Merge pull request #172 from MarcelRaad/illegal_sse4_instruction

Check for SSE4 support before using SSE4.1 instruction
pull/174/head
Jeffrey Walton 2016-05-12 07:17:09 -05:00
commit a96d60e4e8
1 changed files with 2 additions and 2 deletions

View File

@ -217,9 +217,9 @@ void Rijndael::Base::UncheckedSetKey(const byte *userKey, unsigned int keylen, c
word32 *rk = m_key; word32 *rk = m_key;
#if (CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE && (!defined(_MSC_VER) || _MSC_VER >= 1600 || CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32)) #if (CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE && CRYPTOPP_BOOL_SSE4_INTRINSICS_AVAILABLE && (!defined(_MSC_VER) || _MSC_VER >= 1600 || CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32))
// MSVC 2008 SP1 generates bad code for _mm_extract_epi32() when compiling for X64 // MSVC 2008 SP1 generates bad code for _mm_extract_epi32() when compiling for X64
if (HasAESNI()) if (HasAESNI() && HasSSE4())
{ {
static const word32 rcLE[] = { static const word32 rcLE[] = {
0x01, 0x02, 0x04, 0x08, 0x01, 0x02, 0x04, 0x08,