From 34dddf0d11ca91082d6928966b9b2686610ed16e Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Sat, 25 Jan 2025 16:23:41 -0600 Subject: [PATCH] wolfcrypt/src/aes.c: in _AesEcbEncrypt() and _AesEcbDecrypt(), implement missing iteration for AES_encrypt_AARCH64() and AES_decrypt_AARCH64(). --- wolfcrypt/src/aes.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/wolfcrypt/src/aes.c b/wolfcrypt/src/aes.c index ec600cacc9..dbc7ef1257 100644 --- a/wolfcrypt/src/aes.c +++ b/wolfcrypt/src/aes.c @@ -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 @@ -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