From 6d1981abd1f982e9079145fad74aee53ff0609d5 Mon Sep 17 00:00:00 2001 From: Daniele Lacamera Date: Tue, 8 Jun 2021 08:24:43 +0200 Subject: [PATCH] Do not directly include psoc6 port header to prevent loops --- wolfcrypt/benchmark/benchmark.c | 1 + wolfssl/wolfcrypt/port/cypress/psoc6_crypto.h | 1 + wolfssl/wolfcrypt/sha256.h | 10 +++++++--- wolfssl/wolfcrypt/sha512.h | 5 ++++- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/wolfcrypt/benchmark/benchmark.c b/wolfcrypt/benchmark/benchmark.c index 75069d192..c93836e92 100644 --- a/wolfcrypt/benchmark/benchmark.c +++ b/wolfcrypt/benchmark/benchmark.c @@ -33,6 +33,7 @@ #include #include #include +#include /* Macro to disable benchmark */ #ifndef NO_CRYPT_BENCHMARK diff --git a/wolfssl/wolfcrypt/port/cypress/psoc6_crypto.h b/wolfssl/wolfcrypt/port/cypress/psoc6_crypto.h index 056db0bab..a41ace703 100644 --- a/wolfssl/wolfcrypt/port/cypress/psoc6_crypto.h +++ b/wolfssl/wolfcrypt/port/cypress/psoc6_crypto.h @@ -29,6 +29,7 @@ #include "cy_crypto_common.h" #include "cy_crypto_core.h" + #ifdef WOLFSSL_SHA512 #include #endif diff --git a/wolfssl/wolfcrypt/sha256.h b/wolfssl/wolfcrypt/sha256.h index 01368e932..87744729b 100644 --- a/wolfssl/wolfcrypt/sha256.h +++ b/wolfssl/wolfcrypt/sha256.h @@ -65,6 +65,13 @@ #include "fsl_dcp.h" #endif +#if defined(WOLFSSL_PSOC6_CRYPTO) +#include "cy_crypto_core_sha.h" +#include "cy_device_headers.h" +#include "cy_crypto_common.h" +#include "cy_crypto_core.h" +#endif + #ifdef __cplusplus extern "C" { #endif @@ -94,9 +101,6 @@ #if defined(WOLFSSL_SILABS_SE_ACCEL) #include #endif -#if defined(WOLFSSL_PSOC6_CRYPTO) - #include -#endif #if defined(_MSC_VER) #define SHA256_NOINLINE __declspec(noinline) diff --git a/wolfssl/wolfcrypt/sha512.h b/wolfssl/wolfcrypt/sha512.h index 7026abbb0..620643b3d 100644 --- a/wolfssl/wolfcrypt/sha512.h +++ b/wolfssl/wolfcrypt/sha512.h @@ -80,7 +80,10 @@ #include #endif #if defined(WOLFSSL_PSOC6_CRYPTO) - #include + #include "cy_crypto_core_sha.h" + #include "cy_device_headers.h" + #include "cy_crypto_common.h" + #include "cy_crypto_core.h" #endif #if defined(_MSC_VER)