ByteReverseArray → ReverseByteArrayLE

pull/484/merge
Jeffrey Walton 2017-09-18 18:40:19 -04:00
parent 2c18fe8af8
commit 923cf95571
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
2 changed files with 4 additions and 4 deletions

View File

@ -771,7 +771,7 @@ void Rijndael_UncheckedSetKeyRev_AESNI(word32 *key, unsigned int rounds)
typedef __vector unsigned char uint8x16_p8; typedef __vector unsigned char uint8x16_p8;
typedef __vector unsigned long long uint64x2_p8; typedef __vector unsigned long long uint64x2_p8;
void ByteReverseArray(byte src[16]) void ReverseByteArrayLE(byte src[16])
{ {
#if defined(CRYPTOPP_XLC_VERSION) && defined(IS_LITTLE_ENDIAN) #if defined(CRYPTOPP_XLC_VERSION) && defined(IS_LITTLE_ENDIAN)
vec_st(vec_reve(vec_ld(0, src)), 0, src); vec_st(vec_reve(vec_ld(0, src)), 0, src);
@ -854,7 +854,7 @@ static inline uint64x2_p8 Load64x2(int off, const uint8_t src[16])
return (uint64x2_p8)vec_xl_be(off, (uint8_t*)src); return (uint64x2_p8)vec_xl_be(off, (uint8_t*)src);
#else #else
# if defined(IS_LITTLE_ENDIAN) # if defined(IS_LITTLE_ENDIAN)
return Reverse64x2((uint64x2_p8)vec_vsx_ld(off, src)); return (uint64x2_p8)Reverse8x16(vec_vsx_ld(off, src));
# else # else
return (uint64x2_p8)vec_vsx_ld(off, src); return (uint64x2_p8)vec_vsx_ld(off, src);
# endif # endif

View File

@ -251,7 +251,7 @@ extern size_t Rijndael_Dec_AdvancedProcessBlocks_ARMV8(const word32 *subkeys, si
#endif #endif
#if (CRYPTOPP_POWER8_AES_AVAILABLE) #if (CRYPTOPP_POWER8_AES_AVAILABLE)
extern void ByteReverseArray(byte src[16]); extern void ReverseByteArrayLE(byte src[16]);
extern size_t Rijndael_Enc_AdvancedProcessBlocks_POWER8(const word32 *subkeys, size_t rounds, extern size_t Rijndael_Enc_AdvancedProcessBlocks_POWER8(const word32 *subkeys, size_t rounds,
const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags); const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags);
@ -329,7 +329,7 @@ void Rijndael::Base::UncheckedSetKey(const byte *userKey, unsigned int keyLen, c
// reversed on little-endian systems to ensure it loads properly. // reversed on little-endian systems to ensure it loads properly.
byte * ptr = reinterpret_cast<byte*>(rk); byte * ptr = reinterpret_cast<byte*>(rk);
for (unsigned int i=0; i<=m_rounds; i++) for (unsigned int i=0; i<=m_rounds; i++)
ByteReverseArray(ptr+i*16); ReverseByteArrayLE(ptr+i*16);
#endif // IS_LITTLE_ENDIAN #endif // IS_LITTLE_ENDIAN
return; return;