Skip to content

Commit

Permalink
wolfcrypt/src/aes.c: in _AesEcbEncrypt() and _AesEcbDecrypt(), implem…
Browse files Browse the repository at this point in the history
…ent missing iteration for AES_encrypt_AARCH64() and AES_decrypt_AARCH64().
  • Loading branch information
douzzer committed Jan 25, 2025
1 parent 3379328 commit 34dddf0
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions wolfcrypt/src/aes.c
Original file line number Diff line number Diff line change
Expand Up @@ -11847,7 +11847,13 @@ static WARN_UNUSED_RESULT int _AesEcbEncrypt(
#elif defined(__aarch64__) && defined(WOLFSSL_ARMASM) && \
!defined(WOLFSSL_ARMASM_NO_HW_CRYPTO)
if (aes->use_aes_hw_crypto) {
AES_encrypt_AARCH64(in, out, (byte*)aes->key, (int)aes->rounds);
word32 i;

for (i = 0; i < sz; i += WC_AES_BLOCK_SIZE) {
AES_encrypt_AARCH64(in, out, (byte*)aes->key, (int)aes->rounds);
in += WC_AES_BLOCK_SIZE;
out += WC_AES_BLOCK_SIZE;
}
}
else
#endif
Expand Down Expand Up @@ -11905,7 +11911,13 @@ static WARN_UNUSED_RESULT int _AesEcbDecrypt(
#elif defined(__aarch64__) && defined(WOLFSSL_ARMASM) && \
!defined(WOLFSSL_ARMASM_NO_HW_CRYPTO)
if (aes->use_aes_hw_crypto) {
AES_decrypt_AARCH64(in, out, (byte*)aes->key, (int)aes->rounds);
word32 i;

for (i = 0; i < sz; i += WC_AES_BLOCK_SIZE) {
AES_decrypt_AARCH64(in, out, (byte*)aes->key, (int)aes->rounds);
in += WC_AES_BLOCK_SIZE;
out += WC_AES_BLOCK_SIZE;
}
}
else
#endif
Expand Down

0 comments on commit 34dddf0

Please sign in to comment.