diff --git a/gcm.cpp b/gcm.cpp index 09510e83..0ef5fe4e 100644 --- a/gcm.cpp +++ b/gcm.cpp @@ -378,8 +378,8 @@ unsigned int GCM_Base::OptimalDataAlignment() const #ifdef CRYPTOPP_X64_MASM_AVAILABLE extern "C" { -void GCM_AuthenticateBlocks_2K(const byte *data, size_t blocks, word64 *hashBuffer, const word16 *reductionTable); -void GCM_AuthenticateBlocks_64K(const byte *data, size_t blocks, word64 *hashBuffer); +void GCM_AuthenticateBlocks_2K_SSE2(const byte *data, size_t blocks, word64 *hashBuffer, const word16 *reductionTable); +void GCM_AuthenticateBlocks_64K_SSE2(const byte *data, size_t blocks, word64 *hashBuffer); } #endif @@ -550,10 +550,10 @@ size_t GCM_Base::AuthenticateBlocks(const byte *data, size_t len) #ifdef CRYPTOPP_X64_MASM_AVAILABLE case 1: // SSE2 and 2K tables - GCM_AuthenticateBlocks_2K(data, len/16, hashBuffer, s_reductionTable); + GCM_AuthenticateBlocks_2K_SSE2(data, len/16, hashBuffer, s_reductionTable); return len % 16; case 3: // SSE2 and 64K tables - GCM_AuthenticateBlocks_64K(data, len/16, hashBuffer); + GCM_AuthenticateBlocks_64K_SSE2(data, len/16, hashBuffer); return len % 16; #endif @@ -566,7 +566,7 @@ size_t GCM_Base::AuthenticateBlocks(const byte *data, size_t len) INTEL_NOPREFIX #elif defined(CRYPTOPP_GENERATE_X64_MASM) ALIGN 8 - GCM_AuthenticateBlocks_2K PROC FRAME + GCM_AuthenticateBlocks_2K_SSE2 PROC FRAME rex_push_reg rsi push_reg rdi push_reg rbx @@ -734,7 +734,7 @@ size_t GCM_Base::AuthenticateBlocks(const byte *data, size_t len) pop rdi pop rsi ret - GCM_AuthenticateBlocks_2K ENDP + GCM_AuthenticateBlocks_2K_SSE2 ENDP #endif return len%16; @@ -747,7 +747,7 @@ size_t GCM_Base::AuthenticateBlocks(const byte *data, size_t len) INTEL_NOPREFIX #elif defined(CRYPTOPP_GENERATE_X64_MASM) ALIGN 8 - GCM_AuthenticateBlocks_64K PROC FRAME + GCM_AuthenticateBlocks_64K_SSE2 PROC FRAME rex_push_reg rsi push_reg rdi .endprolog @@ -809,7 +809,7 @@ size_t GCM_Base::AuthenticateBlocks(const byte *data, size_t len) pop rdi pop rsi ret - GCM_AuthenticateBlocks_64K ENDP + GCM_AuthenticateBlocks_64K_SSE2 ENDP #endif return len%16; diff --git a/rijndael.cpp b/rijndael.cpp index 3a55f528..bbe81569 100644 --- a/rijndael.cpp +++ b/rijndael.cpp @@ -760,7 +760,7 @@ void Rijndael::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock #if CRYPTOPP_SSE2_ASM_AVAILABLE && !defined(CRYPTOPP_DISABLE_RIJNDAEL_ASM) -CRYPTOPP_NAKED void CRYPTOPP_FASTCALL Rijndael_Enc_AdvancedProcessBlocks(void *locals, const word32 *k) +CRYPTOPP_NAKED void CRYPTOPP_FASTCALL Rijndael_Enc_AdvancedProcessBlocks_SSE2(void *locals, const word32 *k) { CRYPTOPP_UNUSED(locals); CRYPTOPP_UNUSED(k); @@ -1238,7 +1238,7 @@ CRYPTOPP_NAKED void CRYPTOPP_FASTCALL Rijndael_Enc_AdvancedProcessBlocks(void *l #ifdef CRYPTOPP_X64_MASM_AVAILABLE extern "C" { -void Rijndael_Enc_AdvancedProcessBlocks(void *locals, const word32 *k); +void Rijndael_Enc_AdvancedProcessBlocks_SSE2(void *locals, const word32 *k); } #endif @@ -1302,7 +1302,7 @@ size_t Rijndael::Enc::AdvancedProcessBlocks(const byte *inBlocks, const byte *xo int keysToCopy = m_rounds - (flags & BT_InBlockIsCounter ? 3 : 2); locals.keysBegin = (12-keysToCopy)*16; - Rijndael_Enc_AdvancedProcessBlocks(&locals, m_key); + Rijndael_Enc_AdvancedProcessBlocks_SSE2(&locals, m_key); return length % BLOCKSIZE; } diff --git a/x64dll.asm b/x64dll.asm index 0adb5c11..33fa6a17 100644 --- a/x64dll.asm +++ b/x64dll.asm @@ -58,7 +58,7 @@ $1@Baseline_Sub: Baseline_Sub ENDP ALIGN 8 -Rijndael_Enc_AdvancedProcessBlocks PROC FRAME +Rijndael_Enc_AdvancedProcessBlocks_SSE2 PROC FRAME rex_push_reg rsi push_reg rdi push_reg rbx @@ -454,10 +454,10 @@ pop rbx pop rdi pop rsi ret -Rijndael_Enc_AdvancedProcessBlocks ENDP +Rijndael_Enc_AdvancedProcessBlocks_SSE2 ENDP ALIGN 8 -GCM_AuthenticateBlocks_2K PROC FRAME +GCM_AuthenticateBlocks_2K_SSE2 PROC FRAME rex_push_reg rsi push_reg rdi push_reg rbx @@ -593,10 +593,10 @@ pop rbx pop rdi pop rsi ret -GCM_AuthenticateBlocks_2K ENDP +GCM_AuthenticateBlocks_2K_SSE2 ENDP ALIGN 8 -GCM_AuthenticateBlocks_64K PROC FRAME +GCM_AuthenticateBlocks_64K_SSE2 PROC FRAME rex_push_reg rsi push_reg rdi .endprolog @@ -673,7 +673,7 @@ movdqa [rsi], xmm0 pop rdi pop rsi ret -GCM_AuthenticateBlocks_64K ENDP +GCM_AuthenticateBlocks_64K_SSE2 ENDP ALIGN 8 SHA256_HashMultipleBlocks_SSE2 PROC FRAME