diff --git a/aria.cpp b/aria.cpp index 75ae98f1..c9b7c4f0 100644 --- a/aria.cpp +++ b/aria.cpp @@ -7,7 +7,7 @@ #include "misc.h" #include "cpu.h" -#if CRYPTOPP_SSE2_AVAILABLE +#if CRYPTOPP_SSE2_INTRIN_AVAILABLE # define CRYPTOPP_ENABLE_ARIA_SSE2_INTRINSICS 1 #endif diff --git a/blake2-simd.cpp b/blake2-simd.cpp index 1aff1ff8..2b788d4c 100644 --- a/blake2-simd.cpp +++ b/blake2-simd.cpp @@ -37,7 +37,7 @@ 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. // Also see http://stackoverflow.com/a/38547909/608639 -#if CRYPTOPP_SSE2_AVAILABLE && ((__SUNPRO_CC >= 0x5100 && __SUNPRO_CC < 0x5130) || (defined(_MSC_VER) && _MSC_VER < 1600) || (defined(_M_IX86) && _MSC_VER >= 1600)) +#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; diff --git a/config.h b/config.h index e063108f..c88c30a1 100644 --- a/config.h +++ b/config.h @@ -481,7 +481,7 @@ NAMESPACE_END #endif #if !defined(CRYPTOPP_DISABLE_ASM) && (defined(_MSC_VER) || defined(__SSE2__)) - #define CRYPTOPP_SSE2_AVAILABLE 1 + #define CRYPTOPP_SSE2_INTRIN_AVAILABLE 1 #endif #if !defined(CRYPTOPP_DISABLE_ASM) && !defined(CRYPTOPP_DISABLE_SSSE3) @@ -581,7 +581,7 @@ NAMESPACE_END // ***************** Miscellaneous ******************** -#if CRYPTOPP_SSE2_AVAILABLE || CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || CRYPTOPP_ARM_NEON_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE) +#if CRYPTOPP_SSE2_INTRIN_AVAILABLE || CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || CRYPTOPP_ARM_NEON_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE) #define CRYPTOPP_BOOL_ALIGN16 1 #else #define CRYPTOPP_BOOL_ALIGN16 0 diff --git a/cpu.cpp b/cpu.cpp index 3ac1a979..8e41f921 100644 --- a/cpu.cpp +++ b/cpu.cpp @@ -150,7 +150,7 @@ static bool CPU_ProbeSSE2() { #if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE AS2(por xmm0, xmm0) // executing SSE2 instruction -#elif CRYPTOPP_SSE2_AVAILABLE +#elif CRYPTOPP_SSE2_INTRIN_AVAILABLE __m128i x = _mm_setzero_si128(); return _mm_cvtsi128_si32(x) == 0; #endif @@ -182,7 +182,7 @@ static bool CPU_ProbeSSE2() { #if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE __asm __volatile ("por %xmm0, %xmm0"); -#elif CRYPTOPP_SSE2_AVAILABLE +#elif CRYPTOPP_SSE2_INTRIN_AVAILABLE __m128i x = _mm_setzero_si128(); result = _mm_cvtsi128_si32(x) == 0; #endif diff --git a/gcm.cpp b/gcm.cpp index 033e8da9..d9c77df8 100644 --- a/gcm.cpp +++ b/gcm.cpp @@ -32,7 +32,7 @@ NAMESPACE_BEGIN(CryptoPP) -#if (CRYPTOPP_SSE2_AVAILABLE) +#if (CRYPTOPP_SSE2_INTRIN_AVAILABLE) # include "emmintrin.h" #endif @@ -76,14 +76,14 @@ inline static void Xor16(byte *a, const byte *b, const byte *c) ((word64 *)(void *)a)[1] = ((word64 *)(void *)b)[1] ^ ((word64 *)(void *)c)[1]; } -#if CRYPTOPP_SSE2_AVAILABLE || CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE +#if CRYPTOPP_SSE2_INTRIN_AVAILABLE || CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE inline static void GCM_Xor16_SSE2(byte *a, const byte *b, const byte *c) { // SunCC 5.14 crash (bewildering since asserts are not in effect in release builds) // Also see http://github.com/weidai11/cryptopp/issues/226 and http://github.com/weidai11/cryptopp/issues/284 # if __SUNPRO_CC *M128_CAST(a) = _mm_xor_si128(*M128_CAST(b), *M128_CAST(c)); -# elif CRYPTOPP_SSE2_AVAILABLE +# elif CRYPTOPP_SSE2_INTRIN_AVAILABLE CRYPTOPP_ASSERT(IsAlignedOn(a,GetAlignmentOf<__m128i>())); CRYPTOPP_ASSERT(IsAlignedOn(b,GetAlignmentOf<__m128i>())); CRYPTOPP_ASSERT(IsAlignedOn(c,GetAlignmentOf<__m128i>())); @@ -197,7 +197,7 @@ void GCM_Base::SetKeyWithoutResync(const byte *userKey, size_t keylength, const for (i=0; i<16; i++) { memset(mulTable+i*256*16, 0, 16); -#if CRYPTOPP_SSE2_AVAILABLE || CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE +#if CRYPTOPP_SSE2_INTRIN_AVAILABLE || CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE if (HasSSE2()) for (j=2; j<=0x80; j*=2) for (k=1; k