From e33dd33dff5f209c86f0555311b089f5c55c41c3 Mon Sep 17 00:00:00 2001 From: JacobBarthelmeh Date: Mon, 11 May 2026 16:06:58 -0600 Subject: [PATCH 1/2] fix for CAAM build --- wolfcrypt/src/port/caam/wolfcaam_hash.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wolfcrypt/src/port/caam/wolfcaam_hash.c b/wolfcrypt/src/port/caam/wolfcaam_hash.c index 1fbf9f334f9..0127135f904 100644 --- a/wolfcrypt/src/port/caam/wolfcaam_hash.c +++ b/wolfcrypt/src/port/caam/wolfcaam_hash.c @@ -92,7 +92,7 @@ static int _ShaUpdate(byte* buffer, word32* buffLen, const byte* ctx, if (*buffLen == WC_CAAM_HASH_BLOCK) { /* Set buffer for context */ buf[idx].BufferType = DataBuffer; - buf[idx].TheAddress = (CAAM_ADDRESS)sha->ctx; + buf[idx].TheAddress = (CAAM_ADDRESS)ctx; buf[idx].Length = digestSz + WC_CAAM_CTXLEN; #if defined(__INTEGRITY) || defined(INTEGRITY) buf[idx].Transferred = 0; @@ -101,7 +101,7 @@ static int _ShaUpdate(byte* buffer, word32* buffLen, const byte* ctx, /* data to update with */ buf[idx].BufferType = DataBuffer | LastBuffer; - buf[idx].TheAddress = (CAAM_ADDRESS)sha->buffer; + buf[idx].TheAddress = (CAAM_ADDRESS)buffer; buf[idx].Length = *buffLen; #if defined(__INTEGRITY) || defined(INTEGRITY) buf[idx].Transferred = 0; @@ -127,7 +127,7 @@ static int _ShaUpdate(byte* buffer, word32* buffLen, const byte* ctx, /* Set buffer for context */ buf[idx].BufferType = DataBuffer; - buf[idx].TheAddress = (CAAM_ADDRESS)sha->ctx; + buf[idx].TheAddress = (CAAM_ADDRESS)ctx; buf[idx].Length = digestSz + WC_CAAM_CTXLEN; #if defined(__INTEGRITY) || defined(INTEGRITY) buf[idx].Transferred = 0; @@ -262,7 +262,7 @@ int wc_CAAM_Sha224Hash(wc_Sha224* sha224, const byte* in, word32 inSz, #ifdef WOLFSSL_HASH_KEEP ret = wc_Sha224_Grow(sha224, in, inSz); #else - ret = _ShaUpdate(sha224->buffer, &sha224->bufferLen, + ret = _ShaUpdate((byte*)sha224->buffer, &sha224->buffLen, (byte*)sha224->digest, in, inSz, SHA224_DIGEST_SIZE, CAAM_SHA224); #endif } @@ -278,7 +278,7 @@ int wc_CAAM_Sha224Hash(wc_Sha224* sha224, const byte* in, word32 inSz, wc_InitSha224_ex(sha224, heap, devId); #else ret = _ShaFinal((byte*)sha224->digest, SHA224_DIGEST_SIZE, - (byte*)sha224->buffer, sha224->bufferLen, digest, CAAM_SHA224); + (byte*)sha224->buffer, sha224->buffLen, digest, CAAM_SHA224); #endif } return ret; From 8c552e35b9e76bde9df8e24854ad8be187a7c84b Mon Sep 17 00:00:00 2001 From: JacobBarthelmeh Date: Tue, 12 May 2026 10:02:51 -0600 Subject: [PATCH 2/2] fix for const pointer with internal CAAM function --- wolfcrypt/src/port/caam/wolfcaam_hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wolfcrypt/src/port/caam/wolfcaam_hash.c b/wolfcrypt/src/port/caam/wolfcaam_hash.c index 0127135f904..72d8b85e69d 100644 --- a/wolfcrypt/src/port/caam/wolfcaam_hash.c +++ b/wolfcrypt/src/port/caam/wolfcaam_hash.c @@ -66,7 +66,7 @@ ****************************************************************************/ #ifndef WOLFSSL_HASH_KEEP -static int _ShaUpdate(byte* buffer, word32* buffLen, const byte* ctx, +static int _ShaUpdate(byte* buffer, word32* buffLen, byte* ctx, const byte* data, word32 len, word32 digestSz, word32 type) { CAAM_BUFFER buf[2];