From 916fe7db267d7b3b8b008029b90b402864297f14 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Sun, 15 Jul 2018 12:59:28 -0400 Subject: [PATCH] Remove unneeded code from Blake2 --- blake2-simd.cpp | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/blake2-simd.cpp b/blake2-simd.cpp index 76e7c153..cff64f26 100644 --- a/blake2-simd.cpp +++ b/blake2-simd.cpp @@ -43,24 +43,11 @@ #define M128_CAST(x) ((__m128i *)(void *)(x)) #define CONST_M128_CAST(x) ((const __m128i *)(const void *)(x)) -NAMESPACE_BEGIN(CryptoPP) - -// Sun Studio 12.3 and earlier lack SSE2's _mm_set_epi64x. Win32 lacks _mm_set_epi64x, -// Win64 supplies it except for VS2008. See http://stackoverflow.com/a/38547909/608639 -#if CRYPTOPP_SSE2_INTRIN_AVAILABLE && ((__SUNPRO_CC >= 0x5100 && __SUNPRO_CC < 0x5130) || \ - (defined(_MSC_VER) && _MSC_VER < 1600) || (defined(_M_IX86) && _MSC_VER >= 1600)) -inline __m128i MM_SET_EPI64X(const word64 a, const word64 b) -{ - const word64 t[2] = {b,a}; __m128i r; - std::memcpy(&r, t, sizeof(t)); - return r; -} -#else -# define MM_SET_EPI64X(a, b) _mm_set_epi64x(a, b) -#endif - ANONYMOUS_NAMESPACE_BEGIN +using CryptoPP::word32; +using CryptoPP::word64; + CRYPTOPP_ALIGN_DATA(16) const word32 BLAKE2S_IV[8] = { 0x6A09E667UL, 0xBB67AE85UL, 0x3C6EF372UL, 0xA54FF53AUL, @@ -77,6 +64,8 @@ const word64 BLAKE2B_IV[8] = { ANONYMOUS_NAMESPACE_END +NAMESPACE_BEGIN(CryptoPP) + #if CRYPTOPP_SSE41_AVAILABLE void BLAKE2_Compress32_SSE4(const byte* input, BLAKE2_State& state) {