move aesni cbc encrypt align check down to crypto layer

This commit is contained in:
toddouska
2013-03-26 14:13:01 -07:00
parent 6bc7ba1592
commit f601b7bfda
4 changed files with 28 additions and 14 deletions
-14
View File
@@ -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