diff options
author | Jeffrey Walton <noloader@gmail.com> | 2017-11-15 20:08:06 -0500 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2017-11-15 20:08:06 -0500 |
commit | e8bed05b7dc8785567801996e0b0b74f6aebf9a3 (patch) | |
tree | ee2e15a59f5530d309b6570097a81ec5ce5759e7 /blake2.cpp | |
parent | a3784a3ac5e5e6eb13b2460d055ebb0fa7bd42de (diff) | |
download | cryptopp-git-e8bed05b7dc8785567801996e0b0b74f6aebf9a3.tar.gz |
Use SSE4.1 instead of SSE4.2 for BLAKE2
BLAKE2 requires SSE4.1, no SSE4.2. This change should have been made when we split SSE4 into .1 and .2, but we needed more OS X and LLVM testing
Diffstat (limited to 'blake2.cpp')
-rw-r--r-- | blake2.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
@@ -14,19 +14,13 @@ NAMESPACE_BEGIN(CryptoPP) // Uncomment for benchmarking C++ against SSE2 or NEON.
// Do so in both blake2.cpp and blake2-simd.cpp.
-// #undef CRYPTOPP_SSE42_AVAILABLE
+// #undef CRYPTOPP_SSE41_AVAILABLE
// #undef CRYPTOPP_ARM_NEON_AVAILABLE
-// Apple Clang 6.0/Clang 3.5 does not have SSSE3 intrinsics
-// http://llvm.org/bugs/show_bug.cgi?id=20213
-#if (defined(CRYPTOPP_APPLE_CLANG_VERSION) && (CRYPTOPP_APPLE_CLANG_VERSION <= 60000)) || (defined(CRYPTOPP_LLVM_CLANG_VERSION) && (CRYPTOPP_LLVM_CLANG_VERSION <= 30500))
-# undef CRYPTOPP_SSE42_AVAILABLE
-#endif
-
void BLAKE2_Compress32_CXX(const byte* input, BLAKE2_State<word32, false>& state);
void BLAKE2_Compress64_CXX(const byte* input, BLAKE2_State<word64, true>& state);
-#if CRYPTOPP_SSE42_AVAILABLE
+#if CRYPTOPP_SSE41_AVAILABLE
extern void BLAKE2_Compress32_SSE4(const byte* input, BLAKE2_State<word32, false>& state);
extern void BLAKE2_Compress64_SSE4(const byte* input, BLAKE2_State<word64, true>& state);
#endif
@@ -95,8 +89,8 @@ typedef void (*pfnCompress64)(const byte*, BLAKE2_State<word64, true>&); pfnCompress64 InitializeCompress64Fn()
{
-#if CRYPTOPP_SSE42_AVAILABLE
- if (HasSSE42())
+#if CRYPTOPP_SSE41_AVAILABLE
+ if (HasSSE41())
return &BLAKE2_Compress64_SSE4;
else
#endif
@@ -110,8 +104,8 @@ pfnCompress64 InitializeCompress64Fn() pfnCompress32 InitializeCompress32Fn()
{
-#if CRYPTOPP_SSE42_AVAILABLE
- if (HasSSE42())
+#if CRYPTOPP_SSE41_AVAILABLE
+ if (HasSSE41())
return &BLAKE2_Compress32_SSE4;
else
#endif
|