diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2017-07-04 02:05:11 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2017-07-04 02:26:24 +0200 |
commit | 89efcdb8cd95ea798187fe4062a73fa5d2fca456 (patch) | |
tree | 5b87e340ffc7fb6ad8a8859750aa388487188f8f /src/Common/Tests.c | |
parent | c2f6190627de27903264258c6ea8ee72199c0c81 (diff) | |
download | VeraCrypt-89efcdb8cd95ea798187fe4062a73fa5d2fca456.tar.gz VeraCrypt-89efcdb8cd95ea798187fe4062a73fa5d2fca456.zip |
Windows Driver: correctly save and restore extended processor state when performing AVX operations on Windows 7 and later. Enhance readability of code handling save/restore of floating point state.
Diffstat (limited to 'src/Common/Tests.c')
-rw-r--r-- | src/Common/Tests.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Common/Tests.c b/src/Common/Tests.c index 8daf9f7d..cf30e4a1 100644 --- a/src/Common/Tests.c +++ b/src/Common/Tests.c @@ -583,8 +583,8 @@ BOOL RunHashTest (HashFunction fn, HashTestVector* vector, BOOL bUseSSE) BOOL bRet = TRUE; #if defined (DEVICE_DRIVER) && !defined (_WIN64) KFLOATING_SAVE floatingPointState; - NTSTATUS saveStatus = STATUS_SUCCESS; - if (bUseSSE && (HasISSE() || HasSSE2())) + NTSTATUS saveStatus = STATUS_INVALID_PARAMETER; + if (bUseSSE) saveStatus = KeSaveFloatingPointState (&floatingPointState); #endif while (vector[i].hexInput && vector[i].hexOutput) @@ -601,7 +601,7 @@ BOOL RunHashTest (HashFunction fn, HashTestVector* vector, BOOL bUseSSE) } #if defined (DEVICE_DRIVER) && !defined (_WIN64) - if (NT_SUCCESS (saveStatus) && bUseSSE && (HasISSE() || HasSSE2())) + if (NT_SUCCESS (saveStatus)) KeRestoreFloatingPointState (&floatingPointState); #endif @@ -1508,7 +1508,7 @@ BOOL test_pkcs5 () return FALSE; /* STREEBOG hash tests */ - if (RunHashTest (StreebogHash, Streebog512TestVectors, TRUE) == FALSE) + if (RunHashTest (StreebogHash, Streebog512TestVectors, (HasSSE2() || HasSSE41())? TRUE : FALSE) == FALSE) return FALSE; /* PKCS-5 test 1 with HMAC-SHA-256 used as the PRF (https://tools.ietf.org/html/draft-josefsson-scrypt-kdf-00) */ |