From b395eef455fe78a8a3c0d9553443fad22411d318 Mon Sep 17 00:00:00 2001 From: Pushyanth Kamatham <--global> Date: Tue, 17 Feb 2026 02:26:52 +0530 Subject: [PATCH] Fix missing header includes and conditional compilation issue in PSoC6 crypto hardware acceleration port. Guard the `aes->left = 0` assignment to enable when WOLFSSL_AES_CFB is defined. --- wolfcrypt/src/port/cypress/psoc6_crypto.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/wolfcrypt/src/port/cypress/psoc6_crypto.c b/wolfcrypt/src/port/cypress/psoc6_crypto.c index 90d9ce2082..020620f151 100644 --- a/wolfcrypt/src/port/cypress/psoc6_crypto.c +++ b/wolfcrypt/src/port/cypress/psoc6_crypto.c @@ -36,10 +36,10 @@ #include #include -#include -#include #include #include +#include +#include #include "cy_crypto_core_hw_v2.h" #include "cy_crypto_core_mem.h" @@ -54,9 +54,20 @@ #include "cy_crypto_common.h" #include "cy_crypto_core_aes.h" #include "cy_crypto_core_aes_v2.h" - #endif /* NO_AES */ +#ifndef NO_SHA256 +#include "wolfssl/wolfcrypt/sha256.h" +#endif + +#ifdef WOLFSSL_SHA3 +#include "wolfssl/wolfcrypt/sha3.h" +#endif + +#if defined(WOLFSSL_SHA512) || defined(WOLFSSL_SHA384) +#include "wolfssl/wolfcrypt/sha512.h" +#endif + #if defined(PSOC6_HASH_SHA3) /* Number of bits in a byte */ @@ -1102,7 +1113,10 @@ int wc_Psoc6_Aes_SetKey(Aes* aes, const byte* userKey, word32 len, /* Store key information in wolfSSL structure */ aes->keylen = len; aes->rounds = len / 4 + 6; - aes->left = 0; + +#if defined(WOLFSSL_AES_CFB) + aes->left = 0; +#endif XMEMCPY(aes->key, userKey, len);