diff --git a/IDE/ECLIPSE/DEOS/deos_wolfssl/.project b/IDE/ECLIPSE/DEOS/deos_wolfssl/.project index 3e7019fb7..ef0b34a50 100644 --- a/IDE/ECLIPSE/DEOS/deos_wolfssl/.project +++ b/IDE/ECLIPSE/DEOS/deos_wolfssl/.project @@ -609,6 +609,16 @@ 1 WOLFSSL_ROOT/wolfcrypt/src/wolfmath.c + + wolfcrypt/src/wolfssl_sources.h + 1 + WOLFSSL_ROOT/wolfcrypt/src/wolfssl_sources.h + + + wolfcrypt/src/wolfssl_sources_asm.h + 1 + WOLFSSL_ROOT/wolfcrypt/src/wolfssl_sources_asm.h + diff --git a/IDE/XilinxSDK/2019_2/wolfCrypt_example/.project b/IDE/XilinxSDK/2019_2/wolfCrypt_example/.project index 068e630bd..35644d64b 100644 --- a/IDE/XilinxSDK/2019_2/wolfCrypt_example/.project +++ b/IDE/XilinxSDK/2019_2/wolfCrypt_example/.project @@ -705,6 +705,16 @@ 1 PARENT-4-PROJECT_LOC/wolfcrypt/src/wolfmath.c + + src/wolfcrypt/src/wolfssl_sources.h + 1 + PARENT-4-PROJECT_LOC/wolfcrypt/src/wolfssl_sources.h + + + src/wolfcrypt/src/wolfssl_sources_asm.h + 1 + PARENT-4-PROJECT_LOC/wolfcrypt/src/wolfssl_sources_asm.h + src/wolfcrypt/test/README.md 1 diff --git a/IDE/XilinxSDK/2022_1/wolfCrypt_FreeRTOS_example/.project b/IDE/XilinxSDK/2022_1/wolfCrypt_FreeRTOS_example/.project index dc79a4eca..e4b67b6d3 100644 --- a/IDE/XilinxSDK/2022_1/wolfCrypt_FreeRTOS_example/.project +++ b/IDE/XilinxSDK/2022_1/wolfCrypt_FreeRTOS_example/.project @@ -1400,6 +1400,16 @@ 1 PARENT-3-WORKSPACE_LOC/wolfcrypt/src/wolfmath.c + + src/wolfcrypt/src/wolfssl_sources.h + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/wolfssl_sources.h + + + src/wolfcrypt/src/wolfssl_sources_asm.h + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/wolfssl_sources_asm.h + src/wolfcrypt/test/test.c 1 diff --git a/IDE/XilinxSDK/2022_1/wolfCrypt_example/.project b/IDE/XilinxSDK/2022_1/wolfCrypt_example/.project index d4a25e938..7082ac480 100644 --- a/IDE/XilinxSDK/2022_1/wolfCrypt_example/.project +++ b/IDE/XilinxSDK/2022_1/wolfCrypt_example/.project @@ -1400,6 +1400,16 @@ 1 PARENT-3-WORKSPACE_LOC/wolfcrypt/src/wolfmath.c + + src/wolfcrypt/src/wolfssl_sources.h + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/wolfssl_sources.h + + + src/wolfcrypt/src/wolfssl_sources_asm.h + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/wolfssl_sources_asm.h + src/wolfcrypt/test/test.c 1 diff --git a/linuxkm/linuxkm_wc_port.h b/linuxkm/linuxkm_wc_port.h index 67079aa83..9a0ad918b 100644 --- a/linuxkm/linuxkm_wc_port.h +++ b/linuxkm/linuxkm_wc_port.h @@ -855,7 +855,7 @@ /* remove this multifariously conflicting macro, picked up from * Linux arch//include/asm/current.h. */ - #ifndef WOLFSSL_NEED_LINUX_CURRENT + #ifndef WOLFSSL_LINUXKM_NEED_LINUX_CURRENT #undef current #endif diff --git a/linuxkm/module_exports.c.template b/linuxkm/module_exports.c.template index 8d98cd0b5..61af9b46b 100644 --- a/linuxkm/module_exports.c.template +++ b/linuxkm/module_exports.c.template @@ -20,17 +20,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include "../wolfcrypt/src/wolfssl_sources.h" #ifdef HAVE_FIPS #define FIPS_NO_WRAPPERS #endif -#include #ifndef WOLFCRYPT_ONLY #include #include diff --git a/linuxkm/module_hooks.c b/linuxkm/module_hooks.c index 32b1db9a2..2ee89004d 100644 --- a/linuxkm/module_hooks.c +++ b/linuxkm/module_hooks.c @@ -29,14 +29,10 @@ #define FIPS_NO_WRAPPERS -#define WOLFSSL_NEED_LINUX_CURRENT +#define WOLFSSL_LINUXKM_NEED_LINUX_CURRENT -#ifdef HAVE_CONFIG_H - #include -#endif +#include "../wolfcrypt/src/wolfssl_sources.h" -#include -#include #ifdef WOLFCRYPT_ONLY #include #else diff --git a/linuxkm/pie_first.c b/linuxkm/pie_first.c index d0c108c5b..83cd6ef91 100644 --- a/linuxkm/pie_first.c +++ b/linuxkm/pie_first.c @@ -23,12 +23,8 @@ #error pie_first.c must be compiled -fPIE. #endif -#ifdef HAVE_CONFIG_H - #include -#endif +#include "../wolfcrypt/src/wolfssl_sources.h" -#include -#include #include int wolfCrypt_PIE_first_function(void); diff --git a/linuxkm/pie_last.c b/linuxkm/pie_last.c index 87d1cd04b..4d54c488a 100644 --- a/linuxkm/pie_last.c +++ b/linuxkm/pie_last.c @@ -23,12 +23,8 @@ #error pie_last.c must be compiled -fPIE. #endif -#ifdef HAVE_CONFIG_H - #include -#endif +#include "../wolfcrypt/src/wolfssl_sources.h" -#include -#include #include int wolfCrypt_PIE_last_function(void); diff --git a/linuxkm/pie_redirect_table.c b/linuxkm/pie_redirect_table.c index 75433dd32..e314a642d 100644 --- a/linuxkm/pie_redirect_table.c +++ b/linuxkm/pie_redirect_table.c @@ -23,12 +23,8 @@ #error pie_redirect_table.c must be compiled -fPIE. #endif -#ifdef HAVE_CONFIG_H - #include -#endif +#include "../wolfcrypt/src/wolfssl_sources.h" -#include -#include #include /* compiling -fPIE results in references to the GOT or equivalent thereof, which remain after linking diff --git a/src/bio.c b/src/bio.c index 80fa6a183..c4443d8f8 100644 --- a/src/bio.c +++ b/src/bio.c @@ -19,11 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif +#include "../wolfcrypt/src/wolfssl_sources.h" -#include #if defined(OPENSSL_EXTRA) && !defined(_WIN32) && !defined(_GNU_SOURCE) /* turn on GNU extensions for XVASPRINTF with wolfSSL_BIO_printf */ #define _GNU_SOURCE 1 diff --git a/src/conf.c b/src/conf.c index 341385696..9a070487c 100644 --- a/src/conf.c +++ b/src/conf.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 "../wolfcrypt/src/wolfssl_sources.h" #if !defined(WOLFSSL_CONF_INCLUDED) #ifndef WOLFSSL_IGNORE_FILE_WARN diff --git a/src/crl.c b/src/crl.c index 6a03a39d7..36a3c5032 100644 --- a/src/crl.c +++ b/src/crl.c @@ -19,6 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#include "../wolfcrypt/src/wolfssl_sources.h" /* CRL Options: @@ -32,11 +33,6 @@ CRL Options: * Return any errors encountered during loading CRL * from a directory. */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#include #ifndef WOLFCRYPT_ONLY #ifdef HAVE_CRL diff --git a/src/dtls.c b/src/dtls.c index 8c063bd85..fc95dc2fb 100644 --- a/src/dtls.c +++ b/src/dtls.c @@ -19,6 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#include "../wolfcrypt/src/wolfssl_sources.h" + /* * WOLFSSL_DTLS_NO_HVR_ON_RESUME * WOLFSSL_DTLS13_NO_HRR_ON_RESUME @@ -46,12 +48,6 @@ * to explicitly enable this during runtime. */ -#ifdef HAVE_CONFIG_H -#include -#endif - -#include - #ifndef WOLFCRYPT_ONLY #include diff --git a/src/dtls13.c b/src/dtls13.c index a9beec6ca..90a3cef9e 100644 --- a/src/dtls13.c +++ b/src/dtls13.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 "../wolfcrypt/src/wolfssl_sources.h" #ifdef WOLFSSL_DTLS13 diff --git a/src/internal.c b/src/internal.c index ac4f56e72..6705a3399 100644 --- a/src/internal.c +++ b/src/internal.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 "../wolfcrypt/src/wolfssl_sources.h" /* * WOLFSSL_SMALL_CERT_VERIFY: diff --git a/src/keys.c b/src/keys.c index 79560710f..3a5c1a9e3 100644 --- a/src/keys.c +++ b/src/keys.c @@ -22,11 +22,7 @@ /* Name change compatibility layer no longer needs to be included here */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include "../wolfcrypt/src/wolfssl_sources.h" #if !defined(WOLFCRYPT_ONLY) && !defined(NO_TLS) diff --git a/src/ocsp.c b/src/ocsp.c index 8ded866ac..846e0f9c7 100644 --- a/src/ocsp.c +++ b/src/ocsp.c @@ -19,15 +19,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#include "../wolfcrypt/src/wolfssl_sources.h" /* Name change compatibility layer no longer needs to be included here */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#include - /* * WOLFSSL_NO_OCSP_ISSUER_CHAIN_CHECK: * Disable looking for an authorized responder in the verification path of diff --git a/src/pk.c b/src/pk.c index 25fa65824..06afd0c68 100644 --- a/src/pk.c +++ b/src/pk.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 "../wolfcrypt/src/wolfssl_sources.h" #include #ifndef WC_NO_RNG diff --git a/src/quic.c b/src/quic.c index 82b0e3395..282601493 100644 --- a/src/quic.c +++ b/src/quic.c @@ -19,14 +19,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#include "../wolfcrypt/src/wolfssl_sources.h" /* Name change compatibility layer no longer needs to be included here */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#include #ifdef NO_INLINE #include #else diff --git a/src/sniffer.c b/src/sniffer.c index b15067b5a..4d3fa07c8 100644 --- a/src/sniffer.c +++ b/src/sniffer.c @@ -19,14 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ - -#ifdef HAVE_CONFIG_H - #include -#endif - -#include -#include -#include +#include "../wolfcrypt/src/wolfssl_sources.h" #ifdef WOLFSSL_ASYNC_CRYPT #include diff --git a/src/ssl.c b/src/ssl.c index df7e7c9e8..715bd4119 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -19,12 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#include "../wolfcrypt/src/wolfssl_sources.h" -#ifdef HAVE_CONFIG_H - #include -#endif - -#include #if defined(OPENSSL_EXTRA) && !defined(_WIN32) && !defined(_GNU_SOURCE) /* turn on GNU extensions for XISASCII */ #define _GNU_SOURCE 1 diff --git a/src/ssl_asn1.c b/src/ssl_asn1.c index 4973235ba..6435c4aaa 100644 --- a/src/ssl_asn1.c +++ b/src/ssl_asn1.c @@ -19,13 +19,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif +#include "../wolfcrypt/src/wolfssl_sources.h" -#include - - #include +#include #ifndef WC_NO_RNG #include #endif diff --git a/src/ssl_bn.c b/src/ssl_bn.c index 2d0d29d1f..7b760517b 100644 --- a/src/ssl_bn.c +++ b/src/ssl_bn.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 "../wolfcrypt/src/wolfssl_sources.h" #include #ifndef WC_NO_RNG diff --git a/src/ssl_certman.c b/src/ssl_certman.c index f1dd6d00b..0d60d6151 100644 --- a/src/ssl_certman.c +++ b/src/ssl_certman.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 "../wolfcrypt/src/wolfssl_sources.h" #include diff --git a/src/ssl_crypto.c b/src/ssl_crypto.c index 59e4db57f..2c3db21d8 100644 --- a/src/ssl_crypto.c +++ b/src/ssl_crypto.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 "../wolfcrypt/src/wolfssl_sources.h" #ifndef WOLFSSL_SSL_CRYPTO_INCLUDED #ifndef WOLFSSL_IGNORE_FILE_WARN diff --git a/src/ssl_load.c b/src/ssl_load.c index 051464564..f4179a94a 100644 --- a/src/ssl_load.c +++ b/src/ssl_load.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 "../wolfcrypt/src/wolfssl_sources.h" /* * WOLFSSL_SYS_CA_CERTS diff --git a/src/ssl_misc.c b/src/ssl_misc.c index 0d75639c8..11d875bd6 100644 --- a/src/ssl_misc.c +++ b/src/ssl_misc.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 "../wolfcrypt/src/wolfssl_sources.h" #if !defined(WOLFSSL_SSL_MISC_INCLUDED) #ifndef WOLFSSL_IGNORE_FILE_WARN diff --git a/src/ssl_p7p12.c b/src/ssl_p7p12.c index 87d18ff0e..719497dcc 100644 --- a/src/ssl_p7p12.c +++ b/src/ssl_p7p12.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 "../wolfcrypt/src/wolfssl_sources.h" #if defined(OPENSSL_EXTRA) && (defined(HAVE_FIPS) || defined(HAVE_SELFTEST)) #include diff --git a/src/ssl_sess.c b/src/ssl_sess.c index 6101df711..ee6182c3b 100644 --- a/src/ssl_sess.c +++ b/src/ssl_sess.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 "../wolfcrypt/src/wolfssl_sources.h" #if !defined(WOLFSSL_SSL_SESS_INCLUDED) #ifndef WOLFSSL_IGNORE_FILE_WARN diff --git a/src/tls.c b/src/tls.c index 6c9d7643a..228682776 100644 --- a/src/tls.c +++ b/src/tls.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 "../wolfcrypt/src/wolfssl_sources.h" #ifndef WOLFCRYPT_ONLY diff --git a/src/tls13.c b/src/tls13.c index 4406130c9..87aaad99f 100644 --- a/src/tls13.c +++ b/src/tls13.c @@ -19,6 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#include "../wolfcrypt/src/wolfssl_sources.h" /* * BUILD_GCM @@ -88,16 +89,7 @@ * Default behavior is to return a signed 64-bit value. */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#include - #ifdef WOLFSSL_TLS13 -#ifdef HAVE_SESSION_TICKET - #include -#endif #ifndef WOLFCRYPT_ONLY diff --git a/src/wolfio.c b/src/wolfio.c index e63595a55..65793f048 100644 --- a/src/wolfio.c +++ b/src/wolfio.c @@ -24,11 +24,7 @@ #define WOLFSSL_STRERROR_BUFFER_SIZE 256 #endif -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include "../wolfcrypt/src/wolfssl_sources.h" #ifndef WOLFCRYPT_ONLY diff --git a/src/x509.c b/src/x509.c index bd4d09464..ffa2fc368 100644 --- a/src/x509.c +++ b/src/x509.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 "../wolfcrypt/src/wolfssl_sources.h" #if !defined(WOLFSSL_X509_INCLUDED) #ifndef WOLFSSL_IGNORE_FILE_WARN diff --git a/src/x509_str.c b/src/x509_str.c index 0e7c655e4..2553dd6a1 100644 --- a/src/x509_str.c +++ b/src/x509_str.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 "../wolfcrypt/src/wolfssl_sources.h" #if !defined(WOLFSSL_X509_STORE_INCLUDED) #ifndef WOLFSSL_IGNORE_FILE_WARN diff --git a/tests/api/test_aes.c b/tests/api/test_aes.c index 878d721be..181a4cb9d 100644 --- a/tests/api/test_aes.c +++ b/tests/api/test_aes.c @@ -19,14 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#if !defined(WOLFSSL_USER_SETTINGS) && !defined(WOLFSSL_NO_OPTIONS_H) - #include -#endif -#include +#include #ifdef NO_INLINE #include @@ -38,7 +31,6 @@ #include #include #include -#include #include #include diff --git a/tests/api/test_arc4.c b/tests/api/test_arc4.c index 6b32dd904..d1ecb0cf9 100644 --- a/tests/api/test_arc4.c +++ b/tests/api/test_arc4.c @@ -19,14 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#if !defined(WOLFSSL_USER_SETTINGS) && !defined(WOLFSSL_NO_OPTIONS_H) - #include -#endif -#include +#include #ifdef NO_INLINE #include @@ -37,7 +30,6 @@ #include #include -#include #include #include diff --git a/tests/api/test_ascon.c b/tests/api/test_ascon.c index b8bef7a47..354889ec8 100644 --- a/tests/api/test_ascon.c +++ b/tests/api/test_ascon.c @@ -19,14 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#if !defined(WOLFSSL_USER_SETTINGS) && !defined(WOLFSSL_NO_OPTIONS_H) - #include -#endif -#include +#include #ifdef NO_INLINE #include @@ -37,7 +30,6 @@ #include #include -#include #include #ifdef HAVE_ASCON diff --git a/tests/api/test_blake2.c b/tests/api/test_blake2.c index eb5898e13..e2e7b4655 100644 --- a/tests/api/test_blake2.c +++ b/tests/api/test_blake2.c @@ -19,14 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#if !defined(WOLFSSL_USER_SETTINGS) && !defined(WOLFSSL_NO_OPTIONS_H) - #include -#endif -#include +#include #ifdef NO_INLINE #include @@ -37,7 +30,6 @@ #include #include -#include #include #include diff --git a/tests/api/test_camellia.c b/tests/api/test_camellia.c index d09b5fe35..5b2b39527 100644 --- a/tests/api/test_camellia.c +++ b/tests/api/test_camellia.c @@ -19,14 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#if !defined(WOLFSSL_USER_SETTINGS) && !defined(WOLFSSL_NO_OPTIONS_H) - #include -#endif -#include +#include #ifdef NO_INLINE #include @@ -37,7 +30,6 @@ #include #include -#include #include #include diff --git a/tests/api/test_chacha.c b/tests/api/test_chacha.c index f39403bde..ef48e3afc 100644 --- a/tests/api/test_chacha.c +++ b/tests/api/test_chacha.c @@ -19,14 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#if !defined(WOLFSSL_USER_SETTINGS) && !defined(WOLFSSL_NO_OPTIONS_H) - #include -#endif -#include +#include #ifdef NO_INLINE #include @@ -37,7 +30,6 @@ #include #include -#include #include #include diff --git a/tests/api/test_chacha20_poly1305.c b/tests/api/test_chacha20_poly1305.c index ddcc484cc..7001827e3 100644 --- a/tests/api/test_chacha20_poly1305.c +++ b/tests/api/test_chacha20_poly1305.c @@ -19,14 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#if !defined(WOLFSSL_USER_SETTINGS) && !defined(WOLFSSL_NO_OPTIONS_H) - #include -#endif -#include +#include #ifdef NO_INLINE #include @@ -37,7 +30,6 @@ #include #include -#include #include #include diff --git a/tests/api/test_cmac.c b/tests/api/test_cmac.c index 5e829c4ce..b474db9f8 100644 --- a/tests/api/test_cmac.c +++ b/tests/api/test_cmac.c @@ -19,14 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#if !defined(WOLFSSL_USER_SETTINGS) && !defined(WOLFSSL_NO_OPTIONS_H) - #include -#endif -#include +#include #ifdef NO_INLINE #include @@ -37,7 +30,6 @@ #include #include -#include #include #include diff --git a/tests/api/test_curve25519.c b/tests/api/test_curve25519.c index a9a0a5947..ff89638a0 100644 --- a/tests/api/test_curve25519.c +++ b/tests/api/test_curve25519.c @@ -19,14 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#if !defined(WOLFSSL_USER_SETTINGS) && !defined(WOLFSSL_NO_OPTIONS_H) - #include -#endif -#include +#include #ifdef NO_INLINE #include @@ -37,7 +30,6 @@ #include #include -#include #include #include diff --git a/tests/api/test_curve448.c b/tests/api/test_curve448.c index 82b1eb415..0ae3736a8 100644 --- a/tests/api/test_curve448.c +++ b/tests/api/test_curve448.c @@ -19,14 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#if !defined(WOLFSSL_USER_SETTINGS) && !defined(WOLFSSL_NO_OPTIONS_H) - #include -#endif -#include +#include #ifdef NO_INLINE #include @@ -37,7 +30,6 @@ #include #include -#include #include #include diff --git a/tests/api/test_des3.c b/tests/api/test_des3.c index 9b567e6d9..1feb84357 100644 --- a/tests/api/test_des3.c +++ b/tests/api/test_des3.c @@ -19,14 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#if !defined(WOLFSSL_USER_SETTINGS) && !defined(WOLFSSL_NO_OPTIONS_H) - #include -#endif -#include +#include #ifdef NO_INLINE #include @@ -37,7 +30,6 @@ #include #include -#include #include #include diff --git a/tests/api/test_dh.c b/tests/api/test_dh.c index 232422e25..259f0cc2b 100644 --- a/tests/api/test_dh.c +++ b/tests/api/test_dh.c @@ -19,14 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#if !defined(WOLFSSL_USER_SETTINGS) && !defined(WOLFSSL_NO_OPTIONS_H) - #include -#endif -#include +#include #ifdef NO_INLINE #include @@ -37,7 +30,6 @@ #include #include -#include #include #include diff --git a/tests/api/test_dsa.c b/tests/api/test_dsa.c index ed62eab6e..f406f5a5b 100644 --- a/tests/api/test_dsa.c +++ b/tests/api/test_dsa.c @@ -19,14 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#if !defined(WOLFSSL_USER_SETTINGS) && !defined(WOLFSSL_NO_OPTIONS_H) - #include -#endif -#include +#include #ifdef NO_INLINE #include @@ -37,7 +30,6 @@ #include #include -#include #include #include diff --git a/tests/api/test_ecc.c b/tests/api/test_ecc.c index 78fc5559a..984403578 100644 --- a/tests/api/test_ecc.c +++ b/tests/api/test_ecc.c @@ -19,14 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#if !defined(WOLFSSL_USER_SETTINGS) && !defined(WOLFSSL_NO_OPTIONS_H) - #include -#endif -#include +#include #ifdef NO_INLINE #include @@ -38,7 +31,6 @@ #include #include #include -#include #include #include diff --git a/tests/api/test_ed25519.c b/tests/api/test_ed25519.c index 075d376dd..884d4e1ed 100644 --- a/tests/api/test_ed25519.c +++ b/tests/api/test_ed25519.c @@ -19,14 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#if !defined(WOLFSSL_USER_SETTINGS) && !defined(WOLFSSL_NO_OPTIONS_H) - #include -#endif -#include +#include #ifdef NO_INLINE #include @@ -37,7 +30,6 @@ #include #include -#include #include #include diff --git a/tests/api/test_ed448.c b/tests/api/test_ed448.c index 0fdc1ee1f..87ec0e17d 100644 --- a/tests/api/test_ed448.c +++ b/tests/api/test_ed448.c @@ -19,14 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#if !defined(WOLFSSL_USER_SETTINGS) && !defined(WOLFSSL_NO_OPTIONS_H) - #include -#endif -#include +#include #ifdef NO_INLINE #include @@ -37,7 +30,6 @@ #include #include -#include #include #include diff --git a/tests/api/test_evp.c b/tests/api/test_evp.c index def5f19b3..5010f678a 100644 --- a/tests/api/test_evp.c +++ b/tests/api/test_evp.c @@ -19,15 +19,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif +#include -#include -#include #include -#include #include #include diff --git a/tests/api/test_hash.c b/tests/api/test_hash.c index c1927a2be..42003e37d 100644 --- a/tests/api/test_hash.c +++ b/tests/api/test_hash.c @@ -19,14 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#if !defined(WOLFSSL_USER_SETTINGS) && !defined(WOLFSSL_NO_OPTIONS_H) - #include -#endif -#include +#include #ifdef NO_INLINE #include @@ -37,7 +30,6 @@ #include #include -#include #include #include #include diff --git a/tests/api/test_hmac.c b/tests/api/test_hmac.c index a811db233..5551c5293 100644 --- a/tests/api/test_hmac.c +++ b/tests/api/test_hmac.c @@ -19,14 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#if !defined(WOLFSSL_USER_SETTINGS) && !defined(WOLFSSL_NO_OPTIONS_H) - #include -#endif -#include +#include #ifdef NO_INLINE #include @@ -37,7 +30,6 @@ #include #include -#include #include #include diff --git a/tests/api/test_md2.c b/tests/api/test_md2.c index 6dcc4ed2a..309f68e6d 100644 --- a/tests/api/test_md2.c +++ b/tests/api/test_md2.c @@ -19,14 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#if !defined(WOLFSSL_USER_SETTINGS) && !defined(WOLFSSL_NO_OPTIONS_H) - #include -#endif -#include +#include #ifdef NO_INLINE #include @@ -37,7 +30,6 @@ #include #include -#include #include #include #include diff --git a/tests/api/test_md4.c b/tests/api/test_md4.c index 7998047bc..6a868d2e5 100644 --- a/tests/api/test_md4.c +++ b/tests/api/test_md4.c @@ -19,14 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#if !defined(WOLFSSL_USER_SETTINGS) && !defined(WOLFSSL_NO_OPTIONS_H) - #include -#endif -#include +#include #ifdef NO_INLINE #include @@ -37,7 +30,6 @@ #include #include -#include #include #include #include diff --git a/tests/api/test_md5.c b/tests/api/test_md5.c index 11c804548..957248d74 100644 --- a/tests/api/test_md5.c +++ b/tests/api/test_md5.c @@ -19,14 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#if !defined(WOLFSSL_USER_SETTINGS) && !defined(WOLFSSL_NO_OPTIONS_H) - #include -#endif -#include +#include #ifdef NO_INLINE #include @@ -37,7 +30,6 @@ #include #include -#include #include #include #include diff --git a/tests/api/test_mldsa.c b/tests/api/test_mldsa.c index c73709150..2229c5f77 100644 --- a/tests/api/test_mldsa.c +++ b/tests/api/test_mldsa.c @@ -19,14 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#if !defined(WOLFSSL_USER_SETTINGS) && !defined(WOLFSSL_NO_OPTIONS_H) - #include -#endif -#include +#include #ifdef NO_INLINE #include @@ -40,7 +33,6 @@ #include #endif #include -#include #include #include diff --git a/tests/api/test_mlkem.c b/tests/api/test_mlkem.c index a4c2fcd15..4ff92d66b 100644 --- a/tests/api/test_mlkem.c +++ b/tests/api/test_mlkem.c @@ -19,14 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#if !defined(WOLFSSL_USER_SETTINGS) && !defined(WOLFSSL_NO_OPTIONS_H) - #include -#endif -#include +#include #ifdef NO_INLINE #include @@ -42,7 +35,6 @@ #endif #endif #include -#include #include #include diff --git a/tests/api/test_ocsp.c b/tests/api/test_ocsp.c index 4bc1d0410..76cdc977a 100644 --- a/tests/api/test_ocsp.c +++ b/tests/api/test_ocsp.c @@ -19,17 +19,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif -#if !defined(WOLFSSL_USER_SETTINGS) && !defined(WOLFSSL_NO_OPTIONS_H) - #include -#endif -#include +#include #include #include -#include #include #include #include diff --git a/tests/api/test_poly1305.c b/tests/api/test_poly1305.c index 775e7cea7..60e7542ec 100644 --- a/tests/api/test_poly1305.c +++ b/tests/api/test_poly1305.c @@ -19,14 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#if !defined(WOLFSSL_USER_SETTINGS) && !defined(WOLFSSL_NO_OPTIONS_H) - #include -#endif -#include +#include #ifdef NO_INLINE #include @@ -37,7 +30,6 @@ #include #include -#include #include #include diff --git a/tests/api/test_random.c b/tests/api/test_random.c index 3e0fc1204..272ddba33 100644 --- a/tests/api/test_random.c +++ b/tests/api/test_random.c @@ -19,14 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#if !defined(WOLFSSL_USER_SETTINGS) && !defined(WOLFSSL_NO_OPTIONS_H) - #include -#endif -#include +#include #ifdef NO_INLINE #include @@ -37,7 +30,6 @@ #include #include -#include #include #include diff --git a/tests/api/test_rc2.c b/tests/api/test_rc2.c index 108ecc86c..847e7508c 100644 --- a/tests/api/test_rc2.c +++ b/tests/api/test_rc2.c @@ -19,14 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#if !defined(WOLFSSL_USER_SETTINGS) && !defined(WOLFSSL_NO_OPTIONS_H) - #include -#endif -#include +#include #ifdef NO_INLINE #include @@ -37,7 +30,6 @@ #include #include -#include #include #include diff --git a/tests/api/test_ripemd.c b/tests/api/test_ripemd.c index a59cdb599..2125d33e8 100644 --- a/tests/api/test_ripemd.c +++ b/tests/api/test_ripemd.c @@ -19,14 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#if !defined(WOLFSSL_USER_SETTINGS) && !defined(WOLFSSL_NO_OPTIONS_H) - #include -#endif -#include +#include #ifdef NO_INLINE #include @@ -37,7 +30,6 @@ #include #include -#include #include #include #include diff --git a/tests/api/test_rsa.c b/tests/api/test_rsa.c index 0533d8733..068b980b5 100644 --- a/tests/api/test_rsa.c +++ b/tests/api/test_rsa.c @@ -19,14 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#if !defined(WOLFSSL_USER_SETTINGS) && !defined(WOLFSSL_NO_OPTIONS_H) - #include -#endif -#include +#include #ifdef NO_INLINE #include @@ -37,7 +30,6 @@ #include #include -#include #include #include diff --git a/tests/api/test_sha.c b/tests/api/test_sha.c index 4b67f2a30..5c18dab3c 100644 --- a/tests/api/test_sha.c +++ b/tests/api/test_sha.c @@ -19,14 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#if !defined(WOLFSSL_USER_SETTINGS) && !defined(WOLFSSL_NO_OPTIONS_H) - #include -#endif -#include +#include #ifdef NO_INLINE #include @@ -37,7 +30,6 @@ #include #include -#include #include #include #include diff --git a/tests/api/test_sha256.c b/tests/api/test_sha256.c index 634ff222e..83182acb6 100644 --- a/tests/api/test_sha256.c +++ b/tests/api/test_sha256.c @@ -19,14 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#if !defined(WOLFSSL_USER_SETTINGS) && !defined(WOLFSSL_NO_OPTIONS_H) - #include -#endif -#include +#include #ifdef NO_INLINE #include @@ -37,7 +30,6 @@ #include #include -#include #include #include #include diff --git a/tests/api/test_sha3.c b/tests/api/test_sha3.c index dc362a3ae..0e1224004 100644 --- a/tests/api/test_sha3.c +++ b/tests/api/test_sha3.c @@ -19,14 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#if !defined(WOLFSSL_USER_SETTINGS) && !defined(WOLFSSL_NO_OPTIONS_H) - #include -#endif -#include +#include #ifdef NO_INLINE #include @@ -37,7 +30,6 @@ #include #include -#include #include #include #include diff --git a/tests/api/test_sha512.c b/tests/api/test_sha512.c index 7d5753e29..8ef92cbf0 100644 --- a/tests/api/test_sha512.c +++ b/tests/api/test_sha512.c @@ -19,14 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#if !defined(WOLFSSL_USER_SETTINGS) && !defined(WOLFSSL_NO_OPTIONS_H) - #include -#endif -#include +#include #ifdef NO_INLINE #include @@ -37,7 +30,6 @@ #include #include -#include #include #include #include diff --git a/tests/api/test_signature.c b/tests/api/test_signature.c index 1fc17d5b6..f0436b02e 100644 --- a/tests/api/test_signature.c +++ b/tests/api/test_signature.c @@ -19,14 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#if !defined(WOLFSSL_USER_SETTINGS) && !defined(WOLFSSL_NO_OPTIONS_H) - #include -#endif -#include +#include #ifdef NO_INLINE #include @@ -39,7 +32,6 @@ #include #include #include -#include #include #include diff --git a/tests/api/test_sm2.c b/tests/api/test_sm2.c index 414fe144e..d306b5aea 100644 --- a/tests/api/test_sm2.c +++ b/tests/api/test_sm2.c @@ -19,14 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#if !defined(WOLFSSL_USER_SETTINGS) && !defined(WOLFSSL_NO_OPTIONS_H) - #include -#endif -#include +#include #ifdef NO_INLINE #include @@ -37,7 +30,6 @@ #include #include -#include #include #include diff --git a/tests/api/test_sm3.c b/tests/api/test_sm3.c index ccd50d7fc..e4ba656cb 100644 --- a/tests/api/test_sm3.c +++ b/tests/api/test_sm3.c @@ -19,14 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#if !defined(WOLFSSL_USER_SETTINGS) && !defined(WOLFSSL_NO_OPTIONS_H) - #include -#endif -#include +#include #ifdef NO_INLINE #include @@ -37,7 +30,6 @@ #include #include -#include #include #include #include diff --git a/tests/api/test_sm4.c b/tests/api/test_sm4.c index 3d8a30400..aee60b8fd 100644 --- a/tests/api/test_sm4.c +++ b/tests/api/test_sm4.c @@ -19,14 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#if !defined(WOLFSSL_USER_SETTINGS) && !defined(WOLFSSL_NO_OPTIONS_H) - #include -#endif -#include +#include #ifdef NO_INLINE #include @@ -37,7 +30,6 @@ #include #include -#include #include #include diff --git a/tests/api/test_wc_encrypt.c b/tests/api/test_wc_encrypt.c index 1200e9361..4568ba3ac 100644 --- a/tests/api/test_wc_encrypt.c +++ b/tests/api/test_wc_encrypt.c @@ -19,14 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#if !defined(WOLFSSL_USER_SETTINGS) && !defined(WOLFSSL_NO_OPTIONS_H) - #include -#endif -#include +#include #ifdef NO_INLINE #include @@ -37,7 +30,6 @@ #include #include -#include #include #include diff --git a/tests/api/test_wolfmath.c b/tests/api/test_wolfmath.c index 657775c86..1b6c6ec85 100644 --- a/tests/api/test_wolfmath.c +++ b/tests/api/test_wolfmath.c @@ -19,14 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#if !defined(WOLFSSL_USER_SETTINGS) && !defined(WOLFSSL_NO_OPTIONS_H) - #include -#endif -#include +#include #ifdef NO_INLINE #include @@ -37,7 +30,6 @@ #include #include -#include #include #include diff --git a/tests/quic.c b/tests/quic.c index ff8f5b499..355b07f69 100644 --- a/tests/quic.c +++ b/tests/quic.c @@ -19,14 +19,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif -#ifndef WOLFSSL_USER_SETTINGS - #include -#endif -#include - #include #ifdef WOLFSSL_QUIC diff --git a/tests/srp.c b/tests/srp.c index 42c3f59ae..87541be34 100644 --- a/tests/srp.c +++ b/tests/srp.c @@ -19,17 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ - -#ifdef HAVE_CONFIG_H - #include -#endif - -#ifndef WOLFSSL_USER_SETTINGS - #include -#endif -#include - #include + #include #include diff --git a/wolfcrypt/src/aes.c b/wolfcrypt/src/aes.c index bb2c4160c..5cf15e886 100644 --- a/wolfcrypt/src/aes.c +++ b/wolfcrypt/src/aes.c @@ -28,12 +28,8 @@ block cipher mechanism that uses n-bit binary string parameter key with 128-bits 192-bits, and 256-bits of key sizes. */ -#ifdef HAVE_CONFIG_H - #include -#endif -#include -#include +#include "wolfssl_sources.h" #if !defined(NO_AES) diff --git a/wolfcrypt/src/arc4.c b/wolfcrypt/src/arc4.c index 1b0d1ea08..ac2aefb0d 100644 --- a/wolfcrypt/src/arc4.c +++ b/wolfcrypt/src/arc4.c @@ -19,16 +19,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ - -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include "wolfssl_sources.h" #ifndef NO_RC4 -#include #include diff --git a/wolfcrypt/src/ascon.c b/wolfcrypt/src/ascon.c index d5eb451d7..a91391437 100644 --- a/wolfcrypt/src/ascon.c +++ b/wolfcrypt/src/ascon.c @@ -19,17 +19,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include "wolfssl_sources.h" #ifdef HAVE_ASCON #include -#include -#include #ifdef NO_INLINE #include #else diff --git a/wolfcrypt/src/asm.c b/wolfcrypt/src/asm.c index 69f34b562..6a6a9caeb 100644 --- a/wolfcrypt/src/asm.c +++ b/wolfcrypt/src/asm.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 "wolfssl_sources.h" /* * Based on public domain TomsFastMath 0.10 by Tom St Denis, tomstdenis@iahu.ca, diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index d72855ba0..cedf2d68a 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -34,11 +34,8 @@ * Provides routines to convert BER into DER. Replaces indefinite length * encoded items with explicit lengths. */ -#ifdef HAVE_CONFIG_H - #include -#endif -#include +#include "wolfssl_sources.h" /* ASN Options: @@ -128,7 +125,6 @@ ASN Options: #include #include #include -#include #include #include diff --git a/wolfcrypt/src/blake2b.c b/wolfcrypt/src/blake2b.c index fed8eac38..8e2a1a6bc 100644 --- a/wolfcrypt/src/blake2b.c +++ b/wolfcrypt/src/blake2b.c @@ -31,20 +31,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ - - -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include "wolfssl_sources.h" #ifdef HAVE_BLAKE2 #include #include -#include - static const word64 blake2b_IV[8] = { diff --git a/wolfcrypt/src/blake2s.c b/wolfcrypt/src/blake2s.c index e55cf7640..c29a52c53 100644 --- a/wolfcrypt/src/blake2s.c +++ b/wolfcrypt/src/blake2s.c @@ -31,20 +31,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ - - -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include "wolfssl_sources.h" #ifdef HAVE_BLAKE2S #include #include -#include - static const word32 blake2s_IV[8] = { diff --git a/wolfcrypt/src/camellia.c b/wolfcrypt/src/camellia.c index 568743fa5..a2f315717 100644 --- a/wolfcrypt/src/camellia.c +++ b/wolfcrypt/src/camellia.c @@ -52,18 +52,11 @@ * http://info.isl.ntt.co.jp/crypt/eng/camellia/specifications.html */ - -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include "wolfssl_sources.h" #ifdef HAVE_CAMELLIA #include -#include -#include #ifdef NO_INLINE #include #else diff --git a/wolfcrypt/src/chacha.c b/wolfcrypt/src/chacha.c index dce1b2c20..ea4478d6b 100644 --- a/wolfcrypt/src/chacha.c +++ b/wolfcrypt/src/chacha.c @@ -29,15 +29,10 @@ Public domain. */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include "wolfssl_sources.h" #ifdef HAVE_CHACHA #include - #include #ifdef NO_INLINE #include diff --git a/wolfcrypt/src/chacha20_poly1305.c b/wolfcrypt/src/chacha20_poly1305.c index 535fdd977..d3aa121a2 100644 --- a/wolfcrypt/src/chacha20_poly1305.c +++ b/wolfcrypt/src/chacha20_poly1305.c @@ -27,17 +27,11 @@ or Authenticated Encryption with Additional Data (AEAD) algorithm. */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include "wolfssl_sources.h" #if defined(HAVE_CHACHA) && defined(HAVE_POLY1305) #include -#include -#include #ifdef NO_INLINE #include diff --git a/wolfcrypt/src/cmac.c b/wolfcrypt/src/cmac.c index d023e1801..e934a6f5a 100644 --- a/wolfcrypt/src/cmac.c +++ b/wolfcrypt/src/cmac.c @@ -19,12 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#include "wolfssl_sources.h" -#ifdef HAVE_CONFIG_H - #include -#endif - -#include #ifdef WOLFSSL_QNX_CAAM #include #endif diff --git a/wolfcrypt/src/coding.c b/wolfcrypt/src/coding.c index c5c15205d..a8929c5c6 100644 --- a/wolfcrypt/src/coding.c +++ b/wolfcrypt/src/coding.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 "wolfssl_sources.h" #ifndef NO_CODING #include -#include -#include #ifndef NO_ASN #include /* For PEM_LINE_SZ */ #endif diff --git a/wolfcrypt/src/compress.c b/wolfcrypt/src/compress.c index 77904adbd..64f1b7da8 100644 --- a/wolfcrypt/src/compress.c +++ b/wolfcrypt/src/compress.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 "wolfssl_sources.h" #ifdef HAVE_LIBZ #include -#include -#include #ifdef NO_INLINE #include #else diff --git a/wolfcrypt/src/cpuid.c b/wolfcrypt/src/cpuid.c index e8debad16..c1eae7b76 100644 --- a/wolfcrypt/src/cpuid.c +++ b/wolfcrypt/src/cpuid.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 "wolfssl_sources.h" #include diff --git a/wolfcrypt/src/cryptocb.c b/wolfcrypt/src/cryptocb.c index ee429d5b0..349a7b04d 100644 --- a/wolfcrypt/src/cryptocb.c +++ b/wolfcrypt/src/cryptocb.c @@ -36,17 +36,11 @@ * DEBUG_CRYPTOCB */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include "wolfssl_sources.h" #ifdef WOLF_CRYPTO_CB #include -#include -#include #ifdef HAVE_ARIA #include diff --git a/wolfcrypt/src/curve25519.c b/wolfcrypt/src/curve25519.c index f2f2a4352..d619366f3 100644 --- a/wolfcrypt/src/curve25519.c +++ b/wolfcrypt/src/curve25519.c @@ -22,17 +22,11 @@ /* Based On Daniel J Bernstein's curve25519 Public Domain ref10 work. */ - -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include "wolfssl_sources.h" #ifdef HAVE_CURVE25519 #include -#include #ifdef NO_INLINE #include #else diff --git a/wolfcrypt/src/curve448.c b/wolfcrypt/src/curve448.c index a3e4dc2ed..fe364ee10 100644 --- a/wolfcrypt/src/curve448.c +++ b/wolfcrypt/src/curve448.c @@ -25,16 +25,11 @@ * Reworked for curve448 by Sean Parkinson. */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include "wolfssl_sources.h" #ifdef HAVE_CURVE448 #include -#include #ifdef NO_INLINE #include #else diff --git a/wolfcrypt/src/des3.c b/wolfcrypt/src/des3.c index 255ea625d..3a2fdb4ed 100644 --- a/wolfcrypt/src/des3.c +++ b/wolfcrypt/src/des3.c @@ -19,15 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ - -#ifdef HAVE_CONFIG_H - #include -#endif - -#include -#include -#include - +#include "wolfssl_sources.h" #ifndef NO_DES3 diff --git a/wolfcrypt/src/dh.c b/wolfcrypt/src/dh.c index 69a71a514..64c203a60 100644 --- a/wolfcrypt/src/dh.c +++ b/wolfcrypt/src/dh.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 "wolfssl_sources.h" #ifndef NO_DH diff --git a/wolfcrypt/src/dilithium.c b/wolfcrypt/src/dilithium.c index 5409df5dc..72587da7b 100644 --- a/wolfcrypt/src/dilithium.c +++ b/wolfcrypt/src/dilithium.c @@ -130,13 +130,7 @@ * shift equivalent. */ - -#ifdef HAVE_CONFIG_H - #include -#endif - -/* in case user set HAVE_PQC there */ -#include +#include "wolfssl_sources.h" #ifndef WOLFSSL_DILITHIUM_NO_ASN1 #include @@ -151,7 +145,6 @@ #include #include #include -#include #ifdef NO_INLINE #include #else diff --git a/wolfcrypt/src/dsa.c b/wolfcrypt/src/dsa.c index bcd31c2a7..317c240ac 100644 --- a/wolfcrypt/src/dsa.c +++ b/wolfcrypt/src/dsa.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 "wolfssl_sources.h" #ifndef NO_DSA #include #include -#include -#include #include #include diff --git a/wolfcrypt/src/ecc.c b/wolfcrypt/src/ecc.c index 64849d624..55959afc3 100644 --- a/wolfcrypt/src/ecc.c +++ b/wolfcrypt/src/ecc.c @@ -19,14 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ - - -#ifdef HAVE_CONFIG_H - #include -#endif - -/* in case user set HAVE_ECC there */ -#include +#include "wolfssl_sources.h" #ifdef WOLFSSL_ECC_NO_SMALL_STACK #undef WOLFSSL_SMALL_STACK @@ -161,9 +154,6 @@ ECC Curve Sizes: #include #include -#include -#include -#include #ifdef WOLFSSL_HAVE_SP_ECC #include diff --git a/wolfcrypt/src/eccsi.c b/wolfcrypt/src/eccsi.c index 562dedc8b..ade8a6c0f 100644 --- a/wolfcrypt/src/eccsi.c +++ b/wolfcrypt/src/eccsi.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 "wolfssl_sources.h" #ifdef NO_INLINE #include @@ -36,7 +30,6 @@ #ifdef WOLFCRYPT_HAVE_ECCSI -#include #include #include #ifdef WOLFSSL_HAVE_SP_ECC diff --git a/wolfcrypt/src/ed25519.c b/wolfcrypt/src/ed25519.c index eb2b02f3b..a015c9d09 100644 --- a/wolfcrypt/src/ed25519.c +++ b/wolfcrypt/src/ed25519.c @@ -28,12 +28,7 @@ * Check that the private key didn't change during the signing operations. */ -#ifdef HAVE_CONFIG_H - #include -#endif - -/* in case user set HAVE_ED25519 there */ -#include +#include "wolfssl_sources.h" #ifdef HAVE_ED25519 #if FIPS_VERSION3_GE(6,0,0) @@ -48,8 +43,6 @@ #include #include -#include -#include #include #ifdef NO_INLINE #include diff --git a/wolfcrypt/src/ed448.c b/wolfcrypt/src/ed448.c index 0ef1757d9..b8c019153 100644 --- a/wolfcrypt/src/ed448.c +++ b/wolfcrypt/src/ed448.c @@ -30,12 +30,7 @@ * Check that the private key didn't change during the signing operations. */ -#ifdef HAVE_CONFIG_H - #include -#endif - -/* in case user set HAVE_ED448 there */ -#include +#include "wolfssl_sources.h" #ifdef HAVE_ED448 #if FIPS_VERSION3_GE(6,0,0) @@ -49,7 +44,6 @@ #endif #include -#include #include #ifdef NO_INLINE #include diff --git a/wolfcrypt/src/error.c b/wolfcrypt/src/error.c index b2a43803d..e53b3e5de 100644 --- a/wolfcrypt/src/error.c +++ b/wolfcrypt/src/error.c @@ -19,14 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ - -#ifdef HAVE_CONFIG_H - #include -#endif - -#include - -#include +#include "wolfssl_sources.h" #ifdef _MSC_VER /* 4996 warning to use MS extensions e.g., strcpy_s instead of XSTRNCPY */ diff --git a/wolfcrypt/src/evp.c b/wolfcrypt/src/evp.c index 79547e0b1..4956e0d8e 100644 --- a/wolfcrypt/src/evp.c +++ b/wolfcrypt/src/evp.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 "wolfssl_sources.h" #if !defined(WOLFSSL_EVP_INCLUDED) #ifndef WOLFSSL_IGNORE_FILE_WARN diff --git a/wolfcrypt/src/ext_lms.c b/wolfcrypt/src/ext_lms.c index b9f00d5bc..da49efb65 100644 --- a/wolfcrypt/src/ext_lms.c +++ b/wolfcrypt/src/ext_lms.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 "wolfssl_sources.h" #if defined(WOLFSSL_HAVE_LMS) && defined(HAVE_LIBLMS) diff --git a/wolfcrypt/src/ext_mlkem.c b/wolfcrypt/src/ext_mlkem.c index 7b5a209d7..748d4a8a8 100644 --- a/wolfcrypt/src/ext_mlkem.c +++ b/wolfcrypt/src/ext_mlkem.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 "wolfssl_sources.h" #if defined(WOLFSSL_HAVE_MLKEM) && !defined(WOLFSSL_WC_MLKEM) #include diff --git a/wolfcrypt/src/ext_xmss.c b/wolfcrypt/src/ext_xmss.c index 31293a162..51337f14e 100644 --- a/wolfcrypt/src/ext_xmss.c +++ b/wolfcrypt/src/ext_xmss.c @@ -19,13 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif +#include "wolfssl_sources.h" -#include -#include -#include #include #if defined(WOLFSSL_HAVE_XMSS) && defined(HAVE_LIBXMSS) diff --git a/wolfcrypt/src/falcon.c b/wolfcrypt/src/falcon.c index c19bb01e6..03fe0caf6 100644 --- a/wolfcrypt/src/falcon.c +++ b/wolfcrypt/src/falcon.c @@ -19,19 +19,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#include "wolfssl_sources.h" + /* Based on ed448.c and Reworked for Falcon by Anthony Hu. */ -#ifdef HAVE_CONFIG_H - #include -#endif - -/* in case user set HAVE_PQC there */ -#include +#if defined(HAVE_PQC) && defined(HAVE_FALCON) #include -#if defined(HAVE_PQC) && defined(HAVE_FALCON) - #ifdef HAVE_LIBOQS #include #endif diff --git a/wolfcrypt/src/fe_448.c b/wolfcrypt/src/fe_448.c index d375735e2..ae55035ca 100644 --- a/wolfcrypt/src/fe_448.c +++ b/wolfcrypt/src/fe_448.c @@ -24,11 +24,7 @@ * Reworked for curve448 by Sean Parkinson. */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include "wolfssl_sources.h" #if defined(HAVE_CURVE448) || defined(HAVE_ED448) diff --git a/wolfcrypt/src/fe_low_mem.c b/wolfcrypt/src/fe_low_mem.c index 473cc70d9..9c06e0c26 100644 --- a/wolfcrypt/src/fe_low_mem.c +++ b/wolfcrypt/src/fe_low_mem.c @@ -19,15 +19,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#include "wolfssl_sources.h" /* Based from Daniel Beer's public domain work. */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#include - #if defined(HAVE_CURVE25519) || defined(HAVE_ED25519) #if defined(CURVE25519_SMALL) || defined(ED25519_SMALL) /* use slower code that takes less memory */ diff --git a/wolfcrypt/src/fe_operations.c b/wolfcrypt/src/fe_operations.c index e129618a7..e4e1dbcae 100644 --- a/wolfcrypt/src/fe_operations.c +++ b/wolfcrypt/src/fe_operations.c @@ -19,15 +19,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#include "wolfssl_sources.h" /* Based On Daniel J Bernstein's curve25519 Public Domain ref10 work. */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#include - #if defined(HAVE_CURVE25519) || defined(HAVE_ED25519) #if !defined(CURVE25519_SMALL) || !defined(ED25519_SMALL) /* run when not defined to use small memory math */ diff --git a/wolfcrypt/src/ge_448.c b/wolfcrypt/src/ge_448.c index e36f1e1ee..95d4cf9ba 100644 --- a/wolfcrypt/src/ge_448.c +++ b/wolfcrypt/src/ge_448.c @@ -24,17 +24,12 @@ * Reworked for ed448 by Sean Parkinson. */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include "wolfssl_sources.h" #ifdef HAVE_ED448 #include #include -#include #ifdef NO_INLINE #include #else diff --git a/wolfcrypt/src/ge_low_mem.c b/wolfcrypt/src/ge_low_mem.c index f36c1c5b2..9e26ef29b 100644 --- a/wolfcrypt/src/ge_low_mem.c +++ b/wolfcrypt/src/ge_low_mem.c @@ -19,15 +19,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#include "wolfssl_sources.h" /* Based from Daniel Beer's public domain work. */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#include - #ifdef HAVE_ED25519 #ifdef ED25519_SMALL /* use slower code that takes less memory */ diff --git a/wolfcrypt/src/ge_operations.c b/wolfcrypt/src/ge_operations.c index 3f7f01b3e..35f584e2b 100644 --- a/wolfcrypt/src/ge_operations.c +++ b/wolfcrypt/src/ge_operations.c @@ -22,19 +22,13 @@ /* Based On Daniel J Bernstein's ed25519 Public Domain ref10 work. */ - -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include "wolfssl_sources.h" #ifdef HAVE_ED25519 #ifndef ED25519_SMALL /* run when not defined to use small memory math */ #include #include -#include #ifdef NO_INLINE #include #else diff --git a/wolfcrypt/src/hash.c b/wolfcrypt/src/hash.c index 93964e879..3441a9519 100644 --- a/wolfcrypt/src/hash.c +++ b/wolfcrypt/src/hash.c @@ -19,14 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#include "wolfssl_sources.h" -#ifdef HAVE_CONFIG_H - #include -#endif - -#include -#include -#include #ifndef NO_ASN #include #endif diff --git a/wolfcrypt/src/hmac.c b/wolfcrypt/src/hmac.c index 9a7b82384..2e310ecfe 100644 --- a/wolfcrypt/src/hmac.c +++ b/wolfcrypt/src/hmac.c @@ -20,14 +20,7 @@ */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#include -#include -#include -#include +#include "wolfssl_sources.h" #ifndef NO_HMAC diff --git a/wolfcrypt/src/hpke.c b/wolfcrypt/src/hpke.c index cef2ab83d..a1c2310b6 100644 --- a/wolfcrypt/src/hpke.c +++ b/wolfcrypt/src/hpke.c @@ -23,16 +23,11 @@ * TODO: Add X448 and ChaCha20 */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include "wolfssl_sources.h" #if defined(HAVE_HPKE) && (defined(HAVE_ECC) || defined(HAVE_CURVE25519)) && \ defined(HAVE_AESGCM) -#include #include #include #include diff --git a/wolfcrypt/src/include.am b/wolfcrypt/src/include.am index 872dffd0f..10883cc7d 100644 --- a/wolfcrypt/src/include.am +++ b/wolfcrypt/src/include.am @@ -55,7 +55,9 @@ EXTRA_DIST += \ wolfcrypt/src/fp_sqr_comba_8.i \ wolfcrypt/src/fp_sqr_comba_9.i \ wolfcrypt/src/fp_sqr_comba_small_set.i \ - wolfcrypt/src/fe_x25519_128.h + wolfcrypt/src/fe_x25519_128.h \ + wolfcrypt/src/wolfssl_sources_asm.h \ + wolfcrypt/src/wolfssl_sources.h EXTRA_DIST += wolfcrypt/src/port/ti/ti-aes.c \ wolfcrypt/src/port/ti/ti-des3.c \ diff --git a/wolfcrypt/src/integer.c b/wolfcrypt/src/integer.c index 8ecabf552..896fb763c 100644 --- a/wolfcrypt/src/integer.c +++ b/wolfcrypt/src/integer.c @@ -19,21 +19,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ - +#include "wolfssl_sources.h" /* * Based on public domain LibTomMath 0.38 by Tom St Denis, tomstdenis@iahu.ca, * http://math.libtomcrypt.com */ - -#ifdef HAVE_CONFIG_H - #include -#endif - -/* in case user set USE_FAST_MATH there */ -#include - #ifndef NO_BIG_INT #if !defined(USE_FAST_MATH) && defined(USE_INTEGER_HEAP_MATH) diff --git a/wolfcrypt/src/kdf.c b/wolfcrypt/src/kdf.c index e9442187d..04adcfa88 100644 --- a/wolfcrypt/src/kdf.c +++ b/wolfcrypt/src/kdf.c @@ -19,15 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ - -#ifdef HAVE_CONFIG_H - #include -#endif - -#include -#include -#include -#include +#include "wolfssl_sources.h" #ifndef NO_KDF diff --git a/wolfcrypt/src/logging.c b/wolfcrypt/src/logging.c index f64ec177a..13ecf4e75 100644 --- a/wolfcrypt/src/logging.c +++ b/wolfcrypt/src/logging.c @@ -19,15 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#include "wolfssl_sources.h" -#ifdef HAVE_CONFIG_H - #include -#endif - -#include - -#include -#include #if defined(OPENSSL_EXTRA) && !defined(WOLFCRYPT_ONLY) /* avoid adding WANT_READ and WANT_WRITE to error queue */ #include diff --git a/wolfcrypt/src/md2.c b/wolfcrypt/src/md2.c index e7de96c67..d317da6ff 100644 --- a/wolfcrypt/src/md2.c +++ b/wolfcrypt/src/md2.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 "wolfssl_sources.h" #ifdef WOLFSSL_MD2 #include -#include #ifdef NO_INLINE #include diff --git a/wolfcrypt/src/md4.c b/wolfcrypt/src/md4.c index 754b0e966..37f42796c 100644 --- a/wolfcrypt/src/md4.c +++ b/wolfcrypt/src/md4.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 "wolfssl_sources.h" #ifndef NO_MD4 diff --git a/wolfcrypt/src/md5.c b/wolfcrypt/src/md5.c index 0f4533e57..ef9679687 100644 --- a/wolfcrypt/src/md5.c +++ b/wolfcrypt/src/md5.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 "wolfssl_sources.h" #if !defined(NO_MD5) @@ -35,8 +29,6 @@ #else #include -#include -#include #include #ifdef NO_INLINE diff --git a/wolfcrypt/src/memory.c b/wolfcrypt/src/memory.c index 452ca8b66..68302bacd 100644 --- a/wolfcrypt/src/memory.c +++ b/wolfcrypt/src/memory.c @@ -19,20 +19,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +/* inhibit "#undef current" in linuxkm_wc_port.h, included from wc_port.h, + * because needed in linuxkm_memory.c, included below. + */ +#define WOLFSSL_LINUXKM_NEED_LINUX_CURRENT -#ifdef HAVE_CONFIG_H - #include -#endif - -#ifdef WOLFSSL_LINUXKM - /* inhibit "#undef current" in linuxkm_wc_port.h, included from wc_port.h, - * because needed in linuxkm_memory.c, included below. - */ - #define WOLFSSL_NEED_LINUX_CURRENT -#endif - -#include -#include +#include "wolfssl_sources.h" /* Possible memory options: diff --git a/wolfcrypt/src/misc.c b/wolfcrypt/src/misc.c index 1d5b06740..dd117ecf1 100644 --- a/wolfcrypt/src/misc.c +++ b/wolfcrypt/src/misc.c @@ -25,11 +25,15 @@ This module implements the arithmetic-shift right, left, byte swapping, XOR, masking and clearing memory logic. */ -#ifdef HAVE_CONFIG_H - #include -#endif -#include +#ifdef WOLFSSL_VIS_FOR_TESTS + #ifdef HAVE_CONFIG_H + #include + #endif + #include +#else + #include "wolfssl_sources.h" +#endif #ifndef WOLF_CRYPT_MISC_C #define WOLF_CRYPT_MISC_C diff --git a/wolfcrypt/src/pkcs12.c b/wolfcrypt/src/pkcs12.c index 42f8074b5..40aff64b5 100644 --- a/wolfcrypt/src/pkcs12.c +++ b/wolfcrypt/src/pkcs12.c @@ -21,11 +21,7 @@ /* PKCS#12 allows storage of key and certificates into containers */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include "wolfssl_sources.h" #if defined(HAVE_PKCS12) && \ !defined(NO_ASN) && !defined(NO_PWDBASED) && !defined(NO_HMAC) && \ @@ -33,9 +29,7 @@ #include #include -#include #include -#include #ifdef NO_INLINE #include #else diff --git a/wolfcrypt/src/pkcs7.c b/wolfcrypt/src/pkcs7.c index 90e0a7738..45de54694 100644 --- a/wolfcrypt/src/pkcs7.c +++ b/wolfcrypt/src/pkcs7.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 "wolfssl_sources.h" #ifdef HAVE_PKCS7 #include -#include -#include #include #ifndef NO_RSA #include diff --git a/wolfcrypt/src/poly1305.c b/wolfcrypt/src/poly1305.c index 10a1c5048..3c9557b96 100644 --- a/wolfcrypt/src/poly1305.c +++ b/wolfcrypt/src/poly1305.c @@ -36,16 +36,10 @@ and Daniel J. Bernstein * 303.004 MiB/s with and 1874.194 MiB/s without. */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include "wolfssl_sources.h" #ifdef HAVE_POLY1305 #include -#include -#include #include #ifdef NO_INLINE #include diff --git a/wolfcrypt/src/pwdbased.c b/wolfcrypt/src/pwdbased.c index 05e574dfb..c63ba71bf 100644 --- a/wolfcrypt/src/pwdbased.c +++ b/wolfcrypt/src/pwdbased.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 "wolfssl_sources.h" #ifndef NO_PWDBASED @@ -42,7 +37,6 @@ #include #include #include -#include #ifdef NO_INLINE #include diff --git a/wolfcrypt/src/random.c b/wolfcrypt/src/random.c index c665f6e40..d0b785a0d 100644 --- a/wolfcrypt/src/random.c +++ b/wolfcrypt/src/random.c @@ -25,15 +25,8 @@ DESCRIPTION This library contains implementation for the random number generator. */ -#ifdef HAVE_CONFIG_H - #include -#endif -#include -#include -#if defined(DEBUG_WOLFSSL) - #include -#endif +#include "wolfssl_sources.h" /* on HPUX 11 you may need to install /dev/random see http://h20293.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=KRNG11I diff --git a/wolfcrypt/src/rc2.c b/wolfcrypt/src/rc2.c index c38e90625..fd48e1390 100644 --- a/wolfcrypt/src/rc2.c +++ b/wolfcrypt/src/rc2.c @@ -19,17 +19,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#include "wolfssl_sources.h" + /* DESCRIPTION This library provides the interface to the RC2 encryption algorithm (RFC 2268) */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#include #ifdef WC_RC2 diff --git a/wolfcrypt/src/ripemd.c b/wolfcrypt/src/ripemd.c index adfd96051..7c0ac5e8c 100644 --- a/wolfcrypt/src/ripemd.c +++ b/wolfcrypt/src/ripemd.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 "wolfssl_sources.h" #ifdef WOLFSSL_RIPEMD @@ -37,8 +31,6 @@ #include #endif -#include - int wc_InitRipeMd(RipeMd* ripemd) { if (ripemd == NULL) { diff --git a/wolfcrypt/src/rsa.c b/wolfcrypt/src/rsa.c index 834682e2f..109d890fe 100644 --- a/wolfcrypt/src/rsa.c +++ b/wolfcrypt/src/rsa.c @@ -26,12 +26,8 @@ This library provides the interface to the RSA. RSA keys can be used to encrypt, decrypt, sign and verify data. */ -#ifdef HAVE_CONFIG_H - #include -#endif -#include -#include +#include "wolfssl_sources.h" #ifndef NO_RSA diff --git a/wolfcrypt/src/sakke.c b/wolfcrypt/src/sakke.c index 217456461..22c4d898e 100644 --- a/wolfcrypt/src/sakke.c +++ b/wolfcrypt/src/sakke.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 "wolfssl_sources.h" #ifdef NO_INLINE #include @@ -40,7 +34,6 @@ #ifdef WOLFCRYPT_HAVE_SAKKE -#include #include #include diff --git a/wolfcrypt/src/sha.c b/wolfcrypt/src/sha.c index 81a15e423..26064a405 100644 --- a/wolfcrypt/src/sha.c +++ b/wolfcrypt/src/sha.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 "wolfssl_sources.h" #ifdef DEBUG_WOLFSSL_VERBOSE #if defined(WOLFSSL_ESPIDF) #include - #else - #include #endif #endif diff --git a/wolfcrypt/src/sha256.c b/wolfcrypt/src/sha256.c index 31a557c8d..dcc904a2f 100644 --- a/wolfcrypt/src/sha256.c +++ b/wolfcrypt/src/sha256.c @@ -38,12 +38,7 @@ on the specific device platform. */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#include -#include +#include "wolfssl_sources.h" /* * SHA256 Build Options: diff --git a/wolfcrypt/src/sha3.c b/wolfcrypt/src/sha3.c index de4dbb94d..0f487532a 100644 --- a/wolfcrypt/src/sha3.c +++ b/wolfcrypt/src/sha3.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 "wolfssl_sources.h" #if defined(WOLFSSL_SHA3) && !defined(WOLFSSL_XILINX_CRYPT) && \ !defined(WOLFSSL_AFALG_XILINX_SHA3) @@ -40,7 +35,6 @@ #endif #include -#include #include #ifdef WOLF_CRYPTO_CB diff --git a/wolfcrypt/src/sha512.c b/wolfcrypt/src/sha512.c index b47fc3e33..81b1080bc 100644 --- a/wolfcrypt/src/sha512.c +++ b/wolfcrypt/src/sha512.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 "wolfssl_sources.h" #if (defined(WOLFSSL_SHA512) || defined(WOLFSSL_SHA384)) && \ (!defined(WOLFSSL_ARMASM) && !defined(WOLFSSL_ARMASM_NO_NEON)) && \ diff --git a/wolfcrypt/src/signature.c b/wolfcrypt/src/signature.c index 98db14f85..8c99259ba 100644 --- a/wolfcrypt/src/signature.c +++ b/wolfcrypt/src/signature.c @@ -19,15 +19,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#include "wolfssl_sources.h" -#ifdef HAVE_CONFIG_H - #include -#endif - -#include #include -#include -#include #ifndef NO_ASN #include #endif diff --git a/wolfcrypt/src/siphash.c b/wolfcrypt/src/siphash.c index 9dea3f3c3..3f0e2d5c8 100644 --- a/wolfcrypt/src/siphash.c +++ b/wolfcrypt/src/siphash.c @@ -19,16 +19,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ - -#ifdef HAVE_CONFIG_H - #include -#endif - -#include -#include +#include "wolfssl_sources.h" #include -#include #ifdef NO_INLINE #include diff --git a/wolfcrypt/src/sm2.c b/wolfcrypt/src/sm2.c index a0873cbf6..d0eeeecad 100644 --- a/wolfcrypt/src/sm2.c +++ b/wolfcrypt/src/sm2.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 "wolfssl_sources.h" #ifdef WOLFSSL_SM2 diff --git a/wolfcrypt/src/sm3.c b/wolfcrypt/src/sm3.c index edc8c5f36..d8a525d5e 100644 --- a/wolfcrypt/src/sm3.c +++ b/wolfcrypt/src/sm3.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 "wolfssl_sources.h" #ifdef WOLFSSL_SM3 diff --git a/wolfcrypt/src/sm3_asm.S b/wolfcrypt/src/sm3_asm.S index 8fd7a6513..7e1c950b7 100644 --- a/wolfcrypt/src/sm3_asm.S +++ b/wolfcrypt/src/sm3_asm.S @@ -19,11 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include "wolfssl_sources_asm.h" #ifdef WOLFSSL_SM3 diff --git a/wolfcrypt/src/sm4.c b/wolfcrypt/src/sm4.c index 9bea60359..d65f7ad40 100644 --- a/wolfcrypt/src/sm4.c +++ b/wolfcrypt/src/sm4.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 "wolfssl_sources.h" #ifdef WOLFSSL_SM4 diff --git a/wolfcrypt/src/sp_arm32.c b/wolfcrypt/src/sp_arm32.c index eb3a77317..7f30d0a67 100644 --- a/wolfcrypt/src/sp_arm32.c +++ b/wolfcrypt/src/sp_arm32.c @@ -21,16 +21,11 @@ /* Implementation by Sean Parkinson. */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include "wolfssl_sources.h" #if defined(WOLFSSL_HAVE_SP_RSA) || defined(WOLFSSL_HAVE_SP_DH) || \ defined(WOLFSSL_HAVE_SP_ECC) -#include #include #ifdef NO_INLINE #include diff --git a/wolfcrypt/src/sp_arm64.c b/wolfcrypt/src/sp_arm64.c index 3ea0e0165..f1e566c4f 100644 --- a/wolfcrypt/src/sp_arm64.c +++ b/wolfcrypt/src/sp_arm64.c @@ -21,16 +21,11 @@ /* Implementation by Sean Parkinson. */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include "wolfssl_sources.h" #if defined(WOLFSSL_HAVE_SP_RSA) || defined(WOLFSSL_HAVE_SP_DH) || \ defined(WOLFSSL_HAVE_SP_ECC) -#include #include #ifdef NO_INLINE #include diff --git a/wolfcrypt/src/sp_armthumb.c b/wolfcrypt/src/sp_armthumb.c index 1b836823b..badf210c4 100644 --- a/wolfcrypt/src/sp_armthumb.c +++ b/wolfcrypt/src/sp_armthumb.c @@ -21,16 +21,11 @@ /* Implementation by Sean Parkinson. */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include "wolfssl_sources.h" #if defined(WOLFSSL_HAVE_SP_RSA) || defined(WOLFSSL_HAVE_SP_DH) || \ defined(WOLFSSL_HAVE_SP_ECC) -#include #include #ifdef NO_INLINE #include diff --git a/wolfcrypt/src/sp_c32.c b/wolfcrypt/src/sp_c32.c index ec6d5ed0d..7400f03ca 100644 --- a/wolfcrypt/src/sp_c32.c +++ b/wolfcrypt/src/sp_c32.c @@ -21,16 +21,11 @@ /* Implementation by Sean Parkinson. */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include "wolfssl_sources.h" #if defined(WOLFSSL_HAVE_SP_RSA) || defined(WOLFSSL_HAVE_SP_DH) || \ defined(WOLFSSL_HAVE_SP_ECC) -#include #include #ifdef NO_INLINE #include diff --git a/wolfcrypt/src/sp_c64.c b/wolfcrypt/src/sp_c64.c index 706b47fff..c7284bb6e 100644 --- a/wolfcrypt/src/sp_c64.c +++ b/wolfcrypt/src/sp_c64.c @@ -21,16 +21,11 @@ /* Implementation by Sean Parkinson. */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include "wolfssl_sources.h" #if defined(WOLFSSL_HAVE_SP_RSA) || defined(WOLFSSL_HAVE_SP_DH) || \ defined(WOLFSSL_HAVE_SP_ECC) -#include #include #ifdef NO_INLINE #include diff --git a/wolfcrypt/src/sp_cortexm.c b/wolfcrypt/src/sp_cortexm.c index af5e445f4..3459fae71 100644 --- a/wolfcrypt/src/sp_cortexm.c +++ b/wolfcrypt/src/sp_cortexm.c @@ -21,16 +21,11 @@ /* Implementation by Sean Parkinson. */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include "wolfssl_sources.h" #if defined(WOLFSSL_HAVE_SP_RSA) || defined(WOLFSSL_HAVE_SP_DH) || \ defined(WOLFSSL_HAVE_SP_ECC) -#include #include #ifdef NO_INLINE #include diff --git a/wolfcrypt/src/sp_dsp32.c b/wolfcrypt/src/sp_dsp32.c index 579831b99..b7a0a6c93 100644 --- a/wolfcrypt/src/sp_dsp32.c +++ b/wolfcrypt/src/sp_dsp32.c @@ -19,14 +19,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#include "wolfssl_sources.h" + /* from wolfcrypt/src/sp_c32.c */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#include -#include #include #ifdef NO_INLINE #include diff --git a/wolfcrypt/src/sp_int.c b/wolfcrypt/src/sp_int.c index 976ea7a24..c31ff8206 100644 --- a/wolfcrypt/src/sp_int.c +++ b/wolfcrypt/src/sp_int.c @@ -26,12 +26,8 @@ DESCRIPTION This library provides single precision (SP) integer math functions. */ -#ifdef HAVE_CONFIG_H - #include -#endif -#include -#include +#include "wolfssl_sources.h" #if defined(WOLFSSL_SP_MATH) || defined(WOLFSSL_SP_MATH_ALL) diff --git a/wolfcrypt/src/sp_sm2_arm32.c b/wolfcrypt/src/sp_sm2_arm32.c index 2ab530785..0d9277800 100644 --- a/wolfcrypt/src/sp_sm2_arm32.c +++ b/wolfcrypt/src/sp_sm2_arm32.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 "wolfssl_sources.h" #ifdef WOLFSSL_SM2 diff --git a/wolfcrypt/src/sp_sm2_arm64.c b/wolfcrypt/src/sp_sm2_arm64.c index 4cfe9c8d9..cecc4e04e 100644 --- a/wolfcrypt/src/sp_sm2_arm64.c +++ b/wolfcrypt/src/sp_sm2_arm64.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 "wolfssl_sources.h" #ifdef WOLFSSL_SM2 diff --git a/wolfcrypt/src/sp_sm2_armthumb.c b/wolfcrypt/src/sp_sm2_armthumb.c index 5ba99500f..e1b2f6594 100644 --- a/wolfcrypt/src/sp_sm2_armthumb.c +++ b/wolfcrypt/src/sp_sm2_armthumb.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 "wolfssl_sources.h" #ifdef WOLFSSL_SM2 diff --git a/wolfcrypt/src/sp_sm2_c32.c b/wolfcrypt/src/sp_sm2_c32.c index 233d204e2..c0094fd13 100644 --- a/wolfcrypt/src/sp_sm2_c32.c +++ b/wolfcrypt/src/sp_sm2_c32.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 "wolfssl_sources.h" #ifdef WOLFSSL_SM2 diff --git a/wolfcrypt/src/sp_sm2_c64.c b/wolfcrypt/src/sp_sm2_c64.c index a099155ea..36edbe261 100644 --- a/wolfcrypt/src/sp_sm2_c64.c +++ b/wolfcrypt/src/sp_sm2_c64.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 "wolfssl_sources.h" #ifdef WOLFSSL_SM2 diff --git a/wolfcrypt/src/sp_sm2_cortexm.c b/wolfcrypt/src/sp_sm2_cortexm.c index 6474cb70f..32f7964c3 100644 --- a/wolfcrypt/src/sp_sm2_cortexm.c +++ b/wolfcrypt/src/sp_sm2_cortexm.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 "wolfssl_sources.h" #ifdef WOLFSSL_SM2 diff --git a/wolfcrypt/src/sp_sm2_x86_64.c b/wolfcrypt/src/sp_sm2_x86_64.c index 5181a3844..a78b37e83 100644 --- a/wolfcrypt/src/sp_sm2_x86_64.c +++ b/wolfcrypt/src/sp_sm2_x86_64.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 "wolfssl_sources.h" #ifdef WOLFSSL_SM2 diff --git a/wolfcrypt/src/sp_sm2_x86_64_asm.S b/wolfcrypt/src/sp_sm2_x86_64_asm.S index c845cec4a..668b90854 100644 --- a/wolfcrypt/src/sp_sm2_x86_64_asm.S +++ b/wolfcrypt/src/sp_sm2_x86_64_asm.S @@ -19,11 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include "wolfssl_sources_asm.h" #ifdef WOLFSSL_SM2 diff --git a/wolfcrypt/src/sp_x86_64.c b/wolfcrypt/src/sp_x86_64.c index a32840051..06de9f806 100644 --- a/wolfcrypt/src/sp_x86_64.c +++ b/wolfcrypt/src/sp_x86_64.c @@ -21,16 +21,11 @@ /* Implementation by Sean Parkinson. */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include "wolfssl_sources.h" #if defined(WOLFSSL_HAVE_SP_RSA) || defined(WOLFSSL_HAVE_SP_DH) || \ defined(WOLFSSL_HAVE_SP_ECC) -#include #include #ifdef NO_INLINE #include diff --git a/wolfcrypt/src/sphincs.c b/wolfcrypt/src/sphincs.c index 99340eaba..1a0e91f49 100644 --- a/wolfcrypt/src/sphincs.c +++ b/wolfcrypt/src/sphincs.c @@ -19,15 +19,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#include "wolfssl_sources.h" + /* Based on dilithium.c and Reworked for Sphincs by Anthony Hu. */ -#ifdef HAVE_CONFIG_H - #include -#endif - -/* in case user set HAVE_PQC there */ -#include - #include #if defined(HAVE_PQC) && defined(HAVE_SPHINCS) diff --git a/wolfcrypt/src/srp.c b/wolfcrypt/src/srp.c index de0056ed6..e671d2646 100644 --- a/wolfcrypt/src/srp.c +++ b/wolfcrypt/src/srp.c @@ -19,18 +19,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ - -#ifdef HAVE_CONFIG_H - #include -#endif - -#include +#include "wolfssl_sources.h" #ifdef WOLFCRYPT_HAVE_SRP #include #include -#include #ifdef NO_INLINE #include diff --git a/wolfcrypt/src/tfm.c b/wolfcrypt/src/tfm.c index a07fcbbe9..567b58056 100644 --- a/wolfcrypt/src/tfm.c +++ b/wolfcrypt/src/tfm.c @@ -19,7 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ - +#include "wolfssl_sources.h" /* * Based on public domain TomsFastMath 0.10 by Tom St Denis, tomstdenis@iahu.ca, @@ -31,13 +31,6 @@ * to fit wolfSSL's needs. */ -#ifdef HAVE_CONFIG_H - #include -#endif - -/* in case user set USE_FAST_MATH there */ -#include - #ifdef USE_FAST_MATH #ifdef NO_INLINE diff --git a/wolfcrypt/src/wc_dsp.c b/wolfcrypt/src/wc_dsp.c index 4a30615a4..5514ce23a 100644 --- a/wolfcrypt/src/wc_dsp.c +++ b/wolfcrypt/src/wc_dsp.c @@ -19,13 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif +#include "wolfssl_sources.h" -#include -#include -#include #ifdef NO_INLINE #include #else diff --git a/wolfcrypt/src/wc_encrypt.c b/wolfcrypt/src/wc_encrypt.c index 375b4d901..516f256f3 100644 --- a/wolfcrypt/src/wc_encrypt.c +++ b/wolfcrypt/src/wc_encrypt.c @@ -19,23 +19,17 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#include "wolfssl_sources.h" -#ifdef HAVE_CONFIG_H - #include -#endif - -#include #include #include #include #include #include #include -#include #include #include #include -#include #ifdef NO_INLINE #include diff --git a/wolfcrypt/src/wc_lms.c b/wolfcrypt/src/wc_lms.c index faa69987d..57ce14169 100644 --- a/wolfcrypt/src/wc_lms.c +++ b/wolfcrypt/src/wc_lms.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 "wolfssl_sources.h" #if defined(WOLFSSL_HAVE_LMS) && defined(WOLFSSL_WC_LMS) #include diff --git a/wolfcrypt/src/wc_lms_impl.c b/wolfcrypt/src/wc_lms_impl.c index 70fe8c1e3..4fa34bf48 100644 --- a/wolfcrypt/src/wc_lms_impl.c +++ b/wolfcrypt/src/wc_lms_impl.c @@ -37,13 +37,9 @@ * Enable when memory is limited. */ -#ifdef HAVE_CONFIG_H - #include -#endif +#include "wolfssl_sources.h" -#include #include -#include #ifdef NO_INLINE #include diff --git a/wolfcrypt/src/wc_mlkem.c b/wolfcrypt/src/wc_mlkem.c index 2951e6fe1..bd7e275f7 100644 --- a/wolfcrypt/src/wc_mlkem.c +++ b/wolfcrypt/src/wc_mlkem.c @@ -63,14 +63,10 @@ * Turn on when performing make key and decapsualtion with same object. */ -#ifdef HAVE_CONFIG_H - #include -#endif +#include "wolfssl_sources.h" -#include #include #include -#include #include #include diff --git a/wolfcrypt/src/wc_mlkem_poly.c b/wolfcrypt/src/wc_mlkem_poly.c index d4b7842fc..0503f4e01 100644 --- a/wolfcrypt/src/wc_mlkem_poly.c +++ b/wolfcrypt/src/wc_mlkem_poly.c @@ -67,14 +67,11 @@ * some platforms and is smaller in code size. */ -#ifdef HAVE_CONFIG_H - #include -#endif +#include "wolfssl_sources.h" #include #include #include -#include #ifdef WOLFSSL_WC_MLKEM diff --git a/wolfcrypt/src/wc_pkcs11.c b/wolfcrypt/src/wc_pkcs11.c index e6278fc89..9b64a614b 100644 --- a/wolfcrypt/src/wc_pkcs11.c +++ b/wolfcrypt/src/wc_pkcs11.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 "wolfssl_sources.h" #ifdef HAVE_PKCS11 @@ -32,9 +28,7 @@ #endif #include -#include #include -#include #ifndef NO_RSA #include #endif diff --git a/wolfcrypt/src/wc_port.c b/wolfcrypt/src/wc_port.c index a57e54c44..bfc9ff6e6 100644 --- a/wolfcrypt/src/wc_port.c +++ b/wolfcrypt/src/wc_port.c @@ -19,10 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ - -#ifdef HAVE_CONFIG_H - #include -#endif +#include "wolfssl_sources.h" #ifdef __APPLE__ #include diff --git a/wolfcrypt/src/wc_xmss.c b/wolfcrypt/src/wc_xmss.c index 7e08be2f5..f046dbb3f 100644 --- a/wolfcrypt/src/wc_xmss.c +++ b/wolfcrypt/src/wc_xmss.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 "wolfssl_sources.h" #ifdef WOLFSSL_HAVE_XMSS #include diff --git a/wolfcrypt/src/wc_xmss_impl.c b/wolfcrypt/src/wc_xmss_impl.c index 0a058a2a6..ec09b96b4 100644 --- a/wolfcrypt/src/wc_xmss_impl.c +++ b/wolfcrypt/src/wc_xmss_impl.c @@ -29,13 +29,7 @@ * (https://ece.engr.uvic.ca/~raltawy/SAC2021/9.pdf) */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#include -#include -#include +#include "wolfssl_sources.h" #include #include diff --git a/wolfcrypt/src/wolfevent.c b/wolfcrypt/src/wolfevent.c index 82fbf6640..5df67ab22 100644 --- a/wolfcrypt/src/wolfevent.c +++ b/wolfcrypt/src/wolfevent.c @@ -19,18 +19,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#ifdef HAVE_CONFIG_H - #include -#endif - -#include - +#include "wolfssl_sources.h" #ifdef HAVE_WOLF_EVENT #include #include -#include #include diff --git a/wolfcrypt/src/wolfmath.c b/wolfcrypt/src/wolfmath.c index 1b61d0c30..60152bee1 100644 --- a/wolfcrypt/src/wolfmath.c +++ b/wolfcrypt/src/wolfmath.c @@ -26,15 +26,9 @@ * NO_BIG_INT: Disable support for all multi-precision math libraries */ -#ifdef HAVE_CONFIG_H - #include -#endif +#include "wolfssl_sources.h" -/* in case user set USE_FAST_MATH there */ -#include #include -#include -#include #ifdef WOLFSSL_ASYNC_CRYPT #include diff --git a/wolfcrypt/src/wolfssl_sources.h b/wolfcrypt/src/wolfssl_sources.h new file mode 100644 index 000000000..bc8c0532f --- /dev/null +++ b/wolfcrypt/src/wolfssl_sources.h @@ -0,0 +1,48 @@ +/* wolfssl_sources.h + * + * Copyright (C) 2006-2025 wolfSSL Inc. + * + * This file is part of wolfSSL. + * + * wolfSSL is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * wolfSSL is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA + */ + +/* In wolfSSL library sources, #include this file before any other #includes, to + * assure BUILDING_WOLFSSL is defined. + * + * This file also includes the common headers needed by all sources. + */ + +#ifndef WOLFSSL_SOURCES_H +#define WOLFSSL_SOURCES_H + +#if defined(TEST_WOLFSSL_SOURCES_INCLUSION_SEQUENCE) && \ + defined(WOLF_CRYPT_SETTINGS_H) + #error settings.h included before wolfssl_sources.h. +#endif + +#ifndef BUILDING_WOLFSSL + #define BUILDING_WOLFSSL +#endif + +#ifdef HAVE_CONFIG_H + #include +#endif + +#include +#include +#include + +#endif /* WOLFSSL_SOURCES_H */ diff --git a/wolfcrypt/src/wolfssl_sources_asm.h b/wolfcrypt/src/wolfssl_sources_asm.h new file mode 100644 index 000000000..7b08a77f8 --- /dev/null +++ b/wolfcrypt/src/wolfssl_sources_asm.h @@ -0,0 +1,46 @@ +/* wolfssl_sources_asm.h + * + * Copyright (C) 2006-2025 wolfSSL Inc. + * + * This file is part of wolfSSL. + * + * wolfSSL is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * wolfSSL is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA + */ + +/* In wolfSSL library sources, #include this file before any other #includes, to + * assure BUILDING_WOLFSSL is defined. + * + * This file also includes the common headers needed by all sources. + */ + +#ifndef WOLFSSL_SOURCES_ASM_H +#define WOLFSSL_SOURCES_ASM_H + +#if defined(TEST_WOLFSSL_SOURCES_INCLUSION_SEQUENCE) && \ + defined(WOLF_CRYPT_SETTINGS_H) + #error settings.h included before wolfssl_sources_asm.h. +#endif + +#ifndef BUILDING_WOLFSSL + #define BUILDING_WOLFSSL +#endif + +#ifdef HAVE_CONFIG_H + #include +#endif + +#include + +#endif /* WOLFSSL_SOURCES_ASM_H */ diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index 1dc48bf54..6147323f1 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -28,6 +28,8 @@ * WC_USE_DEVID=0x1234 */ +#define WOLFSSL_VIS_FOR_TESTS + #ifdef HAVE_CONFIG_H #include #endif diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index 855cb8d5c..3b34f0d1b 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -47,6 +47,12 @@ extern "C" { #endif +#if defined(TEST_WOLFSSL_SOURCES_INCLUSION_SEQUENCE) && \ + defined(BUILDING_WOLFSSL) && !defined(WOLFSSL_SOURCES_H) && \ + !defined(WOLFSSL_SOURCES_ASM_H) + #error settings.h included before wolfssl_sources.h. +#endif + /* WOLFSSL_USE_OPTIONS_H directs wolfSSL to include options.h on behalf of * application code, rather than the application including it directly. This is * not defined when compiling wolfSSL library objects, which are configured