From 4e1b719236f9a10dce836591bf37d360f752c57a Mon Sep 17 00:00:00 2001 From: David Garske Date: Fri, 14 Nov 2025 09:40:56 -0800 Subject: [PATCH] Improve wc_HmacUpdate to return early if input length == 0. Fixes QAT issue with HKDF test. --- wolfcrypt/src/hmac.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wolfcrypt/src/hmac.c b/wolfcrypt/src/hmac.c index caf7e142a..e7e23387f 100644 --- a/wolfcrypt/src/hmac.c +++ b/wolfcrypt/src/hmac.c @@ -814,6 +814,9 @@ int wc_HmacUpdate(Hmac* hmac, const byte* msg, word32 length) if (hmac == NULL || (msg == NULL && length > 0)) { return BAD_FUNC_ARG; } + if (length == 0) { + return 0; /* nothing to do, return success */ + } #ifdef WOLF_CRYPTO_CB if (hmac->devId != INVALID_DEVID) {