Skip to content

Commit 5960a36

Browse files
authored
Merge pull request wolfSSL#9776 from Pushyanth-Infineon/fix_psoc6_sha_includes
Fix missing header includes and conditional compilation issue for PSoC6 port.
2 parents 40bb3e7 + b395eef commit 5960a36

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

wolfcrypt/src/port/cypress/psoc6_crypto.c

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@
3636
#include <stdint.h>
3737
#include <string.h>
3838

39-
#include <wolfssl/wolfcrypt/port/cypress/psoc6_crypto.h>
40-
#include <wolfssl/wolfcrypt/random.h>
4139
#include <wolfssl/wolfcrypt/error-crypt.h>
4240
#include <wolfssl/wolfcrypt/logging.h>
41+
#include <wolfssl/wolfcrypt/port/cypress/psoc6_crypto.h>
42+
#include <wolfssl/wolfcrypt/random.h>
4343

4444
#include "cy_crypto_core_hw_v2.h"
4545
#include "cy_crypto_core_mem.h"
@@ -54,9 +54,20 @@
5454
#include "cy_crypto_common.h"
5555
#include "cy_crypto_core_aes.h"
5656
#include "cy_crypto_core_aes_v2.h"
57-
5857
#endif /* NO_AES */
5958

59+
#ifndef NO_SHA256
60+
#include "wolfssl/wolfcrypt/sha256.h"
61+
#endif
62+
63+
#ifdef WOLFSSL_SHA3
64+
#include "wolfssl/wolfcrypt/sha3.h"
65+
#endif
66+
67+
#if defined(WOLFSSL_SHA512) || defined(WOLFSSL_SHA384)
68+
#include "wolfssl/wolfcrypt/sha512.h"
69+
#endif
70+
6071
#if defined(PSOC6_HASH_SHA3)
6172

6273
/* Number of bits in a byte */
@@ -1102,7 +1113,10 @@ int wc_Psoc6_Aes_SetKey(Aes* aes, const byte* userKey, word32 len,
11021113
/* Store key information in wolfSSL structure */
11031114
aes->keylen = len;
11041115
aes->rounds = len / 4 + 6;
1105-
aes->left = 0;
1116+
1117+
#if defined(WOLFSSL_AES_CFB)
1118+
aes->left = 0;
1119+
#endif
11061120

11071121
XMEMCPY(aes->key, userKey, len);
11081122

0 commit comments

Comments
 (0)