From d0f5778429c9a62c0e604c472cbe45975803516a Mon Sep 17 00:00:00 2001 From: JacobBarthelmeh Date: Wed, 23 Oct 2024 15:04:06 -0600 Subject: [PATCH] fix for state of aes.gcm.H on re-use --- wolfcrypt/src/aes.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wolfcrypt/src/aes.c b/wolfcrypt/src/aes.c index acd8c017ce..1cb98431aa 100644 --- a/wolfcrypt/src/aes.c +++ b/wolfcrypt/src/aes.c @@ -8063,6 +8063,8 @@ static void GHASH_FINAL(Aes* aes, byte* s, word32 sSz) GHASH_LEN_BLOCK(aes); /* Copy the result into s. */ XMEMCPY(s, AES_TAG(aes), sSz); + /* reset aes->gcm.H in case of re-use */ + GHASH_INIT_EXTRA(aes); } #endif /* WOLFSSL_AESGCM_STREAM */