Fix SunCC 12.5 failed validation in gcm.cpp (Issue 284)

pull/286/head
Jeffrey Walton 2016-09-18 11:45:12 -04:00
parent 4fb75a8f4d
commit 2d0e388d9a
1 changed files with 7 additions and 3 deletions

View File

@ -94,7 +94,11 @@ __m128i _mm_clmulepi64_si128(const __m128i &a, const __m128i &b, int i)
#if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE || CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE #if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE || CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE
inline static void SSE2_Xor16(byte *a, const byte *b, const byte *c) inline static void SSE2_Xor16(byte *a, const byte *b, const byte *c)
{ {
#if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE && !defined(__SUNPRO_CC) // SunCC 5.14 crash (bewildering since asserts are not in effect in rlease builds)
// Also see http://github.com/weidai11/cryptopp/issues/226
# if __SUNPRO_CC
*(__m128i *)(void *)a = _mm_xor_si128(*(__m128i *)(void *)b, *(__m128i *)(void *)c);
# elif CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE
CRYPTOPP_ASSERT(IsAlignedOn(a,GetAlignmentOf<__m128i>())); CRYPTOPP_ASSERT(IsAlignedOn(a,GetAlignmentOf<__m128i>()));
CRYPTOPP_ASSERT(IsAlignedOn(b,GetAlignmentOf<__m128i>())); CRYPTOPP_ASSERT(IsAlignedOn(b,GetAlignmentOf<__m128i>()));
CRYPTOPP_ASSERT(IsAlignedOn(c,GetAlignmentOf<__m128i>())); CRYPTOPP_ASSERT(IsAlignedOn(c,GetAlignmentOf<__m128i>()));