forked from wolfSSL/wolfssl
Merge pull request #6079 from SparkiDev/aes-ecb-len-aesni
AES ECB/CTR/XTS: enable AES-NI usage
This commit is contained in:
@ -10915,6 +10915,14 @@ static WARN_UNUSED_RESULT int _AesEcbEncrypt(
|
|||||||
#ifdef WOLFSSL_IMXRT_DCP
|
#ifdef WOLFSSL_IMXRT_DCP
|
||||||
if (aes->keylen == 16)
|
if (aes->keylen == 16)
|
||||||
return DCPAesEcbEncrypt(aes, out, in, sz);
|
return DCPAesEcbEncrypt(aes, out, in, sz);
|
||||||
|
#endif
|
||||||
|
#ifdef WOLFSSL_AESNI
|
||||||
|
if (haveAESNI && aes->use_aesni) {
|
||||||
|
SAVE_VECTOR_REGISTERS(return _svr_ret;);
|
||||||
|
AES_ECB_encrypt(in, out, sz, (byte*)aes->key, aes->rounds);
|
||||||
|
RESTORE_VECTOR_REGISTERS();
|
||||||
|
blocks = 0;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
while (blocks > 0) {
|
while (blocks > 0) {
|
||||||
int ret = wc_AesEncryptDirect(aes, out, in);
|
int ret = wc_AesEncryptDirect(aes, out, in);
|
||||||
@ -10943,6 +10951,14 @@ static WARN_UNUSED_RESULT int _AesEcbDecrypt(
|
|||||||
#ifdef WOLFSSL_IMXRT_DCP
|
#ifdef WOLFSSL_IMXRT_DCP
|
||||||
if (aes->keylen == 16)
|
if (aes->keylen == 16)
|
||||||
return DCPAesEcbDecrypt(aes, out, in, sz);
|
return DCPAesEcbDecrypt(aes, out, in, sz);
|
||||||
|
#endif
|
||||||
|
#ifdef WOLFSSL_AESNI
|
||||||
|
if (haveAESNI && aes->use_aesni) {
|
||||||
|
SAVE_VECTOR_REGISTERS(return _svr_ret;);
|
||||||
|
AES_ECB_decrypt(in, out, sz, (byte*)aes->key, aes->rounds);
|
||||||
|
RESTORE_VECTOR_REGISTERS();
|
||||||
|
blocks = 0;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
while (blocks > 0) {
|
while (blocks > 0) {
|
||||||
int ret = wc_AesDecryptDirect(aes, out, in);
|
int ret = wc_AesDecryptDirect(aes, out, in);
|
||||||
|
Reference in New Issue
Block a user