forked from wolfSSL/wolfssl
move aesni cbc encrypt align check down to crypto layer
This commit is contained in:
@@ -3424,20 +3424,6 @@ static INLINE int Encrypt(CYASSL* ssl, byte* out, const byte* input, word32 sz)
|
||||
|
||||
#ifdef BUILD_AES
|
||||
case aes:
|
||||
#ifdef CYASSL_AESNI
|
||||
if ((word)input % 16) {
|
||||
int ret;
|
||||
byte* tmp = (byte*)XMALLOC(sz, ssl->heap,
|
||||
DYNAMIC_TYPE_TMP_BUFFER);
|
||||
if (tmp == NULL) return MEMORY_E;
|
||||
XMEMCPY(tmp, input, sz);
|
||||
ret = AesCbcEncrypt(ssl->encrypt.aes, tmp, tmp, sz);
|
||||
XMEMCPY(out, tmp, sz);
|
||||
XFREE(tmp, ssl->heap, DYNAMIC_TYPE_TMP_BUFFER);
|
||||
return ret;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
return AesCbcEncrypt(ssl->encrypt.aes, out, input, sz);
|
||||
break;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user