From 6c1ea1d2617926e2d41e333c040760a9b8396e8c Mon Sep 17 00:00:00 2001 From: Mark Atwood Date: Thu, 9 Jul 2026 16:46:54 -0700 Subject: [PATCH] fix: drop redundant XMEMSET before XMSS Init --- src/sign-verify/clu_sign.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/sign-verify/clu_sign.c b/src/sign-verify/clu_sign.c index cfebc878..16c2eb88 100644 --- a/src/sign-verify/clu_sign.c +++ b/src/sign-verify/clu_sign.c @@ -880,8 +880,7 @@ int wolfCLU_sign_data_xmss(byte* data, char* out, int fSz, char* privKey) XmssKey key[1]; #endif - /* init the XMSS key */ - XMEMSET(key, 0, sizeof(XmssKey)); + /* init the XMSS key (wc_XmssKey_Init zeroizes the struct internally) */ ret = wc_XmssKey_Init(key, HEAP_HINT, 0); if (ret != 0) { wolfCLU_LogError("Failed to initialize XMSS Key." @@ -1060,8 +1059,7 @@ int wolfCLU_sign_data_xmssmt(byte* data, char* out, int fSz, char* privKey) XmssKey key[1]; #endif - /* init the xmss key */ - XMEMSET(key, 0, sizeof(XmssKey)); + /* init the xmss key (wc_XmssKey_Init zeroizes the struct internally) */ ret = wc_XmssKey_Init(key, HEAP_HINT, 0); if (ret != 0) { wolfCLU_LogError("Failed to initialize XMSS Key.\nRET: %d", ret);