mirror of https://github.com/wolfSSL/wolfssl.git
Merge pull request #6079 from SparkiDev/aes-ecb-len-aesni
AES ECB/CTR/XTS: enable AES-NI usagepull/5709/head
commit
c2384674d8
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue