diff options
Diffstat (limited to 'src/Crypto')
-rw-r--r-- | src/Crypto/chacha256.c | 4 | ||||
-rw-r--r-- | src/Crypto/cpu.c | 21 | ||||
-rw-r--r-- | src/Crypto/kuznyechik.c | 6 |
3 files changed, 5 insertions, 26 deletions
diff --git a/src/Crypto/chacha256.c b/src/Crypto/chacha256.c index f32e607b..685f7886 100644 --- a/src/Crypto/chacha256.c +++ b/src/Crypto/chacha256.c @@ -20,7 +20,7 @@ void chacha_ECRYPT_encrypt_bytes(size_t bytes, uint32* x, const unsigned char* m static VC_INLINE void xor_block_512(const unsigned char* in, const unsigned char* prev, unsigned char* out) { -#if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE && !defined(_UEFI) && (!defined (TC_WINDOWS_DRIVER) || (!defined (DEBUG) && defined (_WIN64))) +#if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE && !defined(_UEFI) && (!defined (TC_WINDOWS_DRIVER) || (!defined (DEBUG))) if (HasSSE2()) { __m128i b1 = _mm_loadu_si128((const __m128i*) in); @@ -161,7 +161,7 @@ static VC_INLINE void do_encrypt(const unsigned char* in, size_t len, unsigned c if (len) pos = 0; -#if CRYPTOPP_SSSE3_AVAILABLE && !defined(_UEFI) && (!defined (TC_WINDOWS_DRIVER) || (!defined (DEBUG) && defined (_WIN64))) +#if CRYPTOPP_SSSE3_AVAILABLE && !defined(_UEFI) && (!defined (TC_WINDOWS_DRIVER) || (!defined (DEBUG))) if (HasSSSE3()) { size_t fullblocks = len - len % 64; diff --git a/src/Crypto/cpu.c b/src/Crypto/cpu.c index 30263361..e611e9bb 100644 --- a/src/Crypto/cpu.c +++ b/src/Crypto/cpu.c @@ -140,11 +140,6 @@ static int TrySSE2() return 1; #elif defined(CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY) && !defined(_UEFI) volatile int result = 1; -#if defined (TC_WINDOWS_DRIVER) && !defined (_WIN64) - KFLOATING_SAVE floatingPointState; - if (NT_SUCCESS (KeSaveFloatingPointState (&floatingPointState))) - { -#endif __try { #if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE @@ -158,12 +153,6 @@ static int TrySSE2() { result = 0; } -#if defined (TC_WINDOWS_DRIVER) && !defined (_WIN64) - KeRestoreFloatingPointState (&floatingPointState); - } - else - return 0; -#endif return result; #elif !defined(_UEFI) // longjmp and clobber warnings. Volatile is required. @@ -293,17 +282,7 @@ static int Detect_MS_HyperV_AES () HvProductName[12] = 0; if (_stricmp(HvProductName, "Microsoft Hv") == 0) { -#if defined (TC_WINDOWS_DRIVER) && !defined (_WIN64) - KFLOATING_SAVE floatingPointState; - if (NT_SUCCESS (KeSaveFloatingPointState (&floatingPointState))) - { -#endif hasAesNI = TryAESNI (); - -#if defined (TC_WINDOWS_DRIVER) && !defined (_WIN64) - KeRestoreFloatingPointState (&floatingPointState); - } -#endif } return hasAesNI; diff --git a/src/Crypto/kuznyechik.c b/src/Crypto/kuznyechik.c index fb76142b..1ba38abe 100644 --- a/src/Crypto/kuznyechik.c +++ b/src/Crypto/kuznyechik.c @@ -2201,7 +2201,7 @@ void kuznyechik_decrypt_blocks_simd(uint8* out, const uint8* in, size_t blocks, void kuznyechik_set_key(const uint8* key, kuznyechik_kds* kds) { -#if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE && !defined(_UEFI) && (!defined (TC_WINDOWS_DRIVER) || (!defined (DEBUG) && defined (_WIN64))) +#if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE && !defined(_UEFI) && (!defined (TC_WINDOWS_DRIVER) || (!defined (DEBUG))) if(HasSSE2()) { kuznyechik_set_key_simd (key, kds); @@ -2260,7 +2260,7 @@ void kuznyechik_decrypt_blocks_simd(uint8* out, const uint8* in, size_t blocks, void kuznyechik_encrypt_block(uint8* out, const uint8* in, kuznyechik_kds* kds) { -#if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE && !defined(_UEFI) && (!defined (TC_WINDOWS_DRIVER) || (!defined (DEBUG) && defined (_WIN64))) +#if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE && !defined(_UEFI) && (!defined (TC_WINDOWS_DRIVER) || (!defined (DEBUG))) if(HasSSE2()) { kuznyechik_encrypt_block_simd (out, in, kds); @@ -2327,7 +2327,7 @@ void kuznyechik_decrypt_blocks_simd(uint8* out, const uint8* in, size_t blocks, void kuznyechik_decrypt_block(uint8* out, const uint8* in, kuznyechik_kds* kds) { -#if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE && !defined(_UEFI) && (!defined (TC_WINDOWS_DRIVER) || (!defined (DEBUG) && defined (_WIN64))) +#if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE && !defined(_UEFI) && (!defined (TC_WINDOWS_DRIVER) || (!defined (DEBUG))) if(HasSSE2()) { kuznyechik_decrypt_block_simd (out, in, kds); |