Skip to content

Commit

Permalink
Use consistent suffix for SSE2 ASM
Browse files Browse the repository at this point in the history
  • Loading branch information
noloader committed Aug 20, 2018
1 parent 8c5a558 commit 0177972
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
16 changes: 8 additions & 8 deletions gcm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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;
Expand All @@ -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
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions rijndael.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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;
}
Expand Down
12 changes: 6 additions & 6 deletions x64dll.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0177972

Please sign in to comment.