From fb91f1c1fd5f2b26e1249a978aec7731bc666d18 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Tue, 5 Sep 2023 17:07:08 -0700 Subject: [PATCH] Update the ARM asm files with a missing initialization for SHA2-256 and the AesCtrSetKey function for AES-CTR. --- wolfcrypt/src/port/arm/armv8-aes.c | 6 ++++++ wolfcrypt/src/port/arm/armv8-sha256.c | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/wolfcrypt/src/port/arm/armv8-aes.c b/wolfcrypt/src/port/arm/armv8-aes.c index fa07d4372..fe6ebff9a 100644 --- a/wolfcrypt/src/port/arm/armv8-aes.c +++ b/wolfcrypt/src/port/arm/armv8-aes.c @@ -5719,6 +5719,12 @@ int wc_AesCtrEncrypt(Aes* aes, byte* out, const byte* in, word32 sz) } return 0; } + +int wc_AesCtrSetKey(Aes* aes, const byte* key, word32 len, + const byte* iv, int dir) +{ + return wc_AesSetKey(aes, key, len, iv, AES_ENCRYPTION); +} #endif /* WOLFSSL_AES_COUNTER */ #ifdef HAVE_AESCCM diff --git a/wolfcrypt/src/port/arm/armv8-sha256.c b/wolfcrypt/src/port/arm/armv8-sha256.c index 12a5132fc..28102930b 100644 --- a/wolfcrypt/src/port/arm/armv8-sha256.c +++ b/wolfcrypt/src/port/arm/armv8-sha256.c @@ -85,6 +85,10 @@ static int InitSha256(wc_Sha256* sha256) sha256->loLen = 0; sha256->hiLen = 0; +#ifdef WOLFSSL_HASH_FLAGS + sha256->flags = 0; +#endif + return ret; } @@ -1575,6 +1579,9 @@ int wc_Sha256Transform(wc_Sha256* sha256, const unsigned char* data) sha224->loLen = 0; sha224->hiLen = 0; + #ifdef WOLFSSL_HASH_FLAGS + sha224->flags = 0; + #endif return ret; }