diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2019-04-29 15:28:28 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2019-06-27 06:45:36 +0200 |
commit | d9f22bc61f1434dc6be9affbb59bab3725dc64ce (patch) | |
tree | 0990a43f86353d78c2f32bc936c7daae65f5bd51 /tests | |
parent | bc36db1ebad82ec3da8cc30259bc293093c0aaab (diff) | |
download | gnutls-d9f22bc61f1434dc6be9affbb59bab3725dc64ce.tar.gz |
Align _gnutls_x86_cpuid_s as OPENSSL_ia32cap_P would be
We were not setting the third array member correctly, though
this didn't have any impact to previous implementations as they
did not rely on it. This also moves away from the custom implementation
of cpuid (which was limited), and we now rely on the compiler's
version.
This effectively enables support for SHA_NI.
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/slow/test-ciphers-common.sh | 11 | ||||
-rwxr-xr-x | tests/slow/test-hash-large.sh | 9 |
2 files changed, 19 insertions, 1 deletions
diff --git a/tests/slow/test-ciphers-common.sh b/tests/slow/test-ciphers-common.sh index 52d9d50ea9..1a76b48ce0 100644 --- a/tests/slow/test-ciphers-common.sh +++ b/tests/slow/test-ciphers-common.sh @@ -73,6 +73,17 @@ if test $ret != 0; then exit $ret fi +#SHANI +$(which lscpu)|grep Flags|grep sha_ni >/dev/null +if test $? = 0;then + GNUTLS_CPUID_OVERRIDE=0x20 ${PROG} + ret=$? + if test $ret != 0; then + echo "SHANI cipher tests failed" + exit $ret + fi +fi + GNUTLS_CPUID_OVERRIDE=0x100000 ${PROG} ret=$? if test $ret != 0; then diff --git a/tests/slow/test-hash-large.sh b/tests/slow/test-hash-large.sh index 944eaa5d8d..754232ec2c 100755 --- a/tests/slow/test-hash-large.sh +++ b/tests/slow/test-hash-large.sh @@ -39,21 +39,28 @@ run_test() { fi } +#0x20: SHA_NI #0x4: SSSE3 #0x1: no optimizations #"": default optimizations SSSE3FLAG="" +SHANIFLAG="" which lscpu >/dev/null 2>&1 if test $? = 0;then $(which lscpu)|grep Architecture|grep x86 >/dev/null if test $? = 0;then SSSE3FLAG="0x4" fi + + $(which lscpu)|grep Flags|grep sha_ni >/dev/null + if test $? = 0;then + SHANIFLAG="0x20" + fi fi WAITPID="" -for flags in "" "0x1" ${SSSE3FLAG};do +for flags in "" "0x1" ${SSSE3FLAG} ${SHANIFLAG};do run_test ${flags} & WAITPID="${WAITPID} $!" done |