From 6e2b6f676c49f271b55f52dd35450d172ff8468c Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Mon, 3 Aug 2026 22:29:42 -0500 Subject: [PATCH 01/44] m4/ax_linuxkm.m4: in the AX_SIMD_CC_COMPILER_FLAGS setup, drop the -mavx and -mavx2 AX_APPEND_COMPILE_FLAGS. gcc emits AVX instructions unbidden under those flags (e.g. for 128-bit types) in code paths that cannot be runtime-dispatched on cpuid, leading to invalid-opcode crashes on CPUs lacking AVX (e.g. Westmere). --- m4/ax_linuxkm.m4 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/m4/ax_linuxkm.m4 b/m4/ax_linuxkm.m4 index 339386ea9e5..39d4ac9bf6f 100644 --- a/m4/ax_linuxkm.m4 +++ b/m4/ax_linuxkm.m4 @@ -77,8 +77,9 @@ AC_DEFUN([AX_SIMD_CC_COMPILER_FLAGS], [ AX_APPEND_COMPILE_FLAGS([-mmmx],[CFLAGS_SIMD_ENABLE]) AX_APPEND_COMPILE_FLAGS([-msse2],[CFLAGS_SIMD_ENABLE]) AX_APPEND_COMPILE_FLAGS([-msse4],[CFLAGS_SIMD_ENABLE]) - AX_APPEND_COMPILE_FLAGS([-mavx],[CFLAGS_SIMD_ENABLE]) - AX_APPEND_COMPILE_FLAGS([-mavx2],[CFLAGS_SIMD_ENABLE]) + # Don't add -mavx or -mavx2 -- gcc will emit AVX instructions unbidden, + # e.g. for 128 bit types, that can't be runtime-dispatched based on cpuid, leading + # to crashes (unknown opcodes) on CPUs lacking AVX. AX_APPEND_COMPILE_FLAGS([-mno-general-regs-only],[CFLAGS_SIMD_ENABLE]) fi From afc43cd6d896aed2b694dda9cfb709dadeb46d59 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Mon, 3 Aug 2026 22:32:47 -0500 Subject: [PATCH 02/44] wolfssl/wolfcrypt/error-crypt.h, wolfcrypt/src/error.c: add FIPS_BAD_VALUE_E "Supplied value was rejected by FIPS policy" and FIPS_UNAPPROVED_E "Requested operation succeeded, but supplied parameters are unapproved for FIPS". The first is a new fatal error, the second is a new nonfatal error to which WC_FIPS_NOT_APPROVED will be bound. --- wolfcrypt/src/error.c | 7 +++++++ wolfssl/wolfcrypt/error-crypt.h | 7 +++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/wolfcrypt/src/error.c b/wolfcrypt/src/error.c index 2a076978ccc..d5871dc31ca 100644 --- a/wolfcrypt/src/error.c +++ b/wolfcrypt/src/error.c @@ -741,6 +741,13 @@ const char* wc_GetErrorString(int error) case KMAC_MIN_KEYLEN_E: return "FIPS Mode KMAC Minimum Key Length error"; + case FIPS_BAD_VALUE_E: + return "Supplied value was rejected by FIPS policy"; + + case FIPS_UNAPPROVED_E: + return "Requested operation succeeded, but supplied" + "parameters are unapproved for FIPS"; + case MAX_CODE_E: case WC_SPAN1_MIN_CODE_E: case MIN_CODE_E: diff --git a/wolfssl/wolfcrypt/error-crypt.h b/wolfssl/wolfcrypt/error-crypt.h index e3f091ff736..b45582e9f8a 100644 --- a/wolfssl/wolfcrypt/error-crypt.h +++ b/wolfssl/wolfcrypt/error-crypt.h @@ -345,9 +345,12 @@ enum wolfCrypt_ErrorCodes { AES_KW_KAT_FIPS_E = -1024, /* AES Key Wrap KAT failure */ FIPS_WRONG_API_E = -1025, /* Requested API is not allowed in FIPS mode */ KMAC_MIN_KEYLEN_E = -1026, /* FIPS Mode KMAC Minimum Key Length error */ + FIPS_BAD_VALUE_E = -1027, /* Supplied value was rejected by FIPS policy */ + FIPS_UNAPPROVED_E = -1028, /* Requested operation succeeded, but supplied */ + /* parameters are unapproved for FIPS */ - WC_SPAN2_LAST_E = -1026, /* Update to indicate last used error code */ - WC_LAST_E = -1026, /* the last code used either here or in + WC_SPAN2_LAST_E = -1028, /* Update to indicate last used error code */ + WC_LAST_E = -1028, /* the last code used either here or in * error-ssl.h */ WC_SPAN2_MIN_CODE_E = -1999, /* Last usable code in span 2 */ From 9d58c996051f15b6ace577df5e92d997cbdd7e9b Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Mon, 3 Aug 2026 22:45:03 -0500 Subject: [PATCH 03/44] wolfssl/wolfcrypt/libwolfssl_sources_asm.h: define BUILDING_WOLFSSL_ASM when not already set, so settings.h can distinguish assembly translation units. wolfssl/wolfcrypt/settings.h: in the config-source selection, when BUILDING_WOLFSSL_ASM && WOLFSSL_USER_SETTINGS_ASM, include user_settings_asm.h (the assembly-safe, directives-only header produced by user_settings_asm.sh) instead of user_settings.h, which may contain C that breaks the assembler. wolfcrypt/src/aes_asm.S: drop the file's bespoke copy of the user_settings_asm.h selection block and route through libwolfssl_sources_asm.h, so the choice lives in one place. (aes_asm.S is the only .S that open-coded this.) Also add `#define WC_FIPS_LL_CRYPTO` immediately above the new include. --- wolfcrypt/src/aes_asm.S | 22 ++++------------------ wolfssl/wolfcrypt/libwolfssl_sources_asm.h | 3 +++ wolfssl/wolfcrypt/settings.h | 18 +++++++++++++++++- 3 files changed, 24 insertions(+), 19 deletions(-) diff --git a/wolfcrypt/src/aes_asm.S b/wolfcrypt/src/aes_asm.S index d50fca67f5e..84524a9a935 100644 --- a/wolfcrypt/src/aes_asm.S +++ b/wolfcrypt/src/aes_asm.S @@ -27,24 +27,10 @@ * by Intel Mobility Group, Israel Development Center, Israel Shay Gueron */ -#ifdef WOLFSSL_USER_SETTINGS -#ifdef WOLFSSL_USER_SETTINGS_ASM -/* - * user_settings_asm.h is a file generated by the script user_settings_asm.sh. - * The script takes in a user_settings.h and produces user_settings_asm.h, which - * is a stripped down version of user_settings.h containing only preprocessor - * directives. This makes the header safe to include in assembly (.S) files. - */ -#include "user_settings_asm.h" -#else -/* - * Note: if user_settings.h contains any C code (e.g. a typedef or function - * prototype), including it here in an assembly (.S) file will cause an - * assembler failure. See user_settings_asm.h above. - */ -#include "user_settings.h" -#endif /* WOLFSSL_USER_SETTINGS_ASM */ -#endif /* WOLFSSL_USER_SETTINGS */ +#define WC_FIPS_LL_CRYPTO +#define _WC_BUILDING_AES_ASM_S + +#include #if defined WOLFSSL_X86_BUILD diff --git a/wolfssl/wolfcrypt/libwolfssl_sources_asm.h b/wolfssl/wolfcrypt/libwolfssl_sources_asm.h index 19ddd555313..ed935834b72 100644 --- a/wolfssl/wolfcrypt/libwolfssl_sources_asm.h +++ b/wolfssl/wolfcrypt/libwolfssl_sources_asm.h @@ -37,6 +37,9 @@ #ifndef BUILDING_WOLFSSL #define BUILDING_WOLFSSL #endif +#ifndef BUILDING_WOLFSSL_ASM + #define BUILDING_WOLFSSL_ASM +#endif #if defined(HAVE_CONFIG_H) && !defined(WC_CONFIG_H_INCLUDED) #include diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index 696ece03230..91dfd179c9a 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -357,7 +357,23 @@ #endif #ifdef WOLFSSL_USER_SETTINGS - #include "user_settings.h" + #if defined(BUILDING_WOLFSSL_ASM) && defined(WOLFSSL_USER_SETTINGS_ASM) + /* + * user_settings_asm.h is a file generated by the script + * user_settings_asm.sh. The script takes in a user_settings.h and + * produces user_settings_asm.h, which is a stripped down version of + * user_settings.h containing only preprocessor directives. This makes + * the header safe to include in assembly (.S) files. + */ + #include "user_settings_asm.h" + #else + /* + * Note: if user_settings.h contains any C code (e.g. a typedef or function + * prototype), including it in assembly (.S) files will cause an + * assembler failure. See user_settings_asm.h above. + */ + #include "user_settings.h" + #endif #elif defined(USE_HAL_DRIVER) && !defined(HAVE_CONFIG_H) /* STM Configuration File (generated by CubeMX) */ #include "wolfSSL.I-CUBE-wolfSSL_conf.h" From 46fb6b804da15798c108b8650e52f89a4bd8ec72 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Mon, 3 Aug 2026 22:58:05 -0500 Subject: [PATCH 04/44] wolfcrypt/src/*.c: define WC_FIPS_LL_CRYPTO in FIPS-controlled sources before including libwolfssl_sources.h, replacing the previous per-file `#define FIPS_NO_WRAPPERS` that was placed *after* the include and therefore never took effect. Low-level crypto TUs stop carrying a per-file opinion about wrapper generation; settings.h now derives FIPS_NO_WRAPPERS centrally. des3.c and wolfentropy.c newly acquire FIPS_NO_WRAPPERS (they had none). port/st/stm32.c converts to the same idiom (drops its HAVE_CONFIG_H/config.h + redundant types.h block). Note on scope: FIPS_NO_WRAPPERS governs how the *including* TU resolves its own outbound calls -- it does not change what the file makes available to others, beyond defining the FIPS-supported APIs without the `_fips()` extension the wrappers arrange. The pre-existing effect of the misplacement was that boundary-internal calls resolved to the wrapped forms, i.e. took an unintended round-trip back out through the wrappers. wolfssl/wolfcrypt/settings.h: derive FIPS_NO_WRAPPERS from (WC_FIPS_LL_CRYPTO || WOLFSSL_FIPS_DEV_NO_POST) under HAVE_FIPS, positioned after the config-source selection so it sees HAVE_FIPS regardless of whether it arrived via command line or user_settings.h. --- wolfcrypt/src/aes.c | 4 +--- wolfcrypt/src/cmac.c | 4 +--- wolfcrypt/src/des3.c | 3 +++ wolfcrypt/src/dh.c | 4 +--- wolfcrypt/src/ecc.c | 1 + wolfcrypt/src/ed25519.c | 4 +--- wolfcrypt/src/ed448.c | 4 +--- wolfcrypt/src/hmac.c | 4 +--- wolfcrypt/src/kdf.c | 4 +--- wolfcrypt/src/port/st/stm32.c | 8 +++----- wolfcrypt/src/pwdbased.c | 4 +--- wolfcrypt/src/random.c | 4 +--- wolfcrypt/src/rsa.c | 4 +--- wolfcrypt/src/sha.c | 4 +--- wolfcrypt/src/sha256.c | 1 + wolfcrypt/src/sha3.c | 4 +--- wolfcrypt/src/sha512.c | 1 + wolfcrypt/src/wc_lms.c | 5 +---- wolfcrypt/src/wc_lms_impl.c | 1 + wolfcrypt/src/wc_mldsa.c | 6 +----- wolfcrypt/src/wc_mlkem.c | 6 +----- wolfcrypt/src/wc_mlkem_poly.c | 1 + wolfcrypt/src/wc_slhdsa.c | 6 +----- wolfcrypt/src/wc_xmss.c | 5 +---- wolfcrypt/src/wc_xmss_impl.c | 1 + wolfcrypt/src/wolfentropy.c | 3 +++ wolfssl/wolfcrypt/settings.h | 6 ++++++ 27 files changed, 38 insertions(+), 64 deletions(-) diff --git a/wolfcrypt/src/aes.c b/wolfcrypt/src/aes.c index 79a2b0517e3..0f66def43f6 100644 --- a/wolfcrypt/src/aes.c +++ b/wolfcrypt/src/aes.c @@ -114,6 +114,7 @@ block cipher mechanism that uses n-bit binary string parameter key with 128-bits * WOLFSSL_HW_METRICS: Track hardware acceleration usage default: off */ +#define WC_FIPS_LL_CRYPTO #define _WC_BUILDING_AES_C #include @@ -123,9 +124,6 @@ block cipher mechanism that uses n-bit binary string parameter key with 128-bits /* Tip: Locate the software cipher modes by searching for "Software AES" */ #if FIPS_VERSION3_GE(2,0,0) - /* set NO_WRAPPERS before headers, use direct internal f()s not wrappers */ - #define FIPS_NO_WRAPPERS - #ifdef USE_WINDOWS_API #pragma code_seg(".fipsA$b") #pragma const_seg(".fipsB$b") diff --git a/wolfcrypt/src/cmac.c b/wolfcrypt/src/cmac.c index ff3e29feb39..ac056431ea9 100644 --- a/wolfcrypt/src/cmac.c +++ b/wolfcrypt/src/cmac.c @@ -19,6 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#define WC_FIPS_LL_CRYPTO #define _WC_BUILDING_CMAC_C #include @@ -33,9 +34,6 @@ #if defined(WOLFSSL_CMAC) #if defined(HAVE_FIPS) && defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 2) - /* set NO_WRAPPERS before headers, use direct internal f()s not wrappers */ - #define FIPS_NO_WRAPPERS - #ifdef USE_WINDOWS_API #pragma code_seg(".fipsA$c") #pragma const_seg(".fipsB$c") diff --git a/wolfcrypt/src/des3.c b/wolfcrypt/src/des3.c index f1beae1b60c..80a86cbaaad 100644 --- a/wolfcrypt/src/des3.c +++ b/wolfcrypt/src/des3.c @@ -30,6 +30,9 @@ * FREESCALE_LTC_DES: Freescale LTC DES acceleration default: off */ +#define WC_FIPS_LL_CRYPTO +#define _WC_BUILDING_DES3_C + #include #ifndef NO_DES3 diff --git a/wolfcrypt/src/dh.c b/wolfcrypt/src/dh.c index 96c6446b67b..803c56aa371 100644 --- a/wolfcrypt/src/dh.c +++ b/wolfcrypt/src/dh.c @@ -19,6 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#define WC_FIPS_LL_CRYPTO #define _WC_BUILDING_DH_C #include @@ -28,9 +29,6 @@ #if defined(HAVE_FIPS) && \ defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 2) - /* set NO_WRAPPERS before headers, use direct internal f()s not wrappers */ - #define FIPS_NO_WRAPPERS - #ifdef USE_WINDOWS_API #pragma code_seg(".fipsA$e") #pragma const_seg(".fipsB$e") diff --git a/wolfcrypt/src/ecc.c b/wolfcrypt/src/ecc.c index ec0b5d5c460..079553e9da9 100644 --- a/wolfcrypt/src/ecc.c +++ b/wolfcrypt/src/ecc.c @@ -19,6 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#define WC_FIPS_LL_CRYPTO #define _WC_BUILDING_ECC_C #include diff --git a/wolfcrypt/src/ed25519.c b/wolfcrypt/src/ed25519.c index 4a0bc1257d2..5a25069662d 100644 --- a/wolfcrypt/src/ed25519.c +++ b/wolfcrypt/src/ed25519.c @@ -28,15 +28,13 @@ * Check that the private key didn't change during the signing operations. */ +#define WC_FIPS_LL_CRYPTO #define _WC_BUILDING_ED25519_C #include #ifdef HAVE_ED25519 #if FIPS_VERSION3_GE(6,0,0) - /* set NO_WRAPPERS before headers, use direct internal f()s not wrappers */ - #define FIPS_NO_WRAPPERS - #ifdef USE_WINDOWS_API #pragma code_seg(".fipsA$f") #pragma const_seg(".fipsB$f") diff --git a/wolfcrypt/src/ed448.c b/wolfcrypt/src/ed448.c index 8508071d1ae..e8c1a0cd500 100644 --- a/wolfcrypt/src/ed448.c +++ b/wolfcrypt/src/ed448.c @@ -30,15 +30,13 @@ * Check that the private key didn't change during the signing operations. */ +#define WC_FIPS_LL_CRYPTO #define _WC_BUILDING_ED448_C #include #ifdef HAVE_ED448 #if FIPS_VERSION3_GE(6,0,0) - /* set NO_WRAPPERS before headers, use direct internal f()s not wrappers */ - #define FIPS_NO_WRAPPERS - #ifdef USE_WINDOWS_API #pragma code_seg(".fipsA$f") #pragma const_seg(".fipsB$f") diff --git a/wolfcrypt/src/hmac.c b/wolfcrypt/src/hmac.c index e5267c1cbb3..3e1721b181a 100644 --- a/wolfcrypt/src/hmac.c +++ b/wolfcrypt/src/hmac.c @@ -35,6 +35,7 @@ * WOLFSSL_KCAPI_HMAC: Linux kernel crypto API for HMAC default: off */ +#define WC_FIPS_LL_CRYPTO #define _WC_BUILDING_HMAC_C #include @@ -42,9 +43,6 @@ #ifndef NO_HMAC #if FIPS_VERSION3_GE(2,0,0) - /* set NO_WRAPPERS before headers, use direct internal f()s not wrappers */ - #define FIPS_NO_WRAPPERS - #ifdef USE_WINDOWS_API #pragma code_seg(".fipsA$g") #pragma const_seg(".fipsB$g") diff --git a/wolfcrypt/src/kdf.c b/wolfcrypt/src/kdf.c index 0f35bbfab1e..c1a824c68db 100644 --- a/wolfcrypt/src/kdf.c +++ b/wolfcrypt/src/kdf.c @@ -19,6 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#define WC_FIPS_LL_CRYPTO #define _WC_BUILDING_KDF_C #include @@ -26,9 +27,6 @@ #ifndef NO_KDF #if FIPS_VERSION3_GE(5,0,0) - /* set NO_WRAPPERS before headers, use direct internal f()s not wrappers */ - #define FIPS_NO_WRAPPERS - #ifdef USE_WINDOWS_API #pragma code_seg(".fipsA$h") #pragma const_seg(".fipsB$h") diff --git a/wolfcrypt/src/port/st/stm32.c b/wolfcrypt/src/port/st/stm32.c index 6902039b6a7..cccc1dfe88b 100644 --- a/wolfcrypt/src/port/st/stm32.c +++ b/wolfcrypt/src/port/st/stm32.c @@ -22,14 +22,12 @@ /* Generic STM32 Hashing Function */ /* Supports CubeMX HAL or Standard Peripheral Library */ -#ifdef HAVE_CONFIG_H - #include -#endif +#define WC_FIPS_LL_CRYPTO +#define _WC_BUILDING_STM32_C -#include +#include #include -#include #include #ifdef WOLFSSL_DHUK #include diff --git a/wolfcrypt/src/pwdbased.c b/wolfcrypt/src/pwdbased.c index 2405ea68236..1d3ef45e2be 100644 --- a/wolfcrypt/src/pwdbased.c +++ b/wolfcrypt/src/pwdbased.c @@ -19,6 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#define WC_FIPS_LL_CRYPTO #define _WC_BUILDING_PWDBASED_C #include @@ -26,9 +27,6 @@ #ifndef NO_PWDBASED #if FIPS_VERSION3_GE(6,0,0) - /* set NO_WRAPPERS before headers, use direct internal f()s not wrappers */ - #define FIPS_NO_WRAPPERS - #ifdef USE_WINDOWS_API #pragma code_seg(".fipsA$h") #pragma const_seg(".fipsB$h") diff --git a/wolfcrypt/src/random.c b/wolfcrypt/src/random.c index 83dd85c8e08..d80492ba7fb 100644 --- a/wolfcrypt/src/random.c +++ b/wolfcrypt/src/random.c @@ -108,6 +108,7 @@ This library contains implementation for the random number generator. * tuning details. */ +#define WC_FIPS_LL_CRYPTO #define _WC_BUILDING_RANDOM_C #include @@ -123,9 +124,6 @@ This library contains implementation for the random number generator. #if defined(HAVE_FIPS) && \ defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 2) - /* set NO_WRAPPERS before headers, use direct internal f()s not wrappers */ - #define FIPS_NO_WRAPPERS - #ifdef USE_WINDOWS_API #pragma code_seg(".fipsA$i") #pragma const_seg(".fipsB$i") diff --git a/wolfcrypt/src/rsa.c b/wolfcrypt/src/rsa.c index b1dd2f445e7..662bffc3f89 100644 --- a/wolfcrypt/src/rsa.c +++ b/wolfcrypt/src/rsa.c @@ -27,6 +27,7 @@ RSA keys can be used to encrypt, decrypt, sign and verify data. */ +#define WC_FIPS_LL_CRYPTO #define _WC_BUILDING_RSA_C #include @@ -34,9 +35,6 @@ RSA keys can be used to encrypt, decrypt, sign and verify data. #ifndef NO_RSA #if FIPS_VERSION3_GE(2,0,0) - /* set NO_WRAPPERS before headers, use direct internal f()s not wrappers */ - #define FIPS_NO_WRAPPERS - #ifdef USE_WINDOWS_API #pragma code_seg(".fipsA$j") #pragma const_seg(".fipsB$j") diff --git a/wolfcrypt/src/sha.c b/wolfcrypt/src/sha.c index 45b9948df42..bf0058326b9 100644 --- a/wolfcrypt/src/sha.c +++ b/wolfcrypt/src/sha.c @@ -39,6 +39,7 @@ * PSOC6_HASH_SHA1: PSoC6 hardware SHA-1 default: off */ +#define WC_FIPS_LL_CRYPTO #define _WC_BUILDING_SHA_C #include @@ -52,9 +53,6 @@ #if !defined(NO_SHA) #if FIPS_VERSION3_GE(2,0,0) - /* set NO_WRAPPERS before headers, use direct internal f()s not wrappers */ - #define FIPS_NO_WRAPPERS - #ifdef USE_WINDOWS_API #pragma code_seg(".fipsA$k") #pragma const_seg(".fipsB$k") diff --git a/wolfcrypt/src/sha256.c b/wolfcrypt/src/sha256.c index 16e3f58eb64..6d12f12738c 100644 --- a/wolfcrypt/src/sha256.c +++ b/wolfcrypt/src/sha256.c @@ -38,6 +38,7 @@ on the specific device platform. */ +#define WC_FIPS_LL_CRYPTO #define _WC_BUILDING_SHA256_C #include diff --git a/wolfcrypt/src/sha3.c b/wolfcrypt/src/sha3.c index 72f2d4e1fe4..70e9b0df97e 100644 --- a/wolfcrypt/src/sha3.c +++ b/wolfcrypt/src/sha3.c @@ -38,6 +38,7 @@ * PSOC6_HASH_SHA3: PSoC6 hardware SHA-3 default: off */ +#define WC_FIPS_LL_CRYPTO #define _WC_BUILDING_SHA3_C #include @@ -59,9 +60,6 @@ !defined(WOLFSSL_AFALG_XILINX_SHA3) #if FIPS_VERSION3_GE(2,0,0) - /* set NO_WRAPPERS before headers, use direct internal f()s not wrappers */ - #define FIPS_NO_WRAPPERS - #ifdef USE_WINDOWS_API #pragma code_seg(".fipsA$n") #pragma const_seg(".fipsB$n") diff --git a/wolfcrypt/src/sha512.c b/wolfcrypt/src/sha512.c index 8ac9fb835ae..fe325b6fc8d 100644 --- a/wolfcrypt/src/sha512.c +++ b/wolfcrypt/src/sha512.c @@ -54,6 +54,7 @@ * WOLFSSL_RENESAS_RSIP: Renesas RSIP SHA acceleration default: off */ +#define WC_FIPS_LL_CRYPTO #define _WC_BUILDING_SHA512_C #include diff --git a/wolfcrypt/src/wc_lms.c b/wolfcrypt/src/wc_lms.c index 595b93622d8..b1a5043f592 100644 --- a/wolfcrypt/src/wc_lms.c +++ b/wolfcrypt/src/wc_lms.c @@ -19,16 +19,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#define WC_FIPS_LL_CRYPTO #define _WC_BUILDING_WC_LMS_C #include #if defined(WOLFSSL_HAVE_LMS) -#if FIPS_VERSION3_GE(2,0,0) - /* set NO_WRAPPERS before headers, use direct internal f()s not wrappers */ - #define FIPS_NO_WRAPPERS -#endif #include #include diff --git a/wolfcrypt/src/wc_lms_impl.c b/wolfcrypt/src/wc_lms_impl.c index 2b015411391..15f7ddf8434 100644 --- a/wolfcrypt/src/wc_lms_impl.c +++ b/wolfcrypt/src/wc_lms_impl.c @@ -37,6 +37,7 @@ * Enable when memory is limited. */ +#define WC_FIPS_LL_CRYPTO #define _WC_BUILDING_WC_LMS_IMPL_C #include diff --git a/wolfcrypt/src/wc_mldsa.c b/wolfcrypt/src/wc_mldsa.c index 609ad38aae0..ea263f57efb 100644 --- a/wolfcrypt/src/wc_mldsa.c +++ b/wolfcrypt/src/wc_mldsa.c @@ -135,15 +135,11 @@ * shift equivalent. */ +#define WC_FIPS_LL_CRYPTO #define _WC_BUILDING_WC_MLDSA_C #include -#if FIPS_VERSION3_GE(2,0,0) - /* set NO_WRAPPERS before headers, use direct internal f()s not wrappers */ - #define FIPS_NO_WRAPPERS -#endif - #ifndef WOLFSSL_MLDSA_NO_ASN1 #include #endif diff --git a/wolfcrypt/src/wc_mlkem.c b/wolfcrypt/src/wc_mlkem.c index cdb61932bd5..fb4f400a71f 100644 --- a/wolfcrypt/src/wc_mlkem.c +++ b/wolfcrypt/src/wc_mlkem.c @@ -70,6 +70,7 @@ * Cannot be used with WOLFSSL_NO_MALLOC. */ +#define WC_FIPS_LL_CRYPTO #define _WC_BUILDING_WC_MLKEM_C #include @@ -80,11 +81,6 @@ #undef WOLFSSL_RISCV_ASM #endif -#if FIPS_VERSION3_GE(2,0,0) - /* set NO_WRAPPERS before headers, use direct internal f()s not wrappers */ - #define FIPS_NO_WRAPPERS -#endif - #include #include #include diff --git a/wolfcrypt/src/wc_mlkem_poly.c b/wolfcrypt/src/wc_mlkem_poly.c index 56528414773..1a2a25a939f 100644 --- a/wolfcrypt/src/wc_mlkem_poly.c +++ b/wolfcrypt/src/wc_mlkem_poly.c @@ -67,6 +67,7 @@ * some platforms and is smaller in code size. */ +#define WC_FIPS_LL_CRYPTO #define _WC_BUILDING_WC_MLKEM_POLY_C #include diff --git a/wolfcrypt/src/wc_slhdsa.c b/wolfcrypt/src/wc_slhdsa.c index 5e561ac5d20..8e56b873038 100644 --- a/wolfcrypt/src/wc_slhdsa.c +++ b/wolfcrypt/src/wc_slhdsa.c @@ -19,15 +19,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#define WC_FIPS_LL_CRYPTO #define _WC_BUILDING_WC_SLHDSA_C #include -#if FIPS_VERSION3_GE(2,0,0) - /* set NO_WRAPPERS before headers, use direct internal f()s not wrappers */ - #define FIPS_NO_WRAPPERS -#endif - #include #ifdef WOLFSSL_HAVE_SLHDSA diff --git a/wolfcrypt/src/wc_xmss.c b/wolfcrypt/src/wc_xmss.c index b4f4c761850..461f08c28e4 100644 --- a/wolfcrypt/src/wc_xmss.c +++ b/wolfcrypt/src/wc_xmss.c @@ -19,16 +19,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#define WC_FIPS_LL_CRYPTO #define _WC_BUILDING_WC_XMSS_C #include #ifdef WOLFSSL_HAVE_XMSS -#if FIPS_VERSION3_GE(2,0,0) - /* set NO_WRAPPERS before headers, use direct internal f()s not wrappers */ - #define FIPS_NO_WRAPPERS -#endif #include #include diff --git a/wolfcrypt/src/wc_xmss_impl.c b/wolfcrypt/src/wc_xmss_impl.c index 369f0740803..7cd27a90e4f 100644 --- a/wolfcrypt/src/wc_xmss_impl.c +++ b/wolfcrypt/src/wc_xmss_impl.c @@ -29,6 +29,7 @@ * (https://ece.engr.uvic.ca/~raltawy/SAC2021/9.pdf) */ +#define WC_FIPS_LL_CRYPTO #define _WC_BUILDING_WC_XMSS_IMPL_C #include diff --git a/wolfcrypt/src/wolfentropy.c b/wolfcrypt/src/wolfentropy.c index 88ddcb986d1..c50b1dc9237 100644 --- a/wolfcrypt/src/wolfentropy.c +++ b/wolfcrypt/src/wolfentropy.c @@ -30,6 +30,9 @@ data, use this implementation to seed and re-seed the DRBG. */ +#define WC_FIPS_LL_CRYPTO +#define _WC_BUILDING_WOLFENTROPY_C + #include #ifdef HAVE_ENTROPY_MEMUSE diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index 91dfd179c9a..4b714610f61 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -396,6 +396,12 @@ #endif #endif +#if defined(HAVE_FIPS) && \ + (defined(WC_FIPS_LL_CRYPTO) || defined(WOLFSSL_FIPS_DEV_NO_POST)) && \ + !defined(FIPS_NO_WRAPPERS) + #define FIPS_NO_WRAPPERS +#endif + /* Microsoft's ARM64 compiler defines _M_ARM64 but not __aarch64__. The wolfSSL * ARMv8 assembly (WOLFSSL_ARMASM) and all of its C callers are gated on * __aarch64__, so map _M_ARM64 across when building that assembly with MSVC and From c7a2c6c46d46b71040ba0806c74bf06bef47c6c6 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Mon, 3 Aug 2026 23:16:05 -0500 Subject: [PATCH 05/44] configure.ac: add --enable-fips=dev-no-post (WOLFSSL_FIPS_DEV_NO_POST, MAJOR=8) and AM_CONDITIONAL BUILD_FIPS_NO_POST. Refactor FIPS dev/ready version setup: hoist ENABLED_FIPS_DEV / ENABLED_FIPS_READY to set -DWOLFSSL_FIPS_DEV / -DWOLFSSL_FIPS_READY centrally, and switch the FIPS AS_CASE arms from `test "$FIPS_VERSION" != "dev"` to `test "$ENABLED_FIPS_DEV" != "yes"` so the dev semantics extend to v5-dev/v6-dev/lean-aesgcm-dev. src/include.am: under !BUILD_FIPS_NO_POST, drop fips.c / fips_test.c / wolfcrypt_first.c / wolfcrypt_last.c from the build (dev-no-post uses no fips repo content). wolfssl/wolfcrypt/settings.h, wolfssl/wolfcrypt/wc_compat.h: under WOLFSSL_FIPS_DEV_NO_POST, squat WOLF_CRYPT_FIPS_H to inhibit fips.h, and change the FIPS_READY/DEV version block guard to `!defined(HAVE_FIPS_VERSION)` (required so an externally supplied version is not clobbered). wolfssl/wolfcrypt/fips_test.h: add WOLFSSL_FIPS_DEV_NO_POST stub block (fipsCastStatus_get, the PRIVATE_KEY macros) so master builds without the fips repo. linuxkm/linuxkm_wc_port.h, linuxkm/module_hooks.c: accommodate WOLFSSL_FIPS_DEV_NO_POST (guard verifyCore / CAST / fencepost paths that the fips repo would otherwise provide; force WC_USE_PIE_FENCEPOSTS_FOR_FIPS). wolfcrypt/test/test.c: in hmac_sha256_test(), don't expect HMAC_KAT_FIPS_E in WOLFSSL_FIPS_DEV_NO_POST builds. wolfssl/wolfcrypt/types.h: add stub macro for wolfCrypt_SetPrivateKeyReadEnable_fips() when WOLFSSL_FIPS_DEV_NO_POST. --- configure.ac | 375 ++++++++++++++++++++-------------- linuxkm/linuxkm_wc_port.h | 4 + linuxkm/module_hooks.c | 17 +- src/include.am | 8 +- wolfcrypt/test/test.c | 2 +- wolfssl/wolfcrypt/fips_test.h | 15 ++ wolfssl/wolfcrypt/settings.h | 14 +- wolfssl/wolfcrypt/types.h | 6 +- wolfssl/wolfcrypt/wc_compat.h | 5 +- 9 files changed, 272 insertions(+), 174 deletions(-) diff --git a/configure.ac b/configure.ac index a107619ab22..b631ebfc043 100644 --- a/configure.ac +++ b/configure.ac @@ -562,6 +562,13 @@ AS_CASE([$ENABLED_WOLFENGINE], # v5-RC11 - historical FIPS 140-3, wolfCrypt/fips WCv5.0-RC11 # HAVE_FIPS_VERSION = 5, HAVE_FIPS_VERSION_MINOR = 2. # v5-RC12 - historical FIPS 140-3, wolfCrypt/fips WCv5.0-RC12 + +# FIPS dev/ready is always one major increment ahead of the latest tagged +# version: +FIPS_DEVREADY_MAJOR=7 +FIPS_DEVREADY_MINOR=0 +FIPS_DEVREADY_PATCH=0 + AS_CASE([$ENABLED_FIPS], [no],[ FIPS_VERSION="none" @@ -634,6 +641,7 @@ AS_CASE([$ENABLED_FIPS], HAVE_FIPS_VERSION_MAJOR=5 HAVE_FIPS_VERSION_MINOR=3 ENABLED_FIPS="yes" + ENABLED_FIPS_READY=yes DEF_SP_MATH_ALL="no" DEF_FAST_MATH="yes" ], @@ -643,6 +651,7 @@ AS_CASE([$ENABLED_FIPS], HAVE_FIPS_VERSION_MINOR=2 HAVE_FIPS_VERSION_PATCH=1 ENABLED_FIPS="yes" + ENABLED_FIPS_DEV=yes # for dev, DEF_SP_MATH_ALL and DEF_FAST_MATH follow non-FIPS defaults (currently sp-math-all) ], [v5-kcapi],[ @@ -653,7 +662,7 @@ AS_CASE([$ENABLED_FIPS], ENABLED_FIPS="yes" # for dev, DEF_SP_MATH_ALL and DEF_FAST_MATH follow non-FIPS defaults (currently sp-math-all) ], - [v6|v6-dev],[ + [v6],[ FIPS_VERSION="v6" HAVE_FIPS_VERSION=6 HAVE_FIPS_VERSION_MAJOR=6 @@ -663,6 +672,16 @@ AS_CASE([$ENABLED_FIPS], DEF_SP_MATH_ALL="yes" DEF_FAST_MATH="no" ], + [v6-dev],[ + FIPS_VERSION="v6" + HAVE_FIPS_VERSION=6 + HAVE_FIPS_VERSION_MAJOR=6 + HAVE_FIPS_VERSION_MINOR=0 + HAVE_FIPS_VERSION_PATCH=0 + ENABLED_FIPS="yes" + ENABLED_FIPS_DEV=yes + # for dev, DEF_SP_MATH_ALL and DEF_FAST_MATH follow non-FIPS defaults (currently sp-math-all) + ], [v7],[ FIPS_VERSION="v7" HAVE_FIPS_VERSION=7 @@ -673,32 +692,60 @@ AS_CASE([$ENABLED_FIPS], DEF_SP_MATH_ALL="yes" DEF_FAST_MATH="no" ], - # Should always remain one ahead of the latest so as not to be confused with - # the latest [ready|v7-ready],[ FIPS_VERSION="ready" HAVE_FIPS_VERSION=8 - HAVE_FIPS_VERSION_MAJOR=8 - HAVE_FIPS_VERSION_MINOR=0 - HAVE_FIPS_VERSION_PATCH=0 + HAVE_FIPS_VERSION_MAJOR=$FIPS_DEVREADY_MAJOR + HAVE_FIPS_VERSION_MINOR=$FIPS_DEVREADY_MINOR + HAVE_FIPS_VERSION_PATCH=$FIPS_DEVREADY_PATCH ENABLED_FIPS="yes" + ENABLED_FIPS_READY=yes DEF_SP_MATH_ALL="yes" DEF_FAST_MATH="no" ], [dev|v7-dev],[ FIPS_VERSION="dev" - HAVE_FIPS_VERSION_MAJOR=8 - HAVE_FIPS_VERSION_MINOR=0 - HAVE_FIPS_VERSION_PATCH=0 + HAVE_FIPS_VERSION_MAJOR=$FIPS_DEVREADY_MAJOR + HAVE_FIPS_VERSION_MINOR=$FIPS_DEVREADY_MINOR + HAVE_FIPS_VERSION_PATCH=$FIPS_DEVREADY_PATCH ENABLED_FIPS="yes" + ENABLED_FIPS_DEV=yes # for dev, DEF_SP_MATH_ALL and DEF_FAST_MATH follow non-FIPS defaults (currently sp-math-all) ], - [lean-aesgcm|lean-aesgcm-ready|lean-aesgcm-dev],[ + [dev-no-post],[ + FIPS_VERSION="dev-no-post" + HAVE_FIPS_VERSION_MAJOR=$FIPS_DEVREADY_MAJOR + HAVE_FIPS_VERSION_MINOR=$FIPS_DEVREADY_MINOR + HAVE_FIPS_VERSION_PATCH=$FIPS_DEVREADY_PATCH + ENABLED_FIPS="yes" + ENABLED_FIPS_DEV=yes + # for dev, DEF_SP_MATH_ALL and DEF_FAST_MATH follow non-FIPS defaults (currently sp-math-all) + AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_FIPS_DEV_NO_POST" + ], + [lean-aesgcm],[ FIPS_VERSION="$ENABLED_FIPS" - HAVE_FIPS_VERSION_MAJOR=8 - HAVE_FIPS_VERSION_MINOR=0 - HAVE_FIPS_VERSION_PATCH=0 + HAVE_FIPS_VERSION_MAJOR=$FIPS_DEVREADY_MAJOR + HAVE_FIPS_VERSION_MINOR=$FIPS_DEVREADY_MINOR + HAVE_FIPS_VERSION_PATCH=$FIPS_DEVREADY_PATCH + ENABLED_FIPS="yes" + # No PK in lean-aesgcm + ], + [lean-aesgcm-ready],[ + FIPS_VERSION="$ENABLED_FIPS" + HAVE_FIPS_VERSION_MAJOR=$FIPS_DEVREADY_MAJOR + HAVE_FIPS_VERSION_MINOR=$FIPS_DEVREADY_MINOR + HAVE_FIPS_VERSION_PATCH=$FIPS_DEVREADY_PATCH + ENABLED_FIPS="yes" + ENABLED_FIPS_READY=yes + # No PK in lean-aesgcm + ], + [lean-aesgcm-dev],[ + FIPS_VERSION="$ENABLED_FIPS" + HAVE_FIPS_VERSION_MAJOR=$FIPS_DEVREADY_MAJOR + HAVE_FIPS_VERSION_MINOR=$FIPS_DEVREADY_MINOR + HAVE_FIPS_VERSION_PATCH=$FIPS_DEVREADY_PATCH ENABLED_FIPS="yes" + ENABLED_FIPS_DEV=yes ], [ AS_IF([test "$ENABLED_FIPS" = "yes"],[ENABLED_FIPS="(unset)"],[ENABLED_FIPS=\"$ENABLED_FIPS\"]) @@ -717,6 +764,11 @@ if test -z "$HAVE_FIPS_VERSION_PATCH" then HAVE_FIPS_VERSION_PATCH=0 fi + +AC_SUBST([HAVE_FIPS_VERSION_MAJOR]) +AC_SUBST([HAVE_FIPS_VERSION_MINOR]) +AC_SUBST([HAVE_FIPS_VERSION_PATCH]) + if test -z "$HAVE_FIPS_VERSION" then HAVE_FIPS_VERSION="$HAVE_FIPS_VERSION_MAJOR" @@ -733,7 +785,7 @@ AS_CASE([$FIPS_VERSION], AS_IF([ test -s $srcdir/wolfcrypt/src/fips.c ], [AC_MSG_ERROR([FIPS source tree is incompatible with non-FIPS build (requires --enable-fips)])]) ], - [disabled], + [disabled|dev-no-post], [], [ AS_IF([ ! test -s $srcdir/wolfcrypt/src/fips.c], @@ -741,6 +793,30 @@ AS_CASE([$FIPS_VERSION], ] ) +if test "$ENABLED_FIPS_DEV" = "yes" +then + # Only signal WOLFSSL_FIPS_DEV if there is no wolfCrypt overlay, assuring + # that v5-dev and v6-dev are excluded. + if test $HAVE_FIPS_VERSION_MAJOR -ge $FIPS_DEVREADY_MAJOR + then + AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_FIPS_DEV" + fi +else + ENABLED_FIPS_DEV=no +fi + +if test "$ENABLED_FIPS_READY" = "yes" +then + # Only signal WOLFSSL_FIPS_DEV if there is no wolfCrypt overlay, assuring + # that v5-ready is excluded. + if test $HAVE_FIPS_VERSION_MAJOR -ge $FIPS_DEVREADY_MAJOR + then + AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_FIPS_READY" + fi +else + ENABLED_FIPS_READY=no +fi + # For reproducible build, gate out from the build anything that might # introduce semantically frivolous jitter, maximizing chance of # identical object files. @@ -6849,14 +6925,7 @@ AC_ARG_ENABLE([aeskeywrap], # FIPS feature and macro setup AS_CASE([$FIPS_VERSION], - [v7|ready|dev],[ # FIPS 140-3 PQ-FS - - AS_IF([test "$FIPS_VERSION" = "dev"], - ENABLED_FIPS_DEV=yes - [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_FIPS_DEV"]) - AS_IF([test "$FIPS_VERSION" = "ready" || test "$FIPS_VERSION" = "v7"], - ENABLED_FIPS_READY=yes - [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_FIPS_READY"]) + [v7|ready|dev|dev-no-post],[ # FIPS 140-3 PQ-FS AM_CFLAGS="$AM_CFLAGS \ -DHAVE_FIPS \ @@ -6887,35 +6956,35 @@ AS_CASE([$FIPS_VERSION], # protocol section AS_IF([test "$ENABLED_WOLFSSH" != "yes" && - (test "$FIPS_VERSION" != "dev" || test "$enable_ssh" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_ssh" != "no")], [enable_ssh="yes"]) AS_IF([test "$ENABLED_HKDF" != "yes" && - (test "$FIPS_VERSION" != "dev" || test "$enable_hkdf" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_hkdf" != "no")], [ENABLED_HKDF="yes"; AM_CFLAGS="$AM_CFLAGS -DHAVE_HKDF"]) AS_IF([test "x$ENABLED_PWDBASED" = "xno" && - (test "$FIPS_VERSION" != "dev" || test "$enable_pwdbased" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_pwdbased" != "no")], [ENABLED_PWDBASED="yes"; AM_CFLAGS="$AM_CFLAGS -DHAVE_PBKDF2 -DHAVE_AESGCM"]) AS_IF([test "x$ENABLED_SRTP" = "xno" && - (test "$FIPS_VERSION" != "dev" || test "$enable_srtp" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_srtp" != "no")], [ENABLED_SRTP="yes"]) AS_IF([test "x$ENABLED_SRTP_KDF" = "xno" && - (test "$FIPS_VERSION" != "dev" || test "$enable_srtp_kdf" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_srtp_kdf" != "no")], [ENABLED_SRTP_KDF="yes"]) # public key section AS_IF([test "$ENABLED_KEYGEN" != "yes" && - (test "$FIPS_VERSION" != "dev" || test "$enable_keygen" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_keygen" != "no")], [ENABLED_KEYGEN="yes"; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KEY_GEN"]) # AS_IF([test "$ENABLED_COMPKEY" != "yes" && -# (test "$FIPS_VERSION" != "dev" || test "$enable_compkey" != "yes")], +# (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_compkey" != "yes")], # [ENABLED_COMPKEY="yes"]) AS_IF([test "$ENABLED_RSAPSS" != "yes" && - (test "$FIPS_VERSION" != "dev" || test "$enable_rsapss" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_rsapss" != "no")], [ENABLED_RSAPSS="yes"; AM_CFLAGS="$AM_CFLAGS -DWC_RSA_PSS"]) AS_IF([test "$ENABLED_DH" != "no" && @@ -6923,50 +6992,50 @@ AS_CASE([$FIPS_VERSION], [enable_dh="no"; ENABLED_DH="no"; AM_CFLAGS="$AM_CFLAGS -DNO_DH"]) AS_IF([test "$ENABLED_ECC" != "yes" && - (test "$FIPS_VERSION" != "dev" || test "$enable_ecc" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_ecc" != "no")], [ENABLED_ECC="yes"; AM_CFLAGS="$AM_CFLAGS -DHAVE_ECC -DTFM_ECC256" AS_IF([test "$ENABLED_ECC_SHAMIR" = "yes"], [AM_CFLAGS="$AM_CFLAGS -DECC_SHAMIR"])]) AS_IF([test "$ENABLED_ED25519" = "no" && - (test "$FIPS_VERSION" != "dev" || test "$enable_ed25519" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_ed25519" != "no")], [ENABLED_ED25519="yes"; AM_CFLAGS="$AM_CFLAGS -DHAVE_ED25519 -DHAVE_ED25519_KEY_IMPORT"]) AS_IF([test "$ENABLED_CURVE25519" != "no" && - (test "$FIPS_VERSION" != "dev" || test "$enable_curve25519" = "")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_curve25519" = "")], [ENABLED_CURVE25519="no"; AM_CFLAGS="$AM_CFLAGS"]) AS_IF([test "x$ENABLED_ED448" != "xyes" && - (test "$FIPS_VERSION" != "dev" || test "$enable_ed448" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_ed448" != "no")], [ENABLED_ED448="yes"; AM_CFLAGS="$AM_CFLAGS -DHAVE_ED448 -DHAVE_ED448_KEY_IMPORT"]) AS_IF([test "$ENABLED_CURVE448" != "no" && - (test "$FIPS_VERSION" != "dev" || test "$enable_curve448" = "")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_curve448" = "")], [ENABLED_CURVE448="no"; AM_CFLAGS="$AM_CFLAGS"]) AS_IF([test "x$ENABLED_ED25519_STREAM" != "xyes" && - (test "$FIPS_VERSION" != "dev" || test "$enable_ed25519_stream" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_ed25519_stream" != "no")], [ENABLED_ED25519_STREAM="yes"]) AS_IF([test "x$ENABLED_ED448_STREAM" != "xyes" && - (test "$FIPS_VERSION" != "dev" || test "$enable_ed448_stream" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_ed448_stream" != "no")], [ENABLED_ED448_STREAM="yes"]) AS_IF([test "x$ENABLED_ECCCUSTCURVES" != "xno" && - test "$FIPS_VERSION" != "dev"], + test "$ENABLED_FIPS_DEV" != "yes"], [AC_MSG_WARN([Forcing off ecccustcurves for FIPS ${FIPS_VERSION}.]) ENABLED_ECCCUSTCURVES="no"]) # Hashing section AS_IF([test "x$ENABLED_SHA3" != "xyes" && - (test "$FIPS_VERSION" != "dev" || test "$enable_sha3" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_sha3" != "no")], [ENABLED_SHA3="yes"; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SHA3"]) AS_IF([test "$ENABLED_SHA224" != "yes" && - (test "$FIPS_VERSION" != "dev" || test "$enable_sha224" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_sha224" != "no")], [ENABLED_SHA224="yes"; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SHA224"]) AS_IF([test "$ENABLED_SHA512" = "no" && - (test "$FIPS_VERSION" != "dev" || test "$enable_sha512" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_sha512" != "no")], [ENABLED_SHA512="yes"; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SHA512 -DWOLFSSL_SHA384"]) # SHA512-224 and SHA512-256 enabled for FIPS v7+ (needed for ML-DSA @@ -6974,51 +7043,51 @@ AS_CASE([$FIPS_VERSION], # Shake128 because we're testing SHAKE256 AS_IF([test "x$ENABLED_SHAKE128" = "xno" && - (test "$FIPS_VERSION" != "dev" || test "$enable_shake128" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_shake128" != "no")], [ENABLED_SHAKE128="yes"]) # Shake256 mandated for ED448 AS_IF([test "x$ENABLED_SHAKE256" = "xno" && - (test "$FIPS_VERSION" != "dev" || test "$enable_shake256" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_shake256" != "no")], [ENABLED_SHAKE256="yes"]) # Aes section AS_IF([test "$ENABLED_AESCCM" != "yes" && - (test "$FIPS_VERSION" != "dev" || test "$enable_aesccm" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_aesccm" != "no")], [ENABLED_AESCCM="yes"; AM_CFLAGS="$AM_CFLAGS -DHAVE_AESCCM"]) AS_IF([test "$ENABLED_AESCTR" != "yes" && - (test "$FIPS_VERSION" != "dev" || test "$enable_aesctr" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_aesctr" != "no")], [ENABLED_AESCTR="yes"; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_COUNTER"]) AS_IF([test "$ENABLED_CMAC" != "yes" && - (test "$FIPS_VERSION" != "dev" || test "$enable_cmac" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_cmac" != "no")], [ENABLED_CMAC="yes"; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CMAC"]) AS_IF([test "$ENABLED_AESGCM" = "no" && - (test "$FIPS_VERSION" != "dev" || test "$enable_aesgcm" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_aesgcm" != "no")], [ENABLED_AESGCM="yes"; AM_CFLAGS="$AM_CFLAGS -DHAVE_AESGCM"; AM_CCASFLAGS="$AM_CCASFLAGS -DHAVE_AESGCM"]) AS_IF([test "$ENABLED_AESGCM_STREAM" != "yes" && - (test "$FIPS_VERSION" != "dev" || test "$enable_aesgcm_stream" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_aesgcm_stream" != "no")], [ENABLED_AESGCM_STREAM="yes"]) AS_IF([test "x$ENABLED_AESOFB" = "xno" && - (test "$FIPS_VERSION" != "dev" || test "$enable_aesofb" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_aesofb" != "no")], [ENABLED_AESOFB="yes"; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_OFB"]) AS_IF([test "x$ENABLED_AESCFB" = "xno" && - (test "$FIPS_VERSION" != "dev" || test "$enable_aescfb" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_aescfb" != "no")], [ENABLED_AESCFB="yes"; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_CFB"]) AS_IF([test "x$ENABLED_AESXTS" = "xno" && - (test "$FIPS_VERSION" != "dev" || test "$enable_aesxts" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_aesxts" != "no")], [ENABLED_AESXTS="yes"; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_XTS"]) AS_IF([test "x$ENABLED_AESXTS" = "xyes" && test "x$ENABLED_AESNI" = "xyes"], [AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_AES_XTS"]) AS_IF([test "x$ENABLED_AESXTS_STREAM" = "xno" && - (test "$FIPS_VERSION" != "dev" || test "$enable_aesxts_stream" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_aesxts_stream" != "no")], [ENABLED_AESXTS_STREAM="yes"]) AS_IF([(test "$ENABLED_AESCCM" != "no" && test "$HAVE_AESCCM_PORT" != "yes") || @@ -7028,12 +7097,12 @@ AS_CASE([$FIPS_VERSION], [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_DIRECT -DHAVE_AES_ECB"]) AS_IF([test "x$ENABLED_AESKEYWRAP" != "xyes" && - (test "$FIPS_VERSION" != "dev" || test "$enable_aeskeywrap" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_aeskeywrap" != "no")], [ENABLED_AESKEYWRAP="yes"; AM_CFLAGS="$AM_CFLAGS -DHAVE_AES_KEYWRAP"]) # Post-Quantum section AS_IF([test "$ENABLED_MLKEM" != "yes" && - (test "$FIPS_VERSION" != "dev" || test "$enable_mlkem" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_mlkem" != "no")], [ENABLED_MLKEM="yes" ENABLED_MLKEM512="yes" ENABLED_MLKEM768="yes" @@ -7043,7 +7112,7 @@ AS_CASE([$FIPS_VERSION], ENABLED_MLKEM_DECAPSULATE="yes"]) AS_IF([test "$ENABLED_MLDSA" != "yes" && - (test "$FIPS_VERSION" != "dev" || test "$enable_dilithium" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_dilithium" != "no")], [ENABLED_MLDSA="yes" ENABLED_MLDSA44="yes" ENABLED_MLDSA65="yes" @@ -7053,17 +7122,17 @@ AS_CASE([$FIPS_VERSION], ENABLED_MLDSA_VERIFY="yes"]) AS_IF([test "$ENABLED_XMSS" != "yes" && - (test "$FIPS_VERSION" != "dev" || test "$enable_xmss" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_xmss" != "no")], [ENABLED_XMSS="yes"]) AS_IF([test "$ENABLED_LMS" != "yes" && - (test "$FIPS_VERSION" != "dev" || test "$enable_lms" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_lms" != "no")], [ENABLED_LMS="yes"]) # LMS: enable SHA-256/192 and SHAKE256 parameter sets for FIPS v7 AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_LMS_SHA256_192 -DWOLFSSL_LMS_SHAKE256" AS_IF([test "$ENABLED_SLHDSA" != "yes" && - (test "$FIPS_VERSION" != "dev" || test "$enable_slhdsa" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_slhdsa" != "no")], [ENABLED_SLHDSA="yes" SLHDSA_PARAM_128S="yes" SLHDSA_PARAM_128F="yes" @@ -7081,12 +7150,12 @@ AS_CASE([$FIPS_VERSION], # SHA-256 DRBG -- cannot be disabled at build time in FIPS mode AS_IF([test "$ENABLED_SHA256_DRBG" != "yes" && - test "$FIPS_VERSION" != "dev"], + test "$ENABLED_FIPS_DEV" != "yes"], [AC_MSG_ERROR([Can not disable SHA256-DRBG at build time in FIPS mode. Disable at run-time with wc_Sha256Drbg_Disable() or wc_Sha256Drbg_Disable_fips()])]) # SHA-512 DRBG -- cannot be disabled at build time in FIPS mode AS_IF([test "$ENABLED_SHA512_DRBG" != "yes" && - test "$FIPS_VERSION" != "dev"], + test "$ENABLED_FIPS_DEV" != "yes"], [AC_MSG_ERROR([Can not disable SHA512-DRBG at build time in FIPS mode. Disable it at run-time with wc_Sha512Drbg_Disable() or wc_Sha512Drbg_Disable_fips()])]) # Old TLS requires MD5 + HMAC, which is not allowed under FIPS 140-3 @@ -7132,82 +7201,82 @@ AS_CASE([$FIPS_VERSION], # protocol section AS_IF([test "$ENABLED_WOLFSSH" != "yes" && - (test "$FIPS_VERSION" != "dev" || test "$enable_ssh" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_ssh" != "no")], [enable_ssh="yes"]) AS_IF([test "$ENABLED_HKDF" != "yes" && - (test "$FIPS_VERSION" != "dev" || test "$enable_hkdf" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_hkdf" != "no")], [ENABLED_HKDF="yes"; AM_CFLAGS="$AM_CFLAGS -DHAVE_HKDF"]) AS_IF([test "x$ENABLED_PWDBASED" = "xno" && - (test "$FIPS_VERSION" != "dev" || test "$enable_pwdbased" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_pwdbased" != "no")], [ENABLED_PWDBASED="yes"; AM_CFLAGS="$AM_CFLAGS -DHAVE_PBKDF2 -DHAVE_AESGCM"]) AS_IF([test "x$ENABLED_SRTP" = "xno" && - (test "$FIPS_VERSION" != "dev" || test "$enable_srtp" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_srtp" != "no")], [ENABLED_SRTP="yes"]) AS_IF([test "x$ENABLED_SRTP_KDF" = "xno" && - (test "$FIPS_VERSION" != "dev" || test "$enable_srtp_kdf" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_srtp_kdf" != "no")], [ENABLED_SRTP_KDF="yes"]) # public key section AS_IF([test "$ENABLED_KEYGEN" != "yes" && - (test "$FIPS_VERSION" != "dev" || test "$enable_keygen" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_keygen" != "no")], [ENABLED_KEYGEN="yes"; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KEY_GEN"]) # AS_IF([test "$ENABLED_COMPKEY" != "yes" && -# (test "$FIPS_VERSION" != "dev" || test "$enable_compkey" != "yes")], +# (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_compkey" != "yes")], # [ENABLED_COMPKEY="yes"]) AS_IF([test "$ENABLED_RSAPSS" != "yes" && - (test "$FIPS_VERSION" != "dev" || test "$enable_rsapss" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_rsapss" != "no")], [ENABLED_RSAPSS="yes"; AM_CFLAGS="$AM_CFLAGS -DWC_RSA_PSS"]) AS_IF([test "$ENABLED_ECC" != "yes" && - (test "$FIPS_VERSION" != "dev" || test "$enable_ecc" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_ecc" != "no")], [ENABLED_ECC="yes"; AM_CFLAGS="$AM_CFLAGS -DHAVE_ECC -DTFM_ECC256" AS_IF([test "$ENABLED_ECC_SHAMIR" = "yes"], [AM_CFLAGS="$AM_CFLAGS -DECC_SHAMIR"])]) AS_IF([test "$ENABLED_ED25519" = "no" && - (test "$FIPS_VERSION" != "dev" || test "$enable_ed25519" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_ed25519" != "no")], [ENABLED_ED25519="yes"; AM_CFLAGS="$AM_CFLAGS -DHAVE_ED25519 -DHAVE_ED25519_KEY_IMPORT"]) AS_IF([test "$ENABLED_CURVE25519" != "no" && - (test "$FIPS_VERSION" != "dev" || test "$enable_curve25519" = "")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_curve25519" = "")], [ENABLED_CURVE25519="no"; AM_CFLAGS="$AM_CFLAGS"]) AS_IF([test "x$ENABLED_ED448" != "xyes" && - (test "$FIPS_VERSION" != "dev" || test "$enable_ed448" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_ed448" != "no")], [ENABLED_ED448="yes"; AM_CFLAGS="$AM_CFLAGS -DHAVE_ED448 -DHAVE_ED448_KEY_IMPORT"]) AS_IF([test "$ENABLED_CURVE448" != "no" && - (test "$FIPS_VERSION" != "dev" || test "$enable_curve448" = "")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_curve448" = "")], [ENABLED_CURVE448="no"; AM_CFLAGS="$AM_CFLAGS"]) AS_IF([test "x$ENABLED_ED25519_STREAM" != "xyes" && - (test "$FIPS_VERSION" != "dev" || test "$enable_ed25519_stream" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_ed25519_stream" != "no")], [ENABLED_ED25519_STREAM="yes"]) AS_IF([test "x$ENABLED_ED448_STREAM" != "xyes" && - (test "$FIPS_VERSION" != "dev" || test "$enable_ed448_stream" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_ed448_stream" != "no")], [ENABLED_ED448_STREAM="yes"]) AS_IF([test "x$ENABLED_ECCCUSTCURVES" != "xno" && - test "$FIPS_VERSION" != "dev"], + test "$ENABLED_FIPS_DEV" != "yes"], [AC_MSG_WARN([Forcing off ecccustcurves for FIPS ${FIPS_VERSION}.]) ENABLED_ECCCUSTCURVES="no"]) # Hashing section AS_IF([test "x$ENABLED_SHA3" != "xyes" && - (test "$FIPS_VERSION" != "dev" || test "$enable_sha3" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_sha3" != "no")], [ENABLED_SHA3="yes"; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SHA3"]) AS_IF([test "$ENABLED_SHA224" != "yes" && - (test "$FIPS_VERSION" != "dev" || test "$enable_sha224" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_sha224" != "no")], [ENABLED_SHA224="yes"; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SHA224"]) AS_IF([test "$ENABLED_SHA512" = "no" && - (test "$FIPS_VERSION" != "dev" || test "$enable_sha512" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_sha512" != "no")], [ENABLED_SHA512="yes"; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SHA512 -DWOLFSSL_SHA384"]) # SHA512-224 and SHA512-256 are not in-boundary in FIPS v6. @@ -7215,51 +7284,51 @@ AS_CASE([$FIPS_VERSION], # Shake128 because we're testing SHAKE256 AS_IF([test "x$ENABLED_SHAKE128" = "xno" && - (test "$FIPS_VERSION" != "dev" || test "$enable_shake128" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_shake128" != "no")], [ENABLED_SHAKE128="yes"]) # Shake256 mandated for ED448 AS_IF([test "x$ENABLED_SHAKE256" = "xno" && - (test "$FIPS_VERSION" != "dev" || test "$enable_shake256" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_shake256" != "no")], [ENABLED_SHAKE256="yes"]) # Aes section AS_IF([test "$ENABLED_AESCCM" != "yes" && - (test "$FIPS_VERSION" != "dev" || test "$enable_aesccm" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_aesccm" != "no")], [ENABLED_AESCCM="yes"; AM_CFLAGS="$AM_CFLAGS -DHAVE_AESCCM"]) AS_IF([test "$ENABLED_AESCTR" != "yes" && - (test "$FIPS_VERSION" != "dev" || test "$enable_aesctr" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_aesctr" != "no")], [ENABLED_AESCTR="yes"; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_COUNTER"]) AS_IF([test "$ENABLED_CMAC" != "yes" && - (test "$FIPS_VERSION" != "dev" || test "$enable_cmac" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_cmac" != "no")], [ENABLED_CMAC="yes"; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CMAC"]) AS_IF([test "$ENABLED_AESGCM" = "no" && - (test "$FIPS_VERSION" != "dev" || test "$enable_aesgcm" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_aesgcm" != "no")], [ENABLED_AESGCM="yes"; AM_CFLAGS="$AM_CFLAGS -DHAVE_AESGCM"; AM_CCASFLAGS="$AM_CCASFLAGS -DHAVE_AESGCM"]) AS_IF([test "$ENABLED_AESGCM_STREAM" != "yes" && - (test "$FIPS_VERSION" != "dev" || test "$enable_aesgcm_stream" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_aesgcm_stream" != "no")], [ENABLED_AESGCM_STREAM="yes"]) AS_IF([test "x$ENABLED_AESOFB" = "xno" && - (test "$FIPS_VERSION" != "dev" || test "$enable_aesofb" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_aesofb" != "no")], [ENABLED_AESOFB="yes"; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_OFB"]) AS_IF([test "x$ENABLED_AESCFB" = "xno" && - (test "$FIPS_VERSION" != "dev" || test "$enable_aescfb" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_aescfb" != "no")], [ENABLED_AESCFB="yes"; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_CFB"]) AS_IF([test "x$ENABLED_AESXTS" = "xno" && - (test "$FIPS_VERSION" != "dev" || test "$enable_aesxts" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_aesxts" != "no")], [ENABLED_AESXTS="yes"; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_XTS"]) AS_IF([test "x$ENABLED_AESXTS" = "xyes" && test "x$ENABLED_AESNI" = "xyes"], [AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_AES_XTS"]) AS_IF([test "x$ENABLED_AESXTS_STREAM" = "xno" && - (test "$FIPS_VERSION" != "dev" || test "$enable_aesxts_stream" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_aesxts_stream" != "no")], [ENABLED_AESXTS_STREAM="yes"]) AS_IF([(test "$ENABLED_AESCCM" != "no" && test "$HAVE_AESCCM_PORT" != "yes") || @@ -7269,7 +7338,7 @@ AS_CASE([$FIPS_VERSION], [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_DIRECT -DHAVE_AES_ECB"]) AS_IF([test "x$ENABLED_AESKEYWRAP" != "xyes" && - (test "$FIPS_VERSION" != "dev" || test "$enable_aeskeywrap" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_aeskeywrap" != "no")], [ENABLED_AESKEYWRAP="yes"; AM_CFLAGS="$AM_CFLAGS -DHAVE_AES_KEYWRAP"]) # Old TLS requires MD5 + HMAC, which is not allowed under FIPS 140-3 @@ -7281,11 +7350,6 @@ AS_CASE([$FIPS_VERSION], [lean-aesgcm|lean-aesgcm-ready|lean-aesgcm-dev],[ - AS_IF([test "$FIPS_VERSION" = "lean-aesgcm-dev"], - [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_FIPS_DEV"]) - AS_IF([test "$FIPS_VERSION" = "lean-aesgcm-ready"], - [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_FIPS_READY"]) - AM_CFLAGS="$AM_CFLAGS \ -DHAVE_FIPS \ -DHAVE_FIPS_VERSION=$HAVE_FIPS_VERSION \ @@ -7318,19 +7382,19 @@ AS_CASE([$FIPS_VERSION], [ENABLED_WOLFSSH="no"; enable_ssh="no"]) AS_IF([test "$ENABLED_HKDF" != "no" && - (test "$FIPS_VERSION" != "lean-aesgcm-dev" || test "$enable_hkdf" != "yes")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_hkdf" != "yes")], [enable_hkdf="no"; ENABLED_HKDF="no"; AM_CFLAGS="$AM_CFLAGS -UHAVE_HKDF"]) AS_IF([test "$ENABLED_PWDBASED" != "no" && - (test "$FIPS_VERSION" != "lean-aesgcm-dev" || test "$enable_pwdbased" != "yes")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_pwdbased" != "yes")], [enable_pwdbased="no"; ENABLED_PWDBASED="no"]) AS_IF([test "$ENABLED_SRTP" != "no" && - (test "$FIPS_VERSION" != "lean-aesgcm-dev" || test "$enable_srtp" != "yes")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_srtp" != "yes")], [enable_srtp="no"; ENABLED_SRTP="no"]) AS_IF([test "$ENABLED_SRTP_KDF" != "no" && - (test "$FIPS_VERSION" != "lean-aesgcm-dev" || test "$enable_srtp_kdf" != "yes")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_srtp_kdf" != "yes")], [enable_srtp_kdf="no"; ENABLED_SRTP_KDF="no"]) AS_IF([test "$ENABLED_PKCS8" != "no" && test "$enable_pkcs8" != "yes"], @@ -7339,151 +7403,151 @@ AS_CASE([$FIPS_VERSION], # public key section AS_IF([test "$ENABLED_SP_MATH_ALL" != "no" && - (test "$FIPS_VERSION" != "lean-aesgcm-dev" || test "$enable_sp_math_all" != "yes")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_sp_math_all" != "yes")], [enable_sp_math_all="no"; ENABLED_SP_MATH_ALL="no"]) AS_IF([test "$ENABLED_KEYGEN" != "no" && - (test "$FIPS_VERSION" != "lean-aesgcm-dev" || test "$enable_keygen" != "yes")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_keygen" != "yes")], [enable_keygen="no"; ENABLED_KEYGEN="no"; AM_CFLAGS="$AM_CFLAGS -UWOLFSSL_KEY_GEN"]) AS_IF([test "$ENABLED_COMPKEY" != "no" && - (test "$FIPS_VERSION" != "lean-aesgcm-dev" || test "$enable_compkey" != "yes")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_compkey" != "yes")], [enable_compkey="no"; ENABLED_COMPKEY="no"]) AS_IF([test "$ENABLED_RSA" != "no" && - (test "$FIPS_VERSION" != "lean-aesgcm-dev" || test "$enable_rsa" != "yes")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_rsa" != "yes")], [enable_rsa="no"; ENABLED_RSA="no"; AM_CFLAGS="$AM_CFLAGS -DNO_RSA"]) AS_IF([test "$ENABLED_RSAPSS" != "no" && - (test "$FIPS_VERSION" != "lean-aesgcm-dev" || test "$enable_rsapss" != "yes")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_rsapss" != "yes")], [enable_rsapss="no"; ENABLED_RSAPSS="no"; AM_CFLAGS="$AM_CFLAGS -UWC_RSA_PSS"]) AS_IF([test "$ENABLED_DH" != "no" && - (test "$FIPS_VERSION" != "lean-aesgcm-dev" || test "$enable_dh" != "yes")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_dh" != "yes")], [enable_dh="no"; ENABLED_DH="no"; AM_CFLAGS="$AM_CFLAGS -DNO_DH"]) AS_IF([test "$ENABLED_ECC" != "no" && - (test "$FIPS_VERSION" != "lean-aesgcm-dev" || test "$enable_ecc" != "yes")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_ecc" != "yes")], [enable_ecc="no"; ENABLED_ECC="no"; ENABLED_ECCMINSZ="n/a"; ENABLED_ECC_SHAMIR="no"; AM_CFLAGS="$AM_CFLAGS -UHAVE_ECC -UTFM_ECC256 -UECC_MIN_KEY_SZ -UECC_SHAMIR"]) AS_IF([test "$ENABLED_ED25519" != "no" && - (test "$FIPS_VERSION" != "lean-aesgcm-dev" || test "$enable_ed25519" != "yes")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_ed25519" != "yes")], [enable_ed25519="no"; ENABLED_ED25519="no"; AM_CFLAGS="$AM_CFLAGS -UHAVE_ED25519 -UHAVE_ED25519_KEY_IMPORT"]) AS_IF([test "$ENABLED_CURVE25519" != "no" && - (test "$FIPS_VERSION" != "lean-aesgcm-dev" || test "$enable_curve25519" != "yes")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_curve25519" != "yes")], [enable_curve25519="no"; ENABLED_CURVE25519="no"; AM_CFLAGS="$AM_CFLAGS -UHAVE_CURVE25519"]) AS_IF([test "$ENABLED_ED448" != "no" && - (test "$FIPS_VERSION" != "lean-aesgcm-dev" || test "$enable_ed448" != "yes")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_ed448" != "yes")], [enable_ed448="no"; ENABLED_ED448="no"; AM_CFLAGS="$AM_CFLAGS -UHAVE_ED448 -UHAVE_ED448_KEY_IMPORT"]) AS_IF([test "$ENABLED_CURVE448" != "no" && - (test "$FIPS_VERSION" != "lean-aesgcm-dev" || test "$enable_curve448" != "yes")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_curve448" != "yes")], [enable_curve448="no"; ENABLED_CURVE448="no"; AM_CFLAGS="$AM_CFLAGS -UHAVE_CURVE448"]) AS_IF([test "$ENABLED_ED25519_STREAM" != "no" && - (test "$FIPS_VERSION" != "lean-aesgcm-dev" || test "$enable_ed25519_stream" != "yes")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_ed25519_stream" != "yes")], [enable_ed25519_stream="no"; ENABLED_ED25519_STREAM="no"]) AS_IF([test "$ENABLED_ED448_STREAM" != "no" && - (test "$FIPS_VERSION" != "lean-aesgcm-dev" || test "$enable_ed448_stream" != "yes")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_ed448_stream" != "yes")], [enable_ed448_stream="no"; ENABLED_ED448_STREAM="no"]) AS_IF([test "$ENABLED_ECCCUSTCURVES" != "no" && - test "$FIPS_VERSION" != "lean-aesgcm-dev"], + test "$ENABLED_FIPS_DEV" != "yes"], [ENABLED_ECCCUSTCURVES="no"]) # Hashing section AS_IF([test "$ENABLED_SHA" != "no" && - (test "$FIPS_VERSION" != "lean-aesgcm-dev" || test "$enable_sha" != "yes")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_sha" != "yes")], [enable_sha="no"; ENABLED_SHA="no"; AM_CFLAGS="$AM_CFLAGS -DNO_SHA"]) AS_IF([test "$ENABLED_SHA256" = "no" && - (test "$FIPS_VERSION" != "lean-aesgcm-dev" || test "$enable_sha256" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_sha256" != "no")], [enable_sha256="yes"; ENABLED_SHA256="yes"; AM_CFLAGS="$AM_CFLAGS -UNO_SHA256"]) AS_IF([test "$ENABLED_SHA3" != "no" && - (test "$FIPS_VERSION" != "lean-aesgcm-dev" || test "$enable_sha3" != "yes")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_sha3" != "yes")], [enable_sha3="no"; ENABLED_SHA3="no"; AM_CFLAGS="$AM_CFLAGS -UWOLFSSL_SHA3"]) AS_IF([test "$ENABLED_SHAKE128" != "no" && - (test "$FIPS_VERSION" != "lean-aesgcm-dev" || test "$enable_shake128" != "yes")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_shake128" != "yes")], [enable_shake128="no"; ENABLED_SHAKE128="no"]) AS_IF([test "$ENABLED_SHAKE256" != "no" && - (test "$FIPS_VERSION" != "lean-aesgcm-dev" || test "$enable_shake256" != "yes")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_shake256" != "yes")], [enable_shake256="no"; ENABLED_SHAKE256="no"]) AS_IF([test "$ENABLED_SHA224" != "no" && - (test "$FIPS_VERSION" != "lean-aesgcm-dev" || test "$enable_sha224" != "yes")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_sha224" != "yes")], [enable_sha224="no"; ENABLED_SHA224="no"; AM_CFLAGS="$AM_CFLAGS -UWOLFSSL_SHA224"]) AS_IF([test "$ENABLED_SHA384" != "no" && - (test "$FIPS_VERSION" != "lean-aesgcm-dev" || test "$enable_sha384" != "yes")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_sha384" != "yes")], [enable_sha384="no"; ENABLED_SHA384="no"; AM_CFLAGS="$AM_CFLAGS -UWOLFSSL_SHA384 -UWOLFSSL_SHA384"]) AS_IF([test "$ENABLED_SHA512" = "no" && - (test "$FIPS_VERSION" != "lean-aesgcm-dev" || test "$enable_sha512" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_sha512" != "no")], [enable_sha512="yes"; ENABLED_SHA512="yes"; ENABLED_SHA512_DRBG="yes"; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SHA512 -DWOLFSSL_SHA384"]) # SHA512-224 and SHA512-256 are SHA-2 algorithms not in our FIPS algorithm list AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_NOSHA512_224 -DWOLFSSL_NOSHA512_256" AS_IF([test "$ENABLED_SHAKE128" != "no" && - (test "$FIPS_VERSION" != "lean-aesgcm-dev" || test "$enable_shake128" != "yes")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_shake128" != "yes")], [enable_shake128="no"; ENABLED_SHAKE128="no"]) AS_IF([test "$ENABLED_SHAKE256" != "no" && - (test "$FIPS_VERSION" != "lean-aesgcm-dev" || test "$enable_shake256" != "yes")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_shake256" != "yes")], [enable_shake256="no"; ENABLED_SHAKE256="no"]) AS_IF([test "$ENABLED_MLKEM" != "no" && - (test "$FIPS_VERSION" != "lean-aesgcm-dev" || test "$enable_mlkem" != "yes")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_mlkem" != "yes")], [enable_mlkem="no"; ENABLED_MLKEM="no"]) AS_IF([test "$ENABLED_MD5" != "no" && - (test "$FIPS_VERSION" != "lean-aesgcm-dev" || test "$enable_md5" != "yes")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_md5" != "yes")], [enable_md5="no"; ENABLED_MD5="no"; AM_CFLAGS="$AM_CFLAGS -DNO_MD5"]) # Aes section AS_IF([test "$ENABLED_AESCBC" != "no" && - (test "$FIPS_VERSION" != "lean-aesgcm-dev" || test "$enable_aescbc" != "yes")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_aescbc" != "yes")], [enable_aescbc="no"; ENABLED_AESCBC="no"; AM_CFLAGS="$AM_CFLAGS -DNO_AES_CBC"]) AS_IF([test "$ENABLED_AESCCM" != "no" && - (test "$FIPS_VERSION" != "lean-aesgcm-dev" || test "$enable_aesccm" != "yes")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_aesccm" != "yes")], [enable_aesccm="no"; ENABLED_AESCCM="no"; AM_CFLAGS="$AM_CFLAGS -UHAVE_AESCCM"]) AS_IF([test "$ENABLED_AESCTR" != "no" && - (test "$FIPS_VERSION" != "lean-aesgcm-dev" || test "$enable_aesctr" != "yes")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_aesctr" != "yes")], [enable_aesctr="no"; ENABLED_AESCTR="no"; AM_CFLAGS="$AM_CFLAGS -UWOLFSSL_AES_COUNTER"]) AS_IF([test "$ENABLED_CMAC" != "no" && - (test "$FIPS_VERSION" != "lean-aesgcm-dev" || test "$enable_cmac" != "yes")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_cmac" != "yes")], [enable_cmac="no"; ENABLED_CMAC="no"; AM_CFLAGS="$AM_CFLAGS -UWOLFSSL_CMAC"]) AS_IF([test "$ENABLED_AESGCM" = "no" && - (test "$FIPS_VERSION" != "lean-aesgcm-dev" || test "$enable_aesgcm" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_aesgcm" != "no")], [ENABLED_AESGCM="yes"; AM_CFLAGS="$AM_CFLAGS -DHAVE_AESGCM"; AM_CCASFLAGS="$AM_CCASFLAGS -DHAVE_AESGCM"]) AS_IF([test "$ENABLED_AESGCM_STREAM" != "yes" && - (test "$FIPS_VERSION" != "lean-aesgcm-dev" || test "$enable_aesgcm_stream" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_aesgcm_stream" != "no")], [ENABLED_AESGCM_STREAM="yes"]) AS_IF([test "$ENABLED_AESOFB" != "no" && - (test "$FIPS_VERSION" != "lean-aesgcm-dev" || test "$enable_aesofb" != "yes")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_aesofb" != "yes")], [enable_aesofb="no"; ENABLED_AESOFB="no"; AM_CFLAGS="$AM_CFLAGS -UWOLFSSL_AES_OFB"]) AS_IF([test "$ENABLED_AESCFB" != "no" && - (test "$FIPS_VERSION" != "lean-aesgcm-dev" || test "$enable_aescfb" != "yes")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_aescfb" != "yes")], [enable_aescfb="no"; ENABLED_AESCFB="no"; AM_CFLAGS="$AM_CFLAGS -UWOLFSSL_AES_CFB"]) AS_IF([test "$ENABLED_AESXTS" != "no" && - (test "$FIPS_VERSION" != "lean-aesgcm-dev" || test "$enable_aesxts" != "yes")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_aesxts" != "yes")], [enable_aesxts="no"; ENABLED_AESXTS="no"; AM_CFLAGS="$AM_CFLAGS -UWOLFSSL_AES_XTS"]) AS_IF([test "$ENABLED_AESXTS" = "yes" && test "$ENABLED_AESNI" = "yes"], [AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_AES_XTS"]) AS_IF([test "$ENABLED_AESXTS_STREAM" != "no" && - (test "$FIPS_VERSION" != "lean-aesgcm-dev" || test "$enable_aesxts_stream" != "yes")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_aesxts_stream" != "yes")], [enable_aesxts_stream="no"; ENABLED_AESXTS_STREAM="no"]) AS_IF([(test "$ENABLED_AESCCM" != "no" && test "$HAVE_AESCCM_PORT" != "yes") || @@ -7493,7 +7557,7 @@ AS_CASE([$FIPS_VERSION], [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_DIRECT -DHAVE_AES_ECB"]) AS_IF([test "$ENABLED_AESKEYWRAP" != "no" && - (test "$FIPS_VERSION" != "lean-aesgcm-dev" || test "$enable_aeskeywrap" != "yes")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_aeskeywrap" != "yes")], [enable_aeskeywrap="no"; ENABLED_AESKEYWRAP="no"; AM_CFLAGS="$AM_CFLAGS -UHAVE_AES_KEYWRAP"]) # Old TLS requires MD5 + HMAC, which is not allowed under FIPS 140-3 @@ -7539,19 +7603,19 @@ AS_CASE([$FIPS_VERSION], # force various features to FIPS 140-3 defaults, unless overridden with dev: AS_IF([test "$ENABLED_KEYGEN" != "yes" && - (test "$FIPS_VERSION" != "v5-dev" || test "$enable_keygen" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_keygen" != "no")], [ENABLED_KEYGEN="yes"; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KEY_GEN"]) AS_IF([test "$ENABLED_SHA224" != "yes" && - (test "$FIPS_VERSION" != "v5-dev" || test "$enable_sha224" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_sha224" != "no")], [ENABLED_SHA224="yes"; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SHA224"]) AS_IF([test "$ENABLED_SHA3" != "yes" && - (test "$FIPS_VERSION" != "v5-dev" || test "$enable_sha3" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_sha3" != "no")], [ENABLED_SHA3="yes"; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SHA3"]) AS_IF([test "$ENABLED_WOLFSSH" != "yes" && - (test "$FIPS_VERSION" != "v5-dev" || test "$enable_ssh" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_ssh" != "no")], [enable_ssh="yes"]) # Shake128 is a SHA-3 algorithm outside the v5 FIPS algorithm list @@ -7570,7 +7634,7 @@ AS_CASE([$FIPS_VERSION], AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_NOSHA512_224 -DWOLFSSL_NOSHA512_256" AS_IF([test "$ENABLED_AESCCM" != "yes" && - (test "$FIPS_VERSION" != "v5-dev" || test "$enable_aesccm" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_aesccm" != "no")], [ENABLED_AESCCM="yes"; AM_CFLAGS="$AM_CFLAGS -DHAVE_AESCCM"]) AS_IF([test "$ENABLED_AESXTS" = "yes" && @@ -7579,37 +7643,37 @@ AS_CASE([$FIPS_VERSION], ENABLED_AESXTS="no"]) AS_IF([test "$ENABLED_RSAPSS" != "yes" && - (test "$FIPS_VERSION" != "v5-dev" || test "$enable_rsapss" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_rsapss" != "no")], [ENABLED_RSAPSS="yes"; AM_CFLAGS="$AM_CFLAGS -DWC_RSA_PSS"]) AS_IF([test "$ENABLED_ECC" != "yes" && - (test "$FIPS_VERSION" != "v5-dev" || test "$enable_ecc" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_ecc" != "no")], [ENABLED_ECC="yes"; AM_CFLAGS="$AM_CFLAGS -DHAVE_ECC -DTFM_ECC256" AS_IF([test "$ENABLED_ECC_SHAMIR" = "yes" && - (test "$FIPS_VERSION" != "v5-dev" || test "$enable_eccshamir" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_eccshamir" != "no")], [AM_CFLAGS="$AM_CFLAGS -DECC_SHAMIR"])]) AS_IF([test "$ENABLED_AESCTR" != "yes" && - (test "$FIPS_VERSION" != "v5-dev" || test "$enable_aesctr" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_aesctr" != "no")], [ENABLED_AESCTR="yes"; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_COUNTER"]) AS_IF([test "$ENABLED_CMAC" != "yes" && - (test "$FIPS_VERSION" != "v5-dev" || test "$enable_cmac" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_cmac" != "no")], [ENABLED_CMAC="yes"; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CMAC"]) AS_IF([test "$ENABLED_HKDF" != "yes" && - (test "$FIPS_VERSION" != "v5-dev" || test "$enable_hkdf" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_hkdf" != "no")], [ENABLED_HKDF="yes"; AM_CFLAGS="$AM_CFLAGS -DHAVE_HKDF"]) AS_IF([test "$ENABLED_INTELRDSEED" = "yes" || test "$ENABLED_AMDRDSEED" = "yes" ], [AM_CFLAGS="$AM_CFLAGS -DFORCE_FAILURE_RDSEED"]) AS_IF([test "$ENABLED_SHA512" = "no" && - (test "$FIPS_VERSION" != "v5-dev" || test "$enable_sha512" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_sha512" != "no")], [ENABLED_SHA512="yes"; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SHA512 -DWOLFSSL_SHA384"]) AS_IF([test "$ENABLED_AESGCM" = "no" && - (test "$FIPS_VERSION" != "v5-dev" || test "$enable_aesgcm" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_aesgcm" != "no")], [ENABLED_AESGCM="yes"; AM_CFLAGS="$AM_CFLAGS -DHAVE_AESGCM"; AM_CCASFLAGS="$AM_CCASFLAGS -DHAVE_AESGCM"]) # AES-GCM streaming isn't part of the v5 FIPS suite. @@ -7625,7 +7689,7 @@ AS_CASE([$FIPS_VERSION], AS_IF([test $HAVE_FIPS_VERSION_MINOR -ge 2], [AS_IF([test "x$ENABLED_AESOFB" = "xno" && - (test "$FIPS_VERSION" != "v5-dev" || test "$enable_aesofb" != "no")], + (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_aesofb" != "no")], [ENABLED_AESOFB="yes"; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_OFB"])]) AS_IF([test "$ENABLED_SRTP" != "no" && @@ -7726,10 +7790,10 @@ AS_CASE([$FIPS_VERSION], AS_IF([test "x$ENABLED_DES3" = "xno"],[ENABLED_DES3="yes"]) ]) -AS_IF([test "x$ENABLED_FIPS" = "xyes" && test "x$thread_ls_on" = "xno" && test "$ENABLE_LINUXKM" = "no"], +AS_IF([test "x$ENABLED_FIPS" = "xyes" && test "x$thread_ls_on" = "xno" && test "$ENABLE_LINUXKM" = "no" && test "$FIPS_VERSION" != "dev-no-post"], [AC_MSG_ERROR([FIPS requires Thread Local Storage])]) -AS_IF([(test "$ENABLED_NULL_CIPHER" = "yes" || test "$ENABLED_LEANPSK" = "yes") && test "$ENABLED_FIPS" != "no" && test "$FIPS_VERSION" != "dev" && test "$FIPS_VERSION" != "v5-dev"], +AS_IF([(test "$ENABLED_NULL_CIPHER" = "yes" || test "$ENABLED_LEANPSK" = "yes") && test "$ENABLED_FIPS" != "no" && test "$ENABLED_FIPS_DEV" != "yes"], [AC_MSG_ERROR([FIPS is incompatible with nullcipher])]) # SELFTEST @@ -8509,7 +8573,7 @@ fi # FIPS override: Hash DRBG is mandatory if test "$ENABLED_HASHDRBG" != "yes" && test "$ENABLED_FIPS" = "yes" && - test "$FIPS_VERSION" != "dev" && test "$ENABLED_KCAPI" = "no" + test "$ENABLED_FIPS_DEV" != "yes" && test "$ENABLED_KCAPI" = "no" then if test "$enable_hashdrbg" = "no" then @@ -12845,7 +12909,7 @@ AX_HARDEN_CC_COMPILER_FLAGS if test "$ENABLED_SELFTEST" = yes || test "$ENABLED_FIPS" = yes then - if ! test "$ENABLED_FIPS_DEV" = yes && ! test "$ENABLED_FIPS_READY" = yes + if test $HAVE_FIPS_VERSION_MAJOR -lt 7 then # rsa.c wc_hash2mgf() switches on enum wc_HashType, which is defined # outside the FIPS boundary. Unsupported hashes are correctly handled @@ -13082,6 +13146,7 @@ AM_CONDITIONAL([BUILD_FIPS_V6],[test $HAVE_FIPS_VERSION = 6]) AM_CONDITIONAL([BUILD_FIPS_V6_PLUS],[test $HAVE_FIPS_VERSION -ge 6]) AM_CONDITIONAL([BUILD_FIPS_V7],[test $HAVE_FIPS_VERSION = 7]) AM_CONDITIONAL([BUILD_FIPS_V7_PLUS],[test $HAVE_FIPS_VERSION -ge 7]) +AM_CONDITIONAL([BUILD_FIPS_NO_POST],[test "$FIPS_VERSION" = "dev-no-post"]) AM_CONDITIONAL([BUILD_SIPHASH],[test "x$ENABLED_SIPHASH" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"]) AM_CONDITIONAL([BUILD_CMAC],[test "x$ENABLED_CMAC" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"]) AM_CONDITIONAL([BUILD_SHE],[test "x$ENABLED_SHE" = "xstandard" || test "x$ENABLED_SHE" = "xextended" || test "x$ENABLED_USERSETTINGS" = "xyes"]) diff --git a/linuxkm/linuxkm_wc_port.h b/linuxkm/linuxkm_wc_port.h index 77b395d8bd2..d123c678228 100644 --- a/linuxkm/linuxkm_wc_port.h +++ b/linuxkm/linuxkm_wc_port.h @@ -930,10 +930,12 @@ extern int wolfCrypt_FIPS_SHA3_sanity(void); extern const unsigned int wolfCrypt_FIPS_sha3_ro_sanity[2]; #endif +#ifndef WOLFSSL_FIPS_DEV_NO_POST extern int wolfCrypt_FIPS_FT_sanity(void); extern const unsigned int wolfCrypt_FIPS_ft_ro_sanity[2]; extern const unsigned int wolfCrypt_FIPS_f_ro_sanity[2]; extern int wc_RunAllCast_fips(void); +#endif #endif #endif @@ -1266,10 +1268,12 @@ typeof(wolfCrypt_FIPS_SHA3_sanity) *wolfCrypt_FIPS_SHA3_sanity; typeof(wolfCrypt_FIPS_sha3_ro_sanity) *wolfCrypt_FIPS_sha3_ro_sanity; #endif +#ifndef WOLFSSL_FIPS_DEV_NO_POST typeof(wolfCrypt_FIPS_FT_sanity) *wolfCrypt_FIPS_FT_sanity; typeof(wolfCrypt_FIPS_ft_ro_sanity) *wolfCrypt_FIPS_ft_ro_sanity; typeof(wolfCrypt_FIPS_f_ro_sanity) *wolfCrypt_FIPS_f_ro_sanity; typeof(wc_RunAllCast_fips) *wc_RunAllCast_fips; +#endif #endif /* FIPS_VERSION3_GE(6,0,0) */ #endif /* HAVE_FIPS */ diff --git a/linuxkm/module_hooks.c b/linuxkm/module_hooks.c index bb64ce959cd..888343b9da6 100644 --- a/linuxkm/module_hooks.c +++ b/linuxkm/module_hooks.c @@ -40,6 +40,9 @@ #include #endif #include + #if defined(WOLFSSL_FIPS_DEV_NO_POST) && !defined(WC_USE_PIE_FENCEPOSTS_FOR_FIPS) + #define WC_USE_PIE_FENCEPOSTS_FOR_FIPS + #endif #endif #if !defined(NO_CRYPT_TEST) || defined(LINUXKM_LKCAPI_REGISTER) #include @@ -91,7 +94,7 @@ static int libwolfssl_cleanup(void) { return ret; } -#ifdef HAVE_FIPS +#if defined(HAVE_FIPS) && !defined(WOLFSSL_FIPS_DEV_NO_POST) /* failsafe definitions for FIPS <5.3 */ #ifndef FIPS_IN_CORE_DIGEST_SIZE #ifndef NO_SHA256 @@ -630,7 +633,7 @@ static int wolfssl_init(void) } #endif /* WC_LINUXKM_TEST_INET_PTON */ -#ifdef HAVE_FIPS +#if defined(HAVE_FIPS) && !defined(WOLFSSL_FIPS_DEV_NO_POST) /* The compiled-in verifycore must be the right length, else the module * geometry will change when the correct value is passed in, destabilizing * wc_linuxkm_pie_text_reloc_tab. It also must be the right length for the @@ -1217,7 +1220,7 @@ static const struct wc_reloc_table_segments seg_map = { .fips_rodata_start = (size_t)(uintptr_t)wolfCrypt_FIPS_ro_start, .fips_rodata_end = (size_t)(uintptr_t)wolfCrypt_FIPS_ro_end, #endif - #if FIPS_VERSION3_GE(6,0,0) || defined(WOLFCRYPT_FIPS_CORE_DYNAMIC_HASH_VALUE) + #if (FIPS_VERSION3_GE(6,0,0) || defined(WOLFCRYPT_FIPS_CORE_DYNAMIC_HASH_VALUE)) && !defined(WOLFSSL_FIPS_DEV_NO_POST) .verifyCore_start = (uintptr_t)verifyCore, .verifyCore_end = (uintptr_t)verifyCore + FIPS_IN_CORE_DIGEST_SIZE*2 + 1, #endif @@ -1284,7 +1287,7 @@ static const struct wc_reloc_table_segments seg_map = { .fips_rodata_start = (size_t)(uintptr_t)wolfCrypt_FIPS_ro_start, .fips_rodata_end = (size_t)(uintptr_t)wolfCrypt_FIPS_ro_end, #endif - #if FIPS_VERSION3_GE(6,0,0) || defined(WOLFCRYPT_FIPS_CORE_DYNAMIC_HASH_VALUE) + #if (FIPS_VERSION3_GE(6,0,0) || defined(WOLFCRYPT_FIPS_CORE_DYNAMIC_HASH_VALUE)) && !defined(WOLFSSL_FIPS_DEV_NO_POST) .verifyCore_start = (uintptr_t)verifyCore, .verifyCore_end = (uintptr_t)verifyCore + FIPS_IN_CORE_DIGEST_SIZE*2 + 1 #endif @@ -1664,6 +1667,8 @@ static int set_up_wolfssl_linuxkm_pie_redirect_table(void) { wolfssl_linuxkm_pie_redirect_table.wolfCrypt_FIPS_sha3_ro_sanity = &wolfCrypt_FIPS_sha3_ro_sanity; #endif + +#ifndef WOLFSSL_FIPS_DEV_NO_POST wolfssl_linuxkm_pie_redirect_table.wolfCrypt_FIPS_FT_sanity = wolfCrypt_FIPS_FT_sanity; wolfssl_linuxkm_pie_redirect_table.wolfCrypt_FIPS_ft_ro_sanity = @@ -1672,7 +1677,9 @@ static int set_up_wolfssl_linuxkm_pie_redirect_table(void) { &wolfCrypt_FIPS_f_ro_sanity; wolfssl_linuxkm_pie_redirect_table.wc_RunAllCast_fips = wc_RunAllCast_fips; - #endif +#endif /* !WOLFSSL_FIPS_DEV_NO_POST */ + + #endif /* FIPS_VERSION3_GE(6,0,0) */ #endif #if !defined(WOLFCRYPT_ONLY) && !defined(NO_CERTS) diff --git a/src/include.am b/src/include.am index fa0e24a40be..240410ec440 100644 --- a/src/include.am +++ b/src/include.am @@ -933,9 +933,11 @@ src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/wolfcrypt_last.c endif BUILD_FIPS_V6 if BUILD_FIPS_V7_PLUS +if !BUILD_FIPS_NO_POST # FIPS 140-3 v7.0.0+ first file src_libwolfssl@LIBSUFFIX@_la_SOURCES += \ wolfcrypt/src/wolfcrypt_first.c +endif !BUILD_FIPS_NO_POST src_libwolfssl@LIBSUFFIX@_la_SOURCES += \ wolfcrypt/src/hmac.c \ @@ -1359,13 +1361,17 @@ if BUILD_WC_SLHDSA src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/wc_slhdsa.c endif +if !BUILD_FIPS_NO_POST + src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/fips.c \ wolfcrypt/src/fips_test.c # fips last file src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/wolfcrypt_last.c -endif BUILD_FIPS_V7_PLUS +endif !BUILD_FIPS_NO_POST + +endif BUILD_FIPS_V7_PLUS endif BUILD_FIPS diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index 2953550ae90..24f4926c0ae 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -10144,7 +10144,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t hmac_sha256_test(void) #if !defined(HAVE_FIPS) || FIPS_VERSION3_GE(6,0,0) if ((ret = wc_HmacSizeByType(WC_SHA256)) != WC_SHA256_DIGEST_SIZE) return WC_TEST_RET_ENC_EC(ret); -#if FIPS_VERSION3_GE(6,0,0) +#if FIPS_VERSION3_GE(6,0,0) && !defined(WOLFSSL_FIPS_DEV_NO_POST) if ((ret = wc_HmacSizeByType(21)) != WC_NO_ERR_TRACE(HMAC_KAT_FIPS_E)) #else if ((ret = wc_HmacSizeByType(21)) != WC_NO_ERR_TRACE(BAD_FUNC_ARG)) diff --git a/wolfssl/wolfcrypt/fips_test.h b/wolfssl/wolfcrypt/fips_test.h index dc247b272bd..f432692ac79 100644 --- a/wolfssl/wolfcrypt/fips_test.h +++ b/wolfssl/wolfcrypt/fips_test.h @@ -119,6 +119,19 @@ enum FipsModeId { /* FIPS failure callback */ typedef void(*wolfCrypt_fips_cb)(int ok, int err, const char* hash); +#ifdef WOLFSSL_FIPS_DEV_NO_POST + #define wc_RunAllCast_fips() 0 + static WC_INLINE int wolfCrypt_SetCb_fips(wolfCrypt_fips_cb cbf) { + (void)cbf; + return 0; + } + #define wolfCrypt_GetVersion_fips() "wolfCrypt DEV_NO_POST" + #define wolfCrypt_GetStatus_fips() 0 + #define wolfCrypt_GetCoreHash_fips() "" + #define wolfCrypt_IntegrityTest_fips() 0 + #define fipsEntry() WC_DO_NOTHING +#else /* !WOLFSSL_FIPS_DEV_NO_POST */ + /* Public set function */ WOLFSSL_API int wolfCrypt_SetCb_fips(wolfCrypt_fips_cb cbf); @@ -148,6 +161,8 @@ WOLFSSL_API int wc_RunAllCast_fips(void); void fipsEntry(void); #endif +#endif /* !WOLFSSL_FIPS_DEV_NO_POST */ + #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index 4b714610f61..7855fec4d4e 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -402,6 +402,11 @@ #define FIPS_NO_WRAPPERS #endif +#ifdef WOLFSSL_FIPS_DEV_NO_POST + /* Inhibit inclusion of fips.h for no-POST fips-dev. */ + #define WOLF_CRYPT_FIPS_H +#endif + /* Microsoft's ARM64 compiler defines _M_ARM64 but not __aarch64__. The wolfSSL * ARMv8 assembly (WOLFSSL_ARMASM) and all of its C callers are gated on * __aarch64__, so map _M_ARM64 across when building that assembly with MSVC and @@ -486,15 +491,12 @@ #include /*------------------------------------------------------------*/ -#if defined(WOLFSSL_FIPS_READY) || defined(WOLFSSL_FIPS_DEV) - #undef HAVE_FIPS_VERSION_MAJOR +#if (defined(WOLFSSL_FIPS_READY) || defined(WOLFSSL_FIPS_DEV)) && \ + !defined(HAVE_FIPS_VERSION) #define HAVE_FIPS_VERSION_MAJOR 7 /* always one more than major version */ - /* of most recent FIPS certificate */ - #undef HAVE_FIPS_VERSION + /* of most recent FIPS submission */ #define HAVE_FIPS_VERSION HAVE_FIPS_VERSION_MAJOR - #undef HAVE_FIPS_VERSION_MINOR #define HAVE_FIPS_VERSION_MINOR 0 /* always 0 */ - #undef HAVE_FIPS_VERSION_PATCH #define HAVE_FIPS_VERSION_PATCH 0 /* always 0 */ #endif diff --git a/wolfssl/wolfcrypt/types.h b/wolfssl/wolfcrypt/types.h index 31ae10fda88..e60dc3d94da 100644 --- a/wolfssl/wolfcrypt/types.h +++ b/wolfssl/wolfcrypt/types.h @@ -2431,16 +2431,16 @@ WOLFSSL_API word32 CheckRunTimeSettings(void); #define WC_SANITIZE_ENABLE() WC_DO_NOTHING #endif -#if FIPS_VERSION_GE(5,1) - #define WC_SPKRE_F(x,y) wolfCrypt_SetPrivateKeyReadEnable_fips((x),(y)) +#if FIPS_VERSION_GE(5,1) && !defined(WOLFSSL_FIPS_DEV_NO_POST) + #define WC_SPKRE_F(x,y) wolfCrypt_SetPrivateKeyReadEnable_fips(x, y) #define PRIVATE_KEY_LOCK() WC_SPKRE_F(0,WC_KEYTYPE_ALL) #define PRIVATE_KEY_UNLOCK() WC_SPKRE_F(1,WC_KEYTYPE_ALL) #else + #define wolfCrypt_SetPrivateKeyReadEnable_fips(x, y) 0 #define PRIVATE_KEY_LOCK() WC_DO_NOTHING #define PRIVATE_KEY_UNLOCK() WC_DO_NOTHING #endif - #ifdef _MSC_VER /* disable buggy MSC warning (incompatible with clang-tidy * readability-avoid-const-params-in-decls) diff --git a/wolfssl/wolfcrypt/wc_compat.h b/wolfssl/wolfcrypt/wc_compat.h index 9a820f49a91..1a82433b2b3 100644 --- a/wolfssl/wolfcrypt/wc_compat.h +++ b/wolfssl/wolfcrypt/wc_compat.h @@ -32,7 +32,7 @@ (defined(WOLF_CRYPT_AES_H) && !defined(NO_AES) && \ !defined(WC_AES_TYPE_DEFINED) && !defined(CTAO_CRYPT_AES_H)) || \ (defined(WOLF_CRYPT_RANDOM_H) && !defined(WC_RNG_TYPE_DEFINED)) || \ - (defined(WOLF_CRYPT_FIPS_H) && \ + (defined(WOLF_CRYPT_FIPS_H) && !defined(WOLFSSL_FIPS_DEV_NO_POST) && \ !defined(fipsCastStatus_get) && !defined(wc_Des3_SetKey) && \ !defined(WC_DES3_TYPE_DEFINED)) || \ (defined(WOLF_CRYPT_FIPS_TEST_H) && \ @@ -55,8 +55,7 @@ #endif #if defined(HAVE_FIPS) && defined(HAVE_AESGCM) && \ - !defined(WC_FIPS_AESGCM_ONE_SHOT_EXT_IV_ALLOWED) && \ - !defined(FIPS_NO_WRAPPERS) + !defined(WC_FIPS_AESGCM_ONE_SHOT_EXT_IV_ALLOWED) /* Unless WC_FIPS_AESGCM_ONE_SHOT_EXT_IV_ALLOWED, wc_AesGcmEncrypt() is a * non-FIPS API hardwired to FIPS_WRONG_API_E in fips.c. But we can emulate From be988c508d9f3bfff685edb1a6eb442411f3ace9 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Mon, 3 Aug 2026 23:35:26 -0500 Subject: [PATCH 06/44] tests/unit.h: pull in wolfssl/wolfcrypt/fips_test.h, for the WOLFSSL_FIPS_DEV_NO_POST stubs. --- tests/unit.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/unit.h b/tests/unit.h index 49b6b1a2018..c52f955a781 100644 --- a/tests/unit.h +++ b/tests/unit.h @@ -39,6 +39,7 @@ #include #include /* thread and tcp stuff */ +#include #ifdef WOLFSSL_FORCE_MALLOC_FAIL_TEST #define XABORT() WC_DO_NOTHING From df972c52665f9c13a72324f60e7efe73cb583871 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Mon, 3 Aug 2026 23:36:17 -0500 Subject: [PATCH 07/44] wolfcrypt/test/test.c: fix PRIVATE_KEY_UNLOCK() call placement to assure unconditional matching of PRIVATE_KEY_UNLOCK() regardless of intervening error code collection. --- wolfcrypt/test/test.c | 86 ++++++++++++++++++++++++++----------------- 1 file changed, 52 insertions(+), 34 deletions(-) diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index 24f4926c0ae..51cd6dbc512 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -2689,51 +2689,56 @@ options: [-s max_relative_stack_bytes] [-m max_relative_heap_memory_bytes]\n\ #if defined(HAVE_HKDF) && !defined(NO_HMAC) PRIVATE_KEY_UNLOCK(); - if ( (ret = hkdf_test()) != 0) + ret = hkdf_test(); + PRIVATE_KEY_LOCK(); + if (ret != 0) TEST_FAIL("HMAC-KDF test failed!\n", ret); else TEST_PASS("HMAC-KDF test passed!\n"); - PRIVATE_KEY_LOCK(); #endif #endif /* !NO_HMAC */ #ifdef WOLFSSL_WOLFSSH PRIVATE_KEY_UNLOCK(); - if ( (ret = sshkdf_test()) != 0) + ret = sshkdf_test(); + PRIVATE_KEY_LOCK(); + if (ret != 0) TEST_FAIL("SSH-KDF test failed!\n", ret); else TEST_PASS("SSH-KDF test passed!\n"); - PRIVATE_KEY_LOCK(); #endif /* WOLFSSL_WOLFSSH */ #if defined(WOLFSSL_HAVE_PRF) && !defined(NO_HMAC) && \ defined(WOLFSSL_SHA384) && !defined(WOLFSSL_NO_TLS12) PRIVATE_KEY_UNLOCK(); - if ( (ret = prf_test()) != 0) + ret = prf_test(); + PRIVATE_KEY_LOCK(); + if (ret != 0) TEST_FAIL("PRF test failed!\n", ret); else TEST_PASS("PRF test passed!\n"); - PRIVATE_KEY_LOCK(); #endif /* WOLFSSL_HAVE_PRF && !NO_HMAC && WOLFSSL_SHA384 && !WOLFSSL_NO_TLS12 */ #if defined(WOLFSSL_HAVE_PRF) && defined(HAVE_HKDF) && !defined(NO_HMAC) && \ defined(WOLFSSL_BASE16) && !defined(WOLFSSL_NO_TLS12) PRIVATE_KEY_UNLOCK(); - if ( (ret = tls12_kdf_test()) != 0) + ret = tls12_kdf_test(); + PRIVATE_KEY_LOCK(); + if (ret != 0) TEST_FAIL("TLSv1.2 KDF test failed!\n", ret); else TEST_PASS("TLSv1.2 KDF test passed!\n"); - PRIVATE_KEY_LOCK(); #endif /* WOLFSSL_HAVE_PRF && HAVE_HKDF && !NO_HMAC && */ /* WOLFSSL_BASE16 && !WOLFSSL_NO_TLS12 */ #if defined(WOLFSSL_TLS13) && !defined(NO_HMAC) PRIVATE_KEY_UNLOCK(); - if ( (ret = tls13_kdf_test()) != 0) + ret = tls13_kdf_test(); + PRIVATE_KEY_LOCK(); + if (ret != 0) TEST_FAIL("TLSv1.3 KDF test failed!\n", ret); else TEST_PASS("TLSv1.3 KDF test passed!\n"); - PRIVATE_KEY_LOCK(); #endif /* WOLFSSL_TLS13 && !NO_HMAC */ #if defined(HAVE_X963_KDF) && defined(HAVE_ECC) @@ -2748,20 +2753,22 @@ options: [-s max_relative_stack_bytes] [-m max_relative_heap_memory_bytes]\n\ defined(HAVE_CURVE448)) && \ defined(HAVE_AESGCM) PRIVATE_KEY_UNLOCK(); - if ( (ret = hpke_test()) != 0) + ret = hpke_test(); + PRIVATE_KEY_LOCK(); + if (ret != 0) TEST_FAIL("HPKE test failed!\n", ret); else TEST_PASS("HPKE test passed!\n"); - PRIVATE_KEY_LOCK(); #endif #if defined(WC_SRTP_KDF) PRIVATE_KEY_UNLOCK(); - if ( (ret = srtpkdf_test()) != 0) + ret = srtpkdf_test(); + PRIVATE_KEY_LOCK(); + if (ret != 0) TEST_FAIL("SRTP KDF test failed!\n", ret); else TEST_PASS("SRTP KDF test passed!\n"); - PRIVATE_KEY_LOCK(); #endif #if defined(WC_KDF_NIST_SP_800_56C) && \ @@ -3036,11 +3043,13 @@ options: [-s max_relative_stack_bytes] [-m max_relative_heap_memory_bytes]\n\ #ifndef NO_DH PRIVATE_KEY_UNLOCK(); - if ( (ret = dh_test()) != 0) + ret = dh_test(); + PRIVATE_KEY_LOCK(); + + if (ret != 0) TEST_FAIL("DH test failed!\n", ret); else TEST_PASS("DH test passed!\n"); - PRIVATE_KEY_LOCK(); #endif #ifndef NO_DSA @@ -3059,11 +3068,12 @@ options: [-s max_relative_stack_bytes] [-m max_relative_heap_memory_bytes]\n\ #ifndef NO_PWDBASED PRIVATE_KEY_UNLOCK(); - if ( (ret = pwdbased_test()) != 0) + ret = pwdbased_test(); + PRIVATE_KEY_LOCK(); + if (ret != 0) TEST_FAIL("PWDBASED test failed!\n", ret); else TEST_PASS("PWDBASED test passed!\n"); - PRIVATE_KEY_LOCK(); #endif #if defined(USE_CERT_BUFFERS_2048) && \ @@ -3108,11 +3118,12 @@ options: [-s max_relative_stack_bytes] [-m max_relative_heap_memory_bytes]\n\ #if defined(HAVE_ECC) PRIVATE_KEY_UNLOCK(); - if ( (ret = ecc_test()) != 0) + ret = ecc_test(); + PRIVATE_KEY_LOCK(); + if (ret != 0) TEST_FAIL("ECC test failed!\n", ret); else TEST_PASS("ECC test passed!\n"); - PRIVATE_KEY_LOCK(); #if defined(HAVE_ECC_ENCRYPT) && defined(HAVE_AES_CBC) && \ (defined(WOLFSSL_AES_128) || defined(WOLFSSL_AES_256)) if ( (ret = ecc_encrypt_test()) != 0) @@ -3214,11 +3225,12 @@ options: [-s max_relative_stack_bytes] [-m max_relative_heap_memory_bytes]\n\ #if defined(HAVE_ED25519) && \ (!defined(WOLF_CRYPTO_CB_ONLY_ED25519) || defined(WOLFSSL_SWDEV)) PRIVATE_KEY_UNLOCK(); - if ( (ret = ed25519_test()) != 0) + ret = ed25519_test(); + PRIVATE_KEY_LOCK(); + if (ret != 0) TEST_FAIL("ED25519 test failed!\n", ret); else TEST_PASS("ED25519 test passed!\n"); - PRIVATE_KEY_LOCK(); #endif #ifdef HAVE_CURVE448 @@ -3230,20 +3242,22 @@ options: [-s max_relative_stack_bytes] [-m max_relative_heap_memory_bytes]\n\ #ifdef HAVE_ED448 PRIVATE_KEY_UNLOCK(); - if ( (ret = ed448_test()) != 0) + ret = ed448_test(); + PRIVATE_KEY_LOCK(); + if (ret != 0) TEST_FAIL("ED448 test failed!\n", ret); else TEST_PASS("ED448 test passed!\n"); - PRIVATE_KEY_LOCK(); #endif #ifdef WOLFSSL_HAVE_MLKEM PRIVATE_KEY_UNLOCK(); - if ( (ret = mlkem_test()) != 0) + ret = mlkem_test(); + PRIVATE_KEY_LOCK(); + if (ret != 0) TEST_FAIL("MLKEM test failed!\n", ret); else TEST_PASS("MLKEM test passed!\n"); - PRIVATE_KEY_LOCK(); #endif #ifdef WOLFSSL_HAVE_FRODOKEM @@ -3255,20 +3269,22 @@ options: [-s max_relative_stack_bytes] [-m max_relative_heap_memory_bytes]\n\ #ifdef WOLFSSL_HAVE_MLDSA PRIVATE_KEY_UNLOCK(); - if ( (ret = mldsa_test()) != 0) + ret = mldsa_test(); + PRIVATE_KEY_LOCK(); + if (ret != 0) TEST_FAIL("ML-DSA test failed!\n", ret); else TEST_PASS("ML-DSA test passed!\n"); - PRIVATE_KEY_LOCK(); #endif #ifdef HAVE_FALCON PRIVATE_KEY_UNLOCK(); - if ( (ret = falcon_test()) != 0) + ret = falcon_test(); + PRIVATE_KEY_LOCK(); + if (ret != 0) TEST_FAIL("Falcon test failed!\n", ret); else TEST_PASS("Falcon test passed!\n"); - PRIVATE_KEY_LOCK(); #endif #if defined(WOLFSSL_HAVE_XMSS) @@ -3371,19 +3387,21 @@ options: [-s max_relative_stack_bytes] [-m max_relative_heap_memory_bytes]\n\ TEST_PASS("PKCS7signed test passed!\n"); PRIVATE_KEY_UNLOCK(); - if ( (ret = pkcs7enveloped_test()) != 0) + ret = pkcs7enveloped_test(); + PRIVATE_KEY_LOCK(); + if (ret != 0) TEST_FAIL("PKCS7enveloped test failed!\n", ret); else TEST_PASS("PKCS7enveloped test passed!\n"); - PRIVATE_KEY_LOCK(); #if defined(HAVE_AESGCM) || defined(HAVE_AESCCM) PRIVATE_KEY_UNLOCK(); - if ( (ret = pkcs7authenveloped_test()) != 0) + ret = pkcs7authenveloped_test(); + PRIVATE_KEY_LOCK(); + if (ret != 0) TEST_FAIL("PKCS7authenveloped test failed!\n", ret); else TEST_PASS("PKCS7authenveloped test passed!\n"); - PRIVATE_KEY_LOCK(); #endif #endif From eedceef23d369b1902142d3ee3d8afdacca64ab7 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Mon, 3 Aug 2026 23:44:26 -0500 Subject: [PATCH 08/44] wolfssl/wolfcrypt/dh.h, wolfcrypt/src/dh.c: add wc_dh_enable/disable/ is_enabled, WC_DH_INITIAL_RUNTIME_ENABLEMENT, WC_DH_HAVE_RUNTIME_ENABLEMENT. Place the enablement check AFTER key->heap/trustedGroup init in the five entry points (wc_InitDhKey_ex, wc_DhGenerateKeyPair, wc_DhAgree, wc_DhAgree_ct, _DhSetKey) so a disabled-DH early return never leaves a half-initialized key for wc_FreeDhKey to mp_clear on garbage. configure.ac: add --enable-dh=conditional; when DH is enabled (directly or via all-crypto) set it initially usable under FIPS v7 with -DWC_DH_INITIAL_RUNTIME_ENABLEMENT=1; remove the FIPS-v7 DH force-off (in FIPS v7+, disable build by default, unless building in kernel mode with DH registration enabled). linuxkm/lkcapi_glue.c: bracket LKCAPI registration with `need_dh_disable = (wc_dh_enable() == 0)` ... `if (need_dh_disable) wc_dh_disable();`, so DH is disabled on every exit path, and only by the caller that actually enabled it (wc_dh_enable returns ALREADY_E if DH was already on, so this never disables a DH some other context legitimately enabled). tests/unit.c, wolfcrypt/test/test.c: bracket the DH tests with enable/disable so they succeed regardless of runtime initial default enablement. --- configure.ac | 54 ++++++++++++++++++++++++++++++++++-------- linuxkm/lkcapi_glue.c | 11 +++++++++ tests/unit.c | 10 ++++++++ wolfcrypt/src/dh.c | 48 +++++++++++++++++++++++++++++++++++++ wolfcrypt/test/test.c | 16 ++++++++++++- wolfssl/wolfcrypt/dh.h | 12 ++++++++++ 6 files changed, 140 insertions(+), 11 deletions(-) diff --git a/configure.ac b/configure.ac index b631ebfc043..3543577b8e8 100644 --- a/configure.ac +++ b/configure.ac @@ -1698,6 +1698,7 @@ then test "$enable_md5" = "" && enable_md5=yes test "$enable_ssh" = "" && test "$enable_hmac" != "no" && enable_ssh=yes test "$enable_rng_bank" = "" && enable_rng_bank=yes + test "$enable_dh" = "" && enable_dh=yes if test "$KERNEL_MODE_DEFAULTS" != "yes" then @@ -1742,7 +1743,7 @@ then test "$enable_pkcallbacks" = "" && enable_pkcallbacks=yes fi - if test "$ENABLED_FIPS" = "no" || test "$HAVE_FIPS_VERSION" -lt 7 + if test "$enable_dh" = "yes" then # Enable DH const table speedups (eliminates `-lm` math lib dependency) AM_CFLAGS="$AM_CFLAGS -DHAVE_FFDHE_2048 -DHAVE_FFDHE_3072" @@ -1775,6 +1776,8 @@ then AM_CFLAGS="$AM_CFLAGS -DHAVE_AES_DECRYPT -DHAVE_AES_ECB -DWOLFSSL_ALT_NAMES" + # Caution, asym key bits above 4096 can disrupt TLS fragment size dynamics + # (see tests/test-maxfrag.conf). DEFAULT_MAX_CLASSIC_ASYM_KEY_BITS=4096 # Enable all parsing features for ASN */ @@ -1842,13 +1845,31 @@ then test "$enable_shake256" = "" && test "$enable_sha3" = "yes" && enable_shake256=yes test "$enable_compkey" = "" && enable_compkey=yes fi - if test "$ENABLED_FIPS" = "no" || test "$HAVE_FIPS_VERSION" -lt 7 + + # Enable DH even for FIPS v7, to allow non-FIPS pro forma DH in kernel + # modules (effectively disabling it kernel-wide at runtime). The + # "conditional" value leaves it disabled (unusable) after registration. + if test "$HAVE_FIPS_VERSION" -ge 7 && test "$enable_dh" = "" && test "$enable_linuxkm_lkcapi_register" != "" then - # Enable DH const table speedups (eliminates `-lm` math lib dependency) - AM_CFLAGS="$AM_CFLAGS -DHAVE_FFDHE_2048 -DHAVE_FFDHE_3072" + for lkcapi_alg in $(echo "$enable_linuxkm_lkcapi_register" | tr ',' ' ') + do + case "$lkcapi_alg" in + all | all-kconfig | dh) enable_dh=conditional ;; + esac + done + for lkcapi_alg in $(echo "$enable_linuxkm_lkcapi_register" | tr ',' ' ') + do + case "$lkcapi_alg" in + -dh) enable_dh="" ;; + esac + done fi + + # Enable WOLFSSL_DH_EXTRA and DH const table speedups (eliminates `-lm` math lib dependency) + # No effect if DH is disabled. + AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DH_EXTRA -DHAVE_FFDHE_2048 -DHAVE_FFDHE_3072" + DEFAULT_MAX_CLASSIC_ASYM_KEY_BITS=4096 - AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DH_EXTRA" AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ECDSA_DETERMINISTIC_K_VARIANT" fi @@ -6345,16 +6366,28 @@ then ENABLED_DH_DEFAULT=yes else ENABLED_DH_DEFAULT=no + # DH is outside the boundary in FIPS v7+, but if it's enabled directly or + # via --enable-all-crypto, then callers and the test suite will expect it to + # work. + if test "$enable_dh" = "yes" + then + AM_CFLAGS="$AM_CFLAGS -DWC_DH_INITIAL_RUNTIME_ENABLEMENT=1" + fi +fi + +if test "$enable_dh" = "conditional" +then + AM_CFLAGS="$AM_CFLAGS -DWC_DH_INITIAL_RUNTIME_ENABLEMENT=0" + enable_dh=yes fi # DH AC_ARG_ENABLE([dh], - [AS_HELP_STRING([--enable-dh],[Enable DH (default: enabled). Set to "nonblock" to enable non-blocking DH key agreement via SP small mod_exp_nb])], + [AS_HELP_STRING([--enable-dh],[Enable DH (default: ${ENABLED_DH_DEFAULT}). Set to "nonblock" to enable non-blocking DH key agreement via SP small mod_exp_nb])], [ ENABLED_DH=$enableval ], [ ENABLED_DH=$ENABLED_DH_DEFAULT ] ) -# note, this will be forced back off for FIPS v7+ below. if test "$ENABLED_OPENSSH" = "yes" && test "$ENABLED_DH" = "no" then ENABLED_DH="yes" @@ -6987,9 +7020,10 @@ AS_CASE([$FIPS_VERSION], (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_rsapss" != "no")], [ENABLED_RSAPSS="yes"; AM_CFLAGS="$AM_CFLAGS -DWC_RSA_PSS"]) - AS_IF([test "$ENABLED_DH" != "no" && - (test "$FIPS_VERSION" != "dev" || test "$enable_dh" != "yes")], - [enable_dh="no"; ENABLED_DH="no"; AM_CFLAGS="$AM_CFLAGS -DNO_DH"]) +# DH is outside the FIPS v7 boundary and off by default in v7, but freely +# configurable for non-FIPS use, provided the user first calls wc_dh_enable(), +# defines WC_DH_INITIAL_RUNTIME_ENABLEMENT to 1, or enables it explicitly with +# --enable-dh or indirectly with --enable-all-crypto. AS_IF([test "$ENABLED_ECC" != "yes" && (test "$ENABLED_FIPS_DEV" != "yes" || test "$enable_ecc" != "no")], diff --git a/linuxkm/lkcapi_glue.c b/linuxkm/lkcapi_glue.c index 1fbaf973d1e..710e486925c 100644 --- a/linuxkm/lkcapi_glue.c +++ b/linuxkm/lkcapi_glue.c @@ -708,6 +708,11 @@ static int linuxkm_lkcapi_register(void) #endif #ifdef LINUXKM_LKCAPI_REGISTER_DH + { + #ifdef WC_DH_HAVE_RUNTIME_ENABLEMENT + int need_dh_disable = (wc_dh_enable() == 0); + #endif + #ifdef HAVE_FFDHE_2048 REGISTER_ALG(ffdhe2048, kpp, linuxkm_test_ffdhe2048); #endif /* HAVE_FFDHE_2048 */ @@ -731,6 +736,12 @@ static int linuxkm_lkcapi_register(void) #ifdef LINUXKM_DH REGISTER_ALG(dh, kpp, linuxkm_test_dh); #endif /* LINUXKM_DH */ + + #ifdef WC_DH_HAVE_RUNTIME_ENABLEMENT + if (need_dh_disable) + (void)wc_dh_disable(); + #endif + } #endif /* LINUXKM_LKCAPI_REGISTER_DH */ #undef REGISTER_ALG diff --git a/tests/unit.c b/tests/unit.c index 5f788fe051f..856c89b3f93 100644 --- a/tests/unit.c +++ b/tests/unit.c @@ -79,8 +79,13 @@ int unit_test(int argc, char** argv) { int ret = 0; + #ifdef WC_DH_HAVE_RUNTIME_ENABLEMENT + int need_dh_disable = (wc_dh_enable() == 0); + #endif + (void)argc; (void)argv; + #ifdef WOLFSSL_FORCE_MALLOC_FAIL_TEST if (argc > 1) { int memFailCount = atoi(argv[1]); @@ -408,5 +413,10 @@ int unit_test(int argc, char** argv) fflush(stdout); } + #ifdef WC_DH_HAVE_RUNTIME_ENABLEMENT + if (need_dh_disable) + (void)wc_dh_disable(); + #endif + return ret; } diff --git a/wolfcrypt/src/dh.c b/wolfcrypt/src/dh.c index 803c56aa371..d8ee106414e 100644 --- a/wolfcrypt/src/dh.c +++ b/wolfcrypt/src/dh.c @@ -57,6 +57,29 @@ } #endif +#ifdef WC_DH_INITIAL_RUNTIME_ENABLEMENT +static volatile int wc_dh_enabled = WC_DH_INITIAL_RUNTIME_ENABLEMENT; +int wc_dh_enable(void) { + if (wc_dh_enabled) + return ALREADY_E; + else { + wc_dh_enabled = 1; + return 0; + } +} +int wc_dh_disable(void) { + if (wc_dh_enabled) { + wc_dh_enabled = 0; + return 0; + } + else + return ALREADY_E; +} +int wc_dh_is_enabled(void) { + return wc_dh_enabled; +} +#endif + /* Possible DH enable options: * NO_RSA: Overall control of DH default: on (not defined) @@ -943,6 +966,11 @@ int wc_InitDhKey_ex(DhKey* key, void* heap, int devId) key->heap = heap; /* for XMALLOC/XFREE in future */ key->trustedGroup = 0; +#ifdef WC_DH_INITIAL_RUNTIME_ENABLEMENT + if (! wc_dh_enabled) + return FIPS_NOT_ALLOWED_E; +#endif + #ifdef WOLFSSL_DH_EXTRA if (mp_init_multi(&key->p, &key->g, &key->q, &key->pub, &key->priv, NULL) != MP_OKAY) #else @@ -2012,6 +2040,11 @@ int wc_DhGenerateKeyPair(DhKey* key, WC_RNG* rng, return BAD_FUNC_ARG; } +#ifdef WC_DH_INITIAL_RUNTIME_ENABLEMENT + if (! wc_dh_enabled) + return FIPS_NOT_ALLOWED_E; +#endif + #ifdef WOLFSSL_KCAPI_DH (void)priv; (void)privSz; @@ -2381,6 +2414,11 @@ int wc_DhAgree(DhKey* key, byte* agree, word32* agreeSz, const byte* priv, return BAD_FUNC_ARG; } +#ifdef WC_DH_INITIAL_RUNTIME_ENABLEMENT + if (! wc_dh_enabled) + return FIPS_NOT_ALLOWED_E; +#endif + #ifdef WOLFSSL_KCAPI_DH (void)priv; (void)privSz; @@ -2424,6 +2462,11 @@ int wc_DhAgree_ct(DhKey* key, byte* agree, word32 *agreeSz, const byte* priv, return BAD_FUNC_ARG; } +#ifdef WC_DH_INITIAL_RUNTIME_ENABLEMENT + if (! wc_dh_enabled) + return FIPS_NOT_ALLOWED_E; +#endif + requested_agreeSz = (word32)mp_unsigned_bin_size(&key->p); if (requested_agreeSz > *agreeSz) { return BUFFER_E; @@ -2594,6 +2637,11 @@ static int _DhSetKey(DhKey* key, const byte* p, word32 pSz, const byte* g, ret = BAD_FUNC_ARG; } +#ifdef WC_DH_INITIAL_RUNTIME_ENABLEMENT + if ((ret == 0) && (! wc_dh_enabled)) + ret = FIPS_NOT_ALLOWED_E; +#endif + if (ret == 0) { /* may have leading 0 */ if (p[0] == 0) { diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index 51cd6dbc512..0ec8dece597 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -32315,7 +32315,9 @@ static wc_test_ret_t dh_key_import_export_test(DhKey* key, DhKey* key2, /* for HAVE_WOLF_BIGINT prevent leak */ wc_FreeDhKey(key); - (void)wc_InitDhKey_ex(key, HEAP_HINT, devId); + ret = wc_InitDhKey_ex(key, HEAP_HINT, devId); + if (ret != 0) + ERROR_OUT(WC_TEST_RET_ENC_EC(ret), exit_dh_import_export); idx = 0; XMEMSET(tmp2, 0, DH_TEST_TMP_SIZE); @@ -32381,6 +32383,9 @@ static wc_test_ret_t dh_set_check_key_test(DhKey* key, WC_RNG* rng, WOLFSSL_TEST_SUBROUTINE wc_test_ret_t dh_test(void) { +#ifdef WC_DH_HAVE_RUNTIME_ENABLEMENT + int need_dh_disable = 0; +#endif wc_test_ret_t ret; word32 bytes; word32 idx = 0; @@ -32426,6 +32431,10 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t dh_test(void) #endif #endif /* !WC_NO_RNG */ +#ifdef WC_DH_HAVE_RUNTIME_ENABLEMENT + need_dh_disable = (wc_dh_enable() == 0); +#endif + WOLFSSL_ENTER("dh_test"); #if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_NO_MALLOC) @@ -32664,6 +32673,11 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t dh_test(void) (void)pubSz2; (void)privSz2; + #ifdef WC_DH_HAVE_RUNTIME_ENABLEMENT + if (need_dh_disable) + (void)wc_dh_disable(); + #endif + return ret; } diff --git a/wolfssl/wolfcrypt/dh.h b/wolfssl/wolfcrypt/dh.h index 7790a667803..85d3e95f4a2 100644 --- a/wolfssl/wolfcrypt/dh.h +++ b/wolfssl/wolfcrypt/dh.h @@ -161,6 +161,18 @@ enum { WOLFSSL_LOCAL int wolfCrypt_FIPS_DH_sanity(void); #endif +#if FIPS_VERSION3_GE(7,0,0) || defined(WC_DH_INITIAL_RUNTIME_ENABLEMENT) + #ifndef WC_DH_INITIAL_RUNTIME_ENABLEMENT + #define WC_DH_INITIAL_RUNTIME_ENABLEMENT 0 + #endif + #define WC_DH_HAVE_RUNTIME_ENABLEMENT + WOLFSSL_API int wc_dh_enable(void); + WOLFSSL_API int wc_dh_disable(void); + WOLFSSL_API int wc_dh_is_enabled(void); +#else + #undef WC_DH_HAVE_RUNTIME_ENABLEMENT +#endif + #ifdef HAVE_PUBLIC_FFDHE #ifdef HAVE_FFDHE_2048 WOLFSSL_API const DhParams* wc_Dh_ffdhe2048_Get(void); From 71d48cf22dc1a42b15c7bf54795967fb42758947 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Tue, 4 Aug 2026 00:04:20 -0500 Subject: [PATCH 09/44] wolfcrypt/src/ecc.c: pull in wolfssl/wolfcrypt/wc_compat.h for wc_AesGcmEncrypt() remapping if needed. --- wolfcrypt/src/ecc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/wolfcrypt/src/ecc.c b/wolfcrypt/src/ecc.c index 079553e9da9..d75d3307f5c 100644 --- a/wolfcrypt/src/ecc.c +++ b/wolfcrypt/src/ecc.c @@ -212,9 +212,6 @@ ECC Curve Sizes: #endif #if defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 2) - /* set NO_WRAPPERS before headers, use direct internal f()s not wrappers */ - #define FIPS_NO_WRAPPERS - #ifdef USE_WINDOWS_API #pragma code_seg(".fipsA$f") #pragma const_seg(".fipsB$f") @@ -234,6 +231,10 @@ ECC Curve Sizes: #ifdef HAVE_ECC_ENCRYPT #include + + /* For wc_AesGcmEncrypt() wrapper, if needed. */ + #include + #include #endif From 290553f00685e70a26e8f49ced31bebbaec21d76 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Tue, 4 Aug 2026 00:06:57 -0500 Subject: [PATCH 10/44] wolfcrypt/src/aes.c: in FIPS builds, reject ivSz < GCM_NONCE_MID_SZ (12) with FIPS_BAD_VALUE_E in the GCM IV-construction paths under HAVE_FIPS, overridable by WC_FIPS_AESGCM_ALLOW_SHORT_NONCES. Decrypt accepts any supported length per SP 800-38D (IV construction requirements bind encryption only). The floor takes two shapes, both correct by construction: - wc_AesGcmInit_local (reached from wc_AesGcmInit and wc_AesGcmEncryptInit_ex, which pass a decrypt_p flag): (ret == 0) && (! decrypt_p) && (ivSz > 0) && (ivSz < GCM_NONCE_MID_SZ) The `ivSz > 0` clause is load-bearing -- iv is an optional argument there, and the key-only re-init form (iv == NULL, ivSz == 0) used for module-generated-IV streaming must still pass. - wc_AesGcmSetIV / wc_AesGcmSetExtIV: bare `ivSz < GCM_NONCE_MID_SZ`, no ivSz>0 clause needed -- CheckAesGcmIvSize() already admits only {8,12,16}, so ivSz == 0 cannot reach the floor. tests/api/test_aes.c: update tests for new FIPS nonce size restrictions. .wolfssl_known_macro_extras: add WC_FIPS_AESGCM_ALLOW_SHORT_NONCES. --- .wolfssl_known_macro_extras | 1 + tests/api/test_aes.c | 25 ++++++++++++++++--- wolfcrypt/src/aes.c | 50 +++++++++++++++++++++++++++++++++---- 3 files changed, 68 insertions(+), 8 deletions(-) diff --git a/.wolfssl_known_macro_extras b/.wolfssl_known_macro_extras index 79494996bcb..47f033ce301 100644 --- a/.wolfssl_known_macro_extras +++ b/.wolfssl_known_macro_extras @@ -748,6 +748,7 @@ WC_ASYNC_THREAD_BIND WC_BLINDING_NO_RNG_ACKNOWLEDGE_WEAKNESS WC_CACHE_RESISTANT_BASE64_TABLE WC_DISABLE_RADIX_ZERO_PAD +WC_FIPS_AESGCM_ALLOW_SHORT_NONCES WC_FIPS_AESGCM_ONE_SHOT_EXT_IV_ALLOWED WC_FLAG_DONT_USE_AESNI WC_FORCE_LINUXKM_FORTIFY_SOURCE diff --git a/tests/api/test_aes.c b/tests/api/test_aes.c index ed4f762a610..3b909a08cd3 100644 --- a/tests/api/test_aes.c +++ b/tests/api/test_aes.c @@ -8365,7 +8365,9 @@ int test_wc_AesGcmDecisionCoverage(void) 0xFE,0xFF,0xE9,0x92,0x86,0x65,0x73,0x1C, 0x6D,0x6A,0x8F,0x94,0x67,0x30,0x83,0x08 }; - /* wc_AesGcmSetExtIV needs an RNG and is absent from the self-test module. */ + /* wc_AesGcmSetExtIV is built only when !WC_NO_RNG, and is absent from the + * self-test module. + */ #if !defined(WC_NO_RNG) && !defined(HAVE_SELFTEST) static const byte iv[GCM_NONCE_MID_SZ] = { 0xCA,0xFE,0xBA,0xBE,0xFA,0xCE,0xDB,0xAD, @@ -8389,8 +8391,20 @@ int test_wc_AesGcmDecisionCoverage(void) /* Zero-length IV branch: should reject. */ ExpectIntEQ(wc_AesGcmSetExtIV(&aes, iv, 0), WC_NO_ERR_TRACE(BAD_FUNC_ARG)); +#if FIPS_VERSION3_GE(7,0,0) && \ + !defined(WC_FIPS_AESGCM_ALLOW_SHORT_NONCES) + ExpectIntEQ(wc_AesGcmSetExtIV(&aes, iv, GCM_NONCE_MIN_SZ), + WC_NO_ERR_TRACE(FIPS_BAD_VALUE_E)); +#elif (FIPS_VERSION3_EQ(5,2,4) || FIPS_VERSION3_GE(7,0,0)) && \ + !defined(FIPS_NO_WRAPPERS) + ExpectIntEQ(wc_AesGcmSetExtIV(&aes, iv, GCM_NONCE_MIN_SZ), + WC_FIPS_NOT_APPROVED); +#else + ExpectIntEQ(wc_AesGcmSetExtIV(&aes, iv, GCM_NONCE_MIN_SZ), 0); #endif +#endif /* !WC_NO_RNG && !HAVE_SELFTEST */ + /* wc_AesGcmSetKey invalid key-length decision branch. */ { static const byte badKey[15] = {0}; @@ -8399,7 +8413,7 @@ int test_wc_AesGcmDecisionCoverage(void) } if (initDone) wc_AesFree(&aes); -#endif +#endif /* !NO_AES && HAVE_AESGCM */ return EXPECT_RESULT(); } @@ -9241,7 +9255,12 @@ int test_wc_AesGcmArgMcdc(void) * self-contained demonstration). */ ExpectIntEQ(wc_AesGcmSetIV(&aes, 10, NULL, 0, &rng), WC_NO_ERR_TRACE(BAD_FUNC_ARG)); -#if defined(HAVE_FIPS) && FIPS_VERSION3_GE(7,0,0) +#if FIPS_VERSION3_GE(7,0,0) && \ + !defined(WC_FIPS_AESGCM_ALLOW_SHORT_NONCES) + ExpectIntEQ(wc_AesGcmSetIV(&aes, GCM_NONCE_MIN_SZ, NULL, 0, &rng), + WC_NO_ERR_TRACE(FIPS_BAD_VALUE_E)); +#elif (FIPS_VERSION3_EQ(5,2,4) || FIPS_VERSION3_GE(7,0,0)) && \ + !defined(FIPS_NO_WRAPPERS) ExpectIntEQ(wc_AesGcmSetIV(&aes, GCM_NONCE_MIN_SZ, NULL, 0, &rng), WC_FIPS_NOT_APPROVED); #else diff --git a/wolfcrypt/src/aes.c b/wolfcrypt/src/aes.c index 0f66def43f6..aad3f90529b 100644 --- a/wolfcrypt/src/aes.c +++ b/wolfcrypt/src/aes.c @@ -11206,6 +11206,11 @@ int wc_AesGcmEncrypt(Aes* aes, byte* out, const byte* in, word32 sz, if (ret != 0) return ret; +#if defined(HAVE_FIPS) && !defined(WC_FIPS_AESGCM_ALLOW_SHORT_NONCES) + if (ivSz < GCM_NONCE_MID_SZ) + return FIPS_BAD_VALUE_E; +#endif + #ifdef WOLF_CRYPTO_CB #ifndef WOLF_CRYPTO_CB_FIND if (aes->devId != INVALID_DEVID) @@ -12048,6 +12053,11 @@ int wc_AesGcmDecrypt(Aes* aes, byte* out, const byte* in, word32 sz, if (ret != 0) return ret; + /* No FIPS check on ivSz in decrypt mode -- SP 800-38D IV + * construction requirements bind encryption only; decryption must + * accept externally generated IVs of any supported length. + */ + #ifdef WOLF_CRYPTO_CB #ifndef WOLF_CRYPTO_CB_FIND if (aes->devId != INVALID_DEVID) @@ -14246,8 +14256,8 @@ static WARN_UNUSED_RESULT int AesGcmDecryptFinal_RISCV64( * is NULL, or the IV is NULL and no previous IV has been set. * @return MEMORY_E when dynamic memory allocation fails. (WOLFSSL_SMALL_STACK) */ -int wc_AesGcmInit(Aes* aes, const byte* key, word32 len, const byte* iv, - word32 ivSz) +static int wc_AesGcmInit_local(Aes* aes, const byte* key, word32 len, const byte* iv, + word32 ivSz, int decrypt_p) { int ret = 0; @@ -14258,6 +14268,20 @@ int wc_AesGcmInit(Aes* aes, const byte* key, word32 len, const byte* iv, ret = BAD_FUNC_ARG; } +#if defined(HAVE_FIPS) && !defined(WC_FIPS_AESGCM_ALLOW_SHORT_NONCES) + /* Note iv is an optional arg to wc_AesGcmInit(), so we tolerate zero ivSz + * here. + * + * Additionally, there is no FIPS check on ivSz in decrypt mode -- SP + * 800-38D IV construction requirements bind encryption only; decryption + * must accept externally generated IVs of any supported length. + */ + if ((ret == 0) && (! decrypt_p) && (ivSz > 0) && (ivSz < GCM_NONCE_MID_SZ)) + ret = FIPS_BAD_VALUE_E; +#else + (void)decrypt_p; +#endif + #if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_AESNI) if ((ret == 0) && (aes->streamData == NULL)) { /* Allocate buffers for streaming. */ @@ -14354,6 +14378,12 @@ int wc_AesGcmInit(Aes* aes, const byte* key, word32 len, const byte* iv, return ret; } +int wc_AesGcmInit(Aes* aes, const byte* key, word32 len, const byte* iv, + word32 ivSz) +{ + return wc_AesGcmInit_local(aes, key, len, iv, ivSz, 0 /* decrypt_p */); +} + /* Initialize an AES GCM cipher for encryption. * * Must call wc_AesInit() before calling this function. @@ -14370,7 +14400,7 @@ int wc_AesGcmInit(Aes* aes, const byte* key, word32 len, const byte* iv, int wc_AesGcmEncryptInit(Aes* aes, const byte* key, word32 len, const byte* iv, word32 ivSz) { - return wc_AesGcmInit(aes, key, len, iv, ivSz); + return wc_AesGcmInit_local(aes, key, len, iv, ivSz, 0); } /* Initialize an AES GCM cipher for encryption. Get IV. @@ -14404,7 +14434,7 @@ int wc_AesGcmEncryptInit_ex(Aes* aes, const byte* key, word32 len, byte* ivOut, /* Copy out the IV including generated part for decryption. */ XMEMCPY(ivOut, aes->reg, ivOutSz); /* Initialize AES GCM cipher with key and cached Iv. */ - ret = wc_AesGcmInit(aes, key, len, NULL, 0); + ret = wc_AesGcmInit_local(aes, key, len, NULL, 0, 0); } return ret; @@ -14569,7 +14599,7 @@ int wc_AesGcmEncryptFinal(Aes* aes, byte* authTag, word32 authTagSz) int wc_AesGcmDecryptInit(Aes* aes, const byte* key, word32 len, const byte* iv, word32 ivSz) { - return wc_AesGcmInit(aes, key, len, iv, ivSz); + return wc_AesGcmInit_local(aes, key, len, iv, ivSz, 1); } /* Update the AES GCM for decryption with data and/or authentication data. */ @@ -14727,6 +14757,11 @@ int wc_AesGcmSetExtIV(Aes* aes, const byte* iv, word32 ivSz) ret = BAD_FUNC_ARG; } +#if defined(HAVE_FIPS) && !defined(WC_FIPS_AESGCM_ALLOW_SHORT_NONCES) + if (ret == 0 && ivSz < GCM_NONCE_MID_SZ) + ret = FIPS_BAD_VALUE_E; +#endif + if (ret == 0) { XMEMCPY((byte*)aes->reg, iv, ivSz); @@ -14758,6 +14793,11 @@ int wc_AesGcmSetIV(Aes* aes, word32 ivSz, ret = BAD_FUNC_ARG; } +#if defined(HAVE_FIPS) && !defined(WC_FIPS_AESGCM_ALLOW_SHORT_NONCES) + if (ret == 0 && ivSz < GCM_NONCE_MID_SZ) + ret = FIPS_BAD_VALUE_E; +#endif + if (ret == 0) { byte* iv = (byte*)aes->reg; From ec54a2957060b2bbdbb5673462957801e8c9595c Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Tue, 4 Aug 2026 00:12:27 -0500 Subject: [PATCH 11/44] wolfssl/wolfcrypt/cmac.h: add WC_CMAC_NONE = 0 to CmacType. wolfcrypt/src/cmac.c: on _InitCmac_common failure free the Aes and set cmac->type = WC_CMAC_NONE, so a contract-violating wc_CmacFree on a never-initialized object hits a no-op arm instead of re-entering wc_AesFree; add explicit case WC_CMAC_NONE arms to the three type switches (wc_CmacUpdate, wc_CmacFree, wc_CmacFinalNoFree). --- wolfcrypt/src/cmac.c | 9 +++++++++ wolfssl/wolfcrypt/cmac.h | 1 + 2 files changed, 10 insertions(+) diff --git a/wolfcrypt/src/cmac.c b/wolfcrypt/src/cmac.c index ac056431ea9..ef714d1cbb5 100644 --- a/wolfcrypt/src/cmac.c +++ b/wolfcrypt/src/cmac.c @@ -255,6 +255,12 @@ static int _InitCmac_common(Cmac* cmac, const byte* key, word32 keySz, wc_MemZero_Check(l, WC_AES_BLOCK_SIZE); #endif } + + if (ret != 0) { + wc_AesFree(&cmac->aes); + cmac->type = WC_CMAC_NONE; + } + break; #endif /* !NO_AES && WOLFSSL_AES_DIRECT */ default: @@ -359,6 +365,7 @@ int wc_CmacUpdate(Cmac* cmac, const byte* in, word32 inSz) #endif }; break; #endif /* !NO_AES && WOLFSSL_AES_DIRECT */ + case WC_CMAC_NONE: default: ret = BAD_FUNC_ARG; } @@ -381,6 +388,7 @@ int wc_CmacFree(Cmac* cmac) wc_AesFree(&cmac->aes); break; #endif /* !NO_AES && WOLFSSL_AES_DIRECT */ + case WC_CMAC_NONE: default: /* Nothing to do */ (void)cmac; @@ -459,6 +467,7 @@ int wc_CmacFinalNoFree(Cmac* cmac, byte* out, word32* outSz) #endif }; break; #endif /* !NO_AES && WOLFSSL_AES_DIRECT */ + case WC_CMAC_NONE: default: ret = BAD_FUNC_ARG; } diff --git a/wolfssl/wolfcrypt/cmac.h b/wolfssl/wolfcrypt/cmac.h index 40a6e1a64e1..39d7b6d6244 100644 --- a/wolfssl/wolfcrypt/cmac.h +++ b/wolfssl/wolfcrypt/cmac.h @@ -49,6 +49,7 @@ #if !defined(HAVE_FIPS) || FIPS_VERSION3_GE(2,0,0) typedef enum CmacType { + WC_CMAC_NONE = 0, WC_CMAC_AES = 1 } CmacType; From 1b5307345d25d3ecc79e8358c55b357fedec378e Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Tue, 4 Aug 2026 00:14:58 -0500 Subject: [PATCH 12/44] wolfcrypt/src/hmac.c: in wc_HmacSetKey_ex reject WC_MD5 under HAVE_FIPS (unversioned defined(HAVE_FIPS), not a version arm -- hmac.c is in-boundary and master's copy only compiles at v7+/MAJOR=8). This structurally closes the old-TLS MD5 PRF: wc_PRF_TLSv1 -> wc_PRF(md5_mac) -> wc_HmacSetKey(WC_MD5) -> BAD_FUNC_ARG. Separately, in wc_HKDF_Expand_ex, add `else if (ret == 0) return BAD_FUNC_ARG;` after the wc_HmacSizeByType call: the existing code guarded ret < 0 but not ret == 0, and hashSz is the divisor in the `outSz/hashSz + ((outSz % hashSz) != 0) > 255` check three lines below. wolfcrypt/src/kdf.c: delete the two WC_HASH_TYPE_MD5_SHA guards in wc_PRF / wc_PRF_TLS -- they were a domain error (that arg is wc_MACAlgorithm, where WC_HASH_TYPE_MD5_SHA == 9 == sm3_mac, so the guard blocked SM3, not MD5-SHA), and the hmac.c reject is the correct layer. wolfcrypt/src/evp.c: drop the MD5 EVP mapping at FIPS >= 5 (evp.c is out of boundary, so the version arm is live and correct here). tests/api/test_kdf.c: derive secLen from MAX_PRF_HALF rather than hardcoding 521/261 -- MAX_PRF_HALF is config-dependent (516 under HAVE_FFDHE_8192, 388 under FFDHE_6144, else 260), so the hardcoded value made the BUFFER_E expectation config-dependent. --- tests/api/test_kdf.c | 14 ++++++++------ wolfcrypt/src/evp.c | 2 +- wolfcrypt/src/hmac.c | 8 ++++++++ wolfcrypt/src/kdf.c | 10 ++++++++-- 4 files changed, 25 insertions(+), 9 deletions(-) diff --git a/tests/api/test_kdf.c b/tests/api/test_kdf.c index 0957b3ce492..c0f6dadb720 100644 --- a/tests/api/test_kdf.c +++ b/tests/api/test_kdf.c @@ -135,17 +135,19 @@ int test_wc_KdfDecisionCoverage(void) #if defined(WOLFSSL_HAVE_PRF) && !defined(NO_HMAC) && !defined(NO_OLD_TLS) && \ !defined(NO_MD5) && !defined(NO_SHA) { - /* MAX_PRF_HALF is 260 in the default configuration (no - * HAVE_FFDHE_6144/8192). half = (secLen+1)/2, so secLen=521 gives - * half=261 (>260). */ - static byte secretBig[600] = {0}; + /* half = (secLen+1)/2, so secLen = 2*MAX_PRF_HALF + 1 forces + * half = MAX_PRF_HALF + 1 in every configuration (the limit + * varies with HAVE_FFDHE_6144/8192). + */ + static byte secretBig[2*MAX_PRF_HALF + 2] = {0}; static byte labelBuf[150] = {0}; static byte seedBuf[150] = {0}; static byte digestBuf[300] = {0}; /* c0 = half > MAX_PRF_HALF: true, others held at trivial values. */ - ExpectIntEQ(wc_PRF_TLSv1(digestBuf, 16, secretBig, 521, labelBuf, 4, - seedBuf, 4, HEAP_HINT, INVALID_DEVID), WC_NO_ERR_TRACE(BUFFER_E)); + ExpectIntEQ(wc_PRF_TLSv1(digestBuf, 16, secretBig, 2*MAX_PRF_HALF + 1, + labelBuf, 4, seedBuf, 4, HEAP_HINT, INVALID_DEVID), + WC_NO_ERR_TRACE(BUFFER_E)); /* c0 false (small secLen), c1 = labLen+seedLen > MAX_PRF_LABSEED * (128): true. */ diff --git a/wolfcrypt/src/evp.c b/wolfcrypt/src/evp.c index bfdfa99bb64..3b70de2dbe8 100644 --- a/wolfcrypt/src/evp.c +++ b/wolfcrypt/src/evp.c @@ -4803,7 +4803,7 @@ static int wolfssl_evp_md_to_hash_type(const WOLFSSL_EVP_MD *type, } else #endif -#ifndef NO_MD5 +#if !defined(NO_MD5) && (!defined(HAVE_FIPS) || FIPS_VERSION3_LT(5,0,0)) if (XSTRCMP(type, WC_SN_md5) == 0) { *hashType = WC_MD5; } diff --git a/wolfcrypt/src/hmac.c b/wolfcrypt/src/hmac.c index 3e1721b181a..2b99b22a5db 100644 --- a/wolfcrypt/src/hmac.c +++ b/wolfcrypt/src/hmac.c @@ -559,6 +559,11 @@ int wc_HmacSetKey_ex(Hmac* hmac, int type, const byte* key, word32 length, return BAD_FUNC_ARG; } +#if !defined(NO_MD5) && defined(HAVE_FIPS) + if (type == WC_MD5) + return BAD_FUNC_ARG; +#endif + heap = hmac->heap; #if !defined(HAVE_FIPS) || FIPS_VERSION3_GE(6,0,0) /* if set key has already been run then make sure and free existing */ @@ -1874,6 +1879,9 @@ int wolfSSL_GetHmacMaxSize(void) if (ret < 0) { return ret; } + else if (ret == 0) + return BAD_FUNC_ARG; + hashSz = (word32)ret; /* RFC 5869 states that the length of output keying material in diff --git a/wolfcrypt/src/kdf.c b/wolfcrypt/src/kdf.c index c1a824c68db..80315bee665 100644 --- a/wolfcrypt/src/kdf.c +++ b/wolfcrypt/src/kdf.c @@ -1641,6 +1641,7 @@ int wc_KDA_KDF_PRF_cmac(const byte* Kin, word32 KinSz, #endif while (len_rem >= WC_AES_BLOCK_SIZE) { + int cmac_inited = 0; /* cmac in place in block size increments */ c32toa(counter, counterBuf); #ifdef WOLFSSL_DEBUG_KDF @@ -1651,6 +1652,7 @@ int wc_KDA_KDF_PRF_cmac(const byte* Kin, word32 KinSz, ret = wc_InitCmac_ex(cmac, Kin, KinSz, WC_CMAC_AES, NULL, heap, devId); if (ret == 0) { + cmac_inited = 1; ret = wc_CmacUpdate(cmac, counterBuf, sizeof(counterBuf)); } @@ -1668,7 +1670,8 @@ int wc_KDA_KDF_PRF_cmac(const byte* Kin, word32 KinSz, } } - (void)wc_CmacFree(cmac); + if (cmac_inited) + (void)wc_CmacFree(cmac); if (ret != 0) { break; } @@ -1679,6 +1682,7 @@ int wc_KDA_KDF_PRF_cmac(const byte* Kin, word32 KinSz, if (ret == 0 && len_rem) { /* cmac the last little bit that wouldn't fit in a block size. */ byte rem[WC_AES_BLOCK_SIZE]; + int cmac_inited = 0; XMEMSET(rem, 0, sizeof(rem)); #ifdef WOLFSSL_CHECK_MEM_ZERO wc_MemZero_Add("wc_KDA_KDF_PRF_cmac rem", rem, sizeof(rem)); @@ -1693,6 +1697,7 @@ int wc_KDA_KDF_PRF_cmac(const byte* Kin, word32 KinSz, ret = wc_InitCmac_ex(cmac, Kin, KinSz, WC_CMAC_AES, NULL, heap, devId); if (ret == 0) { + cmac_inited = 1; ret = wc_CmacUpdate(cmac, counterBuf, sizeof(counterBuf)); } @@ -1718,7 +1723,8 @@ int wc_KDA_KDF_PRF_cmac(const byte* Kin, word32 KinSz, #ifdef WOLFSSL_CHECK_MEM_ZERO wc_MemZero_Check(rem, sizeof(rem)); #endif - (void)wc_CmacFree(cmac); + if (cmac_inited) + (void)wc_CmacFree(cmac); } #ifdef WOLFSSL_SMALL_STACK From 625f39f665c7fddec11023f6ee2f9a4e98e3db8d Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Tue, 4 Aug 2026 00:17:08 -0500 Subject: [PATCH 13/44] src/internal.c: * in AllocKey capture and propagate the return of the per-type wc_*_init_ex calls (ed25519, ed448, falcon, ML-DSA, ML-KEM, ...) instead of discarding it, so an init failure surfaces rather than leaving a partially-constructed key for later use. * The `default:` arm of the type switch now sets `ret = BAD_FUNC_ARG` and breaks, instead of returning directly, so it reaches the common cleanup. * The failure cleanup distinguishes the two states: if the key was initialized, FreeKey(); otherwise XFREE(*pKey) and NULL the caller's pointer -- previously an allocation that failed before init leaked. * Two mis-copied #endif comments corrected: HAVE_CURVE25519 -> HAVE_ED25519 and HAVE_CURVE448 -> HAVE_ED448. --- src/internal.c | 50 +++++++++++++++++++++++++++++++++++--------------- 1 file changed, 35 insertions(+), 15 deletions(-) diff --git a/src/internal.c b/src/internal.c index 3de4b1d060c..42376ce3a7a 100644 --- a/src/internal.c +++ b/src/internal.c @@ -8942,6 +8942,7 @@ void FreeKey(WOLFSSL* ssl, int type, void** pKey) int AllocKey(WOLFSSL* ssl, int type, void** pKey) { int ret = WC_NO_ERR_TRACE(BAD_FUNC_ARG); + int key_inited = 0; size_t sz = 0; #ifdef HAVE_ECC ecc_key* eccKey; @@ -9048,6 +9049,8 @@ int AllocKey(WOLFSSL* ssl, int type, void** pKey) #ifndef NO_RSA case DYNAMIC_TYPE_RSA: ret = wc_InitRsaKey_ex((RsaKey*)*pKey, ssl->heap, ssl->devId); + if (ret == 0) + key_inited = 1; #if defined(WC_RSA_NONBLOCK) && defined(WOLFSSL_ASYNC_CRYPT_SW) && \ defined(WC_ASYNC_ENABLE_RSA) /* Only set non-blocking context when async device is active. With @@ -9074,6 +9077,8 @@ int AllocKey(WOLFSSL* ssl, int type, void** pKey) case DYNAMIC_TYPE_ECC: eccKey = (ecc_key*)*pKey; ret = wc_ecc_init_ex(eccKey, ssl->heap, ssl->devId); + if (ret == 0) + key_inited = 1; #if defined(WC_ECC_NONBLOCK) && defined(WOLFSSL_ASYNC_CRYPT_SW) && \ defined(WC_ASYNC_ENABLE_ECC) /* Only set non-blocking context when async device is active. With @@ -9098,14 +9103,17 @@ int AllocKey(WOLFSSL* ssl, int type, void** pKey) #endif /* HAVE_ECC */ #ifdef HAVE_ED25519 case DYNAMIC_TYPE_ED25519: - wc_ed25519_init_ex((ed25519_key*)*pKey, ssl->heap, ssl->devId); - ret = 0; + ret = wc_ed25519_init_ex((ed25519_key*)*pKey, ssl->heap, ssl->devId); + if (ret == 0) + key_inited = 1; break; - #endif /* HAVE_CURVE25519 */ + #endif /* HAVE_ED25519 */ #ifdef HAVE_CURVE25519 case DYNAMIC_TYPE_CURVE25519: x25519Key = (curve25519_key*)*pKey; ret = wc_curve25519_init_ex(x25519Key, ssl->heap, ssl->devId); + if (ret == 0) + key_inited = 1; #if defined(WC_X25519_NONBLOCK) && defined(WOLFSSL_ASYNC_CRYPT_SW) && \ defined(WC_ASYNC_ENABLE_X25519) /* Only set non-blocking context when async device is active. With @@ -9130,20 +9138,23 @@ int AllocKey(WOLFSSL* ssl, int type, void** pKey) #endif /* HAVE_CURVE25519 */ #ifdef HAVE_ED448 case DYNAMIC_TYPE_ED448: - wc_ed448_init_ex((ed448_key*)*pKey, ssl->heap, ssl->devId); - ret = 0; + ret = wc_ed448_init_ex((ed448_key*)*pKey, ssl->heap, ssl->devId); + if (ret == 0) + key_inited = 1; break; - #endif /* HAVE_CURVE448 */ + #endif /* HAVE_ED448 */ #if defined(HAVE_FALCON) case DYNAMIC_TYPE_FALCON: - wc_falcon_init_ex((falcon_key*)*pKey, ssl->heap, ssl->devId); - ret = 0; + ret = wc_falcon_init_ex((falcon_key*)*pKey, ssl->heap, ssl->devId); + if (ret == 0) + key_inited = 1; break; #endif /* HAVE_FALCON */ #if defined(WOLFSSL_HAVE_MLDSA) case DYNAMIC_TYPE_MLDSA: - wc_MlDsaKey_Init((wc_MlDsaKey*)*pKey, ssl->heap, ssl->devId); - ret = 0; + ret = wc_MlDsaKey_Init((wc_MlDsaKey*)*pKey, ssl->heap, ssl->devId); + if (ret == 0) + key_inited = 1; break; #endif /* WOLFSSL_HAVE_MLDSA */ #if defined(WOLFSSL_HAVE_SLHDSA) @@ -9159,13 +9170,16 @@ int AllocKey(WOLFSSL* ssl, int type, void** pKey) #endif /* WOLFSSL_HAVE_SLHDSA */ #ifdef HAVE_CURVE448 case DYNAMIC_TYPE_CURVE448: - wc_curve448_init((curve448_key*)*pKey); - ret = 0; + ret = wc_curve448_init((curve448_key*)*pKey); + if (ret == 0) + key_inited = 1; break; #endif /* HAVE_CURVE448 */ #ifndef NO_DH case DYNAMIC_TYPE_DH: ret = wc_InitDhKey_ex((DhKey*)*pKey, ssl->heap, ssl->devId); + if (ret == 0) + key_inited = 1; #if defined(WC_DH_NONBLOCK) && defined(WOLFSSL_ASYNC_CRYPT_SW) && \ defined(WC_ASYNC_ENABLE_DH) /* Only set non-blocking context when async device is active. With @@ -9189,12 +9203,18 @@ int AllocKey(WOLFSSL* ssl, int type, void** pKey) break; #endif /* !NO_DH */ default: - return BAD_FUNC_ARG; + ret = BAD_FUNC_ARG; + break; } - /* On error free handshake key */ + /* On error free handshake key if inited */ if (ret != 0) { - FreeKey(ssl, type, pKey); + if (key_inited) + FreeKey(ssl, type, pKey); + else { + XFREE(*pKey, ssl->heap, type); + *pKey = NULL; + } } return ret; From 69beb773f1edde23a8d6bf17c51bb97e5d4266e0 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Tue, 4 Aug 2026 00:23:04 -0500 Subject: [PATCH 14/44] wolfssl/wolfcrypt/visibility.h: add user-overrideable WC_ASM_ATT_HIDDEN(name) -> `.hidden name` macro under __ELF__, currently empty under !__ELF__. wolfcrypt/src/*.S, wolfcrypt/src/port/{arm,ppc32,ppc64,riscv64}/*.S: emit WC_ASM_ATT_HIDDEN for internal ATT-syntax symbols so they don't become dynamic-table entries or otherwise pollute symbol namespace beyond the library/module. --- wolfcrypt/src/aes_gcm_asm.S | 126 ++++ wolfcrypt/src/aes_gcm_x86_asm.S | 30 + wolfcrypt/src/aes_x86_64_asm.S | 46 ++ wolfcrypt/src/aes_xts_asm.S | 40 ++ wolfcrypt/src/chacha_asm.S | 6 + wolfcrypt/src/fe_x25519_asm.S | 142 +++++ wolfcrypt/src/poly1305_asm.S | 16 + wolfcrypt/src/port/arm/armv8-32-aes-asm.S | 13 + wolfcrypt/src/port/arm/armv8-32-chacha-asm.S | 7 + wolfcrypt/src/port/arm/armv8-32-curve25519.S | 45 ++ .../src/port/arm/armv8-32-frodokem-asm.S | 12 + wolfcrypt/src/port/arm/armv8-32-mlkem-asm.S | 6 + .../src/port/arm/armv8-32-poly1305-asm.S | 7 + wolfcrypt/src/port/arm/armv8-32-sha256-asm.S | 3 + wolfcrypt/src/port/arm/armv8-32-sha3-asm.S | 2 + wolfcrypt/src/port/arm/armv8-32-sha512-asm.S | 2 + wolfcrypt/src/port/arm/armv8-aes-asm.S | 118 ++++ wolfcrypt/src/port/arm/armv8-chacha-asm.S | 8 + wolfcrypt/src/port/arm/armv8-curve25519.S | 56 ++ wolfcrypt/src/port/arm/armv8-frodokem-asm.S | 36 ++ wolfcrypt/src/port/arm/armv8-mlkem-asm.S | 44 ++ wolfcrypt/src/port/arm/armv8-poly1305-asm.S | 8 + wolfcrypt/src/port/arm/armv8-sha256-asm.S | 4 + wolfcrypt/src/port/arm/armv8-sha3-asm.S | 4 + wolfcrypt/src/port/arm/armv8-sha512-asm.S | 4 + wolfcrypt/src/port/arm/thumb2-aes-asm.S | 13 + wolfcrypt/src/port/arm/thumb2-chacha-asm.S | 4 + wolfcrypt/src/port/arm/thumb2-curve25519.S | 45 ++ wolfcrypt/src/port/arm/thumb2-frodokem-asm.S | 5 + wolfcrypt/src/port/arm/thumb2-mlkem-asm.S | 6 + wolfcrypt/src/port/arm/thumb2-poly1305-asm.S | 3 + wolfcrypt/src/port/arm/thumb2-sha256-asm.S | 1 + wolfcrypt/src/port/arm/thumb2-sha3-asm.S | 1 + wolfcrypt/src/port/arm/thumb2-sha512-asm.S | 1 + wolfcrypt/src/port/ppc32/ppc32-aes-asm.S | 10 + wolfcrypt/src/port/ppc32/ppc32-sha256-asm.S | 3 + wolfcrypt/src/port/ppc32/ppc32-sha3-asm.S | 1 + wolfcrypt/src/port/ppc32/ppc32-sha512-asm.S | 1 + wolfcrypt/src/port/ppc64/ppc64-aes-asm.S | 66 +++ wolfcrypt/src/port/ppc64/ppc64-sha256-asm.S | 6 + wolfcrypt/src/port/ppc64/ppc64-sha3-asm.S | 12 + wolfcrypt/src/port/ppc64/ppc64-sha512-asm.S | 6 + wolfcrypt/src/port/riscv64/riscv-64-aes-asm.S | 62 ++ .../src/port/riscv64/riscv-64-chacha-asm.S | 5 + .../src/port/riscv64/riscv-64-poly1305-asm.S | 4 + .../src/port/riscv64/riscv-64-sha256-asm.S | 3 + .../src/port/riscv64/riscv-64-sha3-asm.S | 2 + .../src/port/riscv64/riscv-64-sha512-asm.S | 3 + wolfcrypt/src/sha256_asm.S | 24 + wolfcrypt/src/sha3_asm.S | 26 + wolfcrypt/src/sha512_asm.S | 16 + wolfcrypt/src/sp_x86_64_asm.S | 556 +++++++++++++++++- wolfcrypt/src/wc_falcon_fpr_x86_64_asm.S | 30 + wolfcrypt/src/wc_frodokem_asm.S | 32 + wolfcrypt/src/wc_mldsa_asm.S | 72 +++ wolfcrypt/src/wc_mlkem_asm.S | 144 +++++ wolfssl/wolfcrypt/visibility.h | 8 + 57 files changed, 1933 insertions(+), 23 deletions(-) diff --git a/wolfcrypt/src/aes_gcm_asm.S b/wolfcrypt/src/aes_gcm_asm.S index 553a05549df..f871add7619 100644 --- a/wolfcrypt/src/aes_gcm_asm.S +++ b/wolfcrypt/src/aes_gcm_asm.S @@ -71,12 +71,14 @@ L_GCM_generate_m0_aesni_mod2_128: #ifndef __APPLE__ .text .globl GCM_generate_m0_aesni +WC_ASM_ATT_HIDDEN(GCM_generate_m0_aesni) .type GCM_generate_m0_aesni,@function .align 16 GCM_generate_m0_aesni: #else .section __TEXT,__text .globl _GCM_generate_m0_aesni +WC_ASM_ATT_HIDDEN(_GCM_generate_m0_aesni) .p2align 4 _GCM_generate_m0_aesni: #endif /* __APPLE__ */ @@ -445,12 +447,14 @@ L_aes_gcm_mod2_128: #ifndef __APPLE__ .text .globl AES_GCM_encrypt_aesni +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_aesni) .type AES_GCM_encrypt_aesni,@function .align 16 AES_GCM_encrypt_aesni: #else .section __TEXT,__text .globl _AES_GCM_encrypt_aesni +WC_ASM_ATT_HIDDEN(_AES_GCM_encrypt_aesni) .p2align 4 _AES_GCM_encrypt_aesni: #endif /* __APPLE__ */ @@ -2299,12 +2303,14 @@ L_AES_GCM_encrypt_aesni_store_tag_done: #ifndef __APPLE__ .text .globl AES_GCM_decrypt_aesni +WC_ASM_ATT_HIDDEN(AES_GCM_decrypt_aesni) .type AES_GCM_decrypt_aesni,@function .align 16 AES_GCM_decrypt_aesni: #else .section __TEXT,__text .globl _AES_GCM_decrypt_aesni +WC_ASM_ATT_HIDDEN(_AES_GCM_decrypt_aesni) .p2align 4 _AES_GCM_decrypt_aesni: #endif /* __APPLE__ */ @@ -3705,12 +3711,14 @@ L_AES_GCM_decrypt_aesni_cmp_tag_done: #ifndef __APPLE__ .text .globl AES_GCM_init_aesni +WC_ASM_ATT_HIDDEN(AES_GCM_init_aesni) .type AES_GCM_init_aesni,@function .align 16 AES_GCM_init_aesni: #else .section __TEXT,__text .globl _AES_GCM_init_aesni +WC_ASM_ATT_HIDDEN(_AES_GCM_init_aesni) .p2align 4 _AES_GCM_init_aesni: #endif /* __APPLE__ */ @@ -4058,12 +4066,14 @@ L_AES_GCM_init_aesni_iv_done: #ifndef __APPLE__ .text .globl AES_GCM_aad_update_aesni +WC_ASM_ATT_HIDDEN(AES_GCM_aad_update_aesni) .type AES_GCM_aad_update_aesni,@function .align 16 AES_GCM_aad_update_aesni: #else .section __TEXT,__text .globl _AES_GCM_aad_update_aesni +WC_ASM_ATT_HIDDEN(_AES_GCM_aad_update_aesni) .p2align 4 _AES_GCM_aad_update_aesni: #endif /* __APPLE__ */ @@ -4140,12 +4150,14 @@ L_AES_GCM_aad_update_aesni_16_loop: #ifndef __APPLE__ .text .globl AES_GCM_encrypt_block_aesni +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_block_aesni) .type AES_GCM_encrypt_block_aesni,@function .align 16 AES_GCM_encrypt_block_aesni: #else .section __TEXT,__text .globl _AES_GCM_encrypt_block_aesni +WC_ASM_ATT_HIDDEN(_AES_GCM_encrypt_block_aesni) .p2align 4 _AES_GCM_encrypt_block_aesni: #endif /* __APPLE__ */ @@ -4190,12 +4202,14 @@ L_AES_GCM_encrypt_block_aesni_aesenc_block_aesenc_avx_last: #ifndef __APPLE__ .text .globl AES_GCM_ghash_block_aesni +WC_ASM_ATT_HIDDEN(AES_GCM_ghash_block_aesni) .type AES_GCM_ghash_block_aesni,@function .align 16 AES_GCM_ghash_block_aesni: #else .section __TEXT,__text .globl _AES_GCM_ghash_block_aesni +WC_ASM_ATT_HIDDEN(_AES_GCM_ghash_block_aesni) .p2align 4 _AES_GCM_ghash_block_aesni: #endif /* __APPLE__ */ @@ -4266,12 +4280,14 @@ _AES_GCM_ghash_block_aesni: #ifndef __APPLE__ .text .globl AES_GCM_encrypt_update_aesni +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_update_aesni) .type AES_GCM_encrypt_update_aesni,@function .align 16 AES_GCM_encrypt_update_aesni: #else .section __TEXT,__text .globl _AES_GCM_encrypt_update_aesni +WC_ASM_ATT_HIDDEN(_AES_GCM_encrypt_update_aesni) .p2align 4 _AES_GCM_encrypt_update_aesni: #endif /* __APPLE__ */ @@ -5488,12 +5504,14 @@ L_AES_GCM_encrypt_update_aesni_done_enc: #ifndef __APPLE__ .text .globl AES_GCM_encrypt_final_aesni +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_final_aesni) .type AES_GCM_encrypt_final_aesni,@function .align 16 AES_GCM_encrypt_final_aesni: #else .section __TEXT,__text .globl _AES_GCM_encrypt_final_aesni +WC_ASM_ATT_HIDDEN(_AES_GCM_encrypt_final_aesni) .p2align 4 _AES_GCM_encrypt_final_aesni: #endif /* __APPLE__ */ @@ -5589,12 +5607,14 @@ L_AES_GCM_encrypt_final_aesni_store_tag_done: #ifndef __APPLE__ .text .globl AES_GCM_decrypt_update_aesni +WC_ASM_ATT_HIDDEN(AES_GCM_decrypt_update_aesni) .type AES_GCM_decrypt_update_aesni,@function .align 16 AES_GCM_decrypt_update_aesni: #else .section __TEXT,__text .globl _AES_GCM_decrypt_update_aesni +WC_ASM_ATT_HIDDEN(_AES_GCM_decrypt_update_aesni) .p2align 4 _AES_GCM_decrypt_update_aesni: #endif /* __APPLE__ */ @@ -6354,12 +6374,14 @@ L_AES_GCM_decrypt_update_aesni_done_dec: #ifndef __APPLE__ .text .globl AES_GCM_decrypt_final_aesni +WC_ASM_ATT_HIDDEN(AES_GCM_decrypt_final_aesni) .type AES_GCM_decrypt_final_aesni,@function .align 16 AES_GCM_decrypt_final_aesni: #else .section __TEXT,__text .globl _AES_GCM_decrypt_final_aesni +WC_ASM_ATT_HIDDEN(_AES_GCM_decrypt_final_aesni) .p2align 4 _AES_GCM_decrypt_final_aesni: #endif /* __APPLE__ */ @@ -6488,12 +6510,14 @@ L_aes_gcm_siv_bswap_mask: #ifndef __APPLE__ .text .globl AES_GCMSIV_polyval_aesni +WC_ASM_ATT_HIDDEN(AES_GCMSIV_polyval_aesni) .type AES_GCMSIV_polyval_aesni,@function .align 16 AES_GCMSIV_polyval_aesni: #else .section __TEXT,__text .globl _AES_GCMSIV_polyval_aesni +WC_ASM_ATT_HIDDEN(_AES_GCMSIV_polyval_aesni) .p2align 4 _AES_GCMSIV_polyval_aesni: #endif /* __APPLE__ */ @@ -6849,12 +6873,14 @@ L_aes_gcmsiv_ctr_aesni_one: #ifndef __APPLE__ .text .globl AES_GCMSIV_ctr_aesni +WC_ASM_ATT_HIDDEN(AES_GCMSIV_ctr_aesni) .type AES_GCMSIV_ctr_aesni,@function .align 16 AES_GCMSIV_ctr_aesni: #else .section __TEXT,__text .globl _AES_GCMSIV_ctr_aesni +WC_ASM_ATT_HIDDEN(_AES_GCMSIV_ctr_aesni) .p2align 4 _AES_GCMSIV_ctr_aesni: #endif /* __APPLE__ */ @@ -7063,12 +7089,14 @@ L_GCM_generate_m0_avx1_mod2_128: #ifndef __APPLE__ .text .globl GCM_generate_m0_avx1 +WC_ASM_ATT_HIDDEN(GCM_generate_m0_avx1) .type GCM_generate_m0_avx1,@function .align 16 GCM_generate_m0_avx1: #else .section __TEXT,__text .globl _GCM_generate_m0_avx1 +WC_ASM_ATT_HIDDEN(_GCM_generate_m0_avx1) .p2align 4 _GCM_generate_m0_avx1: #endif /* __APPLE__ */ @@ -7403,12 +7431,14 @@ L_avx1_aes_gcm_mod2_128: #ifndef __APPLE__ .text .globl AES_GCM_encrypt_avx1 +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_avx1) .type AES_GCM_encrypt_avx1,@function .align 16 AES_GCM_encrypt_avx1: #else .section __TEXT,__text .globl _AES_GCM_encrypt_avx1 +WC_ASM_ATT_HIDDEN(_AES_GCM_encrypt_avx1) .p2align 4 _AES_GCM_encrypt_avx1: #endif /* __APPLE__ */ @@ -8985,12 +9015,14 @@ L_AES_GCM_encrypt_avx1_store_tag_done: #ifndef __APPLE__ .text .globl AES_GCM_decrypt_avx1 +WC_ASM_ATT_HIDDEN(AES_GCM_decrypt_avx1) .type AES_GCM_decrypt_avx1,@function .align 16 AES_GCM_decrypt_avx1: #else .section __TEXT,__text .globl _AES_GCM_decrypt_avx1 +WC_ASM_ATT_HIDDEN(_AES_GCM_decrypt_avx1) .p2align 4 _AES_GCM_decrypt_avx1: #endif /* __APPLE__ */ @@ -10162,12 +10194,14 @@ L_AES_GCM_decrypt_avx1_cmp_tag_done: #ifndef __APPLE__ .text .globl AES_GCM_init_avx1 +WC_ASM_ATT_HIDDEN(AES_GCM_init_avx1) .type AES_GCM_init_avx1,@function .align 16 AES_GCM_init_avx1: #else .section __TEXT,__text .globl _AES_GCM_init_avx1 +WC_ASM_ATT_HIDDEN(_AES_GCM_init_avx1) .p2align 4 _AES_GCM_init_avx1: #endif /* __APPLE__ */ @@ -10479,12 +10513,14 @@ L_AES_GCM_init_avx1_iv_done: #ifndef __APPLE__ .text .globl AES_GCM_aad_update_avx1 +WC_ASM_ATT_HIDDEN(AES_GCM_aad_update_avx1) .type AES_GCM_aad_update_avx1,@function .align 16 AES_GCM_aad_update_avx1: #else .section __TEXT,__text .globl _AES_GCM_aad_update_avx1 +WC_ASM_ATT_HIDDEN(_AES_GCM_aad_update_avx1) .p2align 4 _AES_GCM_aad_update_avx1: #endif /* __APPLE__ */ @@ -10550,12 +10586,14 @@ L_AES_GCM_aad_update_avx1_16_loop: #ifndef __APPLE__ .text .globl AES_GCM_encrypt_block_avx1 +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_block_avx1) .type AES_GCM_encrypt_block_avx1,@function .align 16 AES_GCM_encrypt_block_avx1: #else .section __TEXT,__text .globl _AES_GCM_encrypt_block_avx1 +WC_ASM_ATT_HIDDEN(_AES_GCM_encrypt_block_avx1) .p2align 4 _AES_GCM_encrypt_block_avx1: #endif /* __APPLE__ */ @@ -10600,12 +10638,14 @@ L_AES_GCM_encrypt_block_avx1_aesenc_block_last: #ifndef __APPLE__ .text .globl AES_GCM_ghash_block_avx1 +WC_ASM_ATT_HIDDEN(AES_GCM_ghash_block_avx1) .type AES_GCM_ghash_block_avx1,@function .align 16 AES_GCM_ghash_block_avx1: #else .section __TEXT,__text .globl _AES_GCM_ghash_block_avx1 +WC_ASM_ATT_HIDDEN(_AES_GCM_ghash_block_avx1) .p2align 4 _AES_GCM_ghash_block_avx1: #endif /* __APPLE__ */ @@ -10666,12 +10706,14 @@ _AES_GCM_ghash_block_avx1: #ifndef __APPLE__ .text .globl AES_GCM_encrypt_update_avx1 +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_update_avx1) .type AES_GCM_encrypt_update_avx1,@function .align 16 AES_GCM_encrypt_update_avx1: #else .section __TEXT,__text .globl _AES_GCM_encrypt_update_avx1 +WC_ASM_ATT_HIDDEN(_AES_GCM_encrypt_update_avx1) .p2align 4 _AES_GCM_encrypt_update_avx1: #endif /* __APPLE__ */ @@ -11691,12 +11733,14 @@ L_AES_GCM_encrypt_update_avx1_done_enc: #ifndef __APPLE__ .text .globl AES_GCM_encrypt_final_avx1 +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_final_avx1) .type AES_GCM_encrypt_final_avx1,@function .align 16 AES_GCM_encrypt_final_avx1: #else .section __TEXT,__text .globl _AES_GCM_encrypt_final_avx1 +WC_ASM_ATT_HIDDEN(_AES_GCM_encrypt_final_avx1) .p2align 4 _AES_GCM_encrypt_final_avx1: #endif /* __APPLE__ */ @@ -11781,12 +11825,14 @@ L_AES_GCM_encrypt_final_avx1_store_tag_done: #ifndef __APPLE__ .text .globl AES_GCM_decrypt_update_avx1 +WC_ASM_ATT_HIDDEN(AES_GCM_decrypt_update_avx1) .type AES_GCM_decrypt_update_avx1,@function .align 16 AES_GCM_decrypt_update_avx1: #else .section __TEXT,__text .globl _AES_GCM_decrypt_update_avx1 +WC_ASM_ATT_HIDDEN(_AES_GCM_decrypt_update_avx1) .p2align 4 _AES_GCM_decrypt_update_avx1: #endif /* __APPLE__ */ @@ -12390,12 +12436,14 @@ L_AES_GCM_decrypt_update_avx1_done_dec: #ifndef __APPLE__ .text .globl AES_GCM_decrypt_final_avx1 +WC_ASM_ATT_HIDDEN(AES_GCM_decrypt_final_avx1) .type AES_GCM_decrypt_final_avx1,@function .align 16 AES_GCM_decrypt_final_avx1: #else .section __TEXT,__text .globl _AES_GCM_decrypt_final_avx1 +WC_ASM_ATT_HIDDEN(_AES_GCM_decrypt_final_avx1) .p2align 4 _AES_GCM_decrypt_final_avx1: #endif /* __APPLE__ */ @@ -12513,12 +12561,14 @@ L_aes_gcm_siv_bswap_mask_avx1: #ifndef __APPLE__ .text .globl AES_GCMSIV_polyval_avx1 +WC_ASM_ATT_HIDDEN(AES_GCMSIV_polyval_avx1) .type AES_GCMSIV_polyval_avx1,@function .align 16 AES_GCMSIV_polyval_avx1: #else .section __TEXT,__text .globl _AES_GCMSIV_polyval_avx1 +WC_ASM_ATT_HIDDEN(_AES_GCMSIV_polyval_avx1) .p2align 4 _AES_GCMSIV_polyval_avx1: #endif /* __APPLE__ */ @@ -12779,12 +12829,14 @@ L_aes_gcmsiv_ctr_avx1_one: #ifndef __APPLE__ .text .globl AES_GCMSIV_ctr_avx1 +WC_ASM_ATT_HIDDEN(AES_GCMSIV_ctr_avx1) .type AES_GCMSIV_ctr_avx1,@function .align 16 AES_GCMSIV_ctr_avx1: #else .section __TEXT,__text .globl _AES_GCMSIV_ctr_avx1 +WC_ASM_ATT_HIDDEN(_AES_GCMSIV_ctr_avx1) .p2align 4 _AES_GCMSIV_ctr_avx1: #endif /* __APPLE__ */ @@ -12989,12 +13041,14 @@ L_GCM_generate_m0_avx2_mod2_128: #ifndef __APPLE__ .text .globl GCM_generate_m0_avx2 +WC_ASM_ATT_HIDDEN(GCM_generate_m0_avx2) .type GCM_generate_m0_avx2,@function .align 16 GCM_generate_m0_avx2: #else .section __TEXT,__text .globl _GCM_generate_m0_avx2 +WC_ASM_ATT_HIDDEN(_GCM_generate_m0_avx2) .p2align 4 _GCM_generate_m0_avx2: #endif /* __APPLE__ */ @@ -13341,12 +13395,14 @@ L_avx2_aes_gcm_mod2_128: #ifndef __APPLE__ .text .globl AES_GCM_encrypt_avx2 +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_avx2) .type AES_GCM_encrypt_avx2,@function .align 16 AES_GCM_encrypt_avx2: #else .section __TEXT,__text .globl _AES_GCM_encrypt_avx2 +WC_ASM_ATT_HIDDEN(_AES_GCM_encrypt_avx2) .p2align 4 _AES_GCM_encrypt_avx2: #endif /* __APPLE__ */ @@ -14824,12 +14880,14 @@ L_AES_GCM_encrypt_avx2_store_tag_done: #ifndef __APPLE__ .text .globl AES_GCM_decrypt_avx2 +WC_ASM_ATT_HIDDEN(AES_GCM_decrypt_avx2) .type AES_GCM_decrypt_avx2,@function .align 16 AES_GCM_decrypt_avx2: #else .section __TEXT,__text .globl _AES_GCM_decrypt_avx2 +WC_ASM_ATT_HIDDEN(_AES_GCM_decrypt_avx2) .p2align 4 _AES_GCM_decrypt_avx2: #endif /* __APPLE__ */ @@ -15971,12 +16029,14 @@ L_AES_GCM_decrypt_avx2_cmp_tag_done: #ifndef __APPLE__ .text .globl AES_GCM_init_avx2 +WC_ASM_ATT_HIDDEN(AES_GCM_init_avx2) .type AES_GCM_init_avx2,@function .align 16 AES_GCM_init_avx2: #else .section __TEXT,__text .globl _AES_GCM_init_avx2 +WC_ASM_ATT_HIDDEN(_AES_GCM_init_avx2) .p2align 4 _AES_GCM_init_avx2: #endif /* __APPLE__ */ @@ -16244,12 +16304,14 @@ L_AES_GCM_init_avx2_iv_done: #ifndef __APPLE__ .text .globl AES_GCM_aad_update_avx2 +WC_ASM_ATT_HIDDEN(AES_GCM_aad_update_avx2) .type AES_GCM_aad_update_avx2,@function .align 16 AES_GCM_aad_update_avx2: #else .section __TEXT,__text .globl _AES_GCM_aad_update_avx2 +WC_ASM_ATT_HIDDEN(_AES_GCM_aad_update_avx2) .p2align 4 _AES_GCM_aad_update_avx2: #endif /* __APPLE__ */ @@ -16303,12 +16365,14 @@ L_AES_GCM_aad_update_avx2_16_loop: #ifndef __APPLE__ .text .globl AES_GCM_encrypt_block_avx2 +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_block_avx2) .type AES_GCM_encrypt_block_avx2,@function .align 16 AES_GCM_encrypt_block_avx2: #else .section __TEXT,__text .globl _AES_GCM_encrypt_block_avx2 +WC_ASM_ATT_HIDDEN(_AES_GCM_encrypt_block_avx2) .p2align 4 _AES_GCM_encrypt_block_avx2: #endif /* __APPLE__ */ @@ -16368,12 +16432,14 @@ L_AES_GCM_encrypt_block_avx2_aesenc_block_last: #ifndef __APPLE__ .text .globl AES_GCM_ghash_block_avx2 +WC_ASM_ATT_HIDDEN(AES_GCM_ghash_block_avx2) .type AES_GCM_ghash_block_avx2,@function .align 16 AES_GCM_ghash_block_avx2: #else .section __TEXT,__text .globl _AES_GCM_ghash_block_avx2 +WC_ASM_ATT_HIDDEN(_AES_GCM_ghash_block_avx2) .p2align 4 _AES_GCM_ghash_block_avx2: #endif /* __APPLE__ */ @@ -16421,12 +16487,14 @@ _AES_GCM_ghash_block_avx2: #ifndef __APPLE__ .text .globl AES_GCM_encrypt_update_avx2 +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_update_avx2) .type AES_GCM_encrypt_update_avx2,@function .align 16 AES_GCM_encrypt_update_avx2: #else .section __TEXT,__text .globl _AES_GCM_encrypt_update_avx2 +WC_ASM_ATT_HIDDEN(_AES_GCM_encrypt_update_avx2) .p2align 4 _AES_GCM_encrypt_update_avx2: #endif /* __APPLE__ */ @@ -17279,12 +17347,14 @@ L_AES_GCM_encrypt_update_avx2_done_enc: #ifndef __APPLE__ .text .globl AES_GCM_encrypt_final_avx2 +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_final_avx2) .type AES_GCM_encrypt_final_avx2,@function .align 16 AES_GCM_encrypt_final_avx2: #else .section __TEXT,__text .globl _AES_GCM_encrypt_final_avx2 +WC_ASM_ATT_HIDDEN(_AES_GCM_encrypt_final_avx2) .p2align 4 _AES_GCM_encrypt_final_avx2: #endif /* __APPLE__ */ @@ -17351,12 +17421,14 @@ L_AES_GCM_encrypt_final_avx2_store_tag_done: #ifndef __APPLE__ .text .globl AES_GCM_decrypt_update_avx2 +WC_ASM_ATT_HIDDEN(AES_GCM_decrypt_update_avx2) .type AES_GCM_decrypt_update_avx2,@function .align 16 AES_GCM_decrypt_update_avx2: #else .section __TEXT,__text .globl _AES_GCM_decrypt_update_avx2 +WC_ASM_ATT_HIDDEN(_AES_GCM_decrypt_update_avx2) .p2align 4 _AES_GCM_decrypt_update_avx2: #endif /* __APPLE__ */ @@ -17862,12 +17934,14 @@ L_AES_GCM_decrypt_update_avx2_done_dec: #ifndef __APPLE__ .text .globl AES_GCM_decrypt_final_avx2 +WC_ASM_ATT_HIDDEN(AES_GCM_decrypt_final_avx2) .type AES_GCM_decrypt_final_avx2,@function .align 16 AES_GCM_decrypt_final_avx2: #else .section __TEXT,__text .globl _AES_GCM_decrypt_final_avx2 +WC_ASM_ATT_HIDDEN(_AES_GCM_decrypt_final_avx2) .p2align 4 _AES_GCM_decrypt_final_avx2: #endif /* __APPLE__ */ @@ -18027,12 +18101,14 @@ L_GCM_generate_m0_vaes_mod2_128: #ifndef __APPLE__ .text .globl GCM_generate_m0_vaes +WC_ASM_ATT_HIDDEN(GCM_generate_m0_vaes) .type GCM_generate_m0_vaes,@function .align 16 GCM_generate_m0_vaes: #else .section __TEXT,__text .globl _GCM_generate_m0_vaes +WC_ASM_ATT_HIDDEN(_GCM_generate_m0_vaes) .p2align 4 _GCM_generate_m0_vaes: #endif /* __APPLE__ */ @@ -18367,12 +18443,14 @@ L_vaes_aes_gcm_mod2_128: #ifndef __APPLE__ .text .globl AES_GCM_encrypt_vaes +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_vaes) .type AES_GCM_encrypt_vaes,@function .align 16 AES_GCM_encrypt_vaes: #else .section __TEXT,__text .globl _AES_GCM_encrypt_vaes +WC_ASM_ATT_HIDDEN(_AES_GCM_encrypt_vaes) .p2align 4 _AES_GCM_encrypt_vaes: #endif /* __APPLE__ */ @@ -20370,12 +20448,14 @@ L_AES_GCM_encrypt_vaes_store_tag_done: #ifndef __APPLE__ .text .globl AES_GCM_decrypt_vaes +WC_ASM_ATT_HIDDEN(AES_GCM_decrypt_vaes) .type AES_GCM_decrypt_vaes,@function .align 16 AES_GCM_decrypt_vaes: #else .section __TEXT,__text .globl _AES_GCM_decrypt_vaes +WC_ASM_ATT_HIDDEN(_AES_GCM_decrypt_vaes) .p2align 4 _AES_GCM_decrypt_vaes: #endif /* __APPLE__ */ @@ -22329,12 +22409,14 @@ L_AES_GCM_decrypt_vaes_cmp_tag_done: #ifndef __APPLE__ .text .globl AES_GCM_init_vaes +WC_ASM_ATT_HIDDEN(AES_GCM_init_vaes) .type AES_GCM_init_vaes,@function .align 16 AES_GCM_init_vaes: #else .section __TEXT,__text .globl _AES_GCM_init_vaes +WC_ASM_ATT_HIDDEN(_AES_GCM_init_vaes) .p2align 4 _AES_GCM_init_vaes: #endif /* __APPLE__ */ @@ -22646,12 +22728,14 @@ L_AES_GCM_init_vaes_iv_done: #ifndef __APPLE__ .text .globl AES_GCM_aad_update_vaes +WC_ASM_ATT_HIDDEN(AES_GCM_aad_update_vaes) .type AES_GCM_aad_update_vaes,@function .align 16 AES_GCM_aad_update_vaes: #else .section __TEXT,__text .globl _AES_GCM_aad_update_vaes +WC_ASM_ATT_HIDDEN(_AES_GCM_aad_update_vaes) .p2align 4 _AES_GCM_aad_update_vaes: #endif /* __APPLE__ */ @@ -23179,12 +23263,14 @@ L_AES_GCM_aad_update_vaes_done: #ifndef __APPLE__ .text .globl AES_GCM_encrypt_block_vaes +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_block_vaes) .type AES_GCM_encrypt_block_vaes,@function .align 16 AES_GCM_encrypt_block_vaes: #else .section __TEXT,__text .globl _AES_GCM_encrypt_block_vaes +WC_ASM_ATT_HIDDEN(_AES_GCM_encrypt_block_vaes) .p2align 4 _AES_GCM_encrypt_block_vaes: #endif /* __APPLE__ */ @@ -23229,12 +23315,14 @@ L_AES_GCM_encrypt_block_vaes_aesenc_block_last: #ifndef __APPLE__ .text .globl AES_GCM_ghash_block_vaes +WC_ASM_ATT_HIDDEN(AES_GCM_ghash_block_vaes) .type AES_GCM_ghash_block_vaes,@function .align 16 AES_GCM_ghash_block_vaes: #else .section __TEXT,__text .globl _AES_GCM_ghash_block_vaes +WC_ASM_ATT_HIDDEN(_AES_GCM_ghash_block_vaes) .p2align 4 _AES_GCM_ghash_block_vaes: #endif /* __APPLE__ */ @@ -23295,12 +23383,14 @@ _AES_GCM_ghash_block_vaes: #ifndef __APPLE__ .text .globl AES_GCM_encrypt_update_vaes +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_update_vaes) .type AES_GCM_encrypt_update_vaes,@function .align 16 AES_GCM_encrypt_update_vaes: #else .section __TEXT,__text .globl _AES_GCM_encrypt_update_vaes +WC_ASM_ATT_HIDDEN(_AES_GCM_encrypt_update_vaes) .p2align 4 _AES_GCM_encrypt_update_vaes: #endif /* __APPLE__ */ @@ -24250,12 +24340,14 @@ L_AES_GCM_encrypt_update_vaes_done_enc: #ifndef __APPLE__ .text .globl AES_GCM_encrypt_final_vaes +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_final_vaes) .type AES_GCM_encrypt_final_vaes,@function .align 16 AES_GCM_encrypt_final_vaes: #else .section __TEXT,__text .globl _AES_GCM_encrypt_final_vaes +WC_ASM_ATT_HIDDEN(_AES_GCM_encrypt_final_vaes) .p2align 4 _AES_GCM_encrypt_final_vaes: #endif /* __APPLE__ */ @@ -24326,12 +24418,14 @@ L_AES_GCM_encrypt_final_vaes_store_tag_done: #ifndef __APPLE__ .text .globl AES_GCM_decrypt_update_vaes +WC_ASM_ATT_HIDDEN(AES_GCM_decrypt_update_vaes) .type AES_GCM_decrypt_update_vaes,@function .align 16 AES_GCM_decrypt_update_vaes: #else .section __TEXT,__text .globl _AES_GCM_decrypt_update_vaes +WC_ASM_ATT_HIDDEN(_AES_GCM_decrypt_update_vaes) .p2align 4 _AES_GCM_decrypt_update_vaes: #endif /* __APPLE__ */ @@ -25230,12 +25324,14 @@ L_AES_GCM_decrypt_update_vaes_done_dec: #ifndef __APPLE__ .text .globl AES_GCM_decrypt_final_vaes +WC_ASM_ATT_HIDDEN(AES_GCM_decrypt_final_vaes) .type AES_GCM_decrypt_final_vaes,@function .align 16 AES_GCM_decrypt_final_vaes: #else .section __TEXT,__text .globl _AES_GCM_decrypt_final_vaes +WC_ASM_ATT_HIDDEN(_AES_GCM_decrypt_final_vaes) .p2align 4 _AES_GCM_decrypt_final_vaes: #endif /* __APPLE__ */ @@ -25339,12 +25435,14 @@ L_aes_gcm_siv_bswap_mask_vaes: #ifndef __APPLE__ .text .globl AES_GCMSIV_polyval_vaes +WC_ASM_ATT_HIDDEN(AES_GCMSIV_polyval_vaes) .type AES_GCMSIV_polyval_vaes,@function .align 16 AES_GCMSIV_polyval_vaes: #else .section __TEXT,__text .globl _AES_GCMSIV_polyval_vaes +WC_ASM_ATT_HIDDEN(_AES_GCMSIV_polyval_vaes) .p2align 4 _AES_GCMSIV_polyval_vaes: #endif /* __APPLE__ */ @@ -25885,12 +25983,14 @@ L_aes_gcmsiv_ctr_inc_vaes: #ifndef __APPLE__ .text .globl AES_GCMSIV_ctr_vaes +WC_ASM_ATT_HIDDEN(AES_GCMSIV_ctr_vaes) .type AES_GCMSIV_ctr_vaes,@function .align 16 AES_GCMSIV_ctr_vaes: #else .section __TEXT,__text .globl _AES_GCMSIV_ctr_vaes +WC_ASM_ATT_HIDDEN(_AES_GCMSIV_ctr_vaes) .p2align 4 _AES_GCMSIV_ctr_vaes: #endif /* __APPLE__ */ @@ -26226,12 +26326,14 @@ L_GCM_generate_m0_avx512_mod2_128: #ifndef __APPLE__ .text .globl GCM_generate_m0_avx512 +WC_ASM_ATT_HIDDEN(GCM_generate_m0_avx512) .type GCM_generate_m0_avx512,@function .align 16 GCM_generate_m0_avx512: #else .section __TEXT,__text .globl _GCM_generate_m0_avx512 +WC_ASM_ATT_HIDDEN(_GCM_generate_m0_avx512) .p2align 4 _GCM_generate_m0_avx512: #endif /* __APPLE__ */ @@ -26566,12 +26668,14 @@ L_avx512_aes_gcm_mod2_128: #ifndef __APPLE__ .text .globl AES_GCM_encrypt_avx512 +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_avx512) .type AES_GCM_encrypt_avx512,@function .align 16 AES_GCM_encrypt_avx512: #else .section __TEXT,__text .globl _AES_GCM_encrypt_avx512 +WC_ASM_ATT_HIDDEN(_AES_GCM_encrypt_avx512) .p2align 4 _AES_GCM_encrypt_avx512: #endif /* __APPLE__ */ @@ -29268,12 +29372,14 @@ L_AES_GCM_encrypt_avx512_store_tag_done: #ifndef __APPLE__ .text .globl AES_GCM_decrypt_avx512 +WC_ASM_ATT_HIDDEN(AES_GCM_decrypt_avx512) .type AES_GCM_decrypt_avx512,@function .align 16 AES_GCM_decrypt_avx512: #else .section __TEXT,__text .globl _AES_GCM_decrypt_avx512 +WC_ASM_ATT_HIDDEN(_AES_GCM_decrypt_avx512) .p2align 4 _AES_GCM_decrypt_avx512: #endif /* __APPLE__ */ @@ -31771,12 +31877,14 @@ L_AES_GCM_decrypt_avx512_cmp_tag_done: #ifndef __APPLE__ .text .globl AES_GCM_init_avx512 +WC_ASM_ATT_HIDDEN(AES_GCM_init_avx512) .type AES_GCM_init_avx512,@function .align 16 AES_GCM_init_avx512: #else .section __TEXT,__text .globl _AES_GCM_init_avx512 +WC_ASM_ATT_HIDDEN(_AES_GCM_init_avx512) .p2align 4 _AES_GCM_init_avx512: #endif /* __APPLE__ */ @@ -32088,12 +32196,14 @@ L_AES_GCM_init_avx512_iv_done: #ifndef __APPLE__ .text .globl AES_GCM_aad_update_avx512 +WC_ASM_ATT_HIDDEN(AES_GCM_aad_update_avx512) .type AES_GCM_aad_update_avx512,@function .align 16 AES_GCM_aad_update_avx512: #else .section __TEXT,__text .globl _AES_GCM_aad_update_avx512 +WC_ASM_ATT_HIDDEN(_AES_GCM_aad_update_avx512) .p2align 4 _AES_GCM_aad_update_avx512: #endif /* __APPLE__ */ @@ -32520,12 +32630,14 @@ L_AES_GCM_aad_update_avx512_done: #ifndef __APPLE__ .text .globl AES_GCM_encrypt_block_avx512 +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_block_avx512) .type AES_GCM_encrypt_block_avx512,@function .align 16 AES_GCM_encrypt_block_avx512: #else .section __TEXT,__text .globl _AES_GCM_encrypt_block_avx512 +WC_ASM_ATT_HIDDEN(_AES_GCM_encrypt_block_avx512) .p2align 4 _AES_GCM_encrypt_block_avx512: #endif /* __APPLE__ */ @@ -32570,12 +32682,14 @@ L_AES_GCM_encrypt_block_avx512_aesenc_block_last: #ifndef __APPLE__ .text .globl AES_GCM_ghash_block_avx512 +WC_ASM_ATT_HIDDEN(AES_GCM_ghash_block_avx512) .type AES_GCM_ghash_block_avx512,@function .align 16 AES_GCM_ghash_block_avx512: #else .section __TEXT,__text .globl _AES_GCM_ghash_block_avx512 +WC_ASM_ATT_HIDDEN(_AES_GCM_ghash_block_avx512) .p2align 4 _AES_GCM_ghash_block_avx512: #endif /* __APPLE__ */ @@ -32636,12 +32750,14 @@ _AES_GCM_ghash_block_avx512: #ifndef __APPLE__ .text .globl AES_GCM_encrypt_update_avx512 +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_update_avx512) .type AES_GCM_encrypt_update_avx512,@function .align 16 AES_GCM_encrypt_update_avx512: #else .section __TEXT,__text .globl _AES_GCM_encrypt_update_avx512 +WC_ASM_ATT_HIDDEN(_AES_GCM_encrypt_update_avx512) .p2align 4 _AES_GCM_encrypt_update_avx512: #endif /* __APPLE__ */ @@ -34389,12 +34505,14 @@ L_AES_GCM_encrypt_update_avx512_done_enc: #ifndef __APPLE__ .text .globl AES_GCM_encrypt_final_avx512 +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_final_avx512) .type AES_GCM_encrypt_final_avx512,@function .align 16 AES_GCM_encrypt_final_avx512: #else .section __TEXT,__text .globl _AES_GCM_encrypt_final_avx512 +WC_ASM_ATT_HIDDEN(_AES_GCM_encrypt_final_avx512) .p2align 4 _AES_GCM_encrypt_final_avx512: #endif /* __APPLE__ */ @@ -34466,12 +34584,14 @@ L_AES_GCM_encrypt_final_avx512_store_tag_done: #ifndef __APPLE__ .text .globl AES_GCM_decrypt_update_avx512 +WC_ASM_ATT_HIDDEN(AES_GCM_decrypt_update_avx512) .type AES_GCM_decrypt_update_avx512,@function .align 16 AES_GCM_decrypt_update_avx512: #else .section __TEXT,__text .globl _AES_GCM_decrypt_update_avx512 +WC_ASM_ATT_HIDDEN(_AES_GCM_decrypt_update_avx512) .p2align 4 _AES_GCM_decrypt_update_avx512: #endif /* __APPLE__ */ @@ -36013,12 +36133,14 @@ L_AES_GCM_decrypt_update_avx512_done_dec: #ifndef __APPLE__ .text .globl AES_GCM_decrypt_final_avx512 +WC_ASM_ATT_HIDDEN(AES_GCM_decrypt_final_avx512) .type AES_GCM_decrypt_final_avx512,@function .align 16 AES_GCM_decrypt_final_avx512: #else .section __TEXT,__text .globl _AES_GCM_decrypt_final_avx512 +WC_ASM_ATT_HIDDEN(_AES_GCM_decrypt_final_avx512) .p2align 4 _AES_GCM_decrypt_final_avx512: #endif /* __APPLE__ */ @@ -36123,12 +36245,14 @@ L_aes_gcm_siv_bswap_mask_avx512: #ifndef __APPLE__ .text .globl AES_GCMSIV_polyval_avx512 +WC_ASM_ATT_HIDDEN(AES_GCMSIV_polyval_avx512) .type AES_GCMSIV_polyval_avx512,@function .align 16 AES_GCMSIV_polyval_avx512: #else .section __TEXT,__text .globl _AES_GCMSIV_polyval_avx512 +WC_ASM_ATT_HIDDEN(_AES_GCMSIV_polyval_avx512) .p2align 4 _AES_GCMSIV_polyval_avx512: #endif /* __APPLE__ */ @@ -36868,12 +36992,14 @@ L_aes_gcmsiv_ctr_inc_avx512: #ifndef __APPLE__ .text .globl AES_GCMSIV_ctr_avx512 +WC_ASM_ATT_HIDDEN(AES_GCMSIV_ctr_avx512) .type AES_GCMSIV_ctr_avx512,@function .align 16 AES_GCMSIV_ctr_avx512: #else .section __TEXT,__text .globl _AES_GCMSIV_ctr_avx512 +WC_ASM_ATT_HIDDEN(_AES_GCMSIV_ctr_avx512) .p2align 4 _AES_GCMSIV_ctr_avx512: #endif /* __APPLE__ */ diff --git a/wolfcrypt/src/aes_gcm_x86_asm.S b/wolfcrypt/src/aes_gcm_x86_asm.S index 2598e0ddd55..173c3eeb454 100644 --- a/wolfcrypt/src/aes_gcm_x86_asm.S +++ b/wolfcrypt/src/aes_gcm_x86_asm.S @@ -123,6 +123,7 @@ L_aes_gcm_avx2_mod2_128: .long 0x00000001,0x00000000,0x00000000,0xc2000000 .text .globl AES_GCM_encrypt_aesni +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_aesni) .type AES_GCM_encrypt_aesni,@function .align 16 AES_GCM_encrypt_aesni: @@ -1515,6 +1516,7 @@ L_AES_GCM_encrypt_aesni_store_tag_done: .size AES_GCM_encrypt_aesni,.-AES_GCM_encrypt_aesni .text .globl AES_GCM_decrypt_aesni +WC_ASM_ATT_HIDDEN(AES_GCM_decrypt_aesni) .type AES_GCM_decrypt_aesni,@function .align 16 AES_GCM_decrypt_aesni: @@ -2824,6 +2826,7 @@ L_AES_GCM_decrypt_aesni_cmp_tag_done: #ifdef WOLFSSL_AESGCM_STREAM .text .globl AES_GCM_init_aesni +WC_ASM_ATT_HIDDEN(AES_GCM_init_aesni) .type AES_GCM_init_aesni,@function .align 16 AES_GCM_init_aesni: @@ -3172,6 +3175,7 @@ L_AES_GCM_init_aesni_iv_done: .size AES_GCM_init_aesni,.-AES_GCM_init_aesni .text .globl AES_GCM_aad_update_aesni +WC_ASM_ATT_HIDDEN(AES_GCM_aad_update_aesni) .type AES_GCM_aad_update_aesni,@function .align 16 AES_GCM_aad_update_aesni: @@ -3252,6 +3256,7 @@ L_AES_GCM_aad_update_aesni_16_loop: .size AES_GCM_aad_update_aesni,.-AES_GCM_aad_update_aesni .text .globl AES_GCM_encrypt_block_aesni +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_block_aesni) .type AES_GCM_encrypt_block_aesni,@function .align 16 AES_GCM_encrypt_block_aesni: @@ -3300,6 +3305,7 @@ L_AES_GCM_encrypt_block_aesni_aesenc_block_aesenc_avx_last: .size AES_GCM_encrypt_block_aesni,.-AES_GCM_encrypt_block_aesni .text .globl AES_GCM_ghash_block_aesni +WC_ASM_ATT_HIDDEN(AES_GCM_ghash_block_aesni) .type AES_GCM_ghash_block_aesni,@function .align 16 AES_GCM_ghash_block_aesni: @@ -3370,6 +3376,7 @@ AES_GCM_ghash_block_aesni: .size AES_GCM_ghash_block_aesni,.-AES_GCM_ghash_block_aesni .text .globl AES_GCM_encrypt_update_aesni +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_update_aesni) .type AES_GCM_encrypt_update_aesni,@function .align 16 AES_GCM_encrypt_update_aesni: @@ -4137,6 +4144,7 @@ L_AES_GCM_encrypt_update_aesni_done_enc: .size AES_GCM_encrypt_update_aesni,.-AES_GCM_encrypt_update_aesni .text .globl AES_GCM_encrypt_final_aesni +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_final_aesni) .type AES_GCM_encrypt_final_aesni,@function .align 16 AES_GCM_encrypt_final_aesni: @@ -4238,6 +4246,7 @@ L_AES_GCM_encrypt_final_aesni_store_tag_done: .size AES_GCM_encrypt_final_aesni,.-AES_GCM_encrypt_final_aesni .text .globl AES_GCM_decrypt_update_aesni +WC_ASM_ATT_HIDDEN(AES_GCM_decrypt_update_aesni) .type AES_GCM_decrypt_update_aesni,@function .align 16 AES_GCM_decrypt_update_aesni: @@ -4913,6 +4922,7 @@ L_AES_GCM_decrypt_update_aesni_done_dec: .size AES_GCM_decrypt_update_aesni,.-AES_GCM_decrypt_update_aesni .text .globl AES_GCM_decrypt_final_aesni +WC_ASM_ATT_HIDDEN(AES_GCM_decrypt_final_aesni) .type AES_GCM_decrypt_final_aesni,@function .align 16 AES_GCM_decrypt_final_aesni: @@ -5033,6 +5043,7 @@ L_AES_GCM_decrypt_final_aesni_cmp_tag_done: #ifdef HAVE_INTEL_AVX1 .text .globl AES_GCM_encrypt_avx1 +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_avx1) .type AES_GCM_encrypt_avx1,@function .align 16 AES_GCM_encrypt_avx1: @@ -6243,6 +6254,7 @@ L_AES_GCM_encrypt_avx1_store_tag_done: .size AES_GCM_encrypt_avx1,.-AES_GCM_encrypt_avx1 .text .globl AES_GCM_decrypt_avx1 +WC_ASM_ATT_HIDDEN(AES_GCM_decrypt_avx1) .type AES_GCM_decrypt_avx1,@function .align 16 AES_GCM_decrypt_avx1: @@ -7379,6 +7391,7 @@ L_AES_GCM_decrypt_avx1_cmp_tag_done: #ifdef WOLFSSL_AESGCM_STREAM .text .globl AES_GCM_init_avx1 +WC_ASM_ATT_HIDDEN(AES_GCM_init_avx1) .type AES_GCM_init_avx1,@function .align 16 AES_GCM_init_avx1: @@ -7693,6 +7706,7 @@ L_AES_GCM_init_avx1_iv_done: .size AES_GCM_init_avx1,.-AES_GCM_init_avx1 .text .globl AES_GCM_aad_update_avx1 +WC_ASM_ATT_HIDDEN(AES_GCM_aad_update_avx1) .type AES_GCM_aad_update_avx1,@function .align 16 AES_GCM_aad_update_avx1: @@ -7762,6 +7776,7 @@ L_AES_GCM_aad_update_avx1_16_loop: .size AES_GCM_aad_update_avx1,.-AES_GCM_aad_update_avx1 .text .globl AES_GCM_encrypt_block_avx1 +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_block_avx1) .type AES_GCM_encrypt_block_avx1,@function .align 16 AES_GCM_encrypt_block_avx1: @@ -7809,6 +7824,7 @@ L_AES_GCM_encrypt_block_avx1_aesenc_block_aesenc_avx_last: .size AES_GCM_encrypt_block_avx1,.-AES_GCM_encrypt_block_avx1 .text .globl AES_GCM_ghash_block_avx1 +WC_ASM_ATT_HIDDEN(AES_GCM_ghash_block_avx1) .type AES_GCM_ghash_block_avx1,@function .align 16 AES_GCM_ghash_block_avx1: @@ -7868,6 +7884,7 @@ AES_GCM_ghash_block_avx1: .size AES_GCM_ghash_block_avx1,.-AES_GCM_ghash_block_avx1 .text .globl AES_GCM_encrypt_update_avx1 +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_update_avx1) .type AES_GCM_encrypt_update_avx1,@function .align 16 AES_GCM_encrypt_update_avx1: @@ -8528,6 +8545,7 @@ L_AES_GCM_encrypt_update_avx1_done_enc: .size AES_GCM_encrypt_update_avx1,.-AES_GCM_encrypt_update_avx1 .text .globl AES_GCM_encrypt_final_avx1 +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_final_avx1) .type AES_GCM_encrypt_final_avx1,@function .align 16 AES_GCM_encrypt_final_avx1: @@ -8617,6 +8635,7 @@ L_AES_GCM_encrypt_final_avx1_store_tag_done: .size AES_GCM_encrypt_final_avx1,.-AES_GCM_encrypt_final_avx1 .text .globl AES_GCM_decrypt_update_avx1 +WC_ASM_ATT_HIDDEN(AES_GCM_decrypt_update_avx1) .type AES_GCM_decrypt_update_avx1,@function .align 16 AES_GCM_decrypt_update_avx1: @@ -9194,6 +9213,7 @@ L_AES_GCM_decrypt_update_avx1_done_dec: .size AES_GCM_decrypt_update_avx1,.-AES_GCM_decrypt_update_avx1 .text .globl AES_GCM_decrypt_final_avx1 +WC_ASM_ATT_HIDDEN(AES_GCM_decrypt_final_avx1) .type AES_GCM_decrypt_final_avx1,@function .align 16 AES_GCM_decrypt_final_avx1: @@ -9303,6 +9323,7 @@ L_AES_GCM_decrypt_final_avx1_cmp_tag_done: #ifdef HAVE_INTEL_AVX2 .text .globl AES_GCM_encrypt_avx2 +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_avx2) .type AES_GCM_encrypt_avx2,@function .align 16 AES_GCM_encrypt_avx2: @@ -10306,6 +10327,7 @@ L_AES_GCM_encrypt_avx2_store_tag_done: .size AES_GCM_encrypt_avx2,.-AES_GCM_encrypt_avx2 .text .globl AES_GCM_decrypt_avx2 +WC_ASM_ATT_HIDDEN(AES_GCM_decrypt_avx2) .type AES_GCM_decrypt_avx2,@function .align 16 AES_GCM_decrypt_avx2: @@ -11278,6 +11300,7 @@ L_AES_GCM_decrypt_avx2_cmp_tag_done: #ifdef WOLFSSL_AESGCM_STREAM .text .globl AES_GCM_init_avx2 +WC_ASM_ATT_HIDDEN(AES_GCM_init_avx2) .type AES_GCM_init_avx2,@function .align 16 AES_GCM_init_avx2: @@ -11547,6 +11570,7 @@ L_AES_GCM_init_avx2_iv_done: .size AES_GCM_init_avx2,.-AES_GCM_init_avx2 .text .globl AES_GCM_aad_update_avx2 +WC_ASM_ATT_HIDDEN(AES_GCM_aad_update_avx2) .type AES_GCM_aad_update_avx2,@function .align 16 AES_GCM_aad_update_avx2: @@ -11603,6 +11627,7 @@ L_AES_GCM_aad_update_avx2_16_loop: .size AES_GCM_aad_update_avx2,.-AES_GCM_aad_update_avx2 .text .globl AES_GCM_encrypt_block_avx2 +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_block_avx2) .type AES_GCM_encrypt_block_avx2,@function .align 16 AES_GCM_encrypt_block_avx2: @@ -11652,6 +11677,7 @@ L_AES_GCM_encrypt_block_avx2_aesenc_block_aesenc_avx_last: .size AES_GCM_encrypt_block_avx2,.-AES_GCM_encrypt_block_avx2 .text .globl AES_GCM_ghash_block_avx2 +WC_ASM_ATT_HIDDEN(AES_GCM_ghash_block_avx2) .type AES_GCM_ghash_block_avx2,@function .align 16 AES_GCM_ghash_block_avx2: @@ -11698,6 +11724,7 @@ AES_GCM_ghash_block_avx2: .size AES_GCM_ghash_block_avx2,.-AES_GCM_ghash_block_avx2 .text .globl AES_GCM_encrypt_update_avx2 +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_update_avx2) .type AES_GCM_encrypt_update_avx2,@function .align 16 AES_GCM_encrypt_update_avx2: @@ -12258,6 +12285,7 @@ L_AES_GCM_encrypt_update_avx2_done_enc: .size AES_GCM_encrypt_update_avx2,.-AES_GCM_encrypt_update_avx2 .text .globl AES_GCM_encrypt_final_avx2 +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_final_avx2) .type AES_GCM_encrypt_final_avx2,@function .align 16 AES_GCM_encrypt_final_avx2: @@ -12336,6 +12364,7 @@ L_AES_GCM_encrypt_final_avx2_store_tag_done: .size AES_GCM_encrypt_final_avx2,.-AES_GCM_encrypt_final_avx2 .text .globl AES_GCM_decrypt_update_avx2 +WC_ASM_ATT_HIDDEN(AES_GCM_decrypt_update_avx2) .type AES_GCM_decrypt_update_avx2,@function .align 16 AES_GCM_decrypt_update_avx2: @@ -12852,6 +12881,7 @@ L_AES_GCM_decrypt_update_avx2_done_dec: .size AES_GCM_decrypt_update_avx2,.-AES_GCM_decrypt_update_avx2 .text .globl AES_GCM_decrypt_final_avx2 +WC_ASM_ATT_HIDDEN(AES_GCM_decrypt_final_avx2) .type AES_GCM_decrypt_final_avx2,@function .align 16 AES_GCM_decrypt_final_avx2: diff --git a/wolfcrypt/src/aes_x86_64_asm.S b/wolfcrypt/src/aes_x86_64_asm.S index 011798a293e..9d782558dd8 100644 --- a/wolfcrypt/src/aes_x86_64_asm.S +++ b/wolfcrypt/src/aes_x86_64_asm.S @@ -47,12 +47,14 @@ #ifndef __APPLE__ .text .globl AES_128_Key_Expansion_AESNI +WC_ASM_ATT_HIDDEN(AES_128_Key_Expansion_AESNI) .type AES_128_Key_Expansion_AESNI,@function .align 16 AES_128_Key_Expansion_AESNI: #else .section __TEXT,__text .globl _AES_128_Key_Expansion_AESNI +WC_ASM_ATT_HIDDEN(_AES_128_Key_Expansion_AESNI) .p2align 4 _AES_128_Key_Expansion_AESNI: #endif /* __APPLE__ */ @@ -175,12 +177,14 @@ _AES_128_Key_Expansion_AESNI: #ifndef __APPLE__ .text .globl AES_192_Key_Expansion_AESNI +WC_ASM_ATT_HIDDEN(AES_192_Key_Expansion_AESNI) .type AES_192_Key_Expansion_AESNI,@function .align 16 AES_192_Key_Expansion_AESNI: #else .section __TEXT,__text .globl _AES_192_Key_Expansion_AESNI +WC_ASM_ATT_HIDDEN(_AES_192_Key_Expansion_AESNI) .p2align 4 _AES_192_Key_Expansion_AESNI: #endif /* __APPLE__ */ @@ -344,12 +348,14 @@ _AES_192_Key_Expansion_AESNI: #ifndef __APPLE__ .text .globl AES_256_Key_Expansion_AESNI +WC_ASM_ATT_HIDDEN(AES_256_Key_Expansion_AESNI) .type AES_256_Key_Expansion_AESNI,@function .align 16 AES_256_Key_Expansion_AESNI: #else .section __TEXT,__text .globl _AES_256_Key_Expansion_AESNI +WC_ASM_ATT_HIDDEN(_AES_256_Key_Expansion_AESNI) .p2align 4 _AES_256_Key_Expansion_AESNI: #endif /* __APPLE__ */ @@ -507,12 +513,14 @@ _AES_256_Key_Expansion_AESNI: #ifndef __APPLE__ .text .globl AES_ECB_encrypt_AESNI +WC_ASM_ATT_HIDDEN(AES_ECB_encrypt_AESNI) .type AES_ECB_encrypt_AESNI,@function .align 16 AES_ECB_encrypt_AESNI: #else .section __TEXT,__text .globl _AES_ECB_encrypt_AESNI +WC_ASM_ATT_HIDDEN(_AES_ECB_encrypt_AESNI) .p2align 4 _AES_ECB_encrypt_AESNI: #endif /* __APPLE__ */ @@ -675,12 +683,14 @@ L_AES_ECB_encrypt_AESNI_done_enc: #ifndef __APPLE__ .text .globl AES_ECB_decrypt_AESNI +WC_ASM_ATT_HIDDEN(AES_ECB_decrypt_AESNI) .type AES_ECB_decrypt_AESNI,@function .align 16 AES_ECB_decrypt_AESNI: #else .section __TEXT,__text .globl _AES_ECB_decrypt_AESNI +WC_ASM_ATT_HIDDEN(_AES_ECB_decrypt_AESNI) .p2align 4 _AES_ECB_decrypt_AESNI: #endif /* __APPLE__ */ @@ -843,12 +853,14 @@ L_AES_ECB_decrypt_AESNI_done_dec: #ifndef __APPLE__ .text .globl AES_CBC_encrypt_AESNI +WC_ASM_ATT_HIDDEN(AES_CBC_encrypt_AESNI) .type AES_CBC_encrypt_AESNI,@function .align 16 AES_CBC_encrypt_AESNI: #else .section __TEXT,__text .globl _AES_CBC_encrypt_AESNI +WC_ASM_ATT_HIDDEN(_AES_CBC_encrypt_AESNI) .p2align 4 _AES_CBC_encrypt_AESNI: #endif /* __APPLE__ */ @@ -911,12 +923,14 @@ L_AES_CBC_encrypt_AESNI_done: #ifndef __APPLE__ .text .globl AES_CBC_decrypt_AESNI +WC_ASM_ATT_HIDDEN(AES_CBC_decrypt_AESNI) .type AES_CBC_decrypt_AESNI,@function .align 16 AES_CBC_decrypt_AESNI: #else .section __TEXT,__text .globl _AES_CBC_decrypt_AESNI +WC_ASM_ATT_HIDDEN(_AES_CBC_decrypt_AESNI) .p2align 4 _AES_CBC_decrypt_AESNI: #endif /* __APPLE__ */ @@ -1118,12 +1132,14 @@ L_aes_ctr_aesni_one: #ifndef __APPLE__ .text .globl AES_CTR_encrypt_AESNI +WC_ASM_ATT_HIDDEN(AES_CTR_encrypt_AESNI) .type AES_CTR_encrypt_AESNI,@function .align 16 AES_CTR_encrypt_AESNI: #else .section __TEXT,__text .globl _AES_CTR_encrypt_AESNI +WC_ASM_ATT_HIDDEN(_AES_CTR_encrypt_AESNI) .p2align 4 _AES_CTR_encrypt_AESNI: #endif /* __APPLE__ */ @@ -1341,12 +1357,14 @@ L_AES_CTR_encrypt_AESNI_done_enc: #ifndef __APPLE__ .text .globl AES_ECB_encrypt_avx1 +WC_ASM_ATT_HIDDEN(AES_ECB_encrypt_avx1) .type AES_ECB_encrypt_avx1,@function .align 16 AES_ECB_encrypt_avx1: #else .section __TEXT,__text .globl _AES_ECB_encrypt_avx1 +WC_ASM_ATT_HIDDEN(_AES_ECB_encrypt_avx1) .p2align 4 _AES_ECB_encrypt_avx1: #endif /* __APPLE__ */ @@ -1509,12 +1527,14 @@ L_AES_ECB_encrypt_avx1_done_enc: #ifndef __APPLE__ .text .globl AES_ECB_decrypt_avx1 +WC_ASM_ATT_HIDDEN(AES_ECB_decrypt_avx1) .type AES_ECB_decrypt_avx1,@function .align 16 AES_ECB_decrypt_avx1: #else .section __TEXT,__text .globl _AES_ECB_decrypt_avx1 +WC_ASM_ATT_HIDDEN(_AES_ECB_decrypt_avx1) .p2align 4 _AES_ECB_decrypt_avx1: #endif /* __APPLE__ */ @@ -1677,12 +1697,14 @@ L_AES_ECB_decrypt_avx1_done_dec: #ifndef __APPLE__ .text .globl AES_CBC_encrypt_avx1 +WC_ASM_ATT_HIDDEN(AES_CBC_encrypt_avx1) .type AES_CBC_encrypt_avx1,@function .align 16 AES_CBC_encrypt_avx1: #else .section __TEXT,__text .globl _AES_CBC_encrypt_avx1 +WC_ASM_ATT_HIDDEN(_AES_CBC_encrypt_avx1) .p2align 4 _AES_CBC_encrypt_avx1: #endif /* __APPLE__ */ @@ -1745,12 +1767,14 @@ L_AES_CBC_encrypt_avx1_done: #ifndef __APPLE__ .text .globl AES_CBC_decrypt_avx1 +WC_ASM_ATT_HIDDEN(AES_CBC_decrypt_avx1) .type AES_CBC_decrypt_avx1,@function .align 16 AES_CBC_decrypt_avx1: #else .section __TEXT,__text .globl _AES_CBC_decrypt_avx1 +WC_ASM_ATT_HIDDEN(_AES_CBC_decrypt_avx1) .p2align 4 _AES_CBC_decrypt_avx1: #endif /* __APPLE__ */ @@ -1949,12 +1973,14 @@ L_aes_ctr_avx1_one: #ifndef __APPLE__ .text .globl AES_CTR_encrypt_avx1 +WC_ASM_ATT_HIDDEN(AES_CTR_encrypt_avx1) .type AES_CTR_encrypt_avx1,@function .align 16 AES_CTR_encrypt_avx1: #else .section __TEXT,__text .globl _AES_CTR_encrypt_avx1 +WC_ASM_ATT_HIDDEN(_AES_CTR_encrypt_avx1) .p2align 4 _AES_CTR_encrypt_avx1: #endif /* __APPLE__ */ @@ -2158,12 +2184,14 @@ L_AES_CTR_encrypt_avx1_done_enc: #ifndef __APPLE__ .text .globl AES_ECB_encrypt_vaes +WC_ASM_ATT_HIDDEN(AES_ECB_encrypt_vaes) .type AES_ECB_encrypt_vaes,@function .align 16 AES_ECB_encrypt_vaes: #else .section __TEXT,__text .globl _AES_ECB_encrypt_vaes +WC_ASM_ATT_HIDDEN(_AES_ECB_encrypt_vaes) .p2align 4 _AES_ECB_encrypt_vaes: #endif /* __APPLE__ */ @@ -2442,12 +2470,14 @@ L_AES_ECB_encrypt_vaes_done_enc: #ifndef __APPLE__ .text .globl AES_ECB_decrypt_vaes +WC_ASM_ATT_HIDDEN(AES_ECB_decrypt_vaes) .type AES_ECB_decrypt_vaes,@function .align 16 AES_ECB_decrypt_vaes: #else .section __TEXT,__text .globl _AES_ECB_decrypt_vaes +WC_ASM_ATT_HIDDEN(_AES_ECB_decrypt_vaes) .p2align 4 _AES_ECB_decrypt_vaes: #endif /* __APPLE__ */ @@ -2726,12 +2756,14 @@ L_AES_ECB_decrypt_vaes_done_dec: #ifndef __APPLE__ .text .globl AES_CBC_encrypt_vaes +WC_ASM_ATT_HIDDEN(AES_CBC_encrypt_vaes) .type AES_CBC_encrypt_vaes,@function .align 16 AES_CBC_encrypt_vaes: #else .section __TEXT,__text .globl _AES_CBC_encrypt_vaes +WC_ASM_ATT_HIDDEN(_AES_CBC_encrypt_vaes) .p2align 4 _AES_CBC_encrypt_vaes: #endif /* __APPLE__ */ @@ -2794,12 +2826,14 @@ L_AES_CBC_encrypt_vaes_done: #ifndef __APPLE__ .text .globl AES_CBC_decrypt_vaes +WC_ASM_ATT_HIDDEN(AES_CBC_decrypt_vaes) .type AES_CBC_decrypt_vaes,@function .align 16 AES_CBC_decrypt_vaes: #else .section __TEXT,__text .globl _AES_CBC_decrypt_vaes +WC_ASM_ATT_HIDDEN(_AES_CBC_decrypt_vaes) .p2align 4 _AES_CBC_decrypt_vaes: #endif /* __APPLE__ */ @@ -3142,12 +3176,14 @@ L_aes_ctr_inc_vaes: #ifndef __APPLE__ .text .globl AES_CTR_encrypt_vaes +WC_ASM_ATT_HIDDEN(AES_CTR_encrypt_vaes) .type AES_CTR_encrypt_vaes,@function .align 16 AES_CTR_encrypt_vaes: #else .section __TEXT,__text .globl _AES_CTR_encrypt_vaes +WC_ASM_ATT_HIDDEN(_AES_CTR_encrypt_vaes) .p2align 4 _AES_CTR_encrypt_vaes: #endif /* __APPLE__ */ @@ -3573,12 +3609,14 @@ L_AES_CTR_encrypt_vaes_done_enc: #ifndef __APPLE__ .text .globl AES_ECB_encrypt_avx512 +WC_ASM_ATT_HIDDEN(AES_ECB_encrypt_avx512) .type AES_ECB_encrypt_avx512,@function .align 16 AES_ECB_encrypt_avx512: #else .section __TEXT,__text .globl _AES_ECB_encrypt_avx512 +WC_ASM_ATT_HIDDEN(_AES_ECB_encrypt_avx512) .p2align 4 _AES_ECB_encrypt_avx512: #endif /* __APPLE__ */ @@ -3878,12 +3916,14 @@ L_AES_ECB_encrypt_avx512_done_enc: #ifndef __APPLE__ .text .globl AES_ECB_decrypt_avx512 +WC_ASM_ATT_HIDDEN(AES_ECB_decrypt_avx512) .type AES_ECB_decrypt_avx512,@function .align 16 AES_ECB_decrypt_avx512: #else .section __TEXT,__text .globl _AES_ECB_decrypt_avx512 +WC_ASM_ATT_HIDDEN(_AES_ECB_decrypt_avx512) .p2align 4 _AES_ECB_decrypt_avx512: #endif /* __APPLE__ */ @@ -4183,12 +4223,14 @@ L_AES_ECB_decrypt_avx512_done_dec: #ifndef __APPLE__ .text .globl AES_CBC_encrypt_avx512 +WC_ASM_ATT_HIDDEN(AES_CBC_encrypt_avx512) .type AES_CBC_encrypt_avx512,@function .align 16 AES_CBC_encrypt_avx512: #else .section __TEXT,__text .globl _AES_CBC_encrypt_avx512 +WC_ASM_ATT_HIDDEN(_AES_CBC_encrypt_avx512) .p2align 4 _AES_CBC_encrypt_avx512: #endif /* __APPLE__ */ @@ -4250,12 +4292,14 @@ L_AES_CBC_encrypt_avx512_done: #ifndef __APPLE__ .text .globl AES_CBC_decrypt_avx512 +WC_ASM_ATT_HIDDEN(AES_CBC_decrypt_avx512) .type AES_CBC_decrypt_avx512,@function .align 16 AES_CBC_decrypt_avx512: #else .section __TEXT,__text .globl _AES_CBC_decrypt_avx512 +WC_ASM_ATT_HIDDEN(_AES_CBC_decrypt_avx512) .p2align 4 _AES_CBC_decrypt_avx512: #endif /* __APPLE__ */ @@ -4625,12 +4669,14 @@ L_aes_ctr_inc_avx512: #ifndef __APPLE__ .text .globl AES_CTR_encrypt_avx512 +WC_ASM_ATT_HIDDEN(AES_CTR_encrypt_avx512) .type AES_CTR_encrypt_avx512,@function .align 16 AES_CTR_encrypt_avx512: #else .section __TEXT,__text .globl _AES_CTR_encrypt_avx512 +WC_ASM_ATT_HIDDEN(_AES_CTR_encrypt_avx512) .p2align 4 _AES_CTR_encrypt_avx512: #endif /* __APPLE__ */ diff --git a/wolfcrypt/src/aes_xts_asm.S b/wolfcrypt/src/aes_xts_asm.S index d9d38e6b6f0..629de47516f 100644 --- a/wolfcrypt/src/aes_xts_asm.S +++ b/wolfcrypt/src/aes_xts_asm.S @@ -48,12 +48,14 @@ #ifndef __APPLE__ .text .globl AES_XTS_init_aesni +WC_ASM_ATT_HIDDEN(AES_XTS_init_aesni) .type AES_XTS_init_aesni,@function .align 16 AES_XTS_init_aesni: #else .section __TEXT,__text .globl _AES_XTS_init_aesni +WC_ASM_ATT_HIDDEN(_AES_XTS_init_aesni) .p2align 4 _AES_XTS_init_aesni: #endif /* __APPLE__ */ @@ -113,12 +115,14 @@ L_aes_xts_gc_xts: #ifndef __APPLE__ .text .globl AES_XTS_encrypt_aesni +WC_ASM_ATT_HIDDEN(AES_XTS_encrypt_aesni) .type AES_XTS_encrypt_aesni,@function .align 16 AES_XTS_encrypt_aesni: #else .section __TEXT,__text .globl _AES_XTS_encrypt_aesni +WC_ASM_ATT_HIDDEN(_AES_XTS_encrypt_aesni) .p2align 4 _AES_XTS_encrypt_aesni: #endif /* __APPLE__ */ @@ -435,12 +439,14 @@ L_AES_XTS_encrypt_aesni_done_enc: #ifndef __APPLE__ .text .globl AES_XTS_encrypt_update_aesni +WC_ASM_ATT_HIDDEN(AES_XTS_encrypt_update_aesni) .type AES_XTS_encrypt_update_aesni,@function .align 16 AES_XTS_encrypt_update_aesni: #else .section __TEXT,__text .globl _AES_XTS_encrypt_update_aesni +WC_ASM_ATT_HIDDEN(_AES_XTS_encrypt_update_aesni) .p2align 4 _AES_XTS_encrypt_update_aesni: #endif /* __APPLE__ */ @@ -720,12 +726,14 @@ L_AES_XTS_encrypt_update_aesni_done_enc: #ifndef __APPLE__ .text .globl AES_XTS_decrypt_aesni +WC_ASM_ATT_HIDDEN(AES_XTS_decrypt_aesni) .type AES_XTS_decrypt_aesni,@function .align 16 AES_XTS_decrypt_aesni: #else .section __TEXT,__text .globl _AES_XTS_decrypt_aesni +WC_ASM_ATT_HIDDEN(_AES_XTS_decrypt_aesni) .p2align 4 _AES_XTS_decrypt_aesni: #endif /* __APPLE__ */ @@ -1096,12 +1104,14 @@ L_AES_XTS_decrypt_aesni_done_dec: #ifndef __APPLE__ .text .globl AES_XTS_decrypt_update_aesni +WC_ASM_ATT_HIDDEN(AES_XTS_decrypt_update_aesni) .type AES_XTS_decrypt_update_aesni,@function .align 16 AES_XTS_decrypt_update_aesni: #else .section __TEXT,__text .globl _AES_XTS_decrypt_update_aesni +WC_ASM_ATT_HIDDEN(_AES_XTS_decrypt_update_aesni) .p2align 4 _AES_XTS_decrypt_update_aesni: #endif /* __APPLE__ */ @@ -1436,12 +1446,14 @@ L_AES_XTS_decrypt_update_aesni_done_dec: #ifndef __APPLE__ .text .globl AES_XTS_init_avx1 +WC_ASM_ATT_HIDDEN(AES_XTS_init_avx1) .type AES_XTS_init_avx1,@function .align 16 AES_XTS_init_avx1: #else .section __TEXT,__text .globl _AES_XTS_init_avx1 +WC_ASM_ATT_HIDDEN(_AES_XTS_init_avx1) .p2align 4 _AES_XTS_init_avx1: #endif /* __APPLE__ */ @@ -1501,12 +1513,14 @@ L_avx1_aes_xts_gc_xts: #ifndef __APPLE__ .text .globl AES_XTS_encrypt_avx1 +WC_ASM_ATT_HIDDEN(AES_XTS_encrypt_avx1) .type AES_XTS_encrypt_avx1,@function .align 16 AES_XTS_encrypt_avx1: #else .section __TEXT,__text .globl _AES_XTS_encrypt_avx1 +WC_ASM_ATT_HIDDEN(_AES_XTS_encrypt_avx1) .p2align 4 _AES_XTS_encrypt_avx1: #endif /* __APPLE__ */ @@ -1814,12 +1828,14 @@ L_AES_XTS_encrypt_avx1_done_enc: #ifndef __APPLE__ .text .globl AES_XTS_encrypt_update_avx1 +WC_ASM_ATT_HIDDEN(AES_XTS_encrypt_update_avx1) .type AES_XTS_encrypt_update_avx1,@function .align 16 AES_XTS_encrypt_update_avx1: #else .section __TEXT,__text .globl _AES_XTS_encrypt_update_avx1 +WC_ASM_ATT_HIDDEN(_AES_XTS_encrypt_update_avx1) .p2align 4 _AES_XTS_encrypt_update_avx1: #endif /* __APPLE__ */ @@ -2090,12 +2106,14 @@ L_AES_XTS_encrypt_update_avx1_done_enc: #ifndef __APPLE__ .text .globl AES_XTS_decrypt_avx1 +WC_ASM_ATT_HIDDEN(AES_XTS_decrypt_avx1) .type AES_XTS_decrypt_avx1,@function .align 16 AES_XTS_decrypt_avx1: #else .section __TEXT,__text .globl _AES_XTS_decrypt_avx1 +WC_ASM_ATT_HIDDEN(_AES_XTS_decrypt_avx1) .p2align 4 _AES_XTS_decrypt_avx1: #endif /* __APPLE__ */ @@ -2455,12 +2473,14 @@ L_AES_XTS_decrypt_avx1_done_dec: #ifndef __APPLE__ .text .globl AES_XTS_decrypt_update_avx1 +WC_ASM_ATT_HIDDEN(AES_XTS_decrypt_update_avx1) .type AES_XTS_decrypt_update_avx1,@function .align 16 AES_XTS_decrypt_update_avx1: #else .section __TEXT,__text .globl _AES_XTS_decrypt_update_avx1 +WC_ASM_ATT_HIDDEN(_AES_XTS_decrypt_update_avx1) .p2align 4 _AES_XTS_decrypt_update_avx1: #endif /* __APPLE__ */ @@ -2785,12 +2805,14 @@ L_AES_XTS_decrypt_update_avx1_done_dec: #ifndef __APPLE__ .text .globl AES_XTS_init_vaes +WC_ASM_ATT_HIDDEN(AES_XTS_init_vaes) .type AES_XTS_init_vaes,@function .align 16 AES_XTS_init_vaes: #else .section __TEXT,__text .globl _AES_XTS_init_vaes +WC_ASM_ATT_HIDDEN(_AES_XTS_init_vaes) .p2align 4 _AES_XTS_init_vaes: #endif /* __APPLE__ */ @@ -2888,12 +2910,14 @@ L_vaes_aes_xts_shr: #ifndef __APPLE__ .text .globl AES_XTS_encrypt_vaes +WC_ASM_ATT_HIDDEN(AES_XTS_encrypt_vaes) .type AES_XTS_encrypt_vaes,@function .align 16 AES_XTS_encrypt_vaes: #else .section __TEXT,__text .globl _AES_XTS_encrypt_vaes +WC_ASM_ATT_HIDDEN(_AES_XTS_encrypt_vaes) .p2align 4 _AES_XTS_encrypt_vaes: #endif /* __APPLE__ */ @@ -3387,12 +3411,14 @@ L_AES_XTS_encrypt_vaes_done_enc: #ifndef __APPLE__ .text .globl AES_XTS_encrypt_update_vaes +WC_ASM_ATT_HIDDEN(AES_XTS_encrypt_update_vaes) .type AES_XTS_encrypt_update_vaes,@function .align 16 AES_XTS_encrypt_update_vaes: #else .section __TEXT,__text .globl _AES_XTS_encrypt_update_vaes +WC_ASM_ATT_HIDDEN(_AES_XTS_encrypt_update_vaes) .p2align 4 _AES_XTS_encrypt_update_vaes: #endif /* __APPLE__ */ @@ -3849,12 +3875,14 @@ L_AES_XTS_encrypt_update_vaes_done_enc: #ifndef __APPLE__ .text .globl AES_XTS_decrypt_vaes +WC_ASM_ATT_HIDDEN(AES_XTS_decrypt_vaes) .type AES_XTS_decrypt_vaes,@function .align 16 AES_XTS_decrypt_vaes: #else .section __TEXT,__text .globl _AES_XTS_decrypt_vaes +WC_ASM_ATT_HIDDEN(_AES_XTS_decrypt_vaes) .p2align 4 _AES_XTS_decrypt_vaes: #endif /* __APPLE__ */ @@ -4422,12 +4450,14 @@ L_AES_XTS_decrypt_vaes_done_dec: #ifndef __APPLE__ .text .globl AES_XTS_decrypt_update_vaes +WC_ASM_ATT_HIDDEN(AES_XTS_decrypt_update_vaes) .type AES_XTS_decrypt_update_vaes,@function .align 16 AES_XTS_decrypt_update_vaes: #else .section __TEXT,__text .globl _AES_XTS_decrypt_update_vaes +WC_ASM_ATT_HIDDEN(_AES_XTS_decrypt_update_vaes) .p2align 4 _AES_XTS_decrypt_update_vaes: #endif /* __APPLE__ */ @@ -4960,12 +4990,14 @@ L_AES_XTS_decrypt_update_vaes_done_dec: #ifndef __APPLE__ .text .globl AES_XTS_init_avx512 +WC_ASM_ATT_HIDDEN(AES_XTS_init_avx512) .type AES_XTS_init_avx512,@function .align 16 AES_XTS_init_avx512: #else .section __TEXT,__text .globl _AES_XTS_init_avx512 +WC_ASM_ATT_HIDDEN(_AES_XTS_init_avx512) .p2align 4 _AES_XTS_init_avx512: #endif /* __APPLE__ */ @@ -5067,12 +5099,14 @@ L_avx512_aes_xts_shr: #ifndef __APPLE__ .text .globl AES_XTS_encrypt_avx512 +WC_ASM_ATT_HIDDEN(AES_XTS_encrypt_avx512) .type AES_XTS_encrypt_avx512,@function .align 16 AES_XTS_encrypt_avx512: #else .section __TEXT,__text .globl _AES_XTS_encrypt_avx512 +WC_ASM_ATT_HIDDEN(_AES_XTS_encrypt_avx512) .p2align 4 _AES_XTS_encrypt_avx512: #endif /* __APPLE__ */ @@ -5573,12 +5607,14 @@ L_AES_XTS_encrypt_avx512_done_enc: #ifndef __APPLE__ .text .globl AES_XTS_encrypt_update_avx512 +WC_ASM_ATT_HIDDEN(AES_XTS_encrypt_update_avx512) .type AES_XTS_encrypt_update_avx512,@function .align 16 AES_XTS_encrypt_update_avx512: #else .section __TEXT,__text .globl _AES_XTS_encrypt_update_avx512 +WC_ASM_ATT_HIDDEN(_AES_XTS_encrypt_update_avx512) .p2align 4 _AES_XTS_encrypt_update_avx512: #endif /* __APPLE__ */ @@ -6042,12 +6078,14 @@ L_AES_XTS_encrypt_update_avx512_done_enc: #ifndef __APPLE__ .text .globl AES_XTS_decrypt_avx512 +WC_ASM_ATT_HIDDEN(AES_XTS_decrypt_avx512) .type AES_XTS_decrypt_avx512,@function .align 16 AES_XTS_decrypt_avx512: #else .section __TEXT,__text .globl _AES_XTS_decrypt_avx512 +WC_ASM_ATT_HIDDEN(_AES_XTS_decrypt_avx512) .p2align 4 _AES_XTS_decrypt_avx512: #endif /* __APPLE__ */ @@ -6632,12 +6670,14 @@ L_AES_XTS_decrypt_avx512_done_dec: #ifndef __APPLE__ .text .globl AES_XTS_decrypt_update_avx512 +WC_ASM_ATT_HIDDEN(AES_XTS_decrypt_update_avx512) .type AES_XTS_decrypt_update_avx512,@function .align 16 AES_XTS_decrypt_update_avx512: #else .section __TEXT,__text .globl _AES_XTS_decrypt_update_avx512 +WC_ASM_ATT_HIDDEN(_AES_XTS_decrypt_update_avx512) .p2align 4 _AES_XTS_decrypt_update_avx512: #endif /* __APPLE__ */ diff --git a/wolfcrypt/src/chacha_asm.S b/wolfcrypt/src/chacha_asm.S index 26fce84d424..5232aeb5441 100644 --- a/wolfcrypt/src/chacha_asm.S +++ b/wolfcrypt/src/chacha_asm.S @@ -46,12 +46,14 @@ #ifndef __APPLE__ .text .globl chacha_encrypt_x64 +WC_ASM_ATT_HIDDEN(chacha_encrypt_x64) .type chacha_encrypt_x64,@function .align 16 chacha_encrypt_x64: #else .section __TEXT,__text .globl _chacha_encrypt_x64 +WC_ASM_ATT_HIDDEN(_chacha_encrypt_x64) .p2align 4 _chacha_encrypt_x64: #endif /* __APPLE__ */ @@ -524,12 +526,14 @@ L_chacha20_avx1_four: #ifndef __APPLE__ .text .globl chacha_encrypt_avx1 +WC_ASM_ATT_HIDDEN(chacha_encrypt_avx1) .type chacha_encrypt_avx1,@function .align 16 chacha_encrypt_avx1: #else .section __TEXT,__text .globl _chacha_encrypt_avx1 +WC_ASM_ATT_HIDDEN(_chacha_encrypt_avx1) .p2align 4 _chacha_encrypt_avx1: #endif /* __APPLE__ */ @@ -1096,12 +1100,14 @@ L_chacha20_avx2_eight: #ifndef __APPLE__ .text .globl chacha_encrypt_avx2 +WC_ASM_ATT_HIDDEN(chacha_encrypt_avx2) .type chacha_encrypt_avx2,@function .align 16 chacha_encrypt_avx2: #else .section __TEXT,__text .globl _chacha_encrypt_avx2 +WC_ASM_ATT_HIDDEN(_chacha_encrypt_avx2) .p2align 4 _chacha_encrypt_avx2: #endif /* __APPLE__ */ diff --git a/wolfcrypt/src/fe_x25519_asm.S b/wolfcrypt/src/fe_x25519_asm.S index e5c1f5c87a2..ae75178afc8 100644 --- a/wolfcrypt/src/fe_x25519_asm.S +++ b/wolfcrypt/src/fe_x25519_asm.S @@ -53,12 +53,14 @@ #ifndef __APPLE__ .text .globl fe_init +WC_ASM_ATT_HIDDEN(fe_init) .type fe_init,@function .align 16 fe_init: #else .section __TEXT,__text .globl _fe_init +WC_ASM_ATT_HIDDEN(_fe_init) .p2align 4 _fe_init: #endif /* __APPLE__ */ @@ -385,12 +387,14 @@ L_fe_init_flags_done: #ifndef __APPLE__ .text .globl fe_frombytes +WC_ASM_ATT_HIDDEN(fe_frombytes) .type fe_frombytes,@function .align 16 fe_frombytes: #else .section __TEXT,__text .globl _fe_frombytes +WC_ASM_ATT_HIDDEN(_fe_frombytes) .p2align 4 _fe_frombytes: #endif /* __APPLE__ */ @@ -411,12 +415,14 @@ _fe_frombytes: #ifndef __APPLE__ .text .globl fe_tobytes +WC_ASM_ATT_HIDDEN(fe_tobytes) .type fe_tobytes,@function .align 16 fe_tobytes: #else .section __TEXT,__text .globl _fe_tobytes +WC_ASM_ATT_HIDDEN(_fe_tobytes) .p2align 4 _fe_tobytes: #endif /* __APPLE__ */ @@ -451,12 +457,14 @@ _fe_tobytes: #ifndef __APPLE__ .text .globl fe_1 +WC_ASM_ATT_HIDDEN(fe_1) .type fe_1,@function .align 16 fe_1: #else .section __TEXT,__text .globl _fe_1 +WC_ASM_ATT_HIDDEN(_fe_1) .p2align 4 _fe_1: #endif /* __APPLE__ */ @@ -472,12 +480,14 @@ _fe_1: #ifndef __APPLE__ .text .globl fe_0 +WC_ASM_ATT_HIDDEN(fe_0) .type fe_0,@function .align 16 fe_0: #else .section __TEXT,__text .globl _fe_0 +WC_ASM_ATT_HIDDEN(_fe_0) .p2align 4 _fe_0: #endif /* __APPLE__ */ @@ -493,12 +503,14 @@ _fe_0: #ifndef __APPLE__ .text .globl fe_copy +WC_ASM_ATT_HIDDEN(fe_copy) .type fe_copy,@function .align 16 fe_copy: #else .section __TEXT,__text .globl _fe_copy +WC_ASM_ATT_HIDDEN(_fe_copy) .p2align 4 _fe_copy: #endif /* __APPLE__ */ @@ -518,12 +530,14 @@ _fe_copy: #ifndef __APPLE__ .text .globl fe_sub +WC_ASM_ATT_HIDDEN(fe_sub) .type fe_sub,@function .align 16 fe_sub: #else .section __TEXT,__text .globl _fe_sub +WC_ASM_ATT_HIDDEN(_fe_sub) .p2align 4 _fe_sub: #endif /* __APPLE__ */ @@ -556,12 +570,14 @@ _fe_sub: #ifndef __APPLE__ .text .globl fe_add +WC_ASM_ATT_HIDDEN(fe_add) .type fe_add,@function .align 16 fe_add: #else .section __TEXT,__text .globl _fe_add +WC_ASM_ATT_HIDDEN(_fe_add) .p2align 4 _fe_add: #endif /* __APPLE__ */ @@ -595,12 +611,14 @@ _fe_add: #ifndef __APPLE__ .text .globl fe_neg +WC_ASM_ATT_HIDDEN(fe_neg) .type fe_neg,@function .align 16 fe_neg: #else .section __TEXT,__text .globl _fe_neg +WC_ASM_ATT_HIDDEN(_fe_neg) .p2align 4 _fe_neg: #endif /* __APPLE__ */ @@ -623,12 +641,14 @@ _fe_neg: #ifndef __APPLE__ .text .globl fe_cmov +WC_ASM_ATT_HIDDEN(fe_cmov) .type fe_cmov,@function .align 16 fe_cmov: #else .section __TEXT,__text .globl _fe_cmov +WC_ASM_ATT_HIDDEN(_fe_cmov) .p2align 4 _fe_cmov: #endif /* __APPLE__ */ @@ -652,12 +672,14 @@ _fe_cmov: #ifndef __APPLE__ .text .globl fe_isnonzero +WC_ASM_ATT_HIDDEN(fe_isnonzero) .type fe_isnonzero,@function .align 16 fe_isnonzero: #else .section __TEXT,__text .globl _fe_isnonzero +WC_ASM_ATT_HIDDEN(_fe_isnonzero) .p2align 4 _fe_isnonzero: #endif /* __APPLE__ */ @@ -691,12 +713,14 @@ _fe_isnonzero: #ifndef __APPLE__ .text .globl fe_isnegative +WC_ASM_ATT_HIDDEN(fe_isnegative) .type fe_isnegative,@function .align 16 fe_isnegative: #else .section __TEXT,__text .globl _fe_isnegative +WC_ASM_ATT_HIDDEN(_fe_isnegative) .p2align 4 _fe_isnegative: #endif /* __APPLE__ */ @@ -721,12 +745,14 @@ _fe_isnegative: #ifndef __APPLE__ .text .globl fe_cmov_table +WC_ASM_ATT_HIDDEN(fe_cmov_table) .type fe_cmov_table,@function .align 16 fe_cmov_table: #else .section __TEXT,__text .globl _fe_cmov_table +WC_ASM_ATT_HIDDEN(_fe_cmov_table) .p2align 4 _fe_cmov_table: #endif /* __APPLE__ */ @@ -741,12 +767,14 @@ _fe_cmov_table: #ifndef __APPLE__ .text .globl fe_mul +WC_ASM_ATT_HIDDEN(fe_mul) .type fe_mul,@function .align 16 fe_mul: #else .section __TEXT,__text .globl _fe_mul +WC_ASM_ATT_HIDDEN(_fe_mul) .p2align 4 _fe_mul: #endif /* __APPLE__ */ @@ -761,12 +789,14 @@ _fe_mul: #ifndef __APPLE__ .text .globl fe_sq +WC_ASM_ATT_HIDDEN(fe_sq) .type fe_sq,@function .align 16 fe_sq: #else .section __TEXT,__text .globl _fe_sq +WC_ASM_ATT_HIDDEN(_fe_sq) .p2align 4 _fe_sq: #endif /* __APPLE__ */ @@ -781,12 +811,14 @@ _fe_sq: #ifndef __APPLE__ .text .globl fe_mul121666 +WC_ASM_ATT_HIDDEN(fe_mul121666) .type fe_mul121666,@function .align 16 fe_mul121666: #else .section __TEXT,__text .globl _fe_mul121666 +WC_ASM_ATT_HIDDEN(_fe_mul121666) .p2align 4 _fe_mul121666: #endif /* __APPLE__ */ @@ -801,12 +833,14 @@ _fe_mul121666: #ifndef __APPLE__ .text .globl fe_invert +WC_ASM_ATT_HIDDEN(fe_invert) .type fe_invert,@function .align 16 fe_invert: #else .section __TEXT,__text .globl _fe_invert +WC_ASM_ATT_HIDDEN(_fe_invert) .p2align 4 _fe_invert: #endif /* __APPLE__ */ @@ -821,12 +855,14 @@ _fe_invert: #ifndef __APPLE__ .text .globl curve25519 +WC_ASM_ATT_HIDDEN(curve25519) .type curve25519,@function .align 16 curve25519: #else .section __TEXT,__text .globl _curve25519 +WC_ASM_ATT_HIDDEN(_curve25519) .p2align 4 _curve25519: #endif /* __APPLE__ */ @@ -841,12 +877,14 @@ _curve25519: #ifndef __APPLE__ .text .globl fe_pow22523 +WC_ASM_ATT_HIDDEN(fe_pow22523) .type fe_pow22523,@function .align 16 fe_pow22523: #else .section __TEXT,__text .globl _fe_pow22523 +WC_ASM_ATT_HIDDEN(_fe_pow22523) .p2align 4 _fe_pow22523: #endif /* __APPLE__ */ @@ -861,12 +899,14 @@ _fe_pow22523: #ifndef __APPLE__ .text .globl ge_p1p1_to_p2 +WC_ASM_ATT_HIDDEN(ge_p1p1_to_p2) .type ge_p1p1_to_p2,@function .align 16 ge_p1p1_to_p2: #else .section __TEXT,__text .globl _ge_p1p1_to_p2 +WC_ASM_ATT_HIDDEN(_ge_p1p1_to_p2) .p2align 4 _ge_p1p1_to_p2: #endif /* __APPLE__ */ @@ -881,12 +921,14 @@ _ge_p1p1_to_p2: #ifndef __APPLE__ .text .globl ge_p1p1_to_p3 +WC_ASM_ATT_HIDDEN(ge_p1p1_to_p3) .type ge_p1p1_to_p3,@function .align 16 ge_p1p1_to_p3: #else .section __TEXT,__text .globl _ge_p1p1_to_p3 +WC_ASM_ATT_HIDDEN(_ge_p1p1_to_p3) .p2align 4 _ge_p1p1_to_p3: #endif /* __APPLE__ */ @@ -901,12 +943,14 @@ _ge_p1p1_to_p3: #ifndef __APPLE__ .text .globl ge_p2_dbl +WC_ASM_ATT_HIDDEN(ge_p2_dbl) .type ge_p2_dbl,@function .align 16 ge_p2_dbl: #else .section __TEXT,__text .globl _ge_p2_dbl +WC_ASM_ATT_HIDDEN(_ge_p2_dbl) .p2align 4 _ge_p2_dbl: #endif /* __APPLE__ */ @@ -921,12 +965,14 @@ _ge_p2_dbl: #ifndef __APPLE__ .text .globl ge_madd +WC_ASM_ATT_HIDDEN(ge_madd) .type ge_madd,@function .align 16 ge_madd: #else .section __TEXT,__text .globl _ge_madd +WC_ASM_ATT_HIDDEN(_ge_madd) .p2align 4 _ge_madd: #endif /* __APPLE__ */ @@ -941,12 +987,14 @@ _ge_madd: #ifndef __APPLE__ .text .globl ge_msub +WC_ASM_ATT_HIDDEN(ge_msub) .type ge_msub,@function .align 16 ge_msub: #else .section __TEXT,__text .globl _ge_msub +WC_ASM_ATT_HIDDEN(_ge_msub) .p2align 4 _ge_msub: #endif /* __APPLE__ */ @@ -961,12 +1009,14 @@ _ge_msub: #ifndef __APPLE__ .text .globl ge_add +WC_ASM_ATT_HIDDEN(ge_add) .type ge_add,@function .align 16 ge_add: #else .section __TEXT,__text .globl _ge_add +WC_ASM_ATT_HIDDEN(_ge_add) .p2align 4 _ge_add: #endif /* __APPLE__ */ @@ -981,12 +1031,14 @@ _ge_add: #ifndef __APPLE__ .text .globl ge_sub +WC_ASM_ATT_HIDDEN(ge_sub) .type ge_sub,@function .align 16 ge_sub: #else .section __TEXT,__text .globl _ge_sub +WC_ASM_ATT_HIDDEN(_ge_sub) .p2align 4 _ge_sub: #endif /* __APPLE__ */ @@ -1003,12 +1055,14 @@ _ge_sub: #ifndef __APPLE__ .text .globl curve25519_base +WC_ASM_ATT_HIDDEN(curve25519_base) .type curve25519_base,@function .align 16 curve25519_base: #else .section __TEXT,__text .globl _curve25519_base +WC_ASM_ATT_HIDDEN(_curve25519_base) .p2align 4 _curve25519_base: #endif /* __APPLE__ */ @@ -1027,12 +1081,14 @@ _curve25519_base: #ifndef __APPLE__ .text .globl fe_sq2 +WC_ASM_ATT_HIDDEN(fe_sq2) .type fe_sq2,@function .align 16 fe_sq2: #else .section __TEXT,__text .globl _fe_sq2 +WC_ASM_ATT_HIDDEN(_fe_sq2) .p2align 4 _fe_sq2: #endif /* __APPLE__ */ @@ -1049,12 +1105,14 @@ _fe_sq2: #ifndef __APPLE__ .text .globl fe_invert_nct +WC_ASM_ATT_HIDDEN(fe_invert_nct) .type fe_invert_nct,@function .align 16 fe_invert_nct: #else .section __TEXT,__text .globl _fe_invert_nct +WC_ASM_ATT_HIDDEN(_fe_invert_nct) .p2align 4 _fe_invert_nct: #endif /* __APPLE__ */ @@ -1071,12 +1129,14 @@ _fe_invert_nct: #ifndef __APPLE__ .text .globl sc_reduce +WC_ASM_ATT_HIDDEN(sc_reduce) .type sc_reduce,@function .align 16 sc_reduce: #else .section __TEXT,__text .globl _sc_reduce +WC_ASM_ATT_HIDDEN(_sc_reduce) .p2align 4 _sc_reduce: #endif /* __APPLE__ */ @@ -1093,12 +1153,14 @@ _sc_reduce: #ifndef __APPLE__ .text .globl sc_muladd +WC_ASM_ATT_HIDDEN(sc_muladd) .type sc_muladd,@function .align 16 sc_muladd: #else .section __TEXT,__text .globl _sc_muladd +WC_ASM_ATT_HIDDEN(_sc_muladd) .p2align 4 _sc_muladd: #endif /* __APPLE__ */ @@ -1371,12 +1433,14 @@ _sc_muladd_p: #ifndef __APPLE__ .text .globl fe_cmov_table_x64 +WC_ASM_ATT_HIDDEN(fe_cmov_table_x64) .type fe_cmov_table_x64,@function .align 16 fe_cmov_table_x64: #else .section __TEXT,__text .globl _fe_cmov_table_x64 +WC_ASM_ATT_HIDDEN(_fe_cmov_table_x64) .p2align 4 _fe_cmov_table_x64: #endif /* __APPLE__ */ @@ -1659,12 +1723,14 @@ _fe_cmov_table_x64: #ifndef __APPLE__ .text .globl fe_mul_x64 +WC_ASM_ATT_HIDDEN(fe_mul_x64) .type fe_mul_x64,@function .align 16 fe_mul_x64: #else .section __TEXT,__text .globl _fe_mul_x64 +WC_ASM_ATT_HIDDEN(_fe_mul_x64) .p2align 4 _fe_mul_x64: #endif /* __APPLE__ */ @@ -1827,12 +1893,14 @@ _fe_mul_x64: #ifndef __APPLE__ .text .globl fe_sq_x64 +WC_ASM_ATT_HIDDEN(fe_sq_x64) .type fe_sq_x64,@function .align 16 fe_sq_x64: #else .section __TEXT,__text .globl _fe_sq_x64 +WC_ASM_ATT_HIDDEN(_fe_sq_x64) .p2align 4 _fe_sq_x64: #endif /* __APPLE__ */ @@ -1965,12 +2033,14 @@ _fe_sq_x64: #ifndef __APPLE__ .text .globl fe_sq_n_x64 +WC_ASM_ATT_HIDDEN(fe_sq_n_x64) .type fe_sq_n_x64,@function .align 16 fe_sq_n_x64: #else .section __TEXT,__text .globl _fe_sq_n_x64 +WC_ASM_ATT_HIDDEN(_fe_sq_n_x64) .p2align 4 _fe_sq_n_x64: #endif /* __APPLE__ */ @@ -2100,12 +2170,14 @@ L_fe_sq_n_x64: #ifndef __APPLE__ .text .globl fe_mul121666_x64 +WC_ASM_ATT_HIDDEN(fe_mul121666_x64) .type fe_mul121666_x64,@function .align 16 fe_mul121666_x64: #else .section __TEXT,__text .globl _fe_mul121666_x64 +WC_ASM_ATT_HIDDEN(_fe_mul121666_x64) .p2align 4 _fe_mul121666_x64: #endif /* __APPLE__ */ @@ -2151,12 +2223,14 @@ _fe_mul121666_x64: #ifndef __APPLE__ .text .globl fe_invert_x64 +WC_ASM_ATT_HIDDEN(fe_invert_x64) .type fe_invert_x64,@function .align 16 fe_invert_x64: #else .section __TEXT,__text .globl _fe_invert_x64 +WC_ASM_ATT_HIDDEN(_fe_invert_x64) .p2align 4 _fe_invert_x64: #endif /* __APPLE__ */ @@ -2424,12 +2498,14 @@ L_curve25519_base_x64_x2: #ifndef __APPLE__ .text .globl curve25519_base_x64 +WC_ASM_ATT_HIDDEN(curve25519_base_x64) .type curve25519_base_x64,@function .align 16 curve25519_base_x64: #else .section __TEXT,__text .globl _curve25519_base_x64 +WC_ASM_ATT_HIDDEN(_curve25519_base_x64) .p2align 4 _curve25519_base_x64: #endif /* __APPLE__ */ @@ -4737,12 +4813,14 @@ L_curve25519_base_x64_3: #ifndef __APPLE__ .text .globl curve25519_x64 +WC_ASM_ATT_HIDDEN(curve25519_x64) .type curve25519_x64,@function .align 16 curve25519_x64: #else .section __TEXT,__text .globl _curve25519_x64 +WC_ASM_ATT_HIDDEN(_curve25519_x64) .p2align 4 _curve25519_x64: #endif /* __APPLE__ */ @@ -7161,12 +7239,14 @@ L_curve25519_x64_3: #ifndef __APPLE__ .text .globl fe_pow22523_x64 +WC_ASM_ATT_HIDDEN(fe_pow22523_x64) .type fe_pow22523_x64,@function .align 16 fe_pow22523_x64: #else .section __TEXT,__text .globl _fe_pow22523_x64 +WC_ASM_ATT_HIDDEN(_fe_pow22523_x64) .p2align 4 _fe_pow22523_x64: #endif /* __APPLE__ */ @@ -7419,12 +7499,14 @@ _fe_pow22523_x64: #ifndef __APPLE__ .text .globl ge_p1p1_to_p2_x64 +WC_ASM_ATT_HIDDEN(ge_p1p1_to_p2_x64) .type ge_p1p1_to_p2_x64,@function .align 16 ge_p1p1_to_p2_x64: #else .section __TEXT,__text .globl _ge_p1p1_to_p2_x64 +WC_ASM_ATT_HIDDEN(_ge_p1p1_to_p2_x64) .p2align 4 _ge_p1p1_to_p2_x64: #endif /* __APPLE__ */ @@ -7852,12 +7934,14 @@ _ge_p1p1_to_p2_x64: #ifndef __APPLE__ .text .globl ge_p1p1_to_p3_x64 +WC_ASM_ATT_HIDDEN(ge_p1p1_to_p3_x64) .type ge_p1p1_to_p3_x64,@function .align 16 ge_p1p1_to_p3_x64: #else .section __TEXT,__text .globl _ge_p1p1_to_p3_x64 +WC_ASM_ATT_HIDDEN(_ge_p1p1_to_p3_x64) .p2align 4 _ge_p1p1_to_p3_x64: #endif /* __APPLE__ */ @@ -8420,12 +8504,14 @@ _ge_p1p1_to_p3_x64: #ifndef __APPLE__ .text .globl ge_p2_dbl_x64 +WC_ASM_ATT_HIDDEN(ge_p2_dbl_x64) .type ge_p2_dbl_x64,@function .align 16 ge_p2_dbl_x64: #else .section __TEXT,__text .globl _ge_p2_dbl_x64 +WC_ASM_ATT_HIDDEN(_ge_p2_dbl_x64) .p2align 4 _ge_p2_dbl_x64: #endif /* __APPLE__ */ @@ -8986,12 +9072,14 @@ _ge_p2_dbl_x64: #ifndef __APPLE__ .text .globl ge_madd_x64 +WC_ASM_ATT_HIDDEN(ge_madd_x64) .type ge_madd_x64,@function .align 16 ge_madd_x64: #else .section __TEXT,__text .globl _ge_madd_x64 +WC_ASM_ATT_HIDDEN(_ge_madd_x64) .p2align 4 _ge_madd_x64: #endif /* __APPLE__ */ @@ -9577,12 +9665,14 @@ _ge_madd_x64: #ifndef __APPLE__ .text .globl ge_msub_x64 +WC_ASM_ATT_HIDDEN(ge_msub_x64) .type ge_msub_x64,@function .align 16 ge_msub_x64: #else .section __TEXT,__text .globl _ge_msub_x64 +WC_ASM_ATT_HIDDEN(_ge_msub_x64) .p2align 4 _ge_msub_x64: #endif /* __APPLE__ */ @@ -10168,12 +10258,14 @@ _ge_msub_x64: #ifndef __APPLE__ .text .globl ge_add_x64 +WC_ASM_ATT_HIDDEN(ge_add_x64) .type ge_add_x64,@function .align 16 ge_add_x64: #else .section __TEXT,__text .globl _ge_add_x64 +WC_ASM_ATT_HIDDEN(_ge_add_x64) .p2align 4 _ge_add_x64: #endif /* __APPLE__ */ @@ -10885,12 +10977,14 @@ _ge_add_x64: #ifndef __APPLE__ .text .globl ge_sub_x64 +WC_ASM_ATT_HIDDEN(ge_sub_x64) .type ge_sub_x64,@function .align 16 ge_sub_x64: #else .section __TEXT,__text .globl _ge_sub_x64 +WC_ASM_ATT_HIDDEN(_ge_sub_x64) .p2align 4 _ge_sub_x64: #endif /* __APPLE__ */ @@ -11602,12 +11696,14 @@ _ge_sub_x64: #ifndef __APPLE__ .text .globl fe_sq2_x64 +WC_ASM_ATT_HIDDEN(fe_sq2_x64) .type fe_sq2_x64,@function .align 16 fe_sq2_x64: #else .section __TEXT,__text .globl _fe_sq2_x64 +WC_ASM_ATT_HIDDEN(_fe_sq2_x64) .p2align 4 _fe_sq2_x64: #endif /* __APPLE__ */ @@ -11744,12 +11840,14 @@ _fe_sq2_x64: #ifndef __APPLE__ .text .globl sc_reduce_x64 +WC_ASM_ATT_HIDDEN(sc_reduce_x64) .type sc_reduce_x64,@function .align 16 sc_reduce_x64: #else .section __TEXT,__text .globl _sc_reduce_x64 +WC_ASM_ATT_HIDDEN(_sc_reduce_x64) .p2align 4 _sc_reduce_x64: #endif /* __APPLE__ */ @@ -11929,12 +12027,14 @@ _sc_reduce_x64: #ifndef __APPLE__ .text .globl sc_muladd_x64 +WC_ASM_ATT_HIDDEN(sc_muladd_x64) .type sc_muladd_x64,@function .align 16 sc_muladd_x64: #else .section __TEXT,__text .globl _sc_muladd_x64 +WC_ASM_ATT_HIDDEN(_sc_muladd_x64) .p2align 4 _sc_muladd_x64: #endif /* __APPLE__ */ @@ -12221,12 +12321,14 @@ _sc_muladd_x64: #ifndef __APPLE__ .text .globl fe_invert_nct_x64 +WC_ASM_ATT_HIDDEN(fe_invert_nct_x64) .type fe_invert_nct_x64,@function .align 16 fe_invert_nct_x64: #else .section __TEXT,__text .globl _fe_invert_nct_x64 +WC_ASM_ATT_HIDDEN(_fe_invert_nct_x64) .p2align 4 _fe_invert_nct_x64: #endif /* __APPLE__ */ @@ -12447,12 +12549,14 @@ L_fe_invert_nct_store_end: #ifndef __APPLE__ .text .globl fe_cmov_table_avx2 +WC_ASM_ATT_HIDDEN(fe_cmov_table_avx2) .type fe_cmov_table_avx2,@function .align 16 fe_cmov_table_avx2: #else .section __TEXT,__text .globl _fe_cmov_table_avx2 +WC_ASM_ATT_HIDDEN(_fe_cmov_table_avx2) .p2align 4 _fe_cmov_table_avx2: #endif /* __APPLE__ */ @@ -12618,12 +12722,14 @@ _fe_cmov_table_avx2: #ifndef __APPLE__ .text .globl fe_mul_avx2 +WC_ASM_ATT_HIDDEN(fe_mul_avx2) .type fe_mul_avx2,@function .align 16 fe_mul_avx2: #else .section __TEXT,__text .globl _fe_mul_avx2 +WC_ASM_ATT_HIDDEN(_fe_mul_avx2) .p2align 4 _fe_mul_avx2: #endif /* __APPLE__ */ @@ -12759,12 +12865,14 @@ _fe_mul_avx2: #ifndef __APPLE__ .text .globl fe_sq_avx2 +WC_ASM_ATT_HIDDEN(fe_sq_avx2) .type fe_sq_avx2,@function .align 16 fe_sq_avx2: #else .section __TEXT,__text .globl _fe_sq_avx2 +WC_ASM_ATT_HIDDEN(_fe_sq_avx2) .p2align 4 _fe_sq_avx2: #endif /* __APPLE__ */ @@ -12874,12 +12982,14 @@ _fe_sq_avx2: #ifndef __APPLE__ .text .globl fe_sq_n_avx2 +WC_ASM_ATT_HIDDEN(fe_sq_n_avx2) .type fe_sq_n_avx2,@function .align 16 fe_sq_n_avx2: #else .section __TEXT,__text .globl _fe_sq_n_avx2 +WC_ASM_ATT_HIDDEN(_fe_sq_n_avx2) .p2align 4 _fe_sq_n_avx2: #endif /* __APPLE__ */ @@ -12986,12 +13096,14 @@ L_fe_sq_n_avx2: #ifndef __APPLE__ .text .globl fe_mul121666_avx2 +WC_ASM_ATT_HIDDEN(fe_mul121666_avx2) .type fe_mul121666_avx2,@function .align 16 fe_mul121666_avx2: #else .section __TEXT,__text .globl _fe_mul121666_avx2 +WC_ASM_ATT_HIDDEN(_fe_mul121666_avx2) .p2align 4 _fe_mul121666_avx2: #endif /* __APPLE__ */ @@ -13026,12 +13138,14 @@ _fe_mul121666_avx2: #ifndef __APPLE__ .text .globl fe_invert_avx2 +WC_ASM_ATT_HIDDEN(fe_invert_avx2) .type fe_invert_avx2,@function .align 16 fe_invert_avx2: #else .section __TEXT,__text .globl _fe_invert_avx2 +WC_ASM_ATT_HIDDEN(_fe_invert_avx2) .p2align 4 _fe_invert_avx2: #endif /* __APPLE__ */ @@ -13299,12 +13413,14 @@ L_curve25519_base_avx2_x2: #ifndef __APPLE__ .text .globl curve25519_base_avx2 +WC_ASM_ATT_HIDDEN(curve25519_base_avx2) .type curve25519_base_avx2,@function .align 16 curve25519_base_avx2: #else .section __TEXT,__text .globl _curve25519_base_avx2 +WC_ASM_ATT_HIDDEN(_curve25519_base_avx2) .p2align 4 _curve25519_base_avx2: #endif /* __APPLE__ */ @@ -15222,12 +15338,14 @@ L_curve25519_base_avx2_last_3: #ifndef __APPLE__ .text .globl curve25519_avx2 +WC_ASM_ATT_HIDDEN(curve25519_avx2) .type curve25519_avx2,@function .align 16 curve25519_avx2: #else .section __TEXT,__text .globl _curve25519_avx2 +WC_ASM_ATT_HIDDEN(_curve25519_avx2) .p2align 4 _curve25519_avx2: #endif /* __APPLE__ */ @@ -17240,12 +17358,14 @@ L_curve25519_avx2_last_3: #ifndef __APPLE__ .text .globl fe_pow22523_avx2 +WC_ASM_ATT_HIDDEN(fe_pow22523_avx2) .type fe_pow22523_avx2,@function .align 16 fe_pow22523_avx2: #else .section __TEXT,__text .globl _fe_pow22523_avx2 +WC_ASM_ATT_HIDDEN(_fe_pow22523_avx2) .p2align 4 _fe_pow22523_avx2: #endif /* __APPLE__ */ @@ -17498,12 +17618,14 @@ _fe_pow22523_avx2: #ifndef __APPLE__ .text .globl ge_p1p1_to_p2_avx2 +WC_ASM_ATT_HIDDEN(ge_p1p1_to_p2_avx2) .type ge_p1p1_to_p2_avx2,@function .align 16 ge_p1p1_to_p2_avx2: #else .section __TEXT,__text .globl _ge_p1p1_to_p2_avx2 +WC_ASM_ATT_HIDDEN(_ge_p1p1_to_p2_avx2) .p2align 4 _ge_p1p1_to_p2_avx2: #endif /* __APPLE__ */ @@ -17844,12 +17966,14 @@ _ge_p1p1_to_p2_avx2: #ifndef __APPLE__ .text .globl ge_p1p1_to_p3_avx2 +WC_ASM_ATT_HIDDEN(ge_p1p1_to_p3_avx2) .type ge_p1p1_to_p3_avx2,@function .align 16 ge_p1p1_to_p3_avx2: #else .section __TEXT,__text .globl _ge_p1p1_to_p3_avx2 +WC_ASM_ATT_HIDDEN(_ge_p1p1_to_p3_avx2) .p2align 4 _ge_p1p1_to_p3_avx2: #endif /* __APPLE__ */ @@ -18295,12 +18419,14 @@ _ge_p1p1_to_p3_avx2: #ifndef __APPLE__ .text .globl ge_p2_dbl_avx2 +WC_ASM_ATT_HIDDEN(ge_p2_dbl_avx2) .type ge_p2_dbl_avx2,@function .align 16 ge_p2_dbl_avx2: #else .section __TEXT,__text .globl _ge_p2_dbl_avx2 +WC_ASM_ATT_HIDDEN(_ge_p2_dbl_avx2) .p2align 4 _ge_p2_dbl_avx2: #endif /* __APPLE__ */ @@ -18760,12 +18886,14 @@ _ge_p2_dbl_avx2: #ifndef __APPLE__ .text .globl ge_madd_avx2 +WC_ASM_ATT_HIDDEN(ge_madd_avx2) .type ge_madd_avx2,@function .align 16 ge_madd_avx2: #else .section __TEXT,__text .globl _ge_madd_avx2 +WC_ASM_ATT_HIDDEN(_ge_madd_avx2) .p2align 4 _ge_madd_avx2: #endif /* __APPLE__ */ @@ -19265,12 +19393,14 @@ _ge_madd_avx2: #ifndef __APPLE__ .text .globl ge_msub_avx2 +WC_ASM_ATT_HIDDEN(ge_msub_avx2) .type ge_msub_avx2,@function .align 16 ge_msub_avx2: #else .section __TEXT,__text .globl _ge_msub_avx2 +WC_ASM_ATT_HIDDEN(_ge_msub_avx2) .p2align 4 _ge_msub_avx2: #endif /* __APPLE__ */ @@ -19771,12 +19901,14 @@ _ge_msub_avx2: #ifndef __APPLE__ .text .globl ge_add_avx2 +WC_ASM_ATT_HIDDEN(ge_add_avx2) .type ge_add_avx2,@function .align 16 ge_add_avx2: #else .section __TEXT,__text .globl _ge_add_avx2 +WC_ASM_ATT_HIDDEN(_ge_add_avx2) .p2align 4 _ge_add_avx2: #endif /* __APPLE__ */ @@ -20381,12 +20513,14 @@ _ge_add_avx2: #ifndef __APPLE__ .text .globl ge_sub_avx2 +WC_ASM_ATT_HIDDEN(ge_sub_avx2) .type ge_sub_avx2,@function .align 16 ge_sub_avx2: #else .section __TEXT,__text .globl _ge_sub_avx2 +WC_ASM_ATT_HIDDEN(_ge_sub_avx2) .p2align 4 _ge_sub_avx2: #endif /* __APPLE__ */ @@ -20993,12 +21127,14 @@ _ge_sub_avx2: #ifndef __APPLE__ .text .globl fe_sq2_avx2 +WC_ASM_ATT_HIDDEN(fe_sq2_avx2) .type fe_sq2_avx2,@function .align 16 fe_sq2_avx2: #else .section __TEXT,__text .globl _fe_sq2_avx2 +WC_ASM_ATT_HIDDEN(_fe_sq2_avx2) .p2align 4 _fe_sq2_avx2: #endif /* __APPLE__ */ @@ -21112,12 +21248,14 @@ _fe_sq2_avx2: #ifndef __APPLE__ .text .globl sc_reduce_avx2 +WC_ASM_ATT_HIDDEN(sc_reduce_avx2) .type sc_reduce_avx2,@function .align 16 sc_reduce_avx2: #else .section __TEXT,__text .globl _sc_reduce_avx2 +WC_ASM_ATT_HIDDEN(_sc_reduce_avx2) .p2align 4 _sc_reduce_avx2: #endif /* __APPLE__ */ @@ -21276,12 +21414,14 @@ _sc_reduce_avx2: #ifndef __APPLE__ .text .globl sc_muladd_avx2 +WC_ASM_ATT_HIDDEN(sc_muladd_avx2) .type sc_muladd_avx2,@function .align 16 sc_muladd_avx2: #else .section __TEXT,__text .globl _sc_muladd_avx2 +WC_ASM_ATT_HIDDEN(_sc_muladd_avx2) .p2align 4 _sc_muladd_avx2: #endif /* __APPLE__ */ @@ -21633,12 +21773,14 @@ L_fe_invert_nct_avx2_mask26: #ifndef __APPLE__ .text .globl fe_invert_nct_avx2 +WC_ASM_ATT_HIDDEN(fe_invert_nct_avx2) .type fe_invert_nct_avx2,@function .align 16 fe_invert_nct_avx2: #else .section __TEXT,__text .globl _fe_invert_nct_avx2 +WC_ASM_ATT_HIDDEN(_fe_invert_nct_avx2) .p2align 4 _fe_invert_nct_avx2: #endif /* __APPLE__ */ diff --git a/wolfcrypt/src/poly1305_asm.S b/wolfcrypt/src/poly1305_asm.S index 14ca8b820bf..abed381014b 100644 --- a/wolfcrypt/src/poly1305_asm.S +++ b/wolfcrypt/src/poly1305_asm.S @@ -47,12 +47,14 @@ #ifndef __APPLE__ .text .globl poly1305_setkey_avx +WC_ASM_ATT_HIDDEN(poly1305_setkey_avx) .type poly1305_setkey_avx,@function .align 16 poly1305_setkey_avx: #else .section __TEXT,__text .globl _poly1305_setkey_avx +WC_ASM_ATT_HIDDEN(_poly1305_setkey_avx) .p2align 4 _poly1305_setkey_avx: #endif /* __APPLE__ */ @@ -107,12 +109,14 @@ _poly1305_setkey_avx: #ifndef __APPLE__ .text .globl poly1305_block_avx +WC_ASM_ATT_HIDDEN(poly1305_block_avx) .type poly1305_block_avx,@function .align 16 poly1305_block_avx: #else .section __TEXT,__text .globl _poly1305_block_avx +WC_ASM_ATT_HIDDEN(_poly1305_block_avx) .p2align 4 _poly1305_block_avx: #endif /* __APPLE__ */ @@ -191,12 +195,14 @@ _poly1305_block_avx: #ifndef __APPLE__ .text .globl poly1305_blocks_avx +WC_ASM_ATT_HIDDEN(poly1305_blocks_avx) .type poly1305_blocks_avx,@function .align 16 poly1305_blocks_avx: #else .section __TEXT,__text .globl _poly1305_blocks_avx +WC_ASM_ATT_HIDDEN(_poly1305_blocks_avx) .p2align 4 _poly1305_blocks_avx: #endif /* __APPLE__ */ @@ -279,12 +285,14 @@ L_poly1305_avx_blocks_start: #ifndef __APPLE__ .text .globl poly1305_final_avx +WC_ASM_ATT_HIDDEN(poly1305_final_avx) .type poly1305_final_avx,@function .align 16 poly1305_final_avx: #else .section __TEXT,__text .globl _poly1305_final_avx +WC_ASM_ATT_HIDDEN(_poly1305_final_avx) .p2align 4 _poly1305_final_avx: #endif /* __APPLE__ */ @@ -364,12 +372,14 @@ L_poly1305_avx_final_no_more: #ifndef __APPLE__ .text .globl poly1305_calc_powers_avx2 +WC_ASM_ATT_HIDDEN(poly1305_calc_powers_avx2) .type poly1305_calc_powers_avx2,@function .align 16 poly1305_calc_powers_avx2: #else .section __TEXT,__text .globl _poly1305_calc_powers_avx2 +WC_ASM_ATT_HIDDEN(_poly1305_calc_powers_avx2) .p2align 4 _poly1305_calc_powers_avx2: #endif /* __APPLE__ */ @@ -631,12 +641,14 @@ _poly1305_calc_powers_avx2: #ifndef __APPLE__ .text .globl poly1305_setkey_avx2 +WC_ASM_ATT_HIDDEN(poly1305_setkey_avx2) .type poly1305_setkey_avx2,@function .align 16 poly1305_setkey_avx2: #else .section __TEXT,__text .globl _poly1305_setkey_avx2 +WC_ASM_ATT_HIDDEN(_poly1305_setkey_avx2) .p2align 4 _poly1305_setkey_avx2: #endif /* __APPLE__ */ @@ -688,12 +700,14 @@ L_poly1305_avx2_blocks_hibit: #ifndef __APPLE__ .text .globl poly1305_blocks_avx2 +WC_ASM_ATT_HIDDEN(poly1305_blocks_avx2) .type poly1305_blocks_avx2,@function .align 16 poly1305_blocks_avx2: #else .section __TEXT,__text .globl _poly1305_blocks_avx2 +WC_ASM_ATT_HIDDEN(_poly1305_blocks_avx2) .p2align 4 _poly1305_blocks_avx2: #endif /* __APPLE__ */ @@ -1055,12 +1069,14 @@ L_poly1305_avx2_blocks_complete: #ifndef __APPLE__ .text .globl poly1305_final_avx2 +WC_ASM_ATT_HIDDEN(poly1305_final_avx2) .type poly1305_final_avx2,@function .align 16 poly1305_final_avx2: #else .section __TEXT,__text .globl _poly1305_final_avx2 +WC_ASM_ATT_HIDDEN(_poly1305_final_avx2) .p2align 4 _poly1305_final_avx2: #endif /* __APPLE__ */ diff --git a/wolfcrypt/src/port/arm/armv8-32-aes-asm.S b/wolfcrypt/src/port/arm/armv8-32-aes-asm.S index 826d1811690..3c12688bb41 100644 --- a/wolfcrypt/src/port/arm/armv8-32-aes-asm.S +++ b/wolfcrypt/src/port/arm/armv8-32-aes-asm.S @@ -239,6 +239,7 @@ L_AES_ARM32_te: .text .align 4 .globl AES_invert_key + WC_ASM_ATT_HIDDEN(AES_invert_key) .type AES_invert_key, %function AES_invert_key: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -458,6 +459,7 @@ L_AES_ARM32_rcon: .text .align 4 .globl AES_set_encrypt_key + WC_ASM_ATT_HIDDEN(AES_set_encrypt_key) .type AES_set_encrypt_key, %function AES_set_encrypt_key: push {r4, r5, r6, r7, r8, lr} @@ -923,6 +925,7 @@ L_AES_set_encrypt_key_end: .text .align 4 .globl AES_encrypt_block + WC_ASM_ATT_HIDDEN(AES_encrypt_block) .type AES_encrypt_block, %function AES_encrypt_block: push {lr} @@ -1585,6 +1588,7 @@ L_AES_ARM32_te_ecb: .text .align 4 .globl AES_ECB_encrypt + WC_ASM_ATT_HIDDEN(AES_ECB_encrypt) .type AES_ECB_encrypt, %function AES_ECB_encrypt: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -3750,6 +3754,7 @@ L_AES_ARM32_te_cbc: .text .align 4 .globl AES_CBC_encrypt + WC_ASM_ATT_HIDDEN(AES_CBC_encrypt) .type AES_CBC_encrypt, %function AES_CBC_encrypt: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -5929,6 +5934,7 @@ L_AES_ARM32_te_ctr: .text .align 4 .globl AES_CTR_encrypt + WC_ASM_ATT_HIDDEN(AES_CTR_encrypt) .type AES_CTR_encrypt, %function AES_CTR_encrypt: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -8098,6 +8104,7 @@ L_AES_CTR_encrypt_end: .text .align 4 .globl AES_decrypt_block + WC_ASM_ATT_HIDDEN(AES_decrypt_block) .type AES_decrypt_block, %function AES_decrypt_block: push {lr} @@ -8804,6 +8811,7 @@ L_AES_ARM32_ecb_td4: .text .align 4 .globl AES_ECB_decrypt + WC_ASM_ATT_HIDDEN(AES_ECB_decrypt) .type AES_ECB_decrypt, %function AES_ECB_decrypt: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -10996,6 +11004,7 @@ L_AES_ARM32_cbc_td4: .text .align 4 .globl AES_CBC_decrypt + WC_ASM_ATT_HIDDEN(AES_CBC_decrypt) .type AES_CBC_decrypt, %function AES_CBC_decrypt: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -15459,6 +15468,7 @@ L_GCM_gmult_len_r: .text .align 4 .globl GCM_gmult_len + WC_ASM_ATT_HIDDEN(GCM_gmult_len) .type GCM_gmult_len, %function GCM_gmult_len: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -17080,6 +17090,7 @@ L_AES_ARM32_te_gcm: .text .align 4 .globl AES_GCM_encrypt + WC_ASM_ATT_HIDDEN(AES_GCM_encrypt) .type AES_GCM_encrypt, %function AES_GCM_encrypt: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -19255,6 +19266,7 @@ L_AES_GCMSIV_polyval_base_r: .text .align 4 .globl AES_GCMSIV_polyval_base + WC_ASM_ATT_HIDDEN(AES_GCMSIV_polyval_base) .type AES_GCMSIV_polyval_base, %function AES_GCMSIV_polyval_base: push {r4, r5, r6, r7, r8, r9, r10, lr} @@ -20186,6 +20198,7 @@ L_AES_GCMSIV_ctr_base_te: .text .align 4 .globl AES_GCMSIV_ctr_base + WC_ASM_ATT_HIDDEN(AES_GCMSIV_ctr_base) .type AES_GCMSIV_ctr_base, %function AES_GCMSIV_ctr_base: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} diff --git a/wolfcrypt/src/port/arm/armv8-32-chacha-asm.S b/wolfcrypt/src/port/arm/armv8-32-chacha-asm.S index 8a080d4338e..abf80cd270e 100644 --- a/wolfcrypt/src/port/arm/armv8-32-chacha-asm.S +++ b/wolfcrypt/src/port/arm/armv8-32-chacha-asm.S @@ -36,6 +36,7 @@ .text .align 4 .globl wc_chacha_setiv + WC_ASM_ATT_HIDDEN(wc_chacha_setiv) .type wc_chacha_setiv, %function wc_chacha_setiv: push {r4, lr} @@ -72,6 +73,7 @@ L_chacha_arm32_constants: .text .align 4 .globl wc_chacha_setkey + WC_ASM_ATT_HIDDEN(wc_chacha_setkey) .type wc_chacha_setkey, %function wc_chacha_setkey: push {r4, r5, lr} @@ -108,6 +110,7 @@ L_chacha_arm32_setkey_same_key_bytes: .text .align 4 .globl wc_chacha_crypt_bytes + WC_ASM_ATT_HIDDEN(wc_chacha_crypt_bytes) .type wc_chacha_crypt_bytes, %function wc_chacha_crypt_bytes: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -456,6 +459,7 @@ L_chacha_arm32_crypt_done: .text .align 4 .globl wc_chacha_use_over + WC_ASM_ATT_HIDDEN(wc_chacha_use_over) .type wc_chacha_use_over, %function wc_chacha_use_over: push {r4, r5, r6, r7, r8, r9, lr} @@ -519,6 +523,7 @@ L_chacha_arm32_over_done: .text .align 4 .globl wc_chacha_crypt_bytes + WC_ASM_ATT_HIDDEN(wc_chacha_crypt_bytes) .type wc_chacha_crypt_bytes, %function wc_chacha_crypt_bytes: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -1185,6 +1190,7 @@ L_chacha_setkey_arm32_constant: .text .align 4 .globl wc_chacha_setkey + WC_ASM_ATT_HIDDEN(wc_chacha_setkey) .type wc_chacha_setkey, %function wc_chacha_setkey: adr r3, L_chacha_setkey_arm32_constant @@ -1209,6 +1215,7 @@ L_chacha_setkey_arm32_done: .text .align 4 .globl wc_chacha_use_over + WC_ASM_ATT_HIDDEN(wc_chacha_use_over) .type wc_chacha_use_over, %function wc_chacha_use_over: push {lr} diff --git a/wolfcrypt/src/port/arm/armv8-32-curve25519.S b/wolfcrypt/src/port/arm/armv8-32-curve25519.S index 10174491b31..2f0a6b39295 100644 --- a/wolfcrypt/src/port/arm/armv8-32-curve25519.S +++ b/wolfcrypt/src/port/arm/armv8-32-curve25519.S @@ -39,6 +39,7 @@ .text .align 4 .globl fe_init + WC_ASM_ATT_HIDDEN(fe_init) .type fe_init, %function fe_init: bx lr @@ -46,6 +47,7 @@ fe_init: .text .align 4 .globl fe_add_sub_op + WC_ASM_ATT_HIDDEN(fe_add_sub_op) .type fe_add_sub_op, %function fe_add_sub_op: push {lr} @@ -248,6 +250,7 @@ fe_add_sub_op: .text .align 4 .globl fe_sub_op + WC_ASM_ATT_HIDDEN(fe_sub_op) .type fe_sub_op, %function fe_sub_op: push {lr} @@ -285,6 +288,7 @@ fe_sub_op: .text .align 4 .globl fe_sub + WC_ASM_ATT_HIDDEN(fe_sub) .type fe_sub, %function fe_sub: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -294,6 +298,7 @@ fe_sub: .text .align 4 .globl fe_add_op + WC_ASM_ATT_HIDDEN(fe_add_op) .type fe_add_op, %function fe_add_op: push {lr} @@ -331,6 +336,7 @@ fe_add_op: .text .align 4 .globl fe_add + WC_ASM_ATT_HIDDEN(fe_add) .type fe_add, %function fe_add: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -341,6 +347,7 @@ fe_add: .text .align 4 .globl fe_frombytes + WC_ASM_ATT_HIDDEN(fe_frombytes) .type fe_frombytes, %function fe_frombytes: push {r4, r5, r6, r7, r8, r9, lr} @@ -370,6 +377,7 @@ fe_frombytes: .text .align 4 .globl fe_tobytes + WC_ASM_ATT_HIDDEN(fe_tobytes) .type fe_tobytes, %function fe_tobytes: push {r4, r5, r6, r7, r8, r9, lr} @@ -410,6 +418,7 @@ fe_tobytes: .text .align 4 .globl fe_1 + WC_ASM_ATT_HIDDEN(fe_1) .type fe_1, %function fe_1: push {r4, r5, r6, r7, r8, r9, lr} @@ -428,6 +437,7 @@ fe_1: .text .align 4 .globl fe_0 + WC_ASM_ATT_HIDDEN(fe_0) .type fe_0, %function fe_0: push {r4, r5, r6, r7, r8, r9, lr} @@ -446,6 +456,7 @@ fe_0: .text .align 4 .globl fe_copy + WC_ASM_ATT_HIDDEN(fe_copy) .type fe_copy, %function fe_copy: push {r4, r5, lr} @@ -501,6 +512,7 @@ fe_copy: .text .align 4 .globl fe_neg + WC_ASM_ATT_HIDDEN(fe_neg) .type fe_neg, %function fe_neg: push {r4, r5, lr} @@ -524,6 +536,7 @@ fe_neg: .text .align 4 .globl fe_isnonzero + WC_ASM_ATT_HIDDEN(fe_isnonzero) .type fe_isnonzero, %function fe_isnonzero: push {r4, r5, r6, r7, r8, r9, lr} @@ -563,6 +576,7 @@ fe_isnonzero: .text .align 4 .globl fe_isnegative + WC_ASM_ATT_HIDDEN(fe_isnegative) .type fe_isnegative, %function fe_isnegative: push {r4, r5, lr} @@ -586,6 +600,7 @@ fe_isnegative: .text .align 4 .globl fe_cmov_table + WC_ASM_ATT_HIDDEN(fe_cmov_table) .type fe_cmov_table, %function fe_cmov_table: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -2114,6 +2129,7 @@ fe_cmov_table: .text .align 4 .globl fe_cmov_table + WC_ASM_ATT_HIDDEN(fe_cmov_table) .type fe_cmov_table, %function fe_cmov_table: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -2232,6 +2248,7 @@ fe_cmov_table: .text .align 4 .globl fe_mul_op + WC_ASM_ATT_HIDDEN(fe_mul_op) .type fe_mul_op, %function fe_mul_op: push {lr} @@ -2613,6 +2630,7 @@ fe_mul_op: .text .align 4 .globl fe_mul_op_full_red + WC_ASM_ATT_HIDDEN(fe_mul_op_full_red) .type fe_mul_op_full_red, %function fe_mul_op_full_red: push {lr} @@ -3018,6 +3036,7 @@ fe_mul_op_full_red: .text .align 4 .globl fe_mul_op + WC_ASM_ATT_HIDDEN(fe_mul_op) .type fe_mul_op, %function fe_mul_op: push {lr} @@ -3158,6 +3177,7 @@ fe_mul_op: .text .align 4 .globl fe_mul_op_full_red + WC_ASM_ATT_HIDDEN(fe_mul_op_full_red) .type fe_mul_op_full_red, %function fe_mul_op_full_red: push {lr} @@ -3322,6 +3342,7 @@ fe_mul_op_full_red: .text .align 4 .globl fe_mul + WC_ASM_ATT_HIDDEN(fe_mul) .type fe_mul, %function fe_mul: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -3332,6 +3353,7 @@ fe_mul: .text .align 4 .globl fe_sq_op + WC_ASM_ATT_HIDDEN(fe_sq_op) .type fe_sq_op, %function fe_sq_op: push {lr} @@ -3606,6 +3628,7 @@ fe_sq_op: .text .align 4 .globl fe_sq_op_full_red + WC_ASM_ATT_HIDDEN(fe_sq_op_full_red) .type fe_sq_op_full_red, %function fe_sq_op_full_red: push {lr} @@ -3904,6 +3927,7 @@ fe_sq_op_full_red: .text .align 4 .globl fe_sq_op + WC_ASM_ATT_HIDDEN(fe_sq_op) .type fe_sq_op, %function fe_sq_op: push {lr} @@ -4030,6 +4054,7 @@ fe_sq_op: .text .align 4 .globl fe_sq_op_full_red + WC_ASM_ATT_HIDDEN(fe_sq_op_full_red) .type fe_sq_op_full_red, %function fe_sq_op_full_red: push {lr} @@ -4180,6 +4205,7 @@ fe_sq_op_full_red: .text .align 4 .globl fe_sq + WC_ASM_ATT_HIDDEN(fe_sq) .type fe_sq, %function fe_sq: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -4191,6 +4217,7 @@ fe_sq: .text .align 4 .globl fe_mul121666 + WC_ASM_ATT_HIDDEN(fe_mul121666) .type fe_mul121666, %function fe_mul121666: push {r4, r5, r6, r7, r8, r9, r10, lr} @@ -4259,6 +4286,7 @@ fe_mul121666: .text .align 4 .globl fe_mul121666 + WC_ASM_ATT_HIDDEN(fe_mul121666) .type fe_mul121666, %function fe_mul121666: push {r4, r5, r6, r7, r8, r9, r10, lr} @@ -4315,6 +4343,7 @@ fe_mul121666: .text .align 4 .globl curve25519 + WC_ASM_ATT_HIDDEN(curve25519) .type curve25519, %function curve25519: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -4716,6 +4745,7 @@ L_curve25519_inv_8: .text .align 4 .globl curve25519 + WC_ASM_ATT_HIDDEN(curve25519) .type curve25519, %function curve25519: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -5024,6 +5054,7 @@ L_curve25519_inv_8: .text .align 4 .globl fe_invert + WC_ASM_ATT_HIDDEN(fe_invert) .type fe_invert, %function fe_invert: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -5183,6 +5214,7 @@ L_fe_invert8: .text .align 4 .globl fe_sq2 + WC_ASM_ATT_HIDDEN(fe_sq2) .type fe_sq2, %function fe_sq2: push {lr} @@ -5522,6 +5554,7 @@ fe_sq2: .text .align 4 .globl fe_sq2 + WC_ASM_ATT_HIDDEN(fe_sq2) .type fe_sq2, %function fe_sq2: push {lr} @@ -5720,6 +5753,7 @@ fe_sq2: .text .align 4 .globl fe_pow22523 + WC_ASM_ATT_HIDDEN(fe_pow22523) .type fe_pow22523, %function fe_pow22523: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -5878,6 +5912,7 @@ L_fe_pow22523_8: .text .align 4 .globl ge_p1p1_to_p2 + WC_ASM_ATT_HIDDEN(ge_p1p1_to_p2) .type ge_p1p1_to_p2, %function ge_p1p1_to_p2: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -5904,6 +5939,7 @@ ge_p1p1_to_p2: .text .align 4 .globl ge_p1p1_to_p3 + WC_ASM_ATT_HIDDEN(ge_p1p1_to_p3) .type ge_p1p1_to_p3, %function ge_p1p1_to_p3: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -5935,6 +5971,7 @@ ge_p1p1_to_p3: .text .align 4 .globl ge_p2_dbl + WC_ASM_ATT_HIDDEN(ge_p2_dbl) .type ge_p2_dbl, %function ge_p2_dbl: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -5978,6 +6015,7 @@ ge_p2_dbl: .text .align 4 .globl ge_madd + WC_ASM_ATT_HIDDEN(ge_madd) .type ge_madd, %function ge_madd: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -6059,6 +6097,7 @@ ge_madd: .text .align 4 .globl ge_msub + WC_ASM_ATT_HIDDEN(ge_msub) .type ge_msub, %function ge_msub: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -6141,6 +6180,7 @@ ge_msub: .text .align 4 .globl ge_add + WC_ASM_ATT_HIDDEN(ge_add) .type ge_add, %function ge_add: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -6223,6 +6263,7 @@ ge_add: .text .align 4 .globl ge_sub + WC_ASM_ATT_HIDDEN(ge_sub) .type ge_sub, %function ge_sub: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -6308,6 +6349,7 @@ ge_sub: .text .align 4 .globl sc_reduce + WC_ASM_ATT_HIDDEN(sc_reduce) .type sc_reduce, %function sc_reduce: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -7093,6 +7135,7 @@ sc_reduce: .text .align 4 .globl sc_reduce + WC_ASM_ATT_HIDDEN(sc_reduce) .type sc_reduce, %function sc_reduce: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -7751,6 +7794,7 @@ sc_reduce: .text .align 4 .globl sc_muladd + WC_ASM_ATT_HIDDEN(sc_muladd) .type sc_muladd, %function sc_muladd: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -8893,6 +8937,7 @@ sc_muladd: .text .align 4 .globl sc_muladd + WC_ASM_ATT_HIDDEN(sc_muladd) .type sc_muladd, %function sc_muladd: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} diff --git a/wolfcrypt/src/port/arm/armv8-32-frodokem-asm.S b/wolfcrypt/src/port/arm/armv8-32-frodokem-asm.S index fa3d83a08ad..11e00e0b7c8 100644 --- a/wolfcrypt/src/port/arm/armv8-32-frodokem-asm.S +++ b/wolfcrypt/src/port/arm/armv8-32-frodokem-asm.S @@ -38,6 +38,7 @@ .align 4 .fpu neon .globl frodokem_add_neon + WC_ASM_ATT_HIDDEN(frodokem_add_neon) .type frodokem_add_neon, %function frodokem_add_neon: vdup.16 q2, r2 @@ -56,6 +57,7 @@ L_frodokem_add_neon_blk: .align 4 .fpu neon .globl frodokem_sample_neon + WC_ASM_ATT_HIDDEN(frodokem_sample_neon) .type frodokem_sample_neon, %function frodokem_sample_neon: push {r4, lr} @@ -90,6 +92,7 @@ L_frodokem_sample_neon_cdf: .align 4 .fpu neon .globl frodokem_sa_accum_neon + WC_ASM_ATT_HIDDEN(frodokem_sa_accum_neon) .type frodokem_sa_accum_neon, %function frodokem_sa_accum_neon: push {r4, r5, r6, r7, r8, lr} @@ -118,6 +121,7 @@ L_frodokem_sa_accum_neon_k: .align 4 .fpu neon .globl frodokem_as_accum_neon + WC_ASM_ATT_HIDDEN(frodokem_as_accum_neon) .type frodokem_as_accum_neon, %function frodokem_as_accum_neon: push {r4, r5, r6, r7, r8, r9, lr} @@ -216,6 +220,7 @@ L_frodokem_as_accum_neon_k: .align 4 .fpu neon .globl frodokem_mul_bs_neon + WC_ASM_ATT_HIDDEN(frodokem_mul_bs_neon) .type frodokem_mul_bs_neon, %function frodokem_mul_bs_neon: push {r4, r5, r6, r7, r8, r9, r10, lr} @@ -318,6 +323,7 @@ L_frodokem_mul_bs_neon_k: .align 4 .fpu neon .globl frodokem_mul_add_sb_plus_e_neon + WC_ASM_ATT_HIDDEN(frodokem_mul_add_sb_plus_e_neon) .type frodokem_mul_add_sb_plus_e_neon, %function frodokem_mul_add_sb_plus_e_neon: push {r4, r5, r6, r7, r8, r9, lr} @@ -403,6 +409,7 @@ L_frodokem_mul_add_sb_plus_e_neon_j: .text .align 4 .globl frodokem_gen_a_rows_aes_arm32 + WC_ASM_ATT_HIDDEN(frodokem_gen_a_rows_aes_arm32) .type frodokem_gen_a_rows_aes_arm32, %function frodokem_gen_a_rows_aes_arm32: push {r4, r5, r6, r7, r8, r9, lr} @@ -507,6 +514,7 @@ L_frodokem_gen_a_rows_aes_arm32_aes: .text .align 4 .globl frodokem_add_simd32 + WC_ASM_ATT_HIDDEN(frodokem_add_simd32) .type frodokem_add_simd32, %function frodokem_add_simd32: push {lr} @@ -525,6 +533,7 @@ L_frodokem_add_simd32_blk: .text .align 4 .globl frodokem_sa_accum_simd32 + WC_ASM_ATT_HIDDEN(frodokem_sa_accum_simd32) .type frodokem_sa_accum_simd32, %function frodokem_sa_accum_simd32: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -554,6 +563,7 @@ L_frodokem_sa_accum_simd32_k: .text .align 4 .globl frodokem_as_accum_simd32 + WC_ASM_ATT_HIDDEN(frodokem_as_accum_simd32) .type frodokem_as_accum_simd32, %function frodokem_as_accum_simd32: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -585,6 +595,7 @@ L_frodokem_as_accum_simd32_j: .text .align 4 .globl frodokem_mul_bs_simd32 + WC_ASM_ATT_HIDDEN(frodokem_mul_bs_simd32) .type frodokem_mul_bs_simd32, %function frodokem_mul_bs_simd32: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -620,6 +631,7 @@ L_frodokem_mul_bs_simd32_j: .text .align 4 .globl frodokem_mul_add_sb_plus_e_simd32 + WC_ASM_ATT_HIDDEN(frodokem_mul_add_sb_plus_e_simd32) .type frodokem_mul_add_sb_plus_e_simd32, %function frodokem_mul_add_sb_plus_e_simd32: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} diff --git a/wolfcrypt/src/port/arm/armv8-32-mlkem-asm.S b/wolfcrypt/src/port/arm/armv8-32-mlkem-asm.S index be617630d12..1cfe370d0e1 100644 --- a/wolfcrypt/src/port/arm/armv8-32-mlkem-asm.S +++ b/wolfcrypt/src/port/arm/armv8-32-mlkem-asm.S @@ -67,6 +67,7 @@ L_mlkem_arm32_ntt_zetas: .text .align 4 .globl mlkem_arm32_ntt + WC_ASM_ATT_HIDDEN(mlkem_arm32_ntt) .type mlkem_arm32_ntt, %function mlkem_arm32_ntt: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -3088,6 +3089,7 @@ L_mlkem_invntt_zetas_inv: .text .align 4 .globl mlkem_arm32_invntt + WC_ASM_ATT_HIDDEN(mlkem_arm32_invntt) .type mlkem_arm32_invntt, %function mlkem_arm32_invntt: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -7503,6 +7505,7 @@ L_mlkem_basemul_mont_zetas: .text .align 4 .globl mlkem_arm32_basemul_mont + WC_ASM_ATT_HIDDEN(mlkem_arm32_basemul_mont) .type mlkem_arm32_basemul_mont, %function mlkem_arm32_basemul_mont: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -7781,6 +7784,7 @@ L_mlkem_basemul_mont_loop: .text .align 4 .globl mlkem_arm32_basemul_mont_add + WC_ASM_ATT_HIDDEN(mlkem_arm32_basemul_mont_add) .type mlkem_arm32_basemul_mont_add, %function mlkem_arm32_basemul_mont_add: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -8093,6 +8097,7 @@ L_mlkem_arm32_basemul_mont_add_loop: .text .align 4 .globl mlkem_arm32_csubq + WC_ASM_ATT_HIDDEN(mlkem_arm32_csubq) .type mlkem_arm32_csubq, %function mlkem_arm32_csubq: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -8264,6 +8269,7 @@ L_mlkem_arm32_csubq_loop: .text .align 4 .globl mlkem_arm32_rej_uniform + WC_ASM_ATT_HIDDEN(mlkem_arm32_rej_uniform) .type mlkem_arm32_rej_uniform, %function mlkem_arm32_rej_uniform: push {r4, r5, r6, r7, r8, lr} diff --git a/wolfcrypt/src/port/arm/armv8-32-poly1305-asm.S b/wolfcrypt/src/port/arm/armv8-32-poly1305-asm.S index b9620500144..da1da22b853 100644 --- a/wolfcrypt/src/port/arm/armv8-32-poly1305-asm.S +++ b/wolfcrypt/src/port/arm/armv8-32-poly1305-asm.S @@ -37,6 +37,7 @@ .text .align 4 .globl poly1305_arm32_blocks_16 + WC_ASM_ATT_HIDDEN(poly1305_arm32_blocks_16) .type poly1305_arm32_blocks_16, %function poly1305_arm32_blocks_16: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -266,6 +267,7 @@ L_poly1305_arm32_clamp: .text .align 4 .globl poly1305_set_key + WC_ASM_ATT_HIDDEN(poly1305_set_key) .type poly1305_set_key, %function poly1305_set_key: push {r4, r5, r6, r7, r8, lr} @@ -305,6 +307,7 @@ poly1305_set_key: .text .align 4 .globl poly1305_final + WC_ASM_ATT_HIDDEN(poly1305_final) .type poly1305_final, %function poly1305_final: push {r4, r5, r6, r7, r8, r9, lr} @@ -357,6 +360,7 @@ poly1305_final: .text .align 4 .globl poly1305_arm32_blocks_16 + WC_ASM_ATT_HIDDEN(poly1305_arm32_blocks_16) .type poly1305_arm32_blocks_16, %function poly1305_arm32_blocks_16: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -571,6 +575,7 @@ L_poly1305_arm32_16_done: .text .align 4 .globl poly1305_arm32_blocks + WC_ASM_ATT_HIDDEN(poly1305_arm32_blocks) .type poly1305_arm32_blocks, %function poly1305_arm32_blocks: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -1030,6 +1035,7 @@ L_poly1305_arm32_clamp: .text .align 4 .globl poly1305_set_key + WC_ASM_ATT_HIDDEN(poly1305_set_key) .type poly1305_set_key, %function poly1305_set_key: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -1248,6 +1254,7 @@ poly1305_set_key: .text .align 4 .globl poly1305_final + WC_ASM_ATT_HIDDEN(poly1305_final) .type poly1305_final, %function poly1305_final: push {r4, r5, r6, r7, r8, r9, lr} diff --git a/wolfcrypt/src/port/arm/armv8-32-sha256-asm.S b/wolfcrypt/src/port/arm/armv8-32-sha256-asm.S index 9f02a98e4ef..c747b53b047 100644 --- a/wolfcrypt/src/port/arm/armv8-32-sha256-asm.S +++ b/wolfcrypt/src/port/arm/armv8-32-sha256-asm.S @@ -68,6 +68,7 @@ L_SHA256_transform_len_k: .text .align 4 .globl Transform_Sha256_Len_base + WC_ASM_ATT_HIDDEN(Transform_Sha256_Len_base) .type Transform_Sha256_Len_base, %function Transform_Sha256_Len_base: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -2567,6 +2568,7 @@ L_SHA256_transform_neon_len_k: .align 4 .fpu neon .globl Transform_Sha256_Len_neon + WC_ASM_ATT_HIDDEN(Transform_Sha256_Len_neon) .type Transform_Sha256_Len_neon, %function Transform_Sha256_Len_neon: push {r4, r5, r6, r7, r8, r9, r10, lr} @@ -3628,6 +3630,7 @@ L_SHA256_trans_crypto_len_k: .align 4 .fpu crypto-neon-fp-armv8 .globl Transform_Sha256_Len_crypto + WC_ASM_ATT_HIDDEN(Transform_Sha256_Len_crypto) .type Transform_Sha256_Len_crypto, %function Transform_Sha256_Len_crypto: vpush {d8-d15} diff --git a/wolfcrypt/src/port/arm/armv8-32-sha3-asm.S b/wolfcrypt/src/port/arm/armv8-32-sha3-asm.S index 4f0a420398c..aa7192c67ac 100644 --- a/wolfcrypt/src/port/arm/armv8-32-sha3-asm.S +++ b/wolfcrypt/src/port/arm/armv8-32-sha3-asm.S @@ -64,6 +64,7 @@ L_sha3_arm32_neon_rt: .text .align 4 .globl BlockSha3 + WC_ASM_ATT_HIDDEN(BlockSha3) .type BlockSha3, %function BlockSha3: vpush {d8-d15} @@ -358,6 +359,7 @@ L_sha3_arm32_rt: .text .align 4 .globl BlockSha3 + WC_ASM_ATT_HIDDEN(BlockSha3) .type BlockSha3, %function BlockSha3: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} diff --git a/wolfcrypt/src/port/arm/armv8-32-sha512-asm.S b/wolfcrypt/src/port/arm/armv8-32-sha512-asm.S index 5e33ea32f7b..8b98d9f4f1d 100644 --- a/wolfcrypt/src/port/arm/armv8-32-sha512-asm.S +++ b/wolfcrypt/src/port/arm/armv8-32-sha512-asm.S @@ -92,6 +92,7 @@ L_SHA512_transform_len_k: .text .align 4 .globl Transform_Sha512_Len_base + WC_ASM_ATT_HIDDEN(Transform_Sha512_Len_base) .type Transform_Sha512_Len_base, %function Transform_Sha512_Len_base: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -7568,6 +7569,7 @@ L_SHA512_transform_neon_len_k: .align 4 .fpu neon .globl Transform_Sha512_Len_neon + WC_ASM_ATT_HIDDEN(Transform_Sha512_Len_neon) .type Transform_Sha512_Len_neon, %function Transform_Sha512_Len_neon: vpush {d8-d15} diff --git a/wolfcrypt/src/port/arm/armv8-aes-asm.S b/wolfcrypt/src/port/arm/armv8-aes-asm.S index 1bce6418099..1cde598faca 100644 --- a/wolfcrypt/src/port/arm/armv8-aes-asm.S +++ b/wolfcrypt/src/port/arm/armv8-aes-asm.S @@ -38,12 +38,14 @@ #ifndef __APPLE__ .text .globl AES_set_key_AARCH64 +WC_ASM_ATT_HIDDEN(AES_set_key_AARCH64) .type AES_set_key_AARCH64,@function .align 2 AES_set_key_AARCH64: #else .section __TEXT,__text .globl _AES_set_key_AARCH64 +WC_ASM_ATT_HIDDEN(_AES_set_key_AARCH64) .p2align 2 _AES_set_key_AARCH64: #endif /* __APPLE__ */ @@ -589,12 +591,14 @@ L_aes_set_key_arm64_crypto_done: #ifndef __APPLE__ .text .globl AES_encrypt_AARCH64 +WC_ASM_ATT_HIDDEN(AES_encrypt_AARCH64) .type AES_encrypt_AARCH64,@function .align 2 AES_encrypt_AARCH64: #else .section __TEXT,__text .globl _AES_encrypt_AARCH64 +WC_ASM_ATT_HIDDEN(_AES_encrypt_AARCH64) .p2align 2 _AES_encrypt_AARCH64: #endif /* __APPLE__ */ @@ -649,12 +653,14 @@ L_aes_encrypt_arm64_crypto_round_done: #ifndef __APPLE__ .text .globl AES_decrypt_AARCH64 +WC_ASM_ATT_HIDDEN(AES_decrypt_AARCH64) .type AES_decrypt_AARCH64,@function .align 2 AES_decrypt_AARCH64: #else .section __TEXT,__text .globl _AES_decrypt_AARCH64 +WC_ASM_ATT_HIDDEN(_AES_decrypt_AARCH64) .p2align 2 _AES_decrypt_AARCH64: #endif /* __APPLE__ */ @@ -709,12 +715,14 @@ L_aes_decrypt_arm64_crypto_round_done: #ifndef __APPLE__ .text .globl AES_encrypt_blocks_AARCH64 +WC_ASM_ATT_HIDDEN(AES_encrypt_blocks_AARCH64) .type AES_encrypt_blocks_AARCH64,@function .align 2 AES_encrypt_blocks_AARCH64: #else .section __TEXT,__text .globl _AES_encrypt_blocks_AARCH64 +WC_ASM_ATT_HIDDEN(_AES_encrypt_blocks_AARCH64) .p2align 2 _AES_encrypt_blocks_AARCH64: #endif /* __APPLE__ */ @@ -1919,12 +1927,14 @@ L_aes_encrypt_blocks_arm64_crypto_done: #ifndef __APPLE__ .text .globl AES_decrypt_blocks_AARCH64 +WC_ASM_ATT_HIDDEN(AES_decrypt_blocks_AARCH64) .type AES_decrypt_blocks_AARCH64,@function .align 2 AES_decrypt_blocks_AARCH64: #else .section __TEXT,__text .globl _AES_decrypt_blocks_AARCH64 +WC_ASM_ATT_HIDDEN(_AES_decrypt_blocks_AARCH64) .p2align 2 _AES_decrypt_blocks_AARCH64: #endif /* __APPLE__ */ @@ -3131,12 +3141,14 @@ L_aes_decrypt_blocks_arm64_crypto_done: #ifndef __APPLE__ .text .globl AES_CBC_encrypt_AARCH64 +WC_ASM_ATT_HIDDEN(AES_CBC_encrypt_AARCH64) .type AES_CBC_encrypt_AARCH64,@function .align 2 AES_CBC_encrypt_AARCH64: #else .section __TEXT,__text .globl _AES_CBC_encrypt_AARCH64 +WC_ASM_ATT_HIDDEN(_AES_CBC_encrypt_AARCH64) .p2align 2 _AES_CBC_encrypt_AARCH64: #endif /* __APPLE__ */ @@ -3267,12 +3279,14 @@ L_aes_cbc_encrypt_arm64_crypto_done: #ifndef __APPLE__ .text .globl AES_CBC_decrypt_AARCH64 +WC_ASM_ATT_HIDDEN(AES_CBC_decrypt_AARCH64) .type AES_CBC_decrypt_AARCH64,@function .align 2 AES_CBC_decrypt_AARCH64: #else .section __TEXT,__text .globl _AES_CBC_decrypt_AARCH64 +WC_ASM_ATT_HIDDEN(_AES_CBC_decrypt_AARCH64) .p2align 2 _AES_CBC_decrypt_AARCH64: #endif /* __APPLE__ */ @@ -3519,12 +3533,14 @@ L_aes_cbc_decrypt_blocks_arm64_crypto_done: #ifndef __APPLE__ .text .globl AES_CTR_encrypt_AARCH64 +WC_ASM_ATT_HIDDEN(AES_CTR_encrypt_AARCH64) .type AES_CTR_encrypt_AARCH64,@function .align 2 AES_CTR_encrypt_AARCH64: #else .section __TEXT,__text .globl _AES_CTR_encrypt_AARCH64 +WC_ASM_ATT_HIDDEN(_AES_CTR_encrypt_AARCH64) .p2align 2 _AES_CTR_encrypt_AARCH64: #endif /* __APPLE__ */ @@ -5181,12 +5197,14 @@ L_aes_ctr_encrypt_arm64_crypto_done: #ifndef __APPLE__ .text .globl AES_GCM_set_key_AARCH64 +WC_ASM_ATT_HIDDEN(AES_GCM_set_key_AARCH64) .type AES_GCM_set_key_AARCH64,@function .align 2 AES_GCM_set_key_AARCH64: #else .section __TEXT,__text .globl _AES_GCM_set_key_AARCH64 +WC_ASM_ATT_HIDDEN(_AES_GCM_set_key_AARCH64) .p2align 2 _AES_GCM_set_key_AARCH64: #endif /* __APPLE__ */ @@ -5239,12 +5257,14 @@ L_aes_gcm_set_key_arm64_crypto_round_done: #ifndef __APPLE__ .text .globl AES_GCM_encrypt_AARCH64 +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_AARCH64) .type AES_GCM_encrypt_AARCH64,@function .align 2 AES_GCM_encrypt_AARCH64: #else .section __TEXT,__text .globl _AES_GCM_encrypt_AARCH64 +WC_ASM_ATT_HIDDEN(_AES_GCM_encrypt_AARCH64) .p2align 2 _AES_GCM_encrypt_AARCH64: #endif /* __APPLE__ */ @@ -10040,12 +10060,14 @@ L_aes_gcm_encrypt_arm64_crypto_done: #ifndef __APPLE__ .text .globl AES_GCM_decrypt_AARCH64 +WC_ASM_ATT_HIDDEN(AES_GCM_decrypt_AARCH64) .type AES_GCM_decrypt_AARCH64,@function .align 2 AES_GCM_decrypt_AARCH64: #else .section __TEXT,__text .globl _AES_GCM_decrypt_AARCH64 +WC_ASM_ATT_HIDDEN(_AES_GCM_decrypt_AARCH64) .p2align 2 _AES_GCM_decrypt_AARCH64: #endif /* __APPLE__ */ @@ -14891,12 +14913,14 @@ L_aes_gcm_decrypt_arm64_crypto_done: #ifndef __APPLE__ .text .globl AES_GCM_encrypt_AARCH64_EOR3 +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_AARCH64_EOR3) .type AES_GCM_encrypt_AARCH64_EOR3,@function .align 2 AES_GCM_encrypt_AARCH64_EOR3: #else .section __TEXT,__text .globl _AES_GCM_encrypt_AARCH64_EOR3 +WC_ASM_ATT_HIDDEN(_AES_GCM_encrypt_AARCH64_EOR3) .p2align 2 _AES_GCM_encrypt_AARCH64_EOR3: #endif /* __APPLE__ */ @@ -19583,12 +19607,14 @@ L_aes_gcm_encrypt_arm64_crypto_eor3_done: #ifndef __APPLE__ .text .globl AES_GCM_decrypt_AARCH64_EOR3 +WC_ASM_ATT_HIDDEN(AES_GCM_decrypt_AARCH64_EOR3) .type AES_GCM_decrypt_AARCH64_EOR3,@function .align 2 AES_GCM_decrypt_AARCH64_EOR3: #else .section __TEXT,__text .globl _AES_GCM_decrypt_AARCH64_EOR3 +WC_ASM_ATT_HIDDEN(_AES_GCM_decrypt_AARCH64_EOR3) .p2align 2 _AES_GCM_decrypt_AARCH64_EOR3: #endif /* __APPLE__ */ @@ -24326,12 +24352,14 @@ L_aes_gcm_decrypt_arm64_crypto_eor3_done: #ifndef __APPLE__ .text .globl AES_GCM_init_AARCH64 +WC_ASM_ATT_HIDDEN(AES_GCM_init_AARCH64) .type AES_GCM_init_AARCH64,@function .align 2 AES_GCM_init_AARCH64: #else .section __TEXT,__text .globl _AES_GCM_init_AARCH64 +WC_ASM_ATT_HIDDEN(_AES_GCM_init_AARCH64) .p2align 2 _AES_GCM_init_AARCH64: #endif /* __APPLE__ */ @@ -24504,12 +24532,14 @@ L_aes_gcm_init_arm64_crypto_round_done: #ifndef __APPLE__ .text .globl AES_GCM_ghash_block_AARCH64 +WC_ASM_ATT_HIDDEN(AES_GCM_ghash_block_AARCH64) .type AES_GCM_ghash_block_AARCH64,@function .align 2 AES_GCM_ghash_block_AARCH64: #else .section __TEXT,__text .globl _AES_GCM_ghash_block_AARCH64 +WC_ASM_ATT_HIDDEN(_AES_GCM_ghash_block_AARCH64) .p2align 2 _AES_GCM_ghash_block_AARCH64: #endif /* __APPLE__ */ @@ -24549,12 +24579,14 @@ _AES_GCM_ghash_block_AARCH64: #ifndef __APPLE__ .text .globl AES_GCM_aad_update_AARCH64 +WC_ASM_ATT_HIDDEN(AES_GCM_aad_update_AARCH64) .type AES_GCM_aad_update_AARCH64,@function .align 2 AES_GCM_aad_update_AARCH64: #else .section __TEXT,__text .globl _AES_GCM_aad_update_AARCH64 +WC_ASM_ATT_HIDDEN(_AES_GCM_aad_update_AARCH64) .p2align 2 _AES_GCM_aad_update_AARCH64: #endif /* __APPLE__ */ @@ -24903,12 +24935,14 @@ L_aes_gcm_aad_update_arm64_crypto_done: #ifndef __APPLE__ .text .globl AES_GCM_encrypt_block_AARCH64 +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_block_AARCH64) .type AES_GCM_encrypt_block_AARCH64,@function .align 2 AES_GCM_encrypt_block_AARCH64: #else .section __TEXT,__text .globl _AES_GCM_encrypt_block_AARCH64 +WC_ASM_ATT_HIDDEN(_AES_GCM_encrypt_block_AARCH64) .p2align 2 _AES_GCM_encrypt_block_AARCH64: #endif /* __APPLE__ */ @@ -24968,12 +25002,14 @@ L_aes_gcm_encrypt_block_arm64_crypto_round_done: #ifndef __APPLE__ .text .globl AES_GCM_encrypt_update_AARCH64 +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_update_AARCH64) .type AES_GCM_encrypt_update_AARCH64,@function .align 2 AES_GCM_encrypt_update_AARCH64: #else .section __TEXT,__text .globl _AES_GCM_encrypt_update_AARCH64 +WC_ASM_ATT_HIDDEN(_AES_GCM_encrypt_update_AARCH64) .p2align 2 _AES_GCM_encrypt_update_AARCH64: #endif /* __APPLE__ */ @@ -28778,12 +28814,14 @@ L_aes_gcm_encrypt_update_arm64_crypto_done: #ifndef __APPLE__ .text .globl AES_GCM_encrypt_final_AARCH64 +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_final_AARCH64) .type AES_GCM_encrypt_final_AARCH64,@function .align 2 AES_GCM_encrypt_final_AARCH64: #else .section __TEXT,__text .globl _AES_GCM_encrypt_final_AARCH64 +WC_ASM_ATT_HIDDEN(_AES_GCM_encrypt_final_AARCH64) .p2align 2 _AES_GCM_encrypt_final_AARCH64: #endif /* __APPLE__ */ @@ -28853,12 +28891,14 @@ L_aes_gcm_encrypt_final_arm64_crypto_done: #ifndef __APPLE__ .text .globl AES_GCM_decrypt_update_AARCH64 +WC_ASM_ATT_HIDDEN(AES_GCM_decrypt_update_AARCH64) .type AES_GCM_decrypt_update_AARCH64,@function .align 2 AES_GCM_decrypt_update_AARCH64: #else .section __TEXT,__text .globl _AES_GCM_decrypt_update_AARCH64 +WC_ASM_ATT_HIDDEN(_AES_GCM_decrypt_update_AARCH64) .p2align 2 _AES_GCM_decrypt_update_AARCH64: #endif /* __APPLE__ */ @@ -32664,12 +32704,14 @@ L_aes_gcm_decrypt_update_arm64_crypto_done: #ifndef __APPLE__ .text .globl AES_GCM_decrypt_final_AARCH64 +WC_ASM_ATT_HIDDEN(AES_GCM_decrypt_final_AARCH64) .type AES_GCM_decrypt_final_AARCH64,@function .align 2 AES_GCM_decrypt_final_AARCH64: #else .section __TEXT,__text .globl _AES_GCM_decrypt_final_AARCH64 +WC_ASM_ATT_HIDDEN(_AES_GCM_decrypt_final_AARCH64) .p2align 2 _AES_GCM_decrypt_final_AARCH64: #endif /* __APPLE__ */ @@ -32765,12 +32807,14 @@ L_aes_gcm_decrypt_final_arm64_crypto_tag_loaded: #ifndef __APPLE__ .text .globl AES_GCM_init_AARCH64_EOR3 +WC_ASM_ATT_HIDDEN(AES_GCM_init_AARCH64_EOR3) .type AES_GCM_init_AARCH64_EOR3,@function .align 2 AES_GCM_init_AARCH64_EOR3: #else .section __TEXT,__text .globl _AES_GCM_init_AARCH64_EOR3 +WC_ASM_ATT_HIDDEN(_AES_GCM_init_AARCH64_EOR3) .p2align 2 _AES_GCM_init_AARCH64_EOR3: #endif /* __APPLE__ */ @@ -32940,12 +32984,14 @@ L_aes_gcm_init_arm64_crypto_eor3_round_done: #ifndef __APPLE__ .text .globl AES_GCM_ghash_block_AARCH64_EOR3 +WC_ASM_ATT_HIDDEN(AES_GCM_ghash_block_AARCH64_EOR3) .type AES_GCM_ghash_block_AARCH64_EOR3,@function .align 2 AES_GCM_ghash_block_AARCH64_EOR3: #else .section __TEXT,__text .globl _AES_GCM_ghash_block_AARCH64_EOR3 +WC_ASM_ATT_HIDDEN(_AES_GCM_ghash_block_AARCH64_EOR3) .p2align 2 _AES_GCM_ghash_block_AARCH64_EOR3: #endif /* __APPLE__ */ @@ -32984,12 +33030,14 @@ _AES_GCM_ghash_block_AARCH64_EOR3: #ifndef __APPLE__ .text .globl AES_GCM_aad_update_AARCH64_EOR3 +WC_ASM_ATT_HIDDEN(AES_GCM_aad_update_AARCH64_EOR3) .type AES_GCM_aad_update_AARCH64_EOR3,@function .align 2 AES_GCM_aad_update_AARCH64_EOR3: #else .section __TEXT,__text .globl _AES_GCM_aad_update_AARCH64_EOR3 +WC_ASM_ATT_HIDDEN(_AES_GCM_aad_update_AARCH64_EOR3) .p2align 2 _AES_GCM_aad_update_AARCH64_EOR3: #endif /* __APPLE__ */ @@ -33320,12 +33368,14 @@ L_aes_gcm_aad_update_arm64_crypto_eor3_done: #ifndef __APPLE__ .text .globl AES_GCM_encrypt_block_AARCH64_EOR3 +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_block_AARCH64_EOR3) .type AES_GCM_encrypt_block_AARCH64_EOR3,@function .align 2 AES_GCM_encrypt_block_AARCH64_EOR3: #else .section __TEXT,__text .globl _AES_GCM_encrypt_block_AARCH64_EOR3 +WC_ASM_ATT_HIDDEN(_AES_GCM_encrypt_block_AARCH64_EOR3) .p2align 2 _AES_GCM_encrypt_block_AARCH64_EOR3: #endif /* __APPLE__ */ @@ -33385,12 +33435,14 @@ L_aes_gcm_encrypt_block_arm64_crypto_eor3_round_done: #ifndef __APPLE__ .text .globl AES_GCM_encrypt_update_AARCH64_EOR3 +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_update_AARCH64_EOR3) .type AES_GCM_encrypt_update_AARCH64_EOR3,@function .align 2 AES_GCM_encrypt_update_AARCH64_EOR3: #else .section __TEXT,__text .globl _AES_GCM_encrypt_update_AARCH64_EOR3 +WC_ASM_ATT_HIDDEN(_AES_GCM_encrypt_update_AARCH64_EOR3) .p2align 2 _AES_GCM_encrypt_update_AARCH64_EOR3: #endif /* __APPLE__ */ @@ -37111,12 +37163,14 @@ L_aes_gcm_encrypt_update_arm64_crypto_eor3_done: #ifndef __APPLE__ .text .globl AES_GCM_encrypt_final_AARCH64_EOR3 +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_final_AARCH64_EOR3) .type AES_GCM_encrypt_final_AARCH64_EOR3,@function .align 2 AES_GCM_encrypt_final_AARCH64_EOR3: #else .section __TEXT,__text .globl _AES_GCM_encrypt_final_AARCH64_EOR3 +WC_ASM_ATT_HIDDEN(_AES_GCM_encrypt_final_AARCH64_EOR3) .p2align 2 _AES_GCM_encrypt_final_AARCH64_EOR3: #endif /* __APPLE__ */ @@ -37185,12 +37239,14 @@ L_aes_gcm_encrypt_final_arm64_crypto_eor3_done: #ifndef __APPLE__ .text .globl AES_GCM_decrypt_update_AARCH64_EOR3 +WC_ASM_ATT_HIDDEN(AES_GCM_decrypt_update_AARCH64_EOR3) .type AES_GCM_decrypt_update_AARCH64_EOR3,@function .align 2 AES_GCM_decrypt_update_AARCH64_EOR3: #else .section __TEXT,__text .globl _AES_GCM_decrypt_update_AARCH64_EOR3 +WC_ASM_ATT_HIDDEN(_AES_GCM_decrypt_update_AARCH64_EOR3) .p2align 2 _AES_GCM_decrypt_update_AARCH64_EOR3: #endif /* __APPLE__ */ @@ -40912,12 +40968,14 @@ L_aes_gcm_decrypt_update_arm64_crypto_eor3_done: #ifndef __APPLE__ .text .globl AES_GCM_decrypt_final_AARCH64_EOR3 +WC_ASM_ATT_HIDDEN(AES_GCM_decrypt_final_AARCH64_EOR3) .type AES_GCM_decrypt_final_AARCH64_EOR3,@function .align 2 AES_GCM_decrypt_final_AARCH64_EOR3: #else .section __TEXT,__text .globl _AES_GCM_decrypt_final_AARCH64_EOR3 +WC_ASM_ATT_HIDDEN(_AES_GCM_decrypt_final_AARCH64_EOR3) .p2align 2 _AES_GCM_decrypt_final_AARCH64_EOR3: #endif /* __APPLE__ */ @@ -41015,12 +41073,14 @@ L_aes_gcm_decrypt_final_arm64_crypto_eor3_tag_loaded: #ifndef __APPLE__ .text .globl AES_XTS_encrypt_AARCH64 +WC_ASM_ATT_HIDDEN(AES_XTS_encrypt_AARCH64) .type AES_XTS_encrypt_AARCH64,@function .align 2 AES_XTS_encrypt_AARCH64: #else .section __TEXT,__text .globl _AES_XTS_encrypt_AARCH64 +WC_ASM_ATT_HIDDEN(_AES_XTS_encrypt_AARCH64) .p2align 2 _AES_XTS_encrypt_AARCH64: #endif /* __APPLE__ */ @@ -42025,12 +42085,14 @@ L_aes_xts_encrypt_arm64_crypto_done: #ifndef __APPLE__ .text .globl AES_XTS_decrypt_AARCH64 +WC_ASM_ATT_HIDDEN(AES_XTS_decrypt_AARCH64) .type AES_XTS_decrypt_AARCH64,@function .align 2 AES_XTS_decrypt_AARCH64: #else .section __TEXT,__text .globl _AES_XTS_decrypt_AARCH64 +WC_ASM_ATT_HIDDEN(_AES_XTS_decrypt_AARCH64) .p2align 2 _AES_XTS_decrypt_AARCH64: #endif /* __APPLE__ */ @@ -43132,12 +43194,14 @@ L_aes_xts_decrypt_arm64_crypto_done: #ifndef __APPLE__ .text .globl AES_GCMSIV_polyval_pmull +WC_ASM_ATT_HIDDEN(AES_GCMSIV_polyval_pmull) .type AES_GCMSIV_polyval_pmull,@function .align 2 AES_GCMSIV_polyval_pmull: #else .section __TEXT,__text .globl _AES_GCMSIV_polyval_pmull +WC_ASM_ATT_HIDDEN(_AES_GCMSIV_polyval_pmull) .p2align 2 _AES_GCMSIV_polyval_pmull: #endif /* __APPLE__ */ @@ -43671,12 +43735,14 @@ L_AES_GCMSIV_polyval_pmull_done: #ifndef __APPLE__ .text .globl AES_GCMSIV_ctr_aarch64 +WC_ASM_ATT_HIDDEN(AES_GCMSIV_ctr_aarch64) .type AES_GCMSIV_ctr_aarch64,@function .align 2 AES_GCMSIV_ctr_aarch64: #else .section __TEXT,__text .globl _AES_GCMSIV_ctr_aarch64 +WC_ASM_ATT_HIDDEN(_AES_GCMSIV_ctr_aarch64) .p2align 2 _AES_GCMSIV_ctr_aarch64: #endif /* __APPLE__ */ @@ -44267,12 +44333,14 @@ L_AES_ARM64_NEON_shift_rows_shuffle: #ifndef __APPLE__ .text .globl AES_invert_key_NEON +WC_ASM_ATT_HIDDEN(AES_invert_key_NEON) .type AES_invert_key_NEON,@function .align 2 AES_invert_key_NEON: #else .section __TEXT,__text .globl _AES_invert_key_NEON +WC_ASM_ATT_HIDDEN(_AES_invert_key_NEON) .p2align 2 _AES_invert_key_NEON: #endif /* __APPLE__ */ @@ -44346,12 +44414,14 @@ L_AES_ARM64_NEON_rcon: #ifndef __APPLE__ .text .globl AES_set_encrypt_key_NEON +WC_ASM_ATT_HIDDEN(AES_set_encrypt_key_NEON) .type AES_set_encrypt_key_NEON,@function .align 2 AES_set_encrypt_key_NEON: #else .section __TEXT,__text .globl _AES_set_encrypt_key_NEON +WC_ASM_ATT_HIDDEN(_AES_set_encrypt_key_NEON) .p2align 2 _AES_set_encrypt_key_NEON: #endif /* __APPLE__ */ @@ -44593,12 +44663,14 @@ L_AES_set_encrypt_key_NEON_end: #ifndef __APPLE__ .text .globl AES_ECB_encrypt_NEON +WC_ASM_ATT_HIDDEN(AES_ECB_encrypt_NEON) .type AES_ECB_encrypt_NEON,@function .align 2 AES_ECB_encrypt_NEON: #else .section __TEXT,__text .globl _AES_ECB_encrypt_NEON +WC_ASM_ATT_HIDDEN(_AES_ECB_encrypt_NEON) .p2align 2 _AES_ECB_encrypt_NEON: #endif /* __APPLE__ */ @@ -45373,12 +45445,14 @@ L_AES_ECB_encrypt_NEON_data_done: #ifndef __APPLE__ .text .globl AES_CBC_encrypt_NEON +WC_ASM_ATT_HIDDEN(AES_CBC_encrypt_NEON) .type AES_CBC_encrypt_NEON,@function .align 2 AES_CBC_encrypt_NEON: #else .section __TEXT,__text .globl _AES_CBC_encrypt_NEON +WC_ASM_ATT_HIDDEN(_AES_CBC_encrypt_NEON) .p2align 2 _AES_CBC_encrypt_NEON: #endif /* __APPLE__ */ @@ -45538,12 +45612,14 @@ L_AES_CBC_encrypt_NEON_loop_nr: #ifndef __APPLE__ .text .globl AES_CTR_encrypt_NEON +WC_ASM_ATT_HIDDEN(AES_CTR_encrypt_NEON) .type AES_CTR_encrypt_NEON,@function .align 2 AES_CTR_encrypt_NEON: #else .section __TEXT,__text .globl _AES_CTR_encrypt_NEON +WC_ASM_ATT_HIDDEN(_AES_CTR_encrypt_NEON) .p2align 2 _AES_CTR_encrypt_NEON: #endif /* __APPLE__ */ @@ -46432,12 +46508,14 @@ L_AES_ARM64_NEON_shift_rows_invshuffle: #ifndef __APPLE__ .text .globl AES_ECB_decrypt_NEON +WC_ASM_ATT_HIDDEN(AES_ECB_decrypt_NEON) .type AES_ECB_decrypt_NEON,@function .align 2 AES_ECB_decrypt_NEON: #else .section __TEXT,__text .globl _AES_ECB_decrypt_NEON +WC_ASM_ATT_HIDDEN(_AES_ECB_decrypt_NEON) .p2align 2 _AES_ECB_decrypt_NEON: #endif /* __APPLE__ */ @@ -47482,12 +47560,14 @@ L_AES_ECB_decrypt_NEON_data_done: #ifndef __APPLE__ .text .globl AES_CBC_decrypt_NEON +WC_ASM_ATT_HIDDEN(AES_CBC_decrypt_NEON) .type AES_CBC_decrypt_NEON,@function .align 2 AES_CBC_decrypt_NEON: #else .section __TEXT,__text .globl _AES_CBC_decrypt_NEON +WC_ASM_ATT_HIDDEN(_AES_CBC_decrypt_NEON) .p2align 2 _AES_CBC_decrypt_NEON: #endif /* __APPLE__ */ @@ -48555,12 +48635,14 @@ L_AES_CBC_decrypt_NEON_data_done: #ifndef __APPLE__ .text .globl GCM_gmult_len_NEON +WC_ASM_ATT_HIDDEN(GCM_gmult_len_NEON) .type GCM_gmult_len_NEON,@function .align 2 GCM_gmult_len_NEON: #else .section __TEXT,__text .globl _GCM_gmult_len_NEON +WC_ASM_ATT_HIDDEN(_GCM_gmult_len_NEON) .p2align 2 _GCM_gmult_len_NEON: #endif /* __APPLE__ */ @@ -48897,12 +48979,14 @@ L_GCM_gmult_len_NEON_start_block: #ifndef __APPLE__ .text .globl AES_GCM_encrypt_NEON +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_NEON) .type AES_GCM_encrypt_NEON,@function .align 2 AES_GCM_encrypt_NEON: #else .section __TEXT,__text .globl _AES_GCM_encrypt_NEON +WC_ASM_ATT_HIDDEN(_AES_GCM_encrypt_NEON) .p2align 2 _AES_GCM_encrypt_NEON: #endif /* __APPLE__ */ @@ -49703,12 +49787,14 @@ L_AES_GCM_encrypt_NEON_data_done: #ifndef __APPLE__ .text .globl AES_XTS_encrypt_NEON +WC_ASM_ATT_HIDDEN(AES_XTS_encrypt_NEON) .type AES_XTS_encrypt_NEON,@function .align 2 AES_XTS_encrypt_NEON: #else .section __TEXT,__text .globl _AES_XTS_encrypt_NEON +WC_ASM_ATT_HIDDEN(_AES_XTS_encrypt_NEON) .p2align 2 _AES_XTS_encrypt_NEON: #endif /* __APPLE__ */ @@ -50785,12 +50871,14 @@ L_AES_XTS_encrypt_NEON_data_done: #ifndef __APPLE__ .text .globl AES_XTS_decrypt_NEON +WC_ASM_ATT_HIDDEN(AES_XTS_decrypt_NEON) .type AES_XTS_decrypt_NEON,@function .align 2 AES_XTS_decrypt_NEON: #else .section __TEXT,__text .globl _AES_XTS_decrypt_NEON +WC_ASM_ATT_HIDDEN(_AES_XTS_decrypt_NEON) .p2align 2 _AES_XTS_decrypt_NEON: #endif /* __APPLE__ */ @@ -52347,12 +52435,14 @@ L_AES_XTS_decrypt_NEON_data_done: #ifndef __APPLE__ .text .globl AES_GCMSIV_polyval_neon +WC_ASM_ATT_HIDDEN(AES_GCMSIV_polyval_neon) .type AES_GCMSIV_polyval_neon,@function .align 2 AES_GCMSIV_polyval_neon: #else .section __TEXT,__text .globl _AES_GCMSIV_polyval_neon +WC_ASM_ATT_HIDDEN(_AES_GCMSIV_polyval_neon) .p2align 2 _AES_GCMSIV_polyval_neon: #endif /* __APPLE__ */ @@ -52757,12 +52847,14 @@ L_AES_GCMSIV_ctr_neon_shuffle: #ifndef __APPLE__ .text .globl AES_GCMSIV_ctr_neon +WC_ASM_ATT_HIDDEN(AES_GCMSIV_ctr_neon) .type AES_GCMSIV_ctr_neon,@function .align 2 AES_GCMSIV_ctr_neon: #else .section __TEXT,__text .globl _AES_GCMSIV_ctr_neon +WC_ASM_ATT_HIDDEN(_AES_GCMSIV_ctr_neon) .p2align 2 _AES_GCMSIV_ctr_neon: #endif /* __APPLE__ */ @@ -53731,12 +53823,14 @@ L_AES_ARM64_te: #ifndef __APPLE__ .text .globl AES_invert_key +WC_ASM_ATT_HIDDEN(AES_invert_key) .type AES_invert_key,@function .align 2 AES_invert_key: #else .section __TEXT,__text .globl _AES_invert_key +WC_ASM_ATT_HIDDEN(_AES_invert_key) .p2align 2 _AES_invert_key: #endif /* __APPLE__ */ @@ -53882,12 +53976,14 @@ L_AES_ARM64_rcon: #ifndef __APPLE__ .text .globl AES_set_encrypt_key +WC_ASM_ATT_HIDDEN(AES_set_encrypt_key) .type AES_set_encrypt_key,@function .align 2 AES_set_encrypt_key: #else .section __TEXT,__text .globl _AES_set_encrypt_key +WC_ASM_ATT_HIDDEN(_AES_set_encrypt_key) .p2align 2 _AES_set_encrypt_key: #endif /* __APPLE__ */ @@ -54139,12 +54235,14 @@ L_AES_set_encrypt_key_end: #ifndef __APPLE__ .text .globl AES_ECB_encrypt +WC_ASM_ATT_HIDDEN(AES_ECB_encrypt) .type AES_ECB_encrypt,@function .align 2 AES_ECB_encrypt: #else .section __TEXT,__text .globl _AES_ECB_encrypt +WC_ASM_ATT_HIDDEN(_AES_ECB_encrypt) .p2align 2 _AES_ECB_encrypt: #endif /* __APPLE__ */ @@ -54471,12 +54569,14 @@ L_AES_ECB_encrypt_loop_nr: #ifndef __APPLE__ .text .globl AES_CBC_encrypt +WC_ASM_ATT_HIDDEN(AES_CBC_encrypt) .type AES_CBC_encrypt,@function .align 2 AES_CBC_encrypt: #else .section __TEXT,__text .globl _AES_CBC_encrypt +WC_ASM_ATT_HIDDEN(_AES_CBC_encrypt) .p2align 2 _AES_CBC_encrypt: #endif /* __APPLE__ */ @@ -54807,12 +54907,14 @@ L_AES_CBC_encrypt_loop_nr: #ifndef __APPLE__ .text .globl AES_CTR_encrypt +WC_ASM_ATT_HIDDEN(AES_CTR_encrypt) .type AES_CTR_encrypt,@function .align 2 AES_CTR_encrypt: #else .section __TEXT,__text .globl _AES_CTR_encrypt +WC_ASM_ATT_HIDDEN(_AES_CTR_encrypt) .p2align 2 _AES_CTR_encrypt: #endif /* __APPLE__ */ @@ -55202,12 +55304,14 @@ L_AES_ARM64_td4: #ifndef __APPLE__ .text .globl AES_ECB_decrypt +WC_ASM_ATT_HIDDEN(AES_ECB_decrypt) .type AES_ECB_decrypt,@function .align 2 AES_ECB_decrypt: #else .section __TEXT,__text .globl _AES_ECB_decrypt +WC_ASM_ATT_HIDDEN(_AES_ECB_decrypt) .p2align 2 _AES_ECB_decrypt: #endif /* __APPLE__ */ @@ -55513,12 +55617,14 @@ L_AES_ECB_decrypt_loop_nr: #ifndef __APPLE__ .text .globl AES_CBC_decrypt +WC_ASM_ATT_HIDDEN(AES_CBC_decrypt) .type AES_CBC_decrypt,@function .align 2 AES_CBC_decrypt: #else .section __TEXT,__text .globl _AES_CBC_decrypt +WC_ASM_ATT_HIDDEN(_AES_CBC_decrypt) .p2align 2 _AES_CBC_decrypt: #endif /* __APPLE__ */ @@ -56138,12 +56244,14 @@ L_GCM_gmult_len_r: #ifndef __APPLE__ .text .globl GCM_gmult_len +WC_ASM_ATT_HIDDEN(GCM_gmult_len) .type GCM_gmult_len,@function .align 2 GCM_gmult_len: #else .section __TEXT,__text .globl _GCM_gmult_len +WC_ASM_ATT_HIDDEN(_GCM_gmult_len) .p2align 2 _GCM_gmult_len: #endif /* __APPLE__ */ @@ -56942,12 +57050,14 @@ L_GCM_gmult_len_start_block: #ifndef __APPLE__ .text .globl AES_GCM_encrypt +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt) .type AES_GCM_encrypt,@function .align 2 AES_GCM_encrypt: #else .section __TEXT,__text .globl _AES_GCM_encrypt +WC_ASM_ATT_HIDDEN(_AES_GCM_encrypt) .p2align 2 _AES_GCM_encrypt: #endif /* __APPLE__ */ @@ -57285,12 +57395,14 @@ L_AES_GCM_encrypt_loop_nr: #ifndef __APPLE__ .text .globl AES_XTS_encrypt +WC_ASM_ATT_HIDDEN(AES_XTS_encrypt) .type AES_XTS_encrypt,@function .align 2 AES_XTS_encrypt: #else .section __TEXT,__text .globl _AES_XTS_encrypt +WC_ASM_ATT_HIDDEN(_AES_XTS_encrypt) .p2align 2 _AES_XTS_encrypt: #endif /* __APPLE__ */ @@ -58240,12 +58352,14 @@ L_AES_XTS_encrypt_done_data: #ifndef __APPLE__ .text .globl AES_XTS_decrypt +WC_ASM_ATT_HIDDEN(AES_XTS_decrypt) .type AES_XTS_decrypt,@function .align 2 AES_XTS_decrypt: #else .section __TEXT,__text .globl _AES_XTS_decrypt +WC_ASM_ATT_HIDDEN(_AES_XTS_decrypt) .p2align 2 _AES_XTS_decrypt: #endif /* __APPLE__ */ @@ -59458,12 +59572,14 @@ L_AES_GCMSIV_polyval_base_r: #ifndef __APPLE__ .text .globl AES_GCMSIV_polyval_base +WC_ASM_ATT_HIDDEN(AES_GCMSIV_polyval_base) .type AES_GCMSIV_polyval_base,@function .align 2 AES_GCMSIV_polyval_base: #else .section __TEXT,__text .globl _AES_GCMSIV_polyval_base +WC_ASM_ATT_HIDDEN(_AES_GCMSIV_polyval_base) .p2align 2 _AES_GCMSIV_polyval_base: #endif /* __APPLE__ */ @@ -59923,12 +60039,14 @@ L_AES_GCMSIV_ctr_base_te: #ifndef __APPLE__ .text .globl AES_GCMSIV_ctr_base +WC_ASM_ATT_HIDDEN(AES_GCMSIV_ctr_base) .type AES_GCMSIV_ctr_base,@function .align 2 AES_GCMSIV_ctr_base: #else .section __TEXT,__text .globl _AES_GCMSIV_ctr_base +WC_ASM_ATT_HIDDEN(_AES_GCMSIV_ctr_base) .p2align 2 _AES_GCMSIV_ctr_base: #endif /* __APPLE__ */ diff --git a/wolfcrypt/src/port/arm/armv8-chacha-asm.S b/wolfcrypt/src/port/arm/armv8-chacha-asm.S index c04aa5a0824..f4296214e9b 100644 --- a/wolfcrypt/src/port/arm/armv8-chacha-asm.S +++ b/wolfcrypt/src/port/arm/armv8-chacha-asm.S @@ -69,12 +69,14 @@ L_chacha20_arm64_rol8: #ifndef __APPLE__ .text .globl wc_chacha_crypt_bytes +WC_ASM_ATT_HIDDEN(wc_chacha_crypt_bytes) .type wc_chacha_crypt_bytes,@function .align 2 wc_chacha_crypt_bytes: #else .section __TEXT,__text .globl _wc_chacha_crypt_bytes +WC_ASM_ATT_HIDDEN(_wc_chacha_crypt_bytes) .p2align 2 _wc_chacha_crypt_bytes: #endif /* __APPLE__ */ @@ -988,12 +990,14 @@ L_chacha_crypt_bytes_arm64_done_all: #ifndef __APPLE__ .text .globl wc_chacha_setiv +WC_ASM_ATT_HIDDEN(wc_chacha_setiv) .type wc_chacha_setiv,@function .align 2 wc_chacha_setiv: #else .section __TEXT,__text .globl _wc_chacha_setiv +WC_ASM_ATT_HIDDEN(_wc_chacha_setiv) .p2align 2 _wc_chacha_setiv: #endif /* __APPLE__ */ @@ -1026,12 +1030,14 @@ L_chacha_setkey_arm64_constant: #ifndef __APPLE__ .text .globl wc_chacha_setkey +WC_ASM_ATT_HIDDEN(wc_chacha_setkey) .type wc_chacha_setkey,@function .align 2 wc_chacha_setkey: #else .section __TEXT,__text .globl _wc_chacha_setkey +WC_ASM_ATT_HIDDEN(_wc_chacha_setkey) .p2align 2 _wc_chacha_setkey: #endif /* __APPLE__ */ @@ -1066,12 +1072,14 @@ L_chacha_setkey_arm64_done: #ifndef __APPLE__ .text .globl wc_chacha_use_over +WC_ASM_ATT_HIDDEN(wc_chacha_use_over) .type wc_chacha_use_over,@function .align 2 wc_chacha_use_over: #else .section __TEXT,__text .globl _wc_chacha_use_over +WC_ASM_ATT_HIDDEN(_wc_chacha_use_over) .p2align 2 _wc_chacha_use_over: #endif /* __APPLE__ */ diff --git a/wolfcrypt/src/port/arm/armv8-curve25519.S b/wolfcrypt/src/port/arm/armv8-curve25519.S index db3d6a07f2a..a4c7fbbd702 100644 --- a/wolfcrypt/src/port/arm/armv8-curve25519.S +++ b/wolfcrypt/src/port/arm/armv8-curve25519.S @@ -38,12 +38,14 @@ #ifndef __APPLE__ .text .globl fe_init +WC_ASM_ATT_HIDDEN(fe_init) .type fe_init,@function .align 2 fe_init: #else .section __TEXT,__text .globl _fe_init +WC_ASM_ATT_HIDDEN(_fe_init) .p2align 2 _fe_init: #endif /* __APPLE__ */ @@ -54,12 +56,14 @@ _fe_init: #ifndef __APPLE__ .text .globl fe_frombytes +WC_ASM_ATT_HIDDEN(fe_frombytes) .type fe_frombytes,@function .align 2 fe_frombytes: #else .section __TEXT,__text .globl _fe_frombytes +WC_ASM_ATT_HIDDEN(_fe_frombytes) .p2align 2 _fe_frombytes: #endif /* __APPLE__ */ @@ -75,12 +79,14 @@ _fe_frombytes: #ifndef __APPLE__ .text .globl fe_tobytes +WC_ASM_ATT_HIDDEN(fe_tobytes) .type fe_tobytes,@function .align 2 fe_tobytes: #else .section __TEXT,__text .globl _fe_tobytes +WC_ASM_ATT_HIDDEN(_fe_tobytes) .p2align 2 _fe_tobytes: #endif /* __APPLE__ */ @@ -106,12 +112,14 @@ _fe_tobytes: #ifndef __APPLE__ .text .globl fe_1 +WC_ASM_ATT_HIDDEN(fe_1) .type fe_1,@function .align 2 fe_1: #else .section __TEXT,__text .globl _fe_1 +WC_ASM_ATT_HIDDEN(_fe_1) .p2align 2 _fe_1: #endif /* __APPLE__ */ @@ -126,12 +134,14 @@ _fe_1: #ifndef __APPLE__ .text .globl fe_0 +WC_ASM_ATT_HIDDEN(fe_0) .type fe_0,@function .align 2 fe_0: #else .section __TEXT,__text .globl _fe_0 +WC_ASM_ATT_HIDDEN(_fe_0) .p2align 2 _fe_0: #endif /* __APPLE__ */ @@ -145,12 +155,14 @@ _fe_0: #ifndef __APPLE__ .text .globl fe_copy +WC_ASM_ATT_HIDDEN(fe_copy) .type fe_copy,@function .align 2 fe_copy: #else .section __TEXT,__text .globl _fe_copy +WC_ASM_ATT_HIDDEN(_fe_copy) .p2align 2 _fe_copy: #endif /* __APPLE__ */ @@ -166,12 +178,14 @@ _fe_copy: #ifndef __APPLE__ .text .globl fe_sub +WC_ASM_ATT_HIDDEN(fe_sub) .type fe_sub,@function .align 2 fe_sub: #else .section __TEXT,__text .globl _fe_sub +WC_ASM_ATT_HIDDEN(_fe_sub) .p2align 2 _fe_sub: #endif /* __APPLE__ */ @@ -204,12 +218,14 @@ _fe_sub: #ifndef __APPLE__ .text .globl fe_add +WC_ASM_ATT_HIDDEN(fe_add) .type fe_add,@function .align 2 fe_add: #else .section __TEXT,__text .globl _fe_add +WC_ASM_ATT_HIDDEN(_fe_add) .p2align 2 _fe_add: #endif /* __APPLE__ */ @@ -242,12 +258,14 @@ _fe_add: #ifndef __APPLE__ .text .globl fe_neg +WC_ASM_ATT_HIDDEN(fe_neg) .type fe_neg,@function .align 2 fe_neg: #else .section __TEXT,__text .globl _fe_neg +WC_ASM_ATT_HIDDEN(_fe_neg) .p2align 2 _fe_neg: #endif /* __APPLE__ */ @@ -270,12 +288,14 @@ _fe_neg: #ifndef __APPLE__ .text .globl fe_isnonzero +WC_ASM_ATT_HIDDEN(fe_isnonzero) .type fe_isnonzero,@function .align 2 fe_isnonzero: #else .section __TEXT,__text .globl _fe_isnonzero +WC_ASM_ATT_HIDDEN(_fe_isnonzero) .p2align 2 _fe_isnonzero: #endif /* __APPLE__ */ @@ -302,12 +322,14 @@ _fe_isnonzero: #ifndef __APPLE__ .text .globl fe_isnegative +WC_ASM_ATT_HIDDEN(fe_isnegative) .type fe_isnegative,@function .align 2 fe_isnegative: #else .section __TEXT,__text .globl _fe_isnegative +WC_ASM_ATT_HIDDEN(_fe_isnegative) .p2align 2 _fe_isnegative: #endif /* __APPLE__ */ @@ -327,12 +349,14 @@ _fe_isnegative: #ifndef __APPLE__ .text .globl fe_cmov_table +WC_ASM_ATT_HIDDEN(fe_cmov_table) .type fe_cmov_table,@function .align 2 fe_cmov_table: #else .section __TEXT,__text .globl _fe_cmov_table +WC_ASM_ATT_HIDDEN(_fe_cmov_table) .p2align 2 _fe_cmov_table: #endif /* __APPLE__ */ @@ -560,12 +584,14 @@ _fe_cmov_table: #ifndef __APPLE__ .text .globl fe_invert_nct +WC_ASM_ATT_HIDDEN(fe_invert_nct) .type fe_invert_nct,@function .align 2 fe_invert_nct: #else .section __TEXT,__text .globl _fe_invert_nct +WC_ASM_ATT_HIDDEN(_fe_invert_nct) .p2align 2 _fe_invert_nct: #endif /* __APPLE__ */ @@ -807,12 +833,14 @@ L_fe_invert_nct_done: #ifndef __APPLE__ .text .globl fe_mul +WC_ASM_ATT_HIDDEN(fe_mul) .type fe_mul,@function .align 2 fe_mul: #else .section __TEXT,__text .globl _fe_mul +WC_ASM_ATT_HIDDEN(_fe_mul) .p2align 2 _fe_mul: #endif /* __APPLE__ */ @@ -958,12 +986,14 @@ _fe_mul: #ifndef __APPLE__ .text .globl fe_sq +WC_ASM_ATT_HIDDEN(fe_sq) .type fe_sq,@function .align 2 fe_sq: #else .section __TEXT,__text .globl _fe_sq +WC_ASM_ATT_HIDDEN(_fe_sq) .p2align 2 _fe_sq: #endif /* __APPLE__ */ @@ -1067,12 +1097,14 @@ _fe_sq: #ifndef __APPLE__ .text .globl fe_invert +WC_ASM_ATT_HIDDEN(fe_invert) .type fe_invert,@function .align 2 fe_invert: #else .section __TEXT,__text .globl _fe_invert +WC_ASM_ATT_HIDDEN(_fe_invert) .p2align 2 _fe_invert: #endif /* __APPLE__ */ @@ -1963,12 +1995,14 @@ L_curve25519_base_x2: #ifndef __APPLE__ .text .globl curve25519_base +WC_ASM_ATT_HIDDEN(curve25519_base) .type curve25519_base,@function .align 2 curve25519_base: #else .section __TEXT,__text .globl _curve25519_base +WC_ASM_ATT_HIDDEN(_curve25519_base) .p2align 2 _curve25519_base: #endif /* __APPLE__ */ @@ -4497,12 +4531,14 @@ L_curve25519_base_inv_8: #ifndef __APPLE__ .text .globl curve25519 +WC_ASM_ATT_HIDDEN(curve25519) .type curve25519,@function .align 2 curve25519: #else .section __TEXT,__text .globl _curve25519 +WC_ASM_ATT_HIDDEN(_curve25519) .p2align 2 _curve25519: #endif /* __APPLE__ */ @@ -7117,12 +7153,14 @@ L_curve25519_inv_8: #ifndef __APPLE__ .text .globl fe_pow22523 +WC_ASM_ATT_HIDDEN(fe_pow22523) .type fe_pow22523,@function .align 2 fe_pow22523: #else .section __TEXT,__text .globl _fe_pow22523 +WC_ASM_ATT_HIDDEN(_fe_pow22523) .p2align 2 _fe_pow22523: #endif /* __APPLE__ */ @@ -7927,12 +7965,14 @@ L_fe_pow22523_7: #ifndef __APPLE__ .text .globl ge_p1p1_to_p2 +WC_ASM_ATT_HIDDEN(ge_p1p1_to_p2) .type ge_p1p1_to_p2,@function .align 2 ge_p1p1_to_p2: #else .section __TEXT,__text .globl _ge_p1p1_to_p2 +WC_ASM_ATT_HIDDEN(_ge_p1p1_to_p2) .p2align 2 _ge_p1p1_to_p2: #endif /* __APPLE__ */ @@ -8310,12 +8350,14 @@ _ge_p1p1_to_p2: #ifndef __APPLE__ .text .globl ge_p1p1_to_p3 +WC_ASM_ATT_HIDDEN(ge_p1p1_to_p3) .type ge_p1p1_to_p3,@function .align 2 ge_p1p1_to_p3: #else .section __TEXT,__text .globl _ge_p1p1_to_p3 +WC_ASM_ATT_HIDDEN(_ge_p1p1_to_p3) .p2align 2 _ge_p1p1_to_p3: #endif /* __APPLE__ */ @@ -8813,12 +8855,14 @@ _ge_p1p1_to_p3: #ifndef __APPLE__ .text .globl ge_p2_dbl +WC_ASM_ATT_HIDDEN(ge_p2_dbl) .type ge_p2_dbl,@function .align 2 ge_p2_dbl: #else .section __TEXT,__text .globl _ge_p2_dbl +WC_ASM_ATT_HIDDEN(_ge_p2_dbl) .p2align 2 _ge_p2_dbl: #endif /* __APPLE__ */ @@ -9293,12 +9337,14 @@ _ge_p2_dbl: #ifndef __APPLE__ .text .globl ge_madd +WC_ASM_ATT_HIDDEN(ge_madd) .type ge_madd,@function .align 2 ge_madd: #else .section __TEXT,__text .globl _ge_madd +WC_ASM_ATT_HIDDEN(_ge_madd) .p2align 2 _ge_madd: #endif /* __APPLE__ */ @@ -9808,12 +9854,14 @@ _ge_madd: #ifndef __APPLE__ .text .globl ge_msub +WC_ASM_ATT_HIDDEN(ge_msub) .type ge_msub,@function .align 2 ge_msub: #else .section __TEXT,__text .globl _ge_msub +WC_ASM_ATT_HIDDEN(_ge_msub) .p2align 2 _ge_msub: #endif /* __APPLE__ */ @@ -10323,12 +10371,14 @@ _ge_msub: #ifndef __APPLE__ .text .globl ge_add +WC_ASM_ATT_HIDDEN(ge_add) .type ge_add,@function .align 2 ge_add: #else .section __TEXT,__text .globl _ge_add +WC_ASM_ATT_HIDDEN(_ge_add) .p2align 2 _ge_add: #endif /* __APPLE__ */ @@ -10964,12 +11014,14 @@ _ge_add: #ifndef __APPLE__ .text .globl ge_sub +WC_ASM_ATT_HIDDEN(ge_sub) .type ge_sub,@function .align 2 ge_sub: #else .section __TEXT,__text .globl _ge_sub +WC_ASM_ATT_HIDDEN(_ge_sub) .p2align 2 _ge_sub: #endif /* __APPLE__ */ @@ -11621,12 +11673,14 @@ _ge_sub: #ifndef __APPLE__ .text .globl sc_reduce +WC_ASM_ATT_HIDDEN(sc_reduce) .type sc_reduce,@function .align 2 sc_reduce: #else .section __TEXT,__text .globl _sc_reduce +WC_ASM_ATT_HIDDEN(_sc_reduce) .p2align 2 _sc_reduce: #endif /* __APPLE__ */ @@ -11820,12 +11874,14 @@ _sc_reduce: #ifndef __APPLE__ .text .globl sc_muladd +WC_ASM_ATT_HIDDEN(sc_muladd) .type sc_muladd,@function .align 2 sc_muladd: #else .section __TEXT,__text .globl _sc_muladd +WC_ASM_ATT_HIDDEN(_sc_muladd) .p2align 2 _sc_muladd: #endif /* __APPLE__ */ diff --git a/wolfcrypt/src/port/arm/armv8-frodokem-asm.S b/wolfcrypt/src/port/arm/armv8-frodokem-asm.S index 7059e7246ae..1e5188193fe 100644 --- a/wolfcrypt/src/port/arm/armv8-frodokem-asm.S +++ b/wolfcrypt/src/port/arm/armv8-frodokem-asm.S @@ -63,12 +63,14 @@ L_sha3_aarch64_r: #ifndef __APPLE__ .text .globl frodokem_sha3_x2_neon +WC_ASM_ATT_HIDDEN(frodokem_sha3_x2_neon) .type frodokem_sha3_x2_neon,@function .align 2 frodokem_sha3_x2_neon: #else .section __TEXT,__text .globl _frodokem_sha3_x2_neon +WC_ASM_ATT_HIDDEN(_frodokem_sha3_x2_neon) .p2align 2 _frodokem_sha3_x2_neon: #endif /* __APPLE__ */ @@ -300,12 +302,14 @@ L_frodokem_sha3_x2_neon_begin: #ifndef __APPLE__ .text .globl frodokem_sha3_x2_crypto +WC_ASM_ATT_HIDDEN(frodokem_sha3_x2_crypto) .type frodokem_sha3_x2_crypto,@function .align 2 frodokem_sha3_x2_crypto: #else .section __TEXT,__text .globl _frodokem_sha3_x2_crypto +WC_ASM_ATT_HIDDEN(_frodokem_sha3_x2_crypto) .p2align 2 _frodokem_sha3_x2_crypto: #endif /* __APPLE__ */ @@ -455,12 +459,14 @@ L_frodokem_sha3_x2_crypto_begin: #ifndef __APPLE__ .text .globl frodokem_add_neon +WC_ASM_ATT_HIDDEN(frodokem_add_neon) .type frodokem_add_neon,@function .align 2 frodokem_add_neon: #else .section __TEXT,__text .globl _frodokem_add_neon +WC_ASM_ATT_HIDDEN(_frodokem_add_neon) .p2align 2 _frodokem_add_neon: #endif /* __APPLE__ */ @@ -506,12 +512,14 @@ _frodokem_add_neon: #ifndef __APPLE__ .text .globl frodokem_sample_neon +WC_ASM_ATT_HIDDEN(frodokem_sample_neon) .type frodokem_sample_neon,@function .align 2 frodokem_sample_neon: #else .section __TEXT,__text .globl _frodokem_sample_neon +WC_ASM_ATT_HIDDEN(_frodokem_sample_neon) .p2align 2 _frodokem_sample_neon: #endif /* __APPLE__ */ @@ -593,12 +601,14 @@ L_frodokem_sample_neon_done: #ifndef __APPLE__ .text .globl frodokem_sa_accum_neon +WC_ASM_ATT_HIDDEN(frodokem_sa_accum_neon) .type frodokem_sa_accum_neon,@function .align 2 frodokem_sa_accum_neon: #else .section __TEXT,__text .globl _frodokem_sa_accum_neon +WC_ASM_ATT_HIDDEN(_frodokem_sa_accum_neon) .p2align 2 _frodokem_sa_accum_neon: #endif /* __APPLE__ */ @@ -680,12 +690,14 @@ L_frodokem_sa_accum_neon_k: #ifndef __APPLE__ .text .globl frodokem_sa_accum_x4_neon +WC_ASM_ATT_HIDDEN(frodokem_sa_accum_x4_neon) .type frodokem_sa_accum_x4_neon,@function .align 2 frodokem_sa_accum_x4_neon: #else .section __TEXT,__text .globl _frodokem_sa_accum_x4_neon +WC_ASM_ATT_HIDDEN(_frodokem_sa_accum_x4_neon) .p2align 2 _frodokem_sa_accum_x4_neon: #endif /* __APPLE__ */ @@ -799,12 +811,14 @@ L_frodokem_sa_accum_x4_neon_k: #ifndef __APPLE__ .text .globl frodokem_as_accum_neon +WC_ASM_ATT_HIDDEN(frodokem_as_accum_neon) .type frodokem_as_accum_neon,@function .align 2 frodokem_as_accum_neon: #else .section __TEXT,__text .globl _frodokem_as_accum_neon +WC_ASM_ATT_HIDDEN(_frodokem_as_accum_neon) .p2align 2 _frodokem_as_accum_neon: #endif /* __APPLE__ */ @@ -942,12 +956,14 @@ L_frodokem_as_accum_neon_k1: #ifndef __APPLE__ .text .globl frodokem_as_accum_x4_neon +WC_ASM_ATT_HIDDEN(frodokem_as_accum_x4_neon) .type frodokem_as_accum_x4_neon,@function .align 2 frodokem_as_accum_x4_neon: #else .section __TEXT,__text .globl _frodokem_as_accum_x4_neon +WC_ASM_ATT_HIDDEN(_frodokem_as_accum_x4_neon) .p2align 2 _frodokem_as_accum_x4_neon: #endif /* __APPLE__ */ @@ -1175,12 +1191,14 @@ L_frodokem_as_accum_x4_neon_k1: #ifndef __APPLE__ .text .globl frodokem_mul_bs_neon +WC_ASM_ATT_HIDDEN(frodokem_mul_bs_neon) .type frodokem_mul_bs_neon,@function .align 2 frodokem_mul_bs_neon: #else .section __TEXT,__text .globl _frodokem_mul_bs_neon +WC_ASM_ATT_HIDDEN(_frodokem_mul_bs_neon) .p2align 2 _frodokem_mul_bs_neon: #endif /* __APPLE__ */ @@ -1413,12 +1431,14 @@ L_frodokem_mul_bs_neon_k1: #ifndef __APPLE__ .text .globl frodokem_mul_add_sb_plus_e_neon +WC_ASM_ATT_HIDDEN(frodokem_mul_add_sb_plus_e_neon) .type frodokem_mul_add_sb_plus_e_neon,@function .align 2 frodokem_mul_add_sb_plus_e_neon: #else .section __TEXT,__text .globl _frodokem_mul_add_sb_plus_e_neon +WC_ASM_ATT_HIDDEN(_frodokem_mul_add_sb_plus_e_neon) .p2align 2 _frodokem_mul_add_sb_plus_e_neon: #endif /* __APPLE__ */ @@ -1486,12 +1506,14 @@ L_frodokem_mul_add_sb_plus_e_neon_j: #ifndef __APPLE__ .text .globl frodokem_gen_a_rows_aes_arm64 +WC_ASM_ATT_HIDDEN(frodokem_gen_a_rows_aes_arm64) .type frodokem_gen_a_rows_aes_arm64,@function .align 2 frodokem_gen_a_rows_aes_arm64: #else .section __TEXT,__text .globl _frodokem_gen_a_rows_aes_arm64 +WC_ASM_ATT_HIDDEN(_frodokem_gen_a_rows_aes_arm64) .p2align 2 _frodokem_gen_a_rows_aes_arm64: #endif /* __APPLE__ */ @@ -1810,12 +1832,14 @@ L_frodokem_gen_a_rows_aes_arm64_done: #ifndef __APPLE__ .text .globl frodokem_sa_accum_sve +WC_ASM_ATT_HIDDEN(frodokem_sa_accum_sve) .type frodokem_sa_accum_sve,@function .align 2 frodokem_sa_accum_sve: #else .section __TEXT,__text .globl _frodokem_sa_accum_sve +WC_ASM_ATT_HIDDEN(_frodokem_sa_accum_sve) .p2align 2 _frodokem_sa_accum_sve: #endif /* __APPLE__ */ @@ -1854,12 +1878,14 @@ L_frodokem_sa_accum_sve_k: #ifndef __APPLE__ .text .globl frodokem_as_accum_sve +WC_ASM_ATT_HIDDEN(frodokem_as_accum_sve) .type frodokem_as_accum_sve,@function .align 2 frodokem_as_accum_sve: #else .section __TEXT,__text .globl _frodokem_as_accum_sve +WC_ASM_ATT_HIDDEN(_frodokem_as_accum_sve) .p2align 2 _frodokem_as_accum_sve: #endif /* __APPLE__ */ @@ -2044,12 +2070,14 @@ L_frodokem_as_accum_sve_k: #ifndef __APPLE__ .text .globl frodokem_mul_bs_sve +WC_ASM_ATT_HIDDEN(frodokem_mul_bs_sve) .type frodokem_mul_bs_sve,@function .align 2 frodokem_mul_bs_sve: #else .section __TEXT,__text .globl _frodokem_mul_bs_sve +WC_ASM_ATT_HIDDEN(_frodokem_mul_bs_sve) .p2align 2 _frodokem_mul_bs_sve: #endif /* __APPLE__ */ @@ -2160,12 +2188,14 @@ L_frodokem_mul_bs_sve_k: #ifndef __APPLE__ .text .globl frodokem_add_sve +WC_ASM_ATT_HIDDEN(frodokem_add_sve) .type frodokem_add_sve,@function .align 2 frodokem_add_sve: #else .section __TEXT,__text .globl _frodokem_add_sve +WC_ASM_ATT_HIDDEN(_frodokem_add_sve) .p2align 2 _frodokem_add_sve: #endif /* __APPLE__ */ @@ -2194,12 +2224,14 @@ L_frodokem_add_sve_k: #ifndef __APPLE__ .text .globl frodokem_mul_bs_sme +WC_ASM_ATT_HIDDEN(frodokem_mul_bs_sme) .type frodokem_mul_bs_sme,@function .align 2 frodokem_mul_bs_sme: #else .section __TEXT,__text .globl _frodokem_mul_bs_sme +WC_ASM_ATT_HIDDEN(_frodokem_mul_bs_sme) .p2align 2 _frodokem_mul_bs_sme: #endif /* __APPLE__ */ @@ -2239,12 +2271,14 @@ L_frodokem_mul_bs_sme_e: #ifndef __APPLE__ .text .globl frodokem_sa_accum_sme +WC_ASM_ATT_HIDDEN(frodokem_sa_accum_sme) .type frodokem_sa_accum_sme,@function .align 2 frodokem_sa_accum_sme: #else .section __TEXT,__text .globl _frodokem_sa_accum_sme +WC_ASM_ATT_HIDDEN(_frodokem_sa_accum_sme) .p2align 2 _frodokem_sa_accum_sme: #endif /* __APPLE__ */ @@ -2292,12 +2326,14 @@ L_frodokem_sa_accum_sme_e: #ifndef __APPLE__ .text .globl frodokem_as_accum_sme +WC_ASM_ATT_HIDDEN(frodokem_as_accum_sme) .type frodokem_as_accum_sme,@function .align 2 frodokem_as_accum_sme: #else .section __TEXT,__text .globl _frodokem_as_accum_sme +WC_ASM_ATT_HIDDEN(_frodokem_as_accum_sme) .p2align 2 _frodokem_as_accum_sme: #endif /* __APPLE__ */ diff --git a/wolfcrypt/src/port/arm/armv8-mlkem-asm.S b/wolfcrypt/src/port/arm/armv8-mlkem-asm.S index 1ba8ba092f3..31eda1e0ca2 100644 --- a/wolfcrypt/src/port/arm/armv8-mlkem-asm.S +++ b/wolfcrypt/src/port/arm/armv8-mlkem-asm.S @@ -155,12 +155,14 @@ L_mlkem_aarch64_zetas_qinv: #ifndef __APPLE__ .text .globl mlkem_ntt +WC_ASM_ATT_HIDDEN(mlkem_ntt) .type mlkem_ntt,@function .align 2 mlkem_ntt: #else .section __TEXT,__text .globl _mlkem_ntt +WC_ASM_ATT_HIDDEN(_mlkem_ntt) .p2align 2 _mlkem_ntt: #endif /* __APPLE__ */ @@ -1551,12 +1553,14 @@ L_mlkem_aarch64_zetas_inv_qinv: #ifndef __APPLE__ .text .globl mlkem_invntt +WC_ASM_ATT_HIDDEN(mlkem_invntt) .type mlkem_invntt,@function .align 2 mlkem_invntt: #else .section __TEXT,__text .globl _mlkem_invntt +WC_ASM_ATT_HIDDEN(_mlkem_invntt) .p2align 2 _mlkem_invntt: #endif /* __APPLE__ */ @@ -3002,12 +3006,14 @@ _mlkem_invntt: #ifndef __APPLE__ .text .globl mlkem_ntt_sqrdmlsh +WC_ASM_ATT_HIDDEN(mlkem_ntt_sqrdmlsh) .type mlkem_ntt_sqrdmlsh,@function .align 2 mlkem_ntt_sqrdmlsh: #else .section __TEXT,__text .globl _mlkem_ntt_sqrdmlsh +WC_ASM_ATT_HIDDEN(_mlkem_ntt_sqrdmlsh) .p2align 2 _mlkem_ntt_sqrdmlsh: #endif /* __APPLE__ */ @@ -4184,12 +4190,14 @@ _mlkem_ntt_sqrdmlsh: #ifndef __APPLE__ .text .globl mlkem_invntt_sqrdmlsh +WC_ASM_ATT_HIDDEN(mlkem_invntt_sqrdmlsh) .type mlkem_invntt_sqrdmlsh,@function .align 2 mlkem_invntt_sqrdmlsh: #else .section __TEXT,__text .globl _mlkem_invntt_sqrdmlsh +WC_ASM_ATT_HIDDEN(_mlkem_invntt_sqrdmlsh) .p2align 2 _mlkem_invntt_sqrdmlsh: #endif /* __APPLE__ */ @@ -5522,12 +5530,14 @@ L_mlkem_aarch64_zetas_mul: #ifndef __APPLE__ .text .globl mlkem_basemul_mont +WC_ASM_ATT_HIDDEN(mlkem_basemul_mont) .type mlkem_basemul_mont,@function .align 2 mlkem_basemul_mont: #else .section __TEXT,__text .globl _mlkem_basemul_mont +WC_ASM_ATT_HIDDEN(_mlkem_basemul_mont) .p2align 2 _mlkem_basemul_mont: #endif /* __APPLE__ */ @@ -6220,12 +6230,14 @@ _mlkem_basemul_mont: #ifndef __APPLE__ .text .globl mlkem_basemul_mont_add +WC_ASM_ATT_HIDDEN(mlkem_basemul_mont_add) .type mlkem_basemul_mont_add,@function .align 2 mlkem_basemul_mont_add: #else .section __TEXT,__text .globl _mlkem_basemul_mont_add +WC_ASM_ATT_HIDDEN(_mlkem_basemul_mont_add) .p2align 2 _mlkem_basemul_mont_add: #endif /* __APPLE__ */ @@ -6982,12 +6994,14 @@ L_mlkem_aarch64_q: #ifndef __APPLE__ .text .globl mlkem_csubq_neon +WC_ASM_ATT_HIDDEN(mlkem_csubq_neon) .type mlkem_csubq_neon,@function .align 2 mlkem_csubq_neon: #else .section __TEXT,__text .globl _mlkem_csubq_neon +WC_ASM_ATT_HIDDEN(_mlkem_csubq_neon) .p2align 2 _mlkem_csubq_neon: #endif /* __APPLE__ */ @@ -7163,12 +7177,14 @@ _mlkem_csubq_neon: #ifndef __APPLE__ .text .globl mlkem_add_reduce +WC_ASM_ATT_HIDDEN(mlkem_add_reduce) .type mlkem_add_reduce,@function .align 2 mlkem_add_reduce: #else .section __TEXT,__text .globl _mlkem_add_reduce +WC_ASM_ATT_HIDDEN(_mlkem_add_reduce) .p2align 2 _mlkem_add_reduce: #endif /* __APPLE__ */ @@ -7354,12 +7370,14 @@ _mlkem_add_reduce: #ifndef __APPLE__ .text .globl mlkem_add3_reduce +WC_ASM_ATT_HIDDEN(mlkem_add3_reduce) .type mlkem_add3_reduce,@function .align 2 mlkem_add3_reduce: #else .section __TEXT,__text .globl _mlkem_add3_reduce +WC_ASM_ATT_HIDDEN(_mlkem_add3_reduce) .p2align 2 _mlkem_add3_reduce: #endif /* __APPLE__ */ @@ -7585,12 +7603,14 @@ _mlkem_add3_reduce: #ifndef __APPLE__ .text .globl mlkem_rsub_reduce +WC_ASM_ATT_HIDDEN(mlkem_rsub_reduce) .type mlkem_rsub_reduce,@function .align 2 mlkem_rsub_reduce: #else .section __TEXT,__text .globl _mlkem_rsub_reduce +WC_ASM_ATT_HIDDEN(_mlkem_rsub_reduce) .p2align 2 _mlkem_rsub_reduce: #endif /* __APPLE__ */ @@ -7776,12 +7796,14 @@ _mlkem_rsub_reduce: #ifndef __APPLE__ .text .globl mlkem_to_mont +WC_ASM_ATT_HIDDEN(mlkem_to_mont) .type mlkem_to_mont,@function .align 2 mlkem_to_mont: #else .section __TEXT,__text .globl _mlkem_to_mont +WC_ASM_ATT_HIDDEN(_mlkem_to_mont) .p2align 2 _mlkem_to_mont: #endif /* __APPLE__ */ @@ -7990,12 +8012,14 @@ _mlkem_to_mont: #ifndef __APPLE__ .text .globl mlkem_to_mont_sqrdmlsh +WC_ASM_ATT_HIDDEN(mlkem_to_mont_sqrdmlsh) .type mlkem_to_mont_sqrdmlsh,@function .align 2 mlkem_to_mont_sqrdmlsh: #else .section __TEXT,__text .globl _mlkem_to_mont_sqrdmlsh +WC_ASM_ATT_HIDDEN(_mlkem_to_mont_sqrdmlsh) .p2align 2 _mlkem_to_mont_sqrdmlsh: #endif /* __APPLE__ */ @@ -8220,12 +8244,14 @@ L_mlkem_to_msg_bits: #ifndef __APPLE__ .text .globl mlkem_to_msg_neon +WC_ASM_ATT_HIDDEN(mlkem_to_msg_neon) .type mlkem_to_msg_neon,@function .align 2 mlkem_to_msg_neon: #else .section __TEXT,__text .globl _mlkem_to_msg_neon +WC_ASM_ATT_HIDDEN(_mlkem_to_msg_neon) .p2align 2 _mlkem_to_msg_neon: #endif /* __APPLE__ */ @@ -8504,12 +8530,14 @@ L_mlkem_from_msg_bits: #ifndef __APPLE__ .text .globl mlkem_from_msg_neon +WC_ASM_ATT_HIDDEN(mlkem_from_msg_neon) .type mlkem_from_msg_neon,@function .align 2 mlkem_from_msg_neon: #else .section __TEXT,__text .globl _mlkem_from_msg_neon +WC_ASM_ATT_HIDDEN(_mlkem_from_msg_neon) .p2align 2 _mlkem_from_msg_neon: #endif /* __APPLE__ */ @@ -8680,12 +8708,14 @@ _mlkem_from_msg_neon: #ifndef __APPLE__ .text .globl mlkem_cmp_neon +WC_ASM_ATT_HIDDEN(mlkem_cmp_neon) .type mlkem_cmp_neon,@function .align 2 mlkem_cmp_neon: #else .section __TEXT,__text .globl _mlkem_cmp_neon +WC_ASM_ATT_HIDDEN(_mlkem_cmp_neon) .p2align 2 _mlkem_cmp_neon: #endif /* __APPLE__ */ @@ -9517,12 +9547,14 @@ L_mlkem_rej_uniform_indices: #ifndef __APPLE__ .text .globl mlkem_rej_uniform_neon +WC_ASM_ATT_HIDDEN(mlkem_rej_uniform_neon) .type mlkem_rej_uniform_neon,@function .align 2 mlkem_rej_uniform_neon: #else .section __TEXT,__text .globl _mlkem_rej_uniform_neon +WC_ASM_ATT_HIDDEN(_mlkem_rej_uniform_neon) .p2align 2 _mlkem_rej_uniform_neon: #endif /* __APPLE__ */ @@ -9736,12 +9768,14 @@ L_sha3_aarch64_r: #ifndef __APPLE__ .text .globl mlkem_sha3_blocksx3_neon +WC_ASM_ATT_HIDDEN(mlkem_sha3_blocksx3_neon) .type mlkem_sha3_blocksx3_neon,@function .align 2 mlkem_sha3_blocksx3_neon: #else .section __TEXT,__text .globl _mlkem_sha3_blocksx3_neon +WC_ASM_ATT_HIDDEN(_mlkem_sha3_blocksx3_neon) .p2align 2 _mlkem_sha3_blocksx3_neon: #endif /* __APPLE__ */ @@ -10061,12 +10095,14 @@ L_SHA3_transform_blocksx3_neon_begin: #ifndef __APPLE__ .text .globl mlkem_shake128_blocksx3_seed_neon +WC_ASM_ATT_HIDDEN(mlkem_shake128_blocksx3_seed_neon) .type mlkem_shake128_blocksx3_seed_neon,@function .align 2 mlkem_shake128_blocksx3_seed_neon: #else .section __TEXT,__text .globl _mlkem_shake128_blocksx3_seed_neon +WC_ASM_ATT_HIDDEN(_mlkem_shake128_blocksx3_seed_neon) .p2align 2 _mlkem_shake128_blocksx3_seed_neon: #endif /* __APPLE__ */ @@ -10408,12 +10444,14 @@ L_SHA3_shake128_blocksx3_seed_neon_begin: #ifndef __APPLE__ .text .globl mlkem_shake256_blocksx3_seed_neon +WC_ASM_ATT_HIDDEN(mlkem_shake256_blocksx3_seed_neon) .type mlkem_shake256_blocksx3_seed_neon,@function .align 2 mlkem_shake256_blocksx3_seed_neon: #else .section __TEXT,__text .globl _mlkem_shake256_blocksx3_seed_neon +WC_ASM_ATT_HIDDEN(_mlkem_shake256_blocksx3_seed_neon) .p2align 2 _mlkem_shake256_blocksx3_seed_neon: #endif /* __APPLE__ */ @@ -10756,12 +10794,14 @@ L_SHA3_shake256_blocksx3_seed_neon_begin: #ifndef __APPLE__ .text .globl mlkem_sha3_blocksx3_neon +WC_ASM_ATT_HIDDEN(mlkem_sha3_blocksx3_neon) .type mlkem_sha3_blocksx3_neon,@function .align 2 mlkem_sha3_blocksx3_neon: #else .section __TEXT,__text .globl _mlkem_sha3_blocksx3_neon +WC_ASM_ATT_HIDDEN(_mlkem_sha3_blocksx3_neon) .p2align 2 _mlkem_sha3_blocksx3_neon: #endif /* __APPLE__ */ @@ -11166,12 +11206,14 @@ L_SHA3_transform_blocksx3_neon_begin: #ifndef __APPLE__ .text .globl mlkem_shake128_blocksx3_seed_neon +WC_ASM_ATT_HIDDEN(mlkem_shake128_blocksx3_seed_neon) .type mlkem_shake128_blocksx3_seed_neon,@function .align 2 mlkem_shake128_blocksx3_seed_neon: #else .section __TEXT,__text .globl _mlkem_shake128_blocksx3_seed_neon +WC_ASM_ATT_HIDDEN(_mlkem_shake128_blocksx3_seed_neon) .p2align 2 _mlkem_shake128_blocksx3_seed_neon: #endif /* __APPLE__ */ @@ -11598,12 +11640,14 @@ L_SHA3_shake128_blocksx3_seed_neon_begin: #ifndef __APPLE__ .text .globl mlkem_shake256_blocksx3_seed_neon +WC_ASM_ATT_HIDDEN(mlkem_shake256_blocksx3_seed_neon) .type mlkem_shake256_blocksx3_seed_neon,@function .align 2 mlkem_shake256_blocksx3_seed_neon: #else .section __TEXT,__text .globl _mlkem_shake256_blocksx3_seed_neon +WC_ASM_ATT_HIDDEN(_mlkem_shake256_blocksx3_seed_neon) .p2align 2 _mlkem_shake256_blocksx3_seed_neon: #endif /* __APPLE__ */ diff --git a/wolfcrypt/src/port/arm/armv8-poly1305-asm.S b/wolfcrypt/src/port/arm/armv8-poly1305-asm.S index 0793e16f660..d160f1cd182 100644 --- a/wolfcrypt/src/port/arm/armv8-poly1305-asm.S +++ b/wolfcrypt/src/port/arm/armv8-poly1305-asm.S @@ -35,12 +35,14 @@ #ifndef __APPLE__ .text .globl poly1305_arm64_block_16 +WC_ASM_ATT_HIDDEN(poly1305_arm64_block_16) .type poly1305_arm64_block_16,@function .align 2 poly1305_arm64_block_16: #else .section __TEXT,__text .globl _poly1305_arm64_block_16 +WC_ASM_ATT_HIDDEN(_poly1305_arm64_block_16) .p2align 2 _poly1305_arm64_block_16: #endif /* __APPLE__ */ @@ -120,12 +122,14 @@ _poly1305_arm64_block_16: #ifndef __APPLE__ .text .globl poly1305_arm64_blocks +WC_ASM_ATT_HIDDEN(poly1305_arm64_blocks) .type poly1305_arm64_blocks,@function .align 2 poly1305_arm64_blocks: #else .section __TEXT,__text .globl _poly1305_arm64_blocks +WC_ASM_ATT_HIDDEN(_poly1305_arm64_blocks) .p2align 2 _poly1305_arm64_blocks: #endif /* __APPLE__ */ @@ -458,12 +462,14 @@ L_poly1305_set_key_arm64_clamp: #ifndef __APPLE__ .text .globl poly1305_set_key +WC_ASM_ATT_HIDDEN(poly1305_set_key) .type poly1305_set_key,@function .align 2 poly1305_set_key: #else .section __TEXT,__text .globl _poly1305_set_key +WC_ASM_ATT_HIDDEN(_poly1305_set_key) .p2align 2 _poly1305_set_key: #endif /* __APPLE__ */ @@ -656,12 +662,14 @@ _poly1305_set_key: #ifndef __APPLE__ .text .globl poly1305_final +WC_ASM_ATT_HIDDEN(poly1305_final) .type poly1305_final,@function .align 2 poly1305_final: #else .section __TEXT,__text .globl _poly1305_final +WC_ASM_ATT_HIDDEN(_poly1305_final) .p2align 2 _poly1305_final: #endif /* __APPLE__ */ diff --git a/wolfcrypt/src/port/arm/armv8-sha256-asm.S b/wolfcrypt/src/port/arm/armv8-sha256-asm.S index 7efe1b5d222..f8c26311b57 100644 --- a/wolfcrypt/src/port/arm/armv8-sha256-asm.S +++ b/wolfcrypt/src/port/arm/armv8-sha256-asm.S @@ -68,12 +68,14 @@ L_SHA256_transform_neon_len_k: #ifndef __APPLE__ .text .globl Transform_Sha256_Len_neon +WC_ASM_ATT_HIDDEN(Transform_Sha256_Len_neon) .type Transform_Sha256_Len_neon,@function .align 2 Transform_Sha256_Len_neon: #else .section __TEXT,__text .globl _Transform_Sha256_Len_neon +WC_ASM_ATT_HIDDEN(_Transform_Sha256_Len_neon) .p2align 2 _Transform_Sha256_Len_neon: #endif /* __APPLE__ */ @@ -1090,12 +1092,14 @@ L_SHA256_trans_crypto_len_k: #ifndef __APPLE__ .text .globl Transform_Sha256_Len_crypto +WC_ASM_ATT_HIDDEN(Transform_Sha256_Len_crypto) .type Transform_Sha256_Len_crypto,@function .align 2 Transform_Sha256_Len_crypto: #else .section __TEXT,__text .globl _Transform_Sha256_Len_crypto +WC_ASM_ATT_HIDDEN(_Transform_Sha256_Len_crypto) .p2align 2 _Transform_Sha256_Len_crypto: #endif /* __APPLE__ */ diff --git a/wolfcrypt/src/port/arm/armv8-sha3-asm.S b/wolfcrypt/src/port/arm/armv8-sha3-asm.S index 413ed9a5aee..c9ad4a5f333 100644 --- a/wolfcrypt/src/port/arm/armv8-sha3-asm.S +++ b/wolfcrypt/src/port/arm/armv8-sha3-asm.S @@ -65,12 +65,14 @@ L_SHA3_transform_crypto_r: #ifndef __APPLE__ .text .globl BlockSha3_crypto +WC_ASM_ATT_HIDDEN(BlockSha3_crypto) .type BlockSha3_crypto,@function .align 2 BlockSha3_crypto: #else .section __TEXT,__text .globl _BlockSha3_crypto +WC_ASM_ATT_HIDDEN(_BlockSha3_crypto) .p2align 2 _BlockSha3_crypto: #endif /* __APPLE__ */ @@ -228,12 +230,14 @@ L_SHA3_transform_base_r: #ifndef __APPLE__ .text .globl BlockSha3_base +WC_ASM_ATT_HIDDEN(BlockSha3_base) .type BlockSha3_base,@function .align 2 BlockSha3_base: #else .section __TEXT,__text .globl _BlockSha3_base +WC_ASM_ATT_HIDDEN(_BlockSha3_base) .p2align 2 _BlockSha3_base: #endif /* __APPLE__ */ diff --git a/wolfcrypt/src/port/arm/armv8-sha512-asm.S b/wolfcrypt/src/port/arm/armv8-sha512-asm.S index b14aa1198fb..2e894827c84 100644 --- a/wolfcrypt/src/port/arm/armv8-sha512-asm.S +++ b/wolfcrypt/src/port/arm/armv8-sha512-asm.S @@ -109,12 +109,14 @@ L_SHA512_transform_neon_len_r8: #ifndef __APPLE__ .text .globl Transform_Sha512_Len_neon +WC_ASM_ATT_HIDDEN(Transform_Sha512_Len_neon) .type Transform_Sha512_Len_neon,@function .align 2 Transform_Sha512_Len_neon: #else .section __TEXT,__text .globl _Transform_Sha512_Len_neon +WC_ASM_ATT_HIDDEN(_Transform_Sha512_Len_neon) .p2align 2 _Transform_Sha512_Len_neon: #endif /* __APPLE__ */ @@ -1110,12 +1112,14 @@ L_SHA512_trans_crypto_len_k: #ifndef __APPLE__ .text .globl Transform_Sha512_Len_crypto +WC_ASM_ATT_HIDDEN(Transform_Sha512_Len_crypto) .type Transform_Sha512_Len_crypto,@function .align 2 Transform_Sha512_Len_crypto: #else .section __TEXT,__text .globl _Transform_Sha512_Len_crypto +WC_ASM_ATT_HIDDEN(_Transform_Sha512_Len_crypto) .p2align 2 _Transform_Sha512_Len_crypto: #endif /* __APPLE__ */ diff --git a/wolfcrypt/src/port/arm/thumb2-aes-asm.S b/wolfcrypt/src/port/arm/thumb2-aes-asm.S index ac34ed18fb6..3702c53f064 100644 --- a/wolfcrypt/src/port/arm/thumb2-aes-asm.S +++ b/wolfcrypt/src/port/arm/thumb2-aes-asm.S @@ -240,6 +240,7 @@ L_AES_Thumb2_te: .text .align 4 .globl AES_invert_key + WC_ASM_ATT_HIDDEN(AES_invert_key) .type AES_invert_key, %function AES_invert_key: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -358,6 +359,7 @@ L_AES_Thumb2_rcon: .text .align 4 .globl AES_set_encrypt_key + WC_ASM_ATT_HIDDEN(AES_set_encrypt_key) .type AES_set_encrypt_key, %function AES_set_encrypt_key: PUSH {r4, r5, r6, r7, r8, r9, r10, lr} @@ -582,6 +584,7 @@ L_AES_set_encrypt_key_end: .text .align 4 .globl AES_encrypt_block + WC_ASM_ATT_HIDDEN(AES_encrypt_block) .type AES_encrypt_block, %function AES_encrypt_block: PUSH {lr} @@ -821,6 +824,7 @@ L_AES_Thumb2_te_ecb: .text .align 4 .globl AES_ECB_encrypt + WC_ASM_ATT_HIDDEN(AES_ECB_encrypt) .type AES_ECB_encrypt, %function AES_ECB_encrypt: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -1601,6 +1605,7 @@ L_AES_ECB_encrypt_end: .text .align 4 .globl AES_CBC_encrypt + WC_ASM_ATT_HIDDEN(AES_CBC_encrypt) .type AES_CBC_encrypt, %function AES_CBC_encrypt: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -2410,6 +2415,7 @@ L_AES_Thumb2_te_ctr: .text .align 4 .globl AES_CTR_encrypt + WC_ASM_ATT_HIDDEN(AES_CTR_encrypt) .type AES_CTR_encrypt, %function AES_CTR_encrypt: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -3228,6 +3234,7 @@ L_AES_CTR_encrypt_end: .text .align 4 .globl AES_decrypt_block + WC_ASM_ATT_HIDDEN(AES_decrypt_block) .type AES_decrypt_block, %function AES_decrypt_block: PUSH {lr} @@ -3507,6 +3514,7 @@ L_AES_Thumb2_td4: .text .align 4 .globl AES_ECB_decrypt + WC_ASM_ATT_HIDDEN(AES_ECB_decrypt) .type AES_ECB_decrypt, %function AES_ECB_decrypt: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -4283,6 +4291,7 @@ L_AES_ECB_decrypt_end: .text .align 4 .globl AES_CBC_decrypt + WC_ASM_ATT_HIDDEN(AES_CBC_decrypt) .type AES_CBC_decrypt, %function AES_CBC_decrypt: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -5888,6 +5897,7 @@ L_GCM_gmult_len_r: .text .align 4 .globl GCM_gmult_len + WC_ASM_ATT_HIDDEN(GCM_gmult_len) .type GCM_gmult_len, %function GCM_gmult_len: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -6984,6 +6994,7 @@ L_AES_Thumb2_te_gcm: .text .align 4 .globl AES_GCM_encrypt + WC_ASM_ATT_HIDDEN(AES_GCM_encrypt) .type AES_GCM_encrypt, %function AES_GCM_encrypt: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -7808,6 +7819,7 @@ L_AES_GCMSIV_polyval_thumb2_r: .text .align 4 .globl AES_GCMSIV_polyval_thumb2 + WC_ASM_ATT_HIDDEN(AES_GCMSIV_polyval_thumb2) .type AES_GCMSIV_polyval_thumb2, %function AES_GCMSIV_polyval_thumb2: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -8592,6 +8604,7 @@ L_AES_GCMSIV_ctr_thumb2_te: .text .align 4 .globl AES_GCMSIV_ctr_thumb2 + WC_ASM_ATT_HIDDEN(AES_GCMSIV_ctr_thumb2) .type AES_GCMSIV_ctr_thumb2, %function AES_GCMSIV_ctr_thumb2: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} diff --git a/wolfcrypt/src/port/arm/thumb2-chacha-asm.S b/wolfcrypt/src/port/arm/thumb2-chacha-asm.S index 67643ab5dae..3fc0c590265 100644 --- a/wolfcrypt/src/port/arm/thumb2-chacha-asm.S +++ b/wolfcrypt/src/port/arm/thumb2-chacha-asm.S @@ -38,6 +38,7 @@ .text .align 4 .globl wc_chacha_setiv + WC_ASM_ATT_HIDDEN(wc_chacha_setiv) .type wc_chacha_setiv, %function wc_chacha_setiv: PUSH {r4, r5, r6, lr} @@ -74,6 +75,7 @@ L_chacha_thumb2_constants: .text .align 4 .globl wc_chacha_setkey + WC_ASM_ATT_HIDDEN(wc_chacha_setkey) .type wc_chacha_setkey, %function wc_chacha_setkey: PUSH {r4, r5, r6, r7, lr} @@ -115,6 +117,7 @@ L_chacha_thumb2_setkey_same_key_bytes: .text .align 4 .globl wc_chacha_crypt_bytes + WC_ASM_ATT_HIDDEN(wc_chacha_crypt_bytes) .type wc_chacha_crypt_bytes, %function wc_chacha_crypt_bytes: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -477,6 +480,7 @@ L_chacha_thumb2_crypt_done: .text .align 4 .globl wc_chacha_use_over + WC_ASM_ATT_HIDDEN(wc_chacha_use_over) .type wc_chacha_use_over, %function wc_chacha_use_over: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} diff --git a/wolfcrypt/src/port/arm/thumb2-curve25519.S b/wolfcrypt/src/port/arm/thumb2-curve25519.S index 7d30f05d819..881cee8e53d 100644 --- a/wolfcrypt/src/port/arm/thumb2-curve25519.S +++ b/wolfcrypt/src/port/arm/thumb2-curve25519.S @@ -41,6 +41,7 @@ .text .align 4 .globl fe_init + WC_ASM_ATT_HIDDEN(fe_init) .type fe_init, %function fe_init: BX lr @@ -49,6 +50,7 @@ fe_init: .text .align 4 .globl fe_add_sub_op + WC_ASM_ATT_HIDDEN(fe_add_sub_op) .type fe_add_sub_op, %function fe_add_sub_op: PUSH {lr} @@ -145,6 +147,7 @@ fe_add_sub_op: .text .align 4 .globl fe_sub_op + WC_ASM_ATT_HIDDEN(fe_sub_op) .type fe_sub_op, %function fe_sub_op: PUSH {lr} @@ -179,6 +182,7 @@ fe_sub_op: .text .align 4 .globl fe_sub + WC_ASM_ATT_HIDDEN(fe_sub) .type fe_sub, %function fe_sub: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -189,6 +193,7 @@ fe_sub: .text .align 4 .globl fe_add_op + WC_ASM_ATT_HIDDEN(fe_add_op) .type fe_add_op, %function fe_add_op: PUSH {lr} @@ -223,6 +228,7 @@ fe_add_op: .text .align 4 .globl fe_add + WC_ASM_ATT_HIDDEN(fe_add) .type fe_add, %function fe_add: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -234,6 +240,7 @@ fe_add: .text .align 4 .globl fe_frombytes + WC_ASM_ATT_HIDDEN(fe_frombytes) .type fe_frombytes, %function fe_frombytes: PUSH {r4, r5, r6, r7, r8, r9, lr} @@ -260,6 +267,7 @@ fe_frombytes: .text .align 4 .globl fe_tobytes + WC_ASM_ATT_HIDDEN(fe_tobytes) .type fe_tobytes, %function fe_tobytes: PUSH {r4, r5, r6, r7, r8, r9, lr} @@ -297,6 +305,7 @@ fe_tobytes: .text .align 4 .globl fe_1 + WC_ASM_ATT_HIDDEN(fe_1) .type fe_1, %function fe_1: PUSH {r4, r5, r6, r7, r8, r9, lr} @@ -316,6 +325,7 @@ fe_1: .text .align 4 .globl fe_0 + WC_ASM_ATT_HIDDEN(fe_0) .type fe_0, %function fe_0: PUSH {r4, r5, r6, r7, r8, r9, lr} @@ -335,6 +345,7 @@ fe_0: .text .align 4 .globl fe_copy + WC_ASM_ATT_HIDDEN(fe_copy) .type fe_copy, %function fe_copy: PUSH {r4, r5, lr} @@ -353,6 +364,7 @@ fe_copy: .text .align 4 .globl fe_neg + WC_ASM_ATT_HIDDEN(fe_neg) .type fe_neg, %function fe_neg: PUSH {r4, r5, lr} @@ -377,6 +389,7 @@ fe_neg: .text .align 4 .globl fe_isnonzero + WC_ASM_ATT_HIDDEN(fe_isnonzero) .type fe_isnonzero, %function fe_isnonzero: PUSH {r4, r5, r6, r7, r8, r9, lr} @@ -413,6 +426,7 @@ fe_isnonzero: .text .align 4 .globl fe_isnegative + WC_ASM_ATT_HIDDEN(fe_isnegative) .type fe_isnegative, %function fe_isnegative: PUSH {r4, r5, lr} @@ -437,6 +451,7 @@ fe_isnegative: .text .align 4 .globl fe_cmov_table + WC_ASM_ATT_HIDDEN(fe_cmov_table) .type fe_cmov_table, %function fe_cmov_table: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -1410,6 +1425,7 @@ fe_cmov_table: .text .align 4 .globl fe_cmov_table + WC_ASM_ATT_HIDDEN(fe_cmov_table) .type fe_cmov_table, %function fe_cmov_table: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -1515,6 +1531,7 @@ fe_cmov_table: .text .align 4 .globl fe_mul_op + WC_ASM_ATT_HIDDEN(fe_mul_op) .type fe_mul_op, %function fe_mul_op: PUSH {lr} @@ -1893,6 +1910,7 @@ fe_mul_op: .text .align 4 .globl fe_mul_op_full_red + WC_ASM_ATT_HIDDEN(fe_mul_op_full_red) .type fe_mul_op_full_red, %function fe_mul_op_full_red: PUSH {lr} @@ -2291,6 +2309,7 @@ fe_mul_op_full_red: .text .align 4 .globl fe_mul_op + WC_ASM_ATT_HIDDEN(fe_mul_op) .type fe_mul_op, %function fe_mul_op: PUSH {lr} @@ -2423,6 +2442,7 @@ fe_mul_op: .text .align 4 .globl fe_mul_op_full_red + WC_ASM_ATT_HIDDEN(fe_mul_op_full_red) .type fe_mul_op_full_red, %function fe_mul_op_full_red: PUSH {lr} @@ -2575,6 +2595,7 @@ fe_mul_op_full_red: .text .align 4 .globl fe_mul + WC_ASM_ATT_HIDDEN(fe_mul) .type fe_mul, %function fe_mul: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -2586,6 +2607,7 @@ fe_mul: .text .align 4 .globl fe_sq_op + WC_ASM_ATT_HIDDEN(fe_sq_op) .type fe_sq_op, %function fe_sq_op: PUSH {lr} @@ -2857,6 +2879,7 @@ fe_sq_op: .text .align 4 .globl fe_sq_op_full_red + WC_ASM_ATT_HIDDEN(fe_sq_op_full_red) .type fe_sq_op_full_red, %function fe_sq_op_full_red: PUSH {lr} @@ -3148,6 +3171,7 @@ fe_sq_op_full_red: .text .align 4 .globl fe_sq_op + WC_ASM_ATT_HIDDEN(fe_sq_op) .type fe_sq_op, %function fe_sq_op: PUSH {lr} @@ -3266,6 +3290,7 @@ fe_sq_op: .text .align 4 .globl fe_sq_op_full_red + WC_ASM_ATT_HIDDEN(fe_sq_op_full_red) .type fe_sq_op_full_red, %function fe_sq_op_full_red: PUSH {lr} @@ -3404,6 +3429,7 @@ fe_sq_op_full_red: .text .align 4 .globl fe_sq + WC_ASM_ATT_HIDDEN(fe_sq) .type fe_sq, %function fe_sq: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -3416,6 +3442,7 @@ fe_sq: .text .align 4 .globl fe_mul121666 + WC_ASM_ATT_HIDDEN(fe_mul121666) .type fe_mul121666, %function fe_mul121666: PUSH {r4, r5, r6, r7, r8, r9, r10, lr} @@ -3466,6 +3493,7 @@ fe_mul121666: .text .align 4 .globl fe_mul121666 + WC_ASM_ATT_HIDDEN(fe_mul121666) .type fe_mul121666, %function fe_mul121666: PUSH {r4, r5, r6, r7, r8, r9, r10, lr} @@ -3504,6 +3532,7 @@ fe_mul121666: .text .align 4 .globl curve25519 + WC_ASM_ATT_HIDDEN(curve25519) .type curve25519, %function curve25519: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -3942,6 +3971,7 @@ L_curve25519_inv_8: .text .align 4 .globl curve25519 + WC_ASM_ATT_HIDDEN(curve25519) .type curve25519, %function curve25519: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -4284,6 +4314,7 @@ L_curve25519_inv_8: .text .align 4 .globl fe_invert + WC_ASM_ATT_HIDDEN(fe_invert) .type fe_invert, %function fe_invert: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -4476,6 +4507,7 @@ L_fe_invert8: .text .align 4 .globl fe_sq2 + WC_ASM_ATT_HIDDEN(fe_sq2) .type fe_sq2, %function fe_sq2: PUSH {lr} @@ -4800,6 +4832,7 @@ fe_sq2: .text .align 4 .globl fe_sq2 + WC_ASM_ATT_HIDDEN(fe_sq2) .type fe_sq2, %function fe_sq2: PUSH {lr} @@ -4973,6 +5006,7 @@ fe_sq2: .text .align 4 .globl fe_pow22523 + WC_ASM_ATT_HIDDEN(fe_pow22523) .type fe_pow22523, %function fe_pow22523: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -5164,6 +5198,7 @@ L_fe_pow22523_8: .text .align 4 .globl ge_p1p1_to_p2 + WC_ASM_ATT_HIDDEN(ge_p1p1_to_p2) .type ge_p1p1_to_p2, %function ge_p1p1_to_p2: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -5191,6 +5226,7 @@ ge_p1p1_to_p2: .text .align 4 .globl ge_p1p1_to_p3 + WC_ASM_ATT_HIDDEN(ge_p1p1_to_p3) .type ge_p1p1_to_p3, %function ge_p1p1_to_p3: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -5223,6 +5259,7 @@ ge_p1p1_to_p3: .text .align 4 .globl ge_p2_dbl + WC_ASM_ATT_HIDDEN(ge_p2_dbl) .type ge_p2_dbl, %function ge_p2_dbl: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -5267,6 +5304,7 @@ ge_p2_dbl: .text .align 4 .globl ge_madd + WC_ASM_ATT_HIDDEN(ge_madd) .type ge_madd, %function ge_madd: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -5345,6 +5383,7 @@ ge_madd: .text .align 4 .globl ge_msub + WC_ASM_ATT_HIDDEN(ge_msub) .type ge_msub, %function ge_msub: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -5424,6 +5463,7 @@ ge_msub: .text .align 4 .globl ge_add + WC_ASM_ATT_HIDDEN(ge_add) .type ge_add, %function ge_add: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -5503,6 +5543,7 @@ ge_add: .text .align 4 .globl ge_sub + WC_ASM_ATT_HIDDEN(ge_sub) .type ge_sub, %function ge_sub: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -5585,6 +5626,7 @@ ge_sub: .text .align 4 .globl sc_reduce + WC_ASM_ATT_HIDDEN(sc_reduce) .type sc_reduce, %function sc_reduce: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -6011,6 +6053,7 @@ sc_reduce: .text .align 4 .globl sc_reduce + WC_ASM_ATT_HIDDEN(sc_reduce) .type sc_reduce, %function sc_reduce: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -6310,6 +6353,7 @@ sc_reduce: .text .align 4 .globl sc_muladd + WC_ASM_ATT_HIDDEN(sc_muladd) .type sc_muladd, %function sc_muladd: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -7093,6 +7137,7 @@ sc_muladd: .text .align 4 .globl sc_muladd + WC_ASM_ATT_HIDDEN(sc_muladd) .type sc_muladd, %function sc_muladd: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} diff --git a/wolfcrypt/src/port/arm/thumb2-frodokem-asm.S b/wolfcrypt/src/port/arm/thumb2-frodokem-asm.S index bdba679d22c..9ebbfaecb0d 100644 --- a/wolfcrypt/src/port/arm/thumb2-frodokem-asm.S +++ b/wolfcrypt/src/port/arm/thumb2-frodokem-asm.S @@ -38,6 +38,7 @@ .text .align 4 .globl frodokem_add_thumb2 + WC_ASM_ATT_HIDDEN(frodokem_add_thumb2) .type frodokem_add_thumb2, %function frodokem_add_thumb2: PUSH {r4, r5, lr} @@ -61,6 +62,7 @@ L_frodokem_add_thumb2_blk: .text .align 4 .globl frodokem_sa_accum_thumb2 + WC_ASM_ATT_HIDDEN(frodokem_sa_accum_thumb2) .type frodokem_sa_accum_thumb2, %function frodokem_sa_accum_thumb2: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -99,6 +101,7 @@ L_frodokem_sa_accum_thumb2_k: .text .align 4 .globl frodokem_as_accum_thumb2 + WC_ASM_ATT_HIDDEN(frodokem_as_accum_thumb2) .type frodokem_as_accum_thumb2, %function frodokem_as_accum_thumb2: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -139,6 +142,7 @@ L_frodokem_as_accum_thumb2_j: .text .align 4 .globl frodokem_mul_bs_thumb2 + WC_ASM_ATT_HIDDEN(frodokem_mul_bs_thumb2) .type frodokem_mul_bs_thumb2, %function frodokem_mul_bs_thumb2: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -187,6 +191,7 @@ L_frodokem_mul_bs_thumb2_j: .text .align 4 .globl frodokem_mul_add_sb_plus_e_thumb2 + WC_ASM_ATT_HIDDEN(frodokem_mul_add_sb_plus_e_thumb2) .type frodokem_mul_add_sb_plus_e_thumb2, %function frodokem_mul_add_sb_plus_e_thumb2: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} diff --git a/wolfcrypt/src/port/arm/thumb2-mlkem-asm.S b/wolfcrypt/src/port/arm/thumb2-mlkem-asm.S index 8487b9ab333..e71b9311ed5 100644 --- a/wolfcrypt/src/port/arm/thumb2-mlkem-asm.S +++ b/wolfcrypt/src/port/arm/thumb2-mlkem-asm.S @@ -69,6 +69,7 @@ L_mlkem_thumb2_ntt_zetas: .text .align 4 .globl mlkem_thumb2_ntt + WC_ASM_ATT_HIDDEN(mlkem_thumb2_ntt) .type mlkem_thumb2_ntt, %function mlkem_thumb2_ntt: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -1358,6 +1359,7 @@ L_mlkem_invntt_zetas_inv: .text .align 4 .globl mlkem_thumb2_invntt + WC_ASM_ATT_HIDDEN(mlkem_thumb2_invntt) .type mlkem_thumb2_invntt, %function mlkem_thumb2_invntt: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -3014,6 +3016,7 @@ L_mlkem_basemul_mont_zetas: .text .align 4 .globl mlkem_thumb2_basemul_mont + WC_ASM_ATT_HIDDEN(mlkem_thumb2_basemul_mont) .type mlkem_thumb2_basemul_mont, %function mlkem_thumb2_basemul_mont: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -3137,6 +3140,7 @@ L_mlkem_basemul_mont_loop: .text .align 4 .globl mlkem_thumb2_basemul_mont_add + WC_ASM_ATT_HIDDEN(mlkem_thumb2_basemul_mont_add) .type mlkem_thumb2_basemul_mont_add, %function mlkem_thumb2_basemul_mont_add: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -3272,6 +3276,7 @@ L_mlkem_thumb2_basemul_mont_add_loop: .text .align 4 .globl mlkem_thumb2_csubq + WC_ASM_ATT_HIDDEN(mlkem_thumb2_csubq) .type mlkem_thumb2_csubq, %function mlkem_thumb2_csubq: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -3361,6 +3366,7 @@ L_mlkem_thumb2_csubq_loop: .text .align 4 .globl mlkem_thumb2_rej_uniform + WC_ASM_ATT_HIDDEN(mlkem_thumb2_rej_uniform) .type mlkem_thumb2_rej_uniform, %function mlkem_thumb2_rej_uniform: PUSH {r4, r5, r6, r7, r8, r9, r10, lr} diff --git a/wolfcrypt/src/port/arm/thumb2-poly1305-asm.S b/wolfcrypt/src/port/arm/thumb2-poly1305-asm.S index 832d16c91f1..ed5f79d63c4 100644 --- a/wolfcrypt/src/port/arm/thumb2-poly1305-asm.S +++ b/wolfcrypt/src/port/arm/thumb2-poly1305-asm.S @@ -38,6 +38,7 @@ .text .align 4 .globl poly1305_blocks_thumb2_16 + WC_ASM_ATT_HIDDEN(poly1305_blocks_thumb2_16) .type poly1305_blocks_thumb2_16, %function poly1305_blocks_thumb2_16: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -276,6 +277,7 @@ L_poly1305_thumb2_clamp: .text .align 4 .globl poly1305_set_key + WC_ASM_ATT_HIDDEN(poly1305_set_key) .type poly1305_set_key, %function poly1305_set_key: PUSH {r4, r5, r6, r7, r8, r9, r10, lr} @@ -316,6 +318,7 @@ poly1305_set_key: .text .align 4 .globl poly1305_final + WC_ASM_ATT_HIDDEN(poly1305_final) .type poly1305_final, %function poly1305_final: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} diff --git a/wolfcrypt/src/port/arm/thumb2-sha256-asm.S b/wolfcrypt/src/port/arm/thumb2-sha256-asm.S index 9815eed6484..4e923061158 100644 --- a/wolfcrypt/src/port/arm/thumb2-sha256-asm.S +++ b/wolfcrypt/src/port/arm/thumb2-sha256-asm.S @@ -70,6 +70,7 @@ L_SHA256_transform_len_k: .text .align 4 .globl Transform_Sha256_Len_base + WC_ASM_ATT_HIDDEN(Transform_Sha256_Len_base) .type Transform_Sha256_Len_base, %function Transform_Sha256_Len_base: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} diff --git a/wolfcrypt/src/port/arm/thumb2-sha3-asm.S b/wolfcrypt/src/port/arm/thumb2-sha3-asm.S index ae0ac32059b..8df840e51d4 100644 --- a/wolfcrypt/src/port/arm/thumb2-sha3-asm.S +++ b/wolfcrypt/src/port/arm/thumb2-sha3-asm.S @@ -65,6 +65,7 @@ L_sha3_thumb2_rt: .text .align 4 .globl BlockSha3 + WC_ASM_ATT_HIDDEN(BlockSha3) .type BlockSha3, %function BlockSha3: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} diff --git a/wolfcrypt/src/port/arm/thumb2-sha512-asm.S b/wolfcrypt/src/port/arm/thumb2-sha512-asm.S index aa52c12ebf0..0819670884b 100644 --- a/wolfcrypt/src/port/arm/thumb2-sha512-asm.S +++ b/wolfcrypt/src/port/arm/thumb2-sha512-asm.S @@ -94,6 +94,7 @@ L_SHA512_transform_len_k: .text .align 4 .globl Transform_Sha512_Len_base + WC_ASM_ATT_HIDDEN(Transform_Sha512_Len_base) .type Transform_Sha512_Len_base, %function Transform_Sha512_Len_base: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} diff --git a/wolfcrypt/src/port/ppc32/ppc32-aes-asm.S b/wolfcrypt/src/port/ppc32/ppc32-aes-asm.S index 955c01f9077..17b4c80d512 100644 --- a/wolfcrypt/src/port/ppc32/ppc32-aes-asm.S +++ b/wolfcrypt/src/port/ppc32/ppc32-aes-asm.S @@ -686,6 +686,7 @@ L_AES_PPC32_rcon: .section ".text" .align 4 .globl AES_set_encrypt_key + WC_ASM_ATT_HIDDEN(AES_set_encrypt_key) .type AES_set_encrypt_key, @function AES_set_encrypt_key: stwu 1, -20(1) @@ -913,6 +914,7 @@ L_AES_set_encrypt_key_end: .section ".text" .align 4 .globl AES_ECB_encrypt + WC_ASM_ATT_HIDDEN(AES_ECB_encrypt) .type AES_ECB_encrypt, @function AES_ECB_encrypt: stwu 1, -56(1) @@ -1202,6 +1204,7 @@ L_AES_ECB_encrypt_round: .section ".text" .align 4 .globl AES_invert_key + WC_ASM_ATT_HIDDEN(AES_invert_key) .type AES_invert_key, @function AES_invert_key: stwu 1, -40(1) @@ -1356,6 +1359,7 @@ L_AES_invert_key_mix: .section ".text" .align 4 .globl AES_ECB_decrypt + WC_ASM_ATT_HIDDEN(AES_ECB_decrypt) .type AES_ECB_decrypt, @function AES_ECB_decrypt: stwu 1, -60(1) @@ -1650,6 +1654,7 @@ L_AES_ECB_decrypt_round: .section ".text" .align 4 .globl AES_CBC_encrypt + WC_ASM_ATT_HIDDEN(AES_CBC_encrypt) .type AES_CBC_encrypt, @function AES_CBC_encrypt: stwu 1, -56(1) @@ -1950,6 +1955,7 @@ L_AES_CBC_encrypt_round: .section ".text" .align 4 .globl AES_CBC_decrypt + WC_ASM_ATT_HIDDEN(AES_CBC_decrypt) .type AES_CBC_decrypt, @function AES_CBC_decrypt: stwu 1, -76(1) @@ -2268,6 +2274,7 @@ L_AES_CBC_decrypt_round: .section ".text" .align 4 .globl AES_CTR_encrypt + WC_ASM_ATT_HIDDEN(AES_CTR_encrypt) .type AES_CTR_encrypt, @function AES_CTR_encrypt: stwu 1, -72(1) @@ -2585,6 +2592,7 @@ L_AES_CTR_encrypt_round: .section ".text" .align 4 .globl AES_GCM_encrypt + WC_ASM_ATT_HIDDEN(AES_GCM_encrypt) .type AES_GCM_encrypt, @function AES_GCM_encrypt: stwu 1, -72(1) @@ -2921,6 +2929,7 @@ L_GCM_gmult_len_r: .section ".text" .align 4 .globl GCM_gmult_len + WC_ASM_ATT_HIDDEN(GCM_gmult_len) .type GCM_gmult_len, @function GCM_gmult_len: stwu 1, -52(1) @@ -3722,6 +3731,7 @@ L_GCM_gmult_len_r: .section ".text" .align 4 .globl GCM_gmult_len + WC_ASM_ATT_HIDDEN(GCM_gmult_len) .type GCM_gmult_len, @function GCM_gmult_len: stwu 1, -40(1) diff --git a/wolfcrypt/src/port/ppc32/ppc32-sha256-asm.S b/wolfcrypt/src/port/ppc32/ppc32-sha256-asm.S index 2bed1717408..abedebee41d 100644 --- a/wolfcrypt/src/port/ppc32/ppc32-sha256-asm.S +++ b/wolfcrypt/src/port/ppc32/ppc32-sha256-asm.S @@ -68,6 +68,7 @@ L_SHA256_transform_spe_len_k: .section ".text" .align 4 .globl Transform_Sha256_Len + WC_ASM_ATT_HIDDEN(Transform_Sha256_Len) .type Transform_Sha256_Len, @function Transform_Sha256_Len: stwu 1, -104(1) @@ -1215,6 +1216,7 @@ L_SHA256_transform_len_k: .section ".text" .align 4 .globl Transform_Sha256_Len + WC_ASM_ATT_HIDDEN(Transform_Sha256_Len) .type Transform_Sha256_Len, @function Transform_Sha256_Len: stwu 1, -76(1) @@ -4403,6 +4405,7 @@ L_SHA256_transform_len_after_blk_15: .section ".text" .align 4 .globl Transform_Sha256_Len + WC_ASM_ATT_HIDDEN(Transform_Sha256_Len) .type Transform_Sha256_Len, @function Transform_Sha256_Len: stwu 1, -68(1) diff --git a/wolfcrypt/src/port/ppc32/ppc32-sha3-asm.S b/wolfcrypt/src/port/ppc32/ppc32-sha3-asm.S index 41989f530f0..e753062d4eb 100644 --- a/wolfcrypt/src/port/ppc32/ppc32-sha3-asm.S +++ b/wolfcrypt/src/port/ppc32/ppc32-sha3-asm.S @@ -63,6 +63,7 @@ L_sha3_ppc32_rt: .section ".text" .align 4 .globl BlockSha3 + WC_ASM_ATT_HIDDEN(BlockSha3) .type BlockSha3, @function BlockSha3: stwu 1, -32(1) diff --git a/wolfcrypt/src/port/ppc32/ppc32-sha512-asm.S b/wolfcrypt/src/port/ppc32/ppc32-sha512-asm.S index f4c68ccdeca..97b53e8864e 100644 --- a/wolfcrypt/src/port/ppc32/ppc32-sha512-asm.S +++ b/wolfcrypt/src/port/ppc32/ppc32-sha512-asm.S @@ -91,6 +91,7 @@ L_SHA512_transform_len_k: .section ".text" .align 4 .globl Transform_Sha512_Len + WC_ASM_ATT_HIDDEN(Transform_Sha512_Len) .type Transform_Sha512_Len, @function Transform_Sha512_Len: stwu 1, -72(1) diff --git a/wolfcrypt/src/port/ppc64/ppc64-aes-asm.S b/wolfcrypt/src/port/ppc64/ppc64-aes-asm.S index 9a581380e77..bee826cceca 100644 --- a/wolfcrypt/src/port/ppc64/ppc64-aes-asm.S +++ b/wolfcrypt/src/port/ppc64/ppc64-aes-asm.S @@ -201,6 +201,7 @@ L_AES_PPC64_te: #if defined(_CALL_ELF) && _CALL_ELF == 2 .text .globl AES_invert_key +WC_ASM_ATT_HIDDEN(AES_invert_key) .type AES_invert_key,@function .align 16 AES_invert_key: @@ -212,6 +213,7 @@ AES_invert_key: * points at the code (.L.AES_invert_key) and the TOC base. */ .section .opd,"aw",@progbits .globl AES_invert_key +WC_ASM_ATT_HIDDEN(AES_invert_key) .type AES_invert_key,@function .align 3 AES_invert_key: @@ -224,6 +226,7 @@ AES_invert_key: #else .section __TEXT,__text .globl _AES_invert_key +WC_ASM_ATT_HIDDEN(_AES_invert_key) .p2align 4 _AES_invert_key: #endif /* __APPLE__ */ @@ -436,6 +439,7 @@ L_AES_PPC64_rcon: #if defined(_CALL_ELF) && _CALL_ELF == 2 .text .globl AES_set_encrypt_key +WC_ASM_ATT_HIDDEN(AES_set_encrypt_key) .type AES_set_encrypt_key,@function .align 16 AES_set_encrypt_key: @@ -447,6 +451,7 @@ AES_set_encrypt_key: * points at the code (.L.AES_set_encrypt_key) and the TOC base. */ .section .opd,"aw",@progbits .globl AES_set_encrypt_key +WC_ASM_ATT_HIDDEN(AES_set_encrypt_key) .type AES_set_encrypt_key,@function .align 3 AES_set_encrypt_key: @@ -459,6 +464,7 @@ AES_set_encrypt_key: #else .section __TEXT,__text .globl _AES_set_encrypt_key +WC_ASM_ATT_HIDDEN(_AES_set_encrypt_key) .p2align 4 _AES_set_encrypt_key: #endif /* __APPLE__ */ @@ -1138,6 +1144,7 @@ L_AES_PPC64_te4_0: #if defined(_CALL_ELF) && _CALL_ELF == 2 .text .globl AES_ECB_encrypt +WC_ASM_ATT_HIDDEN(AES_ECB_encrypt) .type AES_ECB_encrypt,@function .align 16 AES_ECB_encrypt: @@ -1149,6 +1156,7 @@ AES_ECB_encrypt: * points at the code (.L.AES_ECB_encrypt) and the TOC base. */ .section .opd,"aw",@progbits .globl AES_ECB_encrypt +WC_ASM_ATT_HIDDEN(AES_ECB_encrypt) .type AES_ECB_encrypt,@function .align 3 AES_ECB_encrypt: @@ -1161,6 +1169,7 @@ AES_ECB_encrypt: #else .section __TEXT,__text .globl _AES_ECB_encrypt +WC_ASM_ATT_HIDDEN(_AES_ECB_encrypt) .p2align 4 _AES_ECB_encrypt: #endif /* __APPLE__ */ @@ -1531,6 +1540,7 @@ L_AES_ECB_encrypt_loop_nr: #if defined(_CALL_ELF) && _CALL_ELF == 2 .text .globl AES_CBC_encrypt +WC_ASM_ATT_HIDDEN(AES_CBC_encrypt) .type AES_CBC_encrypt,@function .align 16 AES_CBC_encrypt: @@ -1542,6 +1552,7 @@ AES_CBC_encrypt: * points at the code (.L.AES_CBC_encrypt) and the TOC base. */ .section .opd,"aw",@progbits .globl AES_CBC_encrypt +WC_ASM_ATT_HIDDEN(AES_CBC_encrypt) .type AES_CBC_encrypt,@function .align 3 AES_CBC_encrypt: @@ -1554,6 +1565,7 @@ AES_CBC_encrypt: #else .section __TEXT,__text .globl _AES_CBC_encrypt +WC_ASM_ATT_HIDDEN(_AES_CBC_encrypt) .p2align 4 _AES_CBC_encrypt: #endif /* __APPLE__ */ @@ -1943,6 +1955,7 @@ L_AES_CBC_encrypt_loop_nr: #if defined(_CALL_ELF) && _CALL_ELF == 2 .text .globl AES_CTR_encrypt +WC_ASM_ATT_HIDDEN(AES_CTR_encrypt) .type AES_CTR_encrypt,@function .align 16 AES_CTR_encrypt: @@ -1954,6 +1967,7 @@ AES_CTR_encrypt: * points at the code (.L.AES_CTR_encrypt) and the TOC base. */ .section .opd,"aw",@progbits .globl AES_CTR_encrypt +WC_ASM_ATT_HIDDEN(AES_CTR_encrypt) .type AES_CTR_encrypt,@function .align 3 AES_CTR_encrypt: @@ -1966,6 +1980,7 @@ AES_CTR_encrypt: #else .section __TEXT,__text .globl _AES_CTR_encrypt +WC_ASM_ATT_HIDDEN(_AES_CTR_encrypt) .p2align 4 _AES_CTR_encrypt: #endif /* __APPLE__ */ @@ -2361,6 +2376,7 @@ L_AES_CTR_encrypt_loop_nr: #if defined(_CALL_ELF) && _CALL_ELF == 2 .text .globl AES_GCM_encrypt +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt) .type AES_GCM_encrypt,@function .align 16 AES_GCM_encrypt: @@ -2372,6 +2388,7 @@ AES_GCM_encrypt: * points at the code (.L.AES_GCM_encrypt) and the TOC base. */ .section .opd,"aw",@progbits .globl AES_GCM_encrypt +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt) .type AES_GCM_encrypt,@function .align 3 AES_GCM_encrypt: @@ -2384,6 +2401,7 @@ AES_GCM_encrypt: #else .section __TEXT,__text .globl _AES_GCM_encrypt +WC_ASM_ATT_HIDDEN(_AES_GCM_encrypt) .p2align 4 _AES_GCM_encrypt: #endif /* __APPLE__ */ @@ -2779,6 +2797,7 @@ L_AES_GCM_encrypt_loop_nr: #if defined(_CALL_ELF) && _CALL_ELF == 2 .text .globl AES_XTS_encrypt +WC_ASM_ATT_HIDDEN(AES_XTS_encrypt) .type AES_XTS_encrypt,@function .align 16 AES_XTS_encrypt: @@ -2790,6 +2809,7 @@ AES_XTS_encrypt: * points at the code (.L.AES_XTS_encrypt) and the TOC base. */ .section .opd,"aw",@progbits .globl AES_XTS_encrypt +WC_ASM_ATT_HIDDEN(AES_XTS_encrypt) .type AES_XTS_encrypt,@function .align 3 AES_XTS_encrypt: @@ -2802,6 +2822,7 @@ AES_XTS_encrypt: #else .section __TEXT,__text .globl _AES_XTS_encrypt +WC_ASM_ATT_HIDDEN(_AES_XTS_encrypt) .p2align 4 _AES_XTS_encrypt: #endif /* __APPLE__ */ @@ -3925,6 +3946,7 @@ L_AES_PPC64_td4: #if defined(_CALL_ELF) && _CALL_ELF == 2 .text .globl AES_ECB_decrypt +WC_ASM_ATT_HIDDEN(AES_ECB_decrypt) .type AES_ECB_decrypt,@function .align 16 AES_ECB_decrypt: @@ -3936,6 +3958,7 @@ AES_ECB_decrypt: * points at the code (.L.AES_ECB_decrypt) and the TOC base. */ .section .opd,"aw",@progbits .globl AES_ECB_decrypt +WC_ASM_ATT_HIDDEN(AES_ECB_decrypt) .type AES_ECB_decrypt,@function .align 3 AES_ECB_decrypt: @@ -3948,6 +3971,7 @@ AES_ECB_decrypt: #else .section __TEXT,__text .globl _AES_ECB_decrypt +WC_ASM_ATT_HIDDEN(_AES_ECB_decrypt) .p2align 4 _AES_ECB_decrypt: #endif /* __APPLE__ */ @@ -4314,6 +4338,7 @@ L_AES_ECB_decrypt_loop_nr: #if defined(_CALL_ELF) && _CALL_ELF == 2 .text .globl AES_CBC_decrypt +WC_ASM_ATT_HIDDEN(AES_CBC_decrypt) .type AES_CBC_decrypt,@function .align 16 AES_CBC_decrypt: @@ -4325,6 +4350,7 @@ AES_CBC_decrypt: * points at the code (.L.AES_CBC_decrypt) and the TOC base. */ .section .opd,"aw",@progbits .globl AES_CBC_decrypt +WC_ASM_ATT_HIDDEN(AES_CBC_decrypt) .type AES_CBC_decrypt,@function .align 3 AES_CBC_decrypt: @@ -4337,6 +4363,7 @@ AES_CBC_decrypt: #else .section __TEXT,__text .globl _AES_CBC_decrypt +WC_ASM_ATT_HIDDEN(_AES_CBC_decrypt) .p2align 4 _AES_CBC_decrypt: #endif /* __APPLE__ */ @@ -5064,6 +5091,7 @@ L_AES_CBC_decrypt_end_dec: #if defined(_CALL_ELF) && _CALL_ELF == 2 .text .globl AES_XTS_decrypt +WC_ASM_ATT_HIDDEN(AES_XTS_decrypt) .type AES_XTS_decrypt,@function .align 16 AES_XTS_decrypt: @@ -5075,6 +5103,7 @@ AES_XTS_decrypt: * points at the code (.L.AES_XTS_decrypt) and the TOC base. */ .section .opd,"aw",@progbits .globl AES_XTS_decrypt +WC_ASM_ATT_HIDDEN(AES_XTS_decrypt) .type AES_XTS_decrypt,@function .align 3 AES_XTS_decrypt: @@ -5087,6 +5116,7 @@ AES_XTS_decrypt: #else .section __TEXT,__text .globl _AES_XTS_decrypt +WC_ASM_ATT_HIDDEN(_AES_XTS_decrypt) .p2align 4 _AES_XTS_decrypt: #endif /* __APPLE__ */ @@ -6532,6 +6562,7 @@ L_GCM_gmult_len_r: #if defined(_CALL_ELF) && _CALL_ELF == 2 .text .globl GCM_gmult_len +WC_ASM_ATT_HIDDEN(GCM_gmult_len) .type GCM_gmult_len,@function .align 16 GCM_gmult_len: @@ -6543,6 +6574,7 @@ GCM_gmult_len: * points at the code (.L.GCM_gmult_len) and the TOC base. */ .section .opd,"aw",@progbits .globl GCM_gmult_len +WC_ASM_ATT_HIDDEN(GCM_gmult_len) .type GCM_gmult_len,@function .align 3 GCM_gmult_len: @@ -6555,6 +6587,7 @@ GCM_gmult_len: #else .section __TEXT,__text .globl _GCM_gmult_len +WC_ASM_ATT_HIDDEN(_GCM_gmult_len) .p2align 4 _GCM_gmult_len: #endif /* __APPLE__ */ @@ -7424,6 +7457,7 @@ L_GCM_gmult_len_r: #if defined(_CALL_ELF) && _CALL_ELF == 2 .text .globl GCM_gmult_len +WC_ASM_ATT_HIDDEN(GCM_gmult_len) .type GCM_gmult_len,@function .align 16 GCM_gmult_len: @@ -7435,6 +7469,7 @@ GCM_gmult_len: * points at the code (.L.GCM_gmult_len) and the TOC base. */ .section .opd,"aw",@progbits .globl GCM_gmult_len +WC_ASM_ATT_HIDDEN(GCM_gmult_len) .type GCM_gmult_len,@function .align 3 GCM_gmult_len: @@ -7447,6 +7482,7 @@ GCM_gmult_len: #else .section __TEXT,__text .globl _GCM_gmult_len +WC_ASM_ATT_HIDDEN(_GCM_gmult_len) .p2align 4 _GCM_gmult_len: #endif /* __APPLE__ */ @@ -8021,6 +8057,7 @@ L_AES_PPC64_crypto_one: #if defined(_CALL_ELF) && _CALL_ELF == 2 .text .globl AES_set_encrypt_key_crypto +WC_ASM_ATT_HIDDEN(AES_set_encrypt_key_crypto) .type AES_set_encrypt_key_crypto,@function .align 16 AES_set_encrypt_key_crypto: @@ -8032,6 +8069,7 @@ AES_set_encrypt_key_crypto: * points at the code (.L.AES_set_encrypt_key_crypto) and the TOC base. */ .section .opd,"aw",@progbits .globl AES_set_encrypt_key_crypto +WC_ASM_ATT_HIDDEN(AES_set_encrypt_key_crypto) .type AES_set_encrypt_key_crypto,@function .align 3 AES_set_encrypt_key_crypto: @@ -8044,6 +8082,7 @@ AES_set_encrypt_key_crypto: #else .section __TEXT,__text .globl _AES_set_encrypt_key_crypto +WC_ASM_ATT_HIDDEN(_AES_set_encrypt_key_crypto) .p2align 4 _AES_set_encrypt_key_crypto: #endif /* __APPLE__ */ @@ -8406,6 +8445,7 @@ L_AES_set_encrypt_key_crypto_end: #if defined(_CALL_ELF) && _CALL_ELF == 2 .text .globl AES_invert_key_crypto +WC_ASM_ATT_HIDDEN(AES_invert_key_crypto) .type AES_invert_key_crypto,@function .align 16 AES_invert_key_crypto: @@ -8417,6 +8457,7 @@ AES_invert_key_crypto: * points at the code (.L.AES_invert_key_crypto) and the TOC base. */ .section .opd,"aw",@progbits .globl AES_invert_key_crypto +WC_ASM_ATT_HIDDEN(AES_invert_key_crypto) .type AES_invert_key_crypto,@function .align 3 AES_invert_key_crypto: @@ -8429,6 +8470,7 @@ AES_invert_key_crypto: #else .section __TEXT,__text .globl _AES_invert_key_crypto +WC_ASM_ATT_HIDDEN(_AES_invert_key_crypto) .p2align 4 _AES_invert_key_crypto: #endif /* __APPLE__ */ @@ -8474,6 +8516,7 @@ L_AES_invert_key_crypto_loop: #if defined(_CALL_ELF) && _CALL_ELF == 2 .text .globl AES_ECB_encrypt_crypto +WC_ASM_ATT_HIDDEN(AES_ECB_encrypt_crypto) .type AES_ECB_encrypt_crypto,@function .align 16 AES_ECB_encrypt_crypto: @@ -8485,6 +8528,7 @@ AES_ECB_encrypt_crypto: * points at the code (.L.AES_ECB_encrypt_crypto) and the TOC base. */ .section .opd,"aw",@progbits .globl AES_ECB_encrypt_crypto +WC_ASM_ATT_HIDDEN(AES_ECB_encrypt_crypto) .type AES_ECB_encrypt_crypto,@function .align 3 AES_ECB_encrypt_crypto: @@ -8497,6 +8541,7 @@ AES_ECB_encrypt_crypto: #else .section __TEXT,__text .globl _AES_ECB_encrypt_crypto +WC_ASM_ATT_HIDDEN(_AES_ECB_encrypt_crypto) .p2align 4 _AES_ECB_encrypt_crypto: #endif /* __APPLE__ */ @@ -10091,6 +10136,7 @@ L_AES_ECB_encrypt_crypto_alldone: #if defined(_CALL_ELF) && _CALL_ELF == 2 .text .globl AES_ECB_decrypt_crypto +WC_ASM_ATT_HIDDEN(AES_ECB_decrypt_crypto) .type AES_ECB_decrypt_crypto,@function .align 16 AES_ECB_decrypt_crypto: @@ -10102,6 +10148,7 @@ AES_ECB_decrypt_crypto: * points at the code (.L.AES_ECB_decrypt_crypto) and the TOC base. */ .section .opd,"aw",@progbits .globl AES_ECB_decrypt_crypto +WC_ASM_ATT_HIDDEN(AES_ECB_decrypt_crypto) .type AES_ECB_decrypt_crypto,@function .align 3 AES_ECB_decrypt_crypto: @@ -10114,6 +10161,7 @@ AES_ECB_decrypt_crypto: #else .section __TEXT,__text .globl _AES_ECB_decrypt_crypto +WC_ASM_ATT_HIDDEN(_AES_ECB_decrypt_crypto) .p2align 4 _AES_ECB_decrypt_crypto: #endif /* __APPLE__ */ @@ -11709,6 +11757,7 @@ L_AES_ECB_decrypt_crypto_alldone: #if defined(_CALL_ELF) && _CALL_ELF == 2 .text .globl AES_CBC_encrypt_crypto +WC_ASM_ATT_HIDDEN(AES_CBC_encrypt_crypto) .type AES_CBC_encrypt_crypto,@function .align 16 AES_CBC_encrypt_crypto: @@ -11720,6 +11769,7 @@ AES_CBC_encrypt_crypto: * points at the code (.L.AES_CBC_encrypt_crypto) and the TOC base. */ .section .opd,"aw",@progbits .globl AES_CBC_encrypt_crypto +WC_ASM_ATT_HIDDEN(AES_CBC_encrypt_crypto) .type AES_CBC_encrypt_crypto,@function .align 3 AES_CBC_encrypt_crypto: @@ -11732,6 +11782,7 @@ AES_CBC_encrypt_crypto: #else .section __TEXT,__text .globl _AES_CBC_encrypt_crypto +WC_ASM_ATT_HIDDEN(_AES_CBC_encrypt_crypto) .p2align 4 _AES_CBC_encrypt_crypto: #endif /* __APPLE__ */ @@ -11983,6 +12034,7 @@ L_AES_CBC_encrypt_crypto_alldone: #if defined(_CALL_ELF) && _CALL_ELF == 2 .text .globl AES_CBC_decrypt_crypto +WC_ASM_ATT_HIDDEN(AES_CBC_decrypt_crypto) .type AES_CBC_decrypt_crypto,@function .align 16 AES_CBC_decrypt_crypto: @@ -11994,6 +12046,7 @@ AES_CBC_decrypt_crypto: * points at the code (.L.AES_CBC_decrypt_crypto) and the TOC base. */ .section .opd,"aw",@progbits .globl AES_CBC_decrypt_crypto +WC_ASM_ATT_HIDDEN(AES_CBC_decrypt_crypto) .type AES_CBC_decrypt_crypto,@function .align 3 AES_CBC_decrypt_crypto: @@ -12006,6 +12059,7 @@ AES_CBC_decrypt_crypto: #else .section __TEXT,__text .globl _AES_CBC_decrypt_crypto +WC_ASM_ATT_HIDDEN(_AES_CBC_decrypt_crypto) .p2align 4 _AES_CBC_decrypt_crypto: #endif /* __APPLE__ */ @@ -13851,6 +13905,7 @@ L_AES_CBC_decrypt_crypto_alldone: #if defined(_CALL_ELF) && _CALL_ELF == 2 .text .globl AES_CTR_encrypt_crypto +WC_ASM_ATT_HIDDEN(AES_CTR_encrypt_crypto) .type AES_CTR_encrypt_crypto,@function .align 16 AES_CTR_encrypt_crypto: @@ -13862,6 +13917,7 @@ AES_CTR_encrypt_crypto: * points at the code (.L.AES_CTR_encrypt_crypto) and the TOC base. */ .section .opd,"aw",@progbits .globl AES_CTR_encrypt_crypto +WC_ASM_ATT_HIDDEN(AES_CTR_encrypt_crypto) .type AES_CTR_encrypt_crypto,@function .align 3 AES_CTR_encrypt_crypto: @@ -13874,6 +13930,7 @@ AES_CTR_encrypt_crypto: #else .section __TEXT,__text .globl _AES_CTR_encrypt_crypto +WC_ASM_ATT_HIDDEN(_AES_CTR_encrypt_crypto) .p2align 4 _AES_CTR_encrypt_crypto: #endif /* __APPLE__ */ @@ -15904,6 +15961,7 @@ L_AES_CTR_encrypt_crypto_alldone: #if defined(_CALL_ELF) && _CALL_ELF == 2 .text .globl AES_GCM_encrypt_crypto +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_crypto) .type AES_GCM_encrypt_crypto,@function .align 16 AES_GCM_encrypt_crypto: @@ -15915,6 +15973,7 @@ AES_GCM_encrypt_crypto: * points at the code (.L.AES_GCM_encrypt_crypto) and the TOC base. */ .section .opd,"aw",@progbits .globl AES_GCM_encrypt_crypto +WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_crypto) .type AES_GCM_encrypt_crypto,@function .align 3 AES_GCM_encrypt_crypto: @@ -15927,6 +15986,7 @@ AES_GCM_encrypt_crypto: #else .section __TEXT,__text .globl _AES_GCM_encrypt_crypto +WC_ASM_ATT_HIDDEN(_AES_GCM_encrypt_crypto) .p2align 4 _AES_GCM_encrypt_crypto: #endif /* __APPLE__ */ @@ -17957,6 +18017,7 @@ L_AES_GCM_encrypt_crypto_alldone: #if defined(_CALL_ELF) && _CALL_ELF == 2 .text .globl AES_XTS_encrypt_crypto +WC_ASM_ATT_HIDDEN(AES_XTS_encrypt_crypto) .type AES_XTS_encrypt_crypto,@function .align 16 AES_XTS_encrypt_crypto: @@ -17968,6 +18029,7 @@ AES_XTS_encrypt_crypto: * points at the code (.L.AES_XTS_encrypt_crypto) and the TOC base. */ .section .opd,"aw",@progbits .globl AES_XTS_encrypt_crypto +WC_ASM_ATT_HIDDEN(AES_XTS_encrypt_crypto) .type AES_XTS_encrypt_crypto,@function .align 3 AES_XTS_encrypt_crypto: @@ -17980,6 +18042,7 @@ AES_XTS_encrypt_crypto: #else .section __TEXT,__text .globl _AES_XTS_encrypt_crypto +WC_ASM_ATT_HIDDEN(_AES_XTS_encrypt_crypto) .p2align 4 _AES_XTS_encrypt_crypto: #endif /* __APPLE__ */ @@ -21950,6 +22013,7 @@ L_AES_XTS_encrypt_crypto_alldone: #if defined(_CALL_ELF) && _CALL_ELF == 2 .text .globl AES_XTS_decrypt_crypto +WC_ASM_ATT_HIDDEN(AES_XTS_decrypt_crypto) .type AES_XTS_decrypt_crypto,@function .align 16 AES_XTS_decrypt_crypto: @@ -21961,6 +22025,7 @@ AES_XTS_decrypt_crypto: * points at the code (.L.AES_XTS_decrypt_crypto) and the TOC base. */ .section .opd,"aw",@progbits .globl AES_XTS_decrypt_crypto +WC_ASM_ATT_HIDDEN(AES_XTS_decrypt_crypto) .type AES_XTS_decrypt_crypto,@function .align 3 AES_XTS_decrypt_crypto: @@ -21973,6 +22038,7 @@ AES_XTS_decrypt_crypto: #else .section __TEXT,__text .globl _AES_XTS_decrypt_crypto +WC_ASM_ATT_HIDDEN(_AES_XTS_decrypt_crypto) .p2align 4 _AES_XTS_decrypt_crypto: #endif /* __APPLE__ */ diff --git a/wolfcrypt/src/port/ppc64/ppc64-sha256-asm.S b/wolfcrypt/src/port/ppc64/ppc64-sha256-asm.S index 5e060133a5f..a64b980eec3 100644 --- a/wolfcrypt/src/port/ppc64/ppc64-sha256-asm.S +++ b/wolfcrypt/src/port/ppc64/ppc64-sha256-asm.S @@ -67,6 +67,7 @@ L_SHA256_transform_len_k: #if defined(_CALL_ELF) && _CALL_ELF == 2 .text .globl Transform_Sha256_Len +WC_ASM_ATT_HIDDEN(Transform_Sha256_Len) .type Transform_Sha256_Len,@function .align 16 Transform_Sha256_Len: @@ -78,6 +79,7 @@ Transform_Sha256_Len: * points at the code (.L.Transform_Sha256_Len) and the TOC base. */ .section .opd,"aw",@progbits .globl Transform_Sha256_Len +WC_ASM_ATT_HIDDEN(Transform_Sha256_Len) .type Transform_Sha256_Len,@function .align 3 Transform_Sha256_Len: @@ -90,6 +92,7 @@ Transform_Sha256_Len: #else .section __TEXT,__text .globl _Transform_Sha256_Len +WC_ASM_ATT_HIDDEN(_Transform_Sha256_Len) .p2align 4 _Transform_Sha256_Len: #endif /* __APPLE__ */ @@ -3418,6 +3421,7 @@ L_SHA256_crypto_k: #if defined(_CALL_ELF) && _CALL_ELF == 2 .text .globl Transform_Sha256_Len_crypto +WC_ASM_ATT_HIDDEN(Transform_Sha256_Len_crypto) .type Transform_Sha256_Len_crypto,@function .align 16 Transform_Sha256_Len_crypto: @@ -3429,6 +3433,7 @@ Transform_Sha256_Len_crypto: * points at the code (.L.Transform_Sha256_Len_crypto) and the TOC base. */ .section .opd,"aw",@progbits .globl Transform_Sha256_Len_crypto +WC_ASM_ATT_HIDDEN(Transform_Sha256_Len_crypto) .type Transform_Sha256_Len_crypto,@function .align 3 Transform_Sha256_Len_crypto: @@ -3441,6 +3446,7 @@ Transform_Sha256_Len_crypto: #else .section __TEXT,__text .globl _Transform_Sha256_Len_crypto +WC_ASM_ATT_HIDDEN(_Transform_Sha256_Len_crypto) .p2align 4 _Transform_Sha256_Len_crypto: #endif /* __APPLE__ */ diff --git a/wolfcrypt/src/port/ppc64/ppc64-sha3-asm.S b/wolfcrypt/src/port/ppc64/ppc64-sha3-asm.S index 4f23637debe..0267121ea8b 100644 --- a/wolfcrypt/src/port/ppc64/ppc64-sha3-asm.S +++ b/wolfcrypt/src/port/ppc64/ppc64-sha3-asm.S @@ -63,6 +63,7 @@ L_SHA3_transform_base_r: #if defined(_CALL_ELF) && _CALL_ELF == 2 .text .globl BlockSha3_base +WC_ASM_ATT_HIDDEN(BlockSha3_base) .type BlockSha3_base,@function .align 16 BlockSha3_base: @@ -74,6 +75,7 @@ BlockSha3_base: * points at the code (.L.BlockSha3_base) and the TOC base. */ .section .opd,"aw",@progbits .globl BlockSha3_base +WC_ASM_ATT_HIDDEN(BlockSha3_base) .type BlockSha3_base,@function .align 3 BlockSha3_base: @@ -86,6 +88,7 @@ BlockSha3_base: #else .section __TEXT,__text .globl _BlockSha3_base +WC_ASM_ATT_HIDDEN(_BlockSha3_base) .p2align 4 _BlockSha3_base: #endif /* __APPLE__ */ @@ -386,6 +389,7 @@ L_SHA3_transform_power8_r: #if defined(_CALL_ELF) && _CALL_ELF == 2 .text .globl BlockSha3_power8 +WC_ASM_ATT_HIDDEN(BlockSha3_power8) .type BlockSha3_power8,@function .align 16 BlockSha3_power8: @@ -397,6 +401,7 @@ BlockSha3_power8: * points at the code (.L.BlockSha3_power8) and the TOC base. */ .section .opd,"aw",@progbits .globl BlockSha3_power8 +WC_ASM_ATT_HIDDEN(BlockSha3_power8) .type BlockSha3_power8,@function .align 3 BlockSha3_power8: @@ -409,6 +414,7 @@ BlockSha3_power8: #else .section __TEXT,__text .globl _BlockSha3_power8 +WC_ASM_ATT_HIDDEN(_BlockSha3_power8) .p2align 4 _BlockSha3_power8: #endif /* __APPLE__ */ @@ -832,6 +838,7 @@ L_SHA3_blocksx2_power8_r: #if defined(_CALL_ELF) && _CALL_ELF == 2 .text .globl sha3_blocksx2_power8 +WC_ASM_ATT_HIDDEN(sha3_blocksx2_power8) .type sha3_blocksx2_power8,@function .align 16 sha3_blocksx2_power8: @@ -843,6 +850,7 @@ sha3_blocksx2_power8: * points at the code (.L.sha3_blocksx2_power8) and the TOC base. */ .section .opd,"aw",@progbits .globl sha3_blocksx2_power8 +WC_ASM_ATT_HIDDEN(sha3_blocksx2_power8) .type sha3_blocksx2_power8,@function .align 3 sha3_blocksx2_power8: @@ -855,6 +863,7 @@ sha3_blocksx2_power8: #else .section __TEXT,__text .globl _sha3_blocksx2_power8 +WC_ASM_ATT_HIDDEN(_sha3_blocksx2_power8) .p2align 4 _sha3_blocksx2_power8: #endif /* __APPLE__ */ @@ -1280,6 +1289,7 @@ L_SHA3_blocksx3_power8_r: #if defined(_CALL_ELF) && _CALL_ELF == 2 .text .globl sha3_blocksx3_power8 +WC_ASM_ATT_HIDDEN(sha3_blocksx3_power8) .type sha3_blocksx3_power8,@function .align 16 sha3_blocksx3_power8: @@ -1291,6 +1301,7 @@ sha3_blocksx3_power8: * points at the code (.L.sha3_blocksx3_power8) and the TOC base. */ .section .opd,"aw",@progbits .globl sha3_blocksx3_power8 +WC_ASM_ATT_HIDDEN(sha3_blocksx3_power8) .type sha3_blocksx3_power8,@function .align 3 sha3_blocksx3_power8: @@ -1303,6 +1314,7 @@ sha3_blocksx3_power8: #else .section __TEXT,__text .globl _sha3_blocksx3_power8 +WC_ASM_ATT_HIDDEN(_sha3_blocksx3_power8) .p2align 4 _sha3_blocksx3_power8: #endif /* __APPLE__ */ diff --git a/wolfcrypt/src/port/ppc64/ppc64-sha512-asm.S b/wolfcrypt/src/port/ppc64/ppc64-sha512-asm.S index 736dbd9dbdb..7b668d6c4d6 100644 --- a/wolfcrypt/src/port/ppc64/ppc64-sha512-asm.S +++ b/wolfcrypt/src/port/ppc64/ppc64-sha512-asm.S @@ -91,6 +91,7 @@ L_SHA512_transform_len_k: #if defined(_CALL_ELF) && _CALL_ELF == 2 .text .globl Transform_Sha512_Len +WC_ASM_ATT_HIDDEN(Transform_Sha512_Len) .type Transform_Sha512_Len,@function .align 16 Transform_Sha512_Len: @@ -102,6 +103,7 @@ Transform_Sha512_Len: * points at the code (.L.Transform_Sha512_Len) and the TOC base. */ .section .opd,"aw",@progbits .globl Transform_Sha512_Len +WC_ASM_ATT_HIDDEN(Transform_Sha512_Len) .type Transform_Sha512_Len,@function .align 3 Transform_Sha512_Len: @@ -114,6 +116,7 @@ Transform_Sha512_Len: #else .section __TEXT,__text .globl _Transform_Sha512_Len +WC_ASM_ATT_HIDDEN(_Transform_Sha512_Len) .p2align 4 _Transform_Sha512_Len: #endif /* __APPLE__ */ @@ -4107,6 +4110,7 @@ L_SHA512_crypto_k: #if defined(_CALL_ELF) && _CALL_ELF == 2 .text .globl Transform_Sha512_Len_crypto +WC_ASM_ATT_HIDDEN(Transform_Sha512_Len_crypto) .type Transform_Sha512_Len_crypto,@function .align 16 Transform_Sha512_Len_crypto: @@ -4118,6 +4122,7 @@ Transform_Sha512_Len_crypto: * points at the code (.L.Transform_Sha512_Len_crypto) and the TOC base. */ .section .opd,"aw",@progbits .globl Transform_Sha512_Len_crypto +WC_ASM_ATT_HIDDEN(Transform_Sha512_Len_crypto) .type Transform_Sha512_Len_crypto,@function .align 3 Transform_Sha512_Len_crypto: @@ -4130,6 +4135,7 @@ Transform_Sha512_Len_crypto: #else .section __TEXT,__text .globl _Transform_Sha512_Len_crypto +WC_ASM_ATT_HIDDEN(_Transform_Sha512_Len_crypto) .p2align 4 _Transform_Sha512_Len_crypto: #endif /* __APPLE__ */ diff --git a/wolfcrypt/src/port/riscv64/riscv-64-aes-asm.S b/wolfcrypt/src/port/riscv64/riscv-64-aes-asm.S index f5db756d26d..a813e65d7d7 100644 --- a/wolfcrypt/src/port/riscv64/riscv-64-aes-asm.S +++ b/wolfcrypt/src/port/riscv64/riscv-64-aes-asm.S @@ -34,6 +34,7 @@ #ifdef WOLFSSL_RISCV_VECTOR_CRYPTO_ASM .text .globl AES_set_key_RISCV64 + WC_ASM_ATT_HIDDEN(AES_set_key_RISCV64) .type AES_set_key_RISCV64,@function .align 2 AES_set_key_RISCV64: @@ -873,6 +874,7 @@ L_AES_set_key_RISCV64_done: #ifdef HAVE_AESGCM .text .globl AES_GCM_encrypt_RISCV64 + WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_RISCV64) .type AES_GCM_encrypt_RISCV64,@function .align 2 AES_GCM_encrypt_RISCV64: @@ -1485,6 +1487,7 @@ L_AES_GCM_encrypt_RISCV64_store_tag: #ifdef HAVE_AES_DECRYPT .text .globl AES_GCM_decrypt_RISCV64 + WC_ASM_ATT_HIDDEN(AES_GCM_decrypt_RISCV64) .type AES_GCM_decrypt_RISCV64,@function .align 2 AES_GCM_decrypt_RISCV64: @@ -2105,6 +2108,7 @@ L_AES_GCM_decrypt_RISCV64_cmp_tag: #ifdef WOLFSSL_AESGCM_STREAM .text .globl AES_GCM_init_RISCV64 + WC_ASM_ATT_HIDDEN(AES_GCM_init_RISCV64) .type AES_GCM_init_RISCV64,@function .align 2 AES_GCM_init_RISCV64: @@ -2250,6 +2254,7 @@ L_AES_GCM_init_RISCV64_aes_last: .size AES_GCM_init_RISCV64,.-AES_GCM_init_RISCV64 .text .globl AES_GCM_ghash_block_RISCV64 + WC_ASM_ATT_HIDDEN(AES_GCM_ghash_block_RISCV64) .type AES_GCM_ghash_block_RISCV64,@function .align 2 AES_GCM_ghash_block_RISCV64: @@ -2273,6 +2278,7 @@ AES_GCM_ghash_block_RISCV64: .size AES_GCM_ghash_block_RISCV64,.-AES_GCM_ghash_block_RISCV64 .text .globl AES_GCM_aad_update_RISCV64 + WC_ASM_ATT_HIDDEN(AES_GCM_aad_update_RISCV64) .type AES_GCM_aad_update_RISCV64,@function .align 2 AES_GCM_aad_update_RISCV64: @@ -2303,6 +2309,7 @@ L_AES_GCM_aad_update_RISCV64_done: .size AES_GCM_aad_update_RISCV64,.-AES_GCM_aad_update_RISCV64 .text .globl AES_GCM_encrypt_block_RISCV64 + WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_block_RISCV64) .type AES_GCM_encrypt_block_RISCV64,@function .align 2 AES_GCM_encrypt_block_RISCV64: @@ -2393,6 +2400,7 @@ L_AES_GCM_encrypt_block_RISCV64_aes_last: .size AES_GCM_encrypt_block_RISCV64,.-AES_GCM_encrypt_block_RISCV64 .text .globl AES_GCM_encrypt_update_RISCV64 + WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_update_RISCV64) .type AES_GCM_encrypt_update_RISCV64,@function .align 2 AES_GCM_encrypt_update_RISCV64: @@ -2508,6 +2516,7 @@ L_AES_GCM_encrypt_update_RISCV64_done: .size AES_GCM_encrypt_update_RISCV64,.-AES_GCM_encrypt_update_RISCV64 .text .globl AES_GCM_encrypt_final_RISCV64 + WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_final_RISCV64) .type AES_GCM_encrypt_final_RISCV64,@function .align 2 AES_GCM_encrypt_final_RISCV64: @@ -2572,6 +2581,7 @@ L_AES_GCM_encrypt_final_RISCV64_store: #ifdef HAVE_AES_DECRYPT .text .globl AES_GCM_decrypt_update_RISCV64 + WC_ASM_ATT_HIDDEN(AES_GCM_decrypt_update_RISCV64) .type AES_GCM_decrypt_update_RISCV64,@function .align 2 AES_GCM_decrypt_update_RISCV64: @@ -2687,6 +2697,7 @@ L_AES_GCM_decrypt_update_RISCV64_done: .size AES_GCM_decrypt_update_RISCV64,.-AES_GCM_decrypt_update_RISCV64 .text .globl AES_GCM_decrypt_final_RISCV64 + WC_ASM_ATT_HIDDEN(AES_GCM_decrypt_final_RISCV64) .type AES_GCM_decrypt_final_RISCV64,@function .align 2 AES_GCM_decrypt_final_RISCV64: @@ -2760,6 +2771,7 @@ L_AES_GCM_decrypt_final_RISCV64_cmp: #ifdef WOLFSSL_AES_XTS .text .globl AES_XTS_encrypt_RISCV64 + WC_ASM_ATT_HIDDEN(AES_XTS_encrypt_RISCV64) .type AES_XTS_encrypt_RISCV64,@function .align 2 AES_XTS_encrypt_RISCV64: @@ -3558,6 +3570,7 @@ L_AES_XTS_encrypt_RISCV64_done: #ifdef HAVE_AES_DECRYPT .text .globl AES_XTS_decrypt_RISCV64 + WC_ASM_ATT_HIDDEN(AES_XTS_decrypt_RISCV64) .type AES_XTS_decrypt_RISCV64,@function .align 2 AES_XTS_decrypt_RISCV64: @@ -4429,6 +4442,7 @@ L_AES_XTS_decrypt_RISCV64_done: #if defined(HAVE_AESCCM) || defined(HAVE_AESGCM) || defined(WOLFSSL_AES_DIRECT) || defined(WOLFSSL_AES_COUNTER) || defined(HAVE_AES_CBC) .text .globl AES_encrypt_RISCV64 + WC_ASM_ATT_HIDDEN(AES_encrypt_RISCV64) .type AES_encrypt_RISCV64,@function .align 2 AES_encrypt_RISCV64: @@ -4500,6 +4514,7 @@ L_AES_encrypt_RISCV64_last: #ifdef HAVE_AES_DECRYPT .text .globl AES_decrypt_RISCV64 + WC_ASM_ATT_HIDDEN(AES_decrypt_RISCV64) .type AES_decrypt_RISCV64,@function .align 2 AES_decrypt_RISCV64: @@ -4573,6 +4588,7 @@ L_AES_decrypt_RISCV64_last: #ifdef HAVE_AES_ECB .text .globl AES_encrypt_blocks_RISCV64 + WC_ASM_ATT_HIDDEN(AES_encrypt_blocks_RISCV64) .type AES_encrypt_blocks_RISCV64,@function .align 2 AES_encrypt_blocks_RISCV64: @@ -4795,6 +4811,7 @@ L_AES_encrypt_blocks_RISCV64_done: #ifdef HAVE_AES_DECRYPT .text .globl AES_decrypt_blocks_RISCV64 + WC_ASM_ATT_HIDDEN(AES_decrypt_blocks_RISCV64) .type AES_decrypt_blocks_RISCV64,@function .align 2 AES_decrypt_blocks_RISCV64: @@ -5019,6 +5036,7 @@ L_AES_decrypt_blocks_RISCV64_done: #ifdef HAVE_AES_CBC .text .globl AES_CBC_encrypt_RISCV64 + WC_ASM_ATT_HIDDEN(AES_CBC_encrypt_RISCV64) .type AES_CBC_encrypt_RISCV64,@function .align 2 AES_CBC_encrypt_RISCV64: @@ -5111,6 +5129,7 @@ L_AES_CBC_encrypt_RISCV64_done: #ifdef HAVE_AES_DECRYPT .text .globl AES_CBC_decrypt_RISCV64 + WC_ASM_ATT_HIDDEN(AES_CBC_decrypt_RISCV64) .type AES_CBC_decrypt_RISCV64,@function .align 2 AES_CBC_decrypt_RISCV64: @@ -5398,6 +5417,7 @@ L_AES_CBC_decrypt_RISCV64_done: #ifdef WOLFSSL_AES_COUNTER .text .globl AES_CTR_encrypt_RISCV64 + WC_ASM_ATT_HIDDEN(AES_CTR_encrypt_RISCV64) .type AES_CTR_encrypt_RISCV64,@function .align 2 AES_CTR_encrypt_RISCV64: @@ -6098,6 +6118,7 @@ L_AES_CTR_encrypt_RISCV64_store: #ifdef WOLFSSL_RISCV_SCALAR_CRYPTO_ASM .text .globl AES_set_key_RISCV64 + WC_ASM_ATT_HIDDEN(AES_set_key_RISCV64) .type AES_set_key_RISCV64,@function .align 2 AES_set_key_RISCV64: @@ -7795,6 +7816,7 @@ L_AES_set_key_RISCV64_done: #if defined(HAVE_AESCCM) || defined(HAVE_AESGCM) || defined(WOLFSSL_AES_DIRECT) || defined(WOLFSSL_AES_COUNTER) || defined(HAVE_AES_CBC) .text .globl AES_encrypt_RISCV64 + WC_ASM_ATT_HIDDEN(AES_encrypt_RISCV64) .type AES_encrypt_RISCV64,@function .align 2 AES_encrypt_RISCV64: @@ -8121,6 +8143,7 @@ L_ualn_sd22_e: #ifdef HAVE_AES_DECRYPT .text .globl AES_decrypt_RISCV64 + WC_ASM_ATT_HIDDEN(AES_decrypt_RISCV64) .type AES_decrypt_RISCV64,@function .align 2 AES_decrypt_RISCV64: @@ -8449,6 +8472,7 @@ L_ualn_sd26_e: #ifdef HAVE_AES_ECB .text .globl AES_encrypt_blocks_RISCV64 + WC_ASM_ATT_HIDDEN(AES_encrypt_blocks_RISCV64) .type AES_encrypt_blocks_RISCV64,@function .align 2 AES_encrypt_blocks_RISCV64: @@ -8782,6 +8806,7 @@ L_AES_encrypt_blocks_RISCV64_end: #ifdef HAVE_AES_DECRYPT .text .globl AES_decrypt_blocks_RISCV64 + WC_ASM_ATT_HIDDEN(AES_decrypt_blocks_RISCV64) .type AES_decrypt_blocks_RISCV64,@function .align 2 AES_decrypt_blocks_RISCV64: @@ -9117,6 +9142,7 @@ L_AES_decrypt_blocks_RISCV64_end: #ifdef HAVE_AES_CBC .text .globl AES_CBC_encrypt_RISCV64 + WC_ASM_ATT_HIDDEN(AES_CBC_encrypt_RISCV64) .type AES_CBC_encrypt_RISCV64,@function .align 2 AES_CBC_encrypt_RISCV64: @@ -9465,6 +9491,7 @@ L_AES_CBC_encrypt_RISCV64_end: #ifdef HAVE_AES_DECRYPT .text .globl AES_CBC_decrypt_RISCV64 + WC_ASM_ATT_HIDDEN(AES_CBC_decrypt_RISCV64) .type AES_CBC_decrypt_RISCV64,@function .align 2 AES_CBC_decrypt_RISCV64: @@ -9821,6 +9848,7 @@ L_AES_CBC_decrypt_RISCV64_end: #ifdef WOLFSSL_AES_COUNTER .text .globl AES_CTR_encrypt_RISCV64 + WC_ASM_ATT_HIDDEN(AES_CTR_encrypt_RISCV64) .type AES_CTR_encrypt_RISCV64,@function .align 2 AES_CTR_encrypt_RISCV64: @@ -10556,6 +10584,7 @@ L_AES_CTR_encrypt_RISCV64_done: #ifdef WOLFSSL_AES_XTS .text .globl AES_XTS_encrypt_RISCV64 + WC_ASM_ATT_HIDDEN(AES_XTS_encrypt_RISCV64) .type AES_XTS_encrypt_RISCV64,@function .align 2 AES_XTS_encrypt_RISCV64: @@ -11495,6 +11524,7 @@ L_AES_XTS_encrypt_RISCV64_cts_done: #ifdef HAVE_AES_DECRYPT .text .globl AES_XTS_decrypt_RISCV64 + WC_ASM_ATT_HIDDEN(AES_XTS_decrypt_RISCV64) .type AES_XTS_decrypt_RISCV64,@function .align 2 AES_XTS_decrypt_RISCV64: @@ -12576,6 +12606,7 @@ L_AES_XTS_decrypt_RISCV64_cts_done: #ifdef HAVE_AESGCM .text .globl AES_GCM_set_key_RISCV64 + WC_ASM_ATT_HIDDEN(AES_GCM_set_key_RISCV64) .type AES_GCM_set_key_RISCV64,@function .align 2 AES_GCM_set_key_RISCV64: @@ -12857,6 +12888,7 @@ L_AES_GCM_set_key_RISCV64_done: .size AES_GCM_set_key_RISCV64,.-AES_GCM_set_key_RISCV64 .text .globl GHASH_RISCV64 + WC_ASM_ATT_HIDDEN(GHASH_RISCV64) .type GHASH_RISCV64,@function .align 2 GHASH_RISCV64: @@ -13145,6 +13177,7 @@ L_GHASH_RISCV64_ret: .size GHASH_RISCV64,.-GHASH_RISCV64 .text .globl AES_GCM_encrypt_RISCV64 + WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_RISCV64) .type AES_GCM_encrypt_RISCV64,@function .align 2 AES_GCM_encrypt_RISCV64: @@ -14998,6 +15031,7 @@ L_AES_GCM_encrypt_RISCV64_stag: #ifdef HAVE_AES_DECRYPT .text .globl AES_GCM_decrypt_RISCV64 + WC_ASM_ATT_HIDDEN(AES_GCM_decrypt_RISCV64) .type AES_GCM_decrypt_RISCV64,@function .align 2 AES_GCM_decrypt_RISCV64: @@ -16856,6 +16890,7 @@ L_AES_GCM_decrypt_RISCV64_ctag: #ifdef WOLFSSL_AESGCM_STREAM .text .globl AES_GCM_init_RISCV64 + WC_ASM_ATT_HIDDEN(AES_GCM_init_RISCV64) .type AES_GCM_init_RISCV64,@function .align 2 AES_GCM_init_RISCV64: @@ -17560,6 +17595,7 @@ L_AES_GCM_init_RISCV64_ekj0_done: .size AES_GCM_init_RISCV64,.-AES_GCM_init_RISCV64 .text .globl AES_GCM_ghash_block_RISCV64 + WC_ASM_ATT_HIDDEN(AES_GCM_ghash_block_RISCV64) .type AES_GCM_ghash_block_RISCV64,@function .align 2 AES_GCM_ghash_block_RISCV64: @@ -17851,6 +17887,7 @@ L_ualn_ld96_e: .size AES_GCM_ghash_block_RISCV64,.-AES_GCM_ghash_block_RISCV64 .text .globl AES_GCM_aad_update_RISCV64 + WC_ASM_ATT_HIDDEN(AES_GCM_aad_update_RISCV64) .type AES_GCM_aad_update_RISCV64,@function .align 2 AES_GCM_aad_update_RISCV64: @@ -18154,6 +18191,7 @@ L_AES_GCM_aad_update_RISCV64_done: .size AES_GCM_aad_update_RISCV64,.-AES_GCM_aad_update_RISCV64 .text .globl AES_GCM_encrypt_block_RISCV64 + WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_block_RISCV64) .type AES_GCM_encrypt_block_RISCV64,@function .align 2 AES_GCM_encrypt_block_RISCV64: @@ -18507,6 +18545,7 @@ L_ualn_sd102_e: .size AES_GCM_encrypt_block_RISCV64,.-AES_GCM_encrypt_block_RISCV64 .text .globl AES_GCM_encrypt_update_RISCV64 + WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_update_RISCV64) .type AES_GCM_encrypt_update_RISCV64,@function .align 2 AES_GCM_encrypt_update_RISCV64: @@ -19054,6 +19093,7 @@ L_AES_GCM_encrypt_update_RISCV64_done: .size AES_GCM_encrypt_update_RISCV64,.-AES_GCM_encrypt_update_RISCV64 .text .globl AES_GCM_encrypt_final_RISCV64 + WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_final_RISCV64) .type AES_GCM_encrypt_final_RISCV64,@function .align 2 AES_GCM_encrypt_final_RISCV64: @@ -19292,6 +19332,7 @@ L_AES_GCM_encrypt_final_RISCV64_stag: #ifdef HAVE_AES_DECRYPT .text .globl AES_GCM_decrypt_update_RISCV64 + WC_ASM_ATT_HIDDEN(AES_GCM_decrypt_update_RISCV64) .type AES_GCM_decrypt_update_RISCV64,@function .align 2 AES_GCM_decrypt_update_RISCV64: @@ -19837,6 +19878,7 @@ L_AES_GCM_decrypt_update_RISCV64_done: .size AES_GCM_decrypt_update_RISCV64,.-AES_GCM_decrypt_update_RISCV64 .text .globl AES_GCM_decrypt_final_RISCV64 + WC_ASM_ATT_HIDDEN(AES_GCM_decrypt_final_RISCV64) .type AES_GCM_decrypt_final_RISCV64,@function .align 2 AES_GCM_decrypt_final_RISCV64: @@ -20745,6 +20787,7 @@ L_AES_base_gcm_r: #endif /* HAVE_AESGCM */ .text .globl AES_set_key_RISCV64 + WC_ASM_ATT_HIDDEN(AES_set_key_RISCV64) .type AES_set_key_RISCV64,@function .align 2 AES_set_key_RISCV64: @@ -21962,6 +22005,7 @@ L_AES_set_key_RISCV64_done: #if defined(HAVE_AESCCM) || defined(HAVE_AESGCM) || defined(WOLFSSL_AES_DIRECT) || defined(WOLFSSL_AES_COUNTER) || defined(HAVE_AES_CBC) .text .globl AES_encrypt_RISCV64 + WC_ASM_ATT_HIDDEN(AES_encrypt_RISCV64) .type AES_encrypt_RISCV64,@function .align 2 AES_encrypt_RISCV64: @@ -23532,6 +23576,7 @@ L_AES_encrypt_RISCV64_done: #ifdef HAVE_AES_DECRYPT .text .globl AES_decrypt_RISCV64 + WC_ASM_ATT_HIDDEN(AES_decrypt_RISCV64) .type AES_decrypt_RISCV64,@function .align 2 AES_decrypt_RISCV64: @@ -25078,6 +25123,7 @@ L_AES_decrypt_RISCV64_done: #ifdef HAVE_AES_ECB .text .globl AES_encrypt_blocks_RISCV64 + WC_ASM_ATT_HIDDEN(AES_encrypt_blocks_RISCV64) .type AES_encrypt_blocks_RISCV64,@function .align 2 AES_encrypt_blocks_RISCV64: @@ -26666,6 +26712,7 @@ L_AES_encrypt_blocks_RISCV64_end: #ifdef HAVE_AES_DECRYPT .text .globl AES_decrypt_blocks_RISCV64 + WC_ASM_ATT_HIDDEN(AES_decrypt_blocks_RISCV64) .type AES_decrypt_blocks_RISCV64,@function .align 2 AES_decrypt_blocks_RISCV64: @@ -28230,6 +28277,7 @@ L_AES_decrypt_blocks_RISCV64_end: #ifdef HAVE_AES_CBC .text .globl AES_CBC_encrypt_RISCV64 + WC_ASM_ATT_HIDDEN(AES_CBC_encrypt_RISCV64) .type AES_CBC_encrypt_RISCV64,@function .align 2 AES_CBC_encrypt_RISCV64: @@ -30048,6 +30096,7 @@ L_AES_CBC_encrypt_RISCV64_end: #ifdef HAVE_AES_DECRYPT .text .globl AES_CBC_decrypt_RISCV64 + WC_ASM_ATT_HIDDEN(AES_CBC_decrypt_RISCV64) .type AES_CBC_decrypt_RISCV64,@function .align 2 AES_CBC_decrypt_RISCV64: @@ -31826,6 +31875,7 @@ L_AES_CBC_decrypt_RISCV64_end: #ifdef WOLFSSL_AES_COUNTER .text .globl AES_CTR_encrypt_RISCV64 + WC_ASM_ATT_HIDDEN(AES_CTR_encrypt_RISCV64) .type AES_CTR_encrypt_RISCV64,@function .align 2 AES_CTR_encrypt_RISCV64: @@ -35233,6 +35283,7 @@ L_AES_CTR_encrypt_RISCV64_done: #ifdef WOLFSSL_AES_XTS .text .globl AES_XTS_encrypt_RISCV64 + WC_ASM_ATT_HIDDEN(AES_XTS_encrypt_RISCV64) .type AES_XTS_encrypt_RISCV64,@function .align 2 AES_XTS_encrypt_RISCV64: @@ -40367,6 +40418,7 @@ L_AES_XTS_encrypt_RISCV64_done: #ifdef HAVE_AES_DECRYPT .text .globl AES_XTS_decrypt_RISCV64 + WC_ASM_ATT_HIDDEN(AES_XTS_decrypt_RISCV64) .type AES_XTS_decrypt_RISCV64,@function .align 2 AES_XTS_decrypt_RISCV64: @@ -46994,6 +47046,7 @@ L_AES_XTS_decrypt_RISCV64_done: #ifdef HAVE_AESGCM .text .globl AES_GCM_encrypt_RISCV64 + WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_RISCV64) .type AES_GCM_encrypt_RISCV64,@function .align 2 AES_GCM_encrypt_RISCV64: @@ -57048,6 +57101,7 @@ L_AES_GCM_encrypt_RISCV64_store_tag: #ifdef HAVE_AES_DECRYPT .text .globl AES_GCM_decrypt_RISCV64 + WC_ASM_ATT_HIDDEN(AES_GCM_decrypt_RISCV64) .type AES_GCM_decrypt_RISCV64,@function .align 2 AES_GCM_decrypt_RISCV64: @@ -67110,6 +67164,7 @@ L_AES_GCM_decrypt_RISCV64_check_tag: #ifdef WOLFSSL_AESGCM_STREAM .text .globl AES_GCM_init_RISCV64 + WC_ASM_ATT_HIDDEN(AES_GCM_init_RISCV64) .type AES_GCM_init_RISCV64,@function .align 2 AES_GCM_init_RISCV64: @@ -70661,6 +70716,7 @@ L_AES_enc_block_20_done: .size AES_GCM_init_RISCV64,.-AES_GCM_init_RISCV64 .text .globl AES_GCM_ghash_block_RISCV64 + WC_ASM_ATT_HIDDEN(AES_GCM_ghash_block_RISCV64) .type AES_GCM_ghash_block_RISCV64,@function .align 2 AES_GCM_ghash_block_RISCV64: @@ -71283,6 +71339,7 @@ L_AES_GCM_gmult_next19: .size AES_GCM_ghash_block_RISCV64,.-AES_GCM_ghash_block_RISCV64 .text .globl AES_GCM_aad_update_RISCV64 + WC_ASM_ATT_HIDDEN(AES_GCM_aad_update_RISCV64) .type AES_GCM_aad_update_RISCV64,@function .align 2 AES_GCM_aad_update_RISCV64: @@ -71920,6 +71977,7 @@ L_AES_GCM_aad_update_RISCV64_done: .size AES_GCM_aad_update_RISCV64,.-AES_GCM_aad_update_RISCV64 .text .globl AES_GCM_encrypt_block_RISCV64 + WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_block_RISCV64) .type AES_GCM_encrypt_block_RISCV64,@function .align 2 AES_GCM_encrypt_block_RISCV64: @@ -73735,6 +73793,7 @@ L_ualn_sd88_e: .size AES_GCM_encrypt_block_RISCV64,.-AES_GCM_encrypt_block_RISCV64 .text .globl AES_GCM_encrypt_update_RISCV64 + WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_update_RISCV64) .type AES_GCM_encrypt_update_RISCV64,@function .align 2 AES_GCM_encrypt_update_RISCV64: @@ -76179,6 +76238,7 @@ L_AES_GCM_encrypt_update_RISCV64_done: .size AES_GCM_encrypt_update_RISCV64,.-AES_GCM_encrypt_update_RISCV64 .text .globl AES_GCM_encrypt_final_RISCV64 + WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_final_RISCV64) .type AES_GCM_encrypt_final_RISCV64,@function .align 2 AES_GCM_encrypt_final_RISCV64: @@ -76858,6 +76918,7 @@ L_AES_GCM_encrypt_final_RISCV64_store_tag: #ifdef HAVE_AES_DECRYPT .text .globl AES_GCM_decrypt_update_RISCV64 + WC_ASM_ATT_HIDDEN(AES_GCM_decrypt_update_RISCV64) .type AES_GCM_decrypt_update_RISCV64,@function .align 2 AES_GCM_decrypt_update_RISCV64: @@ -79302,6 +79363,7 @@ L_AES_GCM_decrypt_update_RISCV64_done: .size AES_GCM_decrypt_update_RISCV64,.-AES_GCM_decrypt_update_RISCV64 .text .globl AES_GCM_decrypt_final_RISCV64 + WC_ASM_ATT_HIDDEN(AES_GCM_decrypt_final_RISCV64) .type AES_GCM_decrypt_final_RISCV64,@function .align 2 AES_GCM_decrypt_final_RISCV64: diff --git a/wolfcrypt/src/port/riscv64/riscv-64-chacha-asm.S b/wolfcrypt/src/port/riscv64/riscv-64-chacha-asm.S index ef154f7594e..fb5b5dbc496 100644 --- a/wolfcrypt/src/port/riscv64/riscv-64-chacha-asm.S +++ b/wolfcrypt/src/port/riscv64/riscv-64-chacha-asm.S @@ -33,6 +33,7 @@ #ifdef HAVE_CHACHA .text .globl wc_chacha_setiv + WC_ASM_ATT_HIDDEN(wc_chacha_setiv) .type wc_chacha_setiv,@function .align 2 wc_chacha_setiv: @@ -143,6 +144,7 @@ L_chacha20_riscv64_setkey_constants: .long 0x61707865,0x3320646e,0x79622d32,0x6b206574 .text .globl wc_chacha_setkey + WC_ASM_ATT_HIDDEN(wc_chacha_setkey) .type wc_chacha_setkey,@function .align 2 wc_chacha_setkey: @@ -414,6 +416,7 @@ L_ualn_lw11_e: .size wc_chacha_setkey,.-wc_chacha_setkey .text .globl wc_chacha_use_over + WC_ASM_ATT_HIDDEN(wc_chacha_use_over) .type wc_chacha_use_over,@function .align 2 wc_chacha_use_over: @@ -623,6 +626,7 @@ L_chacha20_riscv64_use_over_done: #ifdef WOLFSSL_RISCV_VECTOR .text .globl wc_chacha_crypt_bytes + WC_ASM_ATT_HIDDEN(wc_chacha_crypt_bytes) .type wc_chacha_crypt_bytes,@function .align 2 wc_chacha_crypt_bytes: @@ -3432,6 +3436,7 @@ L_chacha20_riscv64_vec_done: #else .text .globl wc_chacha_crypt_bytes + WC_ASM_ATT_HIDDEN(wc_chacha_crypt_bytes) .type wc_chacha_crypt_bytes,@function .align 2 wc_chacha_crypt_bytes: diff --git a/wolfcrypt/src/port/riscv64/riscv-64-poly1305-asm.S b/wolfcrypt/src/port/riscv64/riscv-64-poly1305-asm.S index 616275d02ac..bb862d86a3b 100644 --- a/wolfcrypt/src/port/riscv64/riscv-64-poly1305-asm.S +++ b/wolfcrypt/src/port/riscv64/riscv-64-poly1305-asm.S @@ -33,6 +33,7 @@ #ifdef HAVE_POLY1305 .text .globl poly1305_set_key_riscv64 + WC_ASM_ATT_HIDDEN(poly1305_set_key_riscv64) .type poly1305_set_key_riscv64,@function .align 2 poly1305_set_key_riscv64: @@ -290,6 +291,7 @@ L_ualn_ld4_e: .size poly1305_set_key_riscv64,.-poly1305_set_key_riscv64 .text .globl poly1305_block_16_riscv64 + WC_ASM_ATT_HIDDEN(poly1305_block_16_riscv64) .type poly1305_block_16_riscv64,@function .align 2 poly1305_block_16_riscv64: @@ -443,6 +445,7 @@ poly1305_block_16_riscv64: .size poly1305_block_16_riscv64,.-poly1305_block_16_riscv64 .text .globl poly1305_blocks_riscv64 + WC_ASM_ATT_HIDDEN(poly1305_blocks_riscv64) .type poly1305_blocks_riscv64,@function .align 2 poly1305_blocks_riscv64: @@ -4287,6 +4290,7 @@ L_poly1305_riscv64_blocks_done: .size poly1305_blocks_riscv64,.-poly1305_blocks_riscv64 .text .globl poly1305_final_riscv64 + WC_ASM_ATT_HIDDEN(poly1305_final_riscv64) .type poly1305_final_riscv64,@function .align 2 poly1305_final_riscv64: diff --git a/wolfcrypt/src/port/riscv64/riscv-64-sha256-asm.S b/wolfcrypt/src/port/riscv64/riscv-64-sha256-asm.S index 10e5646c2c2..14b53bab949 100644 --- a/wolfcrypt/src/port/riscv64/riscv-64-sha256-asm.S +++ b/wolfcrypt/src/port/riscv64/riscv-64-sha256-asm.S @@ -57,6 +57,7 @@ L_SHA256_transform_riscv_vector_len_k: .long 0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2 .text .globl Transform_Sha256_Len_riscv_vector + WC_ASM_ATT_HIDDEN(Transform_Sha256_Len_riscv_vector) .type Transform_Sha256_Len_riscv_vector,@function .align 2 Transform_Sha256_Len_riscv_vector: @@ -248,6 +249,7 @@ L_SHA256_transform_riscv_crypto_len_k: .long 0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2 .text .globl Transform_Sha256_Len_riscv_crypto + WC_ASM_ATT_HIDDEN(Transform_Sha256_Len_riscv_crypto) .type Transform_Sha256_Len_riscv_crypto,@function .align 2 Transform_Sha256_Len_riscv_crypto: @@ -1333,6 +1335,7 @@ L_SHA256_transform_riscv_len_k: .long 0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2 .text .globl Transform_Sha256_Len_riscv + WC_ASM_ATT_HIDDEN(Transform_Sha256_Len_riscv) .type Transform_Sha256_Len_riscv,@function .align 2 Transform_Sha256_Len_riscv: diff --git a/wolfcrypt/src/port/riscv64/riscv-64-sha3-asm.S b/wolfcrypt/src/port/riscv64/riscv-64-sha3-asm.S index de0267dc5ba..c4b50ca5f9a 100644 --- a/wolfcrypt/src/port/riscv64/riscv-64-sha3-asm.S +++ b/wolfcrypt/src/port/riscv64/riscv-64-sha3-asm.S @@ -53,6 +53,7 @@ L_SHA3_transform_vector_r: .quad 0x0000000080000001,0x8000000080008008 .text .globl BlockSha3 + WC_ASM_ATT_HIDDEN(BlockSha3) .type BlockSha3,@function .align 2 BlockSha3: @@ -580,6 +581,7 @@ L_SHA3_transform_riscv_r: .quad 0x0000000080000001,0x8000000080008008 .text .globl BlockSha3 + WC_ASM_ATT_HIDDEN(BlockSha3) .type BlockSha3,@function .align 2 BlockSha3: diff --git a/wolfcrypt/src/port/riscv64/riscv-64-sha512-asm.S b/wolfcrypt/src/port/riscv64/riscv-64-sha512-asm.S index ff7a8f6227f..d0c22e69eb3 100644 --- a/wolfcrypt/src/port/riscv64/riscv-64-sha512-asm.S +++ b/wolfcrypt/src/port/riscv64/riscv-64-sha512-asm.S @@ -81,6 +81,7 @@ L_SHA512_transform_riscv_vector_len_k: .quad 0x5fcb6fab3ad6faec,0x6c44198c4a475817 .text .globl Transform_Sha512_Len_riscv_vector + WC_ASM_ATT_HIDDEN(Transform_Sha512_Len_riscv_vector) .type Transform_Sha512_Len_riscv_vector,@function .align 2 Transform_Sha512_Len_riscv_vector: @@ -329,6 +330,7 @@ L_SHA512_transform_riscv_crypto_len_k: .quad 0x5fcb6fab3ad6faec,0x6c44198c4a475817 .text .globl Transform_Sha512_Len_riscv_crypto + WC_ASM_ATT_HIDDEN(Transform_Sha512_Len_riscv_crypto) .type Transform_Sha512_Len_riscv_crypto,@function .align 2 Transform_Sha512_Len_riscv_crypto: @@ -1663,6 +1665,7 @@ L_SHA512_transform_riscv_len_k: .quad 0x5fcb6fab3ad6faec,0x6c44198c4a475817 .text .globl Transform_Sha512_Len_riscv + WC_ASM_ATT_HIDDEN(Transform_Sha512_Len_riscv) .type Transform_Sha512_Len_riscv,@function .align 2 Transform_Sha512_Len_riscv: diff --git a/wolfcrypt/src/sha256_asm.S b/wolfcrypt/src/sha256_asm.S index f7f5a7dc79a..85fab76fd39 100644 --- a/wolfcrypt/src/sha256_asm.S +++ b/wolfcrypt/src/sha256_asm.S @@ -86,12 +86,14 @@ L_sse2_sha256_shuf_mask: #ifndef __APPLE__ .text .globl Transform_Sha256_SSE2_Sha +WC_ASM_ATT_HIDDEN(Transform_Sha256_SSE2_Sha) .type Transform_Sha256_SSE2_Sha,@function .align 16 Transform_Sha256_SSE2_Sha: #else .section __TEXT,__text .globl _Transform_Sha256_SSE2_Sha +WC_ASM_ATT_HIDDEN(_Transform_Sha256_SSE2_Sha) .p2align 4 _Transform_Sha256_SSE2_Sha: #endif /* __APPLE__ */ @@ -283,12 +285,14 @@ _Transform_Sha256_SSE2_Sha: #ifndef __APPLE__ .text .globl Transform_Sha256_SSE2_Sha_Len +WC_ASM_ATT_HIDDEN(Transform_Sha256_SSE2_Sha_Len) .type Transform_Sha256_SSE2_Sha_Len,@function .align 16 Transform_Sha256_SSE2_Sha_Len: #else .section __TEXT,__text .globl _Transform_Sha256_SSE2_Sha_Len +WC_ASM_ATT_HIDDEN(_Transform_Sha256_SSE2_Sha_Len) .p2align 4 _Transform_Sha256_SSE2_Sha_Len: #endif /* __APPLE__ */ @@ -549,12 +553,14 @@ L_avx1_sha256_flip_mask: #ifndef __APPLE__ .text .globl Transform_Sha256_AVX1 +WC_ASM_ATT_HIDDEN(Transform_Sha256_AVX1) .type Transform_Sha256_AVX1,@function .align 16 Transform_Sha256_AVX1: #else .section __TEXT,__text .globl _Transform_Sha256_AVX1 +WC_ASM_ATT_HIDDEN(_Transform_Sha256_AVX1) .p2align 4 _Transform_Sha256_AVX1: #endif /* __APPLE__ */ @@ -2940,12 +2946,14 @@ _Transform_Sha256_AVX1: #ifndef __APPLE__ .text .globl Transform_Sha256_AVX1_Len +WC_ASM_ATT_HIDDEN(Transform_Sha256_AVX1_Len) .type Transform_Sha256_AVX1_Len,@function .align 16 Transform_Sha256_AVX1_Len: #else .section __TEXT,__text .globl _Transform_Sha256_AVX1_Len +WC_ASM_ATT_HIDDEN(_Transform_Sha256_AVX1_Len) .p2align 4 _Transform_Sha256_AVX1_Len: #endif /* __APPLE__ */ @@ -5409,12 +5417,14 @@ L_avx1_rorx_sha256_flip_mask: #ifndef __APPLE__ .text .globl Transform_Sha256_AVX1_RORX +WC_ASM_ATT_HIDDEN(Transform_Sha256_AVX1_RORX) .type Transform_Sha256_AVX1_RORX,@function .align 16 Transform_Sha256_AVX1_RORX: #else .section __TEXT,__text .globl _Transform_Sha256_AVX1_RORX +WC_ASM_ATT_HIDDEN(_Transform_Sha256_AVX1_RORX) .p2align 4 _Transform_Sha256_AVX1_RORX: #endif /* __APPLE__ */ @@ -7758,12 +7768,14 @@ _Transform_Sha256_AVX1_RORX: #ifndef __APPLE__ .text .globl Transform_Sha256_AVX1_RORX_Len +WC_ASM_ATT_HIDDEN(Transform_Sha256_AVX1_RORX_Len) .type Transform_Sha256_AVX1_RORX_Len,@function .align 16 Transform_Sha256_AVX1_RORX_Len: #else .section __TEXT,__text .globl _Transform_Sha256_AVX1_RORX_Len +WC_ASM_ATT_HIDDEN(_Transform_Sha256_AVX1_RORX_Len) .p2align 4 _Transform_Sha256_AVX1_RORX_Len: #endif /* __APPLE__ */ @@ -10162,12 +10174,14 @@ L_avx1_sha256_shuf_mask: #ifndef __APPLE__ .text .globl Transform_Sha256_AVX1_Sha +WC_ASM_ATT_HIDDEN(Transform_Sha256_AVX1_Sha) .type Transform_Sha256_AVX1_Sha,@function .align 16 Transform_Sha256_AVX1_Sha: #else .section __TEXT,__text .globl _Transform_Sha256_AVX1_Sha +WC_ASM_ATT_HIDDEN(_Transform_Sha256_AVX1_Sha) .p2align 4 _Transform_Sha256_AVX1_Sha: #endif /* __APPLE__ */ @@ -10331,12 +10345,14 @@ _Transform_Sha256_AVX1_Sha: #ifndef __APPLE__ .text .globl Transform_Sha256_AVX1_Sha_Len +WC_ASM_ATT_HIDDEN(Transform_Sha256_AVX1_Sha_Len) .type Transform_Sha256_AVX1_Sha_Len,@function .align 16 Transform_Sha256_AVX1_Sha_Len: #else .section __TEXT,__text .globl _Transform_Sha256_AVX1_Sha_Len +WC_ASM_ATT_HIDDEN(_Transform_Sha256_AVX1_Sha_Len) .p2align 4 _Transform_Sha256_AVX1_Sha_Len: #endif /* __APPLE__ */ @@ -10589,12 +10605,14 @@ L_avx2_sha256_flip_mask: #ifndef __APPLE__ .text .globl Transform_Sha256_AVX2 +WC_ASM_ATT_HIDDEN(Transform_Sha256_AVX2) .type Transform_Sha256_AVX2,@function .align 16 Transform_Sha256_AVX2: #else .section __TEXT,__text .globl _Transform_Sha256_AVX2 +WC_ASM_ATT_HIDDEN(_Transform_Sha256_AVX2) .p2align 4 _Transform_Sha256_AVX2: #endif /* __APPLE__ */ @@ -12981,12 +12999,14 @@ _Transform_Sha256_AVX2: #ifndef __APPLE__ .text .globl Transform_Sha256_AVX2_Len +WC_ASM_ATT_HIDDEN(Transform_Sha256_AVX2_Len) .type Transform_Sha256_AVX2_Len,@function .align 16 Transform_Sha256_AVX2_Len: #else .section __TEXT,__text .globl _Transform_Sha256_AVX2_Len +WC_ASM_ATT_HIDDEN(_Transform_Sha256_AVX2_Len) .p2align 4 _Transform_Sha256_AVX2_Len: #endif /* __APPLE__ */ @@ -17193,12 +17213,14 @@ L_avx2_rorx_sha256_shuf_DC00: #ifndef __APPLE__ .text .globl Transform_Sha256_AVX2_RORX +WC_ASM_ATT_HIDDEN(Transform_Sha256_AVX2_RORX) .type Transform_Sha256_AVX2_RORX,@function .align 16 Transform_Sha256_AVX2_RORX: #else .section __TEXT,__text .globl _Transform_Sha256_AVX2_RORX +WC_ASM_ATT_HIDDEN(_Transform_Sha256_AVX2_RORX) .p2align 4 _Transform_Sha256_AVX2_RORX: #endif /* __APPLE__ */ @@ -19560,12 +19582,14 @@ _Transform_Sha256_AVX2_RORX: #ifndef __APPLE__ .text .globl Transform_Sha256_AVX2_RORX_Len +WC_ASM_ATT_HIDDEN(Transform_Sha256_AVX2_RORX_Len) .type Transform_Sha256_AVX2_RORX_Len,@function .align 16 Transform_Sha256_AVX2_RORX_Len: #else .section __TEXT,__text .globl _Transform_Sha256_AVX2_RORX_Len +WC_ASM_ATT_HIDDEN(_Transform_Sha256_AVX2_RORX_Len) .p2align 4 _Transform_Sha256_AVX2_RORX_Len: #endif /* __APPLE__ */ diff --git a/wolfcrypt/src/sha3_asm.S b/wolfcrypt/src/sha3_asm.S index 68d09117828..13b2f0dc343 100644 --- a/wolfcrypt/src/sha3_asm.S +++ b/wolfcrypt/src/sha3_asm.S @@ -165,12 +165,14 @@ L_sha3_x4_avx2_r: #ifndef __APPLE__ .text .globl sha3_block_bmi2 +WC_ASM_ATT_HIDDEN(sha3_block_bmi2) .type sha3_block_bmi2,@function .align 16 sha3_block_bmi2: #else .section __TEXT,__text .globl _sha3_block_bmi2 +WC_ASM_ATT_HIDDEN(_sha3_block_bmi2) .p2align 4 _sha3_block_bmi2: #endif /* __APPLE__ */ @@ -4607,12 +4609,14 @@ _sha3_block_bmi2: #ifndef __APPLE__ .text .globl sha3_block_n_bmi2 +WC_ASM_ATT_HIDDEN(sha3_block_n_bmi2) .type sha3_block_n_bmi2,@function .align 16 sha3_block_n_bmi2: #else .section __TEXT,__text .globl _sha3_block_n_bmi2 +WC_ASM_ATT_HIDDEN(_sha3_block_n_bmi2) .p2align 4 _sha3_block_n_bmi2: #endif /* __APPLE__ */ @@ -9353,12 +9357,14 @@ L_sha3_block_avx2_rotr: #ifndef __APPLE__ .text .globl sha3_block_avx2 +WC_ASM_ATT_HIDDEN(sha3_block_avx2) .type sha3_block_avx2,@function .align 16 sha3_block_avx2: #else .section __TEXT,__text .globl _sha3_block_avx2 +WC_ASM_ATT_HIDDEN(_sha3_block_avx2) .p2align 4 _sha3_block_avx2: #endif /* __APPLE__ */ @@ -9572,12 +9578,14 @@ L_sha3_block_n_avx2_rotr: #ifndef __APPLE__ .text .globl sha3_block_n_avx2 +WC_ASM_ATT_HIDDEN(sha3_block_n_avx2) .type sha3_block_n_avx2,@function .align 16 sha3_block_n_avx2: #else .section __TEXT,__text .globl _sha3_block_n_avx2 +WC_ASM_ATT_HIDDEN(_sha3_block_n_avx2) .p2align 4 _sha3_block_n_avx2: #endif /* __APPLE__ */ @@ -9928,12 +9936,14 @@ L_sha3_block_n_avx2_rounds: #ifndef __APPLE__ .text .globl sha3_blocksx4_avx2 +WC_ASM_ATT_HIDDEN(sha3_blocksx4_avx2) .type sha3_blocksx4_avx2,@function .align 16 sha3_blocksx4_avx2: #else .section __TEXT,__text .globl _sha3_blocksx4_avx2 +WC_ASM_ATT_HIDDEN(_sha3_blocksx4_avx2) .p2align 4 _sha3_blocksx4_avx2: #endif /* __APPLE__ */ @@ -15301,12 +15311,14 @@ L_sha3_128_blockx4_seed_avx2_end_mark: #ifndef __APPLE__ .text .globl sha3_128_blocksx4_seed_avx2 +WC_ASM_ATT_HIDDEN(sha3_128_blocksx4_seed_avx2) .type sha3_128_blocksx4_seed_avx2,@function .align 16 sha3_128_blocksx4_seed_avx2: #else .section __TEXT,__text .globl _sha3_128_blocksx4_seed_avx2 +WC_ASM_ATT_HIDDEN(_sha3_128_blocksx4_seed_avx2) .p2align 4 _sha3_128_blocksx4_seed_avx2: #endif /* __APPLE__ */ @@ -20667,12 +20679,14 @@ _sha3_128_blocksx4_seed_avx2: #ifndef __APPLE__ .text .globl sha3_blocksx4_out_avx2 +WC_ASM_ATT_HIDDEN(sha3_blocksx4_out_avx2) .type sha3_blocksx4_out_avx2,@function .align 16 sha3_blocksx4_out_avx2: #else .section __TEXT,__text .globl _sha3_blocksx4_out_avx2 +WC_ASM_ATT_HIDDEN(_sha3_blocksx4_out_avx2) .p2align 4 _sha3_blocksx4_out_avx2: #endif /* __APPLE__ */ @@ -26079,12 +26093,14 @@ L_sha3_256_blockx4_seed_avx2_end_mark: #ifndef __APPLE__ .text .globl sha3_256_blocksx4_seed_avx2 +WC_ASM_ATT_HIDDEN(sha3_256_blocksx4_seed_avx2) .type sha3_256_blocksx4_seed_avx2,@function .align 16 sha3_256_blocksx4_seed_avx2: #else .section __TEXT,__text .globl _sha3_256_blocksx4_seed_avx2 +WC_ASM_ATT_HIDDEN(_sha3_256_blocksx4_seed_avx2) .p2align 4 _sha3_256_blocksx4_seed_avx2: #endif /* __APPLE__ */ @@ -31459,12 +31475,14 @@ L_sha3_256_blockx4_seed_64_avx2_end_mark: #ifndef __APPLE__ .text .globl sha3_256_blocksx4_seed_64_avx2 +WC_ASM_ATT_HIDDEN(sha3_256_blocksx4_seed_64_avx2) .type sha3_256_blocksx4_seed_64_avx2,@function .align 16 sha3_256_blocksx4_seed_64_avx2: #else .section __TEXT,__text .globl _sha3_256_blocksx4_seed_64_avx2 +WC_ASM_ATT_HIDDEN(_sha3_256_blocksx4_seed_64_avx2) .p2align 4 _sha3_256_blocksx4_seed_64_avx2: #endif /* __APPLE__ */ @@ -36965,12 +36983,14 @@ L_sha3_x8_avx512_r: #ifndef __APPLE__ .text .globl sha3_blocksx8_out_avx512 +WC_ASM_ATT_HIDDEN(sha3_blocksx8_out_avx512) .type sha3_blocksx8_out_avx512,@function .align 16 sha3_blocksx8_out_avx512: #else .section __TEXT,__text .globl _sha3_blocksx8_out_avx512 +WC_ASM_ATT_HIDDEN(_sha3_blocksx8_out_avx512) .p2align 4 _sha3_blocksx8_out_avx512: #endif /* __APPLE__ */ @@ -39906,12 +39926,14 @@ L_sha3_blocksx8_out_avx512_done: #ifndef __APPLE__ .text .globl sha3_blocksx8_avx512 +WC_ASM_ATT_HIDDEN(sha3_blocksx8_avx512) .type sha3_blocksx8_avx512,@function .align 16 sha3_blocksx8_avx512: #else .section __TEXT,__text .globl _sha3_blocksx8_avx512 +WC_ASM_ATT_HIDDEN(_sha3_blocksx8_avx512) .p2align 4 _sha3_blocksx8_avx512: #endif /* __APPLE__ */ @@ -42797,12 +42819,14 @@ L_sha3_128_blocksx8_seed_avx512_end_mark: #ifndef __APPLE__ .text .globl sha3_128_blocksx8_seed_avx512 +WC_ASM_ATT_HIDDEN(sha3_128_blocksx8_seed_avx512) .type sha3_128_blocksx8_seed_avx512,@function .align 16 sha3_128_blocksx8_seed_avx512: #else .section __TEXT,__text .globl _sha3_128_blocksx8_seed_avx512 +WC_ASM_ATT_HIDDEN(_sha3_128_blocksx8_seed_avx512) .p2align 4 _sha3_128_blocksx8_seed_avx512: #endif /* __APPLE__ */ @@ -45690,12 +45714,14 @@ L_sha3_256_blocksx8_seed_avx512_end_mark: #ifndef __APPLE__ .text .globl sha3_256_blocksx8_seed_avx512 +WC_ASM_ATT_HIDDEN(sha3_256_blocksx8_seed_avx512) .type sha3_256_blocksx8_seed_avx512,@function .align 16 sha3_256_blocksx8_seed_avx512: #else .section __TEXT,__text .globl _sha3_256_blocksx8_seed_avx512 +WC_ASM_ATT_HIDDEN(_sha3_256_blocksx8_seed_avx512) .p2align 4 _sha3_256_blocksx8_seed_avx512: #endif /* __APPLE__ */ diff --git a/wolfcrypt/src/sha512_asm.S b/wolfcrypt/src/sha512_asm.S index 290249af087..4aed31df282 100644 --- a/wolfcrypt/src/sha512_asm.S +++ b/wolfcrypt/src/sha512_asm.S @@ -110,12 +110,14 @@ L_avx1_sha512_flip_mask: #ifndef __APPLE__ .text .globl Transform_Sha512_AVX1 +WC_ASM_ATT_HIDDEN(Transform_Sha512_AVX1) .type Transform_Sha512_AVX1,@function .align 16 Transform_Sha512_AVX1: #else .section __TEXT,__text .globl _Transform_Sha512_AVX1 +WC_ASM_ATT_HIDDEN(_Transform_Sha512_AVX1) .p2align 4 _Transform_Sha512_AVX1: #endif /* __APPLE__ */ @@ -1383,12 +1385,14 @@ L_transform_sha512_avx1_start: #ifndef __APPLE__ .text .globl Transform_Sha512_AVX1_Len +WC_ASM_ATT_HIDDEN(Transform_Sha512_AVX1_Len) .type Transform_Sha512_AVX1_Len,@function .align 16 Transform_Sha512_AVX1_Len: #else .section __TEXT,__text .globl _Transform_Sha512_AVX1_Len +WC_ASM_ATT_HIDDEN(_Transform_Sha512_AVX1_Len) .p2align 4 _Transform_Sha512_AVX1_Len: #endif /* __APPLE__ */ @@ -2738,12 +2742,14 @@ L_avx1_rorx_sha512_flip_mask: #ifndef __APPLE__ .text .globl Transform_Sha512_AVX1_RORX +WC_ASM_ATT_HIDDEN(Transform_Sha512_AVX1_RORX) .type Transform_Sha512_AVX1_RORX,@function .align 16 Transform_Sha512_AVX1_RORX: #else .section __TEXT,__text .globl _Transform_Sha512_AVX1_RORX +WC_ASM_ATT_HIDDEN(_Transform_Sha512_AVX1_RORX) .p2align 4 _Transform_Sha512_AVX1_RORX: #endif /* __APPLE__ */ @@ -3940,12 +3946,14 @@ L_transform_sha512_avx1_rorx_start: #ifndef __APPLE__ .text .globl Transform_Sha512_AVX1_RORX_Len +WC_ASM_ATT_HIDDEN(Transform_Sha512_AVX1_RORX_Len) .type Transform_Sha512_AVX1_RORX_Len,@function .align 16 Transform_Sha512_AVX1_RORX_Len: #else .section __TEXT,__text .globl _Transform_Sha512_AVX1_RORX_Len +WC_ASM_ATT_HIDDEN(_Transform_Sha512_AVX1_RORX_Len) .p2align 4 _Transform_Sha512_AVX1_RORX_Len: #endif /* __APPLE__ */ @@ -5346,12 +5354,14 @@ L_avx2_sha512_flip_mask: #ifndef __APPLE__ .text .globl Transform_Sha512_AVX2 +WC_ASM_ATT_HIDDEN(Transform_Sha512_AVX2) .type Transform_Sha512_AVX2,@function .align 16 Transform_Sha512_AVX2: #else .section __TEXT,__text .globl _Transform_Sha512_AVX2 +WC_ASM_ATT_HIDDEN(_Transform_Sha512_AVX2) .p2align 4 _Transform_Sha512_AVX2: #endif /* __APPLE__ */ @@ -6408,12 +6418,14 @@ L_sha256_avx2_start: #ifndef __APPLE__ .text .globl Transform_Sha512_AVX2_Len +WC_ASM_ATT_HIDDEN(Transform_Sha512_AVX2_Len) .type Transform_Sha512_AVX2_Len,@function .align 16 Transform_Sha512_AVX2_Len: #else .section __TEXT,__text .globl _Transform_Sha512_AVX2_Len +WC_ASM_ATT_HIDDEN(_Transform_Sha512_AVX2_Len) .p2align 4 _Transform_Sha512_AVX2_Len: #endif /* __APPLE__ */ @@ -8205,12 +8217,14 @@ L_avx2_rorx_sha512_flip_mask: #ifndef __APPLE__ .text .globl Transform_Sha512_AVX2_RORX +WC_ASM_ATT_HIDDEN(Transform_Sha512_AVX2_RORX) .type Transform_Sha512_AVX2_RORX,@function .align 16 Transform_Sha512_AVX2_RORX: #else .section __TEXT,__text .globl _Transform_Sha512_AVX2_RORX +WC_ASM_ATT_HIDDEN(_Transform_Sha512_AVX2_RORX) .p2align 4 _Transform_Sha512_AVX2_RORX: #endif /* __APPLE__ */ @@ -9209,12 +9223,14 @@ L_sha256_len_avx2_rorx_start: #ifndef __APPLE__ .text .globl Transform_Sha512_AVX2_RORX_Len +WC_ASM_ATT_HIDDEN(Transform_Sha512_AVX2_RORX_Len) .type Transform_Sha512_AVX2_RORX_Len,@function .align 16 Transform_Sha512_AVX2_RORX_Len: #else .section __TEXT,__text .globl _Transform_Sha512_AVX2_RORX_Len +WC_ASM_ATT_HIDDEN(_Transform_Sha512_AVX2_RORX_Len) .p2align 4 _Transform_Sha512_AVX2_RORX_Len: #endif /* __APPLE__ */ diff --git a/wolfcrypt/src/sp_x86_64_asm.S b/wolfcrypt/src/sp_x86_64_asm.S index 22a67c201ca..2670c19406c 100644 --- a/wolfcrypt/src/sp_x86_64_asm.S +++ b/wolfcrypt/src/sp_x86_64_asm.S @@ -57,12 +57,14 @@ #ifndef __APPLE__ .text .globl sp_2048_from_bin_bswap +WC_ASM_ATT_HIDDEN(sp_2048_from_bin_bswap) .type sp_2048_from_bin_bswap,@function .align 16 sp_2048_from_bin_bswap: #else .section __TEXT,__text .globl _sp_2048_from_bin_bswap +WC_ASM_ATT_HIDDEN(_sp_2048_from_bin_bswap) .p2align 4 _sp_2048_from_bin_bswap: #endif /* __APPLE__ */ @@ -152,12 +154,14 @@ L_2048_from_bin_bswap_zero_end: #ifndef __APPLE__ .text .globl sp_2048_from_bin_movbe +WC_ASM_ATT_HIDDEN(sp_2048_from_bin_movbe) .type sp_2048_from_bin_movbe,@function .align 16 sp_2048_from_bin_movbe: #else .section __TEXT,__text .globl _sp_2048_from_bin_movbe +WC_ASM_ATT_HIDDEN(_sp_2048_from_bin_movbe) .p2align 4 _sp_2048_from_bin_movbe: #endif /* __APPLE__ */ @@ -236,12 +240,14 @@ L_2048_from_bin_movbe_zero_end: #ifndef __APPLE__ .text .globl sp_2048_to_bin_bswap_32 +WC_ASM_ATT_HIDDEN(sp_2048_to_bin_bswap_32) .type sp_2048_to_bin_bswap_32,@function .align 16 sp_2048_to_bin_bswap_32: #else .section __TEXT,__text .globl _sp_2048_to_bin_bswap_32 +WC_ASM_ATT_HIDDEN(_sp_2048_to_bin_bswap_32) .p2align 4 _sp_2048_to_bin_bswap_32: #endif /* __APPLE__ */ @@ -356,12 +362,14 @@ _sp_2048_to_bin_bswap_32: #ifndef __APPLE__ .text .globl sp_2048_to_bin_movbe_32 +WC_ASM_ATT_HIDDEN(sp_2048_to_bin_movbe_32) .type sp_2048_to_bin_movbe_32,@function .align 16 sp_2048_to_bin_movbe_32: #else .section __TEXT,__text .globl _sp_2048_to_bin_movbe_32 +WC_ASM_ATT_HIDDEN(_sp_2048_to_bin_movbe_32) .p2align 4 _sp_2048_to_bin_movbe_32: #endif /* __APPLE__ */ @@ -443,12 +451,14 @@ _sp_2048_to_bin_movbe_32: #ifndef __APPLE__ .text .globl sp_2048_mul_16 +WC_ASM_ATT_HIDDEN(sp_2048_mul_16) .type sp_2048_mul_16,@function .align 16 sp_2048_mul_16: #else .section __TEXT,__text .globl _sp_2048_mul_16 +WC_ASM_ATT_HIDDEN(_sp_2048_mul_16) .p2align 4 _sp_2048_mul_16: #endif /* __APPLE__ */ @@ -2096,12 +2106,14 @@ _sp_2048_mul_16: #ifndef __APPLE__ .text .globl sp_2048_mul_avx2_16 +WC_ASM_ATT_HIDDEN(sp_2048_mul_avx2_16) .type sp_2048_mul_avx2_16,@function .align 16 sp_2048_mul_avx2_16: #else .section __TEXT,__text .globl _sp_2048_mul_avx2_16 +WC_ASM_ATT_HIDDEN(_sp_2048_mul_avx2_16) .p2align 4 _sp_2048_mul_avx2_16: #endif /* __APPLE__ */ @@ -3772,12 +3784,14 @@ L_end_2048_mul_avx2_16: #ifndef __APPLE__ .text .globl sp_2048_add_16 +WC_ASM_ATT_HIDDEN(sp_2048_add_16) .type sp_2048_add_16,@function .align 16 sp_2048_add_16: #else .section __TEXT,__text .globl _sp_2048_add_16 +WC_ASM_ATT_HIDDEN(_sp_2048_add_16) .p2align 4 _sp_2048_add_16: #endif /* __APPLE__ */ @@ -3844,12 +3858,14 @@ _sp_2048_add_16: #ifndef __APPLE__ .text .globl sp_2048_sub_in_place_32 +WC_ASM_ATT_HIDDEN(sp_2048_sub_in_place_32) .type sp_2048_sub_in_place_32,@function .align 16 sp_2048_sub_in_place_32: #else .section __TEXT,__text .globl _sp_2048_sub_in_place_32 +WC_ASM_ATT_HIDDEN(_sp_2048_sub_in_place_32) .p2align 4 _sp_2048_sub_in_place_32: #endif /* __APPLE__ */ @@ -3963,12 +3979,14 @@ _sp_2048_sub_in_place_32: #ifndef __APPLE__ .text .globl sp_2048_add_32 +WC_ASM_ATT_HIDDEN(sp_2048_add_32) .type sp_2048_add_32,@function .align 16 sp_2048_add_32: #else .section __TEXT,__text .globl _sp_2048_add_32 +WC_ASM_ATT_HIDDEN(_sp_2048_add_32) .p2align 4 _sp_2048_add_32: #endif /* __APPLE__ */ @@ -4084,12 +4102,14 @@ _sp_2048_add_32: #ifndef __APPLE__ .text .globl sp_2048_mul_32 +WC_ASM_ATT_HIDDEN(sp_2048_mul_32) .type sp_2048_mul_32,@function .align 16 sp_2048_mul_32: #else .section __TEXT,__text .globl _sp_2048_mul_32 +WC_ASM_ATT_HIDDEN(_sp_2048_mul_32) .p2align 4 _sp_2048_mul_32: #endif /* __APPLE__ */ @@ -4809,12 +4829,14 @@ _sp_2048_mul_32: #ifndef __APPLE__ .text .globl sp_2048_mul_avx2_32 +WC_ASM_ATT_HIDDEN(sp_2048_mul_avx2_32) .type sp_2048_mul_avx2_32,@function .align 16 sp_2048_mul_avx2_32: #else .section __TEXT,__text .globl _sp_2048_mul_avx2_32 +WC_ASM_ATT_HIDDEN(_sp_2048_mul_avx2_32) .p2align 4 _sp_2048_mul_avx2_32: #endif /* __APPLE__ */ @@ -5485,12 +5507,14 @@ _sp_2048_mul_avx2_32: #ifndef __APPLE__ .text .globl sp_2048_sqr_16 +WC_ASM_ATT_HIDDEN(sp_2048_sqr_16) .type sp_2048_sqr_16,@function .align 16 sp_2048_sqr_16: #else .section __TEXT,__text .globl _sp_2048_sqr_16 +WC_ASM_ATT_HIDDEN(_sp_2048_sqr_16) .p2align 4 _sp_2048_sqr_16: #endif /* __APPLE__ */ @@ -6580,12 +6604,14 @@ _sp_2048_sqr_16: #ifndef __APPLE__ .text .globl sp_2048_sqr_avx2_16 +WC_ASM_ATT_HIDDEN(sp_2048_sqr_avx2_16) .type sp_2048_sqr_avx2_16,@function .align 16 sp_2048_sqr_avx2_16: #else .section __TEXT,__text .globl _sp_2048_sqr_avx2_16 +WC_ASM_ATT_HIDDEN(_sp_2048_sqr_avx2_16) .p2align 4 _sp_2048_sqr_avx2_16: #endif /* __APPLE__ */ @@ -7640,12 +7666,14 @@ L_end_2048_sqr_avx2_16: #ifndef __APPLE__ .text .globl sp_2048_sqr_32 +WC_ASM_ATT_HIDDEN(sp_2048_sqr_32) .type sp_2048_sqr_32,@function .align 16 sp_2048_sqr_32: #else .section __TEXT,__text .globl _sp_2048_sqr_32 +WC_ASM_ATT_HIDDEN(_sp_2048_sqr_32) .p2align 4 _sp_2048_sqr_32: #endif /* __APPLE__ */ @@ -8181,12 +8209,14 @@ _sp_2048_sqr_32: #ifndef __APPLE__ .text .globl sp_2048_sqr_avx2_32 +WC_ASM_ATT_HIDDEN(sp_2048_sqr_avx2_32) .type sp_2048_sqr_avx2_32,@function .align 16 sp_2048_sqr_avx2_32: #else .section __TEXT,__text .globl _sp_2048_sqr_avx2_32 +WC_ASM_ATT_HIDDEN(_sp_2048_sqr_avx2_32) .p2align 4 _sp_2048_sqr_avx2_32: #endif /* __APPLE__ */ @@ -8720,12 +8750,14 @@ _sp_2048_sqr_avx2_32: #ifndef __APPLE__ .text .globl sp_2048_sub_in_place_16 +WC_ASM_ATT_HIDDEN(sp_2048_sub_in_place_16) .type sp_2048_sub_in_place_16,@function .align 16 sp_2048_sub_in_place_16: #else .section __TEXT,__text .globl _sp_2048_sub_in_place_16 +WC_ASM_ATT_HIDDEN(_sp_2048_sub_in_place_16) .p2align 4 _sp_2048_sub_in_place_16: #endif /* __APPLE__ */ @@ -8791,12 +8823,14 @@ _sp_2048_sub_in_place_16: #ifndef __APPLE__ .text .globl sp_2048_mul_d_32 +WC_ASM_ATT_HIDDEN(sp_2048_mul_d_32) .type sp_2048_mul_d_32,@function .align 16 sp_2048_mul_d_32: #else .section __TEXT,__text .globl _sp_2048_mul_d_32 +WC_ASM_ATT_HIDDEN(_sp_2048_mul_d_32) .p2align 4 _sp_2048_mul_d_32: #endif /* __APPLE__ */ @@ -9071,12 +9105,14 @@ _sp_2048_mul_d_32: #ifndef __APPLE__ .text .globl sp_2048_cond_sub_16 +WC_ASM_ATT_HIDDEN(sp_2048_cond_sub_16) .type sp_2048_cond_sub_16,@function .align 16 sp_2048_cond_sub_16: #else .section __TEXT,__text .globl _sp_2048_cond_sub_16 +WC_ASM_ATT_HIDDEN(_sp_2048_cond_sub_16) .p2align 4 _sp_2048_cond_sub_16: #endif /* __APPLE__ */ @@ -9209,12 +9245,14 @@ _sp_2048_cond_sub_16: #ifndef __APPLE__ .text .globl sp_2048_mont_reduce_16 +WC_ASM_ATT_HIDDEN(sp_2048_mont_reduce_16) .type sp_2048_mont_reduce_16,@function .align 16 sp_2048_mont_reduce_16: #else .section __TEXT,__text .globl _sp_2048_mont_reduce_16 +WC_ASM_ATT_HIDDEN(_sp_2048_mont_reduce_16) .p2align 4 _sp_2048_mont_reduce_16: #endif /* __APPLE__ */ @@ -9432,12 +9470,14 @@ L_2048_mont_reduce_16_loop: #ifndef __APPLE__ .text .globl sp_2048_cond_sub_avx2_16 +WC_ASM_ATT_HIDDEN(sp_2048_cond_sub_avx2_16) .type sp_2048_cond_sub_avx2_16,@function .align 16 sp_2048_cond_sub_avx2_16: #else .section __TEXT,__text .globl _sp_2048_cond_sub_avx2_16 +WC_ASM_ATT_HIDDEN(_sp_2048_cond_sub_avx2_16) .p2align 4 _sp_2048_cond_sub_avx2_16: #endif /* __APPLE__ */ @@ -9536,12 +9576,14 @@ _sp_2048_cond_sub_avx2_16: #ifndef __APPLE__ .text .globl sp_2048_mul_d_16 +WC_ASM_ATT_HIDDEN(sp_2048_mul_d_16) .type sp_2048_mul_d_16,@function .align 16 sp_2048_mul_d_16: #else .section __TEXT,__text .globl _sp_2048_mul_d_16 +WC_ASM_ATT_HIDDEN(_sp_2048_mul_d_16) .p2align 4 _sp_2048_mul_d_16: #endif /* __APPLE__ */ @@ -9686,12 +9728,14 @@ _sp_2048_mul_d_16: #ifndef __APPLE__ .text .globl sp_2048_mul_d_avx2_16 +WC_ASM_ATT_HIDDEN(sp_2048_mul_d_avx2_16) .type sp_2048_mul_d_avx2_16,@function .align 16 sp_2048_mul_d_avx2_16: #else .section __TEXT,__text .globl _sp_2048_mul_d_avx2_16 +WC_ASM_ATT_HIDDEN(_sp_2048_mul_d_avx2_16) .p2align 4 _sp_2048_mul_d_avx2_16: #endif /* __APPLE__ */ @@ -9810,12 +9854,14 @@ _sp_2048_mul_d_avx2_16: #ifndef __APPLE__ .text .globl div_2048_word_asm_16 +WC_ASM_ATT_HIDDEN(div_2048_word_asm_16) .type div_2048_word_asm_16,@function .align 16 div_2048_word_asm_16: #else .section __TEXT,__text .globl _div_2048_word_asm_16 +WC_ASM_ATT_HIDDEN(_div_2048_word_asm_16) .p2align 4 _div_2048_word_asm_16: #endif /* __APPLE__ */ @@ -9839,12 +9885,14 @@ _div_2048_word_asm_16: #ifndef __APPLE__ .text .globl sp_2048_cmp_16 +WC_ASM_ATT_HIDDEN(sp_2048_cmp_16) .type sp_2048_cmp_16,@function .align 16 sp_2048_cmp_16: #else .section __TEXT,__text .globl _sp_2048_cmp_16 +WC_ASM_ATT_HIDDEN(_sp_2048_cmp_16) .p2align 4 _sp_2048_cmp_16: #endif /* __APPLE__ */ @@ -9996,12 +10044,14 @@ _sp_2048_cmp_16: #ifndef __APPLE__ .text .globl sp_2048_mont_reduce_avx2_16 +WC_ASM_ATT_HIDDEN(sp_2048_mont_reduce_avx2_16) .type sp_2048_mont_reduce_avx2_16,@function .align 16 sp_2048_mont_reduce_avx2_16: #else .section __TEXT,__text .globl _sp_2048_mont_reduce_avx2_16 +WC_ASM_ATT_HIDDEN(_sp_2048_mont_reduce_avx2_16) .p2align 4 _sp_2048_mont_reduce_avx2_16: #endif /* __APPLE__ */ @@ -10327,12 +10377,14 @@ L_2048_mont_reduce_avx2_16_loop: #ifndef __APPLE__ .text .globl sp_2048_get_from_table_avx2_16 +WC_ASM_ATT_HIDDEN(sp_2048_get_from_table_avx2_16) .type sp_2048_get_from_table_avx2_16,@function .align 16 sp_2048_get_from_table_avx2_16: #else .section __TEXT,__text .globl _sp_2048_get_from_table_avx2_16 +WC_ASM_ATT_HIDDEN(_sp_2048_get_from_table_avx2_16) .p2align 4 _sp_2048_get_from_table_avx2_16: #endif /* __APPLE__ */ @@ -10882,12 +10934,14 @@ _sp_2048_get_from_table_avx2_16: #ifndef __APPLE__ .text .globl sp_2048_cond_sub_32 +WC_ASM_ATT_HIDDEN(sp_2048_cond_sub_32) .type sp_2048_cond_sub_32,@function .align 16 sp_2048_cond_sub_32: #else .section __TEXT,__text .globl _sp_2048_cond_sub_32 +WC_ASM_ATT_HIDDEN(_sp_2048_cond_sub_32) .p2align 4 _sp_2048_cond_sub_32: #endif /* __APPLE__ */ @@ -11132,12 +11186,14 @@ _sp_2048_cond_sub_32: #ifndef __APPLE__ .text .globl sp_2048_mont_reduce_32 +WC_ASM_ATT_HIDDEN(sp_2048_mont_reduce_32) .type sp_2048_mont_reduce_32,@function .align 16 sp_2048_mont_reduce_32: #else .section __TEXT,__text .globl _sp_2048_mont_reduce_32 +WC_ASM_ATT_HIDDEN(_sp_2048_mont_reduce_32) .p2align 4 _sp_2048_mont_reduce_32: #endif /* __APPLE__ */ @@ -11511,12 +11567,14 @@ L_2048_mont_reduce_32_loop: #ifndef __APPLE__ .text .globl sp_2048_sub_32 +WC_ASM_ATT_HIDDEN(sp_2048_sub_32) .type sp_2048_sub_32,@function .align 16 sp_2048_sub_32: #else .section __TEXT,__text .globl _sp_2048_sub_32 +WC_ASM_ATT_HIDDEN(_sp_2048_sub_32) .p2align 4 _sp_2048_sub_32: #endif /* __APPLE__ */ @@ -11631,12 +11689,14 @@ _sp_2048_sub_32: #ifndef __APPLE__ .text .globl sp_2048_mul_d_avx2_32 +WC_ASM_ATT_HIDDEN(sp_2048_mul_d_avx2_32) .type sp_2048_mul_d_avx2_32,@function .align 16 sp_2048_mul_d_avx2_32: #else .section __TEXT,__text .globl _sp_2048_mul_d_avx2_32 +WC_ASM_ATT_HIDDEN(_sp_2048_mul_d_avx2_32) .p2align 4 _sp_2048_mul_d_avx2_32: #endif /* __APPLE__ */ @@ -11851,12 +11911,14 @@ _sp_2048_mul_d_avx2_32: #ifndef __APPLE__ .text .globl div_2048_word_asm_32 +WC_ASM_ATT_HIDDEN(div_2048_word_asm_32) .type div_2048_word_asm_32,@function .align 16 div_2048_word_asm_32: #else .section __TEXT,__text .globl _div_2048_word_asm_32 +WC_ASM_ATT_HIDDEN(_div_2048_word_asm_32) .p2align 4 _div_2048_word_asm_32: #endif /* __APPLE__ */ @@ -11882,12 +11944,14 @@ _div_2048_word_asm_32: #ifndef __APPLE__ .text .globl sp_2048_cond_sub_avx2_32 +WC_ASM_ATT_HIDDEN(sp_2048_cond_sub_avx2_32) .type sp_2048_cond_sub_avx2_32,@function .align 16 sp_2048_cond_sub_avx2_32: #else .section __TEXT,__text .globl _sp_2048_cond_sub_avx2_32 +WC_ASM_ATT_HIDDEN(_sp_2048_cond_sub_avx2_32) .p2align 4 _sp_2048_cond_sub_avx2_32: #endif /* __APPLE__ */ @@ -12068,12 +12132,14 @@ _sp_2048_cond_sub_avx2_32: #ifndef __APPLE__ .text .globl sp_2048_cmp_32 +WC_ASM_ATT_HIDDEN(sp_2048_cmp_32) .type sp_2048_cmp_32,@function .align 16 sp_2048_cmp_32: #else .section __TEXT,__text .globl _sp_2048_cmp_32 +WC_ASM_ATT_HIDDEN(_sp_2048_cmp_32) .p2align 4 _sp_2048_cmp_32: #endif /* __APPLE__ */ @@ -12353,12 +12419,14 @@ _sp_2048_cmp_32: #ifndef __APPLE__ .text .globl sp_2048_mont_reduce_avx2_32 +WC_ASM_ATT_HIDDEN(sp_2048_mont_reduce_avx2_32) .type sp_2048_mont_reduce_avx2_32,@function .align 16 sp_2048_mont_reduce_avx2_32: #else .section __TEXT,__text .globl _sp_2048_mont_reduce_avx2_32 +WC_ASM_ATT_HIDDEN(_sp_2048_mont_reduce_avx2_32) .p2align 4 _sp_2048_mont_reduce_avx2_32: #endif /* __APPLE__ */ @@ -12759,12 +12827,14 @@ L_2048_mont_reduce_avx2_32_loop: #ifndef __APPLE__ .text .globl sp_2048_get_from_table_avx2_32 +WC_ASM_ATT_HIDDEN(sp_2048_get_from_table_avx2_32) .type sp_2048_get_from_table_avx2_32,@function .align 16 sp_2048_get_from_table_avx2_32: #else .section __TEXT,__text .globl _sp_2048_get_from_table_avx2_32 +WC_ASM_ATT_HIDDEN(_sp_2048_get_from_table_avx2_32) .p2align 4 _sp_2048_get_from_table_avx2_32: #endif /* __APPLE__ */ @@ -14926,12 +14996,14 @@ _sp_2048_get_from_table_avx2_32: #ifndef __APPLE__ .text .globl sp_2048_cond_add_16 +WC_ASM_ATT_HIDDEN(sp_2048_cond_add_16) .type sp_2048_cond_add_16,@function .align 16 sp_2048_cond_add_16: #else .section __TEXT,__text .globl _sp_2048_cond_add_16 +WC_ASM_ATT_HIDDEN(_sp_2048_cond_add_16) .p2align 4 _sp_2048_cond_add_16: #endif /* __APPLE__ */ @@ -15068,12 +15140,14 @@ _sp_2048_cond_add_16: #ifndef __APPLE__ .text .globl sp_2048_cond_add_avx2_16 +WC_ASM_ATT_HIDDEN(sp_2048_cond_add_avx2_16) .type sp_2048_cond_add_avx2_16,@function .align 16 sp_2048_cond_add_avx2_16: #else .section __TEXT,__text .globl _sp_2048_cond_add_avx2_16 +WC_ASM_ATT_HIDDEN(_sp_2048_cond_add_avx2_16) .p2align 4 _sp_2048_cond_add_avx2_16: #endif /* __APPLE__ */ @@ -15173,12 +15247,14 @@ _sp_2048_cond_add_avx2_16: #ifndef __APPLE__ .text .globl sp_2048_lshift_32 +WC_ASM_ATT_HIDDEN(sp_2048_lshift_32) .type sp_2048_lshift_32,@function .align 16 sp_2048_lshift_32: #else .section __TEXT,__text .globl _sp_2048_lshift_32 +WC_ASM_ATT_HIDDEN(_sp_2048_lshift_32) .p2align 4 _sp_2048_lshift_32: #endif /* __APPLE__ */ @@ -15301,12 +15377,14 @@ _sp_2048_lshift_32: #ifndef __APPLE__ .text .globl sp_3072_from_bin_bswap +WC_ASM_ATT_HIDDEN(sp_3072_from_bin_bswap) .type sp_3072_from_bin_bswap,@function .align 16 sp_3072_from_bin_bswap: #else .section __TEXT,__text .globl _sp_3072_from_bin_bswap +WC_ASM_ATT_HIDDEN(_sp_3072_from_bin_bswap) .p2align 4 _sp_3072_from_bin_bswap: #endif /* __APPLE__ */ @@ -15396,12 +15474,14 @@ L_3072_from_bin_bswap_zero_end: #ifndef __APPLE__ .text .globl sp_3072_from_bin_movbe +WC_ASM_ATT_HIDDEN(sp_3072_from_bin_movbe) .type sp_3072_from_bin_movbe,@function .align 16 sp_3072_from_bin_movbe: #else .section __TEXT,__text .globl _sp_3072_from_bin_movbe +WC_ASM_ATT_HIDDEN(_sp_3072_from_bin_movbe) .p2align 4 _sp_3072_from_bin_movbe: #endif /* __APPLE__ */ @@ -15480,12 +15560,14 @@ L_3072_from_bin_movbe_zero_end: #ifndef __APPLE__ .text .globl sp_3072_to_bin_bswap_48 +WC_ASM_ATT_HIDDEN(sp_3072_to_bin_bswap_48) .type sp_3072_to_bin_bswap_48,@function .align 16 sp_3072_to_bin_bswap_48: #else .section __TEXT,__text .globl _sp_3072_to_bin_bswap_48 +WC_ASM_ATT_HIDDEN(_sp_3072_to_bin_bswap_48) .p2align 4 _sp_3072_to_bin_bswap_48: #endif /* __APPLE__ */ @@ -15648,12 +15730,14 @@ _sp_3072_to_bin_bswap_48: #ifndef __APPLE__ .text .globl sp_3072_to_bin_movbe_48 +WC_ASM_ATT_HIDDEN(sp_3072_to_bin_movbe_48) .type sp_3072_to_bin_movbe_48,@function .align 16 sp_3072_to_bin_movbe_48: #else .section __TEXT,__text .globl _sp_3072_to_bin_movbe_48 +WC_ASM_ATT_HIDDEN(_sp_3072_to_bin_movbe_48) .p2align 4 _sp_3072_to_bin_movbe_48: #endif /* __APPLE__ */ @@ -15767,12 +15851,14 @@ _sp_3072_to_bin_movbe_48: #ifndef __APPLE__ .text .globl sp_3072_mul_12 +WC_ASM_ATT_HIDDEN(sp_3072_mul_12) .type sp_3072_mul_12,@function .align 16 sp_3072_mul_12: #else .section __TEXT,__text .globl _sp_3072_mul_12 +WC_ASM_ATT_HIDDEN(_sp_3072_mul_12) .p2align 4 _sp_3072_mul_12: #endif /* __APPLE__ */ @@ -16724,12 +16810,14 @@ _sp_3072_mul_12: #ifndef __APPLE__ .text .globl sp_3072_mul_avx2_12 +WC_ASM_ATT_HIDDEN(sp_3072_mul_avx2_12) .type sp_3072_mul_avx2_12,@function .align 16 sp_3072_mul_avx2_12: #else .section __TEXT,__text .globl _sp_3072_mul_avx2_12 +WC_ASM_ATT_HIDDEN(_sp_3072_mul_avx2_12) .p2align 4 _sp_3072_mul_avx2_12: #endif /* __APPLE__ */ @@ -17700,12 +17788,14 @@ L_end_3072_mul_avx2_12: #ifndef __APPLE__ .text .globl sp_3072_add_12 +WC_ASM_ATT_HIDDEN(sp_3072_add_12) .type sp_3072_add_12,@function .align 16 sp_3072_add_12: #else .section __TEXT,__text .globl _sp_3072_add_12 +WC_ASM_ATT_HIDDEN(_sp_3072_add_12) .p2align 4 _sp_3072_add_12: #endif /* __APPLE__ */ @@ -17760,12 +17850,14 @@ _sp_3072_add_12: #ifndef __APPLE__ .text .globl sp_3072_sub_in_place_24 +WC_ASM_ATT_HIDDEN(sp_3072_sub_in_place_24) .type sp_3072_sub_in_place_24,@function .align 16 sp_3072_sub_in_place_24: #else .section __TEXT,__text .globl _sp_3072_sub_in_place_24 +WC_ASM_ATT_HIDDEN(_sp_3072_sub_in_place_24) .p2align 4 _sp_3072_sub_in_place_24: #endif /* __APPLE__ */ @@ -17855,12 +17947,14 @@ _sp_3072_sub_in_place_24: #ifndef __APPLE__ .text .globl sp_3072_add_24 +WC_ASM_ATT_HIDDEN(sp_3072_add_24) .type sp_3072_add_24,@function .align 16 sp_3072_add_24: #else .section __TEXT,__text .globl _sp_3072_add_24 +WC_ASM_ATT_HIDDEN(_sp_3072_add_24) .p2align 4 _sp_3072_add_24: #endif /* __APPLE__ */ @@ -17952,12 +18046,14 @@ _sp_3072_add_24: #ifndef __APPLE__ .text .globl sp_3072_mul_24 +WC_ASM_ATT_HIDDEN(sp_3072_mul_24) .type sp_3072_mul_24,@function .align 16 sp_3072_mul_24: #else .section __TEXT,__text .globl _sp_3072_mul_24 +WC_ASM_ATT_HIDDEN(_sp_3072_mul_24) .p2align 4 _sp_3072_mul_24: #endif /* __APPLE__ */ @@ -18521,12 +18617,14 @@ _sp_3072_mul_24: #ifndef __APPLE__ .text .globl sp_3072_mul_avx2_24 +WC_ASM_ATT_HIDDEN(sp_3072_mul_avx2_24) .type sp_3072_mul_avx2_24,@function .align 16 sp_3072_mul_avx2_24: #else .section __TEXT,__text .globl _sp_3072_mul_avx2_24 +WC_ASM_ATT_HIDDEN(_sp_3072_mul_avx2_24) .p2align 4 _sp_3072_mul_avx2_24: #endif /* __APPLE__ */ @@ -19053,12 +19151,14 @@ _sp_3072_mul_avx2_24: #ifndef __APPLE__ .text .globl sp_3072_sub_in_place_48 +WC_ASM_ATT_HIDDEN(sp_3072_sub_in_place_48) .type sp_3072_sub_in_place_48,@function .align 16 sp_3072_sub_in_place_48: #else .section __TEXT,__text .globl _sp_3072_sub_in_place_48 +WC_ASM_ATT_HIDDEN(_sp_3072_sub_in_place_48) .p2align 4 _sp_3072_sub_in_place_48: #endif /* __APPLE__ */ @@ -19220,12 +19320,14 @@ _sp_3072_sub_in_place_48: #ifndef __APPLE__ .text .globl sp_3072_add_48 +WC_ASM_ATT_HIDDEN(sp_3072_add_48) .type sp_3072_add_48,@function .align 16 sp_3072_add_48: #else .section __TEXT,__text .globl _sp_3072_add_48 +WC_ASM_ATT_HIDDEN(_sp_3072_add_48) .p2align 4 _sp_3072_add_48: #endif /* __APPLE__ */ @@ -19389,12 +19491,14 @@ _sp_3072_add_48: #ifndef __APPLE__ .text .globl sp_3072_mul_48 +WC_ASM_ATT_HIDDEN(sp_3072_mul_48) .type sp_3072_mul_48,@function .align 16 sp_3072_mul_48: #else .section __TEXT,__text .globl _sp_3072_mul_48 +WC_ASM_ATT_HIDDEN(_sp_3072_mul_48) .p2align 4 _sp_3072_mul_48: #endif /* __APPLE__ */ @@ -20426,12 +20530,14 @@ _sp_3072_mul_48: #ifndef __APPLE__ .text .globl sp_3072_mul_avx2_48 +WC_ASM_ATT_HIDDEN(sp_3072_mul_avx2_48) .type sp_3072_mul_avx2_48,@function .align 16 sp_3072_mul_avx2_48: #else .section __TEXT,__text .globl _sp_3072_mul_avx2_48 +WC_ASM_ATT_HIDDEN(_sp_3072_mul_avx2_48) .p2align 4 _sp_3072_mul_avx2_48: #endif /* __APPLE__ */ @@ -21390,12 +21496,14 @@ _sp_3072_mul_avx2_48: #ifndef __APPLE__ .text .globl sp_3072_sqr_12 +WC_ASM_ATT_HIDDEN(sp_3072_sqr_12) .type sp_3072_sqr_12,@function .align 16 sp_3072_sqr_12: #else .section __TEXT,__text .globl _sp_3072_sqr_12 +WC_ASM_ATT_HIDDEN(_sp_3072_sqr_12) .p2align 4 _sp_3072_sqr_12: #endif /* __APPLE__ */ @@ -22065,12 +22173,14 @@ _sp_3072_sqr_12: #ifndef __APPLE__ .text .globl sp_3072_sqr_avx2_12 +WC_ASM_ATT_HIDDEN(sp_3072_sqr_avx2_12) .type sp_3072_sqr_avx2_12,@function .align 16 sp_3072_sqr_avx2_12: #else .section __TEXT,__text .globl _sp_3072_sqr_avx2_12 +WC_ASM_ATT_HIDDEN(_sp_3072_sqr_avx2_12) .p2align 4 _sp_3072_sqr_avx2_12: #endif /* __APPLE__ */ @@ -22714,12 +22824,14 @@ L_end_3072_sqr_avx2_12: #ifndef __APPLE__ .text .globl sp_3072_sqr_24 +WC_ASM_ATT_HIDDEN(sp_3072_sqr_24) .type sp_3072_sqr_24,@function .align 16 sp_3072_sqr_24: #else .section __TEXT,__text .globl _sp_3072_sqr_24 +WC_ASM_ATT_HIDDEN(_sp_3072_sqr_24) .p2align 4 _sp_3072_sqr_24: #endif /* __APPLE__ */ @@ -23139,12 +23251,14 @@ _sp_3072_sqr_24: #ifndef __APPLE__ .text .globl sp_3072_sqr_avx2_24 +WC_ASM_ATT_HIDDEN(sp_3072_sqr_avx2_24) .type sp_3072_sqr_avx2_24,@function .align 16 sp_3072_sqr_avx2_24: #else .section __TEXT,__text .globl _sp_3072_sqr_avx2_24 +WC_ASM_ATT_HIDDEN(_sp_3072_sqr_avx2_24) .p2align 4 _sp_3072_sqr_avx2_24: #endif /* __APPLE__ */ @@ -23564,12 +23678,14 @@ _sp_3072_sqr_avx2_24: #ifndef __APPLE__ .text .globl sp_3072_sqr_48 +WC_ASM_ATT_HIDDEN(sp_3072_sqr_48) .type sp_3072_sqr_48,@function .align 16 sp_3072_sqr_48: #else .section __TEXT,__text .globl _sp_3072_sqr_48 +WC_ASM_ATT_HIDDEN(_sp_3072_sqr_48) .p2align 4 _sp_3072_sqr_48: #endif /* __APPLE__ */ @@ -24337,12 +24453,14 @@ _sp_3072_sqr_48: #ifndef __APPLE__ .text .globl sp_3072_sqr_avx2_48 +WC_ASM_ATT_HIDDEN(sp_3072_sqr_avx2_48) .type sp_3072_sqr_avx2_48,@function .align 16 sp_3072_sqr_avx2_48: #else .section __TEXT,__text .globl _sp_3072_sqr_avx2_48 +WC_ASM_ATT_HIDDEN(_sp_3072_sqr_avx2_48) .p2align 4 _sp_3072_sqr_avx2_48: #endif /* __APPLE__ */ @@ -25109,12 +25227,14 @@ _sp_3072_sqr_avx2_48: #ifndef __APPLE__ .text .globl sp_3072_mul_d_48 +WC_ASM_ATT_HIDDEN(sp_3072_mul_d_48) .type sp_3072_mul_d_48,@function .align 16 sp_3072_mul_d_48: #else .section __TEXT,__text .globl _sp_3072_mul_d_48 +WC_ASM_ATT_HIDDEN(_sp_3072_mul_d_48) .p2align 4 _sp_3072_mul_d_48: #endif /* __APPLE__ */ @@ -25517,12 +25637,14 @@ _sp_3072_mul_d_48: #ifndef __APPLE__ .text .globl sp_3072_cond_sub_24 +WC_ASM_ATT_HIDDEN(sp_3072_cond_sub_24) .type sp_3072_cond_sub_24,@function .align 16 sp_3072_cond_sub_24: #else .section __TEXT,__text .globl _sp_3072_cond_sub_24 +WC_ASM_ATT_HIDDEN(_sp_3072_cond_sub_24) .p2align 4 _sp_3072_cond_sub_24: #endif /* __APPLE__ */ @@ -25711,12 +25833,14 @@ _sp_3072_cond_sub_24: #ifndef __APPLE__ .text .globl sp_3072_mont_reduce_24 +WC_ASM_ATT_HIDDEN(sp_3072_mont_reduce_24) .type sp_3072_mont_reduce_24,@function .align 16 sp_3072_mont_reduce_24: #else .section __TEXT,__text .globl _sp_3072_mont_reduce_24 +WC_ASM_ATT_HIDDEN(_sp_3072_mont_reduce_24) .p2align 4 _sp_3072_mont_reduce_24: #endif /* __APPLE__ */ @@ -26014,12 +26138,14 @@ L_3072_mont_reduce_24_loop: #ifndef __APPLE__ .text .globl sp_3072_cond_sub_avx2_24 +WC_ASM_ATT_HIDDEN(sp_3072_cond_sub_avx2_24) .type sp_3072_cond_sub_avx2_24,@function .align 16 sp_3072_cond_sub_avx2_24: #else .section __TEXT,__text .globl _sp_3072_cond_sub_avx2_24 +WC_ASM_ATT_HIDDEN(_sp_3072_cond_sub_avx2_24) .p2align 4 _sp_3072_cond_sub_avx2_24: #endif /* __APPLE__ */ @@ -26158,12 +26284,14 @@ _sp_3072_cond_sub_avx2_24: #ifndef __APPLE__ .text .globl sp_3072_mul_d_24 +WC_ASM_ATT_HIDDEN(sp_3072_mul_d_24) .type sp_3072_mul_d_24,@function .align 16 sp_3072_mul_d_24: #else .section __TEXT,__text .globl _sp_3072_mul_d_24 +WC_ASM_ATT_HIDDEN(_sp_3072_mul_d_24) .p2align 4 _sp_3072_mul_d_24: #endif /* __APPLE__ */ @@ -26372,12 +26500,14 @@ _sp_3072_mul_d_24: #ifndef __APPLE__ .text .globl sp_3072_mul_d_avx2_24 +WC_ASM_ATT_HIDDEN(sp_3072_mul_d_avx2_24) .type sp_3072_mul_d_avx2_24,@function .align 16 sp_3072_mul_d_avx2_24: #else .section __TEXT,__text .globl _sp_3072_mul_d_avx2_24 +WC_ASM_ATT_HIDDEN(_sp_3072_mul_d_avx2_24) .p2align 4 _sp_3072_mul_d_avx2_24: #endif /* __APPLE__ */ @@ -26544,12 +26674,14 @@ _sp_3072_mul_d_avx2_24: #ifndef __APPLE__ .text .globl div_3072_word_asm_24 +WC_ASM_ATT_HIDDEN(div_3072_word_asm_24) .type div_3072_word_asm_24,@function .align 16 div_3072_word_asm_24: #else .section __TEXT,__text .globl _div_3072_word_asm_24 +WC_ASM_ATT_HIDDEN(_div_3072_word_asm_24) .p2align 4 _div_3072_word_asm_24: #endif /* __APPLE__ */ @@ -26573,12 +26705,14 @@ _div_3072_word_asm_24: #ifndef __APPLE__ .text .globl sp_3072_cmp_24 +WC_ASM_ATT_HIDDEN(sp_3072_cmp_24) .type sp_3072_cmp_24,@function .align 16 sp_3072_cmp_24: #else .section __TEXT,__text .globl _sp_3072_cmp_24 +WC_ASM_ATT_HIDDEN(_sp_3072_cmp_24) .p2align 4 _sp_3072_cmp_24: #endif /* __APPLE__ */ @@ -26794,12 +26928,14 @@ _sp_3072_cmp_24: #ifndef __APPLE__ .text .globl sp_3072_mont_reduce_avx2_24 +WC_ASM_ATT_HIDDEN(sp_3072_mont_reduce_avx2_24) .type sp_3072_mont_reduce_avx2_24,@function .align 16 sp_3072_mont_reduce_avx2_24: #else .section __TEXT,__text .globl _sp_3072_mont_reduce_avx2_24 +WC_ASM_ATT_HIDDEN(_sp_3072_mont_reduce_avx2_24) .p2align 4 _sp_3072_mont_reduce_avx2_24: #endif /* __APPLE__ */ @@ -27112,12 +27248,14 @@ L_3072_mont_reduce_avx2_24_loop: #ifndef __APPLE__ .text .globl sp_3072_get_from_table_avx2_24 +WC_ASM_ATT_HIDDEN(sp_3072_get_from_table_avx2_24) .type sp_3072_get_from_table_avx2_24,@function .align 16 sp_3072_get_from_table_avx2_24: #else .section __TEXT,__text .globl _sp_3072_get_from_table_avx2_24 +WC_ASM_ATT_HIDDEN(_sp_3072_get_from_table_avx2_24) .p2align 4 _sp_3072_get_from_table_avx2_24: #endif /* __APPLE__ */ @@ -28027,12 +28165,14 @@ _sp_3072_get_from_table_avx2_24: #ifndef __APPLE__ .text .globl sp_3072_cond_sub_48 +WC_ASM_ATT_HIDDEN(sp_3072_cond_sub_48) .type sp_3072_cond_sub_48,@function .align 16 sp_3072_cond_sub_48: #else .section __TEXT,__text .globl _sp_3072_cond_sub_48 +WC_ASM_ATT_HIDDEN(_sp_3072_cond_sub_48) .p2align 4 _sp_3072_cond_sub_48: #endif /* __APPLE__ */ @@ -28389,12 +28529,14 @@ _sp_3072_cond_sub_48: #ifndef __APPLE__ .text .globl sp_3072_mont_reduce_48 +WC_ASM_ATT_HIDDEN(sp_3072_mont_reduce_48) .type sp_3072_mont_reduce_48,@function .align 16 sp_3072_mont_reduce_48: #else .section __TEXT,__text .globl _sp_3072_mont_reduce_48 +WC_ASM_ATT_HIDDEN(_sp_3072_mont_reduce_48) .p2align 4 _sp_3072_mont_reduce_48: #endif /* __APPLE__ */ @@ -28928,12 +29070,14 @@ L_3072_mont_reduce_48_loop: #ifndef __APPLE__ .text .globl sp_3072_sub_48 +WC_ASM_ATT_HIDDEN(sp_3072_sub_48) .type sp_3072_sub_48,@function .align 16 sp_3072_sub_48: #else .section __TEXT,__text .globl _sp_3072_sub_48 +WC_ASM_ATT_HIDDEN(_sp_3072_sub_48) .p2align 4 _sp_3072_sub_48: #endif /* __APPLE__ */ @@ -29096,12 +29240,14 @@ _sp_3072_sub_48: #ifndef __APPLE__ .text .globl sp_3072_mul_d_avx2_48 +WC_ASM_ATT_HIDDEN(sp_3072_mul_d_avx2_48) .type sp_3072_mul_d_avx2_48,@function .align 16 sp_3072_mul_d_avx2_48: #else .section __TEXT,__text .globl _sp_3072_mul_d_avx2_48 +WC_ASM_ATT_HIDDEN(_sp_3072_mul_d_avx2_48) .p2align 4 _sp_3072_mul_d_avx2_48: #endif /* __APPLE__ */ @@ -29412,12 +29558,14 @@ _sp_3072_mul_d_avx2_48: #ifndef __APPLE__ .text .globl div_3072_word_asm_48 +WC_ASM_ATT_HIDDEN(div_3072_word_asm_48) .type div_3072_word_asm_48,@function .align 16 div_3072_word_asm_48: #else .section __TEXT,__text .globl _div_3072_word_asm_48 +WC_ASM_ATT_HIDDEN(_div_3072_word_asm_48) .p2align 4 _div_3072_word_asm_48: #endif /* __APPLE__ */ @@ -29443,12 +29591,14 @@ _div_3072_word_asm_48: #ifndef __APPLE__ .text .globl sp_3072_cond_sub_avx2_48 +WC_ASM_ATT_HIDDEN(sp_3072_cond_sub_avx2_48) .type sp_3072_cond_sub_avx2_48,@function .align 16 sp_3072_cond_sub_avx2_48: #else .section __TEXT,__text .globl _sp_3072_cond_sub_avx2_48 +WC_ASM_ATT_HIDDEN(_sp_3072_cond_sub_avx2_48) .p2align 4 _sp_3072_cond_sub_avx2_48: #endif /* __APPLE__ */ @@ -29709,12 +29859,14 @@ _sp_3072_cond_sub_avx2_48: #ifndef __APPLE__ .text .globl sp_3072_cmp_48 +WC_ASM_ATT_HIDDEN(sp_3072_cmp_48) .type sp_3072_cmp_48,@function .align 16 sp_3072_cmp_48: #else .section __TEXT,__text .globl _sp_3072_cmp_48 +WC_ASM_ATT_HIDDEN(_sp_3072_cmp_48) .p2align 4 _sp_3072_cmp_48: #endif /* __APPLE__ */ @@ -30122,12 +30274,14 @@ _sp_3072_cmp_48: #ifndef __APPLE__ .text .globl sp_3072_mont_reduce_avx2_48 +WC_ASM_ATT_HIDDEN(sp_3072_mont_reduce_avx2_48) .type sp_3072_mont_reduce_avx2_48,@function .align 16 sp_3072_mont_reduce_avx2_48: #else .section __TEXT,__text .globl _sp_3072_mont_reduce_avx2_48 +WC_ASM_ATT_HIDDEN(_sp_3072_mont_reduce_avx2_48) .p2align 4 _sp_3072_mont_reduce_avx2_48: #endif /* __APPLE__ */ @@ -30704,12 +30858,14 @@ L_3072_mont_reduce_avx2_48_loop: #ifndef __APPLE__ .text .globl sp_3072_get_from_table_avx2_48 +WC_ASM_ATT_HIDDEN(sp_3072_get_from_table_avx2_48) .type sp_3072_get_from_table_avx2_48,@function .align 16 sp_3072_get_from_table_avx2_48: #else .section __TEXT,__text .globl _sp_3072_get_from_table_avx2_48 +WC_ASM_ATT_HIDDEN(_sp_3072_get_from_table_avx2_48) .p2align 4 _sp_3072_get_from_table_avx2_48: #endif /* __APPLE__ */ @@ -31571,12 +31727,14 @@ _sp_3072_get_from_table_avx2_48: #ifndef __APPLE__ .text .globl sp_3072_cond_add_24 +WC_ASM_ATT_HIDDEN(sp_3072_cond_add_24) .type sp_3072_cond_add_24,@function .align 16 sp_3072_cond_add_24: #else .section __TEXT,__text .globl _sp_3072_cond_add_24 +WC_ASM_ATT_HIDDEN(_sp_3072_cond_add_24) .p2align 4 _sp_3072_cond_add_24: #endif /* __APPLE__ */ @@ -31769,12 +31927,14 @@ _sp_3072_cond_add_24: #ifndef __APPLE__ .text .globl sp_3072_cond_add_avx2_24 +WC_ASM_ATT_HIDDEN(sp_3072_cond_add_avx2_24) .type sp_3072_cond_add_avx2_24,@function .align 16 sp_3072_cond_add_avx2_24: #else .section __TEXT,__text .globl _sp_3072_cond_add_avx2_24 +WC_ASM_ATT_HIDDEN(_sp_3072_cond_add_avx2_24) .p2align 4 _sp_3072_cond_add_avx2_24: #endif /* __APPLE__ */ @@ -31914,12 +32074,14 @@ _sp_3072_cond_add_avx2_24: #ifndef __APPLE__ .text .globl sp_3072_lshift_48 +WC_ASM_ATT_HIDDEN(sp_3072_lshift_48) .type sp_3072_lshift_48,@function .align 16 sp_3072_lshift_48: #else .section __TEXT,__text .globl _sp_3072_lshift_48 +WC_ASM_ATT_HIDDEN(_sp_3072_lshift_48) .p2align 4 _sp_3072_lshift_48: #endif /* __APPLE__ */ @@ -32090,12 +32252,14 @@ _sp_3072_lshift_48: #ifndef __APPLE__ .text .globl sp_4096_from_bin_bswap +WC_ASM_ATT_HIDDEN(sp_4096_from_bin_bswap) .type sp_4096_from_bin_bswap,@function .align 16 sp_4096_from_bin_bswap: #else .section __TEXT,__text .globl _sp_4096_from_bin_bswap +WC_ASM_ATT_HIDDEN(_sp_4096_from_bin_bswap) .p2align 4 _sp_4096_from_bin_bswap: #endif /* __APPLE__ */ @@ -32185,12 +32349,14 @@ L_4096_from_bin_bswap_zero_end: #ifndef __APPLE__ .text .globl sp_4096_from_bin_movbe +WC_ASM_ATT_HIDDEN(sp_4096_from_bin_movbe) .type sp_4096_from_bin_movbe,@function .align 16 sp_4096_from_bin_movbe: #else .section __TEXT,__text .globl _sp_4096_from_bin_movbe +WC_ASM_ATT_HIDDEN(_sp_4096_from_bin_movbe) .p2align 4 _sp_4096_from_bin_movbe: #endif /* __APPLE__ */ @@ -32269,12 +32435,14 @@ L_4096_from_bin_movbe_zero_end: #ifndef __APPLE__ .text .globl sp_4096_to_bin_bswap_64 +WC_ASM_ATT_HIDDEN(sp_4096_to_bin_bswap_64) .type sp_4096_to_bin_bswap_64,@function .align 16 sp_4096_to_bin_bswap_64: #else .section __TEXT,__text .globl _sp_4096_to_bin_bswap_64 +WC_ASM_ATT_HIDDEN(_sp_4096_to_bin_bswap_64) .p2align 4 _sp_4096_to_bin_bswap_64: #endif /* __APPLE__ */ @@ -32485,12 +32653,14 @@ _sp_4096_to_bin_bswap_64: #ifndef __APPLE__ .text .globl sp_4096_to_bin_movbe_64 +WC_ASM_ATT_HIDDEN(sp_4096_to_bin_movbe_64) .type sp_4096_to_bin_movbe_64,@function .align 16 sp_4096_to_bin_movbe_64: #else .section __TEXT,__text .globl _sp_4096_to_bin_movbe_64 +WC_ASM_ATT_HIDDEN(_sp_4096_to_bin_movbe_64) .p2align 4 _sp_4096_to_bin_movbe_64: #endif /* __APPLE__ */ @@ -32635,12 +32805,14 @@ _sp_4096_to_bin_movbe_64: #ifndef __APPLE__ .text .globl sp_4096_sub_in_place_64 +WC_ASM_ATT_HIDDEN(sp_4096_sub_in_place_64) .type sp_4096_sub_in_place_64,@function .align 16 sp_4096_sub_in_place_64: #else .section __TEXT,__text .globl _sp_4096_sub_in_place_64 +WC_ASM_ATT_HIDDEN(_sp_4096_sub_in_place_64) .p2align 4 _sp_4096_sub_in_place_64: #endif /* __APPLE__ */ @@ -32850,12 +33022,14 @@ _sp_4096_sub_in_place_64: #ifndef __APPLE__ .text .globl sp_4096_add_64 +WC_ASM_ATT_HIDDEN(sp_4096_add_64) .type sp_4096_add_64,@function .align 16 sp_4096_add_64: #else .section __TEXT,__text .globl _sp_4096_add_64 +WC_ASM_ATT_HIDDEN(_sp_4096_add_64) .p2align 4 _sp_4096_add_64: #endif /* __APPLE__ */ @@ -33067,12 +33241,14 @@ _sp_4096_add_64: #ifndef __APPLE__ .text .globl sp_4096_mul_64 +WC_ASM_ATT_HIDDEN(sp_4096_mul_64) .type sp_4096_mul_64,@function .align 16 sp_4096_mul_64: #else .section __TEXT,__text .globl _sp_4096_mul_64 +WC_ASM_ATT_HIDDEN(_sp_4096_mul_64) .p2align 4 _sp_4096_mul_64: #endif /* __APPLE__ */ @@ -34416,12 +34592,14 @@ _sp_4096_mul_64: #ifndef __APPLE__ .text .globl sp_4096_mul_avx2_64 +WC_ASM_ATT_HIDDEN(sp_4096_mul_avx2_64) .type sp_4096_mul_avx2_64,@function .align 16 sp_4096_mul_avx2_64: #else .section __TEXT,__text .globl _sp_4096_mul_avx2_64 +WC_ASM_ATT_HIDDEN(_sp_4096_mul_avx2_64) .p2align 4 _sp_4096_mul_avx2_64: #endif /* __APPLE__ */ @@ -35670,12 +35848,14 @@ _sp_4096_mul_avx2_64: #ifndef __APPLE__ .text .globl sp_4096_sqr_64 +WC_ASM_ATT_HIDDEN(sp_4096_sqr_64) .type sp_4096_sqr_64,@function .align 16 sp_4096_sqr_64: #else .section __TEXT,__text .globl _sp_4096_sqr_64 +WC_ASM_ATT_HIDDEN(_sp_4096_sqr_64) .p2align 4 _sp_4096_sqr_64: #endif /* __APPLE__ */ @@ -36675,12 +36855,14 @@ _sp_4096_sqr_64: #ifndef __APPLE__ .text .globl sp_4096_sqr_avx2_64 +WC_ASM_ATT_HIDDEN(sp_4096_sqr_avx2_64) .type sp_4096_sqr_avx2_64,@function .align 16 sp_4096_sqr_avx2_64: #else .section __TEXT,__text .globl _sp_4096_sqr_avx2_64 +WC_ASM_ATT_HIDDEN(_sp_4096_sqr_avx2_64) .p2align 4 _sp_4096_sqr_avx2_64: #endif /* __APPLE__ */ @@ -37679,12 +37861,14 @@ _sp_4096_sqr_avx2_64: #ifndef __APPLE__ .text .globl sp_4096_mul_d_64 +WC_ASM_ATT_HIDDEN(sp_4096_mul_d_64) .type sp_4096_mul_d_64,@function .align 16 sp_4096_mul_d_64: #else .section __TEXT,__text .globl _sp_4096_mul_d_64 +WC_ASM_ATT_HIDDEN(_sp_4096_mul_d_64) .p2align 4 _sp_4096_mul_d_64: #endif /* __APPLE__ */ @@ -38215,12 +38399,14 @@ _sp_4096_mul_d_64: #ifndef __APPLE__ .text .globl sp_4096_cond_sub_64 +WC_ASM_ATT_HIDDEN(sp_4096_cond_sub_64) .type sp_4096_cond_sub_64,@function .align 16 sp_4096_cond_sub_64: #else .section __TEXT,__text .globl _sp_4096_cond_sub_64 +WC_ASM_ATT_HIDDEN(_sp_4096_cond_sub_64) .p2align 4 _sp_4096_cond_sub_64: #endif /* __APPLE__ */ @@ -38689,12 +38875,14 @@ _sp_4096_cond_sub_64: #ifndef __APPLE__ .text .globl sp_4096_mont_reduce_64 +WC_ASM_ATT_HIDDEN(sp_4096_mont_reduce_64) .type sp_4096_mont_reduce_64,@function .align 16 sp_4096_mont_reduce_64: #else .section __TEXT,__text .globl _sp_4096_mont_reduce_64 +WC_ASM_ATT_HIDDEN(_sp_4096_mont_reduce_64) .p2align 4 _sp_4096_mont_reduce_64: #endif /* __APPLE__ */ @@ -39388,12 +39576,14 @@ L_4096_mont_reduce_64_loop: #ifndef __APPLE__ .text .globl sp_4096_sub_64 +WC_ASM_ATT_HIDDEN(sp_4096_sub_64) .type sp_4096_sub_64,@function .align 16 sp_4096_sub_64: #else .section __TEXT,__text .globl _sp_4096_sub_64 +WC_ASM_ATT_HIDDEN(_sp_4096_sub_64) .p2align 4 _sp_4096_sub_64: #endif /* __APPLE__ */ @@ -39604,12 +39794,14 @@ _sp_4096_sub_64: #ifndef __APPLE__ .text .globl sp_4096_mul_d_avx2_64 +WC_ASM_ATT_HIDDEN(sp_4096_mul_d_avx2_64) .type sp_4096_mul_d_avx2_64,@function .align 16 sp_4096_mul_d_avx2_64: #else .section __TEXT,__text .globl _sp_4096_mul_d_avx2_64 +WC_ASM_ATT_HIDDEN(_sp_4096_mul_d_avx2_64) .p2align 4 _sp_4096_mul_d_avx2_64: #endif /* __APPLE__ */ @@ -40016,12 +40208,14 @@ _sp_4096_mul_d_avx2_64: #ifndef __APPLE__ .text .globl div_4096_word_asm_64 +WC_ASM_ATT_HIDDEN(div_4096_word_asm_64) .type div_4096_word_asm_64,@function .align 16 div_4096_word_asm_64: #else .section __TEXT,__text .globl _div_4096_word_asm_64 +WC_ASM_ATT_HIDDEN(_div_4096_word_asm_64) .p2align 4 _div_4096_word_asm_64: #endif /* __APPLE__ */ @@ -40047,12 +40241,14 @@ _div_4096_word_asm_64: #ifndef __APPLE__ .text .globl sp_4096_cond_sub_avx2_64 +WC_ASM_ATT_HIDDEN(sp_4096_cond_sub_avx2_64) .type sp_4096_cond_sub_avx2_64,@function .align 16 sp_4096_cond_sub_avx2_64: #else .section __TEXT,__text .globl _sp_4096_cond_sub_avx2_64 +WC_ASM_ATT_HIDDEN(_sp_4096_cond_sub_avx2_64) .p2align 4 _sp_4096_cond_sub_avx2_64: #endif /* __APPLE__ */ @@ -40393,12 +40589,14 @@ _sp_4096_cond_sub_avx2_64: #ifndef __APPLE__ .text .globl sp_4096_cmp_64 +WC_ASM_ATT_HIDDEN(sp_4096_cmp_64) .type sp_4096_cmp_64,@function .align 16 sp_4096_cmp_64: #else .section __TEXT,__text .globl _sp_4096_cmp_64 +WC_ASM_ATT_HIDDEN(_sp_4096_cmp_64) .p2align 4 _sp_4096_cmp_64: #endif /* __APPLE__ */ @@ -40934,12 +41132,14 @@ _sp_4096_cmp_64: #ifndef __APPLE__ .text .globl sp_4096_mont_reduce_avx2_64 +WC_ASM_ATT_HIDDEN(sp_4096_mont_reduce_avx2_64) .type sp_4096_mont_reduce_avx2_64,@function .align 16 sp_4096_mont_reduce_avx2_64: #else .section __TEXT,__text .globl _sp_4096_mont_reduce_avx2_64 +WC_ASM_ATT_HIDDEN(_sp_4096_mont_reduce_avx2_64) .p2align 4 _sp_4096_mont_reduce_avx2_64: #endif /* __APPLE__ */ @@ -41692,12 +41892,14 @@ L_4096_mont_reduce_avx2_64_loop: #ifndef __APPLE__ .text .globl sp_4096_get_from_table_avx2_64 +WC_ASM_ATT_HIDDEN(sp_4096_get_from_table_avx2_64) .type sp_4096_get_from_table_avx2_64,@function .align 16 sp_4096_get_from_table_avx2_64: #else .section __TEXT,__text .globl _sp_4096_get_from_table_avx2_64 +WC_ASM_ATT_HIDDEN(_sp_4096_get_from_table_avx2_64) .p2align 4 _sp_4096_get_from_table_avx2_64: #endif /* __APPLE__ */ @@ -42843,12 +43045,14 @@ _sp_4096_get_from_table_avx2_64: #ifndef __APPLE__ .text .globl sp_4096_cond_add_32 +WC_ASM_ATT_HIDDEN(sp_4096_cond_add_32) .type sp_4096_cond_add_32,@function .align 16 sp_4096_cond_add_32: #else .section __TEXT,__text .globl _sp_4096_cond_add_32 +WC_ASM_ATT_HIDDEN(_sp_4096_cond_add_32) .p2align 4 _sp_4096_cond_add_32: #endif /* __APPLE__ */ @@ -43097,12 +43301,14 @@ _sp_4096_cond_add_32: #ifndef __APPLE__ .text .globl sp_4096_cond_add_avx2_32 +WC_ASM_ATT_HIDDEN(sp_4096_cond_add_avx2_32) .type sp_4096_cond_add_avx2_32,@function .align 16 sp_4096_cond_add_avx2_32: #else .section __TEXT,__text .globl _sp_4096_cond_add_avx2_32 +WC_ASM_ATT_HIDDEN(_sp_4096_cond_add_avx2_32) .p2align 4 _sp_4096_cond_add_avx2_32: #endif /* __APPLE__ */ @@ -43282,12 +43488,14 @@ _sp_4096_cond_add_avx2_32: #ifndef __APPLE__ .text .globl sp_4096_lshift_64 +WC_ASM_ATT_HIDDEN(sp_4096_lshift_64) .type sp_4096_lshift_64,@function .align 16 sp_4096_lshift_64: #else .section __TEXT,__text .globl _sp_4096_lshift_64 +WC_ASM_ATT_HIDDEN(_sp_4096_lshift_64) .p2align 4 _sp_4096_lshift_64: #endif /* __APPLE__ */ @@ -43503,12 +43711,14 @@ _sp_4096_lshift_64: #ifndef __APPLE__ .text .globl sp_256_mul_4 +WC_ASM_ATT_HIDDEN(sp_256_mul_4) .type sp_256_mul_4,@function .align 16 sp_256_mul_4: #else .section __TEXT,__text .globl _sp_256_mul_4 +WC_ASM_ATT_HIDDEN(_sp_256_mul_4) .p2align 4 _sp_256_mul_4: #endif /* __APPLE__ */ @@ -43644,12 +43854,14 @@ _sp_256_mul_4: #ifndef __APPLE__ .text .globl sp_256_mul_avx2_4 +WC_ASM_ATT_HIDDEN(sp_256_mul_avx2_4) .type sp_256_mul_avx2_4,@function .align 16 sp_256_mul_avx2_4: #else .section __TEXT,__text .globl _sp_256_mul_avx2_4 +WC_ASM_ATT_HIDDEN(_sp_256_mul_avx2_4) .p2align 4 _sp_256_mul_avx2_4: #endif /* __APPLE__ */ @@ -43759,12 +43971,14 @@ _sp_256_mul_avx2_4: #ifndef __APPLE__ .text .globl sp_256_sqr_4 +WC_ASM_ATT_HIDDEN(sp_256_sqr_4) .type sp_256_sqr_4,@function .align 16 sp_256_sqr_4: #else .section __TEXT,__text .globl _sp_256_sqr_4 +WC_ASM_ATT_HIDDEN(_sp_256_sqr_4) .p2align 4 _sp_256_sqr_4: #endif /* __APPLE__ */ @@ -43882,12 +44096,14 @@ _sp_256_sqr_4: #ifndef __APPLE__ .text .globl sp_256_sqr_avx2_4 +WC_ASM_ATT_HIDDEN(sp_256_sqr_avx2_4) .type sp_256_sqr_avx2_4,@function .align 16 sp_256_sqr_avx2_4: #else .section __TEXT,__text .globl _sp_256_sqr_avx2_4 +WC_ASM_ATT_HIDDEN(_sp_256_sqr_avx2_4) .p2align 4 _sp_256_sqr_avx2_4: #endif /* __APPLE__ */ @@ -43980,12 +44196,14 @@ _sp_256_sqr_avx2_4: #ifndef __APPLE__ .text .globl sp_256_add_4 +WC_ASM_ATT_HIDDEN(sp_256_add_4) .type sp_256_add_4,@function .align 16 sp_256_add_4: #else .section __TEXT,__text .globl _sp_256_add_4 +WC_ASM_ATT_HIDDEN(_sp_256_add_4) .p2align 4 _sp_256_add_4: #endif /* __APPLE__ */ @@ -44016,12 +44234,14 @@ _sp_256_add_4: #ifndef __APPLE__ .text .globl sp_256_sub_4 +WC_ASM_ATT_HIDDEN(sp_256_sub_4) .type sp_256_sub_4,@function .align 16 sp_256_sub_4: #else .section __TEXT,__text .globl _sp_256_sub_4 +WC_ASM_ATT_HIDDEN(_sp_256_sub_4) .p2align 4 _sp_256_sub_4: #endif /* __APPLE__ */ @@ -44053,12 +44273,14 @@ _sp_256_sub_4: #ifndef __APPLE__ .text .globl sp_256_cond_copy_4 +WC_ASM_ATT_HIDDEN(sp_256_cond_copy_4) .type sp_256_cond_copy_4,@function .align 16 sp_256_cond_copy_4: #else .section __TEXT,__text .globl _sp_256_cond_copy_4 +WC_ASM_ATT_HIDDEN(_sp_256_cond_copy_4) .p2align 4 _sp_256_cond_copy_4: #endif /* __APPLE__ */ @@ -44094,12 +44316,14 @@ _sp_256_cond_copy_4: #ifndef __APPLE__ .text .globl sp_256_mont_mul_4 +WC_ASM_ATT_HIDDEN(sp_256_mont_mul_4) .type sp_256_mont_mul_4,@function .align 16 sp_256_mont_mul_4: #else .section __TEXT,__text .globl _sp_256_mont_mul_4 +WC_ASM_ATT_HIDDEN(_sp_256_mont_mul_4) .p2align 4 _sp_256_mont_mul_4: #endif /* __APPLE__ */ @@ -44297,12 +44521,14 @@ _sp_256_mont_mul_4: #ifndef __APPLE__ .text .globl sp_256_mont_sqr_4 +WC_ASM_ATT_HIDDEN(sp_256_mont_sqr_4) .type sp_256_mont_sqr_4,@function .align 16 sp_256_mont_sqr_4: #else .section __TEXT,__text .globl _sp_256_mont_sqr_4 +WC_ASM_ATT_HIDDEN(_sp_256_mont_sqr_4) .p2align 4 _sp_256_mont_sqr_4: #endif /* __APPLE__ */ @@ -44471,12 +44697,14 @@ _sp_256_mont_sqr_4: #ifndef __APPLE__ .text .globl sp_256_cmp_4 +WC_ASM_ATT_HIDDEN(sp_256_cmp_4) .type sp_256_cmp_4,@function .align 16 sp_256_cmp_4: #else .section __TEXT,__text .globl _sp_256_cmp_4 +WC_ASM_ATT_HIDDEN(_sp_256_cmp_4) .p2align 4 _sp_256_cmp_4: #endif /* __APPLE__ */ @@ -44533,12 +44761,14 @@ _sp_256_cmp_4: #ifndef __APPLE__ .text .globl sp_256_cond_sub_4 +WC_ASM_ATT_HIDDEN(sp_256_cond_sub_4) .type sp_256_cond_sub_4,@function .align 16 sp_256_cond_sub_4: #else .section __TEXT,__text .globl _sp_256_cond_sub_4 +WC_ASM_ATT_HIDDEN(_sp_256_cond_sub_4) .p2align 4 _sp_256_cond_sub_4: #endif /* __APPLE__ */ @@ -44585,12 +44815,14 @@ _sp_256_cond_sub_4: #ifndef __APPLE__ .text .globl sp_256_mont_reduce_4 +WC_ASM_ATT_HIDDEN(sp_256_mont_reduce_4) .type sp_256_mont_reduce_4,@function .align 16 sp_256_mont_reduce_4: #else .section __TEXT,__text .globl _sp_256_mont_reduce_4 +WC_ASM_ATT_HIDDEN(_sp_256_mont_reduce_4) .p2align 4 _sp_256_mont_reduce_4: #endif /* __APPLE__ */ @@ -44697,12 +44929,14 @@ _sp_256_mont_reduce_4: #ifndef __APPLE__ .text .globl sp_256_mont_reduce_order_4 +WC_ASM_ATT_HIDDEN(sp_256_mont_reduce_order_4) .type sp_256_mont_reduce_order_4,@function .align 16 sp_256_mont_reduce_order_4: #else .section __TEXT,__text .globl _sp_256_mont_reduce_order_4 +WC_ASM_ATT_HIDDEN(_sp_256_mont_reduce_order_4) .p2align 4 _sp_256_mont_reduce_order_4: #endif /* __APPLE__ */ @@ -44806,12 +45040,14 @@ L_mont_loop_4: #ifndef __APPLE__ .text .globl sp_256_mont_add_4 +WC_ASM_ATT_HIDDEN(sp_256_mont_add_4) .type sp_256_mont_add_4,@function .align 16 sp_256_mont_add_4: #else .section __TEXT,__text .globl _sp_256_mont_add_4 +WC_ASM_ATT_HIDDEN(_sp_256_mont_add_4) .p2align 4 _sp_256_mont_add_4: #endif /* __APPLE__ */ @@ -44855,12 +45091,14 @@ _sp_256_mont_add_4: #ifndef __APPLE__ .text .globl sp_256_mont_dbl_4 +WC_ASM_ATT_HIDDEN(sp_256_mont_dbl_4) .type sp_256_mont_dbl_4,@function .align 16 sp_256_mont_dbl_4: #else .section __TEXT,__text .globl _sp_256_mont_dbl_4 +WC_ASM_ATT_HIDDEN(_sp_256_mont_dbl_4) .p2align 4 _sp_256_mont_dbl_4: #endif /* __APPLE__ */ @@ -44905,12 +45143,14 @@ _sp_256_mont_dbl_4: #ifndef __APPLE__ .text .globl sp_256_mont_tpl_4 +WC_ASM_ATT_HIDDEN(sp_256_mont_tpl_4) .type sp_256_mont_tpl_4,@function .align 16 sp_256_mont_tpl_4: #else .section __TEXT,__text .globl _sp_256_mont_tpl_4 +WC_ASM_ATT_HIDDEN(_sp_256_mont_tpl_4) .p2align 4 _sp_256_mont_tpl_4: #endif /* __APPLE__ */ @@ -44974,12 +45214,14 @@ _sp_256_mont_tpl_4: #ifndef __APPLE__ .text .globl sp_256_mont_sub_4 +WC_ASM_ATT_HIDDEN(sp_256_mont_sub_4) .type sp_256_mont_sub_4,@function .align 16 sp_256_mont_sub_4: #else .section __TEXT,__text .globl _sp_256_mont_sub_4 +WC_ASM_ATT_HIDDEN(_sp_256_mont_sub_4) .p2align 4 _sp_256_mont_sub_4: #endif /* __APPLE__ */ @@ -45023,12 +45265,14 @@ _sp_256_mont_sub_4: #ifndef __APPLE__ .text .globl sp_256_mont_div2_4 +WC_ASM_ATT_HIDDEN(sp_256_mont_div2_4) .type sp_256_mont_div2_4,@function .align 16 sp_256_mont_div2_4: #else .section __TEXT,__text .globl _sp_256_mont_div2_4 +WC_ASM_ATT_HIDDEN(_sp_256_mont_div2_4) .p2align 4 _sp_256_mont_div2_4: #endif /* __APPLE__ */ @@ -45070,12 +45314,14 @@ _sp_256_mont_div2_4: #ifndef __APPLE__ .text .globl sp_256_mont_rsb_sub_dbl_4 +WC_ASM_ATT_HIDDEN(sp_256_mont_rsb_sub_dbl_4) .type sp_256_mont_rsb_sub_dbl_4,@function .align 16 sp_256_mont_rsb_sub_dbl_4: #else .section __TEXT,__text .globl _sp_256_mont_rsb_sub_dbl_4 +WC_ASM_ATT_HIDDEN(_sp_256_mont_rsb_sub_dbl_4) .p2align 4 _sp_256_mont_rsb_sub_dbl_4: #endif /* __APPLE__ */ @@ -45178,17 +45424,19 @@ _sp_256_mont_rsb_sub_dbl_4: #ifndef __APPLE__ .text .globl sp_256_get_point_33_4 +WC_ASM_ATT_HIDDEN(sp_256_get_point_33_4) .type sp_256_get_point_33_4,@function .align 16 sp_256_get_point_33_4: #else .section __TEXT,__text .globl _sp_256_get_point_33_4 +WC_ASM_ATT_HIDDEN(_sp_256_get_point_33_4) .p2align 4 _sp_256_get_point_33_4: #endif /* __APPLE__ */ movq $0x01, %rax - movd %edx, %xmm13 + vmovd %edx, %xmm13 addq $0xc8, %rsi movd %eax, %xmm15 movq $32, %rax @@ -45247,19 +45495,21 @@ L_256_get_point_33_4_start_1: #ifndef __APPLE__ .text .globl sp_256_get_point_33_avx2_4 +WC_ASM_ATT_HIDDEN(sp_256_get_point_33_avx2_4) .type sp_256_get_point_33_avx2_4,@function .align 16 sp_256_get_point_33_avx2_4: #else .section __TEXT,__text .globl _sp_256_get_point_33_avx2_4 +WC_ASM_ATT_HIDDEN(_sp_256_get_point_33_avx2_4) .p2align 4 _sp_256_get_point_33_avx2_4: #endif /* __APPLE__ */ movq $0x01, %rax - movd %edx, %xmm7 + vmovd %edx, %xmm7 addq $0xc8, %rsi - movd %eax, %xmm9 + vmovd %eax, %xmm9 movq $32, %rax vpxor %ymm8, %ymm8, %ymm8 vpermd %ymm7, %ymm8, %ymm7 @@ -45305,12 +45555,14 @@ L_256_get_point_33_avx2_4_start: #ifndef __APPLE__ .text .globl sp_256_mont_mul_avx2_4 +WC_ASM_ATT_HIDDEN(sp_256_mont_mul_avx2_4) .type sp_256_mont_mul_avx2_4,@function .align 16 sp_256_mont_mul_avx2_4: #else .section __TEXT,__text .globl _sp_256_mont_mul_avx2_4 +WC_ASM_ATT_HIDDEN(_sp_256_mont_mul_avx2_4) .p2align 4 _sp_256_mont_mul_avx2_4: #endif /* __APPLE__ */ @@ -45486,12 +45738,14 @@ _sp_256_mont_mul_avx2_4: #ifndef __APPLE__ .text .globl sp_256_mont_sqr_avx2_4 +WC_ASM_ATT_HIDDEN(sp_256_mont_sqr_avx2_4) .type sp_256_mont_sqr_avx2_4,@function .align 16 sp_256_mont_sqr_avx2_4: #else .section __TEXT,__text .globl _sp_256_mont_sqr_avx2_4 +WC_ASM_ATT_HIDDEN(_sp_256_mont_sqr_avx2_4) .p2align 4 _sp_256_mont_sqr_avx2_4: #endif /* __APPLE__ */ @@ -45651,12 +45905,14 @@ _sp_256_mont_sqr_avx2_4: #ifndef __APPLE__ .text .globl sp_256_cond_sub_avx2_4 +WC_ASM_ATT_HIDDEN(sp_256_cond_sub_avx2_4) .type sp_256_cond_sub_avx2_4,@function .align 16 sp_256_cond_sub_avx2_4: #else .section __TEXT,__text .globl _sp_256_cond_sub_avx2_4 +WC_ASM_ATT_HIDDEN(_sp_256_cond_sub_avx2_4) .p2align 4 _sp_256_cond_sub_avx2_4: #endif /* __APPLE__ */ @@ -45705,12 +45961,14 @@ _sp_256_cond_sub_avx2_4: #ifndef __APPLE__ .text .globl sp_256_mont_reduce_order_avx2_4 +WC_ASM_ATT_HIDDEN(sp_256_mont_reduce_order_avx2_4) .type sp_256_mont_reduce_order_avx2_4,@function .align 16 sp_256_mont_reduce_order_avx2_4: #else .section __TEXT,__text .globl _sp_256_mont_reduce_order_avx2_4 +WC_ASM_ATT_HIDDEN(_sp_256_mont_reduce_order_avx2_4) .p2align 4 _sp_256_mont_reduce_order_avx2_4: #endif /* __APPLE__ */ @@ -45869,12 +46127,14 @@ _sp_256_mont_reduce_order_avx2_4: #ifndef __APPLE__ .text .globl sp_256_mont_div2_avx2_4 +WC_ASM_ATT_HIDDEN(sp_256_mont_div2_avx2_4) .type sp_256_mont_div2_avx2_4,@function .align 16 sp_256_mont_div2_avx2_4: #else .section __TEXT,__text .globl _sp_256_mont_div2_avx2_4 +WC_ASM_ATT_HIDDEN(_sp_256_mont_div2_avx2_4) .p2align 4 _sp_256_mont_div2_avx2_4: #endif /* __APPLE__ */ @@ -45917,12 +46177,14 @@ _sp_256_mont_div2_avx2_4: #ifndef __APPLE__ .text .globl sp_256_get_entry_64_4 +WC_ASM_ATT_HIDDEN(sp_256_get_entry_64_4) .type sp_256_get_entry_64_4,@function .align 16 sp_256_get_entry_64_4: #else .section __TEXT,__text .globl _sp_256_get_entry_64_4 +WC_ASM_ATT_HIDDEN(_sp_256_get_entry_64_4) .p2align 4 _sp_256_get_entry_64_4: #endif /* __APPLE__ */ @@ -45977,19 +46239,21 @@ L_256_get_entry_64_4_start_0: #ifndef __APPLE__ .text .globl sp_256_get_entry_64_avx2_4 +WC_ASM_ATT_HIDDEN(sp_256_get_entry_64_avx2_4) .type sp_256_get_entry_64_avx2_4,@function .align 16 sp_256_get_entry_64_avx2_4: #else .section __TEXT,__text .globl _sp_256_get_entry_64_avx2_4 +WC_ASM_ATT_HIDDEN(_sp_256_get_entry_64_avx2_4) .p2align 4 _sp_256_get_entry_64_avx2_4: #endif /* __APPLE__ */ movq $0x01, %rax - movd %edx, %xmm5 + vmovd %edx, %xmm5 addq $0x40, %rsi - movd %eax, %xmm7 + vmovd %eax, %xmm7 movq $0x40, %rax vpxor %ymm6, %ymm6, %ymm6 vpermd %ymm5, %ymm6, %ymm5 @@ -46027,12 +46291,14 @@ L_256_get_entry_64_avx2_4_start: #ifndef __APPLE__ .text .globl sp_256_get_entry_65_4 +WC_ASM_ATT_HIDDEN(sp_256_get_entry_65_4) .type sp_256_get_entry_65_4,@function .align 16 sp_256_get_entry_65_4: #else .section __TEXT,__text .globl _sp_256_get_entry_65_4 +WC_ASM_ATT_HIDDEN(_sp_256_get_entry_65_4) .p2align 4 _sp_256_get_entry_65_4: #endif /* __APPLE__ */ @@ -46087,19 +46353,21 @@ L_256_get_entry_65_4_start_0: #ifndef __APPLE__ .text .globl sp_256_get_entry_65_avx2_4 +WC_ASM_ATT_HIDDEN(sp_256_get_entry_65_avx2_4) .type sp_256_get_entry_65_avx2_4,@function .align 16 sp_256_get_entry_65_avx2_4: #else .section __TEXT,__text .globl _sp_256_get_entry_65_avx2_4 +WC_ASM_ATT_HIDDEN(_sp_256_get_entry_65_avx2_4) .p2align 4 _sp_256_get_entry_65_avx2_4: #endif /* __APPLE__ */ movq $0x01, %rax - movd %edx, %xmm5 + vmovd %edx, %xmm5 addq $0x40, %rsi - movd %eax, %xmm7 + vmovd %eax, %xmm7 movq $0x41, %rax vpxor %ymm6, %ymm6, %ymm6 vpermd %ymm5, %ymm6, %ymm5 @@ -46134,12 +46402,14 @@ L_256_get_entry_65_avx2_4_start: #ifndef __APPLE__ .text .globl sp_256_add_one_4 +WC_ASM_ATT_HIDDEN(sp_256_add_one_4) .type sp_256_add_one_4,@function .align 16 sp_256_add_one_4: #else .section __TEXT,__text .globl _sp_256_add_one_4 +WC_ASM_ATT_HIDDEN(_sp_256_add_one_4) .p2align 4 _sp_256_add_one_4: #endif /* __APPLE__ */ @@ -46162,12 +46432,14 @@ _sp_256_add_one_4: #ifndef __APPLE__ .text .globl sp_256_from_bin_bswap +WC_ASM_ATT_HIDDEN(sp_256_from_bin_bswap) .type sp_256_from_bin_bswap,@function .align 16 sp_256_from_bin_bswap: #else .section __TEXT,__text .globl _sp_256_from_bin_bswap +WC_ASM_ATT_HIDDEN(_sp_256_from_bin_bswap) .p2align 4 _sp_256_from_bin_bswap: #endif /* __APPLE__ */ @@ -46257,12 +46529,14 @@ L_256_from_bin_bswap_zero_end: #ifndef __APPLE__ .text .globl sp_256_from_bin_movbe +WC_ASM_ATT_HIDDEN(sp_256_from_bin_movbe) .type sp_256_from_bin_movbe,@function .align 16 sp_256_from_bin_movbe: #else .section __TEXT,__text .globl _sp_256_from_bin_movbe +WC_ASM_ATT_HIDDEN(_sp_256_from_bin_movbe) .p2align 4 _sp_256_from_bin_movbe: #endif /* __APPLE__ */ @@ -46341,12 +46615,14 @@ L_256_from_bin_movbe_zero_end: #ifndef __APPLE__ .text .globl sp_256_to_bin_bswap_4 +WC_ASM_ATT_HIDDEN(sp_256_to_bin_bswap_4) .type sp_256_to_bin_bswap_4,@function .align 16 sp_256_to_bin_bswap_4: #else .section __TEXT,__text .globl _sp_256_to_bin_bswap_4 +WC_ASM_ATT_HIDDEN(_sp_256_to_bin_bswap_4) .p2align 4 _sp_256_to_bin_bswap_4: #endif /* __APPLE__ */ @@ -46377,12 +46653,14 @@ _sp_256_to_bin_bswap_4: #ifndef __APPLE__ .text .globl sp_256_to_bin_movbe_4 +WC_ASM_ATT_HIDDEN(sp_256_to_bin_movbe_4) .type sp_256_to_bin_movbe_4,@function .align 16 sp_256_to_bin_movbe_4: #else .section __TEXT,__text .globl _sp_256_to_bin_movbe_4 +WC_ASM_ATT_HIDDEN(_sp_256_to_bin_movbe_4) .p2align 4 _sp_256_to_bin_movbe_4: #endif /* __APPLE__ */ @@ -46407,12 +46685,14 @@ _sp_256_to_bin_movbe_4: #ifndef __APPLE__ .text .globl sp_256_sub_in_place_4 +WC_ASM_ATT_HIDDEN(sp_256_sub_in_place_4) .type sp_256_sub_in_place_4,@function .align 16 sp_256_sub_in_place_4: #else .section __TEXT,__text .globl _sp_256_sub_in_place_4 +WC_ASM_ATT_HIDDEN(_sp_256_sub_in_place_4) .p2align 4 _sp_256_sub_in_place_4: #endif /* __APPLE__ */ @@ -46438,12 +46718,14 @@ _sp_256_sub_in_place_4: #ifndef __APPLE__ .text .globl sp_256_mul_d_4 +WC_ASM_ATT_HIDDEN(sp_256_mul_d_4) .type sp_256_mul_d_4,@function .align 16 sp_256_mul_d_4: #else .section __TEXT,__text .globl _sp_256_mul_d_4 +WC_ASM_ATT_HIDDEN(_sp_256_mul_d_4) .p2align 4 _sp_256_mul_d_4: #endif /* __APPLE__ */ @@ -46492,12 +46774,14 @@ _sp_256_mul_d_4: #ifndef __APPLE__ .text .globl sp_256_mul_d_avx2_4 +WC_ASM_ATT_HIDDEN(sp_256_mul_d_avx2_4) .type sp_256_mul_d_avx2_4,@function .align 16 sp_256_mul_d_avx2_4: #else .section __TEXT,__text .globl _sp_256_mul_d_avx2_4 +WC_ASM_ATT_HIDDEN(_sp_256_mul_d_avx2_4) .p2align 4 _sp_256_mul_d_avx2_4: #endif /* __APPLE__ */ @@ -46544,12 +46828,14 @@ _sp_256_mul_d_avx2_4: #ifndef __APPLE__ .text .globl div_256_word_asm_4 +WC_ASM_ATT_HIDDEN(div_256_word_asm_4) .type div_256_word_asm_4,@function .align 16 div_256_word_asm_4: #else .section __TEXT,__text .globl _div_256_word_asm_4 +WC_ASM_ATT_HIDDEN(_div_256_word_asm_4) .p2align 4 _div_256_word_asm_4: #endif /* __APPLE__ */ @@ -46573,12 +46859,14 @@ _div_256_word_asm_4: #ifndef __APPLE__ .text .globl sp_256_mont_mul_order_avx2_4 +WC_ASM_ATT_HIDDEN(sp_256_mont_mul_order_avx2_4) .type sp_256_mont_mul_order_avx2_4,@function .align 16 sp_256_mont_mul_order_avx2_4: #else .section __TEXT,__text .globl _sp_256_mont_mul_order_avx2_4 +WC_ASM_ATT_HIDDEN(_sp_256_mont_mul_order_avx2_4) .p2align 4 _sp_256_mont_mul_order_avx2_4: #endif /* __APPLE__ */ @@ -46798,12 +47086,14 @@ _sp_256_mont_mul_order_avx2_4: #ifndef __APPLE__ .text .globl sp_256_mont_sqr_order_avx2_4 +WC_ASM_ATT_HIDDEN(sp_256_mont_sqr_order_avx2_4) .type sp_256_mont_sqr_order_avx2_4,@function .align 16 sp_256_mont_sqr_order_avx2_4: #else .section __TEXT,__text .globl _sp_256_mont_sqr_order_avx2_4 +WC_ASM_ATT_HIDDEN(_sp_256_mont_sqr_order_avx2_4) .p2align 4 _sp_256_mont_sqr_order_avx2_4: #endif /* __APPLE__ */ @@ -47009,12 +47299,14 @@ _sp_256_mont_sqr_order_avx2_4: #ifndef __APPLE__ .text .globl sp_256_mod_inv_4 +WC_ASM_ATT_HIDDEN(sp_256_mod_inv_4) .type sp_256_mod_inv_4,@function .align 16 sp_256_mod_inv_4: #else .section __TEXT,__text .globl _sp_256_mod_inv_4 +WC_ASM_ATT_HIDDEN(_sp_256_mod_inv_4) .p2align 4 _sp_256_mod_inv_4: #endif /* __APPLE__ */ @@ -47344,12 +47636,14 @@ L_sp256_mod_inv_avx2_4_mask26: #ifndef __APPLE__ .text .globl sp_256_mod_inv_avx2_4 +WC_ASM_ATT_HIDDEN(sp_256_mod_inv_avx2_4) .type sp_256_mod_inv_avx2_4,@function .align 16 sp_256_mod_inv_avx2_4: #else .section __TEXT,__text .globl _sp_256_mod_inv_avx2_4 +WC_ASM_ATT_HIDDEN(_sp_256_mod_inv_avx2_4) .p2align 4 _sp_256_mod_inv_avx2_4: #endif /* __APPLE__ */ @@ -47653,12 +47947,14 @@ L_256_mod_inv_avx2_4_no_add_order: #ifndef __APPLE__ .text .globl sp_384_mul_6 +WC_ASM_ATT_HIDDEN(sp_384_mul_6) .type sp_384_mul_6,@function .align 16 sp_384_mul_6: #else .section __TEXT,__text .globl _sp_384_mul_6 +WC_ASM_ATT_HIDDEN(_sp_384_mul_6) .p2align 4 _sp_384_mul_6: #endif /* __APPLE__ */ @@ -47926,12 +48222,14 @@ _sp_384_mul_6: #ifndef __APPLE__ .text .globl sp_384_mul_avx2_6 +WC_ASM_ATT_HIDDEN(sp_384_mul_avx2_6) .type sp_384_mul_avx2_6,@function .align 16 sp_384_mul_avx2_6: #else .section __TEXT,__text .globl _sp_384_mul_avx2_6 +WC_ASM_ATT_HIDDEN(_sp_384_mul_avx2_6) .p2align 4 _sp_384_mul_avx2_6: #endif /* __APPLE__ */ @@ -48148,12 +48446,14 @@ _sp_384_mul_avx2_6: #ifndef __APPLE__ .text .globl sp_384_sqr_6 +WC_ASM_ATT_HIDDEN(sp_384_sqr_6) .type sp_384_sqr_6,@function .align 16 sp_384_sqr_6: #else .section __TEXT,__text .globl _sp_384_sqr_6 +WC_ASM_ATT_HIDDEN(_sp_384_sqr_6) .p2align 4 _sp_384_sqr_6: #endif /* __APPLE__ */ @@ -48373,12 +48673,14 @@ _sp_384_sqr_6: #ifndef __APPLE__ .text .globl sp_384_sqr_avx2_6 +WC_ASM_ATT_HIDDEN(sp_384_sqr_avx2_6) .type sp_384_sqr_avx2_6,@function .align 16 sp_384_sqr_avx2_6: #else .section __TEXT,__text .globl _sp_384_sqr_avx2_6 +WC_ASM_ATT_HIDDEN(_sp_384_sqr_avx2_6) .p2align 4 _sp_384_sqr_avx2_6: #endif /* __APPLE__ */ @@ -48537,12 +48839,14 @@ _sp_384_sqr_avx2_6: #ifndef __APPLE__ .text .globl sp_384_add_6 +WC_ASM_ATT_HIDDEN(sp_384_add_6) .type sp_384_add_6,@function .align 16 sp_384_add_6: #else .section __TEXT,__text .globl _sp_384_add_6 +WC_ASM_ATT_HIDDEN(_sp_384_add_6) .p2align 4 _sp_384_add_6: #endif /* __APPLE__ */ @@ -48581,12 +48885,14 @@ _sp_384_add_6: #ifndef __APPLE__ .text .globl sp_384_sub_6 +WC_ASM_ATT_HIDDEN(sp_384_sub_6) .type sp_384_sub_6,@function .align 16 sp_384_sub_6: #else .section __TEXT,__text .globl _sp_384_sub_6 +WC_ASM_ATT_HIDDEN(_sp_384_sub_6) .p2align 4 _sp_384_sub_6: #endif /* __APPLE__ */ @@ -48626,12 +48932,14 @@ _sp_384_sub_6: #ifndef __APPLE__ .text .globl sp_384_cond_copy_6 +WC_ASM_ATT_HIDDEN(sp_384_cond_copy_6) .type sp_384_cond_copy_6,@function .align 16 sp_384_cond_copy_6: #else .section __TEXT,__text .globl _sp_384_cond_copy_6 +WC_ASM_ATT_HIDDEN(_sp_384_cond_copy_6) .p2align 4 _sp_384_cond_copy_6: #endif /* __APPLE__ */ @@ -48675,12 +48983,14 @@ _sp_384_cond_copy_6: #ifndef __APPLE__ .text .globl sp_384_cond_sub_6 +WC_ASM_ATT_HIDDEN(sp_384_cond_sub_6) .type sp_384_cond_sub_6,@function .align 16 sp_384_cond_sub_6: #else .section __TEXT,__text .globl _sp_384_cond_sub_6 +WC_ASM_ATT_HIDDEN(_sp_384_cond_sub_6) .p2align 4 _sp_384_cond_sub_6: #endif /* __APPLE__ */ @@ -48743,12 +49053,14 @@ _sp_384_cond_sub_6: #ifndef __APPLE__ .text .globl sp_384_mont_reduce_6 +WC_ASM_ATT_HIDDEN(sp_384_mont_reduce_6) .type sp_384_mont_reduce_6,@function .align 16 sp_384_mont_reduce_6: #else .section __TEXT,__text .globl _sp_384_mont_reduce_6 +WC_ASM_ATT_HIDDEN(_sp_384_mont_reduce_6) .p2align 4 _sp_384_mont_reduce_6: #endif /* __APPLE__ */ @@ -48923,12 +49235,14 @@ _sp_384_mont_reduce_6: #ifndef __APPLE__ .text .globl sp_384_mont_reduce_order_6 +WC_ASM_ATT_HIDDEN(sp_384_mont_reduce_order_6) .type sp_384_mont_reduce_order_6,@function .align 16 sp_384_mont_reduce_order_6: #else .section __TEXT,__text .globl _sp_384_mont_reduce_order_6 +WC_ASM_ATT_HIDDEN(_sp_384_mont_reduce_order_6) .p2align 4 _sp_384_mont_reduce_order_6: #endif /* __APPLE__ */ @@ -49044,12 +49358,14 @@ L_384_mont_reduce_order_6_loop: #ifndef __APPLE__ .text .globl sp_384_cmp_6 +WC_ASM_ATT_HIDDEN(sp_384_cmp_6) .type sp_384_cmp_6,@function .align 16 sp_384_cmp_6: #else .section __TEXT,__text .globl _sp_384_cmp_6 +WC_ASM_ATT_HIDDEN(_sp_384_cmp_6) .p2align 4 _sp_384_cmp_6: #endif /* __APPLE__ */ @@ -49120,12 +49436,14 @@ _sp_384_cmp_6: #ifndef __APPLE__ .text .globl sp_384_mont_add_6 +WC_ASM_ATT_HIDDEN(sp_384_mont_add_6) .type sp_384_mont_add_6,@function .align 16 sp_384_mont_add_6: #else .section __TEXT,__text .globl _sp_384_mont_add_6 +WC_ASM_ATT_HIDDEN(_sp_384_mont_add_6) .p2align 4 _sp_384_mont_add_6: #endif /* __APPLE__ */ @@ -49188,12 +49506,14 @@ _sp_384_mont_add_6: #ifndef __APPLE__ .text .globl sp_384_mont_dbl_6 +WC_ASM_ATT_HIDDEN(sp_384_mont_dbl_6) .type sp_384_mont_dbl_6,@function .align 16 sp_384_mont_dbl_6: #else .section __TEXT,__text .globl _sp_384_mont_dbl_6 +WC_ASM_ATT_HIDDEN(_sp_384_mont_dbl_6) .p2align 4 _sp_384_mont_dbl_6: #endif /* __APPLE__ */ @@ -49257,12 +49577,14 @@ _sp_384_mont_dbl_6: #ifndef __APPLE__ .text .globl sp_384_mont_tpl_6 +WC_ASM_ATT_HIDDEN(sp_384_mont_tpl_6) .type sp_384_mont_tpl_6,@function .align 16 sp_384_mont_tpl_6: #else .section __TEXT,__text .globl _sp_384_mont_tpl_6 +WC_ASM_ATT_HIDDEN(_sp_384_mont_tpl_6) .p2align 4 _sp_384_mont_tpl_6: #endif /* __APPLE__ */ @@ -49355,12 +49677,14 @@ _sp_384_mont_tpl_6: #ifndef __APPLE__ .text .globl sp_384_mont_sub_6 +WC_ASM_ATT_HIDDEN(sp_384_mont_sub_6) .type sp_384_mont_sub_6,@function .align 16 sp_384_mont_sub_6: #else .section __TEXT,__text .globl _sp_384_mont_sub_6 +WC_ASM_ATT_HIDDEN(_sp_384_mont_sub_6) .p2align 4 _sp_384_mont_sub_6: #endif /* __APPLE__ */ @@ -49423,12 +49747,14 @@ _sp_384_mont_sub_6: #ifndef __APPLE__ .text .globl sp_384_mont_div2_6 +WC_ASM_ATT_HIDDEN(sp_384_mont_div2_6) .type sp_384_mont_div2_6,@function .align 16 sp_384_mont_div2_6: #else .section __TEXT,__text .globl _sp_384_mont_div2_6 +WC_ASM_ATT_HIDDEN(_sp_384_mont_div2_6) .p2align 4 _sp_384_mont_div2_6: #endif /* __APPLE__ */ @@ -49501,17 +49827,19 @@ _sp_384_mont_div2_6: #ifndef __APPLE__ .text .globl sp_384_get_point_33_6 +WC_ASM_ATT_HIDDEN(sp_384_get_point_33_6) .type sp_384_get_point_33_6,@function .align 16 sp_384_get_point_33_6: #else .section __TEXT,__text .globl _sp_384_get_point_33_6 +WC_ASM_ATT_HIDDEN(_sp_384_get_point_33_6) .p2align 4 _sp_384_get_point_33_6: #endif /* __APPLE__ */ movq $0x01, %rax - movd %edx, %xmm13 + vmovd %edx, %xmm13 addq $0x128, %rsi movd %eax, %xmm15 movq $32, %rax @@ -49557,7 +49885,7 @@ L_384_get_point_33_6_start_1: movdqu %xmm4, 112(%rdi) movdqu %xmm5, 128(%rdi) movq $0x01, %rax - movd %edx, %xmm13 + vmovd %edx, %xmm13 subq $0x2500, %rsi movd %eax, %xmm15 movq $32, %rax @@ -49601,19 +49929,21 @@ L_384_get_point_33_6_start_2: #ifndef __APPLE__ .text .globl sp_384_get_point_33_avx2_6 +WC_ASM_ATT_HIDDEN(sp_384_get_point_33_avx2_6) .type sp_384_get_point_33_avx2_6,@function .align 16 sp_384_get_point_33_avx2_6: #else .section __TEXT,__text .globl _sp_384_get_point_33_avx2_6 +WC_ASM_ATT_HIDDEN(_sp_384_get_point_33_avx2_6) .p2align 4 _sp_384_get_point_33_avx2_6: #endif /* __APPLE__ */ movq $0x01, %rax - movd %edx, %xmm13 + vmovd %edx, %xmm13 addq $0x128, %rsi - movd %eax, %xmm15 + vmovd %eax, %xmm15 movq $32, %rax vpxor %ymm14, %ymm14, %ymm14 vpermd %ymm13, %ymm14, %ymm13 @@ -49672,12 +50002,14 @@ L_384_get_point_33_avx2_6_start: #ifndef __APPLE__ .text .globl sp_384_mont_reduce_order_avx2_6 +WC_ASM_ATT_HIDDEN(sp_384_mont_reduce_order_avx2_6) .type sp_384_mont_reduce_order_avx2_6,@function .align 16 sp_384_mont_reduce_order_avx2_6: #else .section __TEXT,__text .globl _sp_384_mont_reduce_order_avx2_6 +WC_ASM_ATT_HIDDEN(_sp_384_mont_reduce_order_avx2_6) .p2align 4 _sp_384_mont_reduce_order_avx2_6: #endif /* __APPLE__ */ @@ -50005,12 +50337,14 @@ L_mont_loop_order_avx2_6: #ifndef __APPLE__ .text .globl sp_384_cond_sub_avx2_6 +WC_ASM_ATT_HIDDEN(sp_384_cond_sub_avx2_6) .type sp_384_cond_sub_avx2_6,@function .align 16 sp_384_cond_sub_avx2_6: #else .section __TEXT,__text .globl _sp_384_cond_sub_avx2_6 +WC_ASM_ATT_HIDDEN(_sp_384_cond_sub_avx2_6) .p2align 4 _sp_384_cond_sub_avx2_6: #endif /* __APPLE__ */ @@ -50060,12 +50394,14 @@ _sp_384_cond_sub_avx2_6: #ifndef __APPLE__ .text .globl sp_384_mont_div2_avx2_6 +WC_ASM_ATT_HIDDEN(sp_384_mont_div2_avx2_6) .type sp_384_mont_div2_avx2_6,@function .align 16 sp_384_mont_div2_avx2_6: #else .section __TEXT,__text .globl _sp_384_mont_div2_avx2_6 +WC_ASM_ATT_HIDDEN(_sp_384_mont_div2_avx2_6) .p2align 4 _sp_384_mont_div2_avx2_6: #endif /* __APPLE__ */ @@ -50138,12 +50474,14 @@ _sp_384_mont_div2_avx2_6: #ifndef __APPLE__ .text .globl sp_384_get_entry_64_6 +WC_ASM_ATT_HIDDEN(sp_384_get_entry_64_6) .type sp_384_get_entry_64_6,@function .align 16 sp_384_get_entry_64_6: #else .section __TEXT,__text .globl _sp_384_get_entry_64_6 +WC_ASM_ATT_HIDDEN(_sp_384_get_entry_64_6) .p2align 4 _sp_384_get_entry_64_6: #endif /* __APPLE__ */ @@ -50208,19 +50546,21 @@ L_384_get_entry_64_6_start_0: #ifndef __APPLE__ .text .globl sp_384_get_entry_64_avx2_6 +WC_ASM_ATT_HIDDEN(sp_384_get_entry_64_avx2_6) .type sp_384_get_entry_64_avx2_6,@function .align 16 sp_384_get_entry_64_avx2_6: #else .section __TEXT,__text .globl _sp_384_get_entry_64_avx2_6 +WC_ASM_ATT_HIDDEN(_sp_384_get_entry_64_avx2_6) .p2align 4 _sp_384_get_entry_64_avx2_6: #endif /* __APPLE__ */ movq $0x01, %rax - movd %edx, %xmm9 + vmovd %edx, %xmm9 addq $0x60, %rsi - movd %eax, %xmm11 + vmovd %eax, %xmm11 movq $0x40, %rax vpxor %ymm10, %ymm10, %ymm10 vpermd %ymm9, %ymm10, %ymm9 @@ -50268,12 +50608,14 @@ L_384_get_entry_64_avx2_6_start: #ifndef __APPLE__ .text .globl sp_384_get_entry_65_6 +WC_ASM_ATT_HIDDEN(sp_384_get_entry_65_6) .type sp_384_get_entry_65_6,@function .align 16 sp_384_get_entry_65_6: #else .section __TEXT,__text .globl _sp_384_get_entry_65_6 +WC_ASM_ATT_HIDDEN(_sp_384_get_entry_65_6) .p2align 4 _sp_384_get_entry_65_6: #endif /* __APPLE__ */ @@ -50338,19 +50680,21 @@ L_384_get_entry_65_6_start_0: #ifndef __APPLE__ .text .globl sp_384_get_entry_65_avx2_6 +WC_ASM_ATT_HIDDEN(sp_384_get_entry_65_avx2_6) .type sp_384_get_entry_65_avx2_6,@function .align 16 sp_384_get_entry_65_avx2_6: #else .section __TEXT,__text .globl _sp_384_get_entry_65_avx2_6 +WC_ASM_ATT_HIDDEN(_sp_384_get_entry_65_avx2_6) .p2align 4 _sp_384_get_entry_65_avx2_6: #endif /* __APPLE__ */ movq $0x01, %rax - movd %edx, %xmm9 + vmovd %edx, %xmm9 addq $0x60, %rsi - movd %eax, %xmm11 + vmovd %eax, %xmm11 movq $0x41, %rax vpxor %ymm10, %ymm10, %ymm10 vpermd %ymm9, %ymm10, %ymm9 @@ -50395,12 +50739,14 @@ L_384_get_entry_65_avx2_6_start: #ifndef __APPLE__ .text .globl sp_384_add_one_6 +WC_ASM_ATT_HIDDEN(sp_384_add_one_6) .type sp_384_add_one_6,@function .align 16 sp_384_add_one_6: #else .section __TEXT,__text .globl _sp_384_add_one_6 +WC_ASM_ATT_HIDDEN(_sp_384_add_one_6) .p2align 4 _sp_384_add_one_6: #endif /* __APPLE__ */ @@ -50425,12 +50771,14 @@ _sp_384_add_one_6: #ifndef __APPLE__ .text .globl sp_384_from_bin_bswap +WC_ASM_ATT_HIDDEN(sp_384_from_bin_bswap) .type sp_384_from_bin_bswap,@function .align 16 sp_384_from_bin_bswap: #else .section __TEXT,__text .globl _sp_384_from_bin_bswap +WC_ASM_ATT_HIDDEN(_sp_384_from_bin_bswap) .p2align 4 _sp_384_from_bin_bswap: #endif /* __APPLE__ */ @@ -50520,12 +50868,14 @@ L_384_from_bin_bswap_zero_end: #ifndef __APPLE__ .text .globl sp_384_from_bin_movbe +WC_ASM_ATT_HIDDEN(sp_384_from_bin_movbe) .type sp_384_from_bin_movbe,@function .align 16 sp_384_from_bin_movbe: #else .section __TEXT,__text .globl _sp_384_from_bin_movbe +WC_ASM_ATT_HIDDEN(_sp_384_from_bin_movbe) .p2align 4 _sp_384_from_bin_movbe: #endif /* __APPLE__ */ @@ -50604,12 +50954,14 @@ L_384_from_bin_movbe_zero_end: #ifndef __APPLE__ .text .globl sp_384_to_bin_bswap_6 +WC_ASM_ATT_HIDDEN(sp_384_to_bin_bswap_6) .type sp_384_to_bin_bswap_6,@function .align 16 sp_384_to_bin_bswap_6: #else .section __TEXT,__text .globl _sp_384_to_bin_bswap_6 +WC_ASM_ATT_HIDDEN(_sp_384_to_bin_bswap_6) .p2align 4 _sp_384_to_bin_bswap_6: #endif /* __APPLE__ */ @@ -50646,12 +50998,14 @@ _sp_384_to_bin_bswap_6: #ifndef __APPLE__ .text .globl sp_384_to_bin_movbe_6 +WC_ASM_ATT_HIDDEN(sp_384_to_bin_movbe_6) .type sp_384_to_bin_movbe_6,@function .align 16 sp_384_to_bin_movbe_6: #else .section __TEXT,__text .globl _sp_384_to_bin_movbe_6 +WC_ASM_ATT_HIDDEN(_sp_384_to_bin_movbe_6) .p2align 4 _sp_384_to_bin_movbe_6: #endif /* __APPLE__ */ @@ -50680,12 +51034,14 @@ _sp_384_to_bin_movbe_6: #ifndef __APPLE__ .text .globl sp_384_sub_in_place_6 +WC_ASM_ATT_HIDDEN(sp_384_sub_in_place_6) .type sp_384_sub_in_place_6,@function .align 16 sp_384_sub_in_place_6: #else .section __TEXT,__text .globl _sp_384_sub_in_place_6 +WC_ASM_ATT_HIDDEN(_sp_384_sub_in_place_6) .p2align 4 _sp_384_sub_in_place_6: #endif /* __APPLE__ */ @@ -50715,12 +51071,14 @@ _sp_384_sub_in_place_6: #ifndef __APPLE__ .text .globl sp_384_mul_d_6 +WC_ASM_ATT_HIDDEN(sp_384_mul_d_6) .type sp_384_mul_d_6,@function .align 16 sp_384_mul_d_6: #else .section __TEXT,__text .globl _sp_384_mul_d_6 +WC_ASM_ATT_HIDDEN(_sp_384_mul_d_6) .p2align 4 _sp_384_mul_d_6: #endif /* __APPLE__ */ @@ -50785,12 +51143,14 @@ _sp_384_mul_d_6: #ifndef __APPLE__ .text .globl sp_384_mul_d_avx2_6 +WC_ASM_ATT_HIDDEN(sp_384_mul_d_avx2_6) .type sp_384_mul_d_avx2_6,@function .align 16 sp_384_mul_d_avx2_6: #else .section __TEXT,__text .globl _sp_384_mul_d_avx2_6 +WC_ASM_ATT_HIDDEN(_sp_384_mul_d_avx2_6) .p2align 4 _sp_384_mul_d_avx2_6: #endif /* __APPLE__ */ @@ -50849,12 +51209,14 @@ _sp_384_mul_d_avx2_6: #ifndef __APPLE__ .text .globl div_384_word_asm_6 +WC_ASM_ATT_HIDDEN(div_384_word_asm_6) .type div_384_word_asm_6,@function .align 16 div_384_word_asm_6: #else .section __TEXT,__text .globl _div_384_word_asm_6 +WC_ASM_ATT_HIDDEN(_div_384_word_asm_6) .p2align 4 _div_384_word_asm_6: #endif /* __APPLE__ */ @@ -50875,12 +51237,14 @@ _div_384_word_asm_6: #ifndef __APPLE__ .text .globl sp_384_rshift1_6 +WC_ASM_ATT_HIDDEN(sp_384_rshift1_6) .type sp_384_rshift1_6,@function .align 16 sp_384_rshift1_6: #else .section __TEXT,__text .globl _sp_384_rshift1_6 +WC_ASM_ATT_HIDDEN(_sp_384_rshift1_6) .p2align 4 _sp_384_rshift1_6: #endif /* __APPLE__ */ @@ -50915,12 +51279,14 @@ _sp_384_rshift1_6: #ifndef __APPLE__ .text .globl sp_384_div2_mod_6 +WC_ASM_ATT_HIDDEN(sp_384_div2_mod_6) .type sp_384_div2_mod_6,@function .align 16 sp_384_div2_mod_6: #else .section __TEXT,__text .globl _sp_384_div2_mod_6 +WC_ASM_ATT_HIDDEN(_sp_384_div2_mod_6) .p2align 4 _sp_384_div2_mod_6: #endif /* __APPLE__ */ @@ -50979,12 +51345,14 @@ L_384_mod_inv_6_div2_mod_no_add: #ifndef __APPLE__ .text .globl sp_384_num_bits_6 +WC_ASM_ATT_HIDDEN(sp_384_num_bits_6) .type sp_384_num_bits_6,@function .align 16 sp_384_num_bits_6: #else .section __TEXT,__text .globl _sp_384_num_bits_6 +WC_ASM_ATT_HIDDEN(_sp_384_num_bits_6) .p2align 4 _sp_384_num_bits_6: #endif /* __APPLE__ */ @@ -51053,12 +51421,14 @@ L_384_num_bits_6_done: #ifndef __APPLE__ .text .globl sp_521_mul_9 +WC_ASM_ATT_HIDDEN(sp_521_mul_9) .type sp_521_mul_9,@function .align 16 sp_521_mul_9: #else .section __TEXT,__text .globl _sp_521_mul_9 +WC_ASM_ATT_HIDDEN(_sp_521_mul_9) .p2align 4 _sp_521_mul_9: #endif /* __APPLE__ */ @@ -51614,12 +51984,14 @@ _sp_521_mul_9: #ifndef __APPLE__ .text .globl sp_521_mul_avx2_9 +WC_ASM_ATT_HIDDEN(sp_521_mul_avx2_9) .type sp_521_mul_avx2_9,@function .align 16 sp_521_mul_avx2_9: #else .section __TEXT,__text .globl _sp_521_mul_avx2_9 +WC_ASM_ATT_HIDDEN(_sp_521_mul_avx2_9) .p2align 4 _sp_521_mul_avx2_9: #endif /* __APPLE__ */ @@ -52196,12 +52568,14 @@ L_end_521_mul_avx2_9: #ifndef __APPLE__ .text .globl sp_521_sqr_9 +WC_ASM_ATT_HIDDEN(sp_521_sqr_9) .type sp_521_sqr_9,@function .align 16 sp_521_sqr_9: #else .section __TEXT,__text .globl _sp_521_sqr_9 +WC_ASM_ATT_HIDDEN(_sp_521_sqr_9) .p2align 4 _sp_521_sqr_9: #endif /* __APPLE__ */ @@ -52619,12 +52993,14 @@ _sp_521_sqr_9: #ifndef __APPLE__ .text .globl sp_521_sqr_avx2_9 +WC_ASM_ATT_HIDDEN(sp_521_sqr_avx2_9) .type sp_521_sqr_avx2_9,@function .align 16 sp_521_sqr_avx2_9: #else .section __TEXT,__text .globl _sp_521_sqr_avx2_9 +WC_ASM_ATT_HIDDEN(_sp_521_sqr_avx2_9) .p2align 4 _sp_521_sqr_avx2_9: #endif /* __APPLE__ */ @@ -53023,12 +53399,14 @@ L_end_521_sqr_avx2_9: #ifndef __APPLE__ .text .globl sp_521_add_9 +WC_ASM_ATT_HIDDEN(sp_521_add_9) .type sp_521_add_9,@function .align 16 sp_521_add_9: #else .section __TEXT,__text .globl _sp_521_add_9 +WC_ASM_ATT_HIDDEN(_sp_521_add_9) .p2align 4 _sp_521_add_9: #endif /* __APPLE__ */ @@ -53075,12 +53453,14 @@ _sp_521_add_9: #ifndef __APPLE__ .text .globl sp_521_sub_9 +WC_ASM_ATT_HIDDEN(sp_521_sub_9) .type sp_521_sub_9,@function .align 16 sp_521_sub_9: #else .section __TEXT,__text .globl _sp_521_sub_9 +WC_ASM_ATT_HIDDEN(_sp_521_sub_9) .p2align 4 _sp_521_sub_9: #endif /* __APPLE__ */ @@ -53126,12 +53506,14 @@ _sp_521_sub_9: #ifndef __APPLE__ .text .globl sp_521_cond_copy_9 +WC_ASM_ATT_HIDDEN(sp_521_cond_copy_9) .type sp_521_cond_copy_9,@function .align 16 sp_521_cond_copy_9: #else .section __TEXT,__text .globl _sp_521_cond_copy_9 +WC_ASM_ATT_HIDDEN(_sp_521_cond_copy_9) .p2align 4 _sp_521_cond_copy_9: #endif /* __APPLE__ */ @@ -53187,12 +53569,14 @@ _sp_521_cond_copy_9: #ifndef __APPLE__ .text .globl sp_521_mont_mul_9 +WC_ASM_ATT_HIDDEN(sp_521_mont_mul_9) .type sp_521_mont_mul_9,@function .align 16 sp_521_mont_mul_9: #else .section __TEXT,__text .globl _sp_521_mont_mul_9 +WC_ASM_ATT_HIDDEN(_sp_521_mont_mul_9) .p2align 4 _sp_521_mont_mul_9: #endif /* __APPLE__ */ @@ -53784,12 +54168,14 @@ _sp_521_mont_mul_9: #ifndef __APPLE__ .text .globl sp_521_mont_sqr_9 +WC_ASM_ATT_HIDDEN(sp_521_mont_sqr_9) .type sp_521_mont_sqr_9,@function .align 16 sp_521_mont_sqr_9: #else .section __TEXT,__text .globl _sp_521_mont_sqr_9 +WC_ASM_ATT_HIDDEN(_sp_521_mont_sqr_9) .p2align 4 _sp_521_mont_sqr_9: #endif /* __APPLE__ */ @@ -54243,12 +54629,14 @@ _sp_521_mont_sqr_9: #ifndef __APPLE__ .text .globl sp_521_cmp_9 +WC_ASM_ATT_HIDDEN(sp_521_cmp_9) .type sp_521_cmp_9,@function .align 16 sp_521_cmp_9: #else .section __TEXT,__text .globl _sp_521_cmp_9 +WC_ASM_ATT_HIDDEN(_sp_521_cmp_9) .p2align 4 _sp_521_cmp_9: #endif /* __APPLE__ */ @@ -54345,12 +54733,14 @@ _sp_521_cmp_9: #ifndef __APPLE__ .text .globl sp_521_cond_sub_9 +WC_ASM_ATT_HIDDEN(sp_521_cond_sub_9) .type sp_521_cond_sub_9,@function .align 16 sp_521_cond_sub_9: #else .section __TEXT,__text .globl _sp_521_cond_sub_9 +WC_ASM_ATT_HIDDEN(_sp_521_cond_sub_9) .p2align 4 _sp_521_cond_sub_9: #endif /* __APPLE__ */ @@ -54434,12 +54824,14 @@ _sp_521_cond_sub_9: #ifndef __APPLE__ .text .globl sp_521_mont_reduce_9 +WC_ASM_ATT_HIDDEN(sp_521_mont_reduce_9) .type sp_521_mont_reduce_9,@function .align 16 sp_521_mont_reduce_9: #else .section __TEXT,__text .globl _sp_521_mont_reduce_9 +WC_ASM_ATT_HIDDEN(_sp_521_mont_reduce_9) .p2align 4 _sp_521_mont_reduce_9: #endif /* __APPLE__ */ @@ -54513,12 +54905,14 @@ _sp_521_mont_reduce_9: #ifndef __APPLE__ .text .globl sp_521_mont_reduce_order_9 +WC_ASM_ATT_HIDDEN(sp_521_mont_reduce_order_9) .type sp_521_mont_reduce_order_9,@function .align 16 sp_521_mont_reduce_order_9: #else .section __TEXT,__text .globl _sp_521_mont_reduce_order_9 +WC_ASM_ATT_HIDDEN(_sp_521_mont_reduce_order_9) .p2align 4 _sp_521_mont_reduce_order_9: #endif /* __APPLE__ */ @@ -54702,12 +55096,14 @@ L_521_mont_reduce_order_9_nomask: #ifndef __APPLE__ .text .globl sp_521_mont_add_9 +WC_ASM_ATT_HIDDEN(sp_521_mont_add_9) .type sp_521_mont_add_9,@function .align 16 sp_521_mont_add_9: #else .section __TEXT,__text .globl _sp_521_mont_add_9 +WC_ASM_ATT_HIDDEN(_sp_521_mont_add_9) .p2align 4 _sp_521_mont_add_9: #endif /* __APPLE__ */ @@ -54771,12 +55167,14 @@ _sp_521_mont_add_9: #ifndef __APPLE__ .text .globl sp_521_mont_dbl_9 +WC_ASM_ATT_HIDDEN(sp_521_mont_dbl_9) .type sp_521_mont_dbl_9,@function .align 16 sp_521_mont_dbl_9: #else .section __TEXT,__text .globl _sp_521_mont_dbl_9 +WC_ASM_ATT_HIDDEN(_sp_521_mont_dbl_9) .p2align 4 _sp_521_mont_dbl_9: #endif /* __APPLE__ */ @@ -54838,12 +55236,14 @@ _sp_521_mont_dbl_9: #ifndef __APPLE__ .text .globl sp_521_mont_tpl_9 +WC_ASM_ATT_HIDDEN(sp_521_mont_tpl_9) .type sp_521_mont_tpl_9,@function .align 16 sp_521_mont_tpl_9: #else .section __TEXT,__text .globl _sp_521_mont_tpl_9 +WC_ASM_ATT_HIDDEN(_sp_521_mont_tpl_9) .p2align 4 _sp_521_mont_tpl_9: #endif /* __APPLE__ */ @@ -54915,12 +55315,14 @@ _sp_521_mont_tpl_9: #ifndef __APPLE__ .text .globl sp_521_mont_sub_9 +WC_ASM_ATT_HIDDEN(sp_521_mont_sub_9) .type sp_521_mont_sub_9,@function .align 16 sp_521_mont_sub_9: #else .section __TEXT,__text .globl _sp_521_mont_sub_9 +WC_ASM_ATT_HIDDEN(_sp_521_mont_sub_9) .p2align 4 _sp_521_mont_sub_9: #endif /* __APPLE__ */ @@ -54985,12 +55387,14 @@ _sp_521_mont_sub_9: #ifndef __APPLE__ .text .globl sp_521_mont_div2_9 +WC_ASM_ATT_HIDDEN(sp_521_mont_div2_9) .type sp_521_mont_div2_9,@function .align 16 sp_521_mont_div2_9: #else .section __TEXT,__text .globl _sp_521_mont_div2_9 +WC_ASM_ATT_HIDDEN(_sp_521_mont_div2_9) .p2align 4 _sp_521_mont_div2_9: #endif /* __APPLE__ */ @@ -55054,19 +55458,21 @@ _sp_521_mont_div2_9: #ifndef __APPLE__ .text .globl sp_521_get_point_33_9 +WC_ASM_ATT_HIDDEN(sp_521_get_point_33_9) .type sp_521_get_point_33_9,@function .align 16 sp_521_get_point_33_9: #else .section __TEXT,__text .globl _sp_521_get_point_33_9 +WC_ASM_ATT_HIDDEN(_sp_521_get_point_33_9) .p2align 4 _sp_521_get_point_33_9: #endif /* __APPLE__ */ pushq %r12 movq $0x01, %r12 movq $0x01, %rax - movd %edx, %xmm13 + vmovd %edx, %xmm13 #ifndef SP_ALIGN_16 addq $0x1b8, %rsi #else @@ -55132,7 +55538,7 @@ L_521_get_point_33_9_start_1: movdqu %xmm5, 160(%rdi) movq $0x01, %r12 movq $0x01, %rax - movd %edx, %xmm13 + vmovd %edx, %xmm13 #ifndef SP_ALIGN_16 subq $0x3700, %rsi #else @@ -55215,12 +55621,14 @@ L_521_get_point_33_9_start_2: #ifndef __APPLE__ .text .globl sp_521_get_point_33_avx2_9 +WC_ASM_ATT_HIDDEN(sp_521_get_point_33_avx2_9) .type sp_521_get_point_33_avx2_9,@function .align 16 sp_521_get_point_33_avx2_9: #else .section __TEXT,__text .globl _sp_521_get_point_33_avx2_9 +WC_ASM_ATT_HIDDEN(_sp_521_get_point_33_avx2_9) .p2align 4 _sp_521_get_point_33_avx2_9: #endif /* __APPLE__ */ @@ -55229,13 +55637,13 @@ _sp_521_get_point_33_avx2_9: pushq %r14 movq $0x01, %r14 movq $0x01, %rax - movd %edx, %xmm13 + vmovd %edx, %xmm13 #ifndef SP_ALIGN_16 addq $0x1b8, %rsi #else addq $0x1c0, %rsi #endif /* !SP_ALIGN_16 */ - movd %eax, %xmm15 + vmovd %eax, %xmm15 movq $32, %rax vpxor %ymm14, %ymm14, %ymm14 vpermd %ymm13, %ymm14, %ymm13 @@ -55323,12 +55731,14 @@ L_521_get_point_33_avx2_9_start: #ifndef __APPLE__ .text .globl sp_521_mont_mul_avx2_9 +WC_ASM_ATT_HIDDEN(sp_521_mont_mul_avx2_9) .type sp_521_mont_mul_avx2_9,@function .align 16 sp_521_mont_mul_avx2_9: #else .section __TEXT,__text .globl _sp_521_mont_mul_avx2_9 +WC_ASM_ATT_HIDDEN(_sp_521_mont_mul_avx2_9) .p2align 4 _sp_521_mont_mul_avx2_9: #endif /* __APPLE__ */ @@ -55936,12 +56346,14 @@ _sp_521_mont_mul_avx2_9: #ifndef __APPLE__ .text .globl sp_521_mont_sqr_avx2_9 +WC_ASM_ATT_HIDDEN(sp_521_mont_sqr_avx2_9) .type sp_521_mont_sqr_avx2_9,@function .align 16 sp_521_mont_sqr_avx2_9: #else .section __TEXT,__text .globl _sp_521_mont_sqr_avx2_9 +WC_ASM_ATT_HIDDEN(_sp_521_mont_sqr_avx2_9) .p2align 4 _sp_521_mont_sqr_avx2_9: #endif /* __APPLE__ */ @@ -56383,12 +56795,14 @@ _sp_521_mont_sqr_avx2_9: #ifndef __APPLE__ .text .globl sp_521_cond_sub_avx2_9 +WC_ASM_ATT_HIDDEN(sp_521_cond_sub_avx2_9) .type sp_521_cond_sub_avx2_9,@function .align 16 sp_521_cond_sub_avx2_9: #else .section __TEXT,__text .globl _sp_521_cond_sub_avx2_9 +WC_ASM_ATT_HIDDEN(_sp_521_cond_sub_avx2_9) .p2align 4 _sp_521_cond_sub_avx2_9: #endif /* __APPLE__ */ @@ -56454,12 +56868,14 @@ _sp_521_cond_sub_avx2_9: #ifndef __APPLE__ .text .globl sp_521_mont_reduce_order_avx2_9 +WC_ASM_ATT_HIDDEN(sp_521_mont_reduce_order_avx2_9) .type sp_521_mont_reduce_order_avx2_9,@function .align 16 sp_521_mont_reduce_order_avx2_9: #else .section __TEXT,__text .globl _sp_521_mont_reduce_order_avx2_9 +WC_ASM_ATT_HIDDEN(_sp_521_mont_reduce_order_avx2_9) .p2align 4 _sp_521_mont_reduce_order_avx2_9: #endif /* __APPLE__ */ @@ -56772,12 +57188,14 @@ L_521_mont_reduce_order_avx2_9_loop: #ifndef __APPLE__ .text .globl sp_521_mont_div2_avx2_9 +WC_ASM_ATT_HIDDEN(sp_521_mont_div2_avx2_9) .type sp_521_mont_div2_avx2_9,@function .align 16 sp_521_mont_div2_avx2_9: #else .section __TEXT,__text .globl _sp_521_mont_div2_avx2_9 +WC_ASM_ATT_HIDDEN(_sp_521_mont_div2_avx2_9) .p2align 4 _sp_521_mont_div2_avx2_9: #endif /* __APPLE__ */ @@ -56842,12 +57260,14 @@ _sp_521_mont_div2_avx2_9: #ifndef __APPLE__ .text .globl sp_521_get_entry_64_9 +WC_ASM_ATT_HIDDEN(sp_521_get_entry_64_9) .type sp_521_get_entry_64_9,@function .align 16 sp_521_get_entry_64_9: #else .section __TEXT,__text .globl _sp_521_get_entry_64_9 +WC_ASM_ATT_HIDDEN(_sp_521_get_entry_64_9) .p2align 4 _sp_521_get_entry_64_9: #endif /* __APPLE__ */ @@ -56961,21 +57381,23 @@ L_521_get_entry_64_9_start_1: #ifndef __APPLE__ .text .globl sp_521_get_entry_64_avx2_9 +WC_ASM_ATT_HIDDEN(sp_521_get_entry_64_avx2_9) .type sp_521_get_entry_64_avx2_9,@function .align 16 sp_521_get_entry_64_avx2_9: #else .section __TEXT,__text .globl _sp_521_get_entry_64_avx2_9 +WC_ASM_ATT_HIDDEN(_sp_521_get_entry_64_avx2_9) .p2align 4 _sp_521_get_entry_64_avx2_9: #endif /* __APPLE__ */ pushq %r12 movq $0x01, %r12 movq $0x01, %rax - movd %edx, %xmm9 + vmovd %edx, %xmm9 addq $0x90, %rsi - movd %eax, %xmm11 + vmovd %eax, %xmm11 movq $0x40, %rax vpxor %ymm10, %ymm10, %ymm10 vpermd %ymm9, %ymm10, %ymm9 @@ -57039,12 +57461,14 @@ L_521_get_entry_64_avx2_9_start: #ifndef __APPLE__ .text .globl sp_521_get_entry_65_9 +WC_ASM_ATT_HIDDEN(sp_521_get_entry_65_9) .type sp_521_get_entry_65_9,@function .align 16 sp_521_get_entry_65_9: #else .section __TEXT,__text .globl _sp_521_get_entry_65_9 +WC_ASM_ATT_HIDDEN(_sp_521_get_entry_65_9) .p2align 4 _sp_521_get_entry_65_9: #endif /* __APPLE__ */ @@ -57158,21 +57582,23 @@ L_521_get_entry_65_9_start_1: #ifndef __APPLE__ .text .globl sp_521_get_entry_65_avx2_9 +WC_ASM_ATT_HIDDEN(sp_521_get_entry_65_avx2_9) .type sp_521_get_entry_65_avx2_9,@function .align 16 sp_521_get_entry_65_avx2_9: #else .section __TEXT,__text .globl _sp_521_get_entry_65_avx2_9 +WC_ASM_ATT_HIDDEN(_sp_521_get_entry_65_avx2_9) .p2align 4 _sp_521_get_entry_65_avx2_9: #endif /* __APPLE__ */ pushq %r12 movq $0x01, %r12 movq $0x01, %rax - movd %edx, %xmm9 + vmovd %edx, %xmm9 addq $0x90, %rsi - movd %eax, %xmm11 + vmovd %eax, %xmm11 movq $0x41, %rax vpxor %ymm10, %ymm10, %ymm10 vpermd %ymm9, %ymm10, %ymm9 @@ -57233,12 +57659,14 @@ L_521_get_entry_65_avx2_9_start: #ifndef __APPLE__ .text .globl sp_521_add_one_9 +WC_ASM_ATT_HIDDEN(sp_521_add_one_9) .type sp_521_add_one_9,@function .align 16 sp_521_add_one_9: #else .section __TEXT,__text .globl _sp_521_add_one_9 +WC_ASM_ATT_HIDDEN(_sp_521_add_one_9) .p2align 4 _sp_521_add_one_9: #endif /* __APPLE__ */ @@ -57266,12 +57694,14 @@ _sp_521_add_one_9: #ifndef __APPLE__ .text .globl sp_521_from_bin_bswap +WC_ASM_ATT_HIDDEN(sp_521_from_bin_bswap) .type sp_521_from_bin_bswap,@function .align 16 sp_521_from_bin_bswap: #else .section __TEXT,__text .globl _sp_521_from_bin_bswap +WC_ASM_ATT_HIDDEN(_sp_521_from_bin_bswap) .p2align 4 _sp_521_from_bin_bswap: #endif /* __APPLE__ */ @@ -57361,12 +57791,14 @@ L_521_from_bin_bswap_zero_end: #ifndef __APPLE__ .text .globl sp_521_from_bin_movbe +WC_ASM_ATT_HIDDEN(sp_521_from_bin_movbe) .type sp_521_from_bin_movbe,@function .align 16 sp_521_from_bin_movbe: #else .section __TEXT,__text .globl _sp_521_from_bin_movbe +WC_ASM_ATT_HIDDEN(_sp_521_from_bin_movbe) .p2align 4 _sp_521_from_bin_movbe: #endif /* __APPLE__ */ @@ -57445,12 +57877,14 @@ L_521_from_bin_movbe_zero_end: #ifndef __APPLE__ .text .globl sp_521_to_bin_bswap_9 +WC_ASM_ATT_HIDDEN(sp_521_to_bin_bswap_9) .type sp_521_to_bin_bswap_9,@function .align 16 sp_521_to_bin_bswap_9: #else .section __TEXT,__text .globl _sp_521_to_bin_bswap_9 +WC_ASM_ATT_HIDDEN(_sp_521_to_bin_bswap_9) .p2align 4 _sp_521_to_bin_bswap_9: #endif /* __APPLE__ */ @@ -57497,12 +57931,14 @@ _sp_521_to_bin_bswap_9: #ifndef __APPLE__ .text .globl sp_521_to_bin_movbe_9 +WC_ASM_ATT_HIDDEN(sp_521_to_bin_movbe_9) .type sp_521_to_bin_movbe_9,@function .align 16 sp_521_to_bin_movbe_9: #else .section __TEXT,__text .globl _sp_521_to_bin_movbe_9 +WC_ASM_ATT_HIDDEN(_sp_521_to_bin_movbe_9) .p2align 4 _sp_521_to_bin_movbe_9: #endif /* __APPLE__ */ @@ -57539,12 +57975,14 @@ _sp_521_to_bin_movbe_9: #ifndef __APPLE__ .text .globl sp_521_rshift_9 +WC_ASM_ATT_HIDDEN(sp_521_rshift_9) .type sp_521_rshift_9,@function .align 16 sp_521_rshift_9: #else .section __TEXT,__text .globl _sp_521_rshift_9 +WC_ASM_ATT_HIDDEN(_sp_521_rshift_9) .p2align 4 _sp_521_rshift_9: #endif /* __APPLE__ */ @@ -57589,12 +58027,14 @@ _sp_521_rshift_9: #ifndef __APPLE__ .text .globl sp_521_lshift_9 +WC_ASM_ATT_HIDDEN(sp_521_lshift_9) .type sp_521_lshift_9,@function .align 16 sp_521_lshift_9: #else .section __TEXT,__text .globl _sp_521_lshift_9 +WC_ASM_ATT_HIDDEN(_sp_521_lshift_9) .p2align 4 _sp_521_lshift_9: #endif /* __APPLE__ */ @@ -57642,12 +58082,14 @@ _sp_521_lshift_9: #ifndef __APPLE__ .text .globl sp_521_lshift_18 +WC_ASM_ATT_HIDDEN(sp_521_lshift_18) .type sp_521_lshift_18,@function .align 16 sp_521_lshift_18: #else .section __TEXT,__text .globl _sp_521_lshift_18 +WC_ASM_ATT_HIDDEN(_sp_521_lshift_18) .p2align 4 _sp_521_lshift_18: #endif /* __APPLE__ */ @@ -57721,12 +58163,14 @@ _sp_521_lshift_18: #ifndef __APPLE__ .text .globl sp_521_sub_in_place_9 +WC_ASM_ATT_HIDDEN(sp_521_sub_in_place_9) .type sp_521_sub_in_place_9,@function .align 16 sp_521_sub_in_place_9: #else .section __TEXT,__text .globl _sp_521_sub_in_place_9 +WC_ASM_ATT_HIDDEN(_sp_521_sub_in_place_9) .p2align 4 _sp_521_sub_in_place_9: #endif /* __APPLE__ */ @@ -57771,12 +58215,14 @@ _sp_521_sub_in_place_9: #ifndef __APPLE__ .text .globl sp_521_mul_d_9 +WC_ASM_ATT_HIDDEN(sp_521_mul_d_9) .type sp_521_mul_d_9,@function .align 16 sp_521_mul_d_9: #else .section __TEXT,__text .globl _sp_521_mul_d_9 +WC_ASM_ATT_HIDDEN(_sp_521_mul_d_9) .p2align 4 _sp_521_mul_d_9: #endif /* __APPLE__ */ @@ -57865,12 +58311,14 @@ _sp_521_mul_d_9: #ifndef __APPLE__ .text .globl sp_521_mul_d_avx2_9 +WC_ASM_ATT_HIDDEN(sp_521_mul_d_avx2_9) .type sp_521_mul_d_avx2_9,@function .align 16 sp_521_mul_d_avx2_9: #else .section __TEXT,__text .globl _sp_521_mul_d_avx2_9 +WC_ASM_ATT_HIDDEN(_sp_521_mul_d_avx2_9) .p2align 4 _sp_521_mul_d_avx2_9: #endif /* __APPLE__ */ @@ -57947,12 +58395,14 @@ _sp_521_mul_d_avx2_9: #ifndef __APPLE__ .text .globl div_521_word_asm_9 +WC_ASM_ATT_HIDDEN(div_521_word_asm_9) .type div_521_word_asm_9,@function .align 16 div_521_word_asm_9: #else .section __TEXT,__text .globl _div_521_word_asm_9 +WC_ASM_ATT_HIDDEN(_div_521_word_asm_9) .p2align 4 _div_521_word_asm_9: #endif /* __APPLE__ */ @@ -57973,12 +58423,14 @@ _div_521_word_asm_9: #ifndef __APPLE__ .text .globl sp_521_rshift1_9 +WC_ASM_ATT_HIDDEN(sp_521_rshift1_9) .type sp_521_rshift1_9,@function .align 16 sp_521_rshift1_9: #else .section __TEXT,__text .globl _sp_521_rshift1_9 +WC_ASM_ATT_HIDDEN(_sp_521_rshift1_9) .p2align 4 _sp_521_rshift1_9: #endif /* __APPLE__ */ @@ -58022,12 +58474,14 @@ _sp_521_rshift1_9: #ifndef __APPLE__ .text .globl sp_521_div2_mod_9 +WC_ASM_ATT_HIDDEN(sp_521_div2_mod_9) .type sp_521_div2_mod_9,@function .align 16 sp_521_div2_mod_9: #else .section __TEXT,__text .globl _sp_521_div2_mod_9 +WC_ASM_ATT_HIDDEN(_sp_521_div2_mod_9) .p2align 4 _sp_521_div2_mod_9: #endif /* __APPLE__ */ @@ -58105,12 +58559,14 @@ L_521_mod_inv_9_div2_mod_no_add: #ifndef __APPLE__ .text .globl sp_521_num_bits_9 +WC_ASM_ATT_HIDDEN(sp_521_num_bits_9) .type sp_521_num_bits_9,@function .align 16 sp_521_num_bits_9: #else .section __TEXT,__text .globl _sp_521_num_bits_9 +WC_ASM_ATT_HIDDEN(_sp_521_num_bits_9) .p2align 4 _sp_521_num_bits_9: #endif /* __APPLE__ */ @@ -58203,12 +58659,14 @@ L_521_num_bits_9_done: #ifndef __APPLE__ .text .globl sp_1024_mul_16 +WC_ASM_ATT_HIDDEN(sp_1024_mul_16) .type sp_1024_mul_16,@function .align 16 sp_1024_mul_16: #else .section __TEXT,__text .globl _sp_1024_mul_16 +WC_ASM_ATT_HIDDEN(_sp_1024_mul_16) .p2align 4 _sp_1024_mul_16: #endif /* __APPLE__ */ @@ -59854,12 +60312,14 @@ _sp_1024_mul_16: #ifndef __APPLE__ .text .globl sp_1024_sqr_16 +WC_ASM_ATT_HIDDEN(sp_1024_sqr_16) .type sp_1024_sqr_16,@function .align 16 sp_1024_sqr_16: #else .section __TEXT,__text .globl _sp_1024_sqr_16 +WC_ASM_ATT_HIDDEN(_sp_1024_sqr_16) .p2align 4 _sp_1024_sqr_16: #endif /* __APPLE__ */ @@ -60950,12 +61410,14 @@ _sp_1024_sqr_16: #ifndef __APPLE__ .text .globl sp_1024_mul_avx2_16 +WC_ASM_ATT_HIDDEN(sp_1024_mul_avx2_16) .type sp_1024_mul_avx2_16,@function .align 16 sp_1024_mul_avx2_16: #else .section __TEXT,__text .globl _sp_1024_mul_avx2_16 +WC_ASM_ATT_HIDDEN(_sp_1024_mul_avx2_16) .p2align 4 _sp_1024_mul_avx2_16: #endif /* __APPLE__ */ @@ -62626,12 +63088,14 @@ L_end_1024_mul_avx2_16: #ifndef __APPLE__ .text .globl sp_1024_sqr_avx2_16 +WC_ASM_ATT_HIDDEN(sp_1024_sqr_avx2_16) .type sp_1024_sqr_avx2_16,@function .align 16 sp_1024_sqr_avx2_16: #else .section __TEXT,__text .globl _sp_1024_sqr_avx2_16 +WC_ASM_ATT_HIDDEN(_sp_1024_sqr_avx2_16) .p2align 4 _sp_1024_sqr_avx2_16: #endif /* __APPLE__ */ @@ -63685,12 +64149,14 @@ L_end_1024_sqr_avx2_16: #ifndef __APPLE__ .text .globl sp_1024_add_16 +WC_ASM_ATT_HIDDEN(sp_1024_add_16) .type sp_1024_add_16,@function .align 16 sp_1024_add_16: #else .section __TEXT,__text .globl _sp_1024_add_16 +WC_ASM_ATT_HIDDEN(_sp_1024_add_16) .p2align 4 _sp_1024_add_16: #endif /* __APPLE__ */ @@ -63757,12 +64223,14 @@ _sp_1024_add_16: #ifndef __APPLE__ .text .globl sp_1024_sub_in_place_16 +WC_ASM_ATT_HIDDEN(sp_1024_sub_in_place_16) .type sp_1024_sub_in_place_16,@function .align 16 sp_1024_sub_in_place_16: #else .section __TEXT,__text .globl _sp_1024_sub_in_place_16 +WC_ASM_ATT_HIDDEN(_sp_1024_sub_in_place_16) .p2align 4 _sp_1024_sub_in_place_16: #endif /* __APPLE__ */ @@ -63831,12 +64299,14 @@ _sp_1024_sub_in_place_16: #ifndef __APPLE__ .text .globl sp_1024_cond_sub_16 +WC_ASM_ATT_HIDDEN(sp_1024_cond_sub_16) .type sp_1024_cond_sub_16,@function .align 16 sp_1024_cond_sub_16: #else .section __TEXT,__text .globl _sp_1024_cond_sub_16 +WC_ASM_ATT_HIDDEN(_sp_1024_cond_sub_16) .p2align 4 _sp_1024_cond_sub_16: #endif /* __APPLE__ */ @@ -63972,12 +64442,14 @@ _sp_1024_cond_sub_16: #ifndef __APPLE__ .text .globl sp_1024_cond_sub_avx2_16 +WC_ASM_ATT_HIDDEN(sp_1024_cond_sub_avx2_16) .type sp_1024_cond_sub_avx2_16,@function .align 16 sp_1024_cond_sub_avx2_16: #else .section __TEXT,__text .globl _sp_1024_cond_sub_avx2_16 +WC_ASM_ATT_HIDDEN(_sp_1024_cond_sub_avx2_16) .p2align 4 _sp_1024_cond_sub_avx2_16: #endif /* __APPLE__ */ @@ -64076,12 +64548,14 @@ _sp_1024_cond_sub_avx2_16: #ifndef __APPLE__ .text .globl sp_1024_mul_d_16 +WC_ASM_ATT_HIDDEN(sp_1024_mul_d_16) .type sp_1024_mul_d_16,@function .align 16 sp_1024_mul_d_16: #else .section __TEXT,__text .globl _sp_1024_mul_d_16 +WC_ASM_ATT_HIDDEN(_sp_1024_mul_d_16) .p2align 4 _sp_1024_mul_d_16: #endif /* __APPLE__ */ @@ -64226,12 +64700,14 @@ _sp_1024_mul_d_16: #ifndef __APPLE__ .text .globl sp_1024_mul_d_avx2_16 +WC_ASM_ATT_HIDDEN(sp_1024_mul_d_avx2_16) .type sp_1024_mul_d_avx2_16,@function .align 16 sp_1024_mul_d_avx2_16: #else .section __TEXT,__text .globl _sp_1024_mul_d_avx2_16 +WC_ASM_ATT_HIDDEN(_sp_1024_mul_d_avx2_16) .p2align 4 _sp_1024_mul_d_avx2_16: #endif /* __APPLE__ */ @@ -64350,12 +64826,14 @@ _sp_1024_mul_d_avx2_16: #ifndef __APPLE__ .text .globl div_1024_word_asm_16 +WC_ASM_ATT_HIDDEN(div_1024_word_asm_16) .type div_1024_word_asm_16,@function .align 16 div_1024_word_asm_16: #else .section __TEXT,__text .globl _div_1024_word_asm_16 +WC_ASM_ATT_HIDDEN(_div_1024_word_asm_16) .p2align 4 _div_1024_word_asm_16: #endif /* __APPLE__ */ @@ -64379,12 +64857,14 @@ _div_1024_word_asm_16: #ifndef __APPLE__ .text .globl sp_1024_cmp_16 +WC_ASM_ATT_HIDDEN(sp_1024_cmp_16) .type sp_1024_cmp_16,@function .align 16 sp_1024_cmp_16: #else .section __TEXT,__text .globl _sp_1024_cmp_16 +WC_ASM_ATT_HIDDEN(_sp_1024_cmp_16) .p2align 4 _sp_1024_cmp_16: #endif /* __APPLE__ */ @@ -64535,12 +65015,14 @@ _sp_1024_cmp_16: #ifndef __APPLE__ .text .globl sp_1024_cond_copy_16 +WC_ASM_ATT_HIDDEN(sp_1024_cond_copy_16) .type sp_1024_cond_copy_16,@function .align 16 sp_1024_cond_copy_16: #else .section __TEXT,__text .globl _sp_1024_cond_copy_16 +WC_ASM_ATT_HIDDEN(_sp_1024_cond_copy_16) .p2align 4 _sp_1024_cond_copy_16: #endif /* __APPLE__ */ @@ -64622,12 +65104,14 @@ _sp_1024_cond_copy_16: #ifndef __APPLE__ .text .globl sp_1024_mont_reduce_16 +WC_ASM_ATT_HIDDEN(sp_1024_mont_reduce_16) .type sp_1024_mont_reduce_16,@function .align 16 sp_1024_mont_reduce_16: #else .section __TEXT,__text .globl _sp_1024_mont_reduce_16 +WC_ASM_ATT_HIDDEN(_sp_1024_mont_reduce_16) .p2align 4 _sp_1024_mont_reduce_16: #endif /* __APPLE__ */ @@ -64847,12 +65331,14 @@ L_1024_mont_reduce_16_loop: #ifndef __APPLE__ .text .globl sp_1024_mont_add_16 +WC_ASM_ATT_HIDDEN(sp_1024_mont_add_16) .type sp_1024_mont_add_16,@function .align 16 sp_1024_mont_add_16: #else .section __TEXT,__text .globl _sp_1024_mont_add_16 +WC_ASM_ATT_HIDDEN(_sp_1024_mont_add_16) .p2align 4 _sp_1024_mont_add_16: #endif /* __APPLE__ */ @@ -65021,12 +65507,14 @@ _sp_1024_mont_add_16: #ifndef __APPLE__ .text .globl sp_1024_mont_dbl_16 +WC_ASM_ATT_HIDDEN(sp_1024_mont_dbl_16) .type sp_1024_mont_dbl_16,@function .align 16 sp_1024_mont_dbl_16: #else .section __TEXT,__text .globl _sp_1024_mont_dbl_16 +WC_ASM_ATT_HIDDEN(_sp_1024_mont_dbl_16) .p2align 4 _sp_1024_mont_dbl_16: #endif /* __APPLE__ */ @@ -65195,12 +65683,14 @@ _sp_1024_mont_dbl_16: #ifndef __APPLE__ .text .globl sp_1024_mont_tpl_16 +WC_ASM_ATT_HIDDEN(sp_1024_mont_tpl_16) .type sp_1024_mont_tpl_16,@function .align 16 sp_1024_mont_tpl_16: #else .section __TEXT,__text .globl _sp_1024_mont_tpl_16 +WC_ASM_ATT_HIDDEN(_sp_1024_mont_tpl_16) .p2align 4 _sp_1024_mont_tpl_16: #endif /* __APPLE__ */ @@ -65520,12 +66010,14 @@ _sp_1024_mont_tpl_16: #ifndef __APPLE__ .text .globl sp_1024_mont_sub_16 +WC_ASM_ATT_HIDDEN(sp_1024_mont_sub_16) .type sp_1024_mont_sub_16,@function .align 16 sp_1024_mont_sub_16: #else .section __TEXT,__text .globl _sp_1024_mont_sub_16 +WC_ASM_ATT_HIDDEN(_sp_1024_mont_sub_16) .p2align 4 _sp_1024_mont_sub_16: #endif /* __APPLE__ */ @@ -65690,12 +66182,14 @@ _sp_1024_mont_sub_16: #ifndef __APPLE__ .text .globl sp_1024_mont_div2_16 +WC_ASM_ATT_HIDDEN(sp_1024_mont_div2_16) .type sp_1024_mont_div2_16,@function .align 16 sp_1024_mont_div2_16: #else .section __TEXT,__text .globl _sp_1024_mont_div2_16 +WC_ASM_ATT_HIDDEN(_sp_1024_mont_div2_16) .p2align 4 _sp_1024_mont_div2_16: #endif /* __APPLE__ */ @@ -65849,12 +66343,14 @@ _sp_1024_mont_div2_16: #ifndef __APPLE__ .text .globl sp_1024_mont_reduce_avx2_16 +WC_ASM_ATT_HIDDEN(sp_1024_mont_reduce_avx2_16) .type sp_1024_mont_reduce_avx2_16,@function .align 16 sp_1024_mont_reduce_avx2_16: #else .section __TEXT,__text .globl _sp_1024_mont_reduce_avx2_16 +WC_ASM_ATT_HIDDEN(_sp_1024_mont_reduce_avx2_16) .p2align 4 _sp_1024_mont_reduce_avx2_16: #endif /* __APPLE__ */ @@ -66191,12 +66687,14 @@ L_1024_mont_reduce_avx2_16_loop: #ifndef __APPLE__ .text .globl sp_1024_mont_add_avx2_16 +WC_ASM_ATT_HIDDEN(sp_1024_mont_add_avx2_16) .type sp_1024_mont_add_avx2_16,@function .align 16 sp_1024_mont_add_avx2_16: #else .section __TEXT,__text .globl _sp_1024_mont_add_avx2_16 +WC_ASM_ATT_HIDDEN(_sp_1024_mont_add_avx2_16) .p2align 4 _sp_1024_mont_add_avx2_16: #endif /* __APPLE__ */ @@ -66349,12 +66847,14 @@ _sp_1024_mont_add_avx2_16: #ifndef __APPLE__ .text .globl sp_1024_mont_dbl_avx2_16 +WC_ASM_ATT_HIDDEN(sp_1024_mont_dbl_avx2_16) .type sp_1024_mont_dbl_avx2_16,@function .align 16 sp_1024_mont_dbl_avx2_16: #else .section __TEXT,__text .globl _sp_1024_mont_dbl_avx2_16 +WC_ASM_ATT_HIDDEN(_sp_1024_mont_dbl_avx2_16) .p2align 4 _sp_1024_mont_dbl_avx2_16: #endif /* __APPLE__ */ @@ -66507,12 +67007,14 @@ _sp_1024_mont_dbl_avx2_16: #ifndef __APPLE__ .text .globl sp_1024_mont_tpl_avx2_16 +WC_ASM_ATT_HIDDEN(sp_1024_mont_tpl_avx2_16) .type sp_1024_mont_tpl_avx2_16,@function .align 16 sp_1024_mont_tpl_avx2_16: #else .section __TEXT,__text .globl _sp_1024_mont_tpl_avx2_16 +WC_ASM_ATT_HIDDEN(_sp_1024_mont_tpl_avx2_16) .p2align 4 _sp_1024_mont_tpl_avx2_16: #endif /* __APPLE__ */ @@ -66800,12 +67302,14 @@ _sp_1024_mont_tpl_avx2_16: #ifndef __APPLE__ .text .globl sp_1024_mont_sub_avx2_16 +WC_ASM_ATT_HIDDEN(sp_1024_mont_sub_avx2_16) .type sp_1024_mont_sub_avx2_16,@function .align 16 sp_1024_mont_sub_avx2_16: #else .section __TEXT,__text .globl _sp_1024_mont_sub_avx2_16 +WC_ASM_ATT_HIDDEN(_sp_1024_mont_sub_avx2_16) .p2align 4 _sp_1024_mont_sub_avx2_16: #endif /* __APPLE__ */ @@ -66954,12 +67458,14 @@ _sp_1024_mont_sub_avx2_16: #ifndef __APPLE__ .text .globl sp_1024_mont_div2_avx2_16 +WC_ASM_ATT_HIDDEN(sp_1024_mont_div2_avx2_16) .type sp_1024_mont_div2_avx2_16,@function .align 16 sp_1024_mont_div2_avx2_16: #else .section __TEXT,__text .globl _sp_1024_mont_div2_avx2_16 +WC_ASM_ATT_HIDDEN(_sp_1024_mont_div2_avx2_16) .p2align 4 _sp_1024_mont_div2_avx2_16: #endif /* __APPLE__ */ @@ -67113,12 +67619,14 @@ _sp_1024_mont_div2_avx2_16: #ifndef __APPLE__ .text .globl sp_1024_from_bin_bswap +WC_ASM_ATT_HIDDEN(sp_1024_from_bin_bswap) .type sp_1024_from_bin_bswap,@function .align 16 sp_1024_from_bin_bswap: #else .section __TEXT,__text .globl _sp_1024_from_bin_bswap +WC_ASM_ATT_HIDDEN(_sp_1024_from_bin_bswap) .p2align 4 _sp_1024_from_bin_bswap: #endif /* __APPLE__ */ @@ -67208,12 +67716,14 @@ L_1024_from_bin_bswap_zero_end: #ifndef __APPLE__ .text .globl sp_1024_from_bin_movbe +WC_ASM_ATT_HIDDEN(sp_1024_from_bin_movbe) .type sp_1024_from_bin_movbe,@function .align 16 sp_1024_from_bin_movbe: #else .section __TEXT,__text .globl _sp_1024_from_bin_movbe +WC_ASM_ATT_HIDDEN(_sp_1024_from_bin_movbe) .p2align 4 _sp_1024_from_bin_movbe: #endif /* __APPLE__ */ diff --git a/wolfcrypt/src/wc_falcon_fpr_x86_64_asm.S b/wolfcrypt/src/wc_falcon_fpr_x86_64_asm.S index 96585c11b99..8318184447d 100644 --- a/wolfcrypt/src/wc_falcon_fpr_x86_64_asm.S +++ b/wolfcrypt/src/wc_falcon_fpr_x86_64_asm.S @@ -57,12 +57,14 @@ #ifndef __APPLE__ .text .globl fpr_add +WC_ASM_ATT_HIDDEN(fpr_add) .type fpr_add,@function .align 16 fpr_add: #else .section __TEXT,__text .globl _fpr_add +WC_ASM_ATT_HIDDEN(_fpr_add) .p2align 4 _fpr_add: #endif /* __APPLE__ */ @@ -78,12 +80,14 @@ _fpr_add: #ifndef __APPLE__ .text .globl fpr_sub +WC_ASM_ATT_HIDDEN(fpr_sub) .type fpr_sub,@function .align 16 fpr_sub: #else .section __TEXT,__text .globl _fpr_sub +WC_ASM_ATT_HIDDEN(_fpr_sub) .p2align 4 _fpr_sub: #endif /* __APPLE__ */ @@ -99,12 +103,14 @@ _fpr_sub: #ifndef __APPLE__ .text .globl fpr_neg +WC_ASM_ATT_HIDDEN(fpr_neg) .type fpr_neg,@function .align 16 fpr_neg: #else .section __TEXT,__text .globl _fpr_neg +WC_ASM_ATT_HIDDEN(_fpr_neg) .p2align 4 _fpr_neg: #endif /* __APPLE__ */ @@ -121,12 +127,14 @@ _fpr_neg: #ifndef __APPLE__ .text .globl fpr_half +WC_ASM_ATT_HIDDEN(fpr_half) .type fpr_half,@function .align 16 fpr_half: #else .section __TEXT,__text .globl _fpr_half +WC_ASM_ATT_HIDDEN(_fpr_half) .p2align 4 _fpr_half: #endif /* __APPLE__ */ @@ -143,12 +151,14 @@ _fpr_half: #ifndef __APPLE__ .text .globl fpr_double +WC_ASM_ATT_HIDDEN(fpr_double) .type fpr_double,@function .align 16 fpr_double: #else .section __TEXT,__text .globl _fpr_double +WC_ASM_ATT_HIDDEN(_fpr_double) .p2align 4 _fpr_double: #endif /* __APPLE__ */ @@ -163,12 +173,14 @@ _fpr_double: #ifndef __APPLE__ .text .globl fpr_mul +WC_ASM_ATT_HIDDEN(fpr_mul) .type fpr_mul,@function .align 16 fpr_mul: #else .section __TEXT,__text .globl _fpr_mul +WC_ASM_ATT_HIDDEN(_fpr_mul) .p2align 4 _fpr_mul: #endif /* __APPLE__ */ @@ -184,12 +196,14 @@ _fpr_mul: #ifndef __APPLE__ .text .globl fpr_sqr +WC_ASM_ATT_HIDDEN(fpr_sqr) .type fpr_sqr,@function .align 16 fpr_sqr: #else .section __TEXT,__text .globl _fpr_sqr +WC_ASM_ATT_HIDDEN(_fpr_sqr) .p2align 4 _fpr_sqr: #endif /* __APPLE__ */ @@ -204,12 +218,14 @@ _fpr_sqr: #ifndef __APPLE__ .text .globl fpr_div +WC_ASM_ATT_HIDDEN(fpr_div) .type fpr_div,@function .align 16 fpr_div: #else .section __TEXT,__text .globl _fpr_div +WC_ASM_ATT_HIDDEN(_fpr_div) .p2align 4 _fpr_div: #endif /* __APPLE__ */ @@ -225,12 +241,14 @@ _fpr_div: #ifndef __APPLE__ .text .globl fpr_inv +WC_ASM_ATT_HIDDEN(fpr_inv) .type fpr_inv,@function .align 16 fpr_inv: #else .section __TEXT,__text .globl _fpr_inv +WC_ASM_ATT_HIDDEN(_fpr_inv) .p2align 4 _fpr_inv: #endif /* __APPLE__ */ @@ -247,12 +265,14 @@ _fpr_inv: #ifndef __APPLE__ .text .globl fpr_sqrt +WC_ASM_ATT_HIDDEN(fpr_sqrt) .type fpr_sqrt,@function .align 16 fpr_sqrt: #else .section __TEXT,__text .globl _fpr_sqrt +WC_ASM_ATT_HIDDEN(_fpr_sqrt) .p2align 4 _fpr_sqrt: #endif /* __APPLE__ */ @@ -267,12 +287,14 @@ _fpr_sqrt: #ifndef __APPLE__ .text .globl fpr_of +WC_ASM_ATT_HIDDEN(fpr_of) .type fpr_of,@function .align 16 fpr_of: #else .section __TEXT,__text .globl _fpr_of +WC_ASM_ATT_HIDDEN(_fpr_of) .p2align 4 _fpr_of: #endif /* __APPLE__ */ @@ -286,12 +308,14 @@ _fpr_of: #ifndef __APPLE__ .text .globl fpr_rint +WC_ASM_ATT_HIDDEN(fpr_rint) .type fpr_rint,@function .align 16 fpr_rint: #else .section __TEXT,__text .globl _fpr_rint +WC_ASM_ATT_HIDDEN(_fpr_rint) .p2align 4 _fpr_rint: #endif /* __APPLE__ */ @@ -305,12 +329,14 @@ _fpr_rint: #ifndef __APPLE__ .text .globl fpr_floor +WC_ASM_ATT_HIDDEN(fpr_floor) .type fpr_floor,@function .align 16 fpr_floor: #else .section __TEXT,__text .globl _fpr_floor +WC_ASM_ATT_HIDDEN(_fpr_floor) .p2align 4 _fpr_floor: #endif /* __APPLE__ */ @@ -330,12 +356,14 @@ _fpr_floor: #ifndef __APPLE__ .text .globl fpr_trunc +WC_ASM_ATT_HIDDEN(fpr_trunc) .type fpr_trunc,@function .align 16 fpr_trunc: #else .section __TEXT,__text .globl _fpr_trunc +WC_ASM_ATT_HIDDEN(_fpr_trunc) .p2align 4 _fpr_trunc: #endif /* __APPLE__ */ @@ -349,12 +377,14 @@ _fpr_trunc: #ifndef __APPLE__ .text .globl fpr_lt +WC_ASM_ATT_HIDDEN(fpr_lt) .type fpr_lt,@function .align 16 fpr_lt: #else .section __TEXT,__text .globl _fpr_lt +WC_ASM_ATT_HIDDEN(_fpr_lt) .p2align 4 _fpr_lt: #endif /* __APPLE__ */ diff --git a/wolfcrypt/src/wc_frodokem_asm.S b/wolfcrypt/src/wc_frodokem_asm.S index e8d822eba4c..80b956b3e3a 100644 --- a/wolfcrypt/src/wc_frodokem_asm.S +++ b/wolfcrypt/src/wc_frodokem_asm.S @@ -47,12 +47,14 @@ #ifndef __APPLE__ .text .globl frodokem_sa_accum_avx2 +WC_ASM_ATT_HIDDEN(frodokem_sa_accum_avx2) .type frodokem_sa_accum_avx2,@function .align 16 frodokem_sa_accum_avx2: #else .section __TEXT,__text .globl _frodokem_sa_accum_avx2 +WC_ASM_ATT_HIDDEN(_frodokem_sa_accum_avx2) .p2align 4 _frodokem_sa_accum_avx2: #endif /* __APPLE__ */ @@ -104,12 +106,14 @@ L_frodokem_sa_accum_avx2_k: #ifndef __APPLE__ .text .globl frodokem_as_accum_avx2 +WC_ASM_ATT_HIDDEN(frodokem_as_accum_avx2) .type frodokem_as_accum_avx2,@function .align 16 frodokem_as_accum_avx2: #else .section __TEXT,__text .globl _frodokem_as_accum_avx2 +WC_ASM_ATT_HIDDEN(_frodokem_as_accum_avx2) .p2align 4 _frodokem_as_accum_avx2: #endif /* __APPLE__ */ @@ -217,12 +221,14 @@ L_frodokem_as_accum_avx2_j: #ifndef __APPLE__ .text .globl frodokem_mul_bs_avx2 +WC_ASM_ATT_HIDDEN(frodokem_mul_bs_avx2) .type frodokem_mul_bs_avx2,@function .align 16 frodokem_mul_bs_avx2: #else .section __TEXT,__text .globl _frodokem_mul_bs_avx2 +WC_ASM_ATT_HIDDEN(_frodokem_mul_bs_avx2) .p2align 4 _frodokem_mul_bs_avx2: #endif /* __APPLE__ */ @@ -326,12 +332,14 @@ L_frodokem_mul_bs_avx2_j: #ifndef __APPLE__ .text .globl frodokem_mul_add_sb_plus_e_avx2 +WC_ASM_ATT_HIDDEN(frodokem_mul_add_sb_plus_e_avx2) .type frodokem_mul_add_sb_plus_e_avx2,@function .align 16 frodokem_mul_add_sb_plus_e_avx2: #else .section __TEXT,__text .globl _frodokem_mul_add_sb_plus_e_avx2 +WC_ASM_ATT_HIDDEN(_frodokem_mul_add_sb_plus_e_avx2) .p2align 4 _frodokem_mul_add_sb_plus_e_avx2: #endif /* __APPLE__ */ @@ -410,12 +418,14 @@ L_frodokem_mul_add_sb_plus_e_avx2_j: #ifndef __APPLE__ .text .globl frodokem_add_avx2 +WC_ASM_ATT_HIDDEN(frodokem_add_avx2) .type frodokem_add_avx2,@function .align 16 frodokem_add_avx2: #else .section __TEXT,__text .globl _frodokem_add_avx2 +WC_ASM_ATT_HIDDEN(_frodokem_add_avx2) .p2align 4 _frodokem_add_avx2: #endif /* __APPLE__ */ @@ -445,12 +455,14 @@ _frodokem_add_avx2: #ifndef __APPLE__ .text .globl frodokem_a_rows_reduce_avx2 +WC_ASM_ATT_HIDDEN(frodokem_a_rows_reduce_avx2) .type frodokem_a_rows_reduce_avx2,@function .align 16 frodokem_a_rows_reduce_avx2: #else .section __TEXT,__text .globl _frodokem_a_rows_reduce_avx2 +WC_ASM_ATT_HIDDEN(_frodokem_a_rows_reduce_avx2) .p2align 4 _frodokem_a_rows_reduce_avx2: #endif /* __APPLE__ */ @@ -484,12 +496,14 @@ L_frodokem_a_rows_reduce_avx2_done: #ifndef __APPLE__ .text .globl frodokem_sample_avx2 +WC_ASM_ATT_HIDDEN(frodokem_sample_avx2) .type frodokem_sample_avx2,@function .align 16 frodokem_sample_avx2: #else .section __TEXT,__text .globl _frodokem_sample_avx2 +WC_ASM_ATT_HIDDEN(_frodokem_sample_avx2) .p2align 4 _frodokem_sample_avx2: #endif /* __APPLE__ */ @@ -529,12 +543,14 @@ L_frodokem_sample_avx2_cdf: #ifndef __APPLE__ .text .globl frodokem_gen_a_rows_aes_avx2 +WC_ASM_ATT_HIDDEN(frodokem_gen_a_rows_aes_avx2) .type frodokem_gen_a_rows_aes_avx2,@function .align 16 frodokem_gen_a_rows_aes_avx2: #else .section __TEXT,__text .globl _frodokem_gen_a_rows_aes_avx2 +WC_ASM_ATT_HIDDEN(_frodokem_gen_a_rows_aes_avx2) .p2align 4 _frodokem_gen_a_rows_aes_avx2: #endif /* __APPLE__ */ @@ -682,12 +698,14 @@ L_frodokem_gen_a_rows_aes_avx2_next: #ifndef __APPLE__ .text .globl frodokem_gen_a_rows_aes_aesni +WC_ASM_ATT_HIDDEN(frodokem_gen_a_rows_aes_aesni) .type frodokem_gen_a_rows_aes_aesni,@function .align 16 frodokem_gen_a_rows_aes_aesni: #else .section __TEXT,__text .globl _frodokem_gen_a_rows_aes_aesni +WC_ASM_ATT_HIDDEN(_frodokem_gen_a_rows_aes_aesni) .p2align 4 _frodokem_gen_a_rows_aes_aesni: #endif /* __APPLE__ */ @@ -875,12 +893,14 @@ L_frodokem_gen_a_rows_aes_aesni_next: #ifndef __APPLE__ .text .globl frodokem_sa_accum_avx512 +WC_ASM_ATT_HIDDEN(frodokem_sa_accum_avx512) .type frodokem_sa_accum_avx512,@function .align 16 frodokem_sa_accum_avx512: #else .section __TEXT,__text .globl _frodokem_sa_accum_avx512 +WC_ASM_ATT_HIDDEN(_frodokem_sa_accum_avx512) .p2align 4 _frodokem_sa_accum_avx512: #endif /* __APPLE__ */ @@ -983,12 +1003,14 @@ L_frodokem_sa_accum_avx512_tail: #ifndef __APPLE__ .text .globl frodokem_as_accum_avx512 +WC_ASM_ATT_HIDDEN(frodokem_as_accum_avx512) .type frodokem_as_accum_avx512,@function .align 16 frodokem_as_accum_avx512: #else .section __TEXT,__text .globl _frodokem_as_accum_avx512 +WC_ASM_ATT_HIDDEN(_frodokem_as_accum_avx512) .p2align 4 _frodokem_as_accum_avx512: #endif /* __APPLE__ */ @@ -1142,12 +1164,14 @@ L_frodokem_as_accum_avx512_tail: #ifndef __APPLE__ .text .globl frodokem_mul_bs_avx512 +WC_ASM_ATT_HIDDEN(frodokem_mul_bs_avx512) .type frodokem_mul_bs_avx512,@function .align 16 frodokem_mul_bs_avx512: #else .section __TEXT,__text .globl _frodokem_mul_bs_avx512 +WC_ASM_ATT_HIDDEN(_frodokem_mul_bs_avx512) .p2align 4 _frodokem_mul_bs_avx512: #endif /* __APPLE__ */ @@ -1297,12 +1321,14 @@ L_frodokem_mul_bs_avx512_tail: #ifndef __APPLE__ .text .globl frodokem_mul_add_sb_plus_e_avx512 +WC_ASM_ATT_HIDDEN(frodokem_mul_add_sb_plus_e_avx512) .type frodokem_mul_add_sb_plus_e_avx512,@function .align 16 frodokem_mul_add_sb_plus_e_avx512: #else .section __TEXT,__text .globl _frodokem_mul_add_sb_plus_e_avx512 +WC_ASM_ATT_HIDDEN(_frodokem_mul_add_sb_plus_e_avx512) .p2align 4 _frodokem_mul_add_sb_plus_e_avx512: #endif /* __APPLE__ */ @@ -1373,12 +1399,14 @@ L_frodokem_mul_add_sb_plus_e_avx512_j: #ifndef __APPLE__ .text .globl frodokem_add_avx512 +WC_ASM_ATT_HIDDEN(frodokem_add_avx512) .type frodokem_add_avx512,@function .align 16 frodokem_add_avx512: #else .section __TEXT,__text .globl _frodokem_add_avx512 +WC_ASM_ATT_HIDDEN(_frodokem_add_avx512) .p2align 4 _frodokem_add_avx512: #endif /* __APPLE__ */ @@ -1400,12 +1428,14 @@ _frodokem_add_avx512: #ifndef __APPLE__ .text .globl frodokem_sample_avx512 +WC_ASM_ATT_HIDDEN(frodokem_sample_avx512) .type frodokem_sample_avx512,@function .align 16 frodokem_sample_avx512: #else .section __TEXT,__text .globl _frodokem_sample_avx512 +WC_ASM_ATT_HIDDEN(_frodokem_sample_avx512) .p2align 4 _frodokem_sample_avx512: #endif /* __APPLE__ */ @@ -1445,12 +1475,14 @@ L_frodokem_sample_avx512_cdf: #ifndef __APPLE__ .text .globl frodokem_gen_a_rows_aes_avx512 +WC_ASM_ATT_HIDDEN(frodokem_gen_a_rows_aes_avx512) .type frodokem_gen_a_rows_aes_avx512,@function .align 16 frodokem_gen_a_rows_aes_avx512: #else .section __TEXT,__text .globl _frodokem_gen_a_rows_aes_avx512 +WC_ASM_ATT_HIDDEN(_frodokem_gen_a_rows_aes_avx512) .p2align 4 _frodokem_gen_a_rows_aes_avx512: #endif /* __APPLE__ */ diff --git a/wolfcrypt/src/wc_mldsa_asm.S b/wolfcrypt/src/wc_mldsa_asm.S index b72b748df4d..57ad840776f 100644 --- a/wolfcrypt/src/wc_mldsa_asm.S +++ b/wolfcrypt/src/wc_mldsa_asm.S @@ -859,12 +859,14 @@ L_mldsa_avx2_zetas_inv: #ifndef __APPLE__ .text .globl wc_mldsa_poly_red_avx2 +WC_ASM_ATT_HIDDEN(wc_mldsa_poly_red_avx2) .type wc_mldsa_poly_red_avx2,@function .align 16 wc_mldsa_poly_red_avx2: #else .section __TEXT,__text .globl _wc_mldsa_poly_red_avx2 +WC_ASM_ATT_HIDDEN(_wc_mldsa_poly_red_avx2) .p2align 4 _wc_mldsa_poly_red_avx2: #endif /* __APPLE__ */ @@ -1071,12 +1073,14 @@ _wc_mldsa_poly_red_avx2: #ifndef __APPLE__ .text .globl wc_mldsa_ntt_avx2 +WC_ASM_ATT_HIDDEN(wc_mldsa_ntt_avx2) .type wc_mldsa_ntt_avx2,@function .align 16 wc_mldsa_ntt_avx2: #else .section __TEXT,__text .globl _wc_mldsa_ntt_avx2 +WC_ASM_ATT_HIDDEN(_wc_mldsa_ntt_avx2) .p2align 4 _wc_mldsa_ntt_avx2: #endif /* __APPLE__ */ @@ -5311,12 +5315,14 @@ _wc_mldsa_ntt_small_avx2: #ifndef __APPLE__ .text .globl wc_mldsa_ntt_full_avx2 +WC_ASM_ATT_HIDDEN(wc_mldsa_ntt_full_avx2) .type wc_mldsa_ntt_full_avx2,@function .align 16 wc_mldsa_ntt_full_avx2: #else .section __TEXT,__text .globl _wc_mldsa_ntt_full_avx2 +WC_ASM_ATT_HIDDEN(_wc_mldsa_ntt_full_avx2) .p2align 4 _wc_mldsa_ntt_full_avx2: #endif /* __APPLE__ */ @@ -9679,12 +9685,14 @@ _wc_mldsa_ntt_small_full_avx2: #ifndef __APPLE__ .text .globl wc_mldsa_invntt_avx2 +WC_ASM_ATT_HIDDEN(wc_mldsa_invntt_avx2) .type wc_mldsa_invntt_avx2,@function .align 16 wc_mldsa_invntt_avx2: #else .section __TEXT,__text .globl _wc_mldsa_invntt_avx2 +WC_ASM_ATT_HIDDEN(_wc_mldsa_invntt_avx2) .p2align 4 _wc_mldsa_invntt_avx2: #endif /* __APPLE__ */ @@ -12221,12 +12229,14 @@ _wc_mldsa_invntt_avx2: #ifndef __APPLE__ .text .globl wc_mldsa_invntt_full_avx2 +WC_ASM_ATT_HIDDEN(wc_mldsa_invntt_full_avx2) .type wc_mldsa_invntt_full_avx2,@function .align 16 wc_mldsa_invntt_full_avx2: #else .section __TEXT,__text .globl _wc_mldsa_invntt_full_avx2 +WC_ASM_ATT_HIDDEN(_wc_mldsa_invntt_full_avx2) .p2align 4 _wc_mldsa_invntt_full_avx2: #endif /* __APPLE__ */ @@ -14859,12 +14869,14 @@ _wc_mldsa_invntt_full_avx2: #ifndef __APPLE__ .text .globl wc_mldsa_mul_avx2 +WC_ASM_ATT_HIDDEN(wc_mldsa_mul_avx2) .type wc_mldsa_mul_avx2,@function .align 16 wc_mldsa_mul_avx2: #else .section __TEXT,__text .globl _wc_mldsa_mul_avx2 +WC_ASM_ATT_HIDDEN(_wc_mldsa_mul_avx2) .p2align 4 _wc_mldsa_mul_avx2: #endif /* __APPLE__ */ @@ -15391,12 +15403,14 @@ _wc_mldsa_mul_avx2: #ifndef __APPLE__ .text .globl wc_mldsa_mul_vec_4_avx2 +WC_ASM_ATT_HIDDEN(wc_mldsa_mul_vec_4_avx2) .type wc_mldsa_mul_vec_4_avx2,@function .align 16 wc_mldsa_mul_vec_4_avx2: #else .section __TEXT,__text .globl _wc_mldsa_mul_vec_4_avx2 +WC_ASM_ATT_HIDDEN(_wc_mldsa_mul_vec_4_avx2) .p2align 4 _wc_mldsa_mul_vec_4_avx2: #endif /* __APPLE__ */ @@ -16723,12 +16737,14 @@ _wc_mldsa_mul_vec_4_avx2: #ifndef __APPLE__ .text .globl wc_mldsa_mul_vec_5_avx2 +WC_ASM_ATT_HIDDEN(wc_mldsa_mul_vec_5_avx2) .type wc_mldsa_mul_vec_5_avx2,@function .align 16 wc_mldsa_mul_vec_5_avx2: #else .section __TEXT,__text .globl _wc_mldsa_mul_vec_5_avx2 +WC_ASM_ATT_HIDDEN(_wc_mldsa_mul_vec_5_avx2) .p2align 4 _wc_mldsa_mul_vec_5_avx2: #endif /* __APPLE__ */ @@ -18311,12 +18327,14 @@ _wc_mldsa_mul_vec_5_avx2: #ifndef __APPLE__ .text .globl wc_mldsa_mul_vec_7_avx2 +WC_ASM_ATT_HIDDEN(wc_mldsa_mul_vec_7_avx2) .type wc_mldsa_mul_vec_7_avx2,@function .align 16 wc_mldsa_mul_vec_7_avx2: #else .section __TEXT,__text .globl _wc_mldsa_mul_vec_7_avx2 +WC_ASM_ATT_HIDDEN(_wc_mldsa_mul_vec_7_avx2) .p2align 4 _wc_mldsa_mul_vec_7_avx2: #endif /* __APPLE__ */ @@ -20986,12 +21004,14 @@ L_mldsa_rej_ones: #ifndef __APPLE__ .text .globl wc_mldsa_rej_uniform_n_avx2 +WC_ASM_ATT_HIDDEN(wc_mldsa_rej_uniform_n_avx2) .type wc_mldsa_rej_uniform_n_avx2,@function .align 16 wc_mldsa_rej_uniform_n_avx2: #else .section __TEXT,__text .globl _wc_mldsa_rej_uniform_n_avx2 +WC_ASM_ATT_HIDDEN(_wc_mldsa_rej_uniform_n_avx2) .p2align 4 _wc_mldsa_rej_uniform_n_avx2: #endif /* __APPLE__ */ @@ -21524,12 +21544,14 @@ L_mldsa_rej_uniform_n_avx2_done_64: #ifndef __APPLE__ .text .globl wc_mldsa_rej_uniform_avx2 +WC_ASM_ATT_HIDDEN(wc_mldsa_rej_uniform_avx2) .type wc_mldsa_rej_uniform_avx2,@function .align 16 wc_mldsa_rej_uniform_avx2: #else .section __TEXT,__text .globl _wc_mldsa_rej_uniform_avx2 +WC_ASM_ATT_HIDDEN(_wc_mldsa_rej_uniform_avx2) .p2align 4 _wc_mldsa_rej_uniform_avx2: #endif /* __APPLE__ */ @@ -21916,12 +21938,14 @@ L_mldsa_extract_coeffs_eta2_nibble_table: #ifndef __APPLE__ .text .globl wc_mldsa_extract_coeffs_eta2_avx2 +WC_ASM_ATT_HIDDEN(wc_mldsa_extract_coeffs_eta2_avx2) .type wc_mldsa_extract_coeffs_eta2_avx2,@function .align 16 wc_mldsa_extract_coeffs_eta2_avx2: #else .section __TEXT,__text .globl _wc_mldsa_extract_coeffs_eta2_avx2 +WC_ASM_ATT_HIDDEN(_wc_mldsa_extract_coeffs_eta2_avx2) .p2align 4 _wc_mldsa_extract_coeffs_eta2_avx2: #endif /* __APPLE__ */ @@ -22554,12 +22578,14 @@ L_mldsa_extract_coeffs_eta4_four: #ifndef __APPLE__ .text .globl wc_mldsa_extract_coeffs_eta4_avx2 +WC_ASM_ATT_HIDDEN(wc_mldsa_extract_coeffs_eta4_avx2) .type wc_mldsa_extract_coeffs_eta4_avx2,@function .align 16 wc_mldsa_extract_coeffs_eta4_avx2: #else .section __TEXT,__text .globl _wc_mldsa_extract_coeffs_eta4_avx2 +WC_ASM_ATT_HIDDEN(_wc_mldsa_extract_coeffs_eta4_avx2) .p2align 4 _wc_mldsa_extract_coeffs_eta4_avx2: #endif /* __APPLE__ */ @@ -23102,12 +23128,14 @@ L_mldsa_extract_coeffs_eta4_done: #ifndef __APPLE__ .text .globl wc_mldsa_redistribute_21_rand_avx2 +WC_ASM_ATT_HIDDEN(wc_mldsa_redistribute_21_rand_avx2) .type wc_mldsa_redistribute_21_rand_avx2,@function .align 16 wc_mldsa_redistribute_21_rand_avx2: #else .section __TEXT,__text .globl _wc_mldsa_redistribute_21_rand_avx2 +WC_ASM_ATT_HIDDEN(_wc_mldsa_redistribute_21_rand_avx2) .p2align 4 _wc_mldsa_redistribute_21_rand_avx2: #endif /* __APPLE__ */ @@ -23207,12 +23235,14 @@ _wc_mldsa_redistribute_21_rand_avx2: #ifndef __APPLE__ .text .globl wc_mldsa_redistribute_17_rand_avx2 +WC_ASM_ATT_HIDDEN(wc_mldsa_redistribute_17_rand_avx2) .type wc_mldsa_redistribute_17_rand_avx2,@function .align 16 wc_mldsa_redistribute_17_rand_avx2: #else .section __TEXT,__text .globl _wc_mldsa_redistribute_17_rand_avx2 +WC_ASM_ATT_HIDDEN(_wc_mldsa_redistribute_17_rand_avx2) .p2align 4 _wc_mldsa_redistribute_17_rand_avx2: #endif /* __APPLE__ */ @@ -23382,12 +23412,14 @@ L_mldsa_encode_eta_2_avx2_shuff_6_odd: #ifndef __APPLE__ .text .globl wc_mldsa_vec_encode_eta_2_avx2 +WC_ASM_ATT_HIDDEN(wc_mldsa_vec_encode_eta_2_avx2) .type wc_mldsa_vec_encode_eta_2_avx2,@function .align 16 wc_mldsa_vec_encode_eta_2_avx2: #else .section __TEXT,__text .globl _wc_mldsa_vec_encode_eta_2_avx2 +WC_ASM_ATT_HIDDEN(_wc_mldsa_vec_encode_eta_2_avx2) .p2align 4 _wc_mldsa_vec_encode_eta_2_avx2: #endif /* __APPLE__ */ @@ -23683,12 +23715,14 @@ L_mldsa_encode_eta_4_avx2_vs_4: #ifndef __APPLE__ .text .globl wc_mldsa_vec_encode_eta_4_avx2 +WC_ASM_ATT_HIDDEN(wc_mldsa_vec_encode_eta_4_avx2) .type wc_mldsa_vec_encode_eta_4_avx2,@function .align 16 wc_mldsa_vec_encode_eta_4_avx2: #else .section __TEXT,__text .globl _wc_mldsa_vec_encode_eta_4_avx2 +WC_ASM_ATT_HIDDEN(_wc_mldsa_vec_encode_eta_4_avx2) .p2align 4 _wc_mldsa_vec_encode_eta_4_avx2: #endif /* __APPLE__ */ @@ -24846,12 +24880,14 @@ L_mldsa_decode_eta_2_avx2_mask: #ifndef __APPLE__ .text .globl wc_mldsa_decode_eta_2_avx2 +WC_ASM_ATT_HIDDEN(wc_mldsa_decode_eta_2_avx2) .type wc_mldsa_decode_eta_2_avx2,@function .align 16 wc_mldsa_decode_eta_2_avx2: #else .section __TEXT,__text .globl _wc_mldsa_decode_eta_2_avx2 +WC_ASM_ATT_HIDDEN(_wc_mldsa_decode_eta_2_avx2) .p2align 4 _wc_mldsa_decode_eta_2_avx2: #endif /* __APPLE__ */ @@ -25242,12 +25278,14 @@ L_mldsa_decode_eta_4_avx2_mask: #ifndef __APPLE__ .text .globl wc_mldsa_decode_eta_4_avx2 +WC_ASM_ATT_HIDDEN(wc_mldsa_decode_eta_4_avx2) .type wc_mldsa_decode_eta_4_avx2,@function .align 16 wc_mldsa_decode_eta_4_avx2: #else .section __TEXT,__text .globl _wc_mldsa_decode_eta_4_avx2 +WC_ASM_ATT_HIDDEN(_wc_mldsa_decode_eta_4_avx2) .p2align 4 _wc_mldsa_decode_eta_4_avx2: #endif /* __APPLE__ */ @@ -25496,12 +25534,14 @@ L_mldsa_encode_w1_88_avx2_vs: #ifndef __APPLE__ .text .globl wc_mldsa_encode_w1_88_avx2 +WC_ASM_ATT_HIDDEN(wc_mldsa_encode_w1_88_avx2) .type wc_mldsa_encode_w1_88_avx2,@function .align 16 wc_mldsa_encode_w1_88_avx2: #else .section __TEXT,__text .globl _wc_mldsa_encode_w1_88_avx2 +WC_ASM_ATT_HIDDEN(_wc_mldsa_encode_w1_88_avx2) .p2align 4 _wc_mldsa_encode_w1_88_avx2: #endif /* __APPLE__ */ @@ -25788,12 +25828,14 @@ L_mldsa_encode_w1_32_avx2_vs_4: #ifndef __APPLE__ .text .globl wc_mldsa_encode_w1_32_avx2 +WC_ASM_ATT_HIDDEN(wc_mldsa_encode_w1_32_avx2) .type wc_mldsa_encode_w1_32_avx2,@function .align 16 wc_mldsa_encode_w1_32_avx2: #else .section __TEXT,__text .globl _wc_mldsa_encode_w1_32_avx2 +WC_ASM_ATT_HIDDEN(_wc_mldsa_encode_w1_32_avx2) .p2align 4 _wc_mldsa_encode_w1_32_avx2: #endif /* __APPLE__ */ @@ -26051,12 +26093,14 @@ L_mldsa_encode_t0_t1_avx2_shuff_10_odd: #ifndef __APPLE__ .text .globl wc_mldsa_vec_encode_t0_t1_avx2 +WC_ASM_ATT_HIDDEN(wc_mldsa_vec_encode_t0_t1_avx2) .type wc_mldsa_vec_encode_t0_t1_avx2,@function .align 16 wc_mldsa_vec_encode_t0_t1_avx2: #else .section __TEXT,__text .globl _wc_mldsa_vec_encode_t0_t1_avx2 +WC_ASM_ATT_HIDDEN(_wc_mldsa_vec_encode_t0_t1_avx2) .p2align 4 _wc_mldsa_vec_encode_t0_t1_avx2: #endif /* __APPLE__ */ @@ -26943,12 +26987,14 @@ L_mldsa_decode_t0_avx2_d_max_half: #ifndef __APPLE__ .text .globl wc_mldsa_decode_t0_avx2 +WC_ASM_ATT_HIDDEN(wc_mldsa_decode_t0_avx2) .type wc_mldsa_decode_t0_avx2,@function .align 16 wc_mldsa_decode_t0_avx2: #else .section __TEXT,__text .globl _wc_mldsa_decode_t0_avx2 +WC_ASM_ATT_HIDDEN(_wc_mldsa_decode_t0_avx2) .p2align 4 _wc_mldsa_decode_t0_avx2: #endif /* __APPLE__ */ @@ -27307,12 +27353,14 @@ L_mldsa_decode_t1_avx2_mask: #ifndef __APPLE__ .text .globl wc_mldsa_decode_t1_avx2 +WC_ASM_ATT_HIDDEN(wc_mldsa_decode_t1_avx2) .type wc_mldsa_decode_t1_avx2,@function .align 16 wc_mldsa_decode_t1_avx2: #else .section __TEXT,__text .globl _wc_mldsa_decode_t1_avx2 +WC_ASM_ATT_HIDDEN(_wc_mldsa_decode_t1_avx2) .p2align 4 _wc_mldsa_decode_t1_avx2: #endif /* __APPLE__ */ @@ -27672,12 +27720,14 @@ L_mldsa_decode_gamma1_17_avx2_gamma17: #ifndef __APPLE__ .text .globl wc_mldsa_decode_gamma1_17_avx2 +WC_ASM_ATT_HIDDEN(wc_mldsa_decode_gamma1_17_avx2) .type wc_mldsa_decode_gamma1_17_avx2,@function .align 16 wc_mldsa_decode_gamma1_17_avx2: #else .section __TEXT,__text .globl _wc_mldsa_decode_gamma1_17_avx2 +WC_ASM_ATT_HIDDEN(_wc_mldsa_decode_gamma1_17_avx2) .p2align 4 _wc_mldsa_decode_gamma1_17_avx2: #endif /* __APPLE__ */ @@ -28023,12 +28073,14 @@ L_mldsa_decode_gamma1_20_avx2_gamma19: #ifndef __APPLE__ .text .globl wc_mldsa_decode_gamma1_19_avx2 +WC_ASM_ATT_HIDDEN(wc_mldsa_decode_gamma1_19_avx2) .type wc_mldsa_decode_gamma1_19_avx2,@function .align 16 wc_mldsa_decode_gamma1_19_avx2: #else .section __TEXT,__text .globl _wc_mldsa_decode_gamma1_19_avx2 +WC_ASM_ATT_HIDDEN(_wc_mldsa_decode_gamma1_19_avx2) .p2align 4 _wc_mldsa_decode_gamma1_19_avx2: #endif /* __APPLE__ */ @@ -28361,12 +28413,14 @@ L_mldsa_encode_gamma1_17_avx2_vs: #ifndef __APPLE__ .text .globl wc_mldsa_encode_gamma1_17_avx2 +WC_ASM_ATT_HIDDEN(wc_mldsa_encode_gamma1_17_avx2) .type wc_mldsa_encode_gamma1_17_avx2,@function .align 16 wc_mldsa_encode_gamma1_17_avx2: #else .section __TEXT,__text .globl _wc_mldsa_encode_gamma1_17_avx2 +WC_ASM_ATT_HIDDEN(_wc_mldsa_encode_gamma1_17_avx2) .p2align 4 _wc_mldsa_encode_gamma1_17_avx2: #endif /* __APPLE__ */ @@ -28823,12 +28877,14 @@ L_mldsa_encode_gamma1_19_avx2_vs: #ifndef __APPLE__ .text .globl wc_mldsa_encode_gamma1_19_avx2 +WC_ASM_ATT_HIDDEN(wc_mldsa_encode_gamma1_19_avx2) .type wc_mldsa_encode_gamma1_19_avx2,@function .align 16 wc_mldsa_encode_gamma1_19_avx2: #else .section __TEXT,__text .globl _wc_mldsa_encode_gamma1_19_avx2 +WC_ASM_ATT_HIDDEN(_wc_mldsa_encode_gamma1_19_avx2) .p2align 4 _wc_mldsa_encode_gamma1_19_avx2: #endif /* __APPLE__ */ @@ -29281,12 +29337,14 @@ L_mldsa_decompose_q88_avx2_44: #ifndef __APPLE__ .text .globl wc_mldsa_decompose_q88_avx2 +WC_ASM_ATT_HIDDEN(wc_mldsa_decompose_q88_avx2) .type wc_mldsa_decompose_q88_avx2,@function .align 16 wc_mldsa_decompose_q88_avx2: #else .section __TEXT,__text .globl _wc_mldsa_decompose_q88_avx2 +WC_ASM_ATT_HIDDEN(_wc_mldsa_decompose_q88_avx2) .p2align 4 _wc_mldsa_decompose_q88_avx2: #endif /* __APPLE__ */ @@ -31534,12 +31592,14 @@ L_mldsa_decompose_q32_avx2_mask: #ifndef __APPLE__ .text .globl wc_mldsa_decompose_q32_avx2 +WC_ASM_ATT_HIDDEN(wc_mldsa_decompose_q32_avx2) .type wc_mldsa_decompose_q32_avx2,@function .align 16 wc_mldsa_decompose_q32_avx2: #else .section __TEXT,__text .globl _wc_mldsa_decompose_q32_avx2 +WC_ASM_ATT_HIDDEN(_wc_mldsa_decompose_q32_avx2) .p2align 4 _wc_mldsa_decompose_q32_avx2: #endif /* __APPLE__ */ @@ -32132,12 +32192,14 @@ L_mldsa_use_hint_88_avx2_one: #ifndef __APPLE__ .text .globl wc_mldsa_use_hint_88_avx2 +WC_ASM_ATT_HIDDEN(wc_mldsa_use_hint_88_avx2) .type wc_mldsa_use_hint_88_avx2,@function .align 16 wc_mldsa_use_hint_88_avx2: #else .section __TEXT,__text .globl _wc_mldsa_use_hint_88_avx2 +WC_ASM_ATT_HIDDEN(_wc_mldsa_use_hint_88_avx2) .p2align 4 _wc_mldsa_use_hint_88_avx2: #endif /* __APPLE__ */ @@ -37758,12 +37820,14 @@ L_mldsa_use_hint_32_avx2_one: #ifndef __APPLE__ .text .globl wc_mldsa_use_hint_32_avx2 +WC_ASM_ATT_HIDDEN(wc_mldsa_use_hint_32_avx2) .type wc_mldsa_use_hint_32_avx2,@function .align 16 wc_mldsa_use_hint_32_avx2: #else .section __TEXT,__text .globl _wc_mldsa_use_hint_32_avx2 +WC_ASM_ATT_HIDDEN(_wc_mldsa_use_hint_32_avx2) .p2align 4 _wc_mldsa_use_hint_32_avx2: #endif /* __APPLE__ */ @@ -38980,12 +39044,14 @@ L_mldsa_use_hint_32_avx2_hints_done__15: #ifndef __APPLE__ .text .globl wc_mldsa_vec_check_low_avx2 +WC_ASM_ATT_HIDDEN(wc_mldsa_vec_check_low_avx2) .type wc_mldsa_vec_check_low_avx2,@function .align 16 wc_mldsa_vec_check_low_avx2: #else .section __TEXT,__text .globl _wc_mldsa_vec_check_low_avx2 +WC_ASM_ATT_HIDDEN(_wc_mldsa_vec_check_low_avx2) .p2align 4 _wc_mldsa_vec_check_low_avx2: #endif /* __APPLE__ */ @@ -39217,12 +39283,14 @@ L_mldsa_vec_check_low_vx2_done: #ifndef __APPLE__ .text .globl wc_mldsa_poly_add_avx2 +WC_ASM_ATT_HIDDEN(wc_mldsa_poly_add_avx2) .type wc_mldsa_poly_add_avx2,@function .align 16 wc_mldsa_poly_add_avx2: #else .section __TEXT,__text .globl _wc_mldsa_poly_add_avx2 +WC_ASM_ATT_HIDDEN(_wc_mldsa_poly_add_avx2) .p2align 4 _wc_mldsa_poly_add_avx2: #endif /* __APPLE__ */ @@ -39361,12 +39429,14 @@ _wc_mldsa_poly_add_avx2: #ifndef __APPLE__ .text .globl wc_mldsa_poly_sub_avx2 +WC_ASM_ATT_HIDDEN(wc_mldsa_poly_sub_avx2) .type wc_mldsa_poly_sub_avx2,@function .align 16 wc_mldsa_poly_sub_avx2: #else .section __TEXT,__text .globl _wc_mldsa_poly_sub_avx2 +WC_ASM_ATT_HIDDEN(_wc_mldsa_poly_sub_avx2) .p2align 4 _wc_mldsa_poly_sub_avx2: #endif /* __APPLE__ */ @@ -39505,12 +39575,14 @@ _wc_mldsa_poly_sub_avx2: #ifndef __APPLE__ .text .globl wc_mldsa_poly_make_pos_avx2 +WC_ASM_ATT_HIDDEN(wc_mldsa_poly_make_pos_avx2) .type wc_mldsa_poly_make_pos_avx2,@function .align 16 wc_mldsa_poly_make_pos_avx2: #else .section __TEXT,__text .globl _wc_mldsa_poly_make_pos_avx2 +WC_ASM_ATT_HIDDEN(_wc_mldsa_poly_make_pos_avx2) .p2align 4 _wc_mldsa_poly_make_pos_avx2: #endif /* __APPLE__ */ diff --git a/wolfcrypt/src/wc_mlkem_asm.S b/wolfcrypt/src/wc_mlkem_asm.S index 3883f6927a4..5c1c9a307f2 100644 --- a/wolfcrypt/src/wc_mlkem_asm.S +++ b/wolfcrypt/src/wc_mlkem_asm.S @@ -494,12 +494,14 @@ L_mlkem_avx2_zetas_inv: #ifndef __APPLE__ .text .globl mlkem_keygen_avx2 +WC_ASM_ATT_HIDDEN(mlkem_keygen_avx2) .type mlkem_keygen_avx2,@function .align 16 mlkem_keygen_avx2: #else .section __TEXT,__text .globl _mlkem_keygen_avx2 +WC_ASM_ATT_HIDDEN(_mlkem_keygen_avx2) .p2align 4 _mlkem_keygen_avx2: #endif /* __APPLE__ */ @@ -3153,12 +3155,14 @@ L_mlkem_keygen_avx2_to_mont_ntt_err: #ifndef __APPLE__ .text .globl mlkem_encapsulate_avx2 +WC_ASM_ATT_HIDDEN(mlkem_encapsulate_avx2) .type mlkem_encapsulate_avx2,@function .align 16 mlkem_encapsulate_avx2: #else .section __TEXT,__text .globl _mlkem_encapsulate_avx2 +WC_ASM_ATT_HIDDEN(_mlkem_encapsulate_avx2) .p2align 4 _mlkem_encapsulate_avx2: #endif /* __APPLE__ */ @@ -7963,12 +7967,14 @@ L_pointwise_acc_mont_end_encap_v: #ifndef __APPLE__ .text .globl mlkem_decapsulate_avx2 +WC_ASM_ATT_HIDDEN(mlkem_decapsulate_avx2) .type mlkem_decapsulate_avx2,@function .align 16 mlkem_decapsulate_avx2: #else .section __TEXT,__text .globl _mlkem_decapsulate_avx2 +WC_ASM_ATT_HIDDEN(_mlkem_decapsulate_avx2) .p2align 4 _mlkem_decapsulate_avx2: #endif /* __APPLE__ */ @@ -10712,12 +10718,14 @@ L_pointwise_acc_mont_end_decap: #ifndef __APPLE__ .text .globl mlkem_csubq_avx2 +WC_ASM_ATT_HIDDEN(mlkem_csubq_avx2) .type mlkem_csubq_avx2,@function .align 16 mlkem_csubq_avx2: #else .section __TEXT,__text .globl _mlkem_csubq_avx2 +WC_ASM_ATT_HIDDEN(_mlkem_csubq_avx2) .p2align 4 _mlkem_csubq_avx2: #endif /* __APPLE__ */ @@ -11017,12 +11025,14 @@ L_mlkem_rej_shuffle: #ifndef __APPLE__ .text .globl mlkem_rej_uniform_n_avx2 +WC_ASM_ATT_HIDDEN(mlkem_rej_uniform_n_avx2) .type mlkem_rej_uniform_n_avx2,@function .align 16 mlkem_rej_uniform_n_avx2: #else .section __TEXT,__text .globl _mlkem_rej_uniform_n_avx2 +WC_ASM_ATT_HIDDEN(_mlkem_rej_uniform_n_avx2) .p2align 4 _mlkem_rej_uniform_n_avx2: #endif /* __APPLE__ */ @@ -11632,12 +11642,14 @@ L_mlkem_rej_uniform_n_avx2_done_64: #ifndef __APPLE__ .text .globl mlkem_rej_uniform_avx2 +WC_ASM_ATT_HIDDEN(mlkem_rej_uniform_avx2) .type mlkem_rej_uniform_avx2,@function .align 16 mlkem_rej_uniform_avx2: #else .section __TEXT,__text .globl _mlkem_rej_uniform_avx2 +WC_ASM_ATT_HIDDEN(_mlkem_rej_uniform_avx2) .p2align 4 _mlkem_rej_uniform_avx2: #endif /* __APPLE__ */ @@ -12032,12 +12044,14 @@ L_mlkem_shuff: #ifndef __APPLE__ .text .globl mlkem_cbd_eta3_avx2 +WC_ASM_ATT_HIDDEN(mlkem_cbd_eta3_avx2) .type mlkem_cbd_eta3_avx2,@function .align 16 mlkem_cbd_eta3_avx2: #else .section __TEXT,__text .globl _mlkem_cbd_eta3_avx2 +WC_ASM_ATT_HIDDEN(_mlkem_cbd_eta3_avx2) .p2align 4 _mlkem_cbd_eta3_avx2: #endif /* __APPLE__ */ @@ -12347,12 +12361,14 @@ L_mlkem_mask_0f: #ifndef __APPLE__ .text .globl mlkem_cbd_eta2_avx2 +WC_ASM_ATT_HIDDEN(mlkem_cbd_eta2_avx2) .type mlkem_cbd_eta2_avx2,@function .align 16 mlkem_cbd_eta2_avx2: #else .section __TEXT,__text .globl _mlkem_cbd_eta2_avx2 +WC_ASM_ATT_HIDDEN(_mlkem_cbd_eta2_avx2) .p2align 4 _mlkem_cbd_eta2_avx2: #endif /* __APPLE__ */ @@ -12569,12 +12585,14 @@ L_mlkem_compress_10_avx2_shift12: #ifndef __APPLE__ .text .globl mlkem_compress_10_avx2 +WC_ASM_ATT_HIDDEN(mlkem_compress_10_avx2) .type mlkem_compress_10_avx2,@function .align 16 mlkem_compress_10_avx2: #else .section __TEXT,__text .globl _mlkem_compress_10_avx2 +WC_ASM_ATT_HIDDEN(_mlkem_compress_10_avx2) .p2align 4 _mlkem_compress_10_avx2: #endif /* __APPLE__ */ @@ -12958,12 +12976,14 @@ L_mlkem_decompress_10_avx2_shuf: #ifndef __APPLE__ .text .globl mlkem_decompress_10_avx2 +WC_ASM_ATT_HIDDEN(mlkem_decompress_10_avx2) .type mlkem_decompress_10_avx2,@function .align 16 mlkem_decompress_10_avx2: #else .section __TEXT,__text .globl _mlkem_decompress_10_avx2 +WC_ASM_ATT_HIDDEN(_mlkem_decompress_10_avx2) .p2align 4 _mlkem_decompress_10_avx2: #endif /* __APPLE__ */ @@ -13202,12 +13222,14 @@ L_mlkem_compress_11_avx2_shuf: #ifndef __APPLE__ .text .globl mlkem_compress_11_avx2 +WC_ASM_ATT_HIDDEN(mlkem_compress_11_avx2) .type mlkem_compress_11_avx2,@function .align 16 mlkem_compress_11_avx2: #else .section __TEXT,__text .globl _mlkem_compress_11_avx2 +WC_ASM_ATT_HIDDEN(_mlkem_compress_11_avx2) .p2align 4 _mlkem_compress_11_avx2: #endif /* __APPLE__ */ @@ -13666,12 +13688,14 @@ L_mlkem_decompress_11_avx2_mask: #ifndef __APPLE__ .text .globl mlkem_decompress_11_avx2 +WC_ASM_ATT_HIDDEN(mlkem_decompress_11_avx2) .type mlkem_decompress_11_avx2,@function .align 16 mlkem_decompress_11_avx2: #else .section __TEXT,__text .globl _mlkem_decompress_11_avx2 +WC_ASM_ATT_HIDDEN(_mlkem_decompress_11_avx2) .p2align 4 _mlkem_decompress_11_avx2: #endif /* __APPLE__ */ @@ -13903,12 +13927,14 @@ L_mlkem_compress_4_avx2_shift12: #ifndef __APPLE__ .text .globl mlkem_compress_4_avx2 +WC_ASM_ATT_HIDDEN(mlkem_compress_4_avx2) .type mlkem_compress_4_avx2,@function .align 16 mlkem_compress_4_avx2: #else .section __TEXT,__text .globl _mlkem_compress_4_avx2 +WC_ASM_ATT_HIDDEN(_mlkem_compress_4_avx2) .p2align 4 _mlkem_compress_4_avx2: #endif /* __APPLE__ */ @@ -14055,12 +14081,14 @@ L_mlkem_decompress_4_avx2_shuf: #ifndef __APPLE__ .text .globl mlkem_decompress_4_avx2 +WC_ASM_ATT_HIDDEN(mlkem_decompress_4_avx2) .type mlkem_decompress_4_avx2,@function .align 16 mlkem_decompress_4_avx2: #else .section __TEXT,__text .globl _mlkem_decompress_4_avx2 +WC_ASM_ATT_HIDDEN(_mlkem_decompress_4_avx2) .p2align 4 _mlkem_decompress_4_avx2: #endif /* __APPLE__ */ @@ -14265,12 +14293,14 @@ L_mlkem_compress_5_avx2_shuffle: #ifndef __APPLE__ .text .globl mlkem_compress_5_avx2 +WC_ASM_ATT_HIDDEN(mlkem_compress_5_avx2) .type mlkem_compress_5_avx2,@function .align 16 mlkem_compress_5_avx2: #else .section __TEXT,__text .globl _mlkem_compress_5_avx2 +WC_ASM_ATT_HIDDEN(_mlkem_compress_5_avx2) .p2align 4 _mlkem_compress_5_avx2: #endif /* __APPLE__ */ @@ -14472,12 +14502,14 @@ L_mlkem_decompress_5_avx2_shift: #ifndef __APPLE__ .text .globl mlkem_decompress_5_avx2 +WC_ASM_ATT_HIDDEN(mlkem_decompress_5_avx2) .type mlkem_decompress_5_avx2,@function .align 16 mlkem_decompress_5_avx2: #else .section __TEXT,__text .globl _mlkem_decompress_5_avx2 +WC_ASM_ATT_HIDDEN(_mlkem_decompress_5_avx2) .p2align 4 _mlkem_decompress_5_avx2: #endif /* __APPLE__ */ @@ -14633,12 +14665,14 @@ L_mlkem_from_msg_avx2_hqs: #ifndef __APPLE__ .text .globl mlkem_from_msg_avx2 +WC_ASM_ATT_HIDDEN(mlkem_from_msg_avx2) .type mlkem_from_msg_avx2,@function .align 16 mlkem_from_msg_avx2: #else .section __TEXT,__text .globl _mlkem_from_msg_avx2 +WC_ASM_ATT_HIDDEN(_mlkem_from_msg_avx2) .p2align 4 _mlkem_from_msg_avx2: #endif /* __APPLE__ */ @@ -14784,12 +14818,14 @@ L_mlkem_to_msg_avx2_hhqs: #ifndef __APPLE__ .text .globl mlkem_to_msg_avx2 +WC_ASM_ATT_HIDDEN(mlkem_to_msg_avx2) .type mlkem_to_msg_avx2,@function .align 16 mlkem_to_msg_avx2: #else .section __TEXT,__text .globl _mlkem_to_msg_avx2 +WC_ASM_ATT_HIDDEN(_mlkem_to_msg_avx2) .p2align 4 _mlkem_to_msg_avx2: #endif /* __APPLE__ */ @@ -14927,12 +14963,14 @@ L_mlkem_from_bytes_avx2_mask: #ifndef __APPLE__ .text .globl mlkem_from_bytes_avx2 +WC_ASM_ATT_HIDDEN(mlkem_from_bytes_avx2) .type mlkem_from_bytes_avx2,@function .align 16 mlkem_from_bytes_avx2: #else .section __TEXT,__text .globl _mlkem_from_bytes_avx2 +WC_ASM_ATT_HIDDEN(_mlkem_from_bytes_avx2) .p2align 4 _mlkem_from_bytes_avx2: #endif /* __APPLE__ */ @@ -15128,12 +15166,14 @@ L_mlkem_to_bytes_avx2_perm: #ifndef __APPLE__ .text .globl mlkem_to_bytes_avx2 +WC_ASM_ATT_HIDDEN(mlkem_to_bytes_avx2) .type mlkem_to_bytes_avx2,@function .align 16 mlkem_to_bytes_avx2: #else .section __TEXT,__text .globl _mlkem_to_bytes_avx2 +WC_ASM_ATT_HIDDEN(_mlkem_to_bytes_avx2) .p2align 4 _mlkem_to_bytes_avx2: #endif /* __APPLE__ */ @@ -15369,12 +15409,14 @@ _mlkem_to_bytes_avx2: #ifndef __APPLE__ .text .globl mlkem_cmp_avx2 +WC_ASM_ATT_HIDDEN(mlkem_cmp_avx2) .type mlkem_cmp_avx2,@function .align 16 mlkem_cmp_avx2: #else .section __TEXT,__text .globl _mlkem_cmp_avx2 +WC_ASM_ATT_HIDDEN(_mlkem_cmp_avx2) .p2align 4 _mlkem_cmp_avx2: #endif /* __APPLE__ */ @@ -15546,12 +15588,14 @@ L_mlkem_cmp_avx2_done: #ifndef __APPLE__ .text .globl mlkem_redistribute_21_rand_avx2 +WC_ASM_ATT_HIDDEN(mlkem_redistribute_21_rand_avx2) .type mlkem_redistribute_21_rand_avx2,@function .align 16 mlkem_redistribute_21_rand_avx2: #else .section __TEXT,__text .globl _mlkem_redistribute_21_rand_avx2 +WC_ASM_ATT_HIDDEN(_mlkem_redistribute_21_rand_avx2) .p2align 4 _mlkem_redistribute_21_rand_avx2: #endif /* __APPLE__ */ @@ -15651,12 +15695,14 @@ _mlkem_redistribute_21_rand_avx2: #ifndef __APPLE__ .text .globl mlkem_redistribute_17_rand_avx2 +WC_ASM_ATT_HIDDEN(mlkem_redistribute_17_rand_avx2) .type mlkem_redistribute_17_rand_avx2,@function .align 16 mlkem_redistribute_17_rand_avx2: #else .section __TEXT,__text .globl _mlkem_redistribute_17_rand_avx2 +WC_ASM_ATT_HIDDEN(_mlkem_redistribute_17_rand_avx2) .p2align 4 _mlkem_redistribute_17_rand_avx2: #endif /* __APPLE__ */ @@ -15740,12 +15786,14 @@ _mlkem_redistribute_17_rand_avx2: #ifndef __APPLE__ .text .globl mlkem_redistribute_16_rand_avx2 +WC_ASM_ATT_HIDDEN(mlkem_redistribute_16_rand_avx2) .type mlkem_redistribute_16_rand_avx2,@function .align 16 mlkem_redistribute_16_rand_avx2: #else .section __TEXT,__text .globl _mlkem_redistribute_16_rand_avx2 +WC_ASM_ATT_HIDDEN(_mlkem_redistribute_16_rand_avx2) .p2align 4 _mlkem_redistribute_16_rand_avx2: #endif /* __APPLE__ */ @@ -15821,12 +15869,14 @@ _mlkem_redistribute_16_rand_avx2: #ifndef __APPLE__ .text .globl mlkem_redistribute_8_rand_avx2 +WC_ASM_ATT_HIDDEN(mlkem_redistribute_8_rand_avx2) .type mlkem_redistribute_8_rand_avx2,@function .align 16 mlkem_redistribute_8_rand_avx2: #else .section __TEXT,__text .globl _mlkem_redistribute_8_rand_avx2 +WC_ASM_ATT_HIDDEN(_mlkem_redistribute_8_rand_avx2) .p2align 4 _mlkem_redistribute_8_rand_avx2: #endif /* __APPLE__ */ @@ -16295,12 +16345,14 @@ L_mlkem_avx512_zetas_inv: #ifndef __APPLE__ .text .globl mlkem_keygen_avx512 +WC_ASM_ATT_HIDDEN(mlkem_keygen_avx512) .type mlkem_keygen_avx512,@function .align 16 mlkem_keygen_avx512: #else .section __TEXT,__text .globl _mlkem_keygen_avx512 +WC_ASM_ATT_HIDDEN(_mlkem_keygen_avx512) .p2align 4 _mlkem_keygen_avx512: #endif /* __APPLE__ */ @@ -19948,12 +20000,14 @@ L_keygen_avx512_err_done: #ifndef __APPLE__ .text .globl mlkem_encapsulate_avx512 +WC_ASM_ATT_HIDDEN(mlkem_encapsulate_avx512) .type mlkem_encapsulate_avx512,@function .align 16 mlkem_encapsulate_avx512: #else .section __TEXT,__text .globl _mlkem_encapsulate_avx512 +WC_ASM_ATT_HIDDEN(_mlkem_encapsulate_avx512) .p2align 4 _mlkem_encapsulate_avx512: #endif /* __APPLE__ */ @@ -26718,12 +26772,14 @@ L_encap_avx512_calc_done: #ifndef __APPLE__ .text .globl mlkem_decapsulate_avx512 +WC_ASM_ATT_HIDDEN(mlkem_decapsulate_avx512) .type mlkem_decapsulate_avx512,@function .align 16 mlkem_decapsulate_avx512: #else .section __TEXT,__text .globl _mlkem_decapsulate_avx512 +WC_ASM_ATT_HIDDEN(_mlkem_decapsulate_avx512) .p2align 4 _mlkem_decapsulate_avx512: #endif /* __APPLE__ */ @@ -29665,12 +29721,14 @@ L_pointwise_acc_mont_end_decap_avx512: #ifndef __APPLE__ .text .globl mlkem_basemul_x2_avx512 +WC_ASM_ATT_HIDDEN(mlkem_basemul_x2_avx512) .type mlkem_basemul_x2_avx512,@function .align 16 mlkem_basemul_x2_avx512: #else .section __TEXT,__text .globl _mlkem_basemul_x2_avx512 +WC_ASM_ATT_HIDDEN(_mlkem_basemul_x2_avx512) .p2align 4 _mlkem_basemul_x2_avx512: #endif /* __APPLE__ */ @@ -29909,12 +29967,14 @@ _mlkem_basemul_x2_avx512: #ifndef __APPLE__ .text .globl mlkem_tomont_x2_avx512 +WC_ASM_ATT_HIDDEN(mlkem_tomont_x2_avx512) .type mlkem_tomont_x2_avx512,@function .align 16 mlkem_tomont_x2_avx512: #else .section __TEXT,__text .globl _mlkem_tomont_x2_avx512 +WC_ASM_ATT_HIDDEN(_mlkem_tomont_x2_avx512) .p2align 4 _mlkem_tomont_x2_avx512: #endif /* __APPLE__ */ @@ -29983,12 +30043,14 @@ _mlkem_tomont_x2_avx512: #ifndef __APPLE__ .text .globl mlkem_adderr_x2_avx512 +WC_ASM_ATT_HIDDEN(mlkem_adderr_x2_avx512) .type mlkem_adderr_x2_avx512,@function .align 16 mlkem_adderr_x2_avx512: #else .section __TEXT,__text .globl _mlkem_adderr_x2_avx512 +WC_ASM_ATT_HIDDEN(_mlkem_adderr_x2_avx512) .p2align 4 _mlkem_adderr_x2_avx512: #endif /* __APPLE__ */ @@ -30070,12 +30132,14 @@ _mlkem_adderr_x2_avx512: #ifndef __APPLE__ .text .globl mlkem_suberr_x2_avx512 +WC_ASM_ATT_HIDDEN(mlkem_suberr_x2_avx512) .type mlkem_suberr_x2_avx512,@function .align 16 mlkem_suberr_x2_avx512: #else .section __TEXT,__text .globl _mlkem_suberr_x2_avx512 +WC_ASM_ATT_HIDDEN(_mlkem_suberr_x2_avx512) .p2align 4 _mlkem_suberr_x2_avx512: #endif /* __APPLE__ */ @@ -30157,12 +30221,14 @@ _mlkem_suberr_x2_avx512: #ifndef __APPLE__ .text .globl mlkem_ptacc_x2_avx512 +WC_ASM_ATT_HIDDEN(mlkem_ptacc_x2_avx512) .type mlkem_ptacc_x2_avx512,@function .align 16 mlkem_ptacc_x2_avx512: #else .section __TEXT,__text .globl _mlkem_ptacc_x2_avx512 +WC_ASM_ATT_HIDDEN(_mlkem_ptacc_x2_avx512) .p2align 4 _mlkem_ptacc_x2_avx512: #endif /* __APPLE__ */ @@ -30924,12 +30990,14 @@ L_mlkem_cbd_eta2_avx512_m0f: #ifndef __APPLE__ .text .globl mlkem_cbd_eta2_avx512 +WC_ASM_ATT_HIDDEN(mlkem_cbd_eta2_avx512) .type mlkem_cbd_eta2_avx512,@function .align 16 mlkem_cbd_eta2_avx512: #else .section __TEXT,__text .globl _mlkem_cbd_eta2_avx512 +WC_ASM_ATT_HIDDEN(_mlkem_cbd_eta2_avx512) .p2align 4 _mlkem_cbd_eta2_avx512: #endif /* __APPLE__ */ @@ -31117,12 +31185,14 @@ L_mlkem_cbd_eta3_avx512_shuff: #ifndef __APPLE__ .text .globl mlkem_cbd_eta3_avx512 +WC_ASM_ATT_HIDDEN(mlkem_cbd_eta3_avx512) .type mlkem_cbd_eta3_avx512,@function .align 16 mlkem_cbd_eta3_avx512: #else .section __TEXT,__text .globl _mlkem_cbd_eta3_avx512 +WC_ASM_ATT_HIDDEN(_mlkem_cbd_eta3_avx512) .p2align 4 _mlkem_cbd_eta3_avx512: #endif /* __APPLE__ */ @@ -31345,12 +31415,14 @@ L_mlkem_rej_uniform_avx512_mask: #ifndef __APPLE__ .text .globl mlkem_rej_uniform_avx512 +WC_ASM_ATT_HIDDEN(mlkem_rej_uniform_avx512) .type mlkem_rej_uniform_avx512,@function .align 16 mlkem_rej_uniform_avx512: #else .section __TEXT,__text .globl _mlkem_rej_uniform_avx512 +WC_ASM_ATT_HIDDEN(_mlkem_rej_uniform_avx512) .p2align 4 _mlkem_rej_uniform_avx512: #endif /* __APPLE__ */ @@ -31480,12 +31552,14 @@ L_mlkem_rej_uniform_n_avx512_mask: #ifndef __APPLE__ .text .globl mlkem_rej_uniform_n_avx512 +WC_ASM_ATT_HIDDEN(mlkem_rej_uniform_n_avx512) .type mlkem_rej_uniform_n_avx512,@function .align 16 mlkem_rej_uniform_n_avx512: #else .section __TEXT,__text .globl _mlkem_rej_uniform_n_avx512 +WC_ASM_ATT_HIDDEN(_mlkem_rej_uniform_n_avx512) .p2align 4 _mlkem_rej_uniform_n_avx512: #endif /* __APPLE__ */ @@ -31626,12 +31700,14 @@ L_mlkem_redistribute_8_rand_avx512_idx3: #ifndef __APPLE__ .text .globl mlkem_redistribute_8_rand_avx512 +WC_ASM_ATT_HIDDEN(mlkem_redistribute_8_rand_avx512) .type mlkem_redistribute_8_rand_avx512,@function .align 16 mlkem_redistribute_8_rand_avx512: #else .section __TEXT,__text .globl _mlkem_redistribute_8_rand_avx512 +WC_ASM_ATT_HIDDEN(_mlkem_redistribute_8_rand_avx512) .p2align 4 _mlkem_redistribute_8_rand_avx512: #endif /* __APPLE__ */ @@ -31731,12 +31807,14 @@ L_mlkem_redistribute_16_rand_avx512_idx3: #ifndef __APPLE__ .text .globl mlkem_redistribute_16_rand_avx512 +WC_ASM_ATT_HIDDEN(mlkem_redistribute_16_rand_avx512) .type mlkem_redistribute_16_rand_avx512,@function .align 16 mlkem_redistribute_16_rand_avx512: #else .section __TEXT,__text .globl _mlkem_redistribute_16_rand_avx512 +WC_ASM_ATT_HIDDEN(_mlkem_redistribute_16_rand_avx512) .p2align 4 _mlkem_redistribute_16_rand_avx512: #endif /* __APPLE__ */ @@ -31864,12 +31942,14 @@ L_mlkem_redistribute_17_rand_avx512_idx3: #ifndef __APPLE__ .text .globl mlkem_redistribute_17_rand_avx512 +WC_ASM_ATT_HIDDEN(mlkem_redistribute_17_rand_avx512) .type mlkem_redistribute_17_rand_avx512,@function .align 16 mlkem_redistribute_17_rand_avx512: #else .section __TEXT,__text .globl _mlkem_redistribute_17_rand_avx512 +WC_ASM_ATT_HIDDEN(_mlkem_redistribute_17_rand_avx512) .p2align 4 _mlkem_redistribute_17_rand_avx512: #endif /* __APPLE__ */ @@ -32005,12 +32085,14 @@ L_mlkem_redistribute_21_rand_avx512_idx3: #ifndef __APPLE__ .text .globl mlkem_redistribute_21_rand_avx512 +WC_ASM_ATT_HIDDEN(mlkem_redistribute_21_rand_avx512) .type mlkem_redistribute_21_rand_avx512,@function .align 16 mlkem_redistribute_21_rand_avx512: #else .section __TEXT,__text .globl _mlkem_redistribute_21_rand_avx512 +WC_ASM_ATT_HIDDEN(_mlkem_redistribute_21_rand_avx512) .p2align 4 _mlkem_redistribute_21_rand_avx512: #endif /* __APPLE__ */ @@ -32100,12 +32182,14 @@ _mlkem_redistribute_21_rand_avx512: #ifndef __APPLE__ .text .globl mlkem_redistribute_8_rand_x8_avx512 +WC_ASM_ATT_HIDDEN(mlkem_redistribute_8_rand_x8_avx512) .type mlkem_redistribute_8_rand_x8_avx512,@function .align 16 mlkem_redistribute_8_rand_x8_avx512: #else .section __TEXT,__text .globl _mlkem_redistribute_8_rand_x8_avx512 +WC_ASM_ATT_HIDDEN(_mlkem_redistribute_8_rand_x8_avx512) .p2align 4 _mlkem_redistribute_8_rand_x8_avx512: #endif /* __APPLE__ */ @@ -32178,12 +32262,14 @@ _mlkem_redistribute_8_rand_x8_avx512: #ifndef __APPLE__ .text .globl mlkem_redistribute_16_rand_x8_avx512 +WC_ASM_ATT_HIDDEN(mlkem_redistribute_16_rand_x8_avx512) .type mlkem_redistribute_16_rand_x8_avx512,@function .align 16 mlkem_redistribute_16_rand_x8_avx512: #else .section __TEXT,__text .globl _mlkem_redistribute_16_rand_x8_avx512 +WC_ASM_ATT_HIDDEN(_mlkem_redistribute_16_rand_x8_avx512) .p2align 4 _mlkem_redistribute_16_rand_x8_avx512: #endif /* __APPLE__ */ @@ -32296,12 +32382,14 @@ _mlkem_redistribute_16_rand_x8_avx512: #ifndef __APPLE__ .text .globl mlkem_redistribute_17_rand_x8_avx512 +WC_ASM_ATT_HIDDEN(mlkem_redistribute_17_rand_x8_avx512) .type mlkem_redistribute_17_rand_x8_avx512,@function .align 16 mlkem_redistribute_17_rand_x8_avx512: #else .section __TEXT,__text .globl _mlkem_redistribute_17_rand_x8_avx512 +WC_ASM_ATT_HIDDEN(_mlkem_redistribute_17_rand_x8_avx512) .p2align 4 _mlkem_redistribute_17_rand_x8_avx512: #endif /* __APPLE__ */ @@ -32430,12 +32518,14 @@ _mlkem_redistribute_17_rand_x8_avx512: #ifndef __APPLE__ .text .globl mlkem_redistribute_21_rand_x8_avx512 +WC_ASM_ATT_HIDDEN(mlkem_redistribute_21_rand_x8_avx512) .type mlkem_redistribute_21_rand_x8_avx512,@function .align 16 mlkem_redistribute_21_rand_x8_avx512: #else .section __TEXT,__text .globl _mlkem_redistribute_21_rand_x8_avx512 +WC_ASM_ATT_HIDDEN(_mlkem_redistribute_21_rand_x8_avx512) .p2align 4 _mlkem_redistribute_21_rand_x8_avx512: #endif /* __APPLE__ */ @@ -32628,12 +32718,14 @@ _mlkem_redistribute_21_rand_x8_avx512: #ifndef __APPLE__ .text .globl mlkem_csubq_avx512 +WC_ASM_ATT_HIDDEN(mlkem_csubq_avx512) .type mlkem_csubq_avx512,@function .align 16 mlkem_csubq_avx512: #else .section __TEXT,__text .globl _mlkem_csubq_avx512 +WC_ASM_ATT_HIDDEN(_mlkem_csubq_avx512) .p2align 4 _mlkem_csubq_avx512: #endif /* __APPLE__ */ @@ -32696,12 +32788,14 @@ _mlkem_csubq_avx512: #ifndef __APPLE__ .text .globl mlkem_cmp_avx512 +WC_ASM_ATT_HIDDEN(mlkem_cmp_avx512) .type mlkem_cmp_avx512,@function .align 16 mlkem_cmp_avx512: #else .section __TEXT,__text .globl _mlkem_cmp_avx512 +WC_ASM_ATT_HIDDEN(_mlkem_cmp_avx512) .p2align 4 _mlkem_cmp_avx512: #endif /* __APPLE__ */ @@ -32842,12 +32936,14 @@ L_mlkem_from_bytes_avx512_mask: #ifndef __APPLE__ .text .globl mlkem_from_bytes_avx512 +WC_ASM_ATT_HIDDEN(mlkem_from_bytes_avx512) .type mlkem_from_bytes_avx512,@function .align 16 mlkem_from_bytes_avx512: #else .section __TEXT,__text .globl _mlkem_from_bytes_avx512 +WC_ASM_ATT_HIDDEN(_mlkem_from_bytes_avx512) .p2align 4 _mlkem_from_bytes_avx512: #endif /* __APPLE__ */ @@ -32960,12 +33056,14 @@ L_mlkem_to_bytes_avx512_perm: #ifndef __APPLE__ .text .globl mlkem_to_bytes_avx512 +WC_ASM_ATT_HIDDEN(mlkem_to_bytes_avx512) .type mlkem_to_bytes_avx512,@function .align 16 mlkem_to_bytes_avx512: #else .section __TEXT,__text .globl _mlkem_to_bytes_avx512 +WC_ASM_ATT_HIDDEN(_mlkem_to_bytes_avx512) .p2align 4 _mlkem_to_bytes_avx512: #endif /* __APPLE__ */ @@ -33107,12 +33205,14 @@ L_mlkem_from_msg_avx512_pow: #ifndef __APPLE__ .text .globl mlkem_from_msg_avx512 +WC_ASM_ATT_HIDDEN(mlkem_from_msg_avx512) .type mlkem_from_msg_avx512,@function .align 16 mlkem_from_msg_avx512: #else .section __TEXT,__text .globl _mlkem_from_msg_avx512 +WC_ASM_ATT_HIDDEN(_mlkem_from_msg_avx512) .p2align 4 _mlkem_from_msg_avx512: #endif /* __APPLE__ */ @@ -33177,12 +33277,14 @@ _mlkem_from_msg_avx512: #ifndef __APPLE__ .text .globl mlkem_to_msg_avx512 +WC_ASM_ATT_HIDDEN(mlkem_to_msg_avx512) .type mlkem_to_msg_avx512,@function .align 16 mlkem_to_msg_avx512: #else .section __TEXT,__text .globl _mlkem_to_msg_avx512 +WC_ASM_ATT_HIDDEN(_mlkem_to_msg_avx512) .p2align 4 _mlkem_to_msg_avx512: #endif /* __APPLE__ */ @@ -33306,12 +33408,14 @@ L_mlkem_compress_4_avx512_perm: #ifndef __APPLE__ .text .globl mlkem_compress_4_avx512 +WC_ASM_ATT_HIDDEN(mlkem_compress_4_avx512) .type mlkem_compress_4_avx512,@function .align 16 mlkem_compress_4_avx512: #else .section __TEXT,__text .globl _mlkem_compress_4_avx512 +WC_ASM_ATT_HIDDEN(_mlkem_compress_4_avx512) .p2align 4 _mlkem_compress_4_avx512: #endif /* __APPLE__ */ @@ -33447,12 +33551,14 @@ L_mlkem_decompress_4_avx512_shift: #ifndef __APPLE__ .text .globl mlkem_decompress_4_avx512 +WC_ASM_ATT_HIDDEN(mlkem_decompress_4_avx512) .type mlkem_decompress_4_avx512,@function .align 16 mlkem_decompress_4_avx512: #else .section __TEXT,__text .globl _mlkem_decompress_4_avx512 +WC_ASM_ATT_HIDDEN(_mlkem_decompress_4_avx512) .p2align 4 _mlkem_decompress_4_avx512: #endif /* __APPLE__ */ @@ -33582,12 +33688,14 @@ L_mlkem_decompress_5_avx512_shift: #ifndef __APPLE__ .text .globl mlkem_decompress_5_avx512 +WC_ASM_ATT_HIDDEN(mlkem_decompress_5_avx512) .type mlkem_decompress_5_avx512,@function .align 16 mlkem_decompress_5_avx512: #else .section __TEXT,__text .globl _mlkem_decompress_5_avx512 +WC_ASM_ATT_HIDDEN(_mlkem_decompress_5_avx512) .p2align 4 _mlkem_decompress_5_avx512: #endif /* __APPLE__ */ @@ -33734,12 +33842,14 @@ L_mlkem_decompress_10_avx512_shuf: #ifndef __APPLE__ .text .globl mlkem_decompress_10_avx512 +WC_ASM_ATT_HIDDEN(mlkem_decompress_10_avx512) .type mlkem_decompress_10_avx512,@function .align 16 mlkem_decompress_10_avx512: #else .section __TEXT,__text .globl _mlkem_decompress_10_avx512 +WC_ASM_ATT_HIDDEN(_mlkem_decompress_10_avx512) .p2align 4 _mlkem_decompress_10_avx512: #endif /* __APPLE__ */ @@ -33926,12 +34036,14 @@ L_mlkem_decompress_11_avx512_mask: #ifndef __APPLE__ .text .globl mlkem_decompress_11_avx512 +WC_ASM_ATT_HIDDEN(mlkem_decompress_11_avx512) .type mlkem_decompress_11_avx512,@function .align 16 mlkem_decompress_11_avx512: #else .section __TEXT,__text .globl _mlkem_decompress_11_avx512 +WC_ASM_ATT_HIDDEN(_mlkem_decompress_11_avx512) .p2align 4 _mlkem_decompress_11_avx512: #endif /* __APPLE__ */ @@ -34096,12 +34208,14 @@ L_mlkem_compress_5_avx512_shuf: #ifndef __APPLE__ .text .globl mlkem_compress_5_avx512 +WC_ASM_ATT_HIDDEN(mlkem_compress_5_avx512) .type mlkem_compress_5_avx512,@function .align 16 mlkem_compress_5_avx512: #else .section __TEXT,__text .globl _mlkem_compress_5_avx512 +WC_ASM_ATT_HIDDEN(_mlkem_compress_5_avx512) .p2align 4 _mlkem_compress_5_avx512: #endif /* __APPLE__ */ @@ -34279,12 +34393,14 @@ L_mlkem_compress_10_avx512_shuf: #ifndef __APPLE__ .text .globl mlkem_compress_10_avx512 +WC_ASM_ATT_HIDDEN(mlkem_compress_10_avx512) .type mlkem_compress_10_avx512,@function .align 16 mlkem_compress_10_avx512: #else .section __TEXT,__text .globl _mlkem_compress_10_avx512 +WC_ASM_ATT_HIDDEN(_mlkem_compress_10_avx512) .p2align 4 _mlkem_compress_10_avx512: #endif /* __APPLE__ */ @@ -34595,12 +34711,14 @@ L_mlkem_compress_11_avx512_shuf: #ifndef __APPLE__ .text .globl mlkem_compress_11_avx512 +WC_ASM_ATT_HIDDEN(mlkem_compress_11_avx512) .type mlkem_compress_11_avx512,@function .align 16 mlkem_compress_11_avx512: #else .section __TEXT,__text .globl _mlkem_compress_11_avx512 +WC_ASM_ATT_HIDDEN(_mlkem_compress_11_avx512) .p2align 4 _mlkem_compress_11_avx512: #endif /* __APPLE__ */ @@ -34957,12 +35075,14 @@ L_mlkem_rej_uniform_avx512_vbmi2_mask: #ifndef __APPLE__ .text .globl mlkem_rej_uniform_avx512_vbmi2 +WC_ASM_ATT_HIDDEN(mlkem_rej_uniform_avx512_vbmi2) .type mlkem_rej_uniform_avx512_vbmi2,@function .align 16 mlkem_rej_uniform_avx512_vbmi2: #else .section __TEXT,__text .globl _mlkem_rej_uniform_avx512_vbmi2 +WC_ASM_ATT_HIDDEN(_mlkem_rej_uniform_avx512_vbmi2) .p2align 4 _mlkem_rej_uniform_avx512_vbmi2: #endif /* __APPLE__ */ @@ -35080,12 +35200,14 @@ L_mlkem_rej_uniform_n_avx512_vbmi2_mask: #ifndef __APPLE__ .text .globl mlkem_rej_uniform_n_avx512_vbmi2 +WC_ASM_ATT_HIDDEN(mlkem_rej_uniform_n_avx512_vbmi2) .type mlkem_rej_uniform_n_avx512_vbmi2,@function .align 16 mlkem_rej_uniform_n_avx512_vbmi2: #else .section __TEXT,__text .globl _mlkem_rej_uniform_n_avx512_vbmi2 +WC_ASM_ATT_HIDDEN(_mlkem_rej_uniform_n_avx512_vbmi2) .p2align 4 _mlkem_rej_uniform_n_avx512_vbmi2: #endif /* __APPLE__ */ @@ -35233,12 +35355,14 @@ L_mlkem_from_bytes_avx512_vbmi_mask_hi: #ifndef __APPLE__ .text .globl mlkem_from_bytes_avx512_vbmi +WC_ASM_ATT_HIDDEN(mlkem_from_bytes_avx512_vbmi) .type mlkem_from_bytes_avx512_vbmi,@function .align 16 mlkem_from_bytes_avx512_vbmi: #else .section __TEXT,__text .globl _mlkem_from_bytes_avx512_vbmi +WC_ASM_ATT_HIDDEN(_mlkem_from_bytes_avx512_vbmi) .p2align 4 _mlkem_from_bytes_avx512_vbmi: #endif /* __APPLE__ */ @@ -35328,12 +35452,14 @@ L_mlkem_to_bytes_avx512_vbmi_permb: #ifndef __APPLE__ .text .globl mlkem_to_bytes_avx512_vbmi +WC_ASM_ATT_HIDDEN(mlkem_to_bytes_avx512_vbmi) .type mlkem_to_bytes_avx512_vbmi,@function .align 16 mlkem_to_bytes_avx512_vbmi: #else .section __TEXT,__text .globl _mlkem_to_bytes_avx512_vbmi +WC_ASM_ATT_HIDDEN(_mlkem_to_bytes_avx512_vbmi) .p2align 4 _mlkem_to_bytes_avx512_vbmi: #endif /* __APPLE__ */ @@ -35481,12 +35607,14 @@ L_mlkem_rej_uniform_avx512_vbmi_mask_hi: #ifndef __APPLE__ .text .globl mlkem_rej_uniform_avx512_vbmi +WC_ASM_ATT_HIDDEN(mlkem_rej_uniform_avx512_vbmi) .type mlkem_rej_uniform_avx512_vbmi,@function .align 16 mlkem_rej_uniform_avx512_vbmi: #else .section __TEXT,__text .globl _mlkem_rej_uniform_avx512_vbmi +WC_ASM_ATT_HIDDEN(_mlkem_rej_uniform_avx512_vbmi) .p2align 4 _mlkem_rej_uniform_avx512_vbmi: #endif /* __APPLE__ */ @@ -35615,12 +35743,14 @@ L_mlkem_rej_uniform_n_avx512_vbmi_mask_hi: #ifndef __APPLE__ .text .globl mlkem_rej_uniform_n_avx512_vbmi +WC_ASM_ATT_HIDDEN(mlkem_rej_uniform_n_avx512_vbmi) .type mlkem_rej_uniform_n_avx512_vbmi,@function .align 16 mlkem_rej_uniform_n_avx512_vbmi: #else .section __TEXT,__text .globl _mlkem_rej_uniform_n_avx512_vbmi +WC_ASM_ATT_HIDDEN(_mlkem_rej_uniform_n_avx512_vbmi) .p2align 4 _mlkem_rej_uniform_n_avx512_vbmi: #endif /* __APPLE__ */ @@ -35719,12 +35849,14 @@ L_mlkem_compress_4_avx512_vbmi_gather: #ifndef __APPLE__ .text .globl mlkem_compress_4_avx512_vbmi +WC_ASM_ATT_HIDDEN(mlkem_compress_4_avx512_vbmi) .type mlkem_compress_4_avx512_vbmi,@function .align 16 mlkem_compress_4_avx512_vbmi: #else .section __TEXT,__text .globl _mlkem_compress_4_avx512_vbmi +WC_ASM_ATT_HIDDEN(_mlkem_compress_4_avx512_vbmi) .p2align 4 _mlkem_compress_4_avx512_vbmi: #endif /* __APPLE__ */ @@ -35860,12 +35992,14 @@ L_mlkem_compress_5_avx512_vbmi_gather: #ifndef __APPLE__ .text .globl mlkem_compress_5_avx512_vbmi +WC_ASM_ATT_HIDDEN(mlkem_compress_5_avx512_vbmi) .type mlkem_compress_5_avx512_vbmi,@function .align 16 mlkem_compress_5_avx512_vbmi: #else .section __TEXT,__text .globl _mlkem_compress_5_avx512_vbmi +WC_ASM_ATT_HIDDEN(_mlkem_compress_5_avx512_vbmi) .p2align 4 _mlkem_compress_5_avx512_vbmi: #endif /* __APPLE__ */ @@ -36035,12 +36169,14 @@ L_mlkem_compress_10_avx512_vbmi_gather: #ifndef __APPLE__ .text .globl mlkem_compress_10_avx512_vbmi +WC_ASM_ATT_HIDDEN(mlkem_compress_10_avx512_vbmi) .type mlkem_compress_10_avx512_vbmi,@function .align 16 mlkem_compress_10_avx512_vbmi: #else .section __TEXT,__text .globl _mlkem_compress_10_avx512_vbmi +WC_ASM_ATT_HIDDEN(_mlkem_compress_10_avx512_vbmi) .p2align 4 _mlkem_compress_10_avx512_vbmi: #endif /* __APPLE__ */ @@ -36300,12 +36436,14 @@ L_mlkem_decompress_10_avx512_vbmi_hi: #ifndef __APPLE__ .text .globl mlkem_decompress_10_avx512_vbmi +WC_ASM_ATT_HIDDEN(mlkem_decompress_10_avx512_vbmi) .type mlkem_decompress_10_avx512_vbmi,@function .align 16 mlkem_decompress_10_avx512_vbmi: #else .section __TEXT,__text .globl _mlkem_decompress_10_avx512_vbmi +WC_ASM_ATT_HIDDEN(_mlkem_decompress_10_avx512_vbmi) .p2align 4 _mlkem_decompress_10_avx512_vbmi: #endif /* __APPLE__ */ @@ -36488,12 +36626,14 @@ L_mlkem_decompress_11_avx512_vbmi_hi: #ifndef __APPLE__ .text .globl mlkem_decompress_11_avx512_vbmi +WC_ASM_ATT_HIDDEN(mlkem_decompress_11_avx512_vbmi) .type mlkem_decompress_11_avx512_vbmi,@function .align 16 mlkem_decompress_11_avx512_vbmi: #else .section __TEXT,__text .globl _mlkem_decompress_11_avx512_vbmi +WC_ASM_ATT_HIDDEN(_mlkem_decompress_11_avx512_vbmi) .p2align 4 _mlkem_decompress_11_avx512_vbmi: #endif /* __APPLE__ */ @@ -36631,12 +36771,14 @@ L_mlkem_rej_uniform_avx512_vbmi_vbmi2_mask_hi: #ifndef __APPLE__ .text .globl mlkem_rej_uniform_avx512_vbmi_vbmi2 +WC_ASM_ATT_HIDDEN(mlkem_rej_uniform_avx512_vbmi_vbmi2) .type mlkem_rej_uniform_avx512_vbmi_vbmi2,@function .align 16 mlkem_rej_uniform_avx512_vbmi_vbmi2: #else .section __TEXT,__text .globl _mlkem_rej_uniform_avx512_vbmi_vbmi2 +WC_ASM_ATT_HIDDEN(_mlkem_rej_uniform_avx512_vbmi_vbmi2) .p2align 4 _mlkem_rej_uniform_avx512_vbmi_vbmi2: #endif /* __APPLE__ */ @@ -36753,12 +36895,14 @@ L_mlkem_rej_uniform_n_avx512_vbmi_vbmi2_mask_hi: #ifndef __APPLE__ .text .globl mlkem_rej_uniform_n_avx512_vbmi_vbmi2 +WC_ASM_ATT_HIDDEN(mlkem_rej_uniform_n_avx512_vbmi_vbmi2) .type mlkem_rej_uniform_n_avx512_vbmi_vbmi2,@function .align 16 mlkem_rej_uniform_n_avx512_vbmi_vbmi2: #else .section __TEXT,__text .globl _mlkem_rej_uniform_n_avx512_vbmi_vbmi2 +WC_ASM_ATT_HIDDEN(_mlkem_rej_uniform_n_avx512_vbmi_vbmi2) .p2align 4 _mlkem_rej_uniform_n_avx512_vbmi_vbmi2: #endif /* __APPLE__ */ diff --git a/wolfssl/wolfcrypt/visibility.h b/wolfssl/wolfcrypt/visibility.h index 39529d4a2f7..85f01a4b748 100644 --- a/wolfssl/wolfcrypt/visibility.h +++ b/wolfssl/wolfcrypt/visibility.h @@ -88,6 +88,14 @@ #endif /* !BUILDING_WOLFSSL */ +#ifdef WC_ASM_ATT_HIDDEN + /* Use supplied override. */ +#elif defined(__ELF__) + #define WC_ASM_ATT_HIDDEN(name) .hidden name +#else + #define WC_ASM_ATT_HIDDEN(name) /* null expansion */ +#endif + /* WOLFSSL_ABI is used for public API symbols that must not change * their signature. This tag is used for all APIs that are a * part of the fixed ABI. From 2182768a8ce1f73941876f88478ab35d7de1a8ec Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Tue, 4 Aug 2026 00:29:32 -0500 Subject: [PATCH 15/44] wolfssl/wolfcrypt/{types.h -> settings.h}: relocate the WC_HAVE_VECTOR_SPEEDUPS definition (any asm speedup present, minus WOLFSSL_NO_ASM) from types.h to settings.h, and add `#error WC_C_DYNAMIC_FALLBACK requires WC_HAVE_VECTOR_SPEEDUPS` so a fallback-to-C build with no asm to fall back from is rejected at configure time rather than mis-building. --- wolfssl/wolfcrypt/settings.h | 19 +++++++++++++++++++ wolfssl/wolfcrypt/types.h | 6 ------ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index 7855fec4d4e..dc7ae837432 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -4398,6 +4398,15 @@ #endif #if defined(HAVE_FIPS) + #if FIPS_VERSION3_LT(6, 0, 0) && \ + (defined(USE_INTEL_SPEEDUP) || \ + defined(USE_INTEL_SPEEDUP_FOR_AES) || \ + defined(WOLFSSL_AESNI)) + #error Configured FIPS version does not support vector acceleration in kernel mode. + #endif + #if defined(WC_DEBUG_CIPHER_LIFECYCLE) && FIPS_VERSION3_LT(6, 0, 0) + #error Configured FIPS version does not support WC_DEBUG_CIPHER_LIFECYCLE. + #endif #if FIPS_VERSION3_LT(7, 0, 0) /* support RFC 4106 IPsec ESP 64 bit tags */ #undef WOLFSSL_MIN_AUTH_TAG_SZ @@ -5931,6 +5940,16 @@ blinding by defining WC_BLINDING_NO_RNG_ACKNOWLEDGE_WEAKNESS." #undef WOLFSSL_SMALL_STACK_CACHE #endif +#if (defined(USE_INTEL_SPEEDUP) || defined(USE_INTEL_SPEEDUP_FOR_AES) || \ + defined(WOLFSSL_AESNI) || defined(WOLFSSL_ARMASM) || \ + defined(WOLFSSL_SP_ASM)) && !defined(WOLFSSL_NO_ASM) + #define WC_HAVE_VECTOR_SPEEDUPS +#endif + +#if defined(WC_C_DYNAMIC_FALLBACK) && !defined(WC_HAVE_VECTOR_SPEEDUPS) + #error WC_C_DYNAMIC_FALLBACK requires WC_HAVE_VECTOR_SPEEDUPS +#endif + #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/wolfssl/wolfcrypt/types.h b/wolfssl/wolfcrypt/types.h index e60dc3d94da..c693c6e9c6e 100644 --- a/wolfssl/wolfcrypt/types.h +++ b/wolfssl/wolfcrypt/types.h @@ -2400,12 +2400,6 @@ WOLFSSL_API word32 CheckRunTimeSettings(void); #define RESTORE_VECTOR_REGISTERS() RESTORE_NO_VECTOR_REGISTERS() #endif -#if (defined(USE_INTEL_SPEEDUP) || defined(USE_INTEL_SPEEDUP_FOR_AES) || \ - defined(WOLFSSL_AESNI) || defined(WOLFSSL_ARMASM) || \ - defined(WOLFSSL_SP_ASM)) && !defined(WOLFSSL_NO_ASM) - #define WC_HAVE_VECTOR_SPEEDUPS -#endif - /* DISABLE_VECTOR_REGISTERS() and REENABLE_VECTOR_REGISTERS() are currently only * used by Linux kernel code. If WC_HAVE_VECTOR_SPEEDUPS, we default * DISABLE_VECTOR_REGISTERS() to NOT_COMPILED_IN, to assure calling code is From 4b543b75674a8147b2be7fcd33b8b1e217a0b140 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Tue, 4 Aug 2026 00:33:52 -0500 Subject: [PATCH 16/44] various minor cleanups / tweaks for buildability and clarity: wolfcrypt/src/rsa.c: wrap wc_hash2mgf in a targeted -Wswitch-enum pragma configure.ac: rename $ENABLE_ORIGINAL -> $ENABLE_ORIGINAL_KYBER to disambiguate. wolfssl/wolfcrypt/types.h: tighten a braced-group guard with __STRICT_ANSI__ (pedantic-mode correctness). wolfssl/internal.h: add the WOLFSSL_API_PREFIX_MAP mapping for TLSX_CKS_Parse. --- configure.ac | 6 +++--- wolfcrypt/src/rsa.c | 11 +++++++++++ wolfssl/internal.h | 3 +++ wolfssl/wolfcrypt/types.h | 2 +- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 3543577b8e8..bd7d123af92 100644 --- a/configure.ac +++ b/configure.ac @@ -7906,7 +7906,7 @@ do ENABLED_MLKEM_ENCAPSULATE=yes ENABLED_MLKEM_DECAPSULATE=yes ENABLED_ML_KEM=yes - ENABLED_ORIGINAL=yes + ENABLED_ORIGINAL_KYBER=yes ;; no) ;; @@ -7938,7 +7938,7 @@ do ENABLED_MLKEM_DECAPSULATE=yes ;; original|kyber) - ENABLED_ORIGINAL=yes + ENABLED_ORIGINAL_KYBER=yes ;; ml-kem) ENABLED_ML_KEM=yes @@ -8154,7 +8154,7 @@ then AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_HAVE_MLKEM" AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_HAVE_MLKEM" - if test "$ENABLED_ORIGINAL" = "yes"; then + if test "$ENABLED_ORIGINAL_KYBER" = "yes"; then # FIPS 203 (ML-KEM) and Kyber use different implicit rejection. # Kyber mode must not be used in FIPS v7+ builds. AS_IF([test "$HAVE_FIPS_VERSION" -ge 7], diff --git a/wolfcrypt/src/rsa.c b/wolfcrypt/src/rsa.c index 662bffc3f89..07b12e34f41 100644 --- a/wolfcrypt/src/rsa.c +++ b/wolfcrypt/src/rsa.c @@ -2176,6 +2176,12 @@ int wc_RsaUnPad_ex(byte* pkcsBlock, word32 pkcsBlockLen, byte** out, return ret; } +#if defined(HAVE_FIPS) && \ + !defined(WOLFSSL_FIPS_READY) && !defined(WOLFSSL_FIPS_DEV) +PRAGMA_DIAG_PUSH +PRAGMA("GCC diagnostic ignored \"-Wswitch-enum\"") +#endif + int wc_hash2mgf(enum wc_HashType hType) { switch (hType) { @@ -2276,6 +2282,11 @@ int wc_hash2mgf(enum wc_HashType hType) return WC_MGF1NONE; } +#if defined(HAVE_FIPS) && \ + !defined(WOLFSSL_FIPS_READY) && !defined(WOLFSSL_FIPS_DEV) +PRAGMA_DIAG_POP +#endif + #ifdef WC_RSA_NONBLOCK static int wc_RsaFunctionNonBlock(const byte* in, word32 inLen, byte* out, word32* outLen, int type, RsaKey* key) diff --git a/wolfssl/internal.h b/wolfssl/internal.h index 573bab58c90..49e7cafe811 100644 --- a/wolfssl/internal.h +++ b/wolfssl/internal.h @@ -3943,6 +3943,9 @@ WOLFSSL_LOCAL int TLSX_KeyShare_Parse_ClientHello(const WOLFSSL* ssl, WOLFSSL_LOCAL int TLSX_KeyShare_HandlePqcHybridKeyServer(WOLFSSL* ssl, KeyShareEntry* keyShareEntry, byte* data, word16 len); #ifdef WOLFSSL_DUAL_ALG_CERTS +#ifdef WOLFSSL_API_PREFIX_MAP + #define TLSX_CKS_Parse wolfSSL_TLSX_CKS_Parse +#endif WOLFSSL_TEST_VIS int TLSX_CKS_Parse(WOLFSSL* ssl, byte* input, word16 length, TLSX** extensions); WOLFSSL_LOCAL int TLSX_CKS_Set(WOLFSSL* ssl, TLSX** extensions); diff --git a/wolfssl/wolfcrypt/types.h b/wolfssl/wolfcrypt/types.h index c693c6e9c6e..7c4f8116663 100644 --- a/wolfssl/wolfcrypt/types.h +++ b/wolfssl/wolfcrypt/types.h @@ -2274,7 +2274,7 @@ WOLFSSL_API word32 CheckRunTimeSettings(void); #endif #if (defined(__cplusplus) && (__cplusplus >= 201703L)) || \ (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202311L) && \ - !defined(__GNUC__)) || \ + (!defined(__GNUC__) || defined(__STRICT_ANSI__))) || \ (defined(_MSVC_LANG) && (__cpp_static_assert >= 201411L)) /* native variadic static_assert() */ #define wc_static_assert static_assert From c82cfca8ca2c1d87298337160ead776e26fbc35c Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Tue, 4 Aug 2026 00:35:40 -0500 Subject: [PATCH 17/44] wolfcrypt/src/{sha256,sha512}.c and wolfssl/wolfcrypt/{sha256,sha512}.h: Refactor WC_C_DYNAMIC_FALLBACK architecture to allow per-call alternation between asm and C: * Under WC_C_DYNAMIC_FALLBACK keep the block buffer as the raw big-endian stream and byte-reverse just-in-time inside the C transform, so a given wc_Sha256 / wc_Sha512 instance may switch between the vectorized and pure-C transforms per call without producing a wrong digest. * Add Transform_*_C_from_raw / Transform_*_Len_C_from_raw JIT-reversing adapters; the dispatchers early-out through them on (method == C) || SAVE_VECTOR_REGISTERS2 failure; caller-side method-keyed ByteReverse sites are compiled out under the raw-buffer convention and the final block's length words are written unconditionally big-endian. * Remove the init-time CAN_SAVE_VECTOR_REGISTERS pin from Sha*_SetTransform so the recorded method reflects pure CPU capability (enabling fall-forward, not only fallback). Update the bulk paths to check the transform return and not advance on failure. * The raw-buffer convention is scoped to WC_C_DYNAMIC_FALLBACK specifically -- not to WC_NO_INTERNAL_FUNCTION_POINTERS -- because only the fallback build can change transform mid-object; a plain no-function-pointers build picks one method and keeps it, so it retains the conventional host-endian buffer (no change from incumbent code). * Drop the per-object `.sha_method` member. Method selection is a property of the CPU, not of the hash object, so it becomes a file-scope static in each .c, set once (Sha*_SetTransform() early- returns when already set) and read by every instance. Shrinks both structs. * When WOLFSSL_AESNI is enabled without the rest of USE_INTEL_SPEEDUP, `#undef WC_C_DYNAMIC_FALLBACK` -- AES-NI alone satisfies WC_HAVE_VECTOR_SPEEDUPS but leaves SHA with no vectorized transform to fall back from, and the caller-side gating would otherwise suppress a byte-reversal that is still required. --- wolfcrypt/src/sha256.c | 213 +++++++++++++++++++++--------------- wolfcrypt/src/sha512.c | 216 +++++++++++++++++++------------------ wolfssl/wolfcrypt/sha256.h | 4 - wolfssl/wolfcrypt/sha512.h | 3 - 4 files changed, 239 insertions(+), 197 deletions(-) diff --git a/wolfcrypt/src/sha256.c b/wolfcrypt/src/sha256.c index 6d12f12738c..840a818bf42 100644 --- a/wolfcrypt/src/sha256.c +++ b/wolfcrypt/src/sha256.c @@ -43,6 +43,15 @@ on the specific device platform. #include +#if defined(WC_C_DYNAMIC_FALLBACK) && \ + defined(WOLFSSL_AESNI) && !defined(USE_INTEL_SPEEDUP) + /* AES-NI can be enabled with WC_C_DYNAMIC_FALLBACK, but without the rest of + * USE_INTEL_SPEEDUP, in which case we need to disable the dynamic + * fallback. + */ + #undef WC_C_DYNAMIC_FALLBACK +#endif + /* * SHA256 Build Options: * USE_SLOW_SHA256: Reduces code size by not partially unrolling @@ -64,9 +73,6 @@ on the specific device platform. #if !defined(NO_SHA256) #if defined(HAVE_FIPS) && defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 2) - /* set NO_WRAPPERS before headers, use direct internal f()s not wrappers */ - #define FIPS_NO_WRAPPERS - #ifdef USE_WINDOWS_API #pragma code_seg(".fipsA$l") #pragma const_seg(".fipsB$l") @@ -236,8 +242,17 @@ on the specific device platform. #if defined(LITTLE_ENDIAN_ORDER) && \ defined(WOLFSSL_X86_64_BUILD) && defined(USE_INTEL_SPEEDUP) && \ (defined(HAVE_INTEL_AVX1) || defined(HAVE_INTEL_AVX2)) - #ifdef WC_C_DYNAMIC_FALLBACK - #define SHA256_UPDATE_REV_BYTES(ctx) (sha256->sha_method == SHA256_C) + #if defined(WC_NO_INTERNAL_FUNCTION_POINTERS) || \ + defined(WC_C_DYNAMIC_FALLBACK) + /* raw-buffer convention -- sha256->buffer always holds the raw + * big-endian byte stream, and inline_XTRANSFORM{,_LEN}() byte-reverse + * just in time when the C transform runs, so that with + * WC_C_DYNAMIC_FALLBACK the asm-vs-C decision can be made + * independently at each transform. note WC_C_DYNAMIC_FALLBACK + * implies WC_NO_INTERNAL_FUNCTION_POINTERS, but the latter is defined + * below, after this macro. + */ + #define SHA256_UPDATE_REV_BYTES(ctx) 0 #else #define SHA256_UPDATE_REV_BYTES(ctx) \ (!IS_INTEL_AVX1(intel_flags) && !IS_INTEL_AVX2(intel_flags) && \ @@ -275,16 +290,10 @@ on the specific device platform. (!defined(WOLFSSL_HAVE_PSA) || defined(WOLFSSL_PSA_NO_HASH)) && \ !defined(WOLFSSL_RENESAS_RX64_HASH) -#if defined(WOLFSSL_X86_64_BUILD) && defined(USE_INTEL_SPEEDUP) && \ - (defined(HAVE_INTEL_AVX1) || defined(HAVE_INTEL_AVX2)) -#ifdef WC_C_DYNAMIC_FALLBACK - #define SHA256_SETTRANSFORM_ARGS int *sha_method -#else - #define SHA256_SETTRANSFORM_ARGS void -#endif -static void Sha256_SetTransform(SHA256_SETTRANSFORM_ARGS); -#elif defined(WOLFSSL_ARMASM) && defined(__aarch64__) && \ - !defined(WOLF_CRYPTO_CB_ONLY_SHA256) +#if (defined(WOLFSSL_X86_64_BUILD) && defined(USE_INTEL_SPEEDUP) && \ + (defined(HAVE_INTEL_AVX1) || defined(HAVE_INTEL_AVX2))) || \ + (defined(WOLFSSL_ARMASM) && defined(__aarch64__) && \ + !defined(WOLF_CRYPTO_CB_ONLY_SHA256)) static void Sha256_SetTransform(void); #endif @@ -313,17 +322,11 @@ static int InitSha256(wc_Sha256* sha256) sha256->used = 0; #endif -#if defined(WOLFSSL_X86_64_BUILD) && defined(USE_INTEL_SPEEDUP) && \ - (defined(HAVE_INTEL_AVX1) || defined(HAVE_INTEL_AVX2)) +#if (defined(WOLFSSL_X86_64_BUILD) && defined(USE_INTEL_SPEEDUP) && \ + (defined(HAVE_INTEL_AVX1) || defined(HAVE_INTEL_AVX2))) || \ + (defined(WOLFSSL_ARMASM) && defined(__aarch64__) && \ + !defined(WOLF_CRYPTO_CB_ONLY_SHA256)) /* choose best Transform function under this runtime environment */ -#ifdef WC_C_DYNAMIC_FALLBACK - sha256->sha_method = 0; - Sha256_SetTransform(&sha256->sha_method); -#else - Sha256_SetTransform(); -#endif -#elif defined(WOLFSSL_ARMASM) && defined(__aarch64__) && \ - !defined(WOLF_CRYPTO_CB_ONLY_SHA256) Sha256_SetTransform(); #endif @@ -454,42 +457,35 @@ static int InitSha256(wc_Sha256* sha256) SHA256_AVX1_RORX, SHA256_AVX1_NOSHA, SHA256_AVX2_RORX, SHA256_SSE2, SHA256_C }; -#ifndef WC_C_DYNAMIC_FALLBACK /* note that all write access to this static variable must be idempotent, * as arranged by Sha256_SetTransform(), else it will be susceptible to * data races. */ static enum sha_methods sha_method = SHA256_UNSET; -#endif - static void Sha256_SetTransform(SHA256_SETTRANSFORM_ARGS) + static void Sha256_SetTransform(void) { - #ifdef WC_C_DYNAMIC_FALLBACK - #define SHA_METHOD (*sha_method) - #else - #define SHA_METHOD sha_method - #endif - if (SHA_METHOD != SHA256_UNSET) + if (sha_method != SHA256_UNSET) return; - #ifdef WC_C_DYNAMIC_FALLBACK - if (! CAN_SAVE_VECTOR_REGISTERS()) { - SHA_METHOD = SHA256_C; - return; - } - #endif + /* Note, with WC_C_DYNAMIC_FALLBACK, sha_method records CPU capability + * only. Whether vector registers are actually usable is determined + * independently at each transform via SAVE_VECTOR_REGISTERS2(), + * allowing a context to move freely between vectorized and C transforms + * call by call. + */ cpuid_get_flags_atomic(&intel_flags); if (IS_INTEL_SHA(intel_flags)) { #ifdef HAVE_INTEL_AVX1 if (IS_INTEL_AVX1(intel_flags)) { - SHA_METHOD = SHA256_AVX1_SHA; + sha_method = SHA256_AVX1_SHA; } else #endif { - SHA_METHOD = SHA256_SSE2; + sha_method = SHA256_SSE2; } } else @@ -497,12 +493,12 @@ static int InitSha256(wc_Sha256* sha256) if (IS_INTEL_AVX2(intel_flags)) { #ifdef HAVE_INTEL_RORX if (IS_INTEL_BMI2(intel_flags)) { - SHA_METHOD = SHA256_AVX2_RORX; + sha_method = SHA256_AVX2_RORX; } else #endif { - SHA_METHOD = SHA256_AVX2; + sha_method = SHA256_AVX2; } } else @@ -511,34 +507,74 @@ static int InitSha256(wc_Sha256* sha256) if (IS_INTEL_AVX1(intel_flags)) { #ifdef HAVE_INTEL_RORX if (IS_INTEL_BMI2(intel_flags)) { - SHA_METHOD = SHA256_AVX1_RORX; + sha_method = SHA256_AVX1_RORX; } else #endif { - SHA_METHOD = SHA256_AVX1_NOSHA; + sha_method = SHA256_AVX1_NOSHA; } } else #endif { - SHA_METHOD = SHA256_C; + sha_method = SHA256_C; } - #undef SHA_METHOD } - static WC_INLINE int inline_XTRANSFORM(wc_Sha256* S, const byte* D) { - #ifdef WC_C_DYNAMIC_FALLBACK - #define SHA_METHOD (S->sha_method) - #else - #define SHA_METHOD sha_method + /* With WC_NO_INTERNAL_FUNCTION_POINTERS, sha256->buffer always holds the + * raw big-endian byte stream, matching what the asm transforms consume + * (they byte-reverse internally). Transform_Sha256() reads host-endian + * words, so the C path byte-reverses just in time, here. This keeps the + * data layout independent of which transform ultimately runs, so with + * WC_C_DYNAMIC_FALLBACK the asm-vs-C decision can be made independently + * at each transform, using SAVE_VECTOR_REGISTERS2() success/failure at + * the moment of use. Mirrors Transform_Sha512_C_from_raw() in sha512.c + * and Transform_Sha256_C() in the aarch64 section below. + */ + static WC_INLINE int Transform_Sha256_C_from_raw(wc_Sha256* S, + const byte* D) + { + if (D != (const byte*)S->buffer) + XMEMCPY(S->buffer, D, WC_SHA256_BLOCK_SIZE); + #ifdef LITTLE_ENDIAN_ORDER + ByteReverseWords(S->buffer, S->buffer, WC_SHA256_BLOCK_SIZE); #endif + return Transform_Sha256(S, (const byte*)S->buffer); + } + + static WC_INLINE int Transform_Sha256_Len_C_from_raw(wc_Sha256* S, + const byte* D, + word32 L) + { + int ret = 0; + + while (L >= WC_SHA256_BLOCK_SIZE) { + ret = Transform_Sha256_C_from_raw(S, D); + if (ret != 0) + break; + D += WC_SHA256_BLOCK_SIZE; + L -= WC_SHA256_BLOCK_SIZE; + } + + return ret; + } + + static WC_INLINE int inline_XTRANSFORM(wc_Sha256* S, const byte* D) { int ret; - if (SHA_METHOD == SHA256_C) - return Transform_Sha256(S, D); + #ifdef WC_C_DYNAMIC_FALLBACK + if ((sha_method == SHA256_C) || + (SAVE_VECTOR_REGISTERS2() != 0)) + { + return Transform_Sha256_C_from_raw(S, D); + } + #else + if (sha_method == SHA256_C) + return Transform_Sha256_C_from_raw(S, D); SAVE_VECTOR_REGISTERS(return _svr_ret;); - switch (SHA_METHOD) { + #endif + switch (sha_method) { case SHA256_AVX2: ret = Transform_Sha256_AVX2(S, D); break; @@ -560,24 +596,28 @@ static int InitSha256(wc_Sha256* sha256) case SHA256_C: case SHA256_UNSET: default: - ret = Transform_Sha256(S, D); + /* not reachable -- the C path exits above, before vector register + * save -- but must stay layout-correct. */ + ret = Transform_Sha256_C_from_raw(S, D); break; } RESTORE_VECTOR_REGISTERS(); return ret; - #undef SHA_METHOD } #define XTRANSFORM(...) inline_XTRANSFORM(__VA_ARGS__) static WC_INLINE int inline_XTRANSFORM_LEN(wc_Sha256* S, const byte* D, word32 L) { + int ret; #ifdef WC_C_DYNAMIC_FALLBACK - #define SHA_METHOD (S->sha_method) + if ((sha_method == SHA256_C) || + (SAVE_VECTOR_REGISTERS2() != 0)) + { + return Transform_Sha256_Len_C_from_raw(S, D, L); + } #else - #define SHA_METHOD sha_method - #endif - int ret; SAVE_VECTOR_REGISTERS(return _svr_ret;); - switch (SHA_METHOD) { + #endif + switch (sha_method) { case SHA256_AVX2: ret = Transform_Sha256_AVX2_Len(S, D, L); break; @@ -599,12 +639,11 @@ static int InitSha256(wc_Sha256* sha256) case SHA256_C: case SHA256_UNSET: default: - ret = 0; + ret = Transform_Sha256_Len_C_from_raw(S, D, L); break; } RESTORE_VECTOR_REGISTERS(); return ret; - #undef SHA_METHOD } #define XTRANSFORM_LEN(...) inline_XTRANSFORM_LEN(__VA_ARGS__) @@ -788,8 +827,8 @@ static int InitSha256(wc_Sha256* sha256) #include "fsl_mmcau.h" #endif - #define XTRANSFORM(S, D) Transform_Sha256((S),(D)) - #define XTRANSFORM_LEN(S, D, L) Transform_Sha256_Len((S),(D),(L)) + #define XTRANSFORM(S, D) Transform_Sha256(S, D) + #define XTRANSFORM_LEN(S, D, L) Transform_Sha256_Len(S, D, L) #ifndef WC_HASH_DATA_ALIGNMENT /* these hardware API's require 4 byte (word32) alignment */ @@ -994,7 +1033,7 @@ static int InitSha256(wc_Sha256* sha256) #endif #define WC_SHA256_DIGEST_WORD_SIZE 16 - #define XTRANSFORM(S, D) wc_Sha256SCE_XTRANSFORM((S), (D)) + #define XTRANSFORM(S, D) wc_Sha256SCE_XTRANSFORM(S, D) static int wc_Sha256SCE_XTRANSFORM(wc_Sha256* sha256, const byte* data) { if (WOLFSSL_SCE_GSCE_HANDLE.p_cfg->endian_flag == @@ -1166,17 +1205,23 @@ static void Sha256_SetTransform(void) (unsigned int)(IS_PPC64_VEC_CRYPTO(cpuid_get_flags()) != 0)); } -static WC_INLINE void SHA256_TRANSFORM_LEN(wc_Sha256* sha256, const byte* data, +static WC_INLINE int SHA256_TRANSFORM_LEN(wc_Sha256* sha256, const byte* data, word32 len) { if (WOLFSSL_ATOMIC_LOAD(sha256_use_crypto)) Transform_Sha256_Len_crypto(sha256, data, len); else Transform_Sha256_Len(sha256, data, len); + return 0; } #else #define Sha256_SetTransform() WC_DO_NOTHING -#define SHA256_TRANSFORM_LEN(s, d, l) Transform_Sha256_Len((s), (d), (l)) +static WC_INLINE int SHA256_TRANSFORM_LEN(wc_Sha256* sha256, const byte* data, + word32 len) +{ + Transform_Sha256_Len(sha256, data, len); + return 0; +} #endif int wc_InitSha256_ex(wc_Sha256* sha256, void* heap, int devId) @@ -1213,7 +1258,7 @@ static int Transform_Sha256(wc_Sha256* sha256, const byte* data) } #define XTRANSFORM Transform_Sha256 -#define XTRANSFORM_LEN(s, d, l) SHA256_TRANSFORM_LEN((s), (d), (l)) +#define XTRANSFORM_LEN(s, d, l) SHA256_TRANSFORM_LEN(s, d, l) #elif defined(WOLFSSL_ARMASM) && defined(__aarch64__) && \ !defined(WOLF_CRYPTO_CB_ONLY_SHA256) @@ -1641,7 +1686,7 @@ static WC_INLINE int Transform_Sha256_Len(wc_Sha256* sha256, const byte* data, #define h(i) S[(7-(i)) & 7] #ifndef XTRANSFORM - #define XTRANSFORM(S, D) Transform_Sha256((S),(D)) + #define XTRANSFORM(S, D) Transform_Sha256(S, D) #endif #ifndef SHA256_MANY_REGISTERS @@ -1879,9 +1924,7 @@ static WC_INLINE int Transform_Sha256_Len(wc_Sha256* sha256, const byte* data, #if defined(WOLFSSL_X86_64_BUILD) && defined(USE_INTEL_SPEEDUP) && \ (defined(HAVE_INTEL_AVX1) || defined(HAVE_INTEL_AVX2)) - #ifdef WC_C_DYNAMIC_FALLBACK - if (sha256->sha_method != SHA256_C) - #elif defined(WC_NO_INTERNAL_FUNCTION_POINTERS) + #ifdef WC_NO_INTERNAL_FUNCTION_POINTERS if (sha_method != SHA256_C) #else if (Transform_Sha256_Len_p != NULL) @@ -1896,9 +1939,11 @@ static WC_INLINE int Transform_Sha256_Len(wc_Sha256* sha256, const byte* data, blocksLen = len & ~((word32)WC_SHA256_BLOCK_SIZE-1); /* Byte reversal and alignment handled in function if required */ - XTRANSFORM_LEN(sha256, data, blocksLen); - data += blocksLen; - len -= blocksLen; + ret = XTRANSFORM_LEN(sha256, data, blocksLen); + if (ret == 0) { + data += blocksLen; + len -= blocksLen; + } } } #if defined(WOLFSSL_X86_64_BUILD) && defined(USE_INTEL_SPEEDUP) && \ @@ -2122,8 +2167,9 @@ static WC_INLINE int Transform_Sha256_Len(wc_Sha256* sha256, const byte* data, /* Kinetis requires only these bytes reversed */ #if defined(WOLFSSL_X86_64_BUILD) && defined(USE_INTEL_SPEEDUP) && \ (defined(HAVE_INTEL_AVX1) || defined(HAVE_INTEL_AVX2)) - #ifdef WC_C_DYNAMIC_FALLBACK - if (sha256->sha_method != SHA256_C) + #ifdef WC_NO_INTERNAL_FUNCTION_POINTERS + /* raw-buffer convention -- the length words must be big-endian in the + * stream regardless of which transform consumes the final block. */ #else if (IS_INTEL_AVX1(intel_flags) || IS_INTEL_AVX2(intel_flags) || IS_INTEL_SHA(intel_flags)) @@ -2597,16 +2643,9 @@ static WC_INLINE int Transform_Sha256_Len(wc_Sha256* sha256, const byte* data, sha224->loLen = 0; sha224->hiLen = 0; - #ifdef WC_C_DYNAMIC_FALLBACK - sha224->sha_method = 0; - #endif - #if defined(WOLFSSL_X86_64_BUILD) && defined(USE_INTEL_SPEEDUP) && \ (defined(HAVE_INTEL_AVX1) || defined(HAVE_INTEL_AVX2)) /* choose best Transform function under this runtime environment */ - #ifdef WC_C_DYNAMIC_FALLBACK - Sha256_SetTransform(&sha224->sha_method); - #else Sha256_SetTransform(); #endif #elif defined(WOLFSSL_ARMASM_SHA256_TRANSFORM) diff --git a/wolfcrypt/src/sha512.c b/wolfcrypt/src/sha512.c index fe325b6fc8d..6da364834a4 100644 --- a/wolfcrypt/src/sha512.c +++ b/wolfcrypt/src/sha512.c @@ -65,6 +65,15 @@ " acceleration backends" #endif +#if defined(WC_C_DYNAMIC_FALLBACK) && \ + defined(WOLFSSL_AESNI) && !defined(USE_INTEL_SPEEDUP) + /* AES-NI can be enabled with WC_C_DYNAMIC_FALLBACK, but without the rest of + * USE_INTEL_SPEEDUP, in which case we need to disable the dynamic + * fallback. + */ + #undef WC_C_DYNAMIC_FALLBACK +#endif + #if (defined(WOLFSSL_SHA512) || defined(WOLFSSL_SHA384)) /* determine if we are using Espressif SHA hardware acceleration */ @@ -83,9 +92,6 @@ #endif #if defined(HAVE_FIPS) && defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 2) - /* set NO_WRAPPERS before headers, use direct internal f()s not wrappers */ - #define FIPS_NO_WRAPPERS - #ifdef USE_WINDOWS_API #pragma code_seg(".fipsA$m") #pragma const_seg(".fipsB$m") @@ -911,12 +917,7 @@ int wc_Sha384GetFlags(wc_Sha384* sha384, word32* flags) #if (defined(WOLFSSL_X86_64_BUILD) && defined(USE_INTEL_SPEEDUP) && \ (defined(HAVE_INTEL_AVX1) || defined(HAVE_INTEL_AVX2))) || \ defined(WOLFSSL_ARMASM) -#ifdef WC_C_DYNAMIC_FALLBACK - #define SHA512_SETTRANSFORM_ARGS int *sha_method -#else - #define SHA512_SETTRANSFORM_ARGS void -#endif -static void Sha512_SetTransform(SHA512_SETTRANSFORM_ARGS); +static void Sha512_SetTransform(void); #endif static int InitSha512(wc_Sha512* sha512) @@ -941,13 +942,8 @@ static int InitSha512(wc_Sha512* sha512) #if (defined(WOLFSSL_X86_64_BUILD) && defined(USE_INTEL_SPEEDUP) && \ (defined(HAVE_INTEL_AVX1) || defined(HAVE_INTEL_AVX2))) || \ defined(WOLFSSL_ARMASM) -#ifdef WC_C_DYNAMIC_FALLBACK - sha512->sha_method = 0; - Sha512_SetTransform(&sha512->sha_method); -#else Sha512_SetTransform(); #endif -#endif #if defined(WOLFSSL_USE_ESP32_CRYPT_HASH_HW) && \ !defined(NO_WOLFSSL_ESP32_CRYPT_HASH_SHA512) @@ -997,13 +993,8 @@ static int InitSha512_224(wc_Sha512* sha512) #if (defined(WOLFSSL_X86_64_BUILD) && defined(USE_INTEL_SPEEDUP) && \ (defined(HAVE_INTEL_AVX1) || defined(HAVE_INTEL_AVX2))) || \ defined(WOLFSSL_ARMASM) -#ifdef WC_C_DYNAMIC_FALLBACK - sha512->sha_method = 0; - Sha512_SetTransform(&sha512->sha_method); -#else Sha512_SetTransform(); #endif -#endif #if defined(WOLFSSL_USE_ESP32_CRYPT_HASH_HW) && \ !defined(NO_WOLFSSL_ESP32_CRYPT_HASH_SHA512) @@ -1055,13 +1046,8 @@ static int InitSha512_256(wc_Sha512* sha512) #if (defined(WOLFSSL_X86_64_BUILD) && defined(USE_INTEL_SPEEDUP) && \ (defined(HAVE_INTEL_AVX1) || defined(HAVE_INTEL_AVX2))) || \ defined(WOLFSSL_ARMASM) -#ifdef WC_C_DYNAMIC_FALLBACK - sha512->sha_method = 0; - Sha512_SetTransform(&sha512->sha_method); -#else Sha512_SetTransform(); #endif -#endif #if defined(WOLFSSL_USE_ESP32_CRYPT_HASH_HW) && \ !defined(NO_WOLFSSL_ESP32_CRYPT_HASH_SHA512) @@ -1196,30 +1182,63 @@ static int InitSha512_256(wc_Sha512* sha512) enum sha_methods { SHA512_UNSET = 0, SHA512_AVX1, SHA512_AVX2, SHA512_AVX1_RORX, SHA512_AVX2_RORX, SHA512_C }; -#ifndef WC_C_DYNAMIC_FALLBACK /* note that all write access to this static variable must be idempotent, * as arranged by Sha512_SetTransform(), else it will be susceptible to * data races. */ static enum sha_methods sha_method = SHA512_UNSET; -#endif - static void Sha512_SetTransform(SHA512_SETTRANSFORM_ARGS) - { #ifdef WC_C_DYNAMIC_FALLBACK - #define SHA_METHOD (*sha_method) - #else - #define SHA_METHOD sha_method + + /* With WC_C_DYNAMIC_FALLBACK, sha512->buffer always holds the + * raw big-endian byte stream, matching what the AVX transforms consume + * (they byte-reverse internally). _Transform_Sha512() reads host-endian + * words from sha512->buffer, so the C path byte-reverses just in time, + * here. This keeps the buffer layout independent of which transform + * ultimately runs, so with WC_C_DYNAMIC_FALLBACK the asm-vs-C decision + * can be made independently at each transform, using + * SAVE_VECTOR_REGISTERS2() success/failure at the moment of use. + */ + + static WC_INLINE int Transform_Sha512_C_from_raw(wc_Sha512 *sha512) + { + #ifdef LITTLE_ENDIAN_ORDER + ByteReverseWords64(sha512->buffer, sha512->buffer, + WC_SHA512_BLOCK_SIZE); #endif - if (SHA_METHOD != SHA512_UNSET) - return; + return _Transform_Sha512(sha512); + } - #ifdef WC_C_DYNAMIC_FALLBACK - if (! CAN_SAVE_VECTOR_REGISTERS()) { - SHA_METHOD = SHA512_C; - return; + static WC_INLINE int Transform_Sha512_Len_C_from_raw(wc_Sha512 *sha512, + word32 len) + { + const byte* data = sha512->data; + int ret = 0; + + while (len >= WC_SHA512_BLOCK_SIZE) { + XMEMCPY(sha512->buffer, data, WC_SHA512_BLOCK_SIZE); + ret = Transform_Sha512_C_from_raw(sha512); + if (ret != 0) + break; + data += WC_SHA512_BLOCK_SIZE; + len -= WC_SHA512_BLOCK_SIZE; } - #endif + + return ret; + } + #endif /* WC_C_DYNAMIC_FALLBACK */ + + static void Sha512_SetTransform(void) + { + if (sha_method != SHA512_UNSET) + return; + + /* Note that, with WC_C_DYNAMIC_FALLBACK, sha_method records CPU + * capability only. Whether vector registers are actually usable is + * determined independently at each transform via + * SAVE_VECTOR_REGISTERS2(), allowing a context to move freely between + * vectorized and C transforms call by call. + */ cpuid_get_flags_atomic(&intel_flags); @@ -1227,12 +1246,12 @@ static int InitSha512_256(wc_Sha512* sha512) if (IS_INTEL_AVX2(intel_flags)) { #ifdef HAVE_INTEL_RORX if (IS_INTEL_BMI2(intel_flags)) { - SHA_METHOD = SHA512_AVX2_RORX; + sha_method = SHA512_AVX2_RORX; } else #endif { - SHA_METHOD = SHA512_AVX2; + sha_method = SHA512_AVX2; } } else @@ -1241,33 +1260,35 @@ static int InitSha512_256(wc_Sha512* sha512) if (IS_INTEL_AVX1(intel_flags)) { #ifdef HAVE_INTEL_RORX if (IS_INTEL_BMI2(intel_flags)) { - SHA_METHOD = SHA512_AVX1_RORX; + sha_method = SHA512_AVX1_RORX; } else #endif { - SHA_METHOD = SHA512_AVX1; + sha_method = SHA512_AVX1; } } else #endif { - SHA_METHOD = SHA512_C; + sha_method = SHA512_C; } - #undef SHA_METHOD } static WC_INLINE int Transform_Sha512(wc_Sha512 *sha512) { + int ret; #ifdef WC_C_DYNAMIC_FALLBACK - #define SHA_METHOD (sha512->sha_method) + if ((sha_method == SHA512_C) || + (SAVE_VECTOR_REGISTERS2() != 0)) + { + return Transform_Sha512_C_from_raw(sha512); + } #else - #define SHA_METHOD sha_method - #endif - int ret; - if (SHA_METHOD == SHA512_C) - return _Transform_Sha512(sha512); + if (sha_method == SHA512_C) + return Transform_Sha512(sha512); SAVE_VECTOR_REGISTERS(return _svr_ret;); - switch (SHA_METHOD) { + #endif + switch (sha_method) { case SHA512_AVX2: ret = Transform_Sha512_AVX2(sha512); break; @@ -1283,23 +1304,31 @@ static int InitSha512_256(wc_Sha512* sha512) case SHA512_C: case SHA512_UNSET: default: + #ifdef WC_C_DYNAMIC_FALLBACK + /* not reachable -- the C path exits above, before vector register + * save -- but must stay layout-correct. */ + ret = Transform_Sha512_C_from_raw(sha512); + #else ret = _Transform_Sha512(sha512); + #endif break; } RESTORE_VECTOR_REGISTERS(); return ret; - #undef SHA_METHOD } static WC_INLINE int Transform_Sha512_Len(wc_Sha512 *sha512, word32 len) { + int ret; #ifdef WC_C_DYNAMIC_FALLBACK - #define SHA_METHOD (sha512->sha_method) + if ((sha_method == SHA512_C) || + (SAVE_VECTOR_REGISTERS2() != 0)) + { + return Transform_Sha512_Len_C_from_raw(sha512, len); + } #else - #define SHA_METHOD sha_method - #endif - int ret; SAVE_VECTOR_REGISTERS(return _svr_ret;); - switch (SHA_METHOD) { + #endif + switch (sha_method) { case SHA512_AVX2: ret = Transform_Sha512_AVX2_Len(sha512, len); break; @@ -1315,12 +1344,17 @@ static int InitSha512_256(wc_Sha512* sha512) case SHA512_C: case SHA512_UNSET: default: + #ifdef WC_C_DYNAMIC_FALLBACK + /* not reachable -- the C path exits above, before vector register + * save -- but must stay correct. */ + ret = Transform_Sha512_Len_C_from_raw(sha512, len); + #else ret = 0; + #endif break; } RESTORE_VECTOR_REGISTERS(); return ret; - #undef SHA_METHOD } #else /* !WC_NO_INTERNAL_FUNCTION_POINTERS */ @@ -1979,24 +2013,19 @@ static WC_INLINE int Sha512Update(wc_Sha512* sha512, const byte* data, word32 le } if (sha512->buffLen == WC_SHA512_BLOCK_SIZE) { - #if defined(LITTLE_ENDIAN_ORDER) + #if defined(LITTLE_ENDIAN_ORDER) && !defined(WC_C_DYNAMIC_FALLBACK) && \ + (!defined(WOLFSSL_ESP32_CRYPT) || \ + defined(NO_WOLFSSL_ESP32_CRYPT_HASH) || \ + defined(NO_WOLFSSL_ESP32_CRYPT_HASH_SHA512)) && \ + !defined(WOLFSSL_ARMASM) && !defined(WOLFSSL_PPC64_ASM) && \ + !defined(WOLFSSL_RISCV_ASM) #if defined(WOLFSSL_X86_64_BUILD) && defined(USE_INTEL_SPEEDUP) && \ - (defined(HAVE_INTEL_AVX1) || defined(HAVE_INTEL_AVX2)) - #ifdef WC_C_DYNAMIC_FALLBACK - if (sha512->sha_method == SHA512_C) - #else + (defined(HAVE_INTEL_AVX1) || defined(HAVE_INTEL_AVX2)) if (!IS_INTEL_AVX1(intel_flags) && !IS_INTEL_AVX2(intel_flags)) - #endif #endif { - #if (!defined(WOLFSSL_ESP32_CRYPT) || \ - defined(NO_WOLFSSL_ESP32_CRYPT_HASH) || \ - defined(NO_WOLFSSL_ESP32_CRYPT_HASH_SHA512)) && \ - !defined(WOLFSSL_ARMASM) && !defined(WOLFSSL_PPC64_ASM) && \ - !defined(WOLFSSL_RISCV_ASM) ByteReverseWords64(sha512->buffer, sha512->buffer, WC_SHA512_BLOCK_SIZE); - #endif } #endif #if defined(WOLFSSL_ARMASM) || defined(WOLFSSL_PPC64_ASM) || \ @@ -2045,9 +2074,7 @@ static WC_INLINE int Sha512Update(wc_Sha512* sha512, const byte* data, word32 le #if (defined(WOLFSSL_X86_64_BUILD) && defined(USE_INTEL_SPEEDUP) && \ (defined(HAVE_INTEL_AVX1) || defined(HAVE_INTEL_AVX2))) - #ifdef WC_C_DYNAMIC_FALLBACK - if (sha512->sha_method != SHA512_C) - #elif defined(WC_NO_INTERNAL_FUNCTION_POINTERS) + #ifdef WC_NO_INTERNAL_FUNCTION_POINTERS if (sha_method != SHA512_C) #else if (Transform_Sha512_Len_p != NULL) @@ -2059,9 +2086,11 @@ static WC_INLINE int Sha512Update(wc_Sha512* sha512, const byte* data, word32 le if (blocksLen > 0) { sha512->data = data; /* Byte reversal performed in function if required. */ - Transform_Sha512_Len(sha512, blocksLen); - data += blocksLen; - len -= blocksLen; + ret = Transform_Sha512_Len(sha512, blocksLen); + if (ret == 0) { + data += blocksLen; + len -= blocksLen; + } } } else @@ -2077,12 +2106,9 @@ static WC_INLINE int Sha512Update(wc_Sha512* sha512, const byte* data, word32 le len -= WC_SHA512_BLOCK_SIZE; #if defined(WOLFSSL_X86_64_BUILD) && defined(USE_INTEL_SPEEDUP) && \ - (defined(HAVE_INTEL_AVX1) || defined(HAVE_INTEL_AVX2)) - #ifdef WC_C_DYNAMIC_FALLBACK - if (sha512->sha_method == SHA512_C) - #else + (defined(HAVE_INTEL_AVX1) || defined(HAVE_INTEL_AVX2)) && \ + !defined(WC_C_DYNAMIC_FALLBACK) if (!IS_INTEL_AVX1(intel_flags) && !IS_INTEL_AVX2(intel_flags)) - #endif { ByteReverseWords64(sha512->buffer, sha512->buffer, WC_SHA512_BLOCK_SIZE); @@ -2222,14 +2248,10 @@ static WC_INLINE int Sha512Final(wc_Sha512* sha512) } sha512->buffLen += WC_SHA512_BLOCK_SIZE - sha512->buffLen; -#if defined(LITTLE_ENDIAN_ORDER) +#if defined(LITTLE_ENDIAN_ORDER) && !defined(WC_C_DYNAMIC_FALLBACK) #if defined(WOLFSSL_X86_64_BUILD) && defined(USE_INTEL_SPEEDUP) && \ (defined(HAVE_INTEL_AVX1) || defined(HAVE_INTEL_AVX2)) - #ifdef WC_C_DYNAMIC_FALLBACK - if (sha512->sha_method == SHA512_C) - #else if (!IS_INTEL_AVX1(intel_flags) && !IS_INTEL_AVX2(intel_flags)) - #endif #endif { @@ -2282,14 +2304,10 @@ static WC_INLINE int Sha512Final(wc_Sha512* sha512) sha512->loLen = sha512->loLen << 3; /* store lengths */ -#if defined(LITTLE_ENDIAN_ORDER) +#if defined(LITTLE_ENDIAN_ORDER) && !defined(WC_C_DYNAMIC_FALLBACK) #if defined(WOLFSSL_X86_64_BUILD) && defined(USE_INTEL_SPEEDUP) && \ (defined(HAVE_INTEL_AVX1) || defined(HAVE_INTEL_AVX2)) - #ifdef WC_C_DYNAMIC_FALLBACK - if (sha512->sha_method == SHA512_C) - #else if (!IS_INTEL_AVX1(intel_flags) && !IS_INTEL_AVX2(intel_flags)) - #endif #endif #if (!defined(WOLFSSL_ESP32_CRYPT) || \ defined(NO_WOLFSSL_ESP32_CRYPT_HASH) || \ @@ -2311,7 +2329,8 @@ static WC_INLINE int Sha512Final(wc_Sha512* sha512) #if defined(WOLFSSL_X86_64_BUILD) && defined(USE_INTEL_SPEEDUP) && \ (defined(HAVE_INTEL_AVX1) || defined(HAVE_INTEL_AVX2)) #ifdef WC_C_DYNAMIC_FALLBACK - if (sha512->sha_method != SHA512_C) + /* raw-buffer convention -- the length words must be big-endian in the + * stream regardless of which transform consumes the final block. */ #else if (IS_INTEL_AVX1(intel_flags) || IS_INTEL_AVX2(intel_flags)) #endif @@ -2591,20 +2610,16 @@ int wc_Sha512Transform(wc_Sha512* sha, const unsigned char* data) return MEMORY_E; #endif -#if defined(LITTLE_ENDIAN_ORDER) +#if defined(LITTLE_ENDIAN_ORDER) && !defined(WC_C_DYNAMIC_FALLBACK) #if defined(WOLFSSL_X86_64_BUILD) && defined(USE_INTEL_SPEEDUP) && \ (defined(HAVE_INTEL_AVX1) || defined(HAVE_INTEL_AVX2)) - #ifdef WC_C_DYNAMIC_FALLBACK - if (sha->sha_method == SHA512_C) - #else if (!IS_INTEL_AVX1(intel_flags) && !IS_INTEL_AVX2(intel_flags)) - #endif #endif { ByteReverseWords64((word64*)data, (word64*)data, WC_SHA512_BLOCK_SIZE); } -#endif /* LITTLE_ENDIAN_ORDER */ +#endif /* LITTLE_ENDIAN_ORDER && !WC_C_DYNAMIC_FALLBACK */ #if defined(WOLFSSL_ARMASM) || defined(WOLFSSL_RISCV_ASM) ByteReverseWords64(buffer, (word64*)data, WC_SHA512_BLOCK_SIZE); @@ -2787,13 +2802,8 @@ static int InitSha384(wc_Sha384* sha384) #if (defined(WOLFSSL_X86_64_BUILD) && defined(USE_INTEL_SPEEDUP) && \ (defined(HAVE_INTEL_AVX1) || defined(HAVE_INTEL_AVX2))) || \ defined(WOLFSSL_ARMASM) -#ifdef WC_C_DYNAMIC_FALLBACK - sha384->sha_method = 0; - Sha512_SetTransform(&sha384->sha_method); -#else Sha512_SetTransform(); #endif -#endif #if defined(WOLFSSL_USE_ESP32_CRYPT_HASH_HW) && \ !defined(NO_WOLFSSL_ESP32_CRYPT_HASH_SHA384) diff --git a/wolfssl/wolfcrypt/sha256.h b/wolfssl/wolfcrypt/sha256.h index 4305d3078ca..3c35163a8a5 100644 --- a/wolfssl/wolfcrypt/sha256.h +++ b/wolfssl/wolfcrypt/sha256.h @@ -199,10 +199,6 @@ struct wc_Sha256 { word32 loLen; /* length in bytes */ word32 hiLen; /* length in bytes */ -#ifdef WC_C_DYNAMIC_FALLBACK - int sha_method; -#endif - #endif void* heap; #ifdef WOLFSSL_PIC32MZ_HASH diff --git a/wolfssl/wolfcrypt/sha512.h b/wolfssl/wolfcrypt/sha512.h index 5ee250a32be..26cd75a366b 100644 --- a/wolfssl/wolfcrypt/sha512.h +++ b/wolfssl/wolfcrypt/sha512.h @@ -163,9 +163,6 @@ struct wc_Sha512 { #ifdef USE_INTEL_SPEEDUP const byte* data; #endif -#ifdef WC_C_DYNAMIC_FALLBACK - int sha_method; -#endif #ifdef WOLFSSL_ASYNC_CRYPT WC_ASYNC_DEV asyncDev; #endif /* WOLFSSL_ASYNC_CRYPT */ From c95cbdbf28d2351ec9a0a245df1bdb4f80825618 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Tue, 4 Aug 2026 00:46:54 -0500 Subject: [PATCH 18/44] wolfssl/wolfcrypt/random.h, wolfcrypt/src/random.c: add full WOLFSSL_DEBUG_TRACE_ERROR_CODES support for internal DRBG errors. Converts the DRBG internal status #defines (DRBG_SUCCESS/DRBG_FAILURE, WC_DRBG_*) to enums, that are wrapped in WC_ERR_TRACE() when WOLFSSL_DEBUG_TRACE_ERROR_CODES. Deploys well-known error codes and WC_NO_ERR_TRACE() as needed throughout. --- wolfcrypt/src/random.c | 75 +++++++++++++++++++++++--------------- wolfssl/wolfcrypt/random.h | 18 +++++---- 2 files changed, 57 insertions(+), 36 deletions(-) diff --git a/wolfcrypt/src/random.c b/wolfcrypt/src/random.c index d80492ba7fb..31ac0e0393c 100644 --- a/wolfcrypt/src/random.c +++ b/wolfcrypt/src/random.c @@ -315,11 +315,28 @@ int wc_SetSeed_Cb(wc_RngSeed_Cb cb) /* Internal return codes */ -#define DRBG_SUCCESS 0 -#define DRBG_FAILURE 1 -#define DRBG_NEED_RESEED 2 -#define DRBG_CONT_FAILURE 3 -#define DRBG_NO_SEED_CB 4 +enum { + DRBG_SUCCESS = 0, + DRBG_FAILURE = 1, + DRBG_NEED_RESEED = 2, + DRBG_CONT_FAILURE = 3, + DRBG_NO_SEED_CB = 4 +}; + +#ifdef WOLFSSL_DEBUG_TRACE_ERROR_CODES + enum { + CONST_NUM_ERR_DRBG_FAILURE = DRBG_FAILURE, + CONST_NUM_ERR_DRBG_NEED_RESEED = DRBG_NEED_RESEED, + CONST_NUM_ERR_DRBG_CONT_FAILURE = DRBG_CONT_FAILURE, + CONST_NUM_ERR_DRBG_NO_SEED_CB = DRBG_NO_SEED_CB + }; + #define DRBG_FAILURE WC_ERR_TRACE(DRBG_FAILURE) + #define DRBG_NEED_RESEED WC_ERR_TRACE(DRBG_NEED_RESEED) + #define DRBG_CONT_FAILURE WC_ERR_TRACE(DRBG_CONT_FAILURE) + #define DRBG_NO_SEED_CB WC_ERR_TRACE(DRBG_NO_SEED_CB) + #define WC_DRBG_FAILED WC_ERR_TRACE(WC_DRBG_FAILED) + #define WC_DRBG_CONT_FAILED WC_ERR_TRACE(WC_DRBG_CONT_FAILED) +#endif /* RNG health states */ #define DRBG_NOT_INIT WC_DRBG_NOT_INIT @@ -469,7 +486,7 @@ static int Hash_df(DRBG_internal* drbg, byte* out, word32 outSz, byte type, const byte* inB, word32 inBSz, const byte* inC, word32 inCSz) { - int ret = DRBG_FAILURE; + int ret = WC_NO_ERR_TRACE(DRBG_FAILURE); byte ctr; word32 i; word32 len; @@ -704,7 +721,7 @@ static WC_INLINE void array_add_one(byte* data, word32 dataSz) /* Returns: DRBG_SUCCESS or DRBG_FAILURE */ static int Hash_gen(DRBG_internal* drbg, byte* out, word32 outSz, const byte* V) { - int ret = DRBG_FAILURE; + int ret = WC_NO_ERR_TRACE(DRBG_FAILURE); word32 i; word32 len; #if defined(WOLFSSL_SMALL_STACK_CACHE) @@ -1033,7 +1050,7 @@ static int Hash_DRBG_Instantiate(DRBG_internal* drbg, const byte* seed, word32 nonceSz, const byte* perso, word32 persoSz, void* heap, int devId) { - int ret = DRBG_FAILURE; + int ret = WC_NO_ERR_TRACE(DRBG_FAILURE); XMEMSET(drbg, 0, sizeof(DRBG_internal)); drbg->heap = heap; @@ -1105,7 +1122,7 @@ static int Hash512_df(DRBG_SHA512_internal* drbg, byte* out, word32 outSz, const byte* inB, word32 inBSz, const byte* inC, word32 inCSz) { - int ret = DRBG_FAILURE; + int ret = WC_NO_ERR_TRACE(DRBG_FAILURE); byte ctr; word32 i; word32 len; @@ -1279,7 +1296,7 @@ static int Hash512_DRBG_Reseed(DRBG_SHA512_internal* drbg, const byte* seed, static int Hash512_gen(DRBG_SHA512_internal* drbg, byte* out, word32 outSz, const byte* V) { - int ret = DRBG_FAILURE; + int ret = WC_NO_ERR_TRACE(DRBG_FAILURE); word32 i; word32 len; #if defined(WOLFSSL_SMALL_STACK_CACHE) @@ -1524,7 +1541,7 @@ static int Hash512_DRBG_Instantiate(DRBG_SHA512_internal* drbg, const byte* perso, word32 persoSz, void* heap, int devId) { - int ret = DRBG_FAILURE; + int ret = WC_NO_ERR_TRACE(DRBG_FAILURE); XMEMSET(drbg, 0, sizeof(DRBG_SHA512_internal)); drbg->heap = heap; @@ -2237,11 +2254,11 @@ static int _InitRng(WC_RNG* rng, byte* nonce, word32 nonceSz, rng->status = DRBG_OK; ret = 0; } - else if (ret == DRBG_CONT_FAILURE) { + else if (ret == WC_NO_ERR_TRACE(DRBG_CONT_FAILURE)) { rng->status = DRBG_CONT_FAILED; ret = DRBG_CONT_FIPS_E; } - else if (ret == DRBG_FAILURE) { + else if (ret == WC_NO_ERR_TRACE(DRBG_FAILURE)) { rng->status = DRBG_FAILED; ret = RNG_FAILURE_E; } @@ -2341,7 +2358,7 @@ int wc_InitRngNonce_ex(WC_RNG* rng, byte* nonce, word32 nonceSz, #if defined(HAVE_HASHDRBG) && !defined(CUSTOM_RAND_GENERATE_BLOCK) static int PollAndReSeed(WC_RNG* rng) { - int ret = DRBG_NEED_RESEED; + int ret = WC_NO_ERR_TRACE(DRBG_NEED_RESEED); int devId = INVALID_DEVID; #if defined(WOLFSSL_ASYNC_CRYPT) || defined(WOLF_CRYPTO_CB) devId = rng->devId; @@ -2518,7 +2535,7 @@ int wc_RNG_GenerateBlock(WC_RNG* rng, byte* output, word32 sz) if (rng->drbgType == WC_DRBG_SHA256) { ret = Hash_DRBG_Generate((DRBG_internal *)rng->drbg, output, sz, NULL, 0); - if (ret == DRBG_NEED_RESEED) { + if (ret == WC_NO_ERR_TRACE(DRBG_NEED_RESEED)) { ret = PollAndReSeed(rng); if (ret == DRBG_SUCCESS) ret = Hash_DRBG_Generate((DRBG_internal *)rng->drbg, output, @@ -2531,7 +2548,7 @@ int wc_RNG_GenerateBlock(WC_RNG* rng, byte* output, word32 sz) if (rng->drbgType == WC_DRBG_SHA512) { ret = Hash512_DRBG_Generate((DRBG_SHA512_internal *)rng->drbg512, output, sz, NULL, 0); - if (ret == DRBG_NEED_RESEED) { + if (ret == WC_NO_ERR_TRACE(DRBG_NEED_RESEED)) { ret = PollAndReSeed(rng); if (ret == DRBG_SUCCESS) ret = Hash512_DRBG_Generate( @@ -2548,7 +2565,7 @@ int wc_RNG_GenerateBlock(WC_RNG* rng, byte* output, word32 sz) if (ret == DRBG_SUCCESS) { ret = 0; } - else if (ret == DRBG_CONT_FAILURE) { + else if (ret == WC_NO_ERR_TRACE(DRBG_CONT_FAILURE)) { ret = DRBG_CONT_FIPS_E; rng->status = DRBG_CONT_FAILED; } @@ -2737,7 +2754,7 @@ static int wc_RNG_HealthTest_ex_internal(DRBG_internal* drbg, byte* output, word32 outputSz, void* heap, int devId) { - int ret = -1; + int ret = WC_NO_ERR_TRACE(WC_FAILURE); if (seedA == NULL || output == NULL) { return BAD_FUNC_ARG; @@ -2793,7 +2810,7 @@ static int wc_RNG_HealthTest_ex_internal(DRBG_internal* drbg, #ifndef WOLFSSL_SMALL_STACK_CACHE /* This is safe to call even if Hash_DRBG_Instantiate fails */ if (Hash_DRBG_Uninstantiate(drbg) != 0) { - ret = -1; + ret = WC_FAILURE; } #endif @@ -2806,7 +2823,7 @@ int wc_RNG_HealthTest_ex(int reseed, const byte* nonce, word32 nonceSz, byte* output, word32 outputSz, void* heap, int devId) { - int ret = -1; + int ret = WC_NO_ERR_TRACE(WC_FAILURE); DRBG_internal* drbg; #ifndef WOLFSSL_SMALL_STACK DRBG_internal drbg_var; @@ -3038,7 +3055,7 @@ static int wc_RNG_HealthTestLocal(WC_RNG* rng, int reseed, void* heap, if (ret == 0) { if (ConstantCompare(check512, sha512_outputA_data, RNG_HEALTH_TEST_CHECK_SIZE_SHA512) != 0) - ret = -1; + ret = WC_FAILURE; } } else { @@ -3053,7 +3070,7 @@ static int wc_RNG_HealthTestLocal(WC_RNG* rng, int reseed, void* heap, if (ret == 0) { if (ConstantCompare(check512, sha512_outputB_data, RNG_HEALTH_TEST_CHECK_SIZE_SHA512) != 0) - ret = -1; + ret = WC_FAILURE; } } @@ -3121,7 +3138,7 @@ static int wc_RNG_HealthTestLocal(WC_RNG* rng, int reseed, void* heap, if (ret == 0) { if (ConstantCompare(check, outputA, RNG_HEALTH_TEST_CHECK_SIZE) != 0) - ret = -1; + ret = WC_FAILURE; } #ifdef WOLFSSL_USE_FLASHMEM @@ -3173,7 +3190,7 @@ static int wc_RNG_HealthTestLocal(WC_RNG* rng, int reseed, void* heap, #if defined(DEBUG_WOLFSSL) WOLFSSL_MSG_EX("Random ConstantCompare failed: err = %d", ret); #endif - ret = -1; + ret = WC_FAILURE; } } @@ -3190,7 +3207,7 @@ static int wc_RNG_HealthTestLocal(WC_RNG* rng, int reseed, void* heap, heap, devId); if (ret == 0) { if (ConstantCompare(check, outputB, sizeof(outputB_data)) != 0) - ret = -1; + ret = WC_FAILURE; } } @@ -3226,7 +3243,7 @@ static int wc_RNG_HealthTest_SHA512_ex_internal(DRBG_SHA512_internal* drbg, byte* output, word32 outputSz, void* heap, int devId) { - int ret = -1; + int ret = WC_NO_ERR_TRACE(WC_FAILURE); if (seedA == NULL || output == NULL) { return BAD_FUNC_ARG; @@ -3279,7 +3296,7 @@ static int wc_RNG_HealthTest_SHA512_ex_internal(DRBG_SHA512_internal* drbg, #ifndef WOLFSSL_SMALL_STACK_CACHE if (Hash512_DRBG_Uninstantiate(drbg) != 0) { - ret = -1; + ret = WC_FAILURE; } #endif @@ -3299,7 +3316,7 @@ int wc_RNG_HealthTest_SHA512_ex(int reseed, byte* output, word32 outputSz, void* heap, int devId) { - int ret = -1; + int ret = WC_NO_ERR_TRACE(WC_FAILURE); DRBG_SHA512_internal* drbg; #ifndef WOLFSSL_SMALL_STACK DRBG_SHA512_internal drbg_var; @@ -3364,7 +3381,7 @@ int wc_RNG_HealthTest_SHA512(int reseed, const byte* seedB, word32 seedBSz, byte* output, word32 outputSz) { - int ret = -1; + int ret = WC_NO_ERR_TRACE(WC_FAILURE); DRBG_SHA512_internal* drbg; #ifndef WOLFSSL_SMALL_STACK DRBG_SHA512_internal drbg_var; diff --git a/wolfssl/wolfcrypt/random.h b/wolfssl/wolfcrypt/random.h index 102f05d6b55..d9c5a9289b9 100644 --- a/wolfssl/wolfcrypt/random.h +++ b/wolfssl/wolfcrypt/random.h @@ -343,15 +343,19 @@ enum wc_DrbgType { #endif /* RNG health states */ -#define WC_DRBG_NOT_INIT 0 -#define WC_DRBG_OK 1 -#define WC_DRBG_FAILED 2 -#define WC_DRBG_CONT_FAILED 3 +enum wc_RngHealthState { + WC_DRBG_NOT_INIT = 0, + WC_DRBG_OK = 1, + WC_DRBG_FAILED = 2, + WC_DRBG_CONT_FAILED = 3, #ifdef WC_RNG_BANK_SUPPORT - #define WC_DRBG_BANKREF 4 /* Marks the WC_RNG as a ref to a wc_rng_bank, - * with no usable DRBG of its own. - */ + WC_DRBG_BANKREF = 4, /* Marks the WC_RNG as a ref to a wc_rng_bank, + * with no usable DRBG of its own. + */ + #define WC_HAVE_RNG_BANKREF #endif + WOLF_ENUM_DUMMY_LAST_ELEMENT(wc_RngHealthState) +}; /* RNG context */ struct WC_RNG { From 558d90cb1d23458cbf932965699484c7663e33c1 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Tue, 4 Aug 2026 00:57:23 -0500 Subject: [PATCH 19/44] wolfcrypt/src/rng_bank.c, wolfssl/wolfcrypt/rng_bank.h, linuxkm/lkcapi_rsa_glue.c, linuxkm/lkcapi_sha_glue.c, wolfcrypt/test/test.c: * Use defined(WC_HAVE_RNG_BANKREF), not defined(WC_RNG_BANK_SUPPORT), as the feature sensor for RNG bankrefs. * Add DRBG_KAT_FIPS_E and DRBG_CONT_FIPS_E to the list of immediate-failure errors in wc_rng_bank_init(). --- linuxkm/lkcapi_rsa_glue.c | 2 +- linuxkm/lkcapi_sha_glue.c | 4 ++-- wolfcrypt/src/rng_bank.c | 11 ++++++----- wolfcrypt/test/test.c | 30 +++++++++++++++++------------- wolfssl/wolfcrypt/rng_bank.h | 9 +++++++-- 5 files changed, 33 insertions(+), 23 deletions(-) diff --git a/linuxkm/lkcapi_rsa_glue.c b/linuxkm/lkcapi_rsa_glue.c index 5120061ae15..98c5a5b07ac 100644 --- a/linuxkm/lkcapi_rsa_glue.c +++ b/linuxkm/lkcapi_rsa_glue.c @@ -635,7 +635,7 @@ static int km_rsa_ctx_init(struct km_rsa_ctx * ctx, int hash_oid) static inline int km_rsa_ctx_init_rng(struct km_rsa_ctx * ctx) { switch (ctx->rng.status) { case WC_DRBG_OK: -#ifdef WC_RNG_BANK_SUPPORT +#ifdef WC_HAVE_RNG_BANKREF case WC_DRBG_BANKREF: #endif return 0; diff --git a/linuxkm/lkcapi_sha_glue.c b/linuxkm/lkcapi_sha_glue.c index 201aa615404..8a8e800ee52 100644 --- a/linuxkm/lkcapi_sha_glue.c +++ b/linuxkm/lkcapi_sha_glue.c @@ -2214,8 +2214,8 @@ int wc_linux_kernel_rng_is_wolfcrypt(struct crypto_rng *rng) { } } -#ifndef WC_DRBG_BANKREF - #error LINUXKM_LKCAPI_REGISTER_HASH_DRBG_DEFAULT requires WC_DRBG_BANKREF support. +#ifndef WC_HAVE_RNG_BANKREF + #error LINUXKM_LKCAPI_REGISTER_HASH_DRBG_DEFAULT requires WC_HAVE_RNG_BANKREF. #endif WC_MAYBE_UNUSED static int linuxkm_InitRng_DefaultRef(WC_RNG* rng) { diff --git a/wolfcrypt/src/rng_bank.c b/wolfcrypt/src/rng_bank.c index c3b88e28a2c..55fb4663f06 100644 --- a/wolfcrypt/src/rng_bank.c +++ b/wolfcrypt/src/rng_bank.c @@ -153,9 +153,10 @@ WOLFSSL_API int wc_rng_bank_init( case WC_NO_ERR_TRACE(BUFFER_E): case WC_NO_ERR_TRACE(OPEN_RAN_E): case WC_NO_ERR_TRACE(FIPS_NOT_ALLOWED_E): + case WC_NO_ERR_TRACE(DRBG_KAT_FIPS_E): + case WC_NO_ERR_TRACE(DRBG_CONT_FIPS_E): goto out; } - /* Allow interrupt only if we're stuck spinning retries -- i.e., * don't allow an untimely user signal to derail an * initialization that is proceeding expeditiously. @@ -704,7 +705,7 @@ WOLFSSL_API int wc_rng_bank_checkout( return ret; } -#ifdef WC_DRBG_BANKREF +#ifdef WC_HAVE_RNG_BANKREF WOLFSSL_LOCAL int wc_local_rng_bank_checkout_for_bankref( struct wc_rng_bank *bank, struct wc_rng_bank_inst **rng_inst) @@ -716,7 +717,7 @@ WOLFSSL_LOCAL int wc_local_rng_bank_checkout_for_bankref( ((bank->affinity_get_id_cb != NULL) ? WC_RNG_BANK_FLAG_PREFER_AFFINITY_INST : 0) | ((bank->affinity_lock_cb != NULL) ? WC_RNG_BANK_FLAG_AFFINITY_LOCK : 0)); } -#endif /* WC_DRBG_BANKREF */ +#endif /* WC_HAVE_RNG_BANKREF */ static WC_INLINE int rng_inst_matches_bank( struct wc_rng_bank *bank, @@ -1013,7 +1014,7 @@ WOLFSSL_API int wc_rng_bank_reseed(struct wc_rng_bank *bank, return 0; } -#ifdef WC_DRBG_BANKREF +#ifdef WC_HAVE_RNG_BANKREF WOLFSSL_API int wc_InitRng_BankRef(struct wc_rng_bank *bank, WC_RNG *rng) { @@ -1105,6 +1106,6 @@ WOLFSSL_API int wc_rng_new_bankref(struct wc_rng_bank *bank, WC_RNG **rng) { } #endif /* !WC_RNG_BANK_STATIC && !WC_NO_CONSTRUCTORS */ -#endif /* WC_DRBG_BANKREF */ +#endif /* WC_HAVE_RNG_BANKREF */ #endif /* WC_RNG_BANK_SUPPORT */ diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index 0ec8dece597..055fb0e2345 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -25586,13 +25586,13 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t random_bank_test(void) int ret; WC_DECLARE_VAR(bank, struct wc_rng_bank, 1, HEAP_HINT); struct wc_rng_bank_inst *rng_inst = NULL; -#ifdef WC_DRBG_BANKREF +#ifdef WC_HAVE_RNG_BANKREF WC_DECLARE_VAR(rng, WC_RNG, 1, HEAP_HINT); #endif #ifndef WC_RNG_BANK_STATIC struct wc_rng_bank *bank2 = NULL; struct wc_rng_bank_inst *rng_inst2 = NULL; -#ifdef WC_DRBG_BANKREF +#ifdef WC_HAVE_RNG_BANKREF WC_RNG *rng2 = NULL; #endif #endif /* !WC_RNG_BANK_STATIC */ @@ -25604,7 +25604,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t random_bank_test(void) DYNAMIC_TYPE_TMP_BUFFER, return WC_TEST_RET_ENC_EC(MEMORY_E)); -#ifdef WC_DRBG_BANKREF +#ifdef WC_HAVE_RNG_BANKREF WC_ALLOC_VAR_EX(rng, WC_RNG, 1, HEAP_HINT, DYNAMIC_TYPE_TMP_BUFFER, ERROR_OUT(WC_TEST_RET_ENC_EC(MEMORY_E), out)); @@ -25651,13 +25651,17 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t random_bank_test(void) if (rng_bank_affinity_lock_lock != bank_arg + 1) ERROR_OUT(WC_TEST_RET_ENC_NC, out); - /* if we can, confirm that WC_RNG_BANK_FLAG_NO_VECTOR_OPS worked. */ + /* If we can, confirm that WC_RNG_BANK_FLAG_NO_VECTOR_OPS worked. Only + * applicable to old FIPS. + */ #if defined(USE_INTEL_SPEEDUP) && \ defined(WOLFSSL_KERNEL_MODE) && \ defined(WOLFSSL_SMALL_STACK_CACHE) && \ defined(WC_C_DYNAMIC_FALLBACK) && \ defined(HAVE_HASHDRBG) && \ - defined(WC_NO_INTERNAL_FUNCTION_POINTERS) + defined(WC_NO_INTERNAL_FUNCTION_POINTERS) && \ + defined(HAVE_FIPS) && \ + FIPS_VERSION3_LT(7,0,0) #ifdef WOLFSSL_DRBG_SHA512 if (rng_inst->rng.drbgType == WC_DRBG_SHA512) { if (((struct DRBG_SHA512_internal *)rng_inst->rng.drbg512)->sha512.sha_method != 5 /* SHA512_C */) @@ -25719,7 +25723,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t random_bank_test(void) if (XMEMCMP(outbuf1, outbuf2, sizeof(outbuf1)) == 0) ERROR_OUT(WC_TEST_RET_ENC_NC, out); -#ifdef WC_DRBG_BANKREF +#ifdef WC_HAVE_RNG_BANKREF ret = wc_InitRng_BankRef(NULL, rng); if (ret != WC_NO_ERR_TRACE(BAD_FUNC_ARG)) ERROR_OUT(WC_TEST_RET_ENC_EC(ret), out); @@ -25875,7 +25879,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t random_bank_test(void) if (ret != WC_NO_ERR_TRACE(BAD_FUNC_ARG)) ERROR_OUT(WC_TEST_RET_ENC_EC(ret), out); -#ifdef WC_DRBG_BANKREF +#ifdef WC_HAVE_RNG_BANKREF if (wolfSSL_RefCur(bank->refcount) != 2) ERROR_OUT(WC_TEST_RET_ENC_NC, out); @@ -25918,7 +25922,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t random_bank_test(void) if (ret != 0) ERROR_OUT(WC_TEST_RET_ENC_EC(ret), out); -#ifdef WC_DRBG_BANKREF +#ifdef WC_HAVE_RNG_BANKREF ret = wc_InitRng_BankRef(NULL, rng); if (ret != 0) ERROR_OUT(WC_TEST_RET_ENC_EC(ret), out); @@ -26043,7 +26047,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t random_bank_test(void) if (ret != 0) ERROR_OUT(WC_TEST_RET_ENC_EC(ret), out); -#ifdef WC_DRBG_BANKREF +#ifdef WC_HAVE_RNG_BANKREF ret = wc_rng_new_bankref(NULL, &rng2); if (ret != WC_NO_ERR_TRACE(BAD_FUNC_ARG)) ERROR_OUT(WC_TEST_RET_ENC_EC(ret), out); @@ -26079,7 +26083,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t random_bank_test(void) if (wolfSSL_RefCur(bank2->refcount) != 1) ERROR_OUT(WC_TEST_RET_ENC_NC, out); -#endif /* WC_DRBG_BANKREF */ +#endif /* WC_HAVE_RNG_BANKREF */ ret = wc_rng_bank_free(&bank2); if (ret != 0) @@ -26094,12 +26098,12 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t random_bank_test(void) { int cleanup_ret; -#ifdef WC_DRBG_BANKREF +#ifdef WC_HAVE_RNG_BANKREF cleanup_ret = wc_FreeRng(rng); if ((cleanup_ret != 0) && (ret == 0)) ret = WC_TEST_RET_ENC_EC(cleanup_ret); WC_FREE_VAR_EX(rng, HEAP_HINT, DYNAMIC_TYPE_TMP_BUFFER); -#endif /* WC_DRBG_BANKREF */ +#endif /* WC_HAVE_RNG_BANKREF */ if (rng_inst) { cleanup_ret = wc_rng_bank_checkin(bank, &rng_inst); if ((cleanup_ret != 0) && (ret == 0)) @@ -26113,7 +26117,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t random_bank_test(void) WC_FREE_VAR_EX(bank, HEAP_HINT, DYNAMIC_TYPE_TMP_BUFFER); #ifndef WC_RNG_BANK_STATIC -#ifdef WC_DRBG_BANKREF +#ifdef WC_HAVE_RNG_BANKREF if (rng2) wc_rng_free(rng2); #endif diff --git a/wolfssl/wolfcrypt/rng_bank.h b/wolfssl/wolfcrypt/rng_bank.h index bdc8577fdc4..f1e102ef0fa 100644 --- a/wolfssl/wolfcrypt/rng_bank.h +++ b/wolfssl/wolfcrypt/rng_bank.h @@ -164,7 +164,12 @@ WOLFSSL_API int wc_rng_bank_reseed(struct wc_rng_bank *bank, int timeout_secs, word32 flags); -#ifdef WC_DRBG_BANKREF +#if defined(WC_DRBG_BANKREF) && !defined(WC_HAVE_RNG_BANKREF) + /* forward compat for FIPS v5.2.4 random.h */ + #define WC_HAVE_RNG_BANKREF +#endif + +#ifdef WC_HAVE_RNG_BANKREF WOLFSSL_API int wc_InitRng_BankRef(struct wc_rng_bank *bank, WC_RNG *rng); WOLFSSL_API int wc_BankRef_Release(WC_RNG *rng); @@ -173,7 +178,7 @@ WOLFSSL_API int wc_BankRef_Release(WC_RNG *rng); WOLFSSL_API int wc_rng_new_bankref(struct wc_rng_bank *bank, WC_RNG **rng); /* note, free with wc_rng_free(). */ #endif -#endif /* WC_DRBG_BANKREF */ +#endif /* WC_HAVE_RNG_BANKREF */ #define WC_RNG_BANK_INST_TO_RNG(rng_inst) (&(rng_inst)->rng) From d4293a24170f9b16a1edf74fc6c60a3fe05c86d1 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Tue, 4 Aug 2026 01:01:03 -0500 Subject: [PATCH 20/44] wolfcrypt/src/fe_x25519_asm.{S,asm}, wolfcrypt/src/sp_x86_64_asm.{S,asm}: The AVX2 constant-time table-lookup routines seed a broadcast vector with a legacy-SSE GPR->XMM move (movd/movq), which writes bits [127:0] and leaves [255:128] UNMODIFIED, then read the register at full YMM width via vpermd %ymm,%ymm(zeroed),%ymm (a lane-0 broadcast across all 256 bits). If a prior vector op left the upper lane non-zero, the broadcast is corrupt and the constant-time selection returns the wrong table entry -- a wrong ECC point/entry in sp_{256,384,521}_get_{point_33,entry_64,entry_65}_avx2 and sp_{2048,3072,4096}_get_from_table_avx2, or a wrong X25519 public key from fe_cmov_table_avx2. Deterministic given register history; surfaces as intermittent failures because it depends on the upper lane being dirty on entry. Under kernel_fpu_begin (which does not zero YMM) a dirty upper lane is ambient, which is why ED25519 asm was kept disabled in kernel mode. Fix: emit the VEX form (vmovd for 32-bit source, vmovq for 64-bit), which zeroes [255:128]. --- wolfcrypt/src/fe_x25519_asm.S | 4 +- wolfcrypt/src/fe_x25519_asm.asm | 4 +- wolfcrypt/src/sp_x86_64_asm.S | 20 +++++----- wolfcrypt/src/sp_x86_64_asm.asm | 66 ++++++++++++++++----------------- 4 files changed, 47 insertions(+), 47 deletions(-) diff --git a/wolfcrypt/src/fe_x25519_asm.S b/wolfcrypt/src/fe_x25519_asm.S index ae75178afc8..94943554487 100644 --- a/wolfcrypt/src/fe_x25519_asm.S +++ b/wolfcrypt/src/fe_x25519_asm.S @@ -12572,9 +12572,9 @@ _fe_cmov_table_avx2: xorb %dl, %al subb %dl, %al movb %al, %bl - movd %ebx, %xmm7 + vmovd %ebx, %xmm7 movq $0x01, %rbx - movd %rbx, %xmm9 + vmovq %rbx, %xmm9 vmovdqa %ymm9, %ymm3 vmovdqa %ymm9, %ymm4 vpxor %ymm8, %ymm8, %ymm8 diff --git a/wolfcrypt/src/fe_x25519_asm.asm b/wolfcrypt/src/fe_x25519_asm.asm index 7071f384e64..cbbb99a44e5 100644 --- a/wolfcrypt/src/fe_x25519_asm.asm +++ b/wolfcrypt/src/fe_x25519_asm.asm @@ -10995,9 +10995,9 @@ fe_cmov_table_avx2 PROC xor al, dl sub al, dl mov bl, al - movd xmm7, ebx + vmovd xmm7, ebx mov rbx, 1 - movd xmm9, rbx + vmovq xmm9, rbx vmovdqa ymm3, ymm9 vmovdqa ymm4, ymm9 vpxor ymm8, ymm8, ymm8 diff --git a/wolfcrypt/src/sp_x86_64_asm.S b/wolfcrypt/src/sp_x86_64_asm.S index 2670c19406c..3994867b4e0 100644 --- a/wolfcrypt/src/sp_x86_64_asm.S +++ b/wolfcrypt/src/sp_x86_64_asm.S @@ -10389,8 +10389,8 @@ WC_ASM_ATT_HIDDEN(_sp_2048_get_from_table_avx2_16) _sp_2048_get_from_table_avx2_16: #endif /* __APPLE__ */ movq $0x01, %rax - movd %rdx, %xmm10 - movd %rax, %xmm11 + vmovq %rdx, %xmm10 + vmovq %rax, %xmm11 vpxor %ymm13, %ymm13, %ymm13 vpermd %ymm10, %ymm13, %ymm10 vpermd %ymm11, %ymm13, %ymm11 @@ -12839,8 +12839,8 @@ WC_ASM_ATT_HIDDEN(_sp_2048_get_from_table_avx2_32) _sp_2048_get_from_table_avx2_32: #endif /* __APPLE__ */ movq $0x01, %rax - movd %rdx, %xmm10 - movd %rax, %xmm11 + vmovq %rdx, %xmm10 + vmovq %rax, %xmm11 vpxor %ymm13, %ymm13, %ymm13 vpermd %ymm10, %ymm13, %ymm10 vpermd %ymm11, %ymm13, %ymm11 @@ -27260,8 +27260,8 @@ WC_ASM_ATT_HIDDEN(_sp_3072_get_from_table_avx2_24) _sp_3072_get_from_table_avx2_24: #endif /* __APPLE__ */ movq $0x01, %rax - movd %rdx, %xmm10 - movd %rax, %xmm11 + vmovq %rdx, %xmm10 + vmovq %rax, %xmm11 vpxor %ymm13, %ymm13, %ymm13 vpermd %ymm10, %ymm13, %ymm10 vpermd %ymm11, %ymm13, %ymm11 @@ -30870,8 +30870,8 @@ WC_ASM_ATT_HIDDEN(_sp_3072_get_from_table_avx2_48) _sp_3072_get_from_table_avx2_48: #endif /* __APPLE__ */ movq $0x01, %rax - movd %rdx, %xmm10 - movd %rax, %xmm11 + vmovq %rdx, %xmm10 + vmovq %rax, %xmm11 vpxor %ymm13, %ymm13, %ymm13 vpermd %ymm10, %ymm13, %ymm10 vpermd %ymm11, %ymm13, %ymm11 @@ -41904,8 +41904,8 @@ WC_ASM_ATT_HIDDEN(_sp_4096_get_from_table_avx2_64) _sp_4096_get_from_table_avx2_64: #endif /* __APPLE__ */ movq $0x01, %rax - movd %rdx, %xmm10 - movd %rax, %xmm11 + vmovq %rdx, %xmm10 + vmovq %rax, %xmm11 vpxor %ymm13, %ymm13, %ymm13 vpermd %ymm10, %ymm13, %ymm10 vpermd %ymm11, %ymm13, %ymm11 diff --git a/wolfcrypt/src/sp_x86_64_asm.asm b/wolfcrypt/src/sp_x86_64_asm.asm index 473a44325cc..1256f1bf81c 100644 --- a/wolfcrypt/src/sp_x86_64_asm.asm +++ b/wolfcrypt/src/sp_x86_64_asm.asm @@ -10060,8 +10060,8 @@ sp_2048_get_from_table_avx2_16 PROC vmovdqu OWORD PTR [rsp+104], xmm12 vmovdqu OWORD PTR [rsp+120], xmm13 mov rax, 1 - movd xmm10, r8 - movd xmm11, rax + vmovq xmm10, r8 + vmovq xmm11, rax vpxor ymm13, ymm13, ymm13 vpermd ymm10, ymm13, ymm10 vpermd ymm11, ymm13, ymm11 @@ -12424,8 +12424,8 @@ sp_2048_get_from_table_avx2_32 PROC vmovdqu OWORD PTR [rsp+104], xmm12 vmovdqu OWORD PTR [rsp+120], xmm13 mov rax, 1 - movd xmm10, r8 - movd xmm11, rax + vmovq xmm10, r8 + vmovq xmm11, rax vpxor ymm13, ymm13, ymm13 vpermd ymm10, ymm13, ymm10 vpermd ymm11, ymm13, ymm11 @@ -26390,8 +26390,8 @@ sp_3072_get_from_table_avx2_24 PROC vmovdqu OWORD PTR [rsp+104], xmm12 vmovdqu OWORD PTR [rsp+120], xmm13 mov rax, 1 - movd xmm10, r8 - movd xmm11, rax + vmovq xmm10, r8 + vmovq xmm11, rax vpxor ymm13, ymm13, ymm13 vpermd ymm10, ymm13, ymm10 vpermd ymm11, ymm13, ymm11 @@ -29914,8 +29914,8 @@ sp_3072_get_from_table_avx2_48 PROC vmovdqu OWORD PTR [rsp+104], xmm12 vmovdqu OWORD PTR [rsp+120], xmm13 mov rax, 1 - movd xmm10, r8 - movd xmm11, rax + vmovq xmm10, r8 + vmovq xmm11, rax vpxor ymm13, ymm13, ymm13 vpermd ymm10, ymm13, ymm10 vpermd ymm11, ymm13, ymm11 @@ -40655,8 +40655,8 @@ sp_4096_get_from_table_avx2_64 PROC vmovdqu OWORD PTR [rsp+104], xmm12 vmovdqu OWORD PTR [rsp+120], xmm13 mov rax, 1 - movd xmm10, r8 - movd xmm11, rax + vmovq xmm10, r8 + vmovq xmm11, rax vpxor ymm13, ymm13, ymm13 vpermd ymm10, ymm13, ymm10 vpermd ymm11, ymm13, ymm11 @@ -43984,7 +43984,7 @@ sp_256_get_point_33_4 PROC movdqu OWORD PTR [rsp+136], xmm14 movdqu OWORD PTR [rsp+152], xmm15 mov rax, 1 - movd xmm13, r8d + vmovd xmm13, r8d add rdx, 200 movd xmm15, eax mov rax, 32 @@ -44058,9 +44058,9 @@ sp_256_get_point_33_avx2_4 PROC vmovdqu OWORD PTR [rsp+40], xmm8 vmovdqu OWORD PTR [rsp+56], xmm9 mov rax, 1 - movd xmm7, r8d + vmovd xmm7, r8d add rdx, 200 - movd xmm9, eax + vmovd xmm9, eax mov rax, 32 vpxor ymm8, ymm8, ymm8 vpermd ymm7, ymm8, ymm7 @@ -44757,9 +44757,9 @@ sp_256_get_entry_64_avx2_4 PROC vmovdqu OWORD PTR [rsp+8], xmm6 vmovdqu OWORD PTR [rsp+24], xmm7 mov rax, 1 - movd xmm5, r8d + vmovd xmm5, r8d add rdx, 64 - movd xmm7, eax + vmovd xmm7, eax mov rax, 64 vpxor ymm6, ymm6, ymm6 vpermd ymm5, ymm6, ymm5 @@ -44865,9 +44865,9 @@ sp_256_get_entry_65_avx2_4 PROC vmovdqu OWORD PTR [rsp+8], xmm6 vmovdqu OWORD PTR [rsp+24], xmm7 mov rax, 1 - movd xmm5, r8d + vmovd xmm5, r8d add rdx, 64 - movd xmm7, eax + vmovd xmm7, eax mov rax, 65 vpxor ymm6, ymm6, ymm6 vpermd ymm5, ymm6, ymm5 @@ -48011,7 +48011,7 @@ sp_384_get_point_33_6 PROC movdqu OWORD PTR [rsp+136], xmm14 movdqu OWORD PTR [rsp+152], xmm15 mov rax, 1 - movd xmm13, r8d + vmovd xmm13, r8d add rdx, 296 movd xmm15, eax mov rax, 32 @@ -48057,7 +48057,7 @@ L_384_get_point_33_6_start_1: movdqu OWORD PTR [rcx+112], xmm4 movdqu OWORD PTR [rcx+128], xmm5 mov rax, 1 - movd xmm13, r8d + vmovd xmm13, r8d sub rdx, 9472 movd xmm15, eax mov rax, 32 @@ -48122,9 +48122,9 @@ sp_384_get_point_33_avx2_6 PROC vmovdqu OWORD PTR [rsp+136], xmm14 vmovdqu OWORD PTR [rsp+152], xmm15 mov rax, 1 - movd xmm13, r8d + vmovd xmm13, r8d add rdx, 296 - movd xmm15, eax + vmovd xmm15, eax mov rax, 32 vpxor ymm14, ymm14, ymm14 vpermd ymm13, ymm14, ymm13 @@ -48724,9 +48724,9 @@ sp_384_get_entry_64_avx2_6 PROC vmovdqu OWORD PTR [rsp+72], xmm10 vmovdqu OWORD PTR [rsp+88], xmm11 mov rax, 1 - movd xmm9, r8d + vmovd xmm9, r8d add rdx, 96 - movd xmm11, eax + vmovd xmm11, eax mov rax, 64 vpxor ymm10, ymm10, ymm10 vpermd ymm9, ymm10, ymm9 @@ -48868,9 +48868,9 @@ sp_384_get_entry_65_avx2_6 PROC vmovdqu OWORD PTR [rsp+72], xmm10 vmovdqu OWORD PTR [rsp+88], xmm11 mov rax, 1 - movd xmm9, r8d + vmovd xmm9, r8d add rdx, 96 - movd xmm11, eax + vmovd xmm11, eax mov rax, 65 vpxor ymm10, ymm10, ymm10 vpermd ymm9, ymm10, ymm9 @@ -53341,7 +53341,7 @@ sp_521_get_point_33_9 PROC movdqu OWORD PTR [rsp+144], xmm15 mov r14, 1 mov rax, 1 - movd xmm13, r8d + vmovd xmm13, r8d IFNDEF SP_ALIGN_16 add rdx, 440 ELSE @@ -53407,7 +53407,7 @@ ENDIF movdqu OWORD PTR [rcx+160], xmm5 mov r14, 1 mov rax, 1 - movd xmm13, r8d + vmovd xmm13, r8d IFNDEF SP_ALIGN_16 sub rdx, 14080 ELSE @@ -53519,13 +53519,13 @@ sp_521_get_point_33_avx2_9 PROC vmovdqu OWORD PTR [rsp+144], xmm15 mov rdi, 1 mov rax, 1 - movd xmm13, r8d + vmovd xmm13, r8d IFNDEF SP_ALIGN_16 add rdx, 440 ELSE add rdx, 448 ENDIF - movd xmm15, eax + vmovd xmm15, eax mov rax, 32 vpxor ymm14, ymm14, ymm14 vpermd ymm13, ymm14, ymm13 @@ -55255,9 +55255,9 @@ sp_521_get_entry_64_avx2_9 PROC vmovdqu OWORD PTR [rsp+80], xmm11 mov r14, 1 mov rax, 1 - movd xmm9, r8d + vmovd xmm9, r8d add rdx, 144 - movd xmm11, eax + vmovd xmm11, eax mov rax, 64 vpxor ymm10, ymm10, ymm10 vpermd ymm9, ymm10, ymm9 @@ -55472,9 +55472,9 @@ sp_521_get_entry_65_avx2_9 PROC vmovdqu OWORD PTR [rsp+80], xmm11 mov r14, 1 mov rax, 1 - movd xmm9, r8d + vmovd xmm9, r8d add rdx, 144 - movd xmm11, eax + vmovd xmm11, eax mov rax, 65 vpxor ymm10, ymm10, ymm10 vpermd ymm9, ymm10, ymm9 From 0e1a3f91c2deb243f1b8249f7410ed12253480b9 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Tue, 4 Aug 2026 01:08:14 -0500 Subject: [PATCH 21/44] wolfcrypt/src/falcon.c, configure.ac, wolfcrypt/benchmark/benchmark.c, wolfcrypt/test/test.h, wolfcrypt/test/test.c: Falcon fixes and cleanups: wolfcrypt/src/falcon.c: * define _WC_BUILDING_FALCON_C; * add #error arch guards -- WOLFSSL_FALCON_FPR_ASM requires x86-64 (wc_falcon_fpr_x86_64_asm.S), WOLFSSL_FALCON_FFT_AVX2 requires an x86 target, WOLFSSL_FALCON_FFT_NEON requires AArch64 (ARM32 NEON lacks the double-precision lanes used by float64x2_t); * drop the unused FALCON_PRIMES forward declaration; * fix u->U literals and an (sword64)z0*(sword64)z0 overflow; * tightened __uint128_t guard. wolfcrypt/benchmark/benchmark.c: * falcon message buffer -> WC_ALLOC_VAR; * bench wiring for the experimental algs. wolfcrypt/test/test.h: add frodokem_test / falcon_test externs. wolfcrypt/test/test.c: mldsa/falcon WC_ALLOC_VAR conversions. configure.ac: update all-quantum-crypto with the experimental algorithms. --- configure.ac | 26 ++++ wolfcrypt/benchmark/benchmark.c | 51 +++++-- wolfcrypt/src/falcon.c | 251 +++++++++++++++++--------------- wolfcrypt/test/test.c | 134 ++++++++++++----- wolfcrypt/test/test.h | 6 + 5 files changed, 300 insertions(+), 168 deletions(-) diff --git a/configure.ac b/configure.ac index bd7d123af92..144b1b41942 100644 --- a/configure.ac +++ b/configure.ac @@ -1809,6 +1809,32 @@ then test "$enable_xmss" = "" && enable_xmss=yes test "$enable_lms" = "" && enable_lms=yes test "$enable_slhdsa" = "" && enable_slhdsa='yes,sha2' + + if test "$ENABLED_EXPERIMENTAL" = "yes" + then + test "$enable_extra_pqc_hybrids" = "" && enable_extra_pqc_hybrids=yes + test "$enable_frodokem" = "" && enable_frodokem=yes + test "$enable_frodokem" = yes && test "$enable_frodokem_shake" = "" && enable_frodokem_shake=yes + test "$enable_frodokem" = yes && test "$enable_frodokem_aes" = "" && enable_frodokem_aes=yes + test "$enable_frodokem" = yes && test "$enable_frodokem_ephemeral" = "" && enable_frodokem_ephemeral=yes + if test "$enable_falcon" = "" + then + if test "$ENABLED_ASM" = "no" + then + enable_falcon=yes + else + case $host_cpu in + *x86_64* | *amd64*) if test "$ENABLED_32BIT" != "yes"; then + enable_falcon=asm + else + enable_falcon=yes + fi + ;; + *) enable_falcon=yes;; + esac + fi + fi + fi fi # kernel-appropriate settings, also in enable-all-crypto above: diff --git a/wolfcrypt/benchmark/benchmark.c b/wolfcrypt/benchmark/benchmark.c index 08679f0f9e3..9934e77b5fd 100644 --- a/wolfcrypt/benchmark/benchmark.c +++ b/wolfcrypt/benchmark/benchmark.c @@ -15799,38 +15799,48 @@ void bench_sakke(void) void bench_falconKeySign(byte level) { int ret = 0; - falcon_key key; + WC_DECLARE_VAR(key, falcon_key, 1, HEAP_HINT); + int key_inited = 0; double start; int i, count; - byte sig[FALCON_MAX_SIG_SIZE]; - byte msg[512]; + WC_DECLARE_VAR(sig, byte, FALCON_MAX_SIG_SIZE, HEAP_HINT); + #define BENCH_FALCONKEYSIGN_MSG_SIZE 512 + WC_DECLARE_VAR(msg, byte, BENCH_FALCONKEYSIGN_MSG_SIZE, HEAP_HINT); word32 x = 0; const char**desc = bench_desc_words[lng_index]; DECLARE_MULTI_VALUE_STATS_VARS() + WC_ALLOC_VAR(key, falcon_key, 1, HEAP_HINT); + WC_ALLOC_VAR(sig, byte, FALCON_MAX_SIG_SIZE, HEAP_HINT); + WC_ALLOC_VAR(msg, byte, BENCH_FALCONKEYSIGN_MSG_SIZE, HEAP_HINT); + bench_stats_prepare(); - ret = wc_falcon_init_ex(&key, HEAP_HINT, devId); - if (ret != 0) { + ret = wc_falcon_init_ex(key, HEAP_HINT, devId); + if (ret == 0) + key_inited = 1; + else { printf("wc_falcon_init_ex failed %d\n", ret); - return; + goto exit; } - ret = wc_falcon_set_level(&key, level); - if (ret != 0) { - printf("wc_falcon_set_level failed %d\n", ret); + if (ret == 0) { + ret = wc_falcon_set_level(key, level); + if (ret != 0) { + printf("wc_falcon_set_level failed %d\n", ret); + } } if (ret == 0) { word32 idx = 0; if (level == 1) { ret = wc_Falcon_PrivateKeyDecode(bench_falcon_level1_key, &idx, - &key, + key, sizeof_bench_falcon_level1_key); } else { ret = wc_Falcon_PrivateKeyDecode(bench_falcon_level5_key, &idx, - &key, + key, sizeof_bench_falcon_level5_key); } @@ -15840,7 +15850,7 @@ void bench_falconKeySign(byte level) } /* make dummy msg */ - for (i = 0; i < (int)sizeof(msg); i++) { + for (i = 0; i < BENCH_FALCONKEYSIGN_MSG_SIZE; i++) { msg[i] = (byte)i; } @@ -15855,7 +15865,8 @@ void bench_falconKeySign(byte level) x = FALCON_LEVEL5_SIG_SIZE; } - ret = wc_falcon_sign_msg(msg, sizeof(msg), sig, &x, &key, GLOBAL_RNG); + ret = wc_falcon_sign_msg(msg, BENCH_FALCONKEYSIGN_MSG_SIZE, + sig, &x, key, GLOBAL_RNG); if (ret != 0) { printf("wc_falcon_sign_msg failed\n"); } @@ -15884,8 +15895,10 @@ void bench_falconKeySign(byte level) for (i = 0; i < agreeTimes; i++) { if (ret == 0) { int verify = 0; - ret = wc_falcon_verify_msg(sig, x, msg, sizeof(msg), &verify, - &key); + ret = wc_falcon_verify_msg(sig, x, msg, + BENCH_FALCONKEYSIGN_MSG_SIZE, + &verify, + key); if (ret != 0 || verify != 1) { printf("wc_falcon_verify_msg failed %d, verify %d\n", ret, verify); @@ -15909,7 +15922,13 @@ void bench_falconKeySign(byte level) #endif } - wc_falcon_free(&key); +exit: + + if (key_inited) + wc_falcon_free(key); + WC_FREE_VAR(key, HEAP_HINT); + WC_FREE_VAR(sig, HEAP_HINT); + WC_FREE_VAR(msg, HEAP_HINT); } #endif /* HAVE_FALCON */ diff --git a/wolfcrypt/src/falcon.c b/wolfcrypt/src/falcon.c index c4868411439..62da7cb5238 100644 --- a/wolfcrypt/src/falcon.c +++ b/wolfcrypt/src/falcon.c @@ -19,6 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#define _WC_BUILDING_FALCON_C + #include #if defined(HAVE_FALCON) @@ -38,8 +40,6 @@ #include -#if defined(HAVE_FALCON) - #ifdef __cplusplus extern "C" { #endif @@ -139,7 +139,6 @@ extern const fpr fpr_ptwo63; /* 2^63 */ } /* extern "C" */ #endif -#endif /* HAVE_FALCON */ #endif /* WOLF_CRYPT_WC_FALCON_FPR_H */ #ifndef WOLF_CRYPT_WC_FALCON_FFT_H #define WOLF_CRYPT_WC_FALCON_FFT_H @@ -268,6 +267,18 @@ WOLFSSL_LOCAL void falcon_poly_merge_fft_avx2(fpr* f, const fpr* f0, #include #endif +#if defined(WOLFSSL_FALCON_FPR_ASM) && !defined(__x86_64__) + #error "WOLFSSL_FALCON_FPR_ASM requires x86-64 (wc_falcon_fpr_x86_64_asm.S)." +#endif +#if defined(WOLFSSL_FALCON_FFT_AVX2) && \ + !defined(__x86_64__) && !defined(__i386__) + #error "WOLFSSL_FALCON_FFT_AVX2 requires an x86 target." +#endif +#if defined(WOLFSSL_FALCON_FFT_NEON) && !defined(__aarch64__) + /* ARM32 NEON lacks double-precision lanes (used by float64x2_t). */ + #error "WOLFSSL_FALCON_FFT_NEON requires AArch64." +#endif + /* Every fpr backend except the default integer-emulated one runs on the * FP/vector register file: the scalar-double backend and the generated x86-64 * fpr asm use x87/SSE (xmm), and the AVX2/NEON FFT uses ymm / Q vector @@ -311,9 +322,6 @@ typedef struct falcon_small_prime { word32 s; } falcon_small_prime; -/* RNS prime table (terminated with a { 0, 0, 0 } sentinel). */ -static const falcon_small_prime FALCON_PRIMES[]; - /* ---- modular small-integer helpers (single 31-bit prime modulus) ---- */ static word32 modp_set(sword32 x, word32 p); static sword32 modp_norm(word32 x, word32 p); @@ -617,31 +625,31 @@ static int falcon_sign_core(falcon_sampler_ctx* spc, const fpr* expanded, -/* ------------------------------------------------------------------------ */ +/* ------------------------------------------------------------------------- */ /* Low-level helpers. */ /* */ /* These shift helpers tolerate a (possibly secret) shift count in 0..63 in */ /* constant time: a variable shift is split into a fixed conditional 32-bit */ /* part plus a 0..31 part, avoiding both undefined behaviour and any */ /* operand-dependent timing on platforms whose shift is data dependent. */ -/* ------------------------------------------------------------------------ */ +/* ------------------------------------------------------------------------- */ /* Right-shift a 64-bit unsigned value by n (0..63), constant-time. */ -static WC_INLINE fpr fpr_ursh(word64 x, int n) +static WC_MAYBE_UNUSED WC_INLINE fpr fpr_ursh(word64 x, int n) { x ^= (x ^ (x >> 32)) & ((word64)0 - (word64)(n >> 5)); return x >> (n & 31); } /* Right-shift a 64-bit signed value by n (0..63), constant-time. */ -static WC_INLINE sword64 fpr_irsh(sword64 x, int n) +static WC_MAYBE_UNUSED WC_INLINE sword64 fpr_irsh(sword64 x, int n) { x ^= (x ^ (x >> 32)) & ((sword64)0 - (sword64)(n >> 5)); return x >> (n & 31); } /* Left-shift a 64-bit unsigned value by n (0..63), constant-time. */ -static WC_INLINE word64 fpr_ulsh(word64 x, int n) +static WC_MAYBE_UNUSED WC_INLINE word64 fpr_ulsh(word64 x, int n) { x ^= (x ^ (x << 32)) & ((word64)0 - (word64)(n >> 5)); return x << (n & 31); @@ -720,7 +728,7 @@ static WC_INLINE fpr FPR(int s, int e, word64 m) } while (0) /* ------------------------------------------------------------------------ */ -/* Constructors / conversions. */ +/* Constructors / conversions. */ /* ------------------------------------------------------------------------ */ #ifndef WOLFSSL_FALCON_FPR_DOUBLE /* inline backend provides fpr_scaled */ @@ -846,7 +854,7 @@ sword64 fpr_trunc(fpr x) } /* ------------------------------------------------------------------------ */ -/* Arithmetic. */ +/* Arithmetic. */ /* ------------------------------------------------------------------------ */ fpr fpr_add(fpr x, fpr y) @@ -1108,7 +1116,7 @@ fpr fpr_sqrt(fpr x) } /* ------------------------------------------------------------------------ */ -/* Predicates. */ +/* Predicates. */ /* ------------------------------------------------------------------------ */ int fpr_lt(fpr x, fpr y) @@ -1141,9 +1149,10 @@ int fpr_lt(fpr x, fpr y) * targets it is a single multiply instruction; the portable 32x32 fallback * (one MUL becomes four) is kept for platforms without a 128-bit integer type * (e.g. Cortex-M). Both paths are constant-time and bit-identical. */ -#if defined(__SIZEOF_INT128__) +#if defined(HAVE___UINT128_T) && !defined(NO_INT128) && \ + defined(__SIZEOF_INT128__) #define FALCON_MULHI(z, y) \ - ((word64)(((unsigned __int128)(word64)(z) * (unsigned __int128)(word64)(y)) >> 64)) + ((word64)(((__uint128_t)(word64)(z) * (__uint128_t)(word64)(y)) >> 64)) #else static WC_INLINE word64 falcon_mulhi(word64 z, word64 y) { @@ -1167,19 +1176,19 @@ word64 fpr_expm_p63(fpr x, fpr ccs) * deviation from the true value over the 0..log(2) range is below * 2^(-50). */ static const word64 C[] = { - 0x00000004741183A3u, - 0x00000036548CFC06u, - 0x0000024FDCBF140Au, - 0x0000171D939DE045u, - 0x0000D00CF58F6F84u, - 0x000680681CF796E3u, - 0x002D82D8305B0FEAu, - 0x011111110E066FD0u, - 0x0555555555070F00u, - 0x155555555581FF00u, - 0x400000000002B400u, - 0x7FFFFFFFFFFF4800u, - 0x8000000000000000u + 0x00000004741183A3U, + 0x00000036548CFC06U, + 0x0000024FDCBF140AU, + 0x0000171D939DE045U, + 0x0000D00CF58F6F84U, + 0x000680681CF796E3U, + 0x002D82D8305B0FEAU, + 0x011111110E066FD0U, + 0x0555555555070F00U, + 0x155555555581FF00U, + 0x400000000002B400U, + 0x7FFFFFFFFFFF4800U, + 0x8000000000000000U }; word64 z, y; @@ -1210,7 +1219,7 @@ word64 fpr_expm_p63(fpr x, fpr ccs) } /* ------------------------------------------------------------------------ */ -/* Named constants: IEEE-754 binary64 bit patterns. */ +/* Named constants: IEEE-754 binary64 bit patterns. */ /* ------------------------------------------------------------------------ */ const fpr fpr_zero = 0; @@ -3947,7 +3956,7 @@ size_t falcon_comp_encode(byte* out, size_t max_out, const sword16* x, w = (unsigned)t; acc <<= 7; - acc |= w & 127u; + acc |= w & 127U; w >>= 7; acc_len += 8; @@ -4178,13 +4187,13 @@ size_t falcon_privkey_encode(byte* sk, size_t max_sk, const sword8* f, -/* ------------------------------------------------------------------------ */ +/* ------------------------------------------------------------------------- */ /* fpr constants needed by the sampler that are not exported by the seam. */ /* */ /* These are IEEE-754 binary64 bit patterns, identical to the values used by */ /* the Falcon reference (fpr.h). Each has been verified by decoding the bit */ /* pattern back to the documented decimal value (shown in the comment). */ -/* ------------------------------------------------------------------------ */ +/* ------------------------------------------------------------------------- */ /* log(2) = 0.6931471805599453 */ static const fpr falcon_fpr_log2 = (fpr)4604418534313441775U; @@ -4212,16 +4221,16 @@ static const fpr falcon_fpr_sigma_min[11] = { (fpr)4608525754002622308U /* logn 10: 1.2982803343 */ }; -/* ------------------------------------------------------------------------ */ -/* SHAKE256 pseudo-random byte stream. */ -/* */ +/* -------------------------------------------------------------------------- */ +/* SHAKE256 pseudo-random byte stream. */ +/* */ /* Construction: absorb FALCON_PRNG_SEED_LEN fresh bytes from WC_RNG into a */ -/* SHAKE256 sponge, then squeeze the output in fixed FALCON_PRNG_BLOCKS-block */ -/* batches. get_u64 reads 8 stream bytes little-endian; get_u8 reads one. */ +/* SHAKE256 sponge, then squeeze the output in fixed FALCON_PRNG_BLOCKS-block */ +/* batches. get_u64 reads 8 stream bytes little-endian; get_u8 reads one. */ /* The refill is a fixed-size squeeze, hence constant-time; consumption order */ -/* (and thus how many bytes are discarded at a refill boundary) never */ -/* depends on a secret. */ -/* ------------------------------------------------------------------------ */ +/* (and thus how many bytes are discarded at a refill boundary) never */ +/* depends on a secret. */ +/* -------------------------------------------------------------------------- */ /* Squeeze a fresh batch of blocks into the buffer. Constant-time. */ static int falcon_prng_refill(falcon_prng* p) @@ -4329,7 +4338,7 @@ word64 falcon_prng_get_u64(falcon_prng* p) return v; } -/* ------------------------------------------------------------------------ */ +/* ------------------------------------------------------------------------- */ /* gaussian0: base half-Gaussian sampler (centered on 0, sigma0 = 1.8205). */ /* */ /* Faithful port of Pornin's reference gaussian0_sampler. The RCDT (reverse */ @@ -4339,31 +4348,31 @@ word64 falcon_prng_get_u64(falcon_prng* p) /* same table that appears in PQClean's */ /* crypto_sign/falcon-512/clean/sign.c */ /* and in the original Falcon round-3 reference. Do not edit these numbers. */ -/* ------------------------------------------------------------------------ */ +/* ------------------------------------------------------------------------- */ int falcon_gaussian0(falcon_prng* p) { /* RCDT for the half-Gaussian of standard deviation sigma0 = 1.8205, * verbatim from the Falcon reference (Thomas Pornin). Each row holds a * 72-bit value as (hi24, mid24, lo24). */ static const word32 dist[] = { - 10745844u, 3068844u, 3741698u, - 5559083u, 1580863u, 8248194u, - 2260429u, 13669192u, 2736639u, - 708981u, 4421575u, 10046180u, - 169348u, 7122675u, 4136815u, - 30538u, 13063405u, 7650655u, - 4132u, 14505003u, 7826148u, - 417u, 16768101u, 11363290u, - 31u, 8444042u, 8086568u, - 1u, 12844466u, 265321u, - 0u, 1232676u, 13644283u, - 0u, 38047u, 9111839u, - 0u, 870u, 6138264u, - 0u, 14u, 12545723u, - 0u, 0u, 3104126u, - 0u, 0u, 28824u, - 0u, 0u, 198u, - 0u, 0u, 1u + 10745844U, 3068844U, 3741698U, + 5559083U, 1580863U, 8248194U, + 2260429U, 13669192U, 2736639U, + 708981U, 4421575U, 10046180U, + 169348U, 7122675U, 4136815U, + 30538U, 13063405U, 7650655U, + 4132U, 14505003U, 7826148U, + 417U, 16768101U, 11363290U, + 31U, 8444042U, 8086568U, + 1U, 12844466U, 265321U, + 0U, 1232676U, 13644283U, + 0U, 38047U, 9111839U, + 0U, 870U, 6138264U, + 0U, 14U, 12545723U, + 0U, 0U, 3104126U, + 0U, 0U, 28824U, + 0U, 0U, 198U, + 0U, 0U, 1U }; word32 v0, v1, v2, hi; @@ -4374,8 +4383,8 @@ int falcon_gaussian0(falcon_prng* p) /* Get a random 72-bit value, into three 24-bit limbs v0..v2. */ lo = falcon_prng_get_u64(p); hi = (word32)falcon_prng_get_u8(p); - v0 = (word32)lo & 0xFFFFFFu; - v1 = (word32)(lo >> 24) & 0xFFFFFFu; + v0 = (word32)lo & 0xFFFFFFU; + v1 = (word32)(lo >> 24) & 0xFFFFFFU; v2 = (word32)(lo >> 48) | (hi << 16); /* Sampled value is z, the number of leading table thresholds that the @@ -4396,13 +4405,13 @@ int falcon_gaussian0(falcon_prng* p) return z; } -/* ------------------------------------------------------------------------ */ +/* ------------------------------------------------------------------------- */ /* BerExp: Bernoulli test, returns 1 with probability ccs * exp(-x). */ /* */ /* Faithful port of Pornin's reference BerExp. x >= 0 is guaranteed by the */ /* caller. The only data-dependent loop is the lazy 8-bit comparison, whose */ /* iteration count depends on fresh random bytes, not on secrets. */ -/* ------------------------------------------------------------------------ */ +/* ------------------------------------------------------------------------- */ static int falcon_berexp(falcon_prng* p, fpr x, fpr ccs) { int s, i; @@ -4418,7 +4427,7 @@ static int falcon_berexp(falcon_prng* p, fpr x, fpr ccs) /* It may happen (rarely) that s >= 64; if so, BerExp would be non-zero * with probability below 2^-64, so we simply saturate s at 63. */ sw = (word32)s; - sw ^= (sw ^ 63u) & (word32)(0U - ((63u - sw) >> 31)); + sw ^= (sw ^ 63U) & (word32)(0U - ((63U - sw) >> 31)); s = (int)sw; /* exp(-r), scaled to 2^63, scaled up to 2^64, then >> s to obtain @@ -4430,17 +4439,17 @@ static int falcon_berexp(falcon_prng* p, fpr x, fpr ccs) i = 64; do { i -= 8; - w = (word32)falcon_prng_get_u8(p) - ((word32)(z >> i) & 0xFFu); + w = (word32)falcon_prng_get_u8(p) - ((word32)(z >> i) & 0xFFU); } while ((w == 0) && (i > 0)); return (int)(w >> 31); } -/* ------------------------------------------------------------------------ */ -/* sampler (SamplerZ): discrete Gaussian of center mu, std dev 1/isigma. */ -/* */ +/* -------------------------------------------------------------------------- */ +/* sampler (SamplerZ): discrete Gaussian of center mu, std dev 1/isigma. */ +/* */ /* Faithful port of Pornin's reference sampler. ctx is an falcon_sampler_ctx. */ -/* ------------------------------------------------------------------------ */ +/* -------------------------------------------------------------------------- */ int falcon_sampler_z(void* ctx, fpr mu, fpr isigma) { falcon_sampler_ctx* spc = (falcon_sampler_ctx*)ctx; @@ -4482,7 +4491,7 @@ int falcon_sampler_z(void* ctx, fpr mu, fpr isigma) * The sigma_min scaling in ccs decorrelates the rejection rate from * mu/sigma, keeping the whole sampler constant-time. */ x = fpr_mul(fpr_sqr(fpr_sub(fpr_of((sword64)z), r)), dss); - x = fpr_sub(x, fpr_mul(fpr_of((sword64)(z0 * z0)), + x = fpr_sub(x, fpr_mul(fpr_of(((sword64)z0 * (sword64)z0)), falcon_fpr_inv_2sqrsigma0)); if (falcon_berexp(&spc->p, x, ccs)) { /* Rejection was centered on r; the actual center is mu = s + r. */ @@ -4492,7 +4501,7 @@ int falcon_sampler_z(void* ctx, fpr mu, fpr isigma) } /* ------------------------------------------------------------------------ */ -/* Context initialisation. */ +/* Context initialisation. */ /* ------------------------------------------------------------------------ */ int falcon_sampler_init(falcon_sampler_ctx* spc, int logn, WC_RNG* rng) { @@ -4532,7 +4541,7 @@ static const size_t FALCON_KEYGEN_TEMP[] = { }; /* ==================================================================== */ -/* modp helper local to keygen (not part of the shared bigint API). */ +/* modp helper local to keygen (not part of the shared bigint API). */ /* * Given polynomial f in NTT representation modulo p, compute f' of degree @@ -4555,13 +4564,13 @@ static void modp_poly_rec_res(word32* f, unsigned logn, } /* ==================================================================== */ -/* SHAKE256 stream RNG (seeded from WC_RNG). */ +/* SHAKE256 stream RNG (seeded from WC_RNG). */ typedef struct { wc_Shake shake; byte buf[WC_SHA3_256_BLOCK_SIZE]; /* 136-byte SHAKE256 rate block */ - size_t ptr; /* next unread byte in buf */ - int err; /* sticky squeeze error */ + size_t ptr; /* next unread byte in buf */ + int err; /* sticky squeeze error */ } falcon_rng; static int falcon_rng_init(falcon_rng* r, WC_RNG* rng, void* heap) @@ -4629,9 +4638,9 @@ static word64 get_rng_u64(falcon_rng* r) } /* ==================================================================== */ -/* Self-contained mod-q (q = 12289) negacyclic NTT used only to compute */ -/* the public key h = g/f mod q. (modp_* targets 31-bit primes, so a */ -/* dedicated small-modulus transform is used for q here.) */ +/* Self-contained mod-q (q = 12289) negacyclic NTT used only to compute */ +/* the public key h = g/f mod q. (modp_* targets 31-bit primes, so a */ +/* dedicated small-modulus transform is used for q here.) */ static word32 mq_modpow(word32 b, word32 e) { @@ -4751,7 +4760,7 @@ static int falcon_compute_public(word16* h, const sword8* f, const sword8* g, mq_build_tables((int)logn, psi, zetas, izetas); for (u = 0; u < n; u++) { - int xf = f[u], xg = g[u]; + int xf = (int)f[u], xg = (int)g[u]; if (xf < 0) { xf += FALCON_Q; } @@ -5061,7 +5070,7 @@ static word32 poly_small_sqnorm(const sword8* f, unsigned logn) for (u = 0; u < n; u++) { sword32 z; - z = f[u]; + z = (sword32)f[u]; s += (word32)(z * z); ng |= s; } @@ -6425,16 +6434,16 @@ static const fpr fpr_inv_sigma[] = { * common.c l2bound[]. */ static const word32 l2bound[] = { 0, /* unused */ - 101498u, - 208714u, - 428865u, - 892039u, - 1852696u, - 3842630u, - 7959734u, - 16468416u, - 34034726u, - 70265242u + 101498U, + 208714U, + 428865U, + 892039U, + 1852696U, + 3842630U, + 7959734U, + 16468416U, + 34034726U, + 70265242U }; /* ==================================================================== */ @@ -7533,14 +7542,14 @@ static int falcon_sign_dyn_core(falcon_sampler_ctx* spc, const sword8* f, * specification / reference implementation (l2bound table). */ static const word32 falcon_l2bound[] = { /* 0..8 unused */ 0, 0, 0, 0, 0, 0, 0, 0, 0, - 34034726u, /* logn = 9 (Falcon-512) */ - 70265242u /* logn = 10 (Falcon-1024) */ + 34034726U, /* logn = 9 (Falcon-512) */ + 70265242U /* logn = 10 (Falcon-1024) */ }; -/* ------------------------------------------------------------------------ */ -/* Small modular helpers (correctness-first; hot paths are accelerated by the - * generated per-arch backends in a later phase). */ -/* ------------------------------------------------------------------------ */ +/* -------------------------------------------------------------------------- */ +/* Small modular helpers (correctness-first; hot paths are accelerated by the */ +/* generated per-arch backends in a later phase). */ +/* -------------------------------------------------------------------------- */ static word32 falcon_modpow(word32 b, word32 e) { @@ -7855,7 +7864,7 @@ static void falcon_get_tables(unsigned logn, const word16** zetas, * falcon_csub: a in [0, 2q) -> [0, q). */ static WC_INLINE word32 falcon_barrett(word32 a) { - word32 t = (word32)(((word64)a * 349496u) >> 32); + word32 t = (word32)(((word64)a * 349496U) >> 32); a -= t * FALCON_Q; a -= FALCON_Q & (word32)((sword32)(FALCON_Q - 1 - a) >> 31); return a; @@ -7873,12 +7882,16 @@ static WC_INLINE word32 falcon_csub(word32 a) * conditional subtract; the squared-norm accumulates two lanes per SMUAD. Every * result is bit-identical to the scalar Barrett path below. Define * WOLFSSL_FALCON_NO_NTT_DSP to force the portable C path. */ -#if !defined(WOLFSSL_FALCON_NTT_DSP) && defined(__ARM_FEATURE_DSP) && \ +#if !defined(WOLFSSL_FALCON_NTT_DSP) && \ + defined(__ARM_FEATURE_DSP) && defined(__ARM_FEATURE_SIMD32) && \ !defined(WOLFSSL_FALCON_NO_NTT_DSP) #define WOLFSSL_FALCON_NTT_DSP #endif #ifdef WOLFSSL_FALCON_NTT_DSP +#if !defined(__ARM_FEATURE_DSP) || !defined(__ARM_FEATURE_SIMD32) + #error "WOLFSSL_FALCON_NTT_DSP requires ACLE __ARM_FEATURE_DSP and __ARM_FEATURE_SIMD32." +#endif #include /* q replicated into both halfword lanes. */ #define FALCON_QPK (((word32)FALCON_Q << 16) | (word32)FALCON_Q) @@ -7890,7 +7903,7 @@ static WC_INLINE word32 falcon_smultb(word32 a, word32 b) /* a.hi * b.lo */ static WC_INLINE word32 falcon_smultt(word32 a, word32 b) /* a.hi * b.hi */ { return (word32)__smlatt(a, b, 0); } static WC_INLINE word32 falcon_pack(word32 lo, word32 hi) - { return (lo & 0xffffu) | (hi << 16); } + { return (lo & 0xffffU) | (hi << 16); } /* Two packed halfword lanes, each in [0, 2q) -> [0, q): USUB16 sets APSR.GE per * lane (set where x >= q), SEL then selects (x - q) on those lanes. */ static WC_INLINE word32 falcon_pcsub(word32 x) @@ -7981,7 +7994,7 @@ static void falcon_intt(word16* a, int n, const word16* izetas) } /* ------------------------------------------------------------------------ */ -/* Codec */ +/* Codec */ /* ------------------------------------------------------------------------ */ /* Decode the public key polynomial h: n coefficients packed 14 bits each, @@ -8111,7 +8124,7 @@ static int falcon_hash_to_point(const byte* nonce, const byte* msg, w = ((word32)block[bi] << 8) | (word32)block[bi + 1]; bi += 2; /* 61445 == 5 * q: keeps the distribution uniform mod q. */ - if (w < 61445u) { + if (w < 61445U) { while (w >= FALCON_Q) { w -= FALCON_Q; } @@ -8138,7 +8151,7 @@ static WC_INLINE sword32 falcon_center(word32 x) } /* ------------------------------------------------------------------------ */ -/* Public API */ +/* Public API */ /* ------------------------------------------------------------------------ */ static int falcon_level_params(byte level, unsigned* logn, int* n, word32* pubSz) @@ -8260,7 +8273,7 @@ int falcon_native_sign_msg(const byte* in, word32 inLen, byte* out, word32* outL fpr* tmp = NULL; byte* arena = NULL; /* single allocation backing all buffers */ size_t arenaSz = 0; - falcon_sampler_ctx spc; + WC_DECLARE_VAR(spc, falcon_sampler_ctx, 1, key ? key->heap : NULL); byte nonce[FALCON_NONCE_SIZE]; void* heap; int attempt, haveSpc = 0; @@ -8289,12 +8302,16 @@ int falcon_native_sign_msg(const byte* in, word32 inLen, byte* out, word32* outL } heap = key->heap; + WC_ALLOC_VAR(spc, falcon_sampler_ctx, 1, heap); + if (!WC_VAR_OK(spc)) + return MEMORY_E; + /* spc may hold seed-derived sampler state; baseline-zero and register it * before the arena/decode/sampler work so every goto-out and any future * early-exit path is covered by the check. */ #ifdef WOLFSSL_CHECK_MEM_ZERO - XMEMSET(&spc, 0, sizeof(spc)); - wc_MemZero_Add("falcon sign spc", &spc, sizeof(spc)); + XMEMSET(spc, 0, sizeof(*spc)); + wc_MemZero_Add("falcon sign spc", spc, sizeof(spc)); #endif /* One allocation backs every sign buffer (the working set is >100KB at @@ -8369,7 +8386,7 @@ int falcon_native_sign_msg(const byte* in, word32 inLen, byte* out, word32* outL goto out; } #endif - ret = falcon_sampler_init(&spc, (int)logn, rng); + ret = falcon_sampler_init(spc, (int)logn, rng); if (ret != 0) { goto out; } @@ -8387,9 +8404,9 @@ int falcon_native_sign_msg(const byte* in, word32 inLen, byte* out, word32* outL goto out; } #ifdef WOLFSSL_FALCON_SIGN_SMALL_MEM - ret = falcon_sign_dyn_core(&spc, f, g, F, G, c, s2, tmp, logn); + ret = falcon_sign_dyn_core(spc, f, g, F, G, c, s2, tmp, logn); #else - ret = falcon_sign_core(&spc, expanded, c, s2, tmp, logn); + ret = falcon_sign_core(spc, expanded, c, s2, tmp, logn); #endif if (ret != 0) { goto out; @@ -8426,14 +8443,16 @@ int falcon_native_sign_msg(const byte* in, word32 inLen, byte* out, word32* outL * WOLFSSL_ASYNC_CRYPT builds; without it that context leaks on every sign. * Only when falcon_sampler_init succeeded (haveSpc) is the context live. */ if (haveSpc) { - wc_Shake256_Free(&spc.p.shake); + wc_Shake256_Free(&spc->p.shake); } /* Always zeroize: the SHAKE sponge may hold seed-derived state even if * falcon_sampler_init failed after absorbing the seed. */ - ForceZero(&spc, sizeof(spc)); + ForceZero(spc, sizeof(*spc)); #ifdef WOLFSSL_CHECK_MEM_ZERO - wc_MemZero_Check(&spc, sizeof(spc)); + wc_MemZero_Check(spc, sizeof(*spc)); #endif + WC_FREE_VAR(spc, heap); + /* One ForceZero + free covers every secret in the arena (f/g/F/G, the * expanded basis, and the sign scratch). */ if (arena != NULL) { @@ -8512,12 +8531,12 @@ int falcon_native_check_key(falcon_key* key) } for (i = 0; i < n; i++) { - int x = f[i]; + int x = (int)f[i]; if (x < 0) { x += FALCON_Q; } ft[i] = (word16)x; - x = g[i]; + x = (int)g[i]; if (x < 0) { x += FALCON_Q; } @@ -10238,7 +10257,7 @@ void falcon_poly_merge_fft_avx2(fpr* f, const fpr* f0, const fpr* f1, /* b = f1 * gm : br=c1r*gcos-c1i*gsin, bi=c1r*gsin+c1i*gcos */ br = _mm256_fmsub_pd(c1r, gcos, _mm256_mul_pd(c1i, gsin)); bi = _mm256_fmadd_pd(c1r, gsin, _mm256_mul_pd(c1i, gcos)); - /* even (index 2u) = a + b ; odd (index 2u+1) = a - b */ + /* even (index 2U) = a + b ; odd (index 2U+1) = a - b */ tr = _mm256_add_pd(ar, br); /* even real */ ti = _mm256_sub_pd(ar, br); /* odd real */ falcon_int(tr, ti, &v0, &v1); diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index 055fb0e2345..866bb57b596 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -59712,51 +59712,70 @@ static wc_test_ret_t falcon_verify_kat(byte level, const byte* pk, word32 pkLen, const byte* sig, word32 sigLen) { wc_test_ret_t ret; - falcon_key key; + WC_DECLARE_VAR(key, falcon_key, 1, HEAP_HINT); + int falcon_key_inited = 0; int res; - byte badSig[FALCON_MAX_SIG_SIZE]; + WC_DECLARE_VAR(badSig, byte, FALCON_MAX_SIG_SIZE, HEAP_HINT); const byte* msg = (const byte*)FALCON_KAT_MSG; word32 msgLen = (word32)XSTRLEN(FALCON_KAT_MSG); + WC_ALLOC_VAR(key, falcon_key, 1, HEAP_HINT); + if (!WC_VAR_OK(key)) { + ret = WC_TEST_RET_ENC_EC(MEMORY_E); + goto out; + } + + WC_ALLOC_VAR(badSig, byte, FALCON_MAX_SIG_SIZE, HEAP_HINT); + if (!WC_VAR_OK(badSig)) { + ret = WC_TEST_RET_ENC_EC(MEMORY_E); + goto out; + } + /* Use the global test devId so that, when cryptocb_test() has registered a * device, verification is routed through the crypto callback. */ - ret = wc_falcon_init_ex(&key, HEAP_HINT, devId); - if (ret != 0) - return WC_TEST_RET_ENC_EC(ret); + ret = wc_falcon_init_ex(key, HEAP_HINT, devId); + if (ret != 0) { + ret = WC_TEST_RET_ENC_EC(ret); + goto out; + } + falcon_key_inited = 1; - ret = wc_falcon_set_level(&key, level); + ret = wc_falcon_set_level(key, level); if (ret != 0) { ret = WC_TEST_RET_ENC_EC(ret); goto out; } - ret = wc_falcon_import_public(pk, pkLen, &key); + ret = wc_falcon_import_public(pk, pkLen, key); if (ret != 0) { ret = WC_TEST_RET_ENC_EC(ret); goto out; } /* A genuine reference-produced signature must verify (res == 1). */ res = 0; - ret = wc_falcon_verify_msg(sig, sigLen, msg, msgLen, &res, &key); + ret = wc_falcon_verify_msg(sig, sigLen, msg, msgLen, &res, key); if (ret != 0) { ret = WC_TEST_RET_ENC_EC(ret); goto out; } if (res != 1) { ret = WC_TEST_RET_ENC_NC; goto out; } /* Flip a byte in the compressed signature body; it must NOT verify. The * verifier may report this either as an operational parse error or as a * clean res == 0; in all cases it must not claim the signature is valid. */ - if (sigLen > (word32)sizeof(badSig)) { ret = WC_TEST_RET_ENC_NC; goto out; } + if (sigLen > FALCON_MAX_SIG_SIZE) { ret = WC_TEST_RET_ENC_NC; goto out; } XMEMCPY(badSig, sig, sigLen); badSig[sigLen - 1] ^= 0x01; res = 1; - (void)wc_falcon_verify_msg(badSig, sigLen, msg, msgLen, &res, &key); + (void)wc_falcon_verify_msg(badSig, sigLen, msg, msgLen, &res, key); if (res == 1) { ret = WC_TEST_RET_ENC_NC; goto out; } ret = 0; out: - wc_falcon_free(&key); + if (falcon_key_inited) + wc_falcon_free(key); + WC_FREE_VAR(key, HEAP_HINT); + WC_FREE_VAR(badSig, HEAP_HINT); return ret; } #endif /* !WOLF_CRYPTO_CB_ONLY_FALCON */ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t falcon_test(void) { - wc_test_ret_t ret; + wc_test_ret_t ret = 0; #ifndef WOLF_CRYPTO_CB_ONLY_FALCON ret = falcon_verify_kat(FALCON_LEVEL1, FALCON512_pk, @@ -59777,44 +59796,78 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t falcon_test(void) word32 falconMsgLen = (word32)XSTRLEN(falconMsg); WC_RNG rng; int li; + WC_DECLARE_VAR(k, falcon_key, 1, HEAP_HINT); + WC_DECLARE_VAR(sig, byte, FALCON_MAX_SIG_SIZE, HEAP_HINT); ret = wc_InitRng_ex(&rng, HEAP_HINT, devId); if (ret != 0) - return ret; + return WC_TEST_RET_ENC_EC(ret); + + WC_ALLOC_VAR(k, falcon_key, 1, HEAP_HINT); + if (!WC_VAR_OK(k)) { + ret = WC_TEST_RET_ENC_EC(MEMORY_E); + goto exit; + } + + WC_ALLOC_VAR(sig, byte, FALCON_MAX_SIG_SIZE, HEAP_HINT); + if (!WC_VAR_OK(sig)) { + ret = WC_TEST_RET_ENC_EC(MEMORY_E); + goto exit; + } + for (li = 0; li < 2; li++) { - falcon_key k; - byte sig[FALCON_MAX_SIG_SIZE]; - word32 siglen = (word32)sizeof(sig); + word32 siglen = FALCON_MAX_SIG_SIZE; int res = 0; + int k_inited = 0; - ret = wc_falcon_init_ex(&k, HEAP_HINT, devId); - if (ret == 0) - ret = wc_falcon_set_level(&k, falconLvls[li]); - if (ret == 0) - ret = wc_falcon_make_key(&k, &rng); - if (ret == 0) + ret = wc_falcon_init_ex(k, HEAP_HINT, devId); + if (ret == 0) { + k_inited = 1; + ret = wc_falcon_set_level(k, falconLvls[li]); + } + else + ret = WC_TEST_RET_ENC_EC(ret); + if (ret == 0) { + ret = wc_falcon_make_key(k, &rng); + if (ret != 0) + ret = WC_TEST_RET_ENC_EC(ret); + } + if (ret == 0) { ret = wc_falcon_sign_msg((const byte*)falconMsg, falconMsgLen, sig, - &siglen, &k, &rng); - if (ret == 0) + &siglen, k, &rng); + if (ret != 0) + ret = WC_TEST_RET_ENC_EC(ret); + } + if (ret == 0) { ret = wc_falcon_verify_msg(sig, siglen, (const byte*)falconMsg, - falconMsgLen, &res, &k); + falconMsgLen, &res, k); + if (ret != 0) + ret = WC_TEST_RET_ENC_EC(ret); + } if (ret == 0 && res != 1) ret = WC_TEST_RET_ENC_NC; if (ret == 0) { /* A different message must be rejected. */ res = 1; (void)wc_falcon_verify_msg(sig, siglen, (const byte*)"x", 1, &res, - &k); + k); if (res != 0) ret = WC_TEST_RET_ENC_NC; } - wc_falcon_free(&k); - if (ret != 0) { - wc_FreeRng(&rng); - return ret; - } + if (k_inited) + wc_falcon_free(k); + if (ret != 0) + break; } + + exit: + wc_FreeRng(&rng); + WC_FREE_VAR(k, HEAP_HINT); + WC_FREE_VAR(sig, HEAP_HINT); + + if (ret != 0) + return ret; } #endif /* WC_FALCON_HAVE_NATIVE_SIGN */ #else /* WOLF_CRYPTO_CB_ONLY_FALCON */ @@ -59822,20 +59875,29 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t falcon_test(void) * operation when no crypto-callback device is available (INVALID_DEVID), * rather than silently doing nothing. */ { - falcon_key k; + WC_DECLARE_VAR(k, falcon_key, 1, HEAP_HINT); + int k_inited = 0; int res = 0; int r; - ret = wc_falcon_init(&k); + WC_ALLOC_VAR(k, falcon_key, 1, HEAP_HINT); + if (!WC_VAR_OK(k)) + ret = WC_TEST_RET_ENC_EC(MEMORY_E); if (ret == 0) - ret = wc_falcon_set_level(&k, FALCON_LEVEL1); + ret = wc_falcon_init(k); + if (ret == 0) { + k_inited = 1; + ret = wc_falcon_set_level(k, FALCON_LEVEL1); + } if (ret == 0) { r = wc_falcon_verify_msg((const byte*)"m", 1, (const byte*)"m", 1, - &res, &k); + &res, k); if (r != WC_NO_ERR_TRACE(NO_VALID_DEVID)) ret = WC_TEST_RET_ENC_NC; } - wc_falcon_free(&k); + if (k_inited) + wc_falcon_free(k); + WC_FREE_VAR(k, HEAP_HINT); if (ret != 0) return ret; } diff --git a/wolfcrypt/test/test.h b/wolfcrypt/test/test.h index d654e96ba6c..ab1f22e85b7 100644 --- a/wolfcrypt/test/test.h +++ b/wolfcrypt/test/test.h @@ -313,9 +313,15 @@ extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t scrypt_test(void); #ifdef WOLFSSL_HAVE_MLKEM extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t mlkem_test(void); #endif +#ifdef WOLFSSL_HAVE_FRODOKEM + extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t frodokem_test(void); +#endif #ifdef WOLFSSL_HAVE_MLDSA extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t mldsa_test(void); #endif +#ifdef HAVE_FALCON + extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t falcon_test(void); +#endif #if defined(WOLFSSL_HAVE_XMSS) #if !defined(WOLFSSL_SMALL_STACK) && WOLFSSL_XMSS_MIN_HEIGHT <= 10 extern WOLFSSL_TEST_SUBROUTINE wc_test_ret_t xmss_test_verify_only(void); From 4803bbd58e670d2e4f6ae03ff97807bdcaf91a0e Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Tue, 4 Aug 2026 01:14:18 -0500 Subject: [PATCH 22/44] wolfssl/test.h: convert err_sys() and err_sys_with_errno() to err_sys_func() / err_sys_with_errno_func() taking __FILE__ and __LINE__, with function-like macros preserving every existing call site; failure messages now carry file and line ("wolfSSL error, %s L %d: %s"). tests/suites.c: client_test / server_test failure reports go to stderr (printf -> fprintf(stderr, ...)). --- tests/suites.c | 4 ++-- wolfssl/test.h | 13 ++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/tests/suites.c b/tests/suites.c index 13ff4480ad2..f63de1d2880 100644 --- a/tests/suites.c +++ b/tests/suites.c @@ -841,7 +841,7 @@ static int execute_test_case(int svr_argc, char** svr_argv, /* verify results */ if ((cliArgs.return_code != 0 && cliTestShouldFail == 0) || (cliArgs.return_code == 0 && cliTestShouldFail != 0)) { - printf("client_test failed %d %s\n", cliArgs.return_code, + fprintf(stderr, "client_test failed %d %s\n", cliArgs.return_code, cliTestShouldFail ? "(should fail)" : ""); XEXIT(EXIT_FAILURE); } @@ -849,7 +849,7 @@ static int execute_test_case(int svr_argc, char** svr_argv, join_thread(serverThread); if ((svrArgs.return_code != 0 && svrTestShouldFail == 0) || (svrArgs.return_code == 0 && svrTestShouldFail != 0)) { - printf("server_test failed %d %s\n", svrArgs.return_code, + fprintf(stderr, "server_test failed %d %s\n", svrArgs.return_code, svrTestShouldFail ? "(should fail)" : ""); XEXIT(EXIT_FAILURE); } diff --git a/wolfssl/test.h b/wolfssl/test.h index c8f226444a0..abe701cf1a4 100644 --- a/wolfssl/test.h +++ b/wolfssl/test.h @@ -394,7 +394,7 @@ THREAD_RETURN #else WC_NORETURN void #endif -err_sys(const char* msg) +err_sys_func(const char* msg, const char *file, int line) { #if !defined(__GNUC__) /* scan-build (which pretends to be gnuc) can get confused and think the @@ -406,10 +406,11 @@ err_sys(const char* msg) if (msg) #endif { - fprintf(stderr, "wolfSSL error: %s\n", msg); + fprintf(stderr, "wolfSSL error, %s L %d: %s\n", file, line, msg); } XEXIT_T(EXIT_FAILURE); } +#define err_sys(msg) err_sys_func(msg, __FILE__, __LINE__) static WC_INLINE #if defined(WOLFSSL_FORCE_MALLOC_FAIL_TEST) || defined(WOLFSSL_ZEPHYR) @@ -417,7 +418,7 @@ THREAD_RETURN #else WC_NORETURN void #endif -err_sys_with_errno(const char* msg) +err_sys_with_errno_func(const char* msg, const char *file, int line) { #if !defined(__GNUC__) /* scan-build (which pretends to be gnuc) can get confused and think the @@ -430,13 +431,15 @@ err_sys_with_errno(const char* msg) #endif { #if defined(HAVE_STRING_H) && defined(HAVE_ERRNO_H) - fprintf(stderr, "wolfSSL error: %s: %s\n", msg, strerror(errno)); + fprintf(stderr, "wolfSSL error, %s L %d: %s: %s\n", file, line, + msg, strerror(errno)); #else - fprintf(stderr, "wolfSSL error: %s\n", msg); + fprintf(stderr, "wolfSSL error, %s L %d: %s\n", file, line, msg); #endif } XEXIT_T(EXIT_FAILURE); } +#define err_sys_with_errno(msg) err_sys_with_errno_func(msg, __FILE__, __LINE__) #define LIBCALL_CHECK_RET(...) do { \ int _libcall_ret = (__VA_ARGS__); \ From 2a3e1473b93a6787f967d9e67d964a24c7587fb1 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Tue, 4 Aug 2026 01:15:09 -0500 Subject: [PATCH 23/44] tests/api/test_cmac.c: add `&& !defined(WOLFSSL_KCAPI)` to two build guards. --- tests/api/test_cmac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/api/test_cmac.c b/tests/api/test_cmac.c index 5a49fbce64b..5b0b9423724 100644 --- a/tests/api/test_cmac.c +++ b/tests/api/test_cmac.c @@ -374,7 +374,7 @@ int test_wc_InitCmac_Id(void) { EXPECT_DECLS; #if defined(WOLFSSL_CMAC) && !defined(NO_AES) && defined(WOLFSSL_AES_128) && \ - defined(WOLF_PRIVATE_KEY_ID) + defined(WOLF_PRIVATE_KEY_ID) && !defined(WOLFSSL_KCAPI) Cmac cmac; byte id[16]; byte key[] = { @@ -421,7 +421,7 @@ int test_wc_InitCmac_Label(void) { EXPECT_DECLS; #if defined(WOLFSSL_CMAC) && !defined(NO_AES) && defined(WOLFSSL_AES_128) && \ - defined(WOLF_PRIVATE_KEY_ID) + defined(WOLF_PRIVATE_KEY_ID) && !defined(WOLFSSL_KCAPI) Cmac cmac; char longLabel[48]; byte key[] = { From 70cb3f029ac6d171022b3d97a0552effefa4da40 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Tue, 4 Aug 2026 01:19:13 -0500 Subject: [PATCH 24/44] Fix WC_C_DYNAMIC_FALLBACK in various quantum-resistant alg implementations: Under WC_C_DYNAMIC_FALLBACK, SAVE_VECTOR_REGISTERS2() can fail on any call, so two calls on the same object can dispatch differently. Each of these algorithms had state that silently assumed a single dispatch for its lifetime. wolfcrypt/src/wc_mldsa.c: add MLDSA_NTT_AVX2()/MLDSA_INVNTT_AVX2() selecting the "full" AVX2 NTT/invNTT under WC_C_DYNAMIC_FALLBACK. The non-full variants leave NTT-domain coefficients in a permuted, lane-interleaved order that only their matching consumers understand, whereas the full variants and the C implementations use standard order. NTT-domain data at rest (cached s1/s2/t0 vectors, the challenge polynomial) can be produced and consumed by differently-dispatched calls, so its representation must be dispatch-invariant. Without fallback, dispatch is invariant and the ~2%/~4% faster permuted-order variants are kept. Both pipelines are bit-identical end to end. wolfcrypt/src/wc_mlkem_poly.c: in mlkem_derive_secret(), re-initialize the shared SHAKE-256 object under WC_C_DYNAMIC_FALLBACK. The buffer-stuffing shortcut assumes a freshly initialized (zeroed) sponge, which no longer holds once the C fallback legs of mlkem_gen_matrix()/mlkem_get_noise() drive the XOF on that object and leave it mid-squeeze. wolfcrypt/src/wc_slhdsa.c: in slhdsakey_fors_sign(), replace the CAN_SAVE_VECTOR_REGISTERS() test with an actual SAVE_VECTOR_REGISTERS2() == 0 acquisition and a matching RESTORE_VECTOR_REGISTERS(), so the region is held rather than merely predicted to be available. wolfcrypt/src/wc_frodokem_mat.c: in the AES row kernels of frodokem_mul_add_as_plus_e_aes() and frodokem_mul_add_sa_plus_e_aes(), re-key with wc_AesSetKeyDirect() when IS_INTEL_AESNI() but !aes->use_aesni. The kernels consume aes->key directly, which holds an AES-NI-layout schedule only if SetKey ran with vector registers available; under fallback a failed SAVE_VECTOR_REGISTERS2() inside SetKey returns success having keyed only the C-fallback schedule. Re-keying happens inside the held region, where the nested save always succeeds. Loop conditions gain (ret == 0) so a re-key failure stops the run. wolfssl/wolfcrypt/settings.h: with the above, ML-KEM, ML-DSA, SLH-DSA and FrodoKEM are fuzzer-clean, so the DEBUG_VECTOR_REGISTER_ACCESS_FUZZING exclusion narrows from the _WC_BUILDING_WC_MLKEM_POLY_C / _WC_BUILDING_WC_MLDSA_C / _WC_BUILDING_WC_SLHDSA_C set to _WC_BUILDING_FALCON_C alone. Falcon stays excluded because it uses FP or vector registers in all of its asm implementations and there is no option yet to build the C-no-FP implementation alongside them. tests/api/test_mldsa.c: in test_mldsa_encode_w1_large_values(), pin dispatch to the C path with WC_DEBUG_SET_VECTOR_REGISTERS_RETVAL() for the duration of the test and restore it afterward. The two calls being compared are only specified -- and only equal -- on the valid input domain, so letting the fuzzer send them down different (AVX2 vs C) implementations is not a meaningful comparison. --- tests/api/test_mldsa.c | 13 ++++++++++ wolfcrypt/src/wc_frodokem_mat.c | 44 ++++++++++++++++++++++++++++++--- wolfcrypt/src/wc_mldsa.c | 28 +++++++++++++++++++-- wolfcrypt/src/wc_mlkem_poly.c | 22 +++++++++++++++++ wolfcrypt/src/wc_slhdsa.c | 3 ++- wolfssl/wolfcrypt/settings.h | 11 +++++---- 6 files changed, 109 insertions(+), 12 deletions(-) diff --git a/tests/api/test_mldsa.c b/tests/api/test_mldsa.c index e490b6e5949..c7abe5f6dc3 100644 --- a/tests/api/test_mldsa.c +++ b/tests/api/test_mldsa.c @@ -30055,6 +30055,14 @@ int test_mldsa_encode_w1_large_values(void) }; const int n_patterns = (int)(sizeof(patterns) / sizeof(patterns[0])); +#if defined(DEBUG_VECTOR_REGISTER_ACCESS) && \ + defined(DEBUG_VECTOR_REGISTER_ACCESS_FUZZING) + /* Pin dispatch to the C path: under SVR2 fuzzing the two calls can + * otherwise take different (AVX2 vs C) implementations, which are only + * specified - and only equal - on the valid input domain. */ + WC_DEBUG_SET_VECTOR_REGISTERS_RETVAL(WC_NO_ERR_TRACE(SYSLIB_FAILED_E)); +#endif + /* ---- 6-bit encoding (mldsa_encode_w1_88 path) ---- */ #ifndef WOLFSSL_NO_ML_DSA_44 { @@ -30140,6 +30148,11 @@ int test_mldsa_encode_w1_large_values(void) } #endif /* !WOLFSSL_NO_ML_DSA_65 || !WOLFSSL_NO_ML_DSA_87 */ +#if defined(DEBUG_VECTOR_REGISTER_ACCESS) && \ + defined(DEBUG_VECTOR_REGISTER_ACCESS_FUZZING) + WC_DEBUG_SET_VECTOR_REGISTERS_RETVAL(0); +#endif + #endif /* WOLFSSL_HAVE_MLDSA && sign/verify */ return EXPECT_RESULT(); } diff --git a/wolfcrypt/src/wc_frodokem_mat.c b/wolfcrypt/src/wc_frodokem_mat.c index 348abe84380..f80966b0b06 100644 --- a/wolfcrypt/src/wc_frodokem_mat.c +++ b/wolfcrypt/src/wc_frodokem_mat.c @@ -1730,7 +1730,19 @@ static int frodokem_mul_add_as_plus_e_aes(word16* out, const word16* s, #ifdef FRODOKEM_HAVE_MATRIX_ASM_AVX512 if ((ret == 0) && USE_INTEL_AVX512(cpuid_flags) && (SAVE_VECTOR_REGISTERS2() == 0)) { - for (i = 0; i < n; i += 8) { + /* The AES-NI/VAES row kernels below consume aes->key directly, which + * holds a valid AES-NI-layout key schedule only when the + * wc_AesSetKeyDirect() above ran with vector registers available + * (aes->use_aesni nonzero). Under WC_C_DYNAMIC_FALLBACK a failed + * SAVE_VECTOR_REGISTERS2() inside SetKey returns success having keyed + * only the C-fallback schedule (aes->key_C_fallback) - re-key under + * the held region, where the nested SAVE_VECTOR_REGISTERS2() always + * succeeds, so aes->key is valid for the kernels. */ + if (IS_INTEL_AESNI(cpuid_flags) && (! aes->use_aesni)) { + ret = wc_AesSetKeyDirect(aes, seedA, FRODOKEM_SEEDA_SZ, NULL, + AES_ENCRYPTION); + } + for (i = 0; (ret == 0) && (i < n); i += 8) { /* Widest matrix-A generator available at run time (cf. aes.c): * VAES (whole batch in one asm call), else the AES-NI register * kernel, else the per-row C generator. */ @@ -1760,7 +1772,13 @@ static int frodokem_mul_add_as_plus_e_aes(word16* out, const word16* s, #ifdef FRODOKEM_HAVE_MATRIX_ASM if ((ret == 0) && IS_INTEL_AVX2(cpuid_flags) && (SAVE_VECTOR_REGISTERS2() == 0)) { - for (i = 0; i < n; i += 4) { + /* Re-key if SetKey lacked vector registers - see the note in the + * AVX512 branch above (or in frodokem_mul_add_as_plus_e_aes). */ + if (IS_INTEL_AESNI(cpuid_flags) && (! aes->use_aesni)) { + ret = wc_AesSetKeyDirect(aes, seedA, FRODOKEM_SEEDA_SZ, NULL, + AES_ENCRYPTION); + } + for (i = 0; (ret == 0) && (i < n); i += 4) { /* Widest matrix-A generator available at run time (cf. aes.c): * VAES (whole batch in one asm call), else the AES-NI register * kernel, else the per-row C generator. */ @@ -2034,7 +2052,19 @@ static int frodokem_mul_add_sa_plus_e_aes(word16* out, const word16* s, #ifdef FRODOKEM_HAVE_MATRIX_ASM_AVX512 if ((ret == 0) && USE_INTEL_AVX512(cpuid_flags) && (SAVE_VECTOR_REGISTERS2() == 0)) { - for (j = 0; j < n; j += 8) { + /* The AES-NI/VAES row kernels below consume aes->key directly, which + * holds a valid AES-NI-layout key schedule only when the + * wc_AesSetKeyDirect() above ran with vector registers available + * (aes->use_aesni nonzero). Under WC_C_DYNAMIC_FALLBACK a failed + * SAVE_VECTOR_REGISTERS2() inside SetKey returns success having keyed + * only the C-fallback schedule (aes->key_C_fallback) - re-key under + * the held region, where the nested SAVE_VECTOR_REGISTERS2() always + * succeeds, so aes->key is valid for the kernels. */ + if (IS_INTEL_AESNI(cpuid_flags) && (! aes->use_aesni)) { + ret = wc_AesSetKeyDirect(aes, seedA, FRODOKEM_SEEDA_SZ, NULL, + AES_ENCRYPTION); + } + for (j = 0; (ret == 0) && (j < n); j += 8) { /* Widest matrix-A generator available at run time (cf. aes.c): * VAES (whole batch in one asm call), else the AES-NI register * kernel, else the per-row C generator. */ @@ -2064,7 +2094,13 @@ static int frodokem_mul_add_sa_plus_e_aes(word16* out, const word16* s, #ifdef FRODOKEM_HAVE_MATRIX_ASM if ((ret == 0) && IS_INTEL_AVX2(cpuid_flags) && (SAVE_VECTOR_REGISTERS2() == 0)) { - for (j = 0; j < n; j += 4) { + /* Re-key if SetKey lacked vector registers - see the note in the + * AVX512 branch above (or in frodokem_mul_add_as_plus_e_aes). */ + if (IS_INTEL_AESNI(cpuid_flags) && (! aes->use_aesni)) { + ret = wc_AesSetKeyDirect(aes, seedA, FRODOKEM_SEEDA_SZ, NULL, + AES_ENCRYPTION); + } + for (j = 0; (ret == 0) && (j < n); j += 4) { /* Widest matrix-A generator available at run time (cf. aes.c): * VAES (whole batch in one asm call), else the AES-NI register * kernel, else the per-row C generator. */ diff --git a/wolfcrypt/src/wc_mldsa.c b/wolfcrypt/src/wc_mldsa.c index ea263f57efb..36a8b818e06 100644 --- a/wolfcrypt/src/wc_mldsa.c +++ b/wolfcrypt/src/wc_mldsa.c @@ -189,6 +189,27 @@ #if defined(USE_INTEL_SPEEDUP) static cpuid_flags_t cpuid_flags = WC_CPUID_INITIALIZER; + +/* AVX2 NTT/invNTT flavor selection: the non-full AVX2 NTT/invNTT keep the + * NTT-domain coefficients in a permuted (lane-interleaved) order that only + * the non-full AVX2 consumers understand, whereas the full variants and the + * C implementations all use the standard order. With WC_C_DYNAMIC_FALLBACK, + * SAVE_VECTOR_REGISTERS2() can fail on any call, so NTT-domain data at rest + * (cached s1/s2/t0 vectors, the challenge polynomial, etc.) can be produced + * and consumed by differently-dispatched calls, and its representation must + * be dispatch-invariant, i.e. standard order. Without WC_C_DYNAMIC_FALLBACK, + * SAVE_VECTOR_REGISTERS2() cannot fail intermittently (fuzzing without + * fallback is an unsupported contradiction, and kernel-mode intelasm builds + * always define WC_C_DYNAMIC_FALLBACK), so dispatch is invariant and the + * slightly faster (~2%/~4% on NTT/invNTT) permuted-order variants are safe. + * Both pipelines yield bit-identical end results. */ +#ifdef WC_C_DYNAMIC_FALLBACK + #define MLDSA_NTT_AVX2(r) wc_mldsa_ntt_full_avx2(r) + #define MLDSA_INVNTT_AVX2(r) wc_mldsa_invntt_full_avx2(r) +#else + #define MLDSA_NTT_AVX2(r) wc_mldsa_ntt_avx2(r) + #define MLDSA_INVNTT_AVX2(r) wc_mldsa_invntt_avx2(r) +#endif #endif #ifdef DEBUG_MLDSA @@ -6775,8 +6796,9 @@ static void mldsa_ntt(sword32* r) else #endif #ifdef USE_INTEL_SPEEDUP + /* MLDSA_NTT_AVX2: see the flavor-selection note by its definition. */ if (IS_INTEL_AVX2(cpuid_flags) && (SAVE_VECTOR_REGISTERS2() == 0)) { - wc_mldsa_ntt_avx2(r); + MLDSA_NTT_AVX2(r); RESTORE_VECTOR_REGISTERS(); } else @@ -7252,6 +7274,7 @@ static void mldsa_ntt_small(sword32* r) else #endif #ifdef USE_INTEL_SPEEDUP + /* MLDSA_NTT_AVX2: see the flavor-selection note by its definition. */ if (IS_INTEL_AVX2(cpuid_flags) && (SAVE_VECTOR_REGISTERS2() == 0)) { wc_mldsa_ntt_small_avx2(r); RESTORE_VECTOR_REGISTERS(); @@ -7799,8 +7822,9 @@ static void mldsa_invntt(sword32* r) else #endif #ifdef USE_INTEL_SPEEDUP + /* MLDSA_INVNTT_AVX2: see the flavor-selection note by its definition. */ if (IS_INTEL_AVX2(cpuid_flags) && (SAVE_VECTOR_REGISTERS2() == 0)) { - wc_mldsa_invntt_avx2(r); + MLDSA_INVNTT_AVX2(r); RESTORE_VECTOR_REGISTERS(); } else diff --git a/wolfcrypt/src/wc_mlkem_poly.c b/wolfcrypt/src/wc_mlkem_poly.c index 1a2a25a939f..00758b8b9ff 100644 --- a/wolfcrypt/src/wc_mlkem_poly.c +++ b/wolfcrypt/src/wc_mlkem_poly.c @@ -3671,6 +3671,28 @@ int mlkem_derive_secret(wc_Shake* prf, const byte* z, const byte* ct, int ret; #ifdef USE_INTEL_SPEEDUP + #ifdef WC_C_DYNAMIC_FALLBACK + /* The buffer-stuffing shortcut below assumes a freshly initialized object + * (zeroed sponge state). When WC_C_DYNAMIC_FALLBACK, that doesn't + * generally hold: other users of the shared object - e.g. the C fallback + * legs of mlkem_gen_matrix()/mlkem_get_noise() reached when + * SAVE_VECTOR_REGISTERS2() fails (kernel context, or + * DEBUG_VECTOR_REGISTER_ACCESS_FUZZING) - drive the XOF on the object via + * absorb/squeeze and leave it mid-squeeze. + * + * Without WC_C_DYNAMIC_FALLBACK, SAVE_VECTOR_REGISTERS2() cannot fail in + * supported configurations and the asm legs keep their working state in + * local buffers, so the object provably stays pristine and the + * re-initialization is safely skipped. + * + * TL;DR: when WC_C_DYNAMIC_FALLBACK, re-initialize, as the + * non-USE_INTEL_SPEEDUP path does. + */ + ret = wc_InitShake256(prf, NULL, INVALID_DEVID); + if (ret != 0) + return ret; + #endif /* WC_C_DYNAMIC_FALLBACK */ + XMEMCPY(prf->t, z, WC_ML_KEM_SYM_SZ); XMEMCPY(prf->t + WC_ML_KEM_SYM_SZ, ct, WC_SHA3_256_COUNT * 8 - WC_ML_KEM_SYM_SZ); diff --git a/wolfcrypt/src/wc_slhdsa.c b/wolfcrypt/src/wc_slhdsa.c index 8e56b873038..e3b15d9e199 100644 --- a/wolfcrypt/src/wc_slhdsa.c +++ b/wolfcrypt/src/wc_slhdsa.c @@ -5949,7 +5949,7 @@ static int slhdsakey_fors_sign(SlhDsaKey* key, const byte* md, #if defined(USE_INTEL_SPEEDUP) && !defined(WOLFSSL_WC_SLHDSA_SMALL) if (!SLHDSA_IS_SHA2(key->params->param) && IS_INTEL_AVX2(cpuid_flags) && - CAN_SAVE_VECTOR_REGISTERS()) { + (SAVE_VECTOR_REGISTERS2() == 0)) { word16 idx = indices[i]; /* Step 5: For each bit: */ for (j = 0; j < a; j++) { @@ -5967,6 +5967,7 @@ static int slhdsakey_fors_sign(SlhDsaKey* key, const byte* md, /* Update tree index. */ idx >>= 1; } + RESTORE_VECTOR_REGISTERS(); } else #endif diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index dc7ae837432..61cfe8c7bf0 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -4651,11 +4651,12 @@ #endif #endif -/* SHA-3 low level state can't alternate freely between C and intelasm. */ -#if (defined(_WC_BUILDING_WC_MLKEM_POLY_C) || \ - defined(_WC_BUILDING_WC_MLDSA_C) || \ - defined(_WC_BUILDING_WC_SLHDSA_C)) && \ - defined(DEBUG_VECTOR_REGISTER_ACCESS_FUZZING) && \ +/* Falcon uses either FP or vector registers in all asm implementations (no + * option yet to build the C-no-FP implementation simultaneous with other + * implementations(s)). + */ +#if defined(_WC_BUILDING_FALCON_C) && \ + defined(DEBUG_VECTOR_REGISTER_ACCESS_FUZZING) && \ !defined(DEBUG_FORCE_VECTOR_REGISTER_ACCESS_FUZZING) #undef DEBUG_VECTOR_REGISTER_ACCESS_FUZZING #endif From 47d66665995b14a8daaed07604432be84e827d04 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Tue, 4 Aug 2026 01:24:15 -0500 Subject: [PATCH 25/44] linuxkm/x86_vector_register_glue.c, linuxkm/linuxkm_wc_port.h: add a MAYBE_INHIBIT vector-register save mode for the convenience of the DRBG glue logic. Add WC_SVR_FLAG_MAYBE_INHIBIT = 2 (WC_SVR_FLAG_FUZZ becomes 4), and add SAVE_VECTOR_REGISTERS_MAYBE_INHIBIT() / RESTORE_VECTOR_REGISTERS_MAYBE_INHIBITED() macros, routing through wc_{save,restore}_vector_registers_x86(WC_SVR_FLAG_MAYBE_INHIBIT). linuxkm/x86_vector_register_glue.c: implement the mode. A _MAYBE_INHIBIT call must be outermost (BAD_STATE_E otherwise, and a warning on the matching restore at non-outermost depth). The fuzzer check moves ahead of the inhibit decision so that a fuzzed failure converts into an inhibited (rather than failed) acquisition when _MAYBE_INHIBIT is set; a real inability to use SIMD (preempt_count() != 0 && !may_use_simd()) does the same. The restore path treats _MAYBE_INHIBIT like _INHIBIT when deciding whether registers were actually taken. Note, under fuzzer vector disablement, wc_save_vector_registers_x86(WC_SVR_FLAG_MAYBE_INHIBIT) returns 0 with affinity locked, as though explicit WC_SVR_FLAG_INHIBIT were passed. Thus on 0 return, the caller must use `CAN_SAVE_VECTOR_REGISTERS()` to discover whether vector registers are actually usable. --- linuxkm/linuxkm_wc_port.h | 14 +++++++++- linuxkm/x86_vector_register_glue.c | 45 ++++++++++++++++++++++++------ 2 files changed, 49 insertions(+), 10 deletions(-) diff --git a/linuxkm/linuxkm_wc_port.h b/linuxkm/linuxkm_wc_port.h index d123c678228..71d064bdc91 100644 --- a/linuxkm/linuxkm_wc_port.h +++ b/linuxkm/linuxkm_wc_port.h @@ -232,7 +232,8 @@ enum wc_svr_flags { WC_SVR_FLAG_NONE = 0, WC_SVR_FLAG_INHIBIT = 1, - WC_SVR_FLAG_FUZZ + WC_SVR_FLAG_MAYBE_INHIBIT = 2, + WC_SVR_FLAG_FUZZ = 4 }; #if defined(WOLFSSL_AESNI) || defined(USE_INTEL_SPEEDUP) || \ @@ -787,6 +788,17 @@ #define REENABLE_VECTOR_REGISTERS() wc_restore_vector_registers_x86(WC_SVR_FLAG_INHIBIT) #endif + #ifndef SAVE_VECTOR_REGISTERS_MAYBE_INHIBIT + #ifdef DEBUG_VECTOR_REGISTER_ACCESS_FUZZING + #define SAVE_VECTOR_REGISTERS_MAYBE_INHIBIT() wc_save_vector_registers_x86(WC_SVR_FLAG_FUZZ | WC_SVR_FLAG_MAYBE_INHIBIT) + #else + #define SAVE_VECTOR_REGISTERS_MAYBE_INHIBIT() wc_save_vector_registers_x86(WC_SVR_FLAG_MAYBE_INHIBIT) + #endif + #endif + #ifndef RESTORE_VECTOR_REGISTERS_MAYBE_INHIBITED + #define RESTORE_VECTOR_REGISTERS_MAYBE_INHIBITED() wc_restore_vector_registers_x86(WC_SVR_FLAG_MAYBE_INHIBIT) + #endif + #elif defined(WOLFSSL_USE_SAVE_VECTOR_REGISTERS) && (defined(CONFIG_ARM) || defined(CONFIG_ARM64)) #error kernel module ARM SIMD is not yet tested or usable. diff --git a/linuxkm/x86_vector_register_glue.c b/linuxkm/x86_vector_register_glue.c index e33c3d719e8..ab2cea17afe 100644 --- a/linuxkm/x86_vector_register_glue.c +++ b/linuxkm/x86_vector_register_glue.c @@ -352,6 +352,16 @@ WARN_UNUSED_RESULT int wc_save_vector_registers_x86(enum wc_svr_flags flags) /* allow for nested calls */ if (pstate && (pstate->fpu_state != 0U)) { + if (flags & WC_SVR_FLAG_MAYBE_INHIBIT) { + VRG_PR_WARN_X("BUG: wc_save_vector_registers_x86() called by pid %d on CPU %d " + "with _MAYBE_INHIBIT flag at non-outermost depth %u.\n", task_pid_nr(current), + raw_smp_processor_id(), + (pstate->fpu_state & WC_FPU_COUNT_MASK)); + #ifdef WOLFSSL_LINUXKM_VERBOSE_DEBUG + dump_stack(); + #endif + return BAD_STATE_E; + } if (pstate->fpu_state & WC_FPU_INHIBITED_FLAG) { /* don't allow recursive inhibit calls when already inhibited -- * it would add no functionality and require keeping a separate @@ -386,6 +396,26 @@ WARN_UNUSED_RESULT int wc_save_vector_registers_x86(enum wc_svr_flags flags) WC_RELAX_LONG_LOOP(); +#ifdef DEBUG_VECTOR_REGISTER_ACCESS_FUZZING + if (flags & WC_SVR_FLAG_FUZZ) { + int ret = SAVE_VECTOR_REGISTERS2_fuzzer(); + if (ret != 0) { + if (flags & WC_SVR_FLAG_MAYBE_INHIBIT) + flags |= WC_SVR_FLAG_INHIBIT; + else + return ret; + } + } +#endif + + if ((flags & WC_SVR_FLAG_MAYBE_INHIBIT) && + ((preempt_count() != 0) && !may_use_simd())) + { + return WC_ACCEL_INHIBIT_E; /* not an error here, just a + * short-circuit result. + */ + } + if (flags & WC_SVR_FLAG_INHIBIT) { if ((preempt_count() != 0) && !may_use_simd()) return WC_ACCEL_INHIBIT_E; /* not an error here, just a @@ -428,14 +458,6 @@ WARN_UNUSED_RESULT int wc_save_vector_registers_x86(enum wc_svr_flags flags) return 0; } -#ifdef DEBUG_VECTOR_REGISTER_ACCESS_FUZZING - if (flags & WC_SVR_FLAG_FUZZ) { - int ret = SAVE_VECTOR_REGISTERS2_fuzzer(); - if (ret != 0) - return ret; - } -#endif - if ((preempt_count() == 0) || may_use_simd()) { /* fpregs_lock() calls either local_bh_disable() or preempt_disable() * depending on CONFIG_PREEMPT_RT -- we call both, explicitly. @@ -508,6 +530,11 @@ void wc_restore_vector_registers_x86(enum wc_svr_flags flags) } if ((--pstate->fpu_state & WC_FPU_COUNT_MASK) > 0U) { + if (flags & WC_SVR_FLAG_MAYBE_INHIBIT) + VRG_PR_WARN_X("BUG: wc_restore_vector_registers_x86() called by pid %d on CPU %d " + "with _MAYBE_INHIBIT flag at non-outermost depth %u.\n", task_pid_nr(current), + raw_smp_processor_id(), + (pstate->fpu_state & WC_FPU_COUNT_MASK) + 1U); if (flags & WC_SVR_FLAG_INHIBIT) { if (pstate->fpu_state & WC_FPU_INHIBITED_FLAG) pstate->fpu_state &= ~WC_FPU_INHIBITED_FLAG; @@ -527,7 +554,7 @@ void wc_restore_vector_registers_x86(enum wc_svr_flags flags) #endif local_bh_enable(); } else if (unlikely(pstate->fpu_state & WC_FPU_INHIBITED_FLAG)) { - if (unlikely(! (flags & WC_SVR_FLAG_INHIBIT))) + if (unlikely(! (flags & (WC_SVR_FLAG_INHIBIT | WC_SVR_FLAG_MAYBE_INHIBIT)))) VRG_PR_WARN_X("BUG: wc_restore_vector_registers_x86() called by pid %d on CPU %d " "without _INHIBIT flag but saved state is _INHIBITED_.\n", task_pid_nr(current), raw_smp_processor_id()); From 348ea894f281721b75fac41e50778bb6bd3d8145 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Tue, 4 Aug 2026 01:36:31 -0500 Subject: [PATCH 26/44] refactor linuxkm_affinity_lock() and linuxkm_affinity_unlock() to use SAVE_VECTOR_REGISTERS_MAYBE_INHIBIT() and RESTORE_VECTOR_REGISTERS_MAYBE_INHIBITED(), and in wc_linuxkm_rng_bank_init(), disable vector ops only if FIPS = KERNEL_VERSION(5, 7, 0)) migrate_disable(); /* this actually makes irq_count() nonzero, so that * DISABLE_VECTOR_REGISTERS() is superfluous, but @@ -2077,6 +2089,8 @@ static int linuxkm_affinity_lock(void *arg) { #endif local_bh_disable(); return 0; + +#endif /* !WOLFSSL_USE_SAVE_VECTOR_REGISTERS */ } static int linuxkm_affinity_get_id(void *arg, int *id) { @@ -2087,11 +2101,21 @@ static int linuxkm_affinity_get_id(void *arg, int *id) { static int linuxkm_affinity_unlock(void *arg) { (void)arg; + +#ifdef WOLFSSL_USE_SAVE_VECTOR_REGISTERS + + RESTORE_VECTOR_REGISTERS_MAYBE_INHIBITED(); + return 0; + +#else /* !WOLFSSL_USE_SAVE_VECTOR_REGISTERS */ + local_bh_enable(); #if defined(CONFIG_SMP) && (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 7, 0)) migrate_enable(); #endif return 0; + +#endif /* !WOLFSSL_USE_SAVE_VECTOR_REGISTERS */ } static int wc_linuxkm_rng_bank_init(struct wc_rng_bank *ctx) @@ -2099,8 +2123,13 @@ static int wc_linuxkm_rng_bank_init(struct wc_rng_bank *ctx) int ret; word32 flags = WC_RNG_BANK_FLAG_CAN_WAIT; +#if defined(HAVE_FIPS) && FIPS_VERSION3_LT(7,0,0) + /* before v7, the SHA-2 implementations couldn't dynamically switch between + * C and asm in a given wc_Sha256 instance. + */ if (wc_linuxkm_rng_initing_default_bank_flag) flags |= WC_RNG_BANK_FLAG_NO_VECTOR_OPS; +#endif ret = wc_rng_bank_init( ctx, nr_cpu_ids + 4, flags, WC_LINUXKM_INITRNG_TIMEOUT_SEC, From 93a71f38e36927bd23fc932d28d680b1cf8a126c Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Tue, 4 Aug 2026 01:38:55 -0500 Subject: [PATCH 27/44] wolfssl/wolfcrypt/memory.h: prefix the SAVE_VECTOR_REGISTERS2 GNU statement-expr definitions with __extension__ at both arms (the fuzzing arm and the plain arm) so -pedantic builds (which the kernel-settings CI configs use) don't drown in "ISO C forbids braced-groups within expressions" across the hundreds of expansion sites. --- wolfssl/wolfcrypt/memory.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wolfssl/wolfcrypt/memory.h b/wolfssl/wolfcrypt/memory.h index 3eea509e506..403f09b8b38 100644 --- a/wolfssl/wolfcrypt/memory.h +++ b/wolfssl/wolfcrypt/memory.h @@ -433,7 +433,7 @@ WOLFSSL_LOCAL WC_DEBUG_CIPHERLIFECYCLE_WUR int wc_debug_CipherLifecycleFree SAVE_VECTOR_REGISTERS2_fuzzer() == 0) #endif - #define SAVE_VECTOR_REGISTERS2(...) ({ \ + #define SAVE_VECTOR_REGISTERS2(...) __extension__ ({ \ int _svr2_val; \ if (wc_svr_count > 0) \ _svr2_val = 0; \ @@ -462,7 +462,7 @@ WOLFSSL_LOCAL WC_DEBUG_CIPHERLIFECYCLE_WUR int wc_debug_CipherLifecycleFree #else - #define SAVE_VECTOR_REGISTERS2(...) ({ \ + #define SAVE_VECTOR_REGISTERS2(...) __extension__ ({ \ int _svr2_val; \ if (wc_debug_vector_registers_retval != 0) { \ if (wc_svr_count > 0) { \ From 4f2953252d3b12a12f0eb8f628e000b428b1ea48 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Tue, 4 Aug 2026 01:39:53 -0500 Subject: [PATCH 28/44] .github/workflows/codespell.yml: add *.bin to skip list. --- .github/workflows/codespell.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml index 7ee28af3a11..7ff31f705ce 100644 --- a/.github/workflows/codespell.yml +++ b/.github/workflows/codespell.yml @@ -31,4 +31,4 @@ jobs: # The exclude_file contains lines of code that should be ignored. This is useful for individual lines which have non-words that can safely be ignored. exclude_file: '.codespellexcludelines' # To skip files entirely from being processed, add it to the following list: - skip: '*.cproject,*.csr,*.der,*.mtpj,*.pem,*.vcxproj,.git,*.launch,*.scfg,*.revoked,./examples/asn1/dumpasn1.cfg,./examples/asn1/oid_names.h,./scripts/cwe-names.json' + skip: '*.cproject,*.csr,*.der,*.mtpj,*.pem,*.vcxproj,.git,*.launch,*.scfg,*.revoked,./examples/asn1/dumpasn1.cfg,./examples/asn1/oid_names.h,./scripts/cwe-names.json,*.bin' From 2f159261393b7e1a081e402a59ca741ead21759e Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Tue, 4 Aug 2026 01:41:02 -0500 Subject: [PATCH 29/44] .github/workflows/fips-dev-no-post.yml: add new workflow to cover --enable-fips=dev-no-post. Notes: * EXTRA_CPPFLAGS carries -Werror in the base configure line, because the autotools -Werror is gated on a VCS checkout being detected in the configure CWD and these are VPATH builds, which would otherwise silently get no -Werror at all. * The fuzzing cell's WC_DEBUG_VECTOR_REGISTERS_FUZZING_SEED is $$, which changes from run to run. * The two out-of-tree kernel-module cells (linuxkm, linuxkm-all-asm) are commented out, with a note that out-of-tree module builds don't work yet. --- .github/workflows/fips-dev-no-post.yml | 154 +++++++++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100644 .github/workflows/fips-dev-no-post.yml diff --git a/.github/workflows/fips-dev-no-post.yml b/.github/workflows/fips-dev-no-post.yml new file mode 100644 index 00000000000..98d9ae9173a --- /dev/null +++ b/.github/workflows/fips-dev-no-post.yml @@ -0,0 +1,154 @@ +name: FIPS dev-no-POST tests + +# --enable-fips=dev-no-post builds with FIPS-like settings but none of the fips +# repo content: no POST, no CASTs, no optest, and no fips.c wrappers (hence +# FIPS_NO_WRAPPERS). That makes the FIPS-conditional code in the regular +# sources buildable and testable on ordinary master, where the fips repo is +# absent. It also tests for consistency in behavior/error codes between the +# wrappers and the underlying implementations, because all callers (particularly +# unit.test) expect FIPS behavior. + +# START OF COMMON SECTION +on: + push: + branches: [ 'release/**' ] + # Docs-only changes cannot affect the build/test matrix - skip the + # run for them. Keep this list narrow (markdown + doc/ only); + # do not add cert/test data extensions here. + paths-ignore: + - '**/*.md' + - 'doc/**' + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + branches: [ '*' ] + paths-ignore: + - '**/*.md' + - 'doc/**' + # Weekday-morning cron (10:00 UTC) seeds the master-scoped ccache that PR runs + # restore: re-runs --build-only (compile only, no tests) on the + # default branch. PR runs are read-only (see ccache-setup). + schedule: + - cron: '38 10 * * 1-5' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read +# END OF COMMON SECTION + +jobs: + # All former runner-per-config matrix entries build on one runner via + # .github/scripts/parallel-make-check.py (see os-check.yml for the full + # pattern): each config builds in its own out-of-tree ("VPATH") build + # directory off one checkout/autogen, on a pool of one-per-CPU worker + # threads, longest first. + build_library: + name: build library/module + if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} + runs-on: ubuntu-24.04 + # Generous for a cold ccache; warm reruns finish in a fraction. + timeout-minutes: 30 + steps: + - uses: actions/checkout@v5 + name: Checkout wolfSSL + + - name: Install dependencies + uses: ./.github/actions/install-apt-deps + with: + packages: autoconf automake libtool build-essential linux-headers-$(uname -r) + ghcr-debs-tag: ubuntu-24.04-linuxkm + + - name: Set up ccache + uses: ./.github/actions/ccache-setup + with: + workflow-id: fips-dev-no-post + read-only: ${{ github.event_name == 'pull_request' }} + max-size: 500M + + - name: Prepare target kernel for module builds + run: | + echo "preparing target kernel $(uname -r)" + pushd "/lib/modules/$(uname -r)/build" || $(exit 4) + if [ -f /proc/config.gz ]; then gzip -dc /proc/config.gz > /tmp/.config && sudo mv /tmp/.config . || $(exit 5); elif [ -f "/boot/config-$(uname -r)" ]; then sudo cp -p "/boot/config-$(uname -r)" .config || $(exit 6); fi + sudo make -j 4 olddefconfig || $(exit 7) + sudo make M="$(pwd)" modules_prepare || $(exit 8) + popd >/dev/null + + - name: autogen.sh + run: | + ./autogen.sh || $(exit 9) + + # "base" carries flags appropriate for every config; its "configure" list + # is prepended to each config's own. KERNEL_EXTRA_CFLAGS_REMOVE and + # FORCE_NO_MODULE_SIG go in the environment rather than the JSON because + # the pool builds with a bare "make" (no way to add variables to that + # command line); make picks them up from the environment, and they are + # inert for the non-linuxkm configs. Note the heredoc is unquoted so + # $(uname -r) expands -- there is no other $ or backtick in the JSON. + - name: Build all configs (parallel, out-of-tree) + env: + KERNEL_EXTRA_CFLAGS_REMOVE: -pg + FORCE_NO_MODULE_SIG: 1 + run: | + cat > "$RUNNER_TEMP/fips-dev-no-post-configs.json" < Date: Tue, 4 Aug 2026 01:44:21 -0500 Subject: [PATCH 30/44] linuxkm/lkcapi_glue.c: make the #error message for defined(CONFIG_CRYPTO_FIPS) != defined(HAVE_FIPS) more informative. --- linuxkm/lkcapi_glue.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/linuxkm/lkcapi_glue.c b/linuxkm/lkcapi_glue.c index 710e486925c..d4b9c70d0dd 100644 --- a/linuxkm/lkcapi_glue.c +++ b/linuxkm/lkcapi_glue.c @@ -38,7 +38,11 @@ * it's a macro hardcoding it to literal 0). */ #if defined(CONFIG_CRYPTO_FIPS) != defined(HAVE_FIPS) - #error CONFIG_CRYPTO_MANAGER requires that CONFIG_CRYPTO_FIPS match HAVE_FIPS. + #ifdef HAVE_FIPS + #error CONFIG_CRYPTO_MANAGER requires that CONFIG_CRYPTO_FIPS match HAVE_FIPS (CONFIG_CRYPTO_FIPS unset). + #else + #error CONFIG_CRYPTO_MANAGER requires that CONFIG_CRYPTO_FIPS match HAVE_FIPS (HAVE_FIPS unset). + #endif #endif #endif From 1404ffbb45edae9d26cd139ba957d2a5d2cbdc27 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Tue, 4 Aug 2026 01:45:41 -0500 Subject: [PATCH 31/44] Makefile.am: add HAVE_FIPS_VERSION_MAJOR / _MINOR / _PATCH to the variables exported to the linuxkm sub-make. linuxkm/Kbuild: * Feature-detect $(intcmp) (GNU make >= 4.4) into $(HAVE_INTCMP). * Derive FIPS_OPTEST_NO_DH from $(HAVE_FIPS_VERSION_MAJOR) via $(intcmp) when available; otherwise $(error) with instructions to supply it on the make command line. When set, build the optest wrapper with -DNO_DH -- DH is not optested at FIPS v7+ even when the module has DH, because its APIs have no FIPS wrappers. * Same $(intcmp)/$(error) treatment for NO_PIE_FLAG (target kernel < 5.11), and change its test from `ifdef NO_PIE_FLAG` to an explicit `ifeq "$(NO_PIE_FLAG)" "0"` so an explicitly-zero value means what it says. * Add $(CFLAGS_AUTO_VECTORIZE_DISABLE) to benchmark.o ccflags-y and drop its unused asflags-y line. --- Makefile.am | 4 +++- linuxkm/Kbuild | 45 ++++++++++++++++++++++++++++++++++++--------- 2 files changed, 39 insertions(+), 10 deletions(-) diff --git a/Makefile.am b/Makefile.am index 62b62042c35..30c3ccdf0ec 100644 --- a/Makefile.am +++ b/Makefile.am @@ -246,7 +246,9 @@ if BUILD_LINUXKM CFLAGS_AUTO_VECTORIZE_DISABLE CFLAGS_AUTO_VECTORIZE_ENABLE \ ASFLAGS_FPU_DISABLE_SIMD_ENABLE ASFLAGS_FPU_ENABLE_SIMD_DISABLE \ ASFLAGS_FPUSIMD_DISABLE ASFLAGS_FPUSIMD_ENABLE ENABLED_KERNEL_BENCHMARKS \ - FIPS_FLAVOR + FIPS_FLAVOR HAVE_FIPS_VERSION_MAJOR HAVE_FIPS_VERSION_MINOR \ + HAVE_FIPS_VERSION_PATCH + module: +$(MAKE) -C linuxkm module diff --git a/linuxkm/Kbuild b/linuxkm/Kbuild index b9bf722c2b3..3e8deb9628e 100644 --- a/linuxkm/Kbuild +++ b/linuxkm/Kbuild @@ -21,6 +21,13 @@ .ONESHELL: SHELL=bash +# $(intcmp ...) requires GNU make 4.4 or later. +ifeq ($(intcmp 1,1,,yes,),yes) + HAVE_INTCMP := yes +else + HAVE_INTCMP := no +endif + ifeq "$(KERNEL_ARCH)" "x86" KERNEL_ARCH_X86 := yes else ifeq "$(KERNEL_ARCH)" "x86_64" @@ -111,6 +118,24 @@ $(LIBWOLFSSL_NAME)-y := $(WOLFSSL_OBJ_FILES) linuxkm/module_hooks.o linuxkm/modu ifeq "$(FIPS_OPTEST)" "1" $(LIBWOLFSSL_NAME)-y += linuxkm/optest-140-3/linuxkm_optest_wrapper.o + # FIPS_OPTEST_NO_DH=1 for FIPS v7 or later, 0 for earlier. Derived from + # $(HAVE_FIPS_VERSION_MAJOR) when $(intcmp) is available; supply it on the + # make command line otherwise. + ifndef FIPS_OPTEST_NO_DH + ifeq "$(HAVE_INTCMP)" "yes" + ifeq "$(HAVE_FIPS_VERSION_MAJOR)" "" + $(error $$HAVE_FIPS_VERSION_MAJOR is unset.) + endif + FIPS_OPTEST_NO_DH := $(intcmp $(HAVE_FIPS_VERSION_MAJOR),7,0,1,1) + else + $(error $$FIPS_OPTEST_NO_DH is unset -- supply FIPS_OPTEST_NO_DH=1 for FIPS v7 or later, or FIPS_OPTEST_NO_DH=0 for earlier.) + endif + endif + ifeq "$(FIPS_OPTEST_NO_DH)" "1" + # Don't optest DH in FIPS v7+ even if the module has DH -- there are no + # FIPS wrappers for its APIs. + linuxkm/optest-140-3/linuxkm_optest_wrapper.o: ccflags-y += -DNO_DH + endif endif WOLFSSL_CFLAGS_NO_VECTOR_INSNS := $(CFLAGS_SIMD_DISABLE) $(CFLAGS_FPU_DISABLE) @@ -129,6 +154,9 @@ ifeq "$(ENABLED_LINUXKM_PIE)" "yes" ifndef NO_PIE_FLAG ifeq ($(KERNEL_ARCH),arm) + ifneq "$(HAVE_INTCMP)" "yes" + $(error $$NO_PIE_FLAG is unset -- supply NO_PIE_FLAG=1 for target kernel <5.11, else supply NO_PIE_FLAG=0.) + endif ifeq ($(intcmp $(VERSION),5,1,0,0),1) NO_PIE_FLAG := 1 $(info Note: disabling -fPIE to avoid R_ARM_REL32 on pre-5.11 target kernel.) @@ -136,15 +164,19 @@ ifeq "$(ENABLED_LINUXKM_PIE)" "yes" ifeq ($(intcmp $(VERSION),5,0,1,0)-$(intcmp $(PATCHLEVEL),11,1,0,0),1-1) NO_PIE_FLAG := 1 $(info Note: disabling -fPIE to avoid R_ARM_REL32 on pre-5.11 target kernel.) + else + NO_PIE_FLAG := 0 endif endif + else + NO_PIE_FLAG := 0 endif endif - ifdef NO_PIE_FLAG - PIE_FLAGS += -DWC_NO_PIE_FLAG - else + ifeq "$(NO_PIE_FLAG)" "0" PIE_FLAGS += -fPIE + else + PIE_FLAGS += -DWC_NO_PIE_FLAG endif # the kernel sanitizers generate external references to # __ubsan_handle_out_of_bounds(), __ubsan_handle_shift_out_of_bounds(), etc. @@ -198,8 +230,7 @@ endif $(obj)/$(LIBWOLFSSL_NAME).mod.o: ccflags-y := $(PIE_SUPPORT_FLAGS) $(obj)/wolfcrypt/test/test.o: ccflags-y += -DNO_MAIN_DRIVER -DWOLFSSL_NO_OPTIONS_H $(obj)/wolfcrypt/src/aes.o: ccflags-y := $(WOLFSSL_CFLAGS) $(WOLFSSL_CFLAGS_YES_VECTOR_INSNS) $(PIE_FLAGS) $(PIE_SUPPORT_FLAGS) -$(obj)/wolfcrypt/benchmark/benchmark.o: ccflags-y := $(WOLFSSL_CFLAGS) $(CFLAGS_FPU_ENABLE) $(CFLAGS_SIMD_ENABLE) $(PIE_SUPPORT_FLAGS) -DNO_MAIN_FUNCTION -DWOLFSSL_NO_OPTIONS_H -$(obj)/wolfcrypt/benchmark/benchmark.o: asflags-y := $(WOLFSSL_ASFLAGS) $(ASFLAGS_FPU_ENABLE_SIMD_DISABLE) +$(obj)/wolfcrypt/benchmark/benchmark.o: ccflags-y := $(WOLFSSL_CFLAGS) $(CFLAGS_FPU_ENABLE) $(CFLAGS_SIMD_ENABLE) $(CFLAGS_AUTO_VECTORIZE_DISABLE) $(PIE_SUPPORT_FLAGS) -DNO_MAIN_FUNCTION -DWOLFSSL_NO_OPTIONS_H asflags-y := $(WOLFSSL_ASFLAGS) $(ASFLAGS_FPUSIMD_DISABLE) @@ -230,10 +261,6 @@ $(obj)/wolfcrypt/src/wc_mlkem_asm.o: asflags-y := $(WOLFSSL_ASFLAGS) $(ASFLAGS_F $(obj)/wolfcrypt/src/wc_mlkem_asm.o: OBJECT_FILES_NON_STANDARD := y $(obj)/wolfcrypt/src/wc_mldsa_asm.o: asflags-y := $(WOLFSSL_ASFLAGS) $(ASFLAGS_FPU_DISABLE_SIMD_ENABLE) $(obj)/wolfcrypt/src/wc_mldsa_asm.o: OBJECT_FILES_NON_STANDARD := y -# Native Falcon fpr backend: scalar double math on SSE2 (mulsd/divsd/sqrtsd, -# no x87), so it needs the vector insns enabled in the assembler like the other -# _asm.o here. The vector registers are saved at run time by the SAVE_VECTOR_ -# REGISTERS2() wrapping in falcon.c around signing and keygen. $(obj)/wolfcrypt/src/wc_falcon_fpr_x86_64_asm.o: asflags-y := $(WOLFSSL_ASFLAGS) $(ASFLAGS_FPU_DISABLE_SIMD_ENABLE) $(obj)/wolfcrypt/src/wc_falcon_fpr_x86_64_asm.o: OBJECT_FILES_NON_STANDARD := y From 4f163df1379d1768b5d377df30e7d3ee987fb35b Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Tue, 4 Aug 2026 01:47:57 -0500 Subject: [PATCH 32/44] configure.ac: in enable-all-crypto setup, enable_eccencrypt only if !FIPS || FIPS >= v7. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 144b1b41942..7e16042d309 100644 --- a/configure.ac +++ b/configure.ac @@ -1668,7 +1668,6 @@ then test "$enable_certext" = "" && enable_certext=yes test "$enable_sep" = "" && enable_sep=yes test "$enable_hkdf" = "" && enable_hkdf=yes - test "$enable_eccencrypt" = "" && test "$enable_ecc" != "no" && enable_eccencrypt=yes test "$enable_fpecc" = "" && test "$enable_ecc" != "no" && enable_fpecc=yes test "$enable_eccsi" = "" && test "$enable_ecc" != "no" && enable_eccsi=yes test "$enable_psk" = "" && enable_psk=yes @@ -1765,6 +1764,7 @@ then if test "$ENABLED_FIPS" = "no" || test "$HAVE_FIPS_VERSION" -ge 7 then + test "$enable_eccencrypt" = "" && test "$enable_ecc" != "no" && enable_eccencrypt=yes test "$enable_cshake" = "" && enable_cshake=yes test "$enable_kmac" = "" && enable_kmac=yes fi From d1db0a8f3536c870fc0a6070cb728635677c30f1 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Tue, 4 Aug 2026 01:49:37 -0500 Subject: [PATCH 33/44] wolfssl/wolfcrypt/settings.h: remove WOLFSSL_FIPS_READY and WOLFSSL_FIPS_DEV from the gate for implicit defining of WC_TEST_NO_ECC_SIGN_VERIFY_ZERO_DIGEST. --- wolfssl/wolfcrypt/settings.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index 61cfe8c7bf0..0fd6d99a699 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -3982,8 +3982,7 @@ * fips-ready/fips-dev which track the latest in-development source), * unless the user explicitly opts in to allowing an all-zero digest with * WC_ALLOW_ECC_ZERO_HASH or is building with HAVE_SELFTEST */ - #if (!defined(HAVE_FIPS) || FIPS_VERSION_GT(7,0) || \ - defined(WOLFSSL_FIPS_READY) || defined(WOLFSSL_FIPS_DEV)) && \ + #if (!defined(HAVE_FIPS) || FIPS_VERSION_GE(7,0)) && \ !defined(HAVE_SELFTEST) && !defined(WC_ALLOW_ECC_ZERO_HASH) /* sign/verify of an all-zero digest in wolfCrypt rejected */ #define WC_TEST_NO_ECC_SIGN_VERIFY_ZERO_DIGEST From 8618f7c3d033fb4b5d2695ace3c00d7fdea843e2 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Tue, 4 Aug 2026 01:51:05 -0500 Subject: [PATCH 34/44] wolfcrypt/src/logging.c, wolfssl/wolfcrypt/logging.h: recognize WOLFSSL_DEBUG_TRACE_ERROR_CODES_SUPPORT, facilitating opt-in per-file error tracing in debug campaigns. --- .wolfssl_known_macro_extras | 2 ++ wolfcrypt/src/logging.c | 6 ++++-- wolfssl/wolfcrypt/logging.h | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.wolfssl_known_macro_extras b/.wolfssl_known_macro_extras index 47f033ce301..444caffd3a1 100644 --- a/.wolfssl_known_macro_extras +++ b/.wolfssl_known_macro_extras @@ -748,6 +748,7 @@ WC_ASYNC_THREAD_BIND WC_BLINDING_NO_RNG_ACKNOWLEDGE_WEAKNESS WC_CACHE_RESISTANT_BASE64_TABLE WC_DISABLE_RADIX_ZERO_PAD +WC_DRBG_BANKREF WC_FIPS_AESGCM_ALLOW_SHORT_NONCES WC_FIPS_AESGCM_ONE_SHOT_EXT_IV_ALLOWED WC_FLAG_DONT_USE_AESNI @@ -846,6 +847,7 @@ WOLFSSL_CLANG_TIDY WOLFSSL_CLIENT_EXAMPLE WOLFSSL_CONTIKI WOLFSSL_CRL_ALLOW_MISSING_CDP +WOLFSSL_DEBUG_TRACE_ERROR_CODES_SUPPORT WOLFSSL_DISABLE_EARLY_SANITY_CHECKS WOLFSSL_DRBG_SHA256 WOLFSSL_DTLS13_ECHO_LEGACY_SESSION_ID diff --git a/wolfcrypt/src/logging.c b/wolfcrypt/src/logging.c index 436d3df2662..736adbebdb6 100644 --- a/wolfcrypt/src/logging.c +++ b/wolfcrypt/src/logging.c @@ -1826,7 +1826,8 @@ void WOLFSSL_ERROR_MSG(const char* msg) #endif /* DEBUG_WOLFSSL || WOLFSSL_NGINX || WOLFSSL_HAPROXY */ -#ifdef WOLFSSL_DEBUG_TRACE_ERROR_CODES +#if defined(WOLFSSL_DEBUG_TRACE_ERROR_CODES) || \ + defined(WOLFSSL_DEBUG_TRACE_ERROR_CODES_SUPPORT) #ifndef WOLFSSL_DEBUG_TRACE_ERROR_CODES_INIT_STATE #define WOLFSSL_DEBUG_TRACE_ERROR_CODES_INIT_STATE 1 @@ -1849,7 +1850,8 @@ int wc_debug_trace_error_codes_set(int state) { state); } -#endif /* WOLFSSL_DEBUG_TRACE_ERROR_CODES */ +#endif /* WOLFSSL_DEBUG_TRACE_ERROR_CODES || */ + /* WOLFSSL_DEBUG_TRACE_ERROR_CODES_SUPPORT */ #ifdef WOLFSSL_DEBUG_BACKTRACE_ERROR_CODES diff --git a/wolfssl/wolfcrypt/logging.h b/wolfssl/wolfcrypt/logging.h index efed186fdb7..64e716acbc5 100644 --- a/wolfssl/wolfcrypt/logging.h +++ b/wolfssl/wolfcrypt/logging.h @@ -583,7 +583,8 @@ WOLFSSL_API void wolfSSL_SetLoggingPrefix(const char* prefix); WOLFSSL_API XFILE wc_backtrace_set_fp(XFILE new_fp); #endif -#ifdef WOLFSSL_DEBUG_TRACE_ERROR_CODES +#if defined(WOLFSSL_DEBUG_TRACE_ERROR_CODES) || \ + defined(WOLFSSL_DEBUG_TRACE_ERROR_CODES_SUPPORT) WOLFSSL_API int wc_debug_trace_error_codes_enabled(void); WOLFSSL_API int wc_debug_trace_error_codes_set(int state); #endif From 9cad7a568a46b361494c9fb4c2d596327698e259 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Tue, 4 Aug 2026 01:53:18 -0500 Subject: [PATCH 35/44] wolfcrypt/src/memory.c: replace PRNG in SAVE_VECTOR_REGISTERS2_fuzzer() with xorshift64 (Marsaglia 2003). --- wolfcrypt/src/memory.c | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/wolfcrypt/src/memory.c b/wolfcrypt/src/memory.c index 26766d1d34b..4c02e3f2002 100644 --- a/wolfcrypt/src/memory.c +++ b/wolfcrypt/src/memory.c @@ -1803,38 +1803,36 @@ WOLFSSL_LOCAL int SAVE_VECTOR_REGISTERS2_fuzzer(void) { /* alternate implementation useful for testing in the kernel module build, where * glibc and thread-local storage are unavailable. - * - * note this is not a well-behaved PRNG, but is adequate for fuzzing purposes. - * the prn sequence is incompressible according to ent and xz, and does not - * cycle within 10M iterations with various seeds including zero, but the Chi - * square distribution is poor, and the unconditioned lsb bit balance is ~54% - * regardless of seed. - * - * deterministic only if access is single-threaded, but never degenerate. */ WOLFSSL_LOCAL int SAVE_VECTOR_REGISTERS2_fuzzer(void) { - static unsigned long prn = WC_DEBUG_VECTOR_REGISTERS_FUZZING_SEED; - static int balance_bit = 0; - unsigned long new_prn = prn ^ 0xba86943da66ee701ul; /* note this magic - * random number is - * bit-balanced. - */ + /* xorshift64 (Marsaglia 2003): a bijection on the nonzero 64-bit states + * with a single cycle of period 2^64 - 1 -- no state-space contraction, + * no short cycles, and the seed selects only the phase. Aligned 64-bit + * stores are atomic on supported targets and every stored value is + * nonzero, so unsynchronized concurrent access loses updates but can + * never degenerate the state. + */ + static word64 prn = + (word64)WC_DEBUG_VECTOR_REGISTERS_FUZZING_SEED != W64LIT(0) ? + (word64)WC_DEBUG_VECTOR_REGISTERS_FUZZING_SEED : + W64LIT(0x9e3779b97f4a7c15); /* zero is the map's one fixed point -- + * substitute an arbitrary nonzero seed. + */ + word64 x; #ifdef DEBUG_VECTOR_REGISTER_ACCESS if (wc_debug_vector_registers_retval) return wc_debug_vector_registers_retval; #endif - /* barrel-roll using the bottom 6 bits. */ - if (new_prn & 0x3f) - new_prn = (new_prn << (new_prn & 0x3f)) | - (new_prn >> (0x40 - (new_prn & 0x3f))); - prn = new_prn; - - balance_bit = !balance_bit; + x = prn; + x ^= x << 13; + x ^= x >> 7; + x ^= x << 17; + prn = x; - return ((prn & 1) ^ balance_bit) ? WC_NO_ERR_TRACE(IO_FAILED_E) : 0; + return ((x >> 32) & 1) ? WC_NO_ERR_TRACE(IO_FAILED_E) : 0; } #endif /* !HAVE_THREAD_LS */ From 29674681d1de29bcb6bff8a3b57e436a080aa393 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Tue, 4 Aug 2026 01:54:11 -0500 Subject: [PATCH 36/44] wolfssl/wolfcrypt/memory.h: add #errors for unsupported DEBUG_VECTOR_REGISTER_ACCESS configurations. --- wolfssl/wolfcrypt/memory.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/wolfssl/wolfcrypt/memory.h b/wolfssl/wolfcrypt/memory.h index 403f09b8b38..03a23ba2d26 100644 --- a/wolfssl/wolfcrypt/memory.h +++ b/wolfssl/wolfcrypt/memory.h @@ -360,6 +360,12 @@ WOLFSSL_LOCAL WC_DEBUG_CIPHERLIFECYCLE_WUR int wc_debug_CipherLifecycleFree ((void)(CipherLifecycleTag), (void)(heap), (void)(abort_p), 0) #endif +#if (defined(DEBUG_VECTOR_REGISTER_ACCESS) || \ + defined(DEBUG_VECTOR_REGISTER_ACCESS_FUZZING)) && \ + !defined(WC_HAVE_VECTOR_SPEEDUPS) + #error DEBUG_VECTOR_REGISTER_ACCESS requires WC_HAVE_VECTOR_SPEEDUPS. +#endif + #ifdef DEBUG_VECTOR_REGISTER_ACCESS_FUZZING WOLFSSL_LOCAL int SAVE_VECTOR_REGISTERS2_fuzzer(void); #ifndef WC_DEBUG_VECTOR_REGISTERS_FUZZING_SEED @@ -550,9 +556,15 @@ WOLFSSL_LOCAL WC_DEBUG_CIPHERLIFECYCLE_WUR int wc_debug_CipherLifecycleFree #else /* !DEBUG_VECTOR_REGISTER_ACCESS */ #if !defined(SAVE_VECTOR_REGISTERS2) && defined(DEBUG_VECTOR_REGISTER_ACCESS_FUZZING) - #define SAVE_VECTOR_REGISTERS2(...) SAVE_VECTOR_REGISTERS2_fuzzer() + /* The fuzzer's forced-retval override + * (WC_DEBUG_SET_VECTOR_REGISTERS_RETVAL()) is part of the + * DEBUG_VECTOR_REGISTER_ACCESS machinery, and is required in user mode + * for the unit tests. Kernel module builds don't reach this clause + * because their setup headers define SAVE_VECTOR_REGISTERS2(). + */ + #error User-mode DEBUG_VECTOR_REGISTER_ACCESS_FUZZING requires DEBUG_VECTOR_REGISTER_ACCESS. #endif -#endif +#endif /* !DEBUG_VECTOR_REGISTER_ACCESS */ #if defined(WOLFSSL_LINUXKM) || defined(WC_SYM_RELOC_TABLES) || \ defined(WC_SYM_RELOC_TABLES_SUPPORT) From ec04819695b1c7197620540a05a3af7c61e3e39d Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Tue, 4 Aug 2026 01:56:12 -0500 Subject: [PATCH 37/44] wolfcrypt/test/test.c: fix error codes in ecc_test_curve_size(), mldsa_param_*_vfy_test(), test_mldsa_decode_level(), and mldsa_test(). --- wolfcrypt/test/test.c | 48 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 43 insertions(+), 5 deletions(-) diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index 866bb57b596..8ab6dbe9dfd 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -61,7 +61,6 @@ #if defined(HAVE_WOLFCRYPT_TEST_OPTIONS) #include - #define err_sys err_sys_remap /* remap err_sys */ #include #undef err_sys #endif @@ -41613,7 +41612,7 @@ static wc_test_ret_t ecc_test_curve_size(WC_RNG* rng, int keySize, int testVerif } while (ret == WC_NO_ERR_TRACE(WC_PENDING_E)); #ifdef WC_TEST_NO_ECC_SIGN_VERIFY_ZERO_DIGEST if (ret == 0) { - ERROR_OUT(WC_TEST_RET_ENC_EC(ret), done); + ERROR_OUT(WC_TEST_RET_ENC_NC, done); } else { ret = 0; @@ -56466,11 +56465,15 @@ static wc_test_ret_t mldsa_param_44_vfy_test(void) ret = mldsa_param_vfy_test(WC_ML_DSA_44, ml_dsa_44_pub_key, (word32)sizeof(ml_dsa_44_pub_key), ml_dsa_44_sig, (word32)sizeof(ml_dsa_44_sig)); + if (ret != 0) + ret = WC_TEST_RET_ENC_EC(ret); #ifdef WOLFSSL_MLDSA_FIPS204_DRAFT if (ret == 0) { ret = mldsa_param_vfy_test(WC_ML_DSA_44_DRAFT, ml_dsa_44_draft_pub_key, (word32)sizeof(ml_dsa_44_draft_pub_key), ml_dsa_44_draft_sig, (word32)sizeof(ml_dsa_44_draft_sig)); + if (ret != 0) + ret = WC_TEST_RET_ENC_EC(ret); } #endif @@ -57464,11 +57467,15 @@ static wc_test_ret_t mldsa_param_65_vfy_test(void) ret = mldsa_param_vfy_test(WC_ML_DSA_65, ml_dsa_65_pub_key, (word32)sizeof(ml_dsa_65_pub_key), ml_dsa_65_sig, (word32)sizeof(ml_dsa_65_sig)); + if (ret != 0) + ret = WC_TEST_RET_ENC_EC(ret); #ifdef WOLFSSL_MLDSA_FIPS204_DRAFT if (ret == 0) { ret = mldsa_param_vfy_test(WC_ML_DSA_65_DRAFT, ml_dsa_65_draft_pub_key, (word32)sizeof(ml_dsa_65_draft_pub_key), ml_dsa_65_draft_sig, (word32)sizeof(ml_dsa_65_draft_sig)); + if (ret != 0) + ret = WC_TEST_RET_ENC_EC(ret); } #endif @@ -58821,11 +58828,15 @@ static wc_test_ret_t mldsa_param_87_vfy_test(void) ret = mldsa_param_vfy_test(WC_ML_DSA_87, ml_dsa_87_pub_key, (word32)sizeof(ml_dsa_87_pub_key), ml_dsa_87_sig, (word32)sizeof(ml_dsa_87_sig)); + if (ret != 0) + ret = WC_TEST_RET_ENC_EC(ret); #ifdef WOLFSSL_MLDSA_FIPS204_DRAFT if (ret == 0) { ret = mldsa_param_vfy_test(WC_ML_DSA_87_DRAFT, ml_dsa_87_draft_pub_key, (word32)sizeof(ml_dsa_87_draft_pub_key), ml_dsa_87_draft_sig, (word32)sizeof(ml_dsa_87_draft_sig)); + if (ret != 0) + ret = WC_TEST_RET_ENC_EC(ret); } #endif @@ -59050,29 +59061,37 @@ static wc_test_ret_t test_mldsa_decode_level(const byte* rawKey, key = (wc_MlDsaKey *)XMALLOC(sizeof(*key), HEAP_HINT, DYNAMIC_TYPE_TMP_BUFFER); if (der == NULL || key == NULL) { - ret = MEMORY_E; + ret = WC_TEST_RET_ENC_EC(MEMORY_E); } #endif /* Initialize key */ if (ret == 0) { ret = wc_MlDsaKey_Init(key, NULL, devId); + if (ret != 0) + ret = WC_TEST_RET_ENC_EC(ret); } /* Import raw key, setting the security level */ if (ret == 0) { ret = wc_MlDsaKey_SetParams(key, expectedLevel); + if (ret != 0) + ret = WC_TEST_RET_ENC_EC(ret); } if (ret == 0) { #ifdef WOLFSSL_MLDSA_PUBLIC_KEY if (isPublicOnlyKey) { ret = wc_MlDsaKey_ImportPubRaw(key, rawKey, rawKeySz); + if (ret != 0) + ret = WC_TEST_RET_ENC_EC(ret); } #endif #ifdef WOLFSSL_MLDSA_PRIVATE_KEY if (!isPublicOnlyKey) { ret = wc_MlDsaKey_ImportPrivRaw(key, rawKey, rawKeySz); + if (ret != 0) + ret = WC_TEST_RET_ENC_EC(ret); } #endif } @@ -59084,12 +59103,16 @@ static wc_test_ret_t test_mldsa_decode_level(const byte* rawKey, if (isPublicOnlyKey) { ret = wc_MlDsaKey_PublicKeyToDer(key, der, MLDSA_MAX_PRV_KEY_DER_SIZE, 1); + if (ret < 0) + ret = WC_TEST_RET_ENC_EC(ret); } #endif #ifdef WOLFSSL_MLDSA_PRIVATE_KEY if (!isPublicOnlyKey) { ret = wc_MlDsaKey_PrivateKeyToDer(key, der, MLDSA_MAX_PRV_KEY_DER_SIZE); + if (ret < 0) + ret = WC_TEST_RET_ENC_EC(ret); } #endif if (ret >= 0) { @@ -59102,11 +59125,15 @@ static wc_test_ret_t test_mldsa_decode_level(const byte* rawKey, if (ret == 0) { wc_MlDsaKey_Free(key); ret = wc_MlDsaKey_Init(key, NULL, devId); + if (ret != 0) + ret = WC_TEST_RET_ENC_EC(ret); } /* First test decoding when security level is set externally */ if (ret == 0) { ret = wc_MlDsaKey_SetParams(key, expectedLevel); + if (ret != 0) + ret = WC_TEST_RET_ENC_EC(ret); } if (ret == 0) { @@ -59114,11 +59141,15 @@ static wc_test_ret_t test_mldsa_decode_level(const byte* rawKey, #ifdef WOLFSSL_MLDSA_PUBLIC_KEY if (isPublicOnlyKey) { ret = wc_MlDsaKey_PublicKeyDecode(key, der, derSz, &idx); + if (ret != 0) + ret = WC_TEST_RET_ENC_EC(ret); } #endif #ifdef WOLFSSL_MLDSA_PRIVATE_KEY if (!isPublicOnlyKey) { ret = wc_MlDsaKey_PrivateKeyDecode(key, der, derSz, &idx); + if (ret != 0) + ret = WC_TEST_RET_ENC_EC(ret); } #endif } @@ -59127,6 +59158,8 @@ static wc_test_ret_t test_mldsa_decode_level(const byte* rawKey, if (ret == 0) { wc_MlDsaKey_Free(key); ret = wc_MlDsaKey_Init(key, NULL, devId); + if (ret != 0) + ret = WC_TEST_RET_ENC_EC(ret); } #ifndef WOLFSSL_MLDSA_FIPS204_DRAFT @@ -59136,11 +59169,15 @@ static wc_test_ret_t test_mldsa_decode_level(const byte* rawKey, #ifdef WOLFSSL_MLDSA_PUBLIC_KEY if (isPublicOnlyKey) { ret = wc_MlDsaKey_PublicKeyDecode(key, der, derSz, &idx); + if (ret != 0) + ret = WC_TEST_RET_ENC_EC(ret); } #endif #ifdef WOLFSSL_MLDSA_PRIVATE_KEY if (!isPublicOnlyKey) { ret = wc_MlDsaKey_PrivateKeyDecode(key, der, derSz, &idx); + if (ret != 0) + ret = WC_TEST_RET_ENC_EC(ret); } #endif } @@ -59164,6 +59201,8 @@ static wc_test_ret_t test_mldsa_decode_level(const byte* rawKey, ret = wc_MlDsaKey_Init(key, NULL, devId); if (ret == 0) { ret = wc_MlDsaKey_SetParams(key, expectedLevel); + if (ret != 0) + ret = WC_TEST_RET_ENC_EC(ret); } if (ret == 0) { if (wc_MlDsaKey_ImportPrivRaw(key, der, rawKeySz) != @@ -59921,8 +59960,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t mldsa_test(void) ret = wc_InitRng(&rng); #endif if (ret != 0) { - ret = WC_TEST_RET_ENC_EC(ret); - return ret; + return WC_TEST_RET_ENC_EC(ret); } #ifndef WOLFSSL_NO_ML_DSA_44 From 83b175ce95ab9b3c2b33a75fb9b7b3c9f7e2d05d Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Tue, 4 Aug 2026 18:27:36 -0500 Subject: [PATCH 38/44] fixes and improvements from AI review: .github/workflows/fips-dev-no-post.yml: add reporting of fuzzing seed. wolfcrypt/src/aes.c, tests/api/test_aes.c, .wolfssl_known_macro_extras: * change FIPS AES-GCM nonce size restrictions from from opt-out (WC_FIPS_AESGCM_ALLOW_SHORT_NONCES) to opt-in (WC_FIPS_AESGCM_NO_SHORT_NONCES). * apply restrictions only on encryption operations, never on decryption. configure.ac: fix HAVE_FIPS_VERSION of fips-ready; fix enable_dh setup in KERNEL_MODE_DEFAULTS setup; fix help message for --enable-dh. linuxkm/x86_vector_register_glue.c: add dump_stack() on each BUG/WARNING message that didn't already have it. src/tls.c: fix a couple leaks in TLSX_KeyShare_GenDhKey(). tests/swdev/swdev.c: gate src->sha_method access in swdev_sha256_copy_state() and swdev_sha512_copy_state() appropriately. tests/unit.c: conditionally include dh.h, to assure wc_dh_enable() is available. wolfcrypt/src/dh.c: * in wc_InitDhKey_ex(), zero the key at entry unless null, remove duplicate key->trustedGroup = 0, and call wc_FreeDhKey() on error at end. * add missing wc_dh_enabled checks in wc_DhGeneratePublic() and wc_DhGenerateParams(). wolfcrypt/src/error.c: fix missing space in FIPS_UNAPPROVED_E string. b/wolfssl/wolfcrypt/settings.h: sense __SIZEOF_INT128__ and if defined, but HAVE___INT128_T and/or HAVE___UINT128_T are undefined, define them. wolfcrypt/src/falcon.c: tweak the gate on __uint128_t availability to lean solely on HAVE___UINT128_T. wolfcrypt/src/random.c: fix a couple missed WC_NO_ERR_TRACE() wrappers. wolfcrypt/src/rng_bank.c: properly tolerate WC_ACCEL_INHIBIT_E as a retval from bank->affinity_lock_cb(). wolfcrypt/src/sha256.c, wolfcrypt/src/sha512.c: move #undef WC_C_DYNAMIC_FALLBACK for WOLFSSL_AESNI without USE_INTEL_SPEEDUP to follow all includes, assuring no struct layout conflict. wolfcrypt/src/sha512.c: fix wrong call in intelasm Transform_Sha512() !WC_C_DYNAMIC_FALLBACK SHA512_C path. wolfcrypt/test/test.c: fix double-WC_TEST_RET_ENC_EC() in mldsa_param_*_vfy_test(). --- .github/workflows/fips-dev-no-post.yml | 8 +- .wolfssl_known_macro_extras | 2 +- configure.ac | 15 ++-- linuxkm/x86_vector_register_glue.c | 36 ++++++++- src/tls.c | 14 ++++ tests/api/test_aes.c | 15 +--- tests/swdev/swdev.c | 4 +- tests/unit.c | 3 + wolfcrypt/src/aes.c | 103 ++++++++++++++----------- wolfcrypt/src/dh.c | 24 +++++- wolfcrypt/src/error.c | 2 +- wolfcrypt/src/falcon.c | 5 +- wolfcrypt/src/random.c | 4 +- wolfcrypt/src/rng_bank.c | 3 +- wolfcrypt/src/sha256.c | 18 ++--- wolfcrypt/src/sha512.c | 20 ++--- wolfcrypt/test/test.c | 12 --- wolfssl/wolfcrypt/settings.h | 12 +++ 18 files changed, 190 insertions(+), 110 deletions(-) diff --git a/.github/workflows/fips-dev-no-post.yml b/.github/workflows/fips-dev-no-post.yml index 98d9ae9173a..70dfc6f60a8 100644 --- a/.github/workflows/fips-dev-no-post.yml +++ b/.github/workflows/fips-dev-no-post.yml @@ -86,12 +86,16 @@ jobs: # the pool builds with a bare "make" (no way to add variables to that # command line); make picks them up from the environment, and they are # inert for the non-linuxkm configs. Note the heredoc is unquoted so - # $(uname -r) expands -- there is no other $ or backtick in the JSON. + # $(uname -r) and $FUZZING_SEED expand -- there are no other $ or + # backticks in the JSON. - name: Build all configs (parallel, out-of-tree) env: KERNEL_EXTRA_CFLAGS_REMOVE: -pg FORCE_NO_MODULE_SIG: 1 run: | + FUZZING_SEED=$(( (RANDOM << 15) ^ RANDOM )) + echo "FUZZING_SEED=$FUZZING_SEED" + if [ -n "$GITHUB_STEP_SUMMARY" ]; then echo "FUZZING_SEED=$FUZZING_SEED" >> "$GITHUB_STEP_SUMMARY"; fi cat > "$RUNNER_TEMP/fips-dev-no-post-configs.json" <fpu_state & WC_FPU_COUNT_MASK) > 0U) { - if (flags & WC_SVR_FLAG_MAYBE_INHIBIT) + if (flags & WC_SVR_FLAG_MAYBE_INHIBIT) { VRG_PR_WARN_X("BUG: wc_restore_vector_registers_x86() called by pid %d on CPU %d " "with _MAYBE_INHIBIT flag at non-outermost depth %u.\n", task_pid_nr(current), raw_smp_processor_id(), (pstate->fpu_state & WC_FPU_COUNT_MASK) + 1U); + #ifdef WOLFSSL_LINUXKM_VERBOSE_DEBUG + dump_stack(); + #endif + } if (flags & WC_SVR_FLAG_INHIBIT) { if (pstate->fpu_state & WC_FPU_INHIBITED_FLAG) pstate->fpu_state &= ~WC_FPU_INHIBITED_FLAG; - else + else { VRG_PR_WARN_X("BUG: wc_restore_vector_registers_x86() called by pid %d on CPU %d " "with _INHIBIT flag but saved state isn't _INHIBITED_.\n", task_pid_nr(current), raw_smp_processor_id()); + #ifdef WOLFSSL_LINUXKM_VERBOSE_DEBUG + dump_stack(); + #endif + } } return; } @@ -554,10 +578,14 @@ void wc_restore_vector_registers_x86(enum wc_svr_flags flags) #endif local_bh_enable(); } else if (unlikely(pstate->fpu_state & WC_FPU_INHIBITED_FLAG)) { - if (unlikely(! (flags & (WC_SVR_FLAG_INHIBIT | WC_SVR_FLAG_MAYBE_INHIBIT)))) + if (unlikely(! (flags & (WC_SVR_FLAG_INHIBIT | WC_SVR_FLAG_MAYBE_INHIBIT)))) { VRG_PR_WARN_X("BUG: wc_restore_vector_registers_x86() called by pid %d on CPU %d " "without _INHIBIT flag but saved state is _INHIBITED_.\n", task_pid_nr(current), raw_smp_processor_id()); + #ifdef WOLFSSL_LINUXKM_VERBOSE_DEBUG + dump_stack(); + #endif + } pstate->fpu_state = 0U; wc_linuxkm_fpu_state_release(pstate); local_bh_enable(); diff --git a/src/tls.c b/src/tls.c index 1fe31d43af0..c27f08968de 100644 --- a/src/tls.c +++ b/src/tls.c @@ -8217,6 +8217,13 @@ static int TLSX_KeyShare_GenDhKey(WOLFSSL *ssl, KeyShareEntry* kse) /* Setup Key */ ret = wc_InitDhKey_ex((DhKey*)kse->key, ssl->heap, ssl->devId); +#if !defined(HAVE_FIPS) || FIPS_VERSION3_GE(7,0,0) + if (ret != 0) { + XFREE(kse->key, ssl->heap, DYNAMIC_TYPE_DH); + kse->key = NULL; + return ret; + } +#endif if (ret == 0) { dhKey = (DhKey*)kse->key; #ifdef HAVE_PUBLIC_FFDHE @@ -9556,6 +9563,13 @@ static int TLSX_KeyShare_ProcessDh(WOLFSSL* ssl, KeyShareEntry* keyShareEntry) /* Setup Key */ ret = wc_InitDhKey_ex((DhKey*)keyShareEntry->key, ssl->heap, ssl->devId); +#if !defined(HAVE_FIPS) || FIPS_VERSION3_GE(7,0,0) + if (ret != 0) { + XFREE(keyShareEntry->key, ssl->heap, DYNAMIC_TYPE_DH); + keyShareEntry->key = NULL; + return ret; + } +#endif if (ret == 0) { dhKey = (DhKey*)keyShareEntry->key; /* Set key */ diff --git a/tests/api/test_aes.c b/tests/api/test_aes.c index 3b909a08cd3..96f97052940 100644 --- a/tests/api/test_aes.c +++ b/tests/api/test_aes.c @@ -8391,16 +8391,13 @@ int test_wc_AesGcmDecisionCoverage(void) /* Zero-length IV branch: should reject. */ ExpectIntEQ(wc_AesGcmSetExtIV(&aes, iv, 0), WC_NO_ERR_TRACE(BAD_FUNC_ARG)); -#if FIPS_VERSION3_GE(7,0,0) && \ - !defined(WC_FIPS_AESGCM_ALLOW_SHORT_NONCES) - ExpectIntEQ(wc_AesGcmSetExtIV(&aes, iv, GCM_NONCE_MIN_SZ), - WC_NO_ERR_TRACE(FIPS_BAD_VALUE_E)); -#elif (FIPS_VERSION3_EQ(5,2,4) || FIPS_VERSION3_GE(7,0,0)) && \ +#if (FIPS_VERSION3_EQ(5,2,4) || FIPS_VERSION3_GE(7,0,0)) && \ !defined(FIPS_NO_WRAPPERS) ExpectIntEQ(wc_AesGcmSetExtIV(&aes, iv, GCM_NONCE_MIN_SZ), WC_FIPS_NOT_APPROVED); #else - ExpectIntEQ(wc_AesGcmSetExtIV(&aes, iv, GCM_NONCE_MIN_SZ), 0); + /* GCM_NONCE_MIN_SZ is missing from FIPS v2. */ + ExpectIntEQ(wc_AesGcmSetExtIV(&aes, iv, 8 /* GCM_NONCE_MIN_SZ */), 0); #endif #endif /* !WC_NO_RNG && !HAVE_SELFTEST */ @@ -9255,11 +9252,7 @@ int test_wc_AesGcmArgMcdc(void) * self-contained demonstration). */ ExpectIntEQ(wc_AesGcmSetIV(&aes, 10, NULL, 0, &rng), WC_NO_ERR_TRACE(BAD_FUNC_ARG)); -#if FIPS_VERSION3_GE(7,0,0) && \ - !defined(WC_FIPS_AESGCM_ALLOW_SHORT_NONCES) - ExpectIntEQ(wc_AesGcmSetIV(&aes, GCM_NONCE_MIN_SZ, NULL, 0, &rng), - WC_NO_ERR_TRACE(FIPS_BAD_VALUE_E)); -#elif (FIPS_VERSION3_EQ(5,2,4) || FIPS_VERSION3_GE(7,0,0)) && \ +#if (FIPS_VERSION3_EQ(5,2,4) || FIPS_VERSION3_GE(7,0,0)) && \ !defined(FIPS_NO_WRAPPERS) ExpectIntEQ(wc_AesGcmSetIV(&aes, GCM_NONCE_MIN_SZ, NULL, 0, &rng), WC_FIPS_NOT_APPROVED); diff --git a/tests/swdev/swdev.c b/tests/swdev/swdev.c index f5163626ed2..61983992393 100644 --- a/tests/swdev/swdev.c +++ b/tests/swdev/swdev.c @@ -366,7 +366,7 @@ static void swdev_sha256_copy_state(wc_Sha256* dst, const wc_Sha256* src) dst->buffLen = src->buffLen; dst->loLen = src->loLen; dst->hiLen = src->hiLen; -#ifdef WC_C_DYNAMIC_FALLBACK +#if defined(WC_C_DYNAMIC_FALLBACK) && defined(HAVE_FIPS) && FIPS_VERSION_LT(7,0,0) dst->sha_method = src->sha_method; #endif #ifdef WOLFSSL_HASH_FLAGS @@ -462,7 +462,7 @@ static void swdev_sha512_copy_state(wc_Sha512* dst, const wc_Sha512* src) dst->buffLen = src->buffLen; dst->loLen = src->loLen; dst->hiLen = src->hiLen; -#ifdef WC_C_DYNAMIC_FALLBACK +#if defined(WC_C_DYNAMIC_FALLBACK) && defined(HAVE_FIPS) && FIPS_VERSION_LT(7,0,0) dst->sha_method = src->sha_method; #endif #ifdef WOLFSSL_HASH_FLAGS diff --git a/tests/unit.c b/tests/unit.c index 856c89b3f93..2a2b1c2c6f5 100644 --- a/tests/unit.c +++ b/tests/unit.c @@ -28,6 +28,9 @@ #ifdef HAVE_ECC #include #endif +#ifndef NO_DH + #include +#endif #include #include diff --git a/wolfcrypt/src/aes.c b/wolfcrypt/src/aes.c index aad3f90529b..8de26b7ece9 100644 --- a/wolfcrypt/src/aes.c +++ b/wolfcrypt/src/aes.c @@ -11206,7 +11206,7 @@ int wc_AesGcmEncrypt(Aes* aes, byte* out, const byte* in, word32 sz, if (ret != 0) return ret; -#if defined(HAVE_FIPS) && !defined(WC_FIPS_AESGCM_ALLOW_SHORT_NONCES) +#if defined(HAVE_FIPS) && defined(WC_FIPS_AESGCM_NO_SHORT_NONCES) if (ivSz < GCM_NONCE_MID_SZ) return FIPS_BAD_VALUE_E; #endif @@ -14256,8 +14256,8 @@ static WARN_UNUSED_RESULT int AesGcmDecryptFinal_RISCV64( * is NULL, or the IV is NULL and no previous IV has been set. * @return MEMORY_E when dynamic memory allocation fails. (WOLFSSL_SMALL_STACK) */ -static int wc_AesGcmInit_local(Aes* aes, const byte* key, word32 len, const byte* iv, - word32 ivSz, int decrypt_p) +int wc_AesGcmInit(Aes* aes, const byte* key, word32 len, const byte* iv, + word32 ivSz) { int ret = 0; @@ -14268,20 +14268,6 @@ static int wc_AesGcmInit_local(Aes* aes, const byte* key, word32 len, const byte ret = BAD_FUNC_ARG; } -#if defined(HAVE_FIPS) && !defined(WC_FIPS_AESGCM_ALLOW_SHORT_NONCES) - /* Note iv is an optional arg to wc_AesGcmInit(), so we tolerate zero ivSz - * here. - * - * Additionally, there is no FIPS check on ivSz in decrypt mode -- SP - * 800-38D IV construction requirements bind encryption only; decryption - * must accept externally generated IVs of any supported length. - */ - if ((ret == 0) && (! decrypt_p) && (ivSz > 0) && (ivSz < GCM_NONCE_MID_SZ)) - ret = FIPS_BAD_VALUE_E; -#else - (void)decrypt_p; -#endif - #if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_AESNI) if ((ret == 0) && (aes->streamData == NULL)) { /* Allocate buffers for streaming. */ @@ -14324,16 +14310,26 @@ static int wc_AesGcmInit_local(Aes* aes, const byte* key, word32 len, const byte #endif if (ret == 0) { - /* Set the IV passed in if it is smaller than a block. */ - if ((iv != NULL) && (ivSz <= WC_AES_BLOCK_SIZE)) { - XMEMMOVE((byte*)aes->reg, iv, ivSz); - aes->nonceSz = ivSz; + if (iv != NULL) { + if (ivSz <= WC_AES_BLOCK_SIZE) { + /* Set the IV passed in if it is smaller than a block. */ + XMEMMOVE((byte*)aes->reg, iv, ivSz); + aes->nonceSz = ivSz; + } + else { + /* FIPS short-nonce detection depends on aes->nonceSz == 0 + * signifying that supplied ivSz > WC_AES_BLOCK_SIZE. + */ + aes->nonceSz = 0; + } } - /* No IV passed in, check for cached IV. */ - if ((iv == NULL) && (aes->nonceSz != 0)) { - /* Use the cached copy. */ - iv = (byte*)aes->reg; - ivSz = aes->nonceSz; + else { + /* No IV passed in, check for cached IV. */ + if (aes->nonceSz != 0) { + /* Use the cached copy. */ + iv = (byte*)aes->reg; + ivSz = aes->nonceSz; + } } if (iv != NULL) { @@ -14378,12 +14374,6 @@ static int wc_AesGcmInit_local(Aes* aes, const byte* key, word32 len, const byte return ret; } -int wc_AesGcmInit(Aes* aes, const byte* key, word32 len, const byte* iv, - word32 ivSz) -{ - return wc_AesGcmInit_local(aes, key, len, iv, ivSz, 0 /* decrypt_p */); -} - /* Initialize an AES GCM cipher for encryption. * * Must call wc_AesInit() before calling this function. @@ -14400,7 +14390,15 @@ int wc_AesGcmInit(Aes* aes, const byte* key, word32 len, const byte* iv, int wc_AesGcmEncryptInit(Aes* aes, const byte* key, word32 len, const byte* iv, word32 ivSz) { - return wc_AesGcmInit_local(aes, key, len, iv, ivSz, 0); +#if defined(HAVE_FIPS) && defined(WC_FIPS_AESGCM_NO_SHORT_NONCES) + /* Note iv is an optional arg to wc_AesGcmEncryptInit(), so we tolerate zero ivSz + * here. + */ + if ((ivSz > 0) && (ivSz < GCM_NONCE_MID_SZ)) + return FIPS_BAD_VALUE_E; +#endif + + return wc_AesGcmInit(aes, key, len, iv, ivSz); } /* Initialize an AES GCM cipher for encryption. Get IV. @@ -14430,11 +14428,16 @@ int wc_AesGcmEncryptInit_ex(Aes* aes, const byte* key, word32 len, byte* ivOut, if ((aes == NULL) || (ivOut == NULL) || (ivOutSz != aes->nonceSz)) { ret = BAD_FUNC_ARG; } +#if defined(HAVE_FIPS) && defined(WC_FIPS_AESGCM_NO_SHORT_NONCES) + else if (ivOutSz < GCM_NONCE_MID_SZ) { + ret = FIPS_BAD_VALUE_E; + } +#endif else { /* Copy out the IV including generated part for decryption. */ XMEMCPY(ivOut, aes->reg, ivOutSz); /* Initialize AES GCM cipher with key and cached Iv. */ - ret = wc_AesGcmInit_local(aes, key, len, NULL, 0, 0); + ret = wc_AesGcmInit(aes, key, len, NULL, 0); } return ret; @@ -14461,6 +14464,11 @@ int wc_AesGcmEncryptUpdate(Aes* aes, byte* out, const byte* in, word32 sz, ret = MISSING_IV; } +#if defined(HAVE_FIPS) && defined(WC_FIPS_AESGCM_NO_SHORT_NONCES) + if ((ret == 0) && (aes->nonceSz != 0) && (aes->nonceSz < GCM_NONCE_MID_SZ)) + ret = FIPS_BAD_VALUE_E; +#endif + /* Prevent overflow of aes->cSz and ->aSz. Per NIST SP 800-38D section * 5.2.1.1, the maximum allowed ciphertext limit is 2^32 - 2 blocks, but we * currently pass around the cumulative sizes in bytes as word32s, so we @@ -14548,6 +14556,11 @@ int wc_AesGcmEncryptFinal(Aes* aes, byte* authTag, word32 authTagSz) ret = MISSING_IV; } +#if defined(HAVE_FIPS) && defined(WC_FIPS_AESGCM_NO_SHORT_NONCES) + if ((ret == 0) && (aes->nonceSz != 0) && (aes->nonceSz < GCM_NONCE_MID_SZ)) + ret = FIPS_BAD_VALUE_E; +#endif + if (ret == 0) { /* Calculate authentication tag. */ #ifdef WOLFSSL_AESNI @@ -14599,7 +14612,12 @@ int wc_AesGcmEncryptFinal(Aes* aes, byte* authTag, word32 authTagSz) int wc_AesGcmDecryptInit(Aes* aes, const byte* key, word32 len, const byte* iv, word32 ivSz) { - return wc_AesGcmInit_local(aes, key, len, iv, ivSz, 1); + /* + * There is no FIPS check on ivSz in decrypt mode -- SP + * 800-38D IV construction requirements bind encryption only; decryption + * must accept externally generated IVs of any supported length. + */ + return wc_AesGcmInit(aes, key, len, iv, ivSz); } /* Update the AES GCM for decryption with data and/or authentication data. */ @@ -14757,11 +14775,6 @@ int wc_AesGcmSetExtIV(Aes* aes, const byte* iv, word32 ivSz) ret = BAD_FUNC_ARG; } -#if defined(HAVE_FIPS) && !defined(WC_FIPS_AESGCM_ALLOW_SHORT_NONCES) - if (ret == 0 && ivSz < GCM_NONCE_MID_SZ) - ret = FIPS_BAD_VALUE_E; -#endif - if (ret == 0) { XMEMCPY((byte*)aes->reg, iv, ivSz); @@ -14793,11 +14806,6 @@ int wc_AesGcmSetIV(Aes* aes, word32 ivSz, ret = BAD_FUNC_ARG; } -#if defined(HAVE_FIPS) && !defined(WC_FIPS_AESGCM_ALLOW_SHORT_NONCES) - if (ret == 0 && ivSz < GCM_NONCE_MID_SZ) - ret = FIPS_BAD_VALUE_E; -#endif - if (ret == 0) { byte* iv = (byte*)aes->reg; @@ -14837,6 +14845,11 @@ int wc_AesGcmEncrypt_ex(Aes* aes, byte* out, const byte* in, word32 sz, ret = BAD_FUNC_ARG; } +#if defined(HAVE_FIPS) && defined(WC_FIPS_AESGCM_NO_SHORT_NONCES) + if ((ret == 0) && (ivOutSz < GCM_NONCE_MID_SZ)) + ret = FIPS_BAD_VALUE_E; +#endif + if (ret == 0) { aes->invokeCtr[0]++; if (aes->invokeCtr[0] == 0) { diff --git a/wolfcrypt/src/dh.c b/wolfcrypt/src/dh.c index d8ee106414e..06d38a25f1f 100644 --- a/wolfcrypt/src/dh.c +++ b/wolfcrypt/src/dh.c @@ -58,6 +58,12 @@ #endif #ifdef WC_DH_INITIAL_RUNTIME_ENABLEMENT + +/* Note that the wc_dh_enabled runtime feature-switching facility is neither + * thread-synchronized nor thread-local, and is only allowed during global + * initialization or self-test sequences before application service begins. + */ + static volatile int wc_dh_enabled = WC_DH_INITIAL_RUNTIME_ENABLEMENT; int wc_dh_enable(void) { if (wc_dh_enabled) @@ -963,6 +969,8 @@ int wc_InitDhKey_ex(DhKey* key, void* heap, int devId) if (key == NULL) return BAD_FUNC_ARG; + XMEMSET(key, 0, sizeof(*key)); + key->heap = heap; /* for XMALLOC/XFREE in future */ key->trustedGroup = 0; @@ -986,8 +994,6 @@ int wc_InitDhKey_ex(DhKey* key, void* heap, int devId) (void)devId; #endif - key->trustedGroup = 0; - #ifdef WOLFSSL_KCAPI_DH key->handle = NULL; #endif @@ -996,6 +1002,10 @@ int wc_InitDhKey_ex(DhKey* key, void* heap, int devId) key->nb = NULL; #endif + /* On failure, release MPI allocations, if any. */ + if (ret != 0) + (void)wc_FreeDhKey(key); + return ret; } @@ -1464,6 +1474,11 @@ int wc_DhGeneratePublic(DhKey* key, byte* priv, word32 privSz, return BAD_FUNC_ARG; } +#ifdef WC_DH_INITIAL_RUNTIME_ENABLEMENT + if (! wc_dh_enabled) + return FIPS_NOT_ALLOWED_E; +#endif + ret = GeneratePublicDh(key, priv, privSz, pub, pubSz); #if FIPS_VERSION_GE(5,0) || defined(WOLFSSL_VALIDATE_DH_KEYGEN) @@ -3191,6 +3206,11 @@ int wc_DhGenerateParams(WC_RNG *rng, int modSz, DhKey *dh) if (rng == NULL || dh == NULL) ret = BAD_FUNC_ARG; +#ifdef WC_DH_INITIAL_RUNTIME_ENABLEMENT + if (! wc_dh_enabled) + return FIPS_NOT_ALLOWED_E; +#endif + /* set group size in bytes from modulus size * FIPS 186-4 defines valid values (1024, 160) (2048, 256) (3072, 256) */ diff --git a/wolfcrypt/src/error.c b/wolfcrypt/src/error.c index d5871dc31ca..e48bacf922c 100644 --- a/wolfcrypt/src/error.c +++ b/wolfcrypt/src/error.c @@ -745,7 +745,7 @@ const char* wc_GetErrorString(int error) return "Supplied value was rejected by FIPS policy"; case FIPS_UNAPPROVED_E: - return "Requested operation succeeded, but supplied" + return "Requested operation succeeded, but supplied " "parameters are unapproved for FIPS"; case MAX_CODE_E: diff --git a/wolfcrypt/src/falcon.c b/wolfcrypt/src/falcon.c index 62da7cb5238..4737ff3c19a 100644 --- a/wolfcrypt/src/falcon.c +++ b/wolfcrypt/src/falcon.c @@ -1149,8 +1149,7 @@ int fpr_lt(fpr x, fpr y) * targets it is a single multiply instruction; the portable 32x32 fallback * (one MUL becomes four) is kept for platforms without a 128-bit integer type * (e.g. Cortex-M). Both paths are constant-time and bit-identical. */ -#if defined(HAVE___UINT128_T) && !defined(NO_INT128) && \ - defined(__SIZEOF_INT128__) +#if defined(HAVE___UINT128_T) && !defined(NO_INT128) #define FALCON_MULHI(z, y) \ ((word64)(((__uint128_t)(word64)(z) * (__uint128_t)(word64)(y)) >> 64)) #else @@ -8311,7 +8310,7 @@ int falcon_native_sign_msg(const byte* in, word32 inLen, byte* out, word32* outL * early-exit path is covered by the check. */ #ifdef WOLFSSL_CHECK_MEM_ZERO XMEMSET(spc, 0, sizeof(*spc)); - wc_MemZero_Add("falcon sign spc", spc, sizeof(spc)); + wc_MemZero_Add("falcon sign spc", spc, sizeof(*spc)); #endif /* One allocation backs every sign buffer (the working set is >100KB at diff --git a/wolfcrypt/src/random.c b/wolfcrypt/src/random.c index 31ac0e0393c..f6ea349904e 100644 --- a/wolfcrypt/src/random.c +++ b/wolfcrypt/src/random.c @@ -813,7 +813,7 @@ static int Hash_gen(DRBG_internal* drbg, byte* out, word32 outSz, const byte* V) #endif #ifdef WC_VERBOSE_RNG - if ((ret != DRBG_SUCCESS) && (ret != DRBG_FAILURE)) { + if ((ret != DRBG_SUCCESS) && (ret != WC_NO_ERR_TRACE(DRBG_FAILURE))) { /* Note, if we're just going to return DRBG_FAILURE to the caller, then * there's no point printing it out here because (1) the lower-level * code that was remapped to DRBG_FAILURE already got printed before the @@ -1011,7 +1011,7 @@ static int Hash_DRBG_Generate(DRBG_internal* drbg, byte* out, word32 outSz, } #ifdef WC_VERBOSE_RNG - if ((ret != DRBG_SUCCESS) && (ret != DRBG_FAILURE)) { + if ((ret != DRBG_SUCCESS) && (ret != WC_NO_ERR_TRACE(DRBG_FAILURE))) { /* see note above regarding log spam reduction */ WOLFSSL_DEBUG_PRINTF("ERROR: Hash_DRBG_Generate failed with err %d.", ret); diff --git a/wolfcrypt/src/rng_bank.c b/wolfcrypt/src/rng_bank.c index 55fb4663f06..c17e30eda11 100644 --- a/wolfcrypt/src/rng_bank.c +++ b/wolfcrypt/src/rng_bank.c @@ -545,7 +545,8 @@ WOLFSSL_API int wc_rng_bank_checkout( ret = bank->affinity_lock_cb(bank->cb_arg); if (ret == 0) new_lock_value |= WC_RNG_BANK_INST_LOCK_AFFINITY_LOCKED; - else if (ret == WC_NO_ERR_TRACE(ALREADY_E)) + else if ((ret == WC_NO_ERR_TRACE(ALREADY_E)) || + (ret == WC_NO_ERR_TRACE(WC_ACCEL_INHIBIT_E))) ret = 0; else break; diff --git a/wolfcrypt/src/sha256.c b/wolfcrypt/src/sha256.c index 840a818bf42..750f663cf16 100644 --- a/wolfcrypt/src/sha256.c +++ b/wolfcrypt/src/sha256.c @@ -43,15 +43,6 @@ on the specific device platform. #include -#if defined(WC_C_DYNAMIC_FALLBACK) && \ - defined(WOLFSSL_AESNI) && !defined(USE_INTEL_SPEEDUP) - /* AES-NI can be enabled with WC_C_DYNAMIC_FALLBACK, but without the rest of - * USE_INTEL_SPEEDUP, in which case we need to disable the dynamic - * fallback. - */ - #undef WC_C_DYNAMIC_FALLBACK -#endif - /* * SHA256 Build Options: * USE_SLOW_SHA256: Reduces code size by not partially unrolling @@ -189,6 +180,15 @@ on the specific device platform. } #endif +#if defined(WC_C_DYNAMIC_FALLBACK) && \ + defined(WOLFSSL_AESNI) && !defined(USE_INTEL_SPEEDUP) + /* AES-NI can be enabled with WC_C_DYNAMIC_FALLBACK, but without the rest of + * USE_INTEL_SPEEDUP, in which case we need to disable the dynamic + * fallback. + */ + #undef WC_C_DYNAMIC_FALLBACK +#endif + #if defined(WOLFSSL_X86_64_BUILD) && defined(USE_INTEL_SPEEDUP) #if defined(__GNUC__) && ((__GNUC__ < 4) || \ (__GNUC__ == 4 && __GNUC_MINOR__ <= 8)) diff --git a/wolfcrypt/src/sha512.c b/wolfcrypt/src/sha512.c index 6da364834a4..d846f6db5a3 100644 --- a/wolfcrypt/src/sha512.c +++ b/wolfcrypt/src/sha512.c @@ -65,15 +65,6 @@ " acceleration backends" #endif -#if defined(WC_C_DYNAMIC_FALLBACK) && \ - defined(WOLFSSL_AESNI) && !defined(USE_INTEL_SPEEDUP) - /* AES-NI can be enabled with WC_C_DYNAMIC_FALLBACK, but without the rest of - * USE_INTEL_SPEEDUP, in which case we need to disable the dynamic - * fallback. - */ - #undef WC_C_DYNAMIC_FALLBACK -#endif - #if (defined(WOLFSSL_SHA512) || defined(WOLFSSL_SHA384)) /* determine if we are using Espressif SHA hardware acceleration */ @@ -145,6 +136,15 @@ #include #endif +#if defined(WC_C_DYNAMIC_FALLBACK) && \ + defined(WOLFSSL_AESNI) && !defined(USE_INTEL_SPEEDUP) + /* AES-NI can be enabled with WC_C_DYNAMIC_FALLBACK, but without the rest of + * USE_INTEL_SPEEDUP, in which case we need to disable the dynamic + * fallback. + */ + #undef WC_C_DYNAMIC_FALLBACK +#endif + #if defined(WOLFSSL_X86_64_BUILD) && defined(USE_INTEL_SPEEDUP) #if defined(__GNUC__) && ((__GNUC__ < 4) || \ (__GNUC__ == 4 && __GNUC_MINOR__ <= 8)) @@ -1285,7 +1285,7 @@ static int InitSha512_256(wc_Sha512* sha512) } #else if (sha_method == SHA512_C) - return Transform_Sha512(sha512); + return _Transform_Sha512(sha512); SAVE_VECTOR_REGISTERS(return _svr_ret;); #endif switch (sha_method) { diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index 8ab6dbe9dfd..c86fa68a9a7 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -56465,15 +56465,11 @@ static wc_test_ret_t mldsa_param_44_vfy_test(void) ret = mldsa_param_vfy_test(WC_ML_DSA_44, ml_dsa_44_pub_key, (word32)sizeof(ml_dsa_44_pub_key), ml_dsa_44_sig, (word32)sizeof(ml_dsa_44_sig)); - if (ret != 0) - ret = WC_TEST_RET_ENC_EC(ret); #ifdef WOLFSSL_MLDSA_FIPS204_DRAFT if (ret == 0) { ret = mldsa_param_vfy_test(WC_ML_DSA_44_DRAFT, ml_dsa_44_draft_pub_key, (word32)sizeof(ml_dsa_44_draft_pub_key), ml_dsa_44_draft_sig, (word32)sizeof(ml_dsa_44_draft_sig)); - if (ret != 0) - ret = WC_TEST_RET_ENC_EC(ret); } #endif @@ -57467,15 +57463,11 @@ static wc_test_ret_t mldsa_param_65_vfy_test(void) ret = mldsa_param_vfy_test(WC_ML_DSA_65, ml_dsa_65_pub_key, (word32)sizeof(ml_dsa_65_pub_key), ml_dsa_65_sig, (word32)sizeof(ml_dsa_65_sig)); - if (ret != 0) - ret = WC_TEST_RET_ENC_EC(ret); #ifdef WOLFSSL_MLDSA_FIPS204_DRAFT if (ret == 0) { ret = mldsa_param_vfy_test(WC_ML_DSA_65_DRAFT, ml_dsa_65_draft_pub_key, (word32)sizeof(ml_dsa_65_draft_pub_key), ml_dsa_65_draft_sig, (word32)sizeof(ml_dsa_65_draft_sig)); - if (ret != 0) - ret = WC_TEST_RET_ENC_EC(ret); } #endif @@ -58828,15 +58820,11 @@ static wc_test_ret_t mldsa_param_87_vfy_test(void) ret = mldsa_param_vfy_test(WC_ML_DSA_87, ml_dsa_87_pub_key, (word32)sizeof(ml_dsa_87_pub_key), ml_dsa_87_sig, (word32)sizeof(ml_dsa_87_sig)); - if (ret != 0) - ret = WC_TEST_RET_ENC_EC(ret); #ifdef WOLFSSL_MLDSA_FIPS204_DRAFT if (ret == 0) { ret = mldsa_param_vfy_test(WC_ML_DSA_87_DRAFT, ml_dsa_87_draft_pub_key, (word32)sizeof(ml_dsa_87_draft_pub_key), ml_dsa_87_draft_sig, (word32)sizeof(ml_dsa_87_draft_sig)); - if (ret != 0) - ret = WC_TEST_RET_ENC_EC(ret); } #endif diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index 0fd6d99a699..d996d7b599b 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -663,6 +663,18 @@ #define AES_GCM_AESNI_NO_UNROLL #endif +/* Leverage compiler built-ins to assure that __int128_t and __uint128_t are + * gated in regardless of autotools-dependent feature sensing. + */ +#if defined(__SIZEOF_INT128__) && !defined(NO_INT128) + #ifndef HAVE___INT128_T + #define HAVE___INT128_T 1 + #endif + #ifndef HAVE___UINT128_T + #define HAVE___UINT128_T 1 + #endif +#endif + #ifdef IPHONE #define SIZEOF_LONG_LONG 8 #endif From c249a09b38a87ad95ad80c2aa70bd46eeed8f153 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Tue, 4 Aug 2026 22:28:27 -0500 Subject: [PATCH 39/44] wolfcrypt/src/sha256.c, wolfcrypt/src/sha512.c: clean up and fix up gating around WC_C_DYNAMIC_FALLBACK: use WC_SHA{256,512}_RAW_BE_BUFFER to indicate big-endian buffer. tests/swdev/swdev.c: fix typos (FIPS_VERSION3_LT, not FIPS_VERSION_LT). --- tests/swdev/swdev.c | 4 +-- wolfcrypt/src/sha256.c | 63 +++++++++++++++++++++++++----------------- wolfcrypt/src/sha512.c | 55 ++++++++++++++++++++++-------------- 3 files changed, 75 insertions(+), 47 deletions(-) diff --git a/tests/swdev/swdev.c b/tests/swdev/swdev.c index 61983992393..49c05e28b22 100644 --- a/tests/swdev/swdev.c +++ b/tests/swdev/swdev.c @@ -366,7 +366,7 @@ static void swdev_sha256_copy_state(wc_Sha256* dst, const wc_Sha256* src) dst->buffLen = src->buffLen; dst->loLen = src->loLen; dst->hiLen = src->hiLen; -#if defined(WC_C_DYNAMIC_FALLBACK) && defined(HAVE_FIPS) && FIPS_VERSION_LT(7,0,0) +#if defined(WC_C_DYNAMIC_FALLBACK) && defined(HAVE_FIPS) && FIPS_VERSION3_LT(7,0,0) dst->sha_method = src->sha_method; #endif #ifdef WOLFSSL_HASH_FLAGS @@ -462,7 +462,7 @@ static void swdev_sha512_copy_state(wc_Sha512* dst, const wc_Sha512* src) dst->buffLen = src->buffLen; dst->loLen = src->loLen; dst->hiLen = src->hiLen; -#if defined(WC_C_DYNAMIC_FALLBACK) && defined(HAVE_FIPS) && FIPS_VERSION_LT(7,0,0) +#if defined(WC_C_DYNAMIC_FALLBACK) && defined(HAVE_FIPS) && FIPS_VERSION3_LT(7,0,0) dst->sha_method = src->sha_method; #endif #ifdef WOLFSSL_HASH_FLAGS diff --git a/wolfcrypt/src/sha256.c b/wolfcrypt/src/sha256.c index 750f663cf16..ef9e1beecb5 100644 --- a/wolfcrypt/src/sha256.c +++ b/wolfcrypt/src/sha256.c @@ -242,16 +242,25 @@ on the specific device platform. #if defined(LITTLE_ENDIAN_ORDER) && \ defined(WOLFSSL_X86_64_BUILD) && defined(USE_INTEL_SPEEDUP) && \ (defined(HAVE_INTEL_AVX1) || defined(HAVE_INTEL_AVX2)) - #if defined(WC_NO_INTERNAL_FUNCTION_POINTERS) || \ - defined(WC_C_DYNAMIC_FALLBACK) - /* raw-buffer convention -- sha256->buffer always holds the raw - * big-endian byte stream, and inline_XTRANSFORM{,_LEN}() byte-reverse - * just in time when the C transform runs, so that with - * WC_C_DYNAMIC_FALLBACK the asm-vs-C decision can be made - * independently at each transform. note WC_C_DYNAMIC_FALLBACK - * implies WC_NO_INTERNAL_FUNCTION_POINTERS, but the latter is defined - * below, after this macro. + + #if defined(WC_C_DYNAMIC_FALLBACK) && !defined(WC_NO_INTERNAL_FUNCTION_POINTERS) + /* With the AVX backend, wc_Sha256.buffer is in big endian even though + * the host is little endian. For WC_C_DYNAMIC_FALLBACK, which requires + * alternating between AVX and C, we activate + * WC_NO_INTERNAL_FUNCTION_POINTERS, which arranges for just-in-time + * byte swapping on each call to the C back end. This keeps the buffers + * big endian at all times. */ + #define WC_NO_INTERNAL_FUNCTION_POINTERS + #endif + + #ifdef WC_NO_INTERNAL_FUNCTION_POINTERS + /* With WC_NO_INTERNAL_FUNCTION_POINTERS every transform is dispatched + * through inline_XTRANSFORM{,_LEN}(), whose C arm is + * Transform_Sha256{,_Len}_C_from_raw() -- those byte-reverse the block + * themselves, just in time. + */ + #define WC_SHA256_RAW_BE_BUFFER #define SHA256_UPDATE_REV_BYTES(ctx) 0 #else #define SHA256_UPDATE_REV_BYTES(ctx) \ @@ -447,10 +456,6 @@ static int InitSha256(wc_Sha256* sha256) static cpuid_flags_atomic_t intel_flags = WC_CPUID_ATOMIC_INITIALIZER; -#if defined(WC_C_DYNAMIC_FALLBACK) && !defined(WC_NO_INTERNAL_FUNCTION_POINTERS) - #define WC_NO_INTERNAL_FUNCTION_POINTERS -#endif - #ifdef WC_NO_INTERNAL_FUNCTION_POINTERS enum sha_methods { SHA256_UNSET = 0, SHA256_AVX1_SHA, SHA256_AVX2, @@ -522,16 +527,8 @@ static int InitSha256(wc_Sha256* sha256) } } - /* With WC_NO_INTERNAL_FUNCTION_POINTERS, sha256->buffer always holds the - * raw big-endian byte stream, matching what the asm transforms consume - * (they byte-reverse internally). Transform_Sha256() reads host-endian - * words, so the C path byte-reverses just in time, here. This keeps the - * data layout independent of which transform ultimately runs, so with - * WC_C_DYNAMIC_FALLBACK the asm-vs-C decision can be made independently - * at each transform, using SAVE_VECTOR_REGISTERS2() success/failure at - * the moment of use. Mirrors Transform_Sha512_C_from_raw() in sha512.c - * and Transform_Sha256_C() in the aarch64 section below. - */ + #ifdef WC_SHA256_RAW_BE_BUFFER + static WC_INLINE int Transform_Sha256_C_from_raw(wc_Sha256* S, const byte* D) { @@ -560,6 +557,8 @@ static int InitSha256(wc_Sha256* sha256) return ret; } + #endif /* WC_SHA256_RAW_BE_BUFFER */ + static WC_INLINE int inline_XTRANSFORM(wc_Sha256* S, const byte* D) { int ret; @@ -570,8 +569,14 @@ static int InitSha256(wc_Sha256* sha256) return Transform_Sha256_C_from_raw(S, D); } #else - if (sha_method == SHA256_C) + if (sha_method == SHA256_C) { + #ifdef WC_SHA256_RAW_BE_BUFFER + /* not currently reachable */ return Transform_Sha256_C_from_raw(S, D); + #else + return Transform_Sha256(S, D); + #endif + } SAVE_VECTOR_REGISTERS(return _svr_ret;); #endif switch (sha_method) { @@ -598,7 +603,11 @@ static int InitSha256(wc_Sha256* sha256) default: /* not reachable -- the C path exits above, before vector register * save -- but must stay layout-correct. */ + #ifdef WC_SHA256_RAW_BE_BUFFER ret = Transform_Sha256_C_from_raw(S, D); + #else + ret = Transform_Sha256(S, D); + #endif break; } RESTORE_VECTOR_REGISTERS(); @@ -639,7 +648,11 @@ static int InitSha256(wc_Sha256* sha256) case SHA256_C: case SHA256_UNSET: default: + #ifdef WC_SHA256_RAW_BE_BUFFER ret = Transform_Sha256_Len_C_from_raw(S, D, L); + #else + ret = 0; + #endif break; } RESTORE_VECTOR_REGISTERS(); @@ -2167,7 +2180,7 @@ static WC_INLINE int Transform_Sha256_Len(wc_Sha256* sha256, const byte* data, /* Kinetis requires only these bytes reversed */ #if defined(WOLFSSL_X86_64_BUILD) && defined(USE_INTEL_SPEEDUP) && \ (defined(HAVE_INTEL_AVX1) || defined(HAVE_INTEL_AVX2)) - #ifdef WC_NO_INTERNAL_FUNCTION_POINTERS + #ifdef WC_SHA256_RAW_BE_BUFFER /* raw-buffer convention -- the length words must be big-endian in the * stream regardless of which transform consumes the final block. */ #else diff --git a/wolfcrypt/src/sha512.c b/wolfcrypt/src/sha512.c index d846f6db5a3..176d1ce18da 100644 --- a/wolfcrypt/src/sha512.c +++ b/wolfcrypt/src/sha512.c @@ -1189,16 +1189,24 @@ static int InitSha512_256(wc_Sha512* sha512) static enum sha_methods sha_method = SHA512_UNSET; #ifdef WC_C_DYNAMIC_FALLBACK + /* With the AVX backend, wc_Sha512.buffer is in big endian even though + * the host is little endian. For WC_C_DYNAMIC_FALLBACK, which requires + * alternating between AVX and C, we activate WC_SHA512_RAW_BE_BUFFER, + * which brings in the below shims for just-in-time byte swapping on + * each call to the C back end. This keeps the buffers big endian at + * all times. + * + * Callers test WC_SHA512_RAW_BE_BUFFER rather than + * WC_C_DYNAMIC_FALLBACK directly: the latter is a global setting whose + * only prerequisite is WC_HAVE_VECTOR_SPEEDUPS, so it can be set in + * configurations that never compile these adapters (WOLFSSL_SP_ASM + * only, 32-bit x86 --enable-intelasm, ...), and suppressing the + * caller-side byte-reversal there would leave nothing to compensate. + */ + #define WC_SHA512_RAW_BE_BUFFER + #endif - /* With WC_C_DYNAMIC_FALLBACK, sha512->buffer always holds the - * raw big-endian byte stream, matching what the AVX transforms consume - * (they byte-reverse internally). _Transform_Sha512() reads host-endian - * words from sha512->buffer, so the C path byte-reverses just in time, - * here. This keeps the buffer layout independent of which transform - * ultimately runs, so with WC_C_DYNAMIC_FALLBACK the asm-vs-C decision - * can be made independently at each transform, using - * SAVE_VECTOR_REGISTERS2() success/failure at the moment of use. - */ + #ifdef WC_SHA512_RAW_BE_BUFFER static WC_INLINE int Transform_Sha512_C_from_raw(wc_Sha512 *sha512) { @@ -1226,7 +1234,7 @@ static int InitSha512_256(wc_Sha512* sha512) return ret; } - #endif /* WC_C_DYNAMIC_FALLBACK */ + #endif /* WC_SHA512_RAW_BE_BUFFER */ static void Sha512_SetTransform(void) { @@ -1284,8 +1292,14 @@ static int InitSha512_256(wc_Sha512* sha512) return Transform_Sha512_C_from_raw(sha512); } #else - if (sha_method == SHA512_C) + if (sha_method == SHA512_C) { + #ifdef WC_SHA512_RAW_BE_BUFFER + /* not currently reachable */ + return Transform_Sha512_C_from_raw(sha512); + #else return _Transform_Sha512(sha512); + #endif + } SAVE_VECTOR_REGISTERS(return _svr_ret;); #endif switch (sha_method) { @@ -1304,7 +1318,7 @@ static int InitSha512_256(wc_Sha512* sha512) case SHA512_C: case SHA512_UNSET: default: - #ifdef WC_C_DYNAMIC_FALLBACK + #ifdef WC_SHA512_RAW_BE_BUFFER /* not reachable -- the C path exits above, before vector register * save -- but must stay layout-correct. */ ret = Transform_Sha512_C_from_raw(sha512); @@ -1344,7 +1358,7 @@ static int InitSha512_256(wc_Sha512* sha512) case SHA512_C: case SHA512_UNSET: default: - #ifdef WC_C_DYNAMIC_FALLBACK + #ifdef WC_SHA512_RAW_BE_BUFFER /* not reachable -- the C path exits above, before vector register * save -- but must stay correct. */ ret = Transform_Sha512_Len_C_from_raw(sha512, len); @@ -2013,7 +2027,8 @@ static WC_INLINE int Sha512Update(wc_Sha512* sha512, const byte* data, word32 le } if (sha512->buffLen == WC_SHA512_BLOCK_SIZE) { - #if defined(LITTLE_ENDIAN_ORDER) && !defined(WC_C_DYNAMIC_FALLBACK) && \ + #if defined(LITTLE_ENDIAN_ORDER) && \ + !defined(WC_SHA512_RAW_BE_BUFFER) && \ (!defined(WOLFSSL_ESP32_CRYPT) || \ defined(NO_WOLFSSL_ESP32_CRYPT_HASH) || \ defined(NO_WOLFSSL_ESP32_CRYPT_HASH_SHA512)) && \ @@ -2107,7 +2122,7 @@ static WC_INLINE int Sha512Update(wc_Sha512* sha512, const byte* data, word32 le #if defined(WOLFSSL_X86_64_BUILD) && defined(USE_INTEL_SPEEDUP) && \ (defined(HAVE_INTEL_AVX1) || defined(HAVE_INTEL_AVX2)) && \ - !defined(WC_C_DYNAMIC_FALLBACK) + !defined(WC_SHA512_RAW_BE_BUFFER) if (!IS_INTEL_AVX1(intel_flags) && !IS_INTEL_AVX2(intel_flags)) { ByteReverseWords64(sha512->buffer, sha512->buffer, @@ -2248,7 +2263,7 @@ static WC_INLINE int Sha512Final(wc_Sha512* sha512) } sha512->buffLen += WC_SHA512_BLOCK_SIZE - sha512->buffLen; -#if defined(LITTLE_ENDIAN_ORDER) && !defined(WC_C_DYNAMIC_FALLBACK) +#if defined(LITTLE_ENDIAN_ORDER) && !defined(WC_SHA512_RAW_BE_BUFFER) #if defined(WOLFSSL_X86_64_BUILD) && defined(USE_INTEL_SPEEDUP) && \ (defined(HAVE_INTEL_AVX1) || defined(HAVE_INTEL_AVX2)) if (!IS_INTEL_AVX1(intel_flags) && !IS_INTEL_AVX2(intel_flags)) @@ -2304,7 +2319,7 @@ static WC_INLINE int Sha512Final(wc_Sha512* sha512) sha512->loLen = sha512->loLen << 3; /* store lengths */ -#if defined(LITTLE_ENDIAN_ORDER) && !defined(WC_C_DYNAMIC_FALLBACK) +#if defined(LITTLE_ENDIAN_ORDER) && !defined(WC_SHA512_RAW_BE_BUFFER) #if defined(WOLFSSL_X86_64_BUILD) && defined(USE_INTEL_SPEEDUP) && \ (defined(HAVE_INTEL_AVX1) || defined(HAVE_INTEL_AVX2)) if (!IS_INTEL_AVX1(intel_flags) && !IS_INTEL_AVX2(intel_flags)) @@ -2328,7 +2343,7 @@ static WC_INLINE int Sha512Final(wc_Sha512* sha512) #if defined(WOLFSSL_X86_64_BUILD) && defined(USE_INTEL_SPEEDUP) && \ (defined(HAVE_INTEL_AVX1) || defined(HAVE_INTEL_AVX2)) - #ifdef WC_C_DYNAMIC_FALLBACK + #ifdef WC_SHA512_RAW_BE_BUFFER /* raw-buffer convention -- the length words must be big-endian in the * stream regardless of which transform consumes the final block. */ #else @@ -2610,7 +2625,7 @@ int wc_Sha512Transform(wc_Sha512* sha, const unsigned char* data) return MEMORY_E; #endif -#if defined(LITTLE_ENDIAN_ORDER) && !defined(WC_C_DYNAMIC_FALLBACK) +#if defined(LITTLE_ENDIAN_ORDER) && !defined(WC_SHA512_RAW_BE_BUFFER) #if defined(WOLFSSL_X86_64_BUILD) && defined(USE_INTEL_SPEEDUP) && \ (defined(HAVE_INTEL_AVX1) || defined(HAVE_INTEL_AVX2)) if (!IS_INTEL_AVX1(intel_flags) && !IS_INTEL_AVX2(intel_flags)) @@ -2619,7 +2634,7 @@ int wc_Sha512Transform(wc_Sha512* sha, const unsigned char* data) ByteReverseWords64((word64*)data, (word64*)data, WC_SHA512_BLOCK_SIZE); } -#endif /* LITTLE_ENDIAN_ORDER && !WC_C_DYNAMIC_FALLBACK */ +#endif /* LITTLE_ENDIAN_ORDER && !WC_SHA512_RAW_BE_BUFFER */ #if defined(WOLFSSL_ARMASM) || defined(WOLFSSL_RISCV_ASM) ByteReverseWords64(buffer, (word64*)data, WC_SHA512_BLOCK_SIZE); From 50748f04e6ee096a7afd0138d7cbbd7fcb43b1ed Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Tue, 4 Aug 2026 23:38:27 -0500 Subject: [PATCH 40/44] wolfssl/wolfcrypt/settings.h: remove automatic HAVE___INT128_T/HAVE___UINT128_T to avoid inadvertent configuration shifts -- HAVE___UINT128_T is a backend selector (SP_WORD_SIZE, CURVED25519_128BIT, CURVED448_128BIT), not merely a type-availability macro; wolfcrypt/src/falcon.c: accept either defined(__SIZEOF_INT128__) or defined(HAVE___UINT128_T) in FALCON_MULHI() implementation selector. wolfssl/wolfcrypt/sp_int.h: fix size of struct sp_ecc_ctx when SP_WORD_SIZE == 64 (as when HAVE___UINT128_T is defined), fixing assert failure in sp_c64.c sp_ecc_verify_256_nb(). The P-256-only bucket was sized against the C32 layout (verify ctx 2376 <= 2560); the C64 ctx is 2640. The 384 and 521 buckets are equally word-size-blind but currently pass at 64 bits on margin (3600 <= 3840, 4560 <= 5280). --- wolfcrypt/src/falcon.c | 3 ++- wolfssl/wolfcrypt/settings.h | 12 ------------ wolfssl/wolfcrypt/sp_int.h | 3 +++ 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/wolfcrypt/src/falcon.c b/wolfcrypt/src/falcon.c index 4737ff3c19a..45db2ed169b 100644 --- a/wolfcrypt/src/falcon.c +++ b/wolfcrypt/src/falcon.c @@ -1149,7 +1149,8 @@ int fpr_lt(fpr x, fpr y) * targets it is a single multiply instruction; the portable 32x32 fallback * (one MUL becomes four) is kept for platforms without a 128-bit integer type * (e.g. Cortex-M). Both paths are constant-time and bit-identical. */ -#if defined(HAVE___UINT128_T) && !defined(NO_INT128) +#if (defined(HAVE___UINT128_T) || defined(__SIZEOF_INT128__)) && \ + !defined(NO_INT128) #define FALCON_MULHI(z, y) \ ((word64)(((__uint128_t)(word64)(z) * (__uint128_t)(word64)(y)) >> 64)) #else diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index d996d7b599b..0fd6d99a699 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -663,18 +663,6 @@ #define AES_GCM_AESNI_NO_UNROLL #endif -/* Leverage compiler built-ins to assure that __int128_t and __uint128_t are - * gated in regardless of autotools-dependent feature sensing. - */ -#if defined(__SIZEOF_INT128__) && !defined(NO_INT128) - #ifndef HAVE___INT128_T - #define HAVE___INT128_T 1 - #endif - #ifndef HAVE___UINT128_T - #define HAVE___UINT128_T 1 - #endif -#endif - #ifdef IPHONE #define SIZEOF_LONG_LONG 8 #endif diff --git a/wolfssl/wolfcrypt/sp_int.h b/wolfssl/wolfcrypt/sp_int.h index 97c2265934d..5d5891fc310 100644 --- a/wolfssl/wolfcrypt/sp_int.h +++ b/wolfssl/wolfcrypt/sp_int.h @@ -395,6 +395,9 @@ typedef struct sp_ecc_ctx { XALIGNED(4) byte data[66*80]; /* stack data */ #elif defined(WOLFSSL_SP_384) XALIGNED(4) byte data[48*80]; /* stack data */ + #elif SP_WORD_SIZE == 64 + /* C64 P-256 sp_ecc_verify_256_ctx is 2640 bytes */ + XALIGNED(4) byte data[32*84]; /* stack data */ #else XALIGNED(4) byte data[32*80]; /* stack data */ #endif From 64a91957afc9d1bf31a6fe335f49a25f5d47b4fb Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Tue, 4 Aug 2026 23:51:25 -0500 Subject: [PATCH 41/44] fixes from AI review: linuxkm/x86_vector_register_glue.c: in wc_save_vector_registers_x86(), properly squelch the hard-IRQ call warning if flags & WC_SVR_FLAG_MAYBE_INHIBIT; src/internal.c: in AllocKey(), properly set key_inited = 1 if wc_SlhDsaKey_Init() succeeds; .github/workflows/fips-dev-no-post.yml: test -DWC_FIPS_AESGCM_NO_SHORT_NONCES. --- .github/workflows/fips-dev-no-post.yml | 2 +- linuxkm/x86_vector_register_glue.c | 2 +- src/internal.c | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/fips-dev-no-post.yml b/.github/workflows/fips-dev-no-post.yml index 70dfc6f60a8..292b89a2b90 100644 --- a/.github/workflows/fips-dev-no-post.yml +++ b/.github/workflows/fips-dev-no-post.yml @@ -110,7 +110,7 @@ jobs: {"name": "all-nodh-extiv", "minutes": 5, "comment": "DH out of the boundary in v7; one-shot AES-GCM ext IV allowed", "configure": ["--enable-all", "--disable-dh", - "CPPFLAGS=-pedantic -DWC_FIPS_AESGCM_ONE_SHOT_EXT_IV_ALLOWED"]}, + "CPPFLAGS=-pedantic -DWC_FIPS_AESGCM_ONE_SHOT_EXT_IV_ALLOWED -DWC_FIPS_AESGCM_NO_SHORT_NONCES"]}, {"name": "kernel-settings", "minutes": 2, "configure": ["--enable-kernel-settings", "--enable-dh", "CPPFLAGS=-pedantic"]}, diff --git a/linuxkm/x86_vector_register_glue.c b/linuxkm/x86_vector_register_glue.c index c7ca0a5cfc3..0a955027541 100644 --- a/linuxkm/x86_vector_register_glue.c +++ b/linuxkm/x86_vector_register_glue.c @@ -352,7 +352,7 @@ WARN_UNUSED_RESULT int wc_save_vector_registers_x86(enum wc_svr_flags flags) * a second look at preempt_count(). */ if (((preempt_count() & (NMI_MASK | HARDIRQ_MASK)) != 0) || (task_pid_nr(current) == 0)) { - if (! (flags & WC_SVR_FLAG_INHIBIT)) { + if (! (flags & (WC_SVR_FLAG_INHIBIT | WC_SVR_FLAG_MAYBE_INHIBIT))) { VRG_PR_WARN_X("WARNING: wc_save_vector_registers_x86(0x%x) called with preempt_count 0x%x and pid %d on CPU %d.\n", (unsigned)flags, preempt_count(), task_pid_nr(current), raw_smp_processor_id()); #ifdef WOLFSSL_LINUXKM_VERBOSE_DEBUG dump_stack(); diff --git a/src/internal.c b/src/internal.c index 42376ce3a7a..acea91e1ec8 100644 --- a/src/internal.c +++ b/src/internal.c @@ -9166,6 +9166,8 @@ int AllocKey(WOLFSSL* ssl, int type, void** pKey) XMEMSET(*pKey, 0, sizeof(SlhDsaKey)); ret = wc_SlhDsaKey_Init((SlhDsaKey*)*pKey, WC_SLHDSA_DEFAULT_PARAM, ssl->heap, ssl->devId); + if (ret == 0) + key_inited = 1; break; #endif /* WOLFSSL_HAVE_SLHDSA */ #ifdef HAVE_CURVE448 From 67df4928c57dd246b6de9f4a1dc7615903d5ded7 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Wed, 5 Aug 2026 13:55:14 -0500 Subject: [PATCH 42/44] fixes from peer review, post-rebase test results, and test coverage expansion: wolfcrypt/src/wc_mldsa.c: WC_C_DYNAMIC_FALLBACK fixes for AVX512. tests/api/test_frodokem.c, wolfcrypt/test/test.c: fixes for WC_DEBUG_CIPHER_LIFECYCLE. wolfcrypt/src/fe_x25519_asm.S, wolfcrypt/src/port/arm/armv8-32-aes-asm.S, wolfcrypt/src/port/arm/armv8-aes-asm.S, wolfcrypt/src/port/arm/armv8-aes-asm_c.c, wolfcrypt/src/port/arm/thumb2-aes-asm.S, wolfcrypt/src/sha3_asm.S, wolfcrypt/src/wc_mldsa_asm.S: regenerate from scripts#647 .github/workflows/fips-dev-no-post.yml: * update "minutes" for tests using empirical data; * add --enable-experimental --enable-all-quantum-crypto to kernel-settings-all-asm scenario and rename it kernel-settings-all-pqc-asm; add all-pqc-asm-fallback-fuzzer scenario. wolfcrypt/src/wolfentropy.c: remove WC_FIPS_LL_CRYPTO (it is not a FIPS file except in FIPS v5.2.4). wolfcrypt/src/sha256.c: fix for rebase error (stray #endif). --- .github/workflows/fips-dev-no-post.yml | 19 ++--- tests/api/test_frodokem.c | 37 ++++++++-- wolfcrypt/src/fe_x25519_asm.S | 12 ++++ wolfcrypt/src/port/arm/armv8-32-aes-asm.S | 16 +++++ wolfcrypt/src/port/arm/armv8-aes-asm.S | 2 + wolfcrypt/src/port/arm/armv8-aes-asm_c.c | 18 +++-- wolfcrypt/src/port/arm/thumb2-aes-asm.S | 1 + wolfcrypt/src/sha256.c | 1 - wolfcrypt/src/sha3_asm.S | 2 + wolfcrypt/src/wc_mldsa.c | 46 ++++++++---- wolfcrypt/src/wc_mldsa_asm.S | 88 +++++++++++++++++++++++ wolfcrypt/src/wolfentropy.c | 1 - wolfcrypt/test/test.c | 13 +++- 13 files changed, 217 insertions(+), 39 deletions(-) diff --git a/.github/workflows/fips-dev-no-post.yml b/.github/workflows/fips-dev-no-post.yml index 292b89a2b90..5330b8e74cc 100644 --- a/.github/workflows/fips-dev-no-post.yml +++ b/.github/workflows/fips-dev-no-post.yml @@ -101,23 +101,26 @@ jobs: "--with-linux-source=/lib/modules/$(uname -r)/build", "EXTRA_CPPFLAGS=-Werror"]}, "configs": [ - {"name": "default", "minutes": 2, + {"name": "default", "minutes": 7, "configure": ["CPPFLAGS=-pedantic"]}, - {"name": "all-asm-sp", "minutes": 3, + {"name": "all-asm-sp", "minutes": 7, "configure": ["CPPFLAGS=-pedantic", "--enable-all-asm", "--enable-sp"]}, - {"name": "all", "minutes": 5, + {"name": "all", "minutes": 16, "configure": ["CPPFLAGS=-pedantic", "--enable-all"]}, - {"name": "all-nodh-extiv", "minutes": 5, + {"name": "all-nodh-extiv", "minutes": 16, "comment": "DH out of the boundary in v7; one-shot AES-GCM ext IV allowed", "configure": ["--enable-all", "--disable-dh", "CPPFLAGS=-pedantic -DWC_FIPS_AESGCM_ONE_SHOT_EXT_IV_ALLOWED -DWC_FIPS_AESGCM_NO_SHORT_NONCES"]}, - {"name": "kernel-settings", "minutes": 2, + {"name": "all-pqc-asm-fallback-fuzzer", "minutes": 22, + "configure": ["--enable-all", "--enable-sp", "--enable-experimental", "--enable-all-quantum-crypto", + "CPPFLAGS=-pedantic -DWC_DEBUG_CIPHER_LIFECYCLE -DWC_C_DYNAMIC_FALLBACK -DDEBUG_VECTOR_REGISTER_ACCESS -DDEBUG_VECTOR_REGISTER_ACCESS_FUZZING -DWC_DEBUG_VECTOR_REGISTERS_FUZZING_SEED=$FUZZING_SEED"]}, + {"name": "kernel-settings", "minutes": 8, "configure": ["--enable-kernel-settings", "--enable-dh", "CPPFLAGS=-pedantic"]}, - {"name": "kernel-settings-all-asm", "minutes": 6, - "configure": ["--enable-kernel-settings", "--enable-all", + {"name": "kernel-settings-all-pqc-asm", "minutes": 22, + "configure": ["--enable-kernel-settings", "--enable-all", "--enable-experimental", "--enable-all-quantum-crypto", "--enable-all-asm", "--enable-sp", - "CPPFLAGS=-pedantic -DWC_C_DYNAMIC_FALLBACK -DDEBUG_VECTOR_REGISTER_ACCESS -DDEBUG_VECTOR_REGISTER_ACCESS_FUZZING -DWC_DEBUG_VECTOR_REGISTERS_FUZZING_SEED=$FUZZING_SEED"]} + "CPPFLAGS=-pedantic -DWC_DEBUG_CIPHER_LIFECYCLE -DWC_C_DYNAMIC_FALLBACK -DDEBUG_VECTOR_REGISTER_ACCESS -DDEBUG_VECTOR_REGISTER_ACCESS_FUZZING -DWC_DEBUG_VECTOR_REGISTERS_FUZZING_SEED=$FUZZING_SEED"]} ]} EOF # out-of-tree kernel module builds not working yet: diff --git a/tests/api/test_frodokem.c b/tests/api/test_frodokem.c index d5863c33c7c..26c549b310c 100644 --- a/tests/api/test_frodokem.c +++ b/tests/api/test_frodokem.c @@ -1586,7 +1586,9 @@ int test_wc_frodokem_asn1(void) !defined(WOLFSSL_FRODOKEM_NO_DECAPSULATE) int i; FrodoKemKey* key = NULL; + int key_inited = 0; FrodoKemKey* key2 = NULL; + int key2_inited = 0; WC_RNG rng; byte* der = NULL; byte* ct = NULL; @@ -1618,6 +1620,8 @@ int test_wc_frodokem_asn1(void) int type = frodokem_types[i]; ExpectIntEQ(wc_FrodoKemKey_Init(key, type, NULL, INVALID_DEVID), 0); + if (EXPECT_SUCCESS()) + key_inited = 1; ExpectIntEQ(wc_FrodoKemKey_MakeKey(key, &rng), 0); ExpectIntEQ(wc_FrodoKemKey_CipherTextSize(key, &ctLen), 0); ExpectIntEQ(wc_FrodoKemKey_SharedSecretSize(key, &ssLen), 0); @@ -1630,7 +1634,10 @@ int test_wc_frodokem_asn1(void) ExpectIntEQ(wc_FrodoKemKey_PrivateKeyToDer(key, der, FRODOKEM_MAX_PRV_KEY_DER_SIZE), WC_NO_ERR_TRACE(BAD_FUNC_ARG)); - wc_FrodoKemKey_Free(key); + if (key_inited) { + wc_FrodoKemKey_Free(key); + key_inited = 0; + } continue; } @@ -1642,12 +1649,17 @@ int test_wc_frodokem_asn1(void) idx = 0; ExpectIntEQ(wc_FrodoKemKey_PublicKeyDecode(key2, der, (word32)derLen, &idx), 0); + if (EXPECT_SUCCESS()) + key2_inited = 1; ExpectIntEQ(key2->type, type); /* Encapsulate to the decoded public key; original decapsulates. */ ExpectIntEQ(wc_FrodoKemKey_Encapsulate(key2, ct, ss, &rng), 0); ExpectIntEQ(wc_FrodoKemKey_Decapsulate(key, ssDec, ct, ctLen), 0); ExpectIntEQ(XMEMCMP(ss, ssDec, ssLen), 0); - wc_FrodoKemKey_Free(key2); + if (key2_inited) { + wc_FrodoKemKey_Free(key2); + key2_inited = 0; + } /* Private key: PKCS#8 round trip; decoded key can decapsulate. */ ExpectIntGT((derLen = wc_FrodoKemKey_PrivateKeyToDer(key, der, @@ -1657,11 +1669,16 @@ int test_wc_frodokem_asn1(void) idx = 0; ExpectIntEQ(wc_FrodoKemKey_PrivateKeyDecode(key2, der, (word32)derLen, &idx), 0); + if (EXPECT_SUCCESS()) + key2_inited = 1; ExpectIntEQ(key2->type, type); ExpectIntEQ(wc_FrodoKemKey_Encapsulate(key, ct, ss, &rng), 0); ExpectIntEQ(wc_FrodoKemKey_Decapsulate(key2, ssDec, ct, ctLen), 0); ExpectIntEQ(XMEMCMP(ss, ssDec, ssLen), 0); - wc_FrodoKemKey_Free(key2); + if (key2_inited) { + wc_FrodoKemKey_Free(key2); + key2_inited = 0; + } /* Strict validation: decoding this key's DER into a key that was * initialized as a DIFFERENT variant must be rejected. */ @@ -1682,10 +1699,15 @@ int test_wc_frodokem_asn1(void) FRODOKEM_MAX_PUB_KEY_DER_SIZE, 1)), 0); ExpectIntEQ(wc_FrodoKemKey_Init(key2, other, NULL, INVALID_DEVID), 0); + if (EXPECT_SUCCESS()) + key2_inited = 1; idx = 0; ExpectIntNE(wc_FrodoKemKey_PublicKeyDecode(key2, der, (word32)derLen, &idx), 0); - wc_FrodoKemKey_Free(key2); + if (key2_inited) { + wc_FrodoKemKey_Free(key2); + key2_inited = 0; + } } } @@ -1697,9 +1719,10 @@ int test_wc_frodokem_asn1(void) idx = 0; ExpectIntNE(wc_FrodoKemKey_PublicKeyDecode(key2, der, (word32)derLen / 2, &idx), 0); - wc_FrodoKemKey_Free(key2); - - wc_FrodoKemKey_Free(key); + if (key_inited) { + wc_FrodoKemKey_Free(key); + key_inited = 0; + } } /* NULL-argument checks. */ diff --git a/wolfcrypt/src/fe_x25519_asm.S b/wolfcrypt/src/fe_x25519_asm.S index 94943554487..fe3977fe194 100644 --- a/wolfcrypt/src/fe_x25519_asm.S +++ b/wolfcrypt/src/fe_x25519_asm.S @@ -22093,12 +22093,14 @@ L_x25519_ifma_consts: #ifndef __APPLE__ .text .globl curve25519_base_avx512_ifma +WC_ASM_ATT_HIDDEN(curve25519_base_avx512_ifma) .type curve25519_base_avx512_ifma,@function .align 16 curve25519_base_avx512_ifma: #else .section __TEXT,__text .globl _curve25519_base_avx512_ifma +WC_ASM_ATT_HIDDEN(_curve25519_base_avx512_ifma) .p2align 4 _curve25519_base_avx512_ifma: #endif /* __APPLE__ */ @@ -22886,12 +22888,14 @@ L_curve25519_base_avx512_ifma_bits: #ifndef __APPLE__ .text .globl curve25519_avx512_ifma +WC_ASM_ATT_HIDDEN(curve25519_avx512_ifma) .type curve25519_avx512_ifma,@function .align 16 curve25519_avx512_ifma: #else .section __TEXT,__text .globl _curve25519_avx512_ifma +WC_ASM_ATT_HIDDEN(_curve25519_avx512_ifma) .p2align 4 _curve25519_avx512_ifma: #endif /* __APPLE__ */ @@ -23702,12 +23706,14 @@ L_curve25519_avx512_ifma_bits: #ifndef __APPLE__ .text .globl curve25519_base_avx512_ifma_dq +WC_ASM_ATT_HIDDEN(curve25519_base_avx512_ifma_dq) .type curve25519_base_avx512_ifma_dq,@function .align 16 curve25519_base_avx512_ifma_dq: #else .section __TEXT,__text .globl _curve25519_base_avx512_ifma_dq +WC_ASM_ATT_HIDDEN(_curve25519_base_avx512_ifma_dq) .p2align 4 _curve25519_base_avx512_ifma_dq: #endif /* __APPLE__ */ @@ -24450,12 +24456,14 @@ L_curve25519_base_avx512_ifma_dq_bits: #ifndef __APPLE__ .text .globl curve25519_avx512_ifma_dq +WC_ASM_ATT_HIDDEN(curve25519_avx512_ifma_dq) .type curve25519_avx512_ifma_dq,@function .align 16 curve25519_avx512_ifma_dq: #else .section __TEXT,__text .globl _curve25519_avx512_ifma_dq +WC_ASM_ATT_HIDDEN(_curve25519_avx512_ifma_dq) .p2align 4 _curve25519_avx512_ifma_dq: #endif /* __APPLE__ */ @@ -25244,12 +25252,14 @@ L_ge_ifma_consts: #ifndef __APPLE__ .text .globl ge_double_scalarmult_vartime_avx512_ifma +WC_ASM_ATT_HIDDEN(ge_double_scalarmult_vartime_avx512_ifma) .type ge_double_scalarmult_vartime_avx512_ifma,@function .align 16 ge_double_scalarmult_vartime_avx512_ifma: #else .section __TEXT,__text .globl _ge_double_scalarmult_vartime_avx512_ifma +WC_ASM_ATT_HIDDEN(_ge_double_scalarmult_vartime_avx512_ifma) .p2align 4 _ge_double_scalarmult_vartime_avx512_ifma: #endif /* __APPLE__ */ @@ -28235,12 +28245,14 @@ L_ge_dsm_avx512_ifma_skip_b: #ifndef __APPLE__ .text .globl ge_double_scalarmult_vartime_avx512_ifma_dq +WC_ASM_ATT_HIDDEN(ge_double_scalarmult_vartime_avx512_ifma_dq) .type ge_double_scalarmult_vartime_avx512_ifma_dq,@function .align 16 ge_double_scalarmult_vartime_avx512_ifma_dq: #else .section __TEXT,__text .globl _ge_double_scalarmult_vartime_avx512_ifma_dq +WC_ASM_ATT_HIDDEN(_ge_double_scalarmult_vartime_avx512_ifma_dq) .p2align 4 _ge_double_scalarmult_vartime_avx512_ifma_dq: #endif /* __APPLE__ */ diff --git a/wolfcrypt/src/port/arm/armv8-32-aes-asm.S b/wolfcrypt/src/port/arm/armv8-32-aes-asm.S index 3c12688bb41..64c5191e05d 100644 --- a/wolfcrypt/src/port/arm/armv8-32-aes-asm.S +++ b/wolfcrypt/src/port/arm/armv8-32-aes-asm.S @@ -16239,6 +16239,7 @@ L_GCM_gmult_len_r: .text .align 4 .globl GCM_gmult_len + WC_ASM_ATT_HIDDEN(GCM_gmult_len) .type GCM_gmult_len, %function GCM_gmult_len: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -22373,6 +22374,7 @@ L_AES_GCMSIV_ctr_base_end: .align 4 .fpu crypto-neon-fp-armv8 .globl AES_set_key_AARCH32 + WC_ASM_ATT_HIDDEN(AES_set_key_AARCH32) .type AES_set_key_AARCH32, %function AES_set_key_AARCH32: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -23305,6 +23307,7 @@ L_aes_set_key_arm32_crypto_done: .align 4 .fpu crypto-neon-fp-armv8 .globl AES_encrypt_AARCH32 + WC_ASM_ATT_HIDDEN(AES_encrypt_AARCH32) .type AES_encrypt_AARCH32, %function AES_encrypt_AARCH32: vpush {d8-d9} @@ -23359,6 +23362,7 @@ L_aes_encrypt_arm32_crypto_round_done: .align 4 .fpu crypto-neon-fp-armv8 .globl AES_decrypt_AARCH32 + WC_ASM_ATT_HIDDEN(AES_decrypt_AARCH32) .type AES_decrypt_AARCH32, %function AES_decrypt_AARCH32: vpush {d8-d9} @@ -23413,6 +23417,7 @@ L_aes_decrypt_arm32_crypto_round_done: .align 4 .fpu crypto-neon-fp-armv8 .globl AES_encrypt_blocks_AARCH32 + WC_ASM_ATT_HIDDEN(AES_encrypt_blocks_AARCH32) .type AES_encrypt_blocks_AARCH32, %function AES_encrypt_blocks_AARCH32: vpush {d8-d15} @@ -24047,6 +24052,7 @@ L_aes_encrypt_blocks_arm32_crypto_done: .align 4 .fpu crypto-neon-fp-armv8 .globl AES_decrypt_blocks_AARCH32 + WC_ASM_ATT_HIDDEN(AES_decrypt_blocks_AARCH32) .type AES_decrypt_blocks_AARCH32, %function AES_decrypt_blocks_AARCH32: vpush {d8-d15} @@ -24683,6 +24689,7 @@ L_aes_decrypt_blocks_arm32_crypto_done: .align 4 .fpu crypto-neon-fp-armv8 .globl AES_CBC_encrypt_AARCH32 + WC_ASM_ATT_HIDDEN(AES_CBC_encrypt_AARCH32) .type AES_CBC_encrypt_AARCH32, %function AES_CBC_encrypt_AARCH32: push {lr} @@ -25346,6 +25353,7 @@ L_aes_cbc_encrypt_arm32_crypto_done: .align 4 .fpu crypto-neon-fp-armv8 .globl AES_CBC_decrypt_AARCH32 + WC_ASM_ATT_HIDDEN(AES_CBC_decrypt_AARCH32) .type AES_CBC_decrypt_AARCH32, %function AES_CBC_decrypt_AARCH32: push {lr} @@ -25687,6 +25695,7 @@ L_aes_cbc_decrypt_blocks_arm32_crypto_done: .align 4 .fpu crypto-neon-fp-armv8 .globl AES_CTR_encrypt_AARCH32 + WC_ASM_ATT_HIDDEN(AES_CTR_encrypt_AARCH32) .type AES_CTR_encrypt_AARCH32, %function AES_CTR_encrypt_AARCH32: push {r4, r5, r6, r7, r8, lr} @@ -26256,6 +26265,7 @@ L_aes_ctr_encrypt_arm32_crypto_done: .align 4 .fpu crypto-neon-fp-armv8 .globl AES_GCM_set_key_AARCH32 + WC_ASM_ATT_HIDDEN(AES_GCM_set_key_AARCH32) .type AES_GCM_set_key_AARCH32, %function AES_GCM_set_key_AARCH32: vpush {d8-d9} @@ -26319,6 +26329,7 @@ L_aes_gcm_set_key_arm32_crypto_round_done: .align 4 .fpu crypto-neon-fp-armv8 .globl AES_GCM_encrypt_AARCH32 + WC_ASM_ATT_HIDDEN(AES_GCM_encrypt_AARCH32) .type AES_GCM_encrypt_AARCH32, %function AES_GCM_encrypt_AARCH32: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -27764,6 +27775,7 @@ L_aes_gcm_encrypt_arm32_crypto_done_gcm: .align 4 .fpu crypto-neon-fp-armv8 .globl AES_GCM_decrypt_AARCH32 + WC_ASM_ATT_HIDDEN(AES_GCM_decrypt_AARCH32) .type AES_GCM_decrypt_AARCH32, %function AES_GCM_decrypt_AARCH32: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} @@ -29245,6 +29257,7 @@ L_aes_gcm_decrypt_arm32_crypto_tag_tag_loaded: .align 4 .fpu crypto-neon-fp-armv8 .globl AES_XTS_encrypt_AARCH32 + WC_ASM_ATT_HIDDEN(AES_XTS_encrypt_AARCH32) .type AES_XTS_encrypt_AARCH32, %function AES_XTS_encrypt_AARCH32: push {r4, r5, r6, r7, r8, r9, lr} @@ -29651,6 +29664,7 @@ L_aes_xts_encrypt_arm32_crypto_done: .align 4 .fpu crypto-neon-fp-armv8 .globl AES_XTS_decrypt_AARCH32 + WC_ASM_ATT_HIDDEN(AES_XTS_decrypt_AARCH32) .type AES_XTS_decrypt_AARCH32, %function AES_XTS_decrypt_AARCH32: push {r4, r5, r6, r7, r8, r9, lr} @@ -30177,6 +30191,7 @@ L_aes_xts_decrypt_arm32_crypto_done: .align 4 .fpu crypto-neon-fp-armv8 .globl AES_GCMSIV_polyval_crypto + WC_ASM_ATT_HIDDEN(AES_GCMSIV_polyval_crypto) .type AES_GCMSIV_polyval_crypto, %function AES_GCMSIV_polyval_crypto: vpush {d8-d15} @@ -30424,6 +30439,7 @@ L_AES_GCMSIV_polyval_crypto_done: .align 4 .fpu crypto-neon-fp-armv8 .globl AES_GCMSIV_ctr_crypto + WC_ASM_ATT_HIDDEN(AES_GCMSIV_ctr_crypto) .type AES_GCMSIV_ctr_crypto, %function AES_GCMSIV_ctr_crypto: push {r4, r5, r6, r7, r8, r9, r10, lr} diff --git a/wolfcrypt/src/port/arm/armv8-aes-asm.S b/wolfcrypt/src/port/arm/armv8-aes-asm.S index 1cde598faca..646435bec85 100644 --- a/wolfcrypt/src/port/arm/armv8-aes-asm.S +++ b/wolfcrypt/src/port/arm/armv8-aes-asm.S @@ -56750,12 +56750,14 @@ L_GCM_gmult_len_r: #ifndef __APPLE__ .text .globl GCM_gmult_len +WC_ASM_ATT_HIDDEN(GCM_gmult_len) .type GCM_gmult_len,@function .align 2 GCM_gmult_len: #else .section __TEXT,__text .globl _GCM_gmult_len +WC_ASM_ATT_HIDDEN(_GCM_gmult_len) .p2align 2 _GCM_gmult_len: #endif /* __APPLE__ */ diff --git a/wolfcrypt/src/port/arm/armv8-aes-asm_c.c b/wolfcrypt/src/port/arm/armv8-aes-asm_c.c index 53be165ca7f..a99bf834900 100644 --- a/wolfcrypt/src/port/arm/armv8-aes-asm_c.c +++ b/wolfcrypt/src/port/arm/armv8-aes-asm_c.c @@ -16971,7 +16971,8 @@ void AES_GCM_encrypt_AARCH64_EOR3(const byte* in, byte* out, word32 sz, "strh w16, [%x[tag]], #2\n\t" "\n" "L_aes_gcm_encrypt_arm64_crypto_eor3_192_tag_start_byte_%=:\n\t" - "cbz %w[tagSz], L_aes_gcm_encrypt_arm64_crypto_eor3_192_tag_end_bytes_%=\n\t" + "cbz %w[tagSz], " + "L_aes_gcm_encrypt_arm64_crypto_eor3_192_tag_end_bytes_%=\n\t" "ldrb w16, [%x[tmp]], #1\n\t" "subs %w[tagSz], %w[tagSz], #1\n\t" "strb w16, [%x[tag]], #1\n\t" @@ -18513,7 +18514,8 @@ void AES_GCM_encrypt_AARCH64_EOR3(const byte* in, byte* out, word32 sz, "strh w16, [%x[tag]], #2\n\t" "\n" "L_aes_gcm_encrypt_arm64_crypto_eor3_256_tag_start_byte_%=:\n\t" - "cbz %w[tagSz], L_aes_gcm_encrypt_arm64_crypto_eor3_256_tag_end_bytes_%=\n\t" + "cbz %w[tagSz], " + "L_aes_gcm_encrypt_arm64_crypto_eor3_256_tag_end_bytes_%=\n\t" "ldrb w16, [%x[tmp]], #1\n\t" "subs %w[tagSz], %w[tagSz], #1\n\t" "strb w16, [%x[tag]], #1\n\t" @@ -19804,7 +19806,8 @@ void AES_GCM_encrypt_AARCH64_EOR3(const byte* in, byte* out, word32 sz, "strh w16, [%x[tag]], #2\n\t" "\n" "L_aes_gcm_encrypt_arm64_crypto_eor3_128_tag_start_byte_%=:\n\t" - "cbz %w[tagSz], L_aes_gcm_encrypt_arm64_crypto_eor3_128_tag_end_bytes_%=\n\t" + "cbz %w[tagSz], " + "L_aes_gcm_encrypt_arm64_crypto_eor3_128_tag_end_bytes_%=\n\t" "ldrb w16, [%x[tmp]], #1\n\t" "subs %w[tagSz], %w[tagSz], #1\n\t" "strb w16, [%x[tag]], #1\n\t" @@ -29153,7 +29156,8 @@ void AES_GCM_encrypt_final_AARCH64(byte* tag, byte* authTag, word32 tbytes, "strh w8, [%x[authTag]], #2\n\t" "\n" "L_aes_gcm_encrypt_final_arm64_crypto_tag_start_byte_%=:\n\t" - "cbz %w[tbytes], L_aes_gcm_encrypt_final_arm64_crypto_tag_end_bytes_%=\n\t" + "cbz %w[tbytes], " + "L_aes_gcm_encrypt_final_arm64_crypto_tag_end_bytes_%=\n\t" "ldrb w8, [%x[tag]], #1\n\t" "subs %w[tbytes], %w[tbytes], #1\n\t" "strb w8, [%x[authTag]], #1\n\t" @@ -37502,7 +37506,8 @@ void AES_GCM_encrypt_final_AARCH64_EOR3(byte* tag, byte* authTag, word32 tbytes, "strh w8, [%x[authTag]], #2\n\t" "\n" "L_aes_gcm_encrypt_final_arm64_crypto_eor3_tag_start_byte_%=:\n\t" - "cbz %w[tbytes], L_aes_gcm_encrypt_final_arm64_crypto_eor3_tag_end_bytes_%=\n\t" + "cbz %w[tbytes], " + "L_aes_gcm_encrypt_final_arm64_crypto_eor3_tag_end_bytes_%=\n\t" "ldrb w8, [%x[tag]], #1\n\t" "subs %w[tbytes], %w[tbytes], #1\n\t" "strb w8, [%x[authTag]], #1\n\t" @@ -41327,7 +41332,8 @@ void AES_GCM_decrypt_final_AARCH64_EOR3(byte* tag, const byte* authTag, "strh w9, [%x[tag]], #2\n\t" "\n" "L_aes_gcm_decrypt_final_arm64_crypto_eor3_tag_start_byte_%=:\n\t" - "cbz x10, L_aes_gcm_decrypt_final_arm64_crypto_eor3_tag_end_bytes_%=\n\t" + "cbz x10, " + "L_aes_gcm_decrypt_final_arm64_crypto_eor3_tag_end_bytes_%=\n\t" "ldrb w9, [%x[authTag]], #1\n\t" "subs x10, x10, #1\n\t" "strb w9, [%x[tag]], #1\n\t" diff --git a/wolfcrypt/src/port/arm/thumb2-aes-asm.S b/wolfcrypt/src/port/arm/thumb2-aes-asm.S index 3702c53f064..6cf234a0b25 100644 --- a/wolfcrypt/src/port/arm/thumb2-aes-asm.S +++ b/wolfcrypt/src/port/arm/thumb2-aes-asm.S @@ -6514,6 +6514,7 @@ L_GCM_gmult_len_r: .text .align 4 .globl GCM_gmult_len + WC_ASM_ATT_HIDDEN(GCM_gmult_len) .type GCM_gmult_len, %function GCM_gmult_len: PUSH {r4, r5, r6, r7, r8, r9, r10, r11, lr} diff --git a/wolfcrypt/src/sha256.c b/wolfcrypt/src/sha256.c index ef9e1beecb5..382aa5a7619 100644 --- a/wolfcrypt/src/sha256.c +++ b/wolfcrypt/src/sha256.c @@ -2660,7 +2660,6 @@ static WC_INLINE int Transform_Sha256_Len(wc_Sha256* sha256, const byte* data, (defined(HAVE_INTEL_AVX1) || defined(HAVE_INTEL_AVX2)) /* choose best Transform function under this runtime environment */ Sha256_SetTransform(); - #endif #elif defined(WOLFSSL_ARMASM_SHA256_TRANSFORM) /* SHA-224 shares the SHA-256 transform, on AArch32 as well as AArch64; * a no-op in builds that compile a single variant. Keyed off the diff --git a/wolfcrypt/src/sha3_asm.S b/wolfcrypt/src/sha3_asm.S index 13b2f0dc343..8eb74805876 100644 --- a/wolfcrypt/src/sha3_asm.S +++ b/wolfcrypt/src/sha3_asm.S @@ -48609,12 +48609,14 @@ L_sha3_256_blocksx8_seed_64_avx512_end_mark: #ifndef __APPLE__ .text .globl sha3_256_blocksx8_seed_64_avx512 +WC_ASM_ATT_HIDDEN(sha3_256_blocksx8_seed_64_avx512) .type sha3_256_blocksx8_seed_64_avx512,@function .align 16 sha3_256_blocksx8_seed_64_avx512: #else .section __TEXT,__text .globl _sha3_256_blocksx8_seed_64_avx512 +WC_ASM_ATT_HIDDEN(_sha3_256_blocksx8_seed_64_avx512) .p2align 4 _sha3_256_blocksx8_seed_64_avx512: #endif /* __APPLE__ */ diff --git a/wolfcrypt/src/wc_mldsa.c b/wolfcrypt/src/wc_mldsa.c index 36a8b818e06..db739efa6e7 100644 --- a/wolfcrypt/src/wc_mldsa.c +++ b/wolfcrypt/src/wc_mldsa.c @@ -204,11 +204,19 @@ static cpuid_flags_t cpuid_flags = WC_CPUID_INITIALIZER; * slightly faster (~2%/~4% on NTT/invNTT) permuted-order variants are safe. * Both pipelines yield bit-identical end results. */ #ifdef WC_C_DYNAMIC_FALLBACK - #define MLDSA_NTT_AVX2(r) wc_mldsa_ntt_full_avx2(r) - #define MLDSA_INVNTT_AVX2(r) wc_mldsa_invntt_full_avx2(r) + #define MLDSA_NTT_AVX512(r) wc_mldsa_ntt_full_1p_avx512(r) + #define MLDSA_NTT_SMALL_AVX512(r) wc_mldsa_ntt_small_full_1p_avx512(r) + #define MLDSA_INVNTT_AVX512(r) wc_mldsa_invntt_full_1p_avx512(r) + #define MLDSA_NTT_AVX2(r) wc_mldsa_ntt_full_avx2(r) + #define MLDSA_NTT_SMALL_AVX2(r) wc_mldsa_ntt_small_full_avx2(r) + #define MLDSA_INVNTT_AVX2(r) wc_mldsa_invntt_full_avx2(r) #else - #define MLDSA_NTT_AVX2(r) wc_mldsa_ntt_avx2(r) - #define MLDSA_INVNTT_AVX2(r) wc_mldsa_invntt_avx2(r) + #define MLDSA_NTT_AVX512(r) wc_mldsa_ntt_1p_avx512(r) + #define MLDSA_NTT_SMALL_AVX512(r) wc_mldsa_ntt_small_1p_avx512(r) + #define MLDSA_INVNTT_AVX512(r) wc_mldsa_invntt_1p_avx512(r) + #define MLDSA_NTT_AVX2(r) wc_mldsa_ntt_avx2(r) + #define MLDSA_NTT_SMALL_AVX2(r) wc_mldsa_ntt_small_avx2(r) + #define MLDSA_INVNTT_AVX2(r) wc_mldsa_invntt_avx2(r) #endif #endif @@ -1151,8 +1159,12 @@ static void mldsa_vec_encode_eta_bits(const sword32* s, byte d, byte eta, } RESTORE_VECTOR_REGISTERS(); } - else if (USE_INTEL_AVX512(cpuid_flags) && ((d & 1) == 0) && - (SAVE_VECTOR_REGISTERS2() == 0)) { + /* Note the eta check: this arm is also reachable for eta == 4, when the + * first arm's SAVE_VECTOR_REGISTERS2() fails (e.g. under + * DEBUG_VECTOR_REGISTER_ACCESS_FUZZING), and must not consume that flow. + */ + else if (USE_INTEL_AVX512(cpuid_flags) && (eta == MLDSA_ETA_2) && + ((d & 1) == 0) && (SAVE_VECTOR_REGISTERS2() == 0)) { unsigned int i; unsigned int e = MLDSA_ETA_2_BITS * MLDSA_N / 8; for (i = 0; i < d; i += 2) { @@ -6790,7 +6802,7 @@ static void mldsa_ntt(sword32* r) { #if defined(USE_INTEL_SPEEDUP) && defined(WOLFSSL_MLDSA_HAVE_INTEL_AVX512) if (USE_INTEL_AVX512(cpuid_flags) && (SAVE_VECTOR_REGISTERS2() == 0)) { - wc_mldsa_ntt_1p_avx512(r); + MLDSA_NTT_AVX512(r); RESTORE_VECTOR_REGISTERS(); } else @@ -6860,7 +6872,9 @@ static void mldsa_vec_ntt(sword32* r, byte l) * hand back to mldsa_ntt() below. */ if (USE_INTEL_AVX512(cpuid_flags) && (SAVE_VECTOR_REGISTERS2() == 0)) { for (; i < l; i++) { - wc_mldsa_ntt_1p_avx512(r); + /* MLDSA_NTT_AVX512: see the flavor-selection note by its + * definition. */ + MLDSA_NTT_AVX512(r); r += MLDSA_N; } RESTORE_VECTOR_REGISTERS(); @@ -7268,15 +7282,16 @@ static void mldsa_ntt_small(sword32* r) { #if defined(USE_INTEL_SPEEDUP) && defined(WOLFSSL_MLDSA_HAVE_INTEL_AVX512) if (USE_INTEL_AVX512(cpuid_flags) && (SAVE_VECTOR_REGISTERS2() == 0)) { - wc_mldsa_ntt_small_1p_avx512(r); + MLDSA_NTT_SMALL_AVX512(r); RESTORE_VECTOR_REGISTERS(); } else #endif #ifdef USE_INTEL_SPEEDUP - /* MLDSA_NTT_AVX2: see the flavor-selection note by its definition. */ + /* MLDSA_NTT_SMALL_AVX2: see the flavor-selection note by its + * definition. */ if (IS_INTEL_AVX2(cpuid_flags) && (SAVE_VECTOR_REGISTERS2() == 0)) { - wc_mldsa_ntt_small_avx2(r); + MLDSA_NTT_SMALL_AVX2(r); RESTORE_VECTOR_REGISTERS(); } else @@ -7816,7 +7831,9 @@ static void mldsa_invntt(sword32* r) { #if defined(USE_INTEL_SPEEDUP) && defined(WOLFSSL_MLDSA_HAVE_INTEL_AVX512) if (USE_INTEL_AVX512(cpuid_flags) && (SAVE_VECTOR_REGISTERS2() == 0)) { - wc_mldsa_invntt_1p_avx512(r); + /* MLDSA_INVNTT_AVX512: see the flavor-selection note by its + * definition. */ + MLDSA_INVNTT_AVX512(r); RESTORE_VECTOR_REGISTERS(); } else @@ -8225,7 +8242,10 @@ static void mldsa_mul_invntt(sword32* r, sword32* c, sword32* v) /* Both steps under one save/restore of the vector registers. */ if (USE_INTEL_AVX512(cpuid_flags) && (SAVE_VECTOR_REGISTERS2() == 0)) { wc_mldsa_mul_avx512(r, c, v); - wc_mldsa_invntt_1p_avx512(r); + /* MLDSA_INVNTT_AVX512: see the flavor-selection note by its + * definition. wc_mldsa_mul_avx512() is positionwise, so its output + * order matches its operands' order in both configurations. */ + MLDSA_INVNTT_AVX512(r); RESTORE_VECTOR_REGISTERS(); } else diff --git a/wolfcrypt/src/wc_mldsa_asm.S b/wolfcrypt/src/wc_mldsa_asm.S index 57ad840776f..1fc0d8646e0 100644 --- a/wolfcrypt/src/wc_mldsa_asm.S +++ b/wolfcrypt/src/wc_mldsa_asm.S @@ -3243,12 +3243,14 @@ _wc_mldsa_ntt_avx2: #ifndef __APPLE__ .text .globl wc_mldsa_ntt_small_avx2 +WC_ASM_ATT_HIDDEN(wc_mldsa_ntt_small_avx2) .type wc_mldsa_ntt_small_avx2,@function .align 16 wc_mldsa_ntt_small_avx2: #else .section __TEXT,__text .globl _wc_mldsa_ntt_small_avx2 +WC_ASM_ATT_HIDDEN(_wc_mldsa_ntt_small_avx2) .p2align 4 _wc_mldsa_ntt_small_avx2: #endif /* __APPLE__ */ @@ -7549,12 +7551,14 @@ _wc_mldsa_ntt_full_avx2: #ifndef __APPLE__ .text .globl wc_mldsa_ntt_small_full_avx2 +WC_ASM_ATT_HIDDEN(wc_mldsa_ntt_small_full_avx2) .type wc_mldsa_ntt_small_full_avx2,@function .align 16 wc_mldsa_ntt_small_full_avx2: #else .section __TEXT,__text .globl _wc_mldsa_ntt_small_full_avx2 +WC_ASM_ATT_HIDDEN(_wc_mldsa_ntt_small_full_avx2) .p2align 4 _wc_mldsa_ntt_small_full_avx2: #endif /* __APPLE__ */ @@ -39878,12 +39882,14 @@ L_mldsa_rej_shuffle_avx512: #ifndef __APPLE__ .text .globl wc_mldsa_rej_uniform_n_avx512 +WC_ASM_ATT_HIDDEN(wc_mldsa_rej_uniform_n_avx512) .type wc_mldsa_rej_uniform_n_avx512,@function .align 16 wc_mldsa_rej_uniform_n_avx512: #else .section __TEXT,__text .globl _wc_mldsa_rej_uniform_n_avx512 +WC_ASM_ATT_HIDDEN(_wc_mldsa_rej_uniform_n_avx512) .p2align 4 _wc_mldsa_rej_uniform_n_avx512: #endif /* __APPLE__ */ @@ -39954,12 +39960,14 @@ L_wc_mldsa_rej_uniform_n_avx512_done_64: #ifndef __APPLE__ .text .globl wc_mldsa_rej_uniform_avx512 +WC_ASM_ATT_HIDDEN(wc_mldsa_rej_uniform_avx512) .type wc_mldsa_rej_uniform_avx512,@function .align 16 wc_mldsa_rej_uniform_avx512: #else .section __TEXT,__text .globl _wc_mldsa_rej_uniform_avx512 +WC_ASM_ATT_HIDDEN(_wc_mldsa_rej_uniform_avx512) .p2align 4 _wc_mldsa_rej_uniform_avx512: #endif /* __APPLE__ */ @@ -40105,12 +40113,14 @@ L_mldsa_extract_coeffs_eta2_avx512_shift: #ifndef __APPLE__ .text .globl wc_mldsa_extract_coeffs_eta2_avx512 +WC_ASM_ATT_HIDDEN(wc_mldsa_extract_coeffs_eta2_avx512) .type wc_mldsa_extract_coeffs_eta2_avx512,@function .align 16 wc_mldsa_extract_coeffs_eta2_avx512: #else .section __TEXT,__text .globl _wc_mldsa_extract_coeffs_eta2_avx512 +WC_ASM_ATT_HIDDEN(_wc_mldsa_extract_coeffs_eta2_avx512) .p2align 4 _wc_mldsa_extract_coeffs_eta2_avx512: #endif /* __APPLE__ */ @@ -40442,12 +40452,14 @@ L_mldsa_extract_coeffs_eta4_avx512_shift: #ifndef __APPLE__ .text .globl wc_mldsa_extract_coeffs_eta4_avx512 +WC_ASM_ATT_HIDDEN(wc_mldsa_extract_coeffs_eta4_avx512) .type wc_mldsa_extract_coeffs_eta4_avx512,@function .align 16 wc_mldsa_extract_coeffs_eta4_avx512: #else .section __TEXT,__text .globl _wc_mldsa_extract_coeffs_eta4_avx512 +WC_ASM_ATT_HIDDEN(_wc_mldsa_extract_coeffs_eta4_avx512) .p2align 4 _wc_mldsa_extract_coeffs_eta4_avx512: #endif /* __APPLE__ */ @@ -40764,12 +40776,14 @@ L_mldsa_make_hint_88_avx512_step: #ifndef __APPLE__ .text .globl wc_mldsa_make_hint_88_avx512 +WC_ASM_ATT_HIDDEN(wc_mldsa_make_hint_88_avx512) .type wc_mldsa_make_hint_88_avx512,@function .align 16 wc_mldsa_make_hint_88_avx512: #else .section __TEXT,__text .globl _wc_mldsa_make_hint_88_avx512 +WC_ASM_ATT_HIDDEN(_wc_mldsa_make_hint_88_avx512) .p2align 4 _wc_mldsa_make_hint_88_avx512: #endif /* __APPLE__ */ @@ -41192,12 +41206,14 @@ L_mldsa_make_hint_32_avx512_step: #ifndef __APPLE__ .text .globl wc_mldsa_make_hint_32_avx512 +WC_ASM_ATT_HIDDEN(wc_mldsa_make_hint_32_avx512) .type wc_mldsa_make_hint_32_avx512,@function .align 16 wc_mldsa_make_hint_32_avx512: #else .section __TEXT,__text .globl _wc_mldsa_make_hint_32_avx512 +WC_ASM_ATT_HIDDEN(_wc_mldsa_make_hint_32_avx512) .p2align 4 _wc_mldsa_make_hint_32_avx512: #endif /* __APPLE__ */ @@ -41560,12 +41576,14 @@ L_mldsa_make_hint_32_avx512_done: #ifndef __APPLE__ .text .globl wc_mldsa_use_hint_88_avx512 +WC_ASM_ATT_HIDDEN(wc_mldsa_use_hint_88_avx512) .type wc_mldsa_use_hint_88_avx512,@function .align 16 wc_mldsa_use_hint_88_avx512: #else .section __TEXT,__text .globl _wc_mldsa_use_hint_88_avx512 +WC_ASM_ATT_HIDDEN(_wc_mldsa_use_hint_88_avx512) .p2align 4 _wc_mldsa_use_hint_88_avx512: #endif /* __APPLE__ */ @@ -44611,12 +44629,14 @@ L_mldsa_use_hint_88_avx512_hints_done_3_15: #ifndef __APPLE__ .text .globl wc_mldsa_use_hint_32_avx512 +WC_ASM_ATT_HIDDEN(wc_mldsa_use_hint_32_avx512) .type wc_mldsa_use_hint_32_avx512,@function .align 16 wc_mldsa_use_hint_32_avx512: #else .section __TEXT,__text .globl _wc_mldsa_use_hint_32_avx512 +WC_ASM_ATT_HIDDEN(_wc_mldsa_use_hint_32_avx512) .p2align 4 _wc_mldsa_use_hint_32_avx512: #endif /* __APPLE__ */ @@ -45317,12 +45337,14 @@ L_mldsa_use_hint_32_avx512_hints_done_15: #ifndef __APPLE__ .text .globl wc_mldsa_redistribute_21_rand_x8_avx512 +WC_ASM_ATT_HIDDEN(wc_mldsa_redistribute_21_rand_x8_avx512) .type wc_mldsa_redistribute_21_rand_x8_avx512,@function .align 16 wc_mldsa_redistribute_21_rand_x8_avx512: #else .section __TEXT,__text .globl _wc_mldsa_redistribute_21_rand_x8_avx512 +WC_ASM_ATT_HIDDEN(_wc_mldsa_redistribute_21_rand_x8_avx512) .p2align 4 _wc_mldsa_redistribute_21_rand_x8_avx512: #endif /* __APPLE__ */ @@ -45515,12 +45537,14 @@ _wc_mldsa_redistribute_21_rand_x8_avx512: #ifndef __APPLE__ .text .globl wc_mldsa_redistribute_17_rand_x8_avx512 +WC_ASM_ATT_HIDDEN(wc_mldsa_redistribute_17_rand_x8_avx512) .type wc_mldsa_redistribute_17_rand_x8_avx512,@function .align 16 wc_mldsa_redistribute_17_rand_x8_avx512: #else .section __TEXT,__text .globl _wc_mldsa_redistribute_17_rand_x8_avx512 +WC_ASM_ATT_HIDDEN(_wc_mldsa_redistribute_17_rand_x8_avx512) .p2align 4 _wc_mldsa_redistribute_17_rand_x8_avx512: #endif /* __APPLE__ */ @@ -45748,12 +45772,14 @@ L_mldsa_decode_gamma1_17_x2_avx512_gamma17: #ifndef __APPLE__ .text .globl wc_mldsa_decode_gamma1_17_x2_avx512 +WC_ASM_ATT_HIDDEN(wc_mldsa_decode_gamma1_17_x2_avx512) .type wc_mldsa_decode_gamma1_17_x2_avx512,@function .align 16 wc_mldsa_decode_gamma1_17_x2_avx512: #else .section __TEXT,__text .globl _wc_mldsa_decode_gamma1_17_x2_avx512 +WC_ASM_ATT_HIDDEN(_wc_mldsa_decode_gamma1_17_x2_avx512) .p2align 4 _wc_mldsa_decode_gamma1_17_x2_avx512: #endif /* __APPLE__ */ @@ -46166,12 +46192,14 @@ L_mldsa_decode_gamma1_19_x2_avx512_gamma19: #ifndef __APPLE__ .text .globl wc_mldsa_decode_gamma1_19_x2_avx512 +WC_ASM_ATT_HIDDEN(wc_mldsa_decode_gamma1_19_x2_avx512) .type wc_mldsa_decode_gamma1_19_x2_avx512,@function .align 16 wc_mldsa_decode_gamma1_19_x2_avx512: #else .section __TEXT,__text .globl _wc_mldsa_decode_gamma1_19_x2_avx512 +WC_ASM_ATT_HIDDEN(_wc_mldsa_decode_gamma1_19_x2_avx512) .p2align 4 _wc_mldsa_decode_gamma1_19_x2_avx512: #endif /* __APPLE__ */ @@ -46676,12 +46704,14 @@ L_mldsa_decode_t0_x2_avx512_d_max_half: #ifndef __APPLE__ .text .globl wc_mldsa_decode_t0_x2_avx512 +WC_ASM_ATT_HIDDEN(wc_mldsa_decode_t0_x2_avx512) .type wc_mldsa_decode_t0_x2_avx512,@function .align 16 wc_mldsa_decode_t0_x2_avx512: #else .section __TEXT,__text .globl _wc_mldsa_decode_t0_x2_avx512 +WC_ASM_ATT_HIDDEN(_wc_mldsa_decode_t0_x2_avx512) .p2align 4 _wc_mldsa_decode_t0_x2_avx512: #endif /* __APPLE__ */ @@ -47109,12 +47139,14 @@ L_mldsa_decode_t1_x2_avx512_mask: #ifndef __APPLE__ .text .globl wc_mldsa_decode_t1_x2_avx512 +WC_ASM_ATT_HIDDEN(wc_mldsa_decode_t1_x2_avx512) .type wc_mldsa_decode_t1_x2_avx512,@function .align 16 wc_mldsa_decode_t1_x2_avx512: #else .section __TEXT,__text .globl _wc_mldsa_decode_t1_x2_avx512 +WC_ASM_ATT_HIDDEN(_wc_mldsa_decode_t1_x2_avx512) .p2align 4 _wc_mldsa_decode_t1_x2_avx512: #endif /* __APPLE__ */ @@ -47592,12 +47624,14 @@ L_mldsa_decode_eta_2_x2_avx512_mask: #ifndef __APPLE__ .text .globl wc_mldsa_decode_eta_2_x2_avx512 +WC_ASM_ATT_HIDDEN(wc_mldsa_decode_eta_2_x2_avx512) .type wc_mldsa_decode_eta_2_x2_avx512,@function .align 16 wc_mldsa_decode_eta_2_x2_avx512: #else .section __TEXT,__text .globl _wc_mldsa_decode_eta_2_x2_avx512 +WC_ASM_ATT_HIDDEN(_wc_mldsa_decode_eta_2_x2_avx512) .p2align 4 _wc_mldsa_decode_eta_2_x2_avx512: #endif /* __APPLE__ */ @@ -47907,12 +47941,14 @@ L_mldsa_decode_eta_4_x2_avx512_mask: #ifndef __APPLE__ .text .globl wc_mldsa_decode_eta_4_x2_avx512 +WC_ASM_ATT_HIDDEN(wc_mldsa_decode_eta_4_x2_avx512) .type wc_mldsa_decode_eta_4_x2_avx512,@function .align 16 wc_mldsa_decode_eta_4_x2_avx512: #else .section __TEXT,__text .globl _wc_mldsa_decode_eta_4_x2_avx512 +WC_ASM_ATT_HIDDEN(_wc_mldsa_decode_eta_4_x2_avx512) .p2align 4 _wc_mldsa_decode_eta_4_x2_avx512: #endif /* __APPLE__ */ @@ -48258,12 +48294,14 @@ L_mldsa_encode_gamma1_17_avx512_shift2: #ifndef __APPLE__ .text .globl wc_mldsa_encode_gamma1_17_avx512 +WC_ASM_ATT_HIDDEN(wc_mldsa_encode_gamma1_17_avx512) .type wc_mldsa_encode_gamma1_17_avx512,@function .align 16 wc_mldsa_encode_gamma1_17_avx512: #else .section __TEXT,__text .globl _wc_mldsa_encode_gamma1_17_avx512 +WC_ASM_ATT_HIDDEN(_wc_mldsa_encode_gamma1_17_avx512) .p2align 4 _wc_mldsa_encode_gamma1_17_avx512: #endif /* __APPLE__ */ @@ -48565,12 +48603,14 @@ L_mldsa_encode_gamma1_19_avx512_shift2: #ifndef __APPLE__ .text .globl wc_mldsa_encode_gamma1_19_avx512 +WC_ASM_ATT_HIDDEN(wc_mldsa_encode_gamma1_19_avx512) .type wc_mldsa_encode_gamma1_19_avx512,@function .align 16 wc_mldsa_encode_gamma1_19_avx512: #else .section __TEXT,__text .globl _wc_mldsa_encode_gamma1_19_avx512 +WC_ASM_ATT_HIDDEN(_wc_mldsa_encode_gamma1_19_avx512) .p2align 4 _wc_mldsa_encode_gamma1_19_avx512: #endif /* __APPLE__ */ @@ -48840,12 +48880,14 @@ L_mldsa_encode_w1_88_x2_avx512_vs: #ifndef __APPLE__ .text .globl wc_mldsa_encode_w1_88_x2_avx512 +WC_ASM_ATT_HIDDEN(wc_mldsa_encode_w1_88_x2_avx512) .type wc_mldsa_encode_w1_88_x2_avx512,@function .align 16 wc_mldsa_encode_w1_88_x2_avx512: #else .section __TEXT,__text .globl _wc_mldsa_encode_w1_88_x2_avx512 +WC_ASM_ATT_HIDDEN(_wc_mldsa_encode_w1_88_x2_avx512) .p2align 4 _wc_mldsa_encode_w1_88_x2_avx512: #endif /* __APPLE__ */ @@ -49214,12 +49256,14 @@ _wc_mldsa_encode_w1_88_x2_avx512: #ifndef __APPLE__ .text .globl wc_mldsa_encode_w1_32_avx512 +WC_ASM_ATT_HIDDEN(wc_mldsa_encode_w1_32_avx512) .type wc_mldsa_encode_w1_32_avx512,@function .align 16 wc_mldsa_encode_w1_32_avx512: #else .section __TEXT,__text .globl _wc_mldsa_encode_w1_32_avx512 +WC_ASM_ATT_HIDDEN(_wc_mldsa_encode_w1_32_avx512) .p2align 4 _wc_mldsa_encode_w1_32_avx512: #endif /* __APPLE__ */ @@ -49381,12 +49425,14 @@ L_mldsa_encode_eta_2_x2_avx512_shuff_6_odd: #ifndef __APPLE__ .text .globl wc_mldsa_encode_eta_2_x2_avx512 +WC_ASM_ATT_HIDDEN(wc_mldsa_encode_eta_2_x2_avx512) .type wc_mldsa_encode_eta_2_x2_avx512,@function .align 16 wc_mldsa_encode_eta_2_x2_avx512: #else .section __TEXT,__text .globl _wc_mldsa_encode_eta_2_x2_avx512 +WC_ASM_ATT_HIDDEN(_wc_mldsa_encode_eta_2_x2_avx512) .p2align 4 _wc_mldsa_encode_eta_2_x2_avx512: #endif /* __APPLE__ */ @@ -49725,12 +49771,14 @@ L_mldsa_encode_eta_4_avx512_four: #ifndef __APPLE__ .text .globl wc_mldsa_encode_eta_4_avx512 +WC_ASM_ATT_HIDDEN(wc_mldsa_encode_eta_4_avx512) .type wc_mldsa_encode_eta_4_avx512,@function .align 16 wc_mldsa_encode_eta_4_avx512: #else .section __TEXT,__text .globl _wc_mldsa_encode_eta_4_avx512 +WC_ASM_ATT_HIDDEN(_wc_mldsa_encode_eta_4_avx512) .p2align 4 _wc_mldsa_encode_eta_4_avx512: #endif /* __APPLE__ */ @@ -49935,12 +49983,14 @@ L_mldsa_encode_t0_t1_x2_avx512_shuff_10_odd: #ifndef __APPLE__ .text .globl wc_mldsa_encode_t0_t1_x2_avx512 +WC_ASM_ATT_HIDDEN(wc_mldsa_encode_t0_t1_x2_avx512) .type wc_mldsa_encode_t0_t1_x2_avx512,@function .align 16 wc_mldsa_encode_t0_t1_x2_avx512: #else .section __TEXT,__text .globl _wc_mldsa_encode_t0_t1_x2_avx512 +WC_ASM_ATT_HIDDEN(_wc_mldsa_encode_t0_t1_x2_avx512) .p2align 4 _wc_mldsa_encode_t0_t1_x2_avx512: #endif /* __APPLE__ */ @@ -51706,12 +51756,14 @@ L_mldsa_avx512_zetas_inv_1p: #ifndef __APPLE__ .text .globl wc_mldsa_ntt_1p_avx512 +WC_ASM_ATT_HIDDEN(wc_mldsa_ntt_1p_avx512) .type wc_mldsa_ntt_1p_avx512,@function .align 16 wc_mldsa_ntt_1p_avx512: #else .section __TEXT,__text .globl _wc_mldsa_ntt_1p_avx512 +WC_ASM_ATT_HIDDEN(_wc_mldsa_ntt_1p_avx512) .p2align 4 _wc_mldsa_ntt_1p_avx512: #endif /* __APPLE__ */ @@ -52860,12 +52912,14 @@ _wc_mldsa_ntt_1p_avx512: #ifndef __APPLE__ .text .globl wc_mldsa_ntt_small_1p_avx512 +WC_ASM_ATT_HIDDEN(wc_mldsa_ntt_small_1p_avx512) .type wc_mldsa_ntt_small_1p_avx512,@function .align 16 wc_mldsa_ntt_small_1p_avx512: #else .section __TEXT,__text .globl _wc_mldsa_ntt_small_1p_avx512 +WC_ASM_ATT_HIDDEN(_wc_mldsa_ntt_small_1p_avx512) .p2align 4 _wc_mldsa_ntt_small_1p_avx512: #endif /* __APPLE__ */ @@ -53966,12 +54020,14 @@ _wc_mldsa_ntt_small_1p_avx512: #ifndef __APPLE__ .text .globl wc_mldsa_ntt_full_1p_avx512 +WC_ASM_ATT_HIDDEN(wc_mldsa_ntt_full_1p_avx512) .type wc_mldsa_ntt_full_1p_avx512,@function .align 16 wc_mldsa_ntt_full_1p_avx512: #else .section __TEXT,__text .globl _wc_mldsa_ntt_full_1p_avx512 +WC_ASM_ATT_HIDDEN(_wc_mldsa_ntt_full_1p_avx512) .p2align 4 _wc_mldsa_ntt_full_1p_avx512: #endif /* __APPLE__ */ @@ -55154,12 +55210,14 @@ _wc_mldsa_ntt_full_1p_avx512: #ifndef __APPLE__ .text .globl wc_mldsa_ntt_small_full_1p_avx512 +WC_ASM_ATT_HIDDEN(wc_mldsa_ntt_small_full_1p_avx512) .type wc_mldsa_ntt_small_full_1p_avx512,@function .align 16 wc_mldsa_ntt_small_full_1p_avx512: #else .section __TEXT,__text .globl _wc_mldsa_ntt_small_full_1p_avx512 +WC_ASM_ATT_HIDDEN(_wc_mldsa_ntt_small_full_1p_avx512) .p2align 4 _wc_mldsa_ntt_small_full_1p_avx512: #endif /* __APPLE__ */ @@ -56294,12 +56352,14 @@ _wc_mldsa_ntt_small_full_1p_avx512: #ifndef __APPLE__ .text .globl wc_mldsa_invntt_1p_avx512 +WC_ASM_ATT_HIDDEN(wc_mldsa_invntt_1p_avx512) .type wc_mldsa_invntt_1p_avx512,@function .align 16 wc_mldsa_invntt_1p_avx512: #else .section __TEXT,__text .globl _wc_mldsa_invntt_1p_avx512 +WC_ASM_ATT_HIDDEN(_wc_mldsa_invntt_1p_avx512) .p2align 4 _wc_mldsa_invntt_1p_avx512: #endif /* __APPLE__ */ @@ -57626,12 +57686,14 @@ _wc_mldsa_invntt_1p_avx512: #ifndef __APPLE__ .text .globl wc_mldsa_invntt_full_1p_avx512 +WC_ASM_ATT_HIDDEN(wc_mldsa_invntt_full_1p_avx512) .type wc_mldsa_invntt_full_1p_avx512,@function .align 16 wc_mldsa_invntt_full_1p_avx512: #else .section __TEXT,__text .globl _wc_mldsa_invntt_full_1p_avx512 +WC_ASM_ATT_HIDDEN(_wc_mldsa_invntt_full_1p_avx512) .p2align 4 _wc_mldsa_invntt_full_1p_avx512: #endif /* __APPLE__ */ @@ -59062,12 +59124,14 @@ _wc_mldsa_invntt_full_1p_avx512: #ifndef __APPLE__ .text .globl wc_mldsa_poly_red_avx512 +WC_ASM_ATT_HIDDEN(wc_mldsa_poly_red_avx512) .type wc_mldsa_poly_red_avx512,@function .align 16 wc_mldsa_poly_red_avx512: #else .section __TEXT,__text .globl _wc_mldsa_poly_red_avx512 +WC_ASM_ATT_HIDDEN(_wc_mldsa_poly_red_avx512) .p2align 4 _wc_mldsa_poly_red_avx512: #endif /* __APPLE__ */ @@ -59181,12 +59245,14 @@ _wc_mldsa_poly_red_avx512: #ifndef __APPLE__ .text .globl wc_mldsa_mul_avx512 +WC_ASM_ATT_HIDDEN(wc_mldsa_mul_avx512) .type wc_mldsa_mul_avx512,@function .align 16 wc_mldsa_mul_avx512: #else .section __TEXT,__text .globl _wc_mldsa_mul_avx512 +WC_ASM_ATT_HIDDEN(_wc_mldsa_mul_avx512) .p2align 4 _wc_mldsa_mul_avx512: #endif /* __APPLE__ */ @@ -59460,12 +59526,14 @@ _wc_mldsa_mul_avx512: #ifndef __APPLE__ .text .globl wc_mldsa_mul_vec_4_avx512 +WC_ASM_ATT_HIDDEN(wc_mldsa_mul_vec_4_avx512) .type wc_mldsa_mul_vec_4_avx512,@function .align 16 wc_mldsa_mul_vec_4_avx512: #else .section __TEXT,__text .globl _wc_mldsa_mul_vec_4_avx512 +WC_ASM_ATT_HIDDEN(_wc_mldsa_mul_vec_4_avx512) .p2align 4 _wc_mldsa_mul_vec_4_avx512: #endif /* __APPLE__ */ @@ -60139,12 +60207,14 @@ _wc_mldsa_mul_vec_4_avx512: #ifndef __APPLE__ .text .globl wc_mldsa_mul_vec_5_avx512 +WC_ASM_ATT_HIDDEN(wc_mldsa_mul_vec_5_avx512) .type wc_mldsa_mul_vec_5_avx512,@function .align 16 wc_mldsa_mul_vec_5_avx512: #else .section __TEXT,__text .globl _wc_mldsa_mul_vec_5_avx512 +WC_ASM_ATT_HIDDEN(_wc_mldsa_mul_vec_5_avx512) .p2align 4 _wc_mldsa_mul_vec_5_avx512: #endif /* __APPLE__ */ @@ -60946,12 +61016,14 @@ _wc_mldsa_mul_vec_5_avx512: #ifndef __APPLE__ .text .globl wc_mldsa_mul_vec_7_avx512 +WC_ASM_ATT_HIDDEN(wc_mldsa_mul_vec_7_avx512) .type wc_mldsa_mul_vec_7_avx512,@function .align 16 wc_mldsa_mul_vec_7_avx512: #else .section __TEXT,__text .globl _wc_mldsa_mul_vec_7_avx512 +WC_ASM_ATT_HIDDEN(_wc_mldsa_mul_vec_7_avx512) .p2align 4 _wc_mldsa_mul_vec_7_avx512: #endif /* __APPLE__ */ @@ -62009,12 +62081,14 @@ _wc_mldsa_mul_vec_7_avx512: #ifndef __APPLE__ .text .globl wc_mldsa_decompose_q88_avx512 +WC_ASM_ATT_HIDDEN(wc_mldsa_decompose_q88_avx512) .type wc_mldsa_decompose_q88_avx512,@function .align 16 wc_mldsa_decompose_q88_avx512: #else .section __TEXT,__text .globl _wc_mldsa_decompose_q88_avx512 +WC_ASM_ATT_HIDDEN(_wc_mldsa_decompose_q88_avx512) .p2align 4 _wc_mldsa_decompose_q88_avx512: #endif /* __APPLE__ */ @@ -63133,12 +63207,14 @@ _wc_mldsa_decompose_q88_avx512: #ifndef __APPLE__ .text .globl wc_mldsa_decompose_q32_avx512 +WC_ASM_ATT_HIDDEN(wc_mldsa_decompose_q32_avx512) .type wc_mldsa_decompose_q32_avx512,@function .align 16 wc_mldsa_decompose_q32_avx512: #else .section __TEXT,__text .globl _wc_mldsa_decompose_q32_avx512 +WC_ASM_ATT_HIDDEN(_wc_mldsa_decompose_q32_avx512) .p2align 4 _wc_mldsa_decompose_q32_avx512: #endif /* __APPLE__ */ @@ -63408,12 +63484,14 @@ L_mldsa_decompose_q32_avx512_start_256: #ifndef __APPLE__ .text .globl wc_mldsa_vec_check_low_avx512 +WC_ASM_ATT_HIDDEN(wc_mldsa_vec_check_low_avx512) .type wc_mldsa_vec_check_low_avx512,@function .align 16 wc_mldsa_vec_check_low_avx512: #else .section __TEXT,__text .globl _wc_mldsa_vec_check_low_avx512 +WC_ASM_ATT_HIDDEN(_wc_mldsa_vec_check_low_avx512) .p2align 4 _wc_mldsa_vec_check_low_avx512: #endif /* __APPLE__ */ @@ -63533,12 +63611,14 @@ L_mldsa_vec_check_low_avx512_done: #ifndef __APPLE__ .text .globl wc_mldsa_poly_add_avx512 +WC_ASM_ATT_HIDDEN(wc_mldsa_poly_add_avx512) .type wc_mldsa_poly_add_avx512,@function .align 16 wc_mldsa_poly_add_avx512: #else .section __TEXT,__text .globl _wc_mldsa_poly_add_avx512 +WC_ASM_ATT_HIDDEN(_wc_mldsa_poly_add_avx512) .p2align 4 _wc_mldsa_poly_add_avx512: #endif /* __APPLE__ */ @@ -63614,12 +63694,14 @@ _wc_mldsa_poly_add_avx512: #ifndef __APPLE__ .text .globl wc_mldsa_poly_sub_avx512 +WC_ASM_ATT_HIDDEN(wc_mldsa_poly_sub_avx512) .type wc_mldsa_poly_sub_avx512,@function .align 16 wc_mldsa_poly_sub_avx512: #else .section __TEXT,__text .globl _wc_mldsa_poly_sub_avx512 +WC_ASM_ATT_HIDDEN(_wc_mldsa_poly_sub_avx512) .p2align 4 _wc_mldsa_poly_sub_avx512: #endif /* __APPLE__ */ @@ -63695,12 +63777,14 @@ _wc_mldsa_poly_sub_avx512: #ifndef __APPLE__ .text .globl wc_mldsa_poly_make_pos_avx512 +WC_ASM_ATT_HIDDEN(wc_mldsa_poly_make_pos_avx512) .type wc_mldsa_poly_make_pos_avx512,@function .align 16 wc_mldsa_poly_make_pos_avx512: #else .section __TEXT,__text .globl _wc_mldsa_poly_make_pos_avx512 +WC_ASM_ATT_HIDDEN(_wc_mldsa_poly_make_pos_avx512) .p2align 4 _wc_mldsa_poly_make_pos_avx512: #endif /* __APPLE__ */ @@ -63859,12 +63943,14 @@ L_mldsa_encode_w1_88_avx512_vbmi_idx_b: #ifndef __APPLE__ .text .globl wc_mldsa_encode_w1_88_avx512_vbmi +WC_ASM_ATT_HIDDEN(wc_mldsa_encode_w1_88_avx512_vbmi) .type wc_mldsa_encode_w1_88_avx512_vbmi,@function .align 16 wc_mldsa_encode_w1_88_avx512_vbmi: #else .section __TEXT,__text .globl _wc_mldsa_encode_w1_88_avx512_vbmi +WC_ASM_ATT_HIDDEN(_wc_mldsa_encode_w1_88_avx512_vbmi) .p2align 4 _wc_mldsa_encode_w1_88_avx512_vbmi: #endif /* __APPLE__ */ @@ -64113,12 +64199,14 @@ L_mldsa_encode_t0_t1_avx512_vbmi_t1_vs: #ifndef __APPLE__ .text .globl wc_mldsa_encode_t0_t1_avx512_vbmi +WC_ASM_ATT_HIDDEN(wc_mldsa_encode_t0_t1_avx512_vbmi) .type wc_mldsa_encode_t0_t1_avx512_vbmi,@function .align 16 wc_mldsa_encode_t0_t1_avx512_vbmi: #else .section __TEXT,__text .globl _wc_mldsa_encode_t0_t1_avx512_vbmi +WC_ASM_ATT_HIDDEN(_wc_mldsa_encode_t0_t1_avx512_vbmi) .p2align 4 _wc_mldsa_encode_t0_t1_avx512_vbmi: #endif /* __APPLE__ */ diff --git a/wolfcrypt/src/wolfentropy.c b/wolfcrypt/src/wolfentropy.c index c50b1dc9237..876cbc9b425 100644 --- a/wolfcrypt/src/wolfentropy.c +++ b/wolfcrypt/src/wolfentropy.c @@ -30,7 +30,6 @@ data, use this implementation to seed and re-seed the DRBG. */ -#define WC_FIPS_LL_CRYPTO #define _WC_BUILDING_WOLFENTROPY_C #include diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index c86fa68a9a7..d11660f26eb 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -55495,6 +55495,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t frodokem_test(void) WC_RNG rng; int rngInit = 0; FrodoKemKey* key = NULL; + int key_inited = 0; byte* ct = NULL; byte* pk = NULL; byte* sk = NULL; @@ -55506,6 +55507,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t frodokem_test(void) word32 ssLen = 0; #ifdef FRODOKEM_TEST_ASN1 FrodoKemKey* key2 = NULL; + int key2_inited = 0; byte* der = NULL; #endif @@ -55546,6 +55548,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t frodokem_test(void) for (i = 0; i < numTypes; i++) { ret = wc_FrodoKemKey_Init(key, types[i], HEAP_HINT, devId); if (ret != 0) { ret = WC_TEST_RET_ENC_EC(ret); break; } + key_inited = 1; ret = wc_FrodoKemKey_PublicKeySize(key, &pkLen); if (ret != 0) { ret = WC_TEST_RET_ENC_EC(ret); break; } ret = wc_FrodoKemKey_PrivateKeySize(key, &skLen); @@ -55592,6 +55595,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t frodokem_test(void) if (derLen < 0) { ret = WC_TEST_RET_ENC_EC(derLen); break; } ret = wc_FrodoKemKey_Init(key2, types[i], HEAP_HINT, devId); if (ret != 0) { ret = WC_TEST_RET_ENC_EC(ret); break; } + key2_inited = 1; ret = wc_FrodoKemKey_PublicKeyDecode(key2, der, (word32)derLen, &idx); if (ret != 0) { ret = WC_TEST_RET_ENC_EC(ret); break; } @@ -55603,6 +55607,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t frodokem_test(void) ret = WC_TEST_RET_ENC_NC; break; } wc_FrodoKemKey_Free(key2); + key2_inited = 0; /* Private key: PKCS#8. The decoded private key must decapsulate a * ciphertext produced for the original public key. */ @@ -55612,6 +55617,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t frodokem_test(void) if (derLen < 0) { ret = WC_TEST_RET_ENC_EC(derLen); break; } ret = wc_FrodoKemKey_Init(key2, types[i], HEAP_HINT, devId); if (ret != 0) { ret = WC_TEST_RET_ENC_EC(ret); break; } + key2_inited = 1; ret = wc_FrodoKemKey_PrivateKeyDecode(key2, der, (word32)derLen, &idx); if (ret != 0) { ret = WC_TEST_RET_ENC_EC(ret); break; } @@ -55623,6 +55629,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t frodokem_test(void) ret = WC_TEST_RET_ENC_NC; break; } wc_FrodoKemKey_Free(key2); + key2_inited = 0; } else { /* 640 has no standardised OID: encoding must be rejected. */ @@ -55644,7 +55651,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t frodokem_test(void) * the error-break paths. wc_FrodoKemKey_Init zeroizes the object on * re-entry, so no per-iteration free is needed. */ out: - if (key != NULL) + if (key_inited) wc_FrodoKemKey_Free(key); if (rngInit) wc_FreeRng(&rng); @@ -55653,7 +55660,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t frodokem_test(void) XFREE(ct, HEAP_HINT, DYNAMIC_TYPE_TMP_BUFFER); XFREE(key, HEAP_HINT, DYNAMIC_TYPE_TMP_BUFFER); #ifdef FRODOKEM_TEST_ASN1 - if (key2 != NULL) + if (key2_inited) wc_FrodoKemKey_Free(key2); XFREE(der, HEAP_HINT, DYNAMIC_TYPE_TMP_BUFFER); XFREE(key2, HEAP_HINT, DYNAMIC_TYPE_TMP_BUFFER); @@ -58894,7 +58901,7 @@ static wc_test_ret_t mldsa_param_test(int param, WC_RNG* rng) if (ret != 0) ERROR_OUT(WC_TEST_RET_ENC_EC(ret), out); if (res != 1) - ERROR_OUT(WC_TEST_RET_ENC_EC(res), out); + ERROR_OUT(WC_TEST_RET_ENC_I(res), out); #endif #endif From bab1f662af38827a582d40a584d5d20a5abe59ca Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Wed, 5 Aug 2026 18:11:25 -0500 Subject: [PATCH 43/44] configure.ac: use $CC, not "$CC", for ccache compatibility. fixes enable-all-crypto default sensing, and fixes -ffile-prefix-map and --build-id=sha1 setup for reproducible-build, --- configure.ac | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 8a8bf73a8bf..36a60a9b6d5 100644 --- a/configure.ac +++ b/configure.ac @@ -846,7 +846,7 @@ then # opportunistically use -ffile-prefix-map (added in GCC8 and LLVM10) - if "$CC" -ffile-prefix-map=/tmp=. -x c - -o /dev/null >/dev/null 2>&1 <<' EOF' + if $CC -ffile-prefix-map=/tmp=. -x c - -o /dev/null >/dev/null 2>&1 <<' EOF' #include int main(int argc, char **argv) { (void)argc; (void)argv; return 0; @@ -857,7 +857,7 @@ then fi # opportunistically force linker option --build-id=sha1 (usually the default) - if "$CC" -Wl,--build-id=sha1 -x c - -o /dev/null >/dev/null 2>&1 <<' EOF' + if $CC -Wl,--build-id=sha1 -x c - -o /dev/null >/dev/null 2>&1 <<' EOF' #include int main(int argc, char **argv) { (void)argc; (void)argv; return 0; @@ -1514,7 +1514,7 @@ fi # Auto-selected activation of all applicable asm accelerations # Enable asm automatically only if the compiler advertises itself as full Gnu C. -if "$CC" $AM_CFLAGS $CPPFLAGS $CFLAGS -x c - -o /dev/null >/dev/null 2>&1 <<' EOF' +if $CC $AM_CFLAGS $CPPFLAGS $CFLAGS -x c - -o /dev/null >/dev/null 2>&1 <<' EOF' #include int main(int argc, char **argv) { (void)argc; (void)argv; From e89997287fe75d1ddfd76bb1c9d3a2c36dc5ba62 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Wed, 5 Aug 2026 18:33:25 -0500 Subject: [PATCH 44/44] configure.ac, wolfssl/wolfcrypt/settings.h: finish implementing opt-in DH for FIPS v7+. --- configure.ac | 18 +++++++++++++++--- wolfssl/wolfcrypt/settings.h | 9 +++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 36a60a9b6d5..695f3fe4196 100644 --- a/configure.ac +++ b/configure.ac @@ -1891,14 +1891,17 @@ then -dh) lkcapi_dh=no ;; esac done - if test "$lkcapi_dh" = yes; then + if test "$lkcapi_dh" = yes + then enable_dh=conditional fi fi # Enable WOLFSSL_DH_EXTRA and DH const table speedups (eliminates `-lm` math lib dependency) - # No effect if DH is disabled. - AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DH_EXTRA -DHAVE_FFDHE_2048 -DHAVE_FFDHE_3072" + if test "$enable_dh" != no + then + AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DH_EXTRA -DHAVE_FFDHE_2048 -DHAVE_FFDHE_3072" + fi DEFAULT_MAX_CLASSIC_ASYM_KEY_BITS=4096 AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ECDSA_DETERMINISTIC_K_VARIANT" @@ -12893,6 +12896,15 @@ then fi fi fi + + +# Provisions for opt-in DH (FIPS v7+): +if test "$ENABLED_DH" != "no" +then + AM_CFLAGS="$AM_CFLAGS -DHAVE_DH" +fi + + ################################################################################ # USER SETTINGS diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index 0fd6d99a699..e234ba06678 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -5950,6 +5950,15 @@ blinding by defining WC_BLINDING_NO_RNG_ACKNOWLEDGE_WEAKNESS." #error WC_C_DYNAMIC_FALLBACK requires WC_HAVE_VECTOR_SPEEDUPS #endif +/* setup for opt-in DH in FIPS v7+ */ +#if FIPS_VERSION3_GE(7,0,0) && !defined(HAVE_DH) && !defined(NO_DH) + #define NO_DH +#elif defined(NO_DH) + #undef HAVE_DH +#elif !defined(HAVE_DH) + #define HAVE_DH +#endif + #ifdef __cplusplus } /* extern "C" */ #endif