From ed5d8f8e6b06a41f98e15d5166248ccb56729abd Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Fri, 11 Apr 2025 13:57:23 -0500 Subject: [PATCH] update several files in wolfcrypt/src/port/arm to include libwolfssl_sources.h; update wolfcrypt/src/port/af_alg, wolfcrypt/src/port/devcrypto, and wolfcrypt/src/port/kcapi to include libwolfssl_sources.h; remove a slew of includes across lib sources made redundant by libwolfssl_sources.h. --- src/dtls13.c | 3 --- wolfcrypt/src/aes.c | 3 --- wolfcrypt/src/asn.c | 1 - wolfcrypt/src/chacha.c | 1 - wolfcrypt/src/cmac.c | 1 - wolfcrypt/src/des3.c | 2 -- wolfcrypt/src/dh.c | 2 -- wolfcrypt/src/falcon.c | 1 - wolfcrypt/src/ge_low_mem.c | 1 - wolfcrypt/src/logging.c | 1 - wolfcrypt/src/memory.c | 2 -- wolfcrypt/src/port/af_alg/afalg_aes.c | 10 +--------- wolfcrypt/src/port/af_alg/afalg_hash.c | 9 +-------- wolfcrypt/src/port/af_alg/wc_afalg.c | 8 +------- wolfcrypt/src/port/arm/armv8-aes.c | 10 +--------- wolfcrypt/src/port/arm/armv8-chacha.c | 10 ++-------- wolfcrypt/src/port/arm/armv8-poly1305.c | 13 +++---------- wolfcrypt/src/port/arm/armv8-sha256.c | 9 +-------- wolfcrypt/src/port/arm/armv8-sha512.c | 9 +-------- wolfcrypt/src/port/arm/cryptoCell.c | 8 +------- wolfcrypt/src/port/arm/cryptoCellHash.c | 8 +------- wolfcrypt/src/port/arm/thumb2-chacha.c | 9 +-------- wolfcrypt/src/port/arm/thumb2-poly1305.c | 9 +-------- wolfcrypt/src/port/devcrypto/devcrypto_aes.c | 9 +-------- wolfcrypt/src/port/devcrypto/devcrypto_ecdsa.c | 9 +-------- wolfcrypt/src/port/devcrypto/devcrypto_hash.c | 9 +-------- wolfcrypt/src/port/devcrypto/devcrypto_hmac.c | 9 +-------- wolfcrypt/src/port/devcrypto/devcrypto_rsa.c | 9 +-------- wolfcrypt/src/port/devcrypto/devcrypto_x25519.c | 9 +-------- wolfcrypt/src/port/devcrypto/wc_devcrypto.c | 9 +-------- wolfcrypt/src/port/kcapi/kcapi_aes.c | 12 +----------- wolfcrypt/src/port/kcapi/kcapi_dh.c | 9 +-------- wolfcrypt/src/port/kcapi/kcapi_ecc.c | 9 +-------- wolfcrypt/src/port/kcapi/kcapi_hash.c | 10 ++-------- wolfcrypt/src/port/kcapi/kcapi_hmac.c | 9 +-------- wolfcrypt/src/port/kcapi/kcapi_rsa.c | 9 +-------- wolfcrypt/src/pwdbased.c | 3 --- wolfcrypt/src/random.c | 1 - wolfcrypt/src/rc2.c | 1 - wolfcrypt/src/rsa.c | 1 - wolfcrypt/src/sha.c | 2 -- wolfcrypt/src/sha256.c | 3 --- wolfcrypt/src/sha512.c | 3 --- wolfcrypt/src/sphincs.c | 1 - wolfcrypt/src/wc_mlkem_poly.c | 1 - wolfcrypt/src/wc_port.c | 5 ----- 46 files changed, 29 insertions(+), 243 deletions(-) diff --git a/src/dtls13.c b/src/dtls13.c index 5c351b2fd..cc2c02fa4 100644 --- a/src/dtls13.c +++ b/src/dtls13.c @@ -27,10 +27,7 @@ #include #include #include -#include #include -#include -#include #ifdef NO_INLINE #include diff --git a/wolfcrypt/src/aes.c b/wolfcrypt/src/aes.c index 926e80002..007d77ba7 100644 --- a/wolfcrypt/src/aes.c +++ b/wolfcrypt/src/aes.c @@ -93,8 +93,6 @@ block cipher mechanism that uses n-bit binary string parameter key with 128-bits #include #else -#include - #ifdef NO_INLINE #include #else @@ -348,7 +346,6 @@ block cipher mechanism that uses n-bit binary string parameter key with 128-bits #elif defined(HAVE_COLDFIRE_SEC) /* Freescale Coldfire SEC support for CBC mode. * NOTE: no support for AES-CTR/GCM/CCM/Direct */ - #include #include "sec.h" #include "mcf5475_sec.h" #include "mcf5475_siu.h" diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index 35ab4dd14..8148a2cba 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -106,7 +106,6 @@ ASN Options: * usage. */ -#include #ifndef NO_RSA #include #if defined(WOLFSSL_XILINX_CRYPT) || defined(WOLFSSL_CRYPTOCELL) diff --git a/wolfcrypt/src/chacha.c b/wolfcrypt/src/chacha.c index cef272610..1a1d676c0 100644 --- a/wolfcrypt/src/chacha.c +++ b/wolfcrypt/src/chacha.c @@ -78,7 +78,6 @@ Public domain. /* BEGIN ChaCha C implementation */ #if defined(HAVE_CHACHA) -#include #include #ifdef CHACHA_AEAD_TEST diff --git a/wolfcrypt/src/cmac.c b/wolfcrypt/src/cmac.c index f1a722a9f..b83214cbb 100644 --- a/wolfcrypt/src/cmac.c +++ b/wolfcrypt/src/cmac.c @@ -47,7 +47,6 @@ #include #endif -#include #include #include diff --git a/wolfcrypt/src/des3.c b/wolfcrypt/src/des3.c index 1ccec7bba..7a9ba3bc7 100644 --- a/wolfcrypt/src/des3.c +++ b/wolfcrypt/src/des3.c @@ -440,8 +440,6 @@ #elif defined(HAVE_COLDFIRE_SEC) - #include - #include "sec.h" #include "mcf5475_sec.h" #include "mcf5475_siu.h" diff --git a/wolfcrypt/src/dh.c b/wolfcrypt/src/dh.c index 1d70831fe..8869c0374 100644 --- a/wolfcrypt/src/dh.c +++ b/wolfcrypt/src/dh.c @@ -36,8 +36,6 @@ #endif #include -#include -#include #ifdef WOLFSSL_HAVE_SP_DH #include diff --git a/wolfcrypt/src/falcon.c b/wolfcrypt/src/falcon.c index ec9675ca5..6562a809c 100644 --- a/wolfcrypt/src/falcon.c +++ b/wolfcrypt/src/falcon.c @@ -32,7 +32,6 @@ #endif #include -#include #ifdef NO_INLINE #include #else diff --git a/wolfcrypt/src/ge_low_mem.c b/wolfcrypt/src/ge_low_mem.c index 3ce7edc61..c0a952b55 100644 --- a/wolfcrypt/src/ge_low_mem.c +++ b/wolfcrypt/src/ge_low_mem.c @@ -27,7 +27,6 @@ #ifdef ED25519_SMALL /* use slower code that takes less memory */ #include -#include #ifdef NO_INLINE #include #else diff --git a/wolfcrypt/src/logging.c b/wolfcrypt/src/logging.c index 35617683f..42353f573 100644 --- a/wolfcrypt/src/logging.c +++ b/wolfcrypt/src/logging.c @@ -258,7 +258,6 @@ void WOLFSSL_TIME(int count) /* the requisite linux/kernel.h is included in wc_port.h, with incompatible warnings masked out. */ #elif defined(FUSION_RTOS) #include - #include #define fprintf FCL_FPRINTF #else #include /* for default printf stuff */ diff --git a/wolfcrypt/src/memory.c b/wolfcrypt/src/memory.c index f096414bd..c24d841f8 100644 --- a/wolfcrypt/src/memory.c +++ b/wolfcrypt/src/memory.c @@ -73,8 +73,6 @@ void *z_realloc(void *ptr, size_t size) #ifdef USE_WOLFSSL_MEMORY #include -#include -#include #if defined(WOLFSSL_DEBUG_MEMORY) && defined(WOLFSSL_DEBUG_MEMORY_PRINT) #include diff --git a/wolfcrypt/src/port/af_alg/afalg_aes.c b/wolfcrypt/src/port/af_alg/afalg_aes.c index a521eb6f4..fc7bb2fbc 100644 --- a/wolfcrypt/src/port/af_alg/afalg_aes.c +++ b/wolfcrypt/src/port/af_alg/afalg_aes.c @@ -19,20 +19,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ - - -#ifdef HAVE_CONFIG_H - #include -#endif - -#include -#include +#include #if !defined(NO_AES) && (defined(WOLFSSL_AFALG) || \ defined(WOLFSSL_AFALG_XILINX_AES)) #include -#include #include #include /* for readv */ diff --git a/wolfcrypt/src/port/af_alg/afalg_hash.c b/wolfcrypt/src/port/af_alg/afalg_hash.c index 35ee97368..42f3e7a4e 100644 --- a/wolfcrypt/src/port/af_alg/afalg_hash.c +++ b/wolfcrypt/src/port/af_alg/afalg_hash.c @@ -19,18 +19,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ - -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include #if defined(WOLFSSL_AFALG_HASH) || (defined(WOLFSSL_AFALG_XILINX_SHA3) \ && defined(WOLFSSL_SHA3)) -#include -#include #include #include diff --git a/wolfcrypt/src/port/af_alg/wc_afalg.c b/wolfcrypt/src/port/af_alg/wc_afalg.c index ed71131ff..6aba8a021 100644 --- a/wolfcrypt/src/port/af_alg/wc_afalg.c +++ b/wolfcrypt/src/port/af_alg/wc_afalg.c @@ -19,13 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#include -#include -#include +#include #if defined(WOLFSSL_AFALG) || defined(WOLFSSL_AFALG_XILINX) diff --git a/wolfcrypt/src/port/arm/armv8-aes.c b/wolfcrypt/src/port/arm/armv8-aes.c index ad4785933..13fdaae2b 100644 --- a/wolfcrypt/src/port/arm/armv8-aes.c +++ b/wolfcrypt/src/port/arm/armv8-aes.c @@ -19,20 +19,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#include /* * There are two versions one for 64 (Aarch64) and one for 32 bit (Aarch32). * If changing one check the other. */ - -#ifdef HAVE_CONFIG_H - #include -#endif - -#include -#include - #if !defined(NO_AES) && defined(WOLFSSL_ARMASM) #if FIPS_VERSION3_LT(6,0,0) && defined(HAVE_FIPS) @@ -56,7 +49,6 @@ #endif #include -#include #if FIPS_VERSION3_GE(6,0,0) const unsigned int wolfCrypt_FIPS_aes_ro_sanity[2] = diff --git a/wolfcrypt/src/port/arm/armv8-chacha.c b/wolfcrypt/src/port/arm/armv8-chacha.c index 9836572cc..019b1ee5e 100644 --- a/wolfcrypt/src/port/arm/armv8-chacha.c +++ b/wolfcrypt/src/port/arm/armv8-chacha.c @@ -19,23 +19,17 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#include + /* The paper NEON crypto by Daniel J. Bernstein and Peter Schwabe was used to * optimize for ARM * https://cryptojedi.org/papers/neoncrypto-20120320.pdf */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#include - #if defined(WOLFSSL_ARMASM) #ifdef HAVE_CHACHA #include -#include -#include #include #ifdef NO_INLINE #include diff --git a/wolfcrypt/src/port/arm/armv8-poly1305.c b/wolfcrypt/src/port/arm/armv8-poly1305.c index 9dc30d74a..f2e9e83aa 100644 --- a/wolfcrypt/src/port/arm/armv8-poly1305.c +++ b/wolfcrypt/src/port/arm/armv8-poly1305.c @@ -19,24 +19,17 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#include + /* - * Based off the public domain implementations by Andrew Moon + * Based on the public domain implementations by Andrew Moon * and Daniel J. Bernstein */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#include -#include - #ifdef WOLFSSL_ARMASM #ifdef HAVE_POLY1305 #include -#include -#include #include #ifdef NO_INLINE #include diff --git a/wolfcrypt/src/port/arm/armv8-sha256.c b/wolfcrypt/src/port/arm/armv8-sha256.c index 367b74475..5b1818de8 100644 --- a/wolfcrypt/src/port/arm/armv8-sha256.c +++ b/wolfcrypt/src/port/arm/armv8-sha256.c @@ -19,12 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ - -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include #ifdef WOLFSSL_ARMASM #if !defined(NO_SHA256) || defined(WOLFSSL_SHA224) @@ -47,8 +42,6 @@ return 0; } #endif -#include -#include #include #ifdef NO_INLINE diff --git a/wolfcrypt/src/port/arm/armv8-sha512.c b/wolfcrypt/src/port/arm/armv8-sha512.c index 49d84b439..dfc679df0 100644 --- a/wolfcrypt/src/port/arm/armv8-sha512.c +++ b/wolfcrypt/src/port/arm/armv8-sha512.c @@ -19,11 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include #ifdef WOLFSSL_ARMASM #if defined(WOLFSSL_SHA512) || defined(WOLFSSL_SHA384) @@ -47,12 +43,9 @@ return 0; } #endif -#include #include #include -#include - #ifdef NO_INLINE #include #else diff --git a/wolfcrypt/src/port/arm/cryptoCell.c b/wolfcrypt/src/port/arm/cryptoCell.c index d72241693..c2e191f4c 100644 --- a/wolfcrypt/src/port/arm/cryptoCell.c +++ b/wolfcrypt/src/port/arm/cryptoCell.c @@ -19,11 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include /* This source is included in wc_port.c */ /* WOLFSSL_CRYPTOCELL_C is defined by wc_port.c in case compile tries to @@ -32,8 +28,6 @@ #ifdef WOLFSSL_CRYPTOCELL -#include -#include #include #include diff --git a/wolfcrypt/src/port/arm/cryptoCellHash.c b/wolfcrypt/src/port/arm/cryptoCellHash.c index 6b467941d..2944be9a1 100644 --- a/wolfcrypt/src/port/arm/cryptoCellHash.c +++ b/wolfcrypt/src/port/arm/cryptoCellHash.c @@ -19,11 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include /* This source is included in wc_port.c */ /* WOLFSSL_CRYPTOCELL_HASH_C is defined by wc_port.c in case compile tries @@ -31,8 +27,6 @@ #ifdef WOLFSSL_CRYPTOCELL_HASH_C #if !defined(NO_SHA256) && defined(WOLFSSL_CRYPTOCELL) -#include -#include #include #include diff --git a/wolfcrypt/src/port/arm/thumb2-chacha.c b/wolfcrypt/src/port/arm/thumb2-chacha.c index 58d23203b..21f6b6594 100644 --- a/wolfcrypt/src/port/arm/thumb2-chacha.c +++ b/wolfcrypt/src/port/arm/thumb2-chacha.c @@ -19,19 +19,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ - -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include #if defined(WOLFSSL_ARMASM) && defined(WOLFSSL_ARMASM_THUMB2) #ifdef HAVE_CHACHA #include -#include -#include #include #ifdef NO_INLINE #include diff --git a/wolfcrypt/src/port/arm/thumb2-poly1305.c b/wolfcrypt/src/port/arm/thumb2-poly1305.c index 2fa5d03a0..e473ea445 100644 --- a/wolfcrypt/src/port/arm/thumb2-poly1305.c +++ b/wolfcrypt/src/port/arm/thumb2-poly1305.c @@ -19,20 +19,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#include -#include +#include #ifdef WOLFSSL_ARMASM #ifdef WOLFSSL_ARMASM_THUMB2 #ifdef HAVE_POLY1305 #include -#include -#include #include #ifdef NO_INLINE #include diff --git a/wolfcrypt/src/port/devcrypto/devcrypto_aes.c b/wolfcrypt/src/port/devcrypto/devcrypto_aes.c index 456c8469c..500e8a6f9 100644 --- a/wolfcrypt/src/port/devcrypto/devcrypto_aes.c +++ b/wolfcrypt/src/port/devcrypto/devcrypto_aes.c @@ -19,18 +19,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ - -#ifdef HAVE_CONFIG_H - #include -#endif - -#include -#include +#include #if !defined(NO_AES) && defined(WOLFSSL_DEVCRYPTO) #include -#include #include #ifdef NO_INLINE diff --git a/wolfcrypt/src/port/devcrypto/devcrypto_ecdsa.c b/wolfcrypt/src/port/devcrypto/devcrypto_ecdsa.c index a80bb54e4..bee443bec 100644 --- a/wolfcrypt/src/port/devcrypto/devcrypto_ecdsa.c +++ b/wolfcrypt/src/port/devcrypto/devcrypto_ecdsa.c @@ -19,18 +19,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ - -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include #if defined(WOLFSSL_DEVCRYPTO_ECDSA) -#include #include -#include #include diff --git a/wolfcrypt/src/port/devcrypto/devcrypto_hash.c b/wolfcrypt/src/port/devcrypto/devcrypto_hash.c index 00b3c7870..18a7a6c7c 100644 --- a/wolfcrypt/src/port/devcrypto/devcrypto_hash.c +++ b/wolfcrypt/src/port/devcrypto/devcrypto_hash.c @@ -19,17 +19,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ - -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include #if defined(WOLFSSL_DEVCRYPTO_HASH) -#include -#include #include #if !defined(NO_SHA256) diff --git a/wolfcrypt/src/port/devcrypto/devcrypto_hmac.c b/wolfcrypt/src/port/devcrypto/devcrypto_hmac.c index 67c917353..0c9ae3cbd 100644 --- a/wolfcrypt/src/port/devcrypto/devcrypto_hmac.c +++ b/wolfcrypt/src/port/devcrypto/devcrypto_hmac.c @@ -19,18 +19,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ - -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include #if defined(WOLFSSL_DEVCRYPTO_HMAC) -#include #include -#include #include static int InternalTypeToDevcrypto(int t) diff --git a/wolfcrypt/src/port/devcrypto/devcrypto_rsa.c b/wolfcrypt/src/port/devcrypto/devcrypto_rsa.c index 23eee7136..eb29d9420 100644 --- a/wolfcrypt/src/port/devcrypto/devcrypto_rsa.c +++ b/wolfcrypt/src/port/devcrypto/devcrypto_rsa.c @@ -19,18 +19,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ - -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include #if defined(WOLFSSL_DEVCRYPTO_RSA) -#include #include -#include #include static void wc_SetupRsaPublic(struct crypt_kop* kop, WC_CRYPTODEV* dev, diff --git a/wolfcrypt/src/port/devcrypto/devcrypto_x25519.c b/wolfcrypt/src/port/devcrypto/devcrypto_x25519.c index 0e2215f33..031a73922 100644 --- a/wolfcrypt/src/port/devcrypto/devcrypto_x25519.c +++ b/wolfcrypt/src/port/devcrypto/devcrypto_x25519.c @@ -19,18 +19,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ - -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include #if defined(WOLFSSL_DEVCRYPTO_CURVE25519) -#include #include -#include #include const unsigned char qle[] = { diff --git a/wolfcrypt/src/port/devcrypto/wc_devcrypto.c b/wolfcrypt/src/port/devcrypto/wc_devcrypto.c index e8c747f47..6f1b9042a 100644 --- a/wolfcrypt/src/port/devcrypto/wc_devcrypto.c +++ b/wolfcrypt/src/port/devcrypto/wc_devcrypto.c @@ -19,19 +19,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ - -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include #if defined(WOLFSSL_DEVCRYPTO) static volatile int fd; -#include -#include #include int wc_DevCryptoInit(void) diff --git a/wolfcrypt/src/port/kcapi/kcapi_aes.c b/wolfcrypt/src/port/kcapi/kcapi_aes.c index a674aa6d6..71c74fec1 100644 --- a/wolfcrypt/src/port/kcapi/kcapi_aes.c +++ b/wolfcrypt/src/port/kcapi/kcapi_aes.c @@ -19,16 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ - - -#ifdef HAVE_CONFIG_H - #include -#endif - -#include - -#include -#include +#include #if !defined(NO_AES) && defined(WOLFSSL_KCAPI_AES) @@ -45,7 +36,6 @@ #endif #include -#include #include #ifdef NO_INLINE diff --git a/wolfcrypt/src/port/kcapi/kcapi_dh.c b/wolfcrypt/src/port/kcapi/kcapi_dh.c index 0f584dd96..b596e3327 100644 --- a/wolfcrypt/src/port/kcapi/kcapi_dh.c +++ b/wolfcrypt/src/port/kcapi/kcapi_dh.c @@ -19,17 +19,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ - -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include #if defined(WOLFSSL_KCAPI_DH) && !defined(NO_DH) -#include -#include #include #include #include diff --git a/wolfcrypt/src/port/kcapi/kcapi_ecc.c b/wolfcrypt/src/port/kcapi/kcapi_ecc.c index 9bfc83cb4..a42b27125 100644 --- a/wolfcrypt/src/port/kcapi/kcapi_ecc.c +++ b/wolfcrypt/src/port/kcapi/kcapi_ecc.c @@ -19,17 +19,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ - -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include #if defined(WOLFSSL_KCAPI_ECC) && defined(HAVE_ECC) -#include -#include #include #include #include diff --git a/wolfcrypt/src/port/kcapi/kcapi_hash.c b/wolfcrypt/src/port/kcapi/kcapi_hash.c index 4141116bf..4bd34f86e 100644 --- a/wolfcrypt/src/port/kcapi/kcapi_hash.c +++ b/wolfcrypt/src/port/kcapi/kcapi_hash.c @@ -19,6 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#include + /* * KCAPI hash options: * @@ -26,18 +28,10 @@ * Needed to get the current hash and continue with more data. */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#include - #if defined(WOLFSSL_KCAPI_HASH) #define FIPS_NO_WRAPPERS -#include -#include #include #include diff --git a/wolfcrypt/src/port/kcapi/kcapi_hmac.c b/wolfcrypt/src/port/kcapi/kcapi_hmac.c index 08b828207..d811b46f3 100644 --- a/wolfcrypt/src/port/kcapi/kcapi_hmac.c +++ b/wolfcrypt/src/port/kcapi/kcapi_hmac.c @@ -19,19 +19,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ - -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include #if defined(WOLFSSL_KCAPI_HMAC) && !defined(NO_HMAC) #define FIPS_NO_WRAPPERS -#include -#include #include #include #include diff --git a/wolfcrypt/src/port/kcapi/kcapi_rsa.c b/wolfcrypt/src/port/kcapi/kcapi_rsa.c index caa357097..8fa7d190c 100644 --- a/wolfcrypt/src/port/kcapi/kcapi_rsa.c +++ b/wolfcrypt/src/port/kcapi/kcapi_rsa.c @@ -19,17 +19,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ - -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include #if defined(WOLFSSL_KCAPI_RSA) && !defined(NO_RSA) -#include -#include #include #include #include diff --git a/wolfcrypt/src/pwdbased.c b/wolfcrypt/src/pwdbased.c index ab006a0ca..c60db6ae5 100644 --- a/wolfcrypt/src/pwdbased.c +++ b/wolfcrypt/src/pwdbased.c @@ -46,9 +46,6 @@ #endif #if FIPS_VERSION3_GE(6,0,0) - #ifdef DEBUG_WOLFSSL - #include - #endif const unsigned int wolfCrypt_FIPS_pbkdf_ro_sanity[2] = { 0x1a2b3c4d, 0x00000010 }; int wolfCrypt_FIPS_PBKDF_sanity(void) diff --git a/wolfcrypt/src/random.c b/wolfcrypt/src/random.c index b05156715..42c7964d3 100644 --- a/wolfcrypt/src/random.c +++ b/wolfcrypt/src/random.c @@ -86,7 +86,6 @@ This library contains implementation for the random number generator. #undef _WINSOCKAPI_ /* undefine it for MINGW winsock2.h header file */ #elif defined(HAVE_WNR) #include - #include wolfSSL_Mutex wnr_mutex WOLFSSL_MUTEX_INITIALIZER_CLAUSE(wnr_mutex); /* global netRandom mutex */ int wnr_timeout = 0; /* entropy timeout, milliseconds */ #ifndef WOLFSSL_MUTEX_INITIALIZER diff --git a/wolfcrypt/src/rc2.c b/wolfcrypt/src/rc2.c index 00d417585..33d2bd2d5 100644 --- a/wolfcrypt/src/rc2.c +++ b/wolfcrypt/src/rc2.c @@ -38,7 +38,6 @@ This library provides the interface to the RC2 encryption algorithm (RFC 2268) #endif #include -#include /* Table based on value of PI, defined in RFC 2268 */ static const byte pitable[256] = { diff --git a/wolfcrypt/src/rsa.c b/wolfcrypt/src/rsa.c index 78ec32286..802883444 100644 --- a/wolfcrypt/src/rsa.c +++ b/wolfcrypt/src/rsa.c @@ -91,7 +91,6 @@ RSA Key Size Configuration: #include -#include #ifdef WOLF_CRYPTO_CB #include #endif diff --git a/wolfcrypt/src/sha.c b/wolfcrypt/src/sha.c index 436cf3c70..887541a27 100644 --- a/wolfcrypt/src/sha.c +++ b/wolfcrypt/src/sha.c @@ -40,7 +40,6 @@ #endif #include -#include #include #ifdef WOLF_CRYPTO_CB @@ -103,7 +102,6 @@ #else -#include #ifdef NO_INLINE #include #else diff --git a/wolfcrypt/src/sha256.c b/wolfcrypt/src/sha256.c index 54479c880..5b990a200 100644 --- a/wolfcrypt/src/sha256.c +++ b/wolfcrypt/src/sha256.c @@ -72,7 +72,6 @@ on the specific device platform. #endif #include -#include #include #include @@ -122,8 +121,6 @@ on the specific device platform. /* #include */ #else -#include - #ifdef NO_INLINE #include #else diff --git a/wolfcrypt/src/sha512.c b/wolfcrypt/src/sha512.c index e70141c62..73ef41246 100644 --- a/wolfcrypt/src/sha512.c +++ b/wolfcrypt/src/sha512.c @@ -51,7 +51,6 @@ #endif #include -#include #include #include @@ -68,8 +67,6 @@ #define USE_SLOW_SHA512 #endif -#include - #ifdef NO_INLINE #include #else diff --git a/wolfcrypt/src/sphincs.c b/wolfcrypt/src/sphincs.c index 4cb9b5242..94be4ac03 100644 --- a/wolfcrypt/src/sphincs.c +++ b/wolfcrypt/src/sphincs.c @@ -32,7 +32,6 @@ #endif #include -#include #ifdef NO_INLINE #include #else diff --git a/wolfcrypt/src/wc_mlkem_poly.c b/wolfcrypt/src/wc_mlkem_poly.c index 2c5c59930..e5f4a182f 100644 --- a/wolfcrypt/src/wc_mlkem_poly.c +++ b/wolfcrypt/src/wc_mlkem_poly.c @@ -69,7 +69,6 @@ #include -#include #include #include diff --git a/wolfcrypt/src/wc_port.c b/wolfcrypt/src/wc_port.c index 314e5a65f..37822778f 100644 --- a/wolfcrypt/src/wc_port.c +++ b/wolfcrypt/src/wc_port.c @@ -25,11 +25,6 @@ #include #endif -#include -#include -#include -#include -#include #ifdef HAVE_ECC #include #endif