From 1ce90cc8a51dbc5a576b4d222dfbdfe4f625ff0b Mon Sep 17 00:00:00 2001 From: Sean Parkinson Date: Wed, 16 Oct 2024 13:56:44 +1000 Subject: [PATCH] Thumb2 ASM: indicated by WOLFSSL_ARMASM_THUMB2 Detecting ARM or Thumb2 is not simple so making our own define that will work: WOLFSSL_ARMASM_THUMB2 to indicate to use Thumb2 assembly code. --- configure.ac | 6 ++++-- wolfcrypt/src/port/arm/armv8-32-aes-asm.S | 5 ++--- wolfcrypt/src/port/arm/armv8-32-aes-asm_c.c | 5 ++--- wolfcrypt/src/port/arm/armv8-32-chacha-asm.S | 5 ++--- wolfcrypt/src/port/arm/armv8-32-chacha-asm_c.c | 5 ++--- wolfcrypt/src/port/arm/armv8-32-curve25519.S | 5 ++--- wolfcrypt/src/port/arm/armv8-32-curve25519_c.c | 5 ++--- wolfcrypt/src/port/arm/armv8-32-kyber-asm.S | 5 ++--- wolfcrypt/src/port/arm/armv8-32-kyber-asm_c.c | 5 ++--- wolfcrypt/src/port/arm/armv8-32-poly1305-asm.S | 5 ++--- wolfcrypt/src/port/arm/armv8-32-poly1305-asm_c.c | 5 ++--- wolfcrypt/src/port/arm/armv8-32-sha256-asm.S | 5 ++--- wolfcrypt/src/port/arm/armv8-32-sha256-asm_c.c | 5 ++--- wolfcrypt/src/port/arm/armv8-32-sha3-asm.S | 5 ++--- wolfcrypt/src/port/arm/armv8-32-sha3-asm_c.c | 5 ++--- wolfcrypt/src/port/arm/armv8-32-sha512-asm.S | 5 ++--- wolfcrypt/src/port/arm/armv8-32-sha512-asm_c.c | 5 ++--- wolfcrypt/src/port/arm/armv8-poly1305.c | 4 ++-- wolfcrypt/src/port/arm/thumb2-aes-asm.S | 4 ++-- wolfcrypt/src/port/arm/thumb2-aes-asm_c.c | 4 ++-- wolfcrypt/src/port/arm/thumb2-chacha-asm.S | 4 ++-- wolfcrypt/src/port/arm/thumb2-chacha-asm_c.c | 4 ++-- wolfcrypt/src/port/arm/thumb2-chacha.c | 2 +- wolfcrypt/src/port/arm/thumb2-curve25519.S | 4 ++-- wolfcrypt/src/port/arm/thumb2-curve25519_c.c | 4 ++-- wolfcrypt/src/port/arm/thumb2-kyber-asm.S | 4 ++-- wolfcrypt/src/port/arm/thumb2-kyber-asm_c.c | 4 ++-- wolfcrypt/src/port/arm/thumb2-poly1305-asm.S | 4 ++-- wolfcrypt/src/port/arm/thumb2-poly1305-asm_c.c | 4 ++-- wolfcrypt/src/port/arm/thumb2-poly1305.c | 4 ++-- wolfcrypt/src/port/arm/thumb2-sha256-asm.S | 4 ++-- wolfcrypt/src/port/arm/thumb2-sha256-asm_c.c | 4 ++-- wolfcrypt/src/port/arm/thumb2-sha3-asm.S | 4 ++-- wolfcrypt/src/port/arm/thumb2-sha3-asm_c.c | 4 ++-- wolfcrypt/src/port/arm/thumb2-sha512-asm.S | 4 ++-- wolfcrypt/src/port/arm/thumb2-sha512-asm_c.c | 4 ++-- wolfcrypt/src/wc_kyber_poly.c | 2 +- wolfssl/wolfcrypt/chacha.h | 2 +- wolfssl/wolfcrypt/poly1305.h | 2 +- wolfssl/wolfcrypt/wc_kyber.h | 2 +- 40 files changed, 77 insertions(+), 91 deletions(-) diff --git a/configure.ac b/configure.ac index eb1fd6820..cc0217b44 100644 --- a/configure.ac +++ b/configure.ac @@ -3030,7 +3030,8 @@ then ;; armv7m*) # QEMU doesn't work with armv7-m - AM_CPPFLAGS="$AM_CPPFLAGS -march=armv7-r -D__thumb__ -fomit-frame-pointer -DWOLFSSL_ARMASM_NO_HW_CRYPTO -DWOLFSSL_ARM_ARCH=7" + AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ARMASM_THUMB2" + AM_CPPFLAGS="$AM_CPPFLAGS -march=armv7-r -DWOLFSSL_ARMASM_THUMB2 -fomit-frame-pointer -DWOLFSSL_ARMASM_NO_HW_CRYPTO -DWOLFSSL_ARM_ARCH=7" # Include options.h AM_CCASFLAGS="$AM_CCASFLAGS -DEXTERNAL_OPTS_OPENVPN" ENABLED_ARMASM_CRYPTO=no @@ -8388,7 +8389,8 @@ if test "$ENABLED_SP_ASM" = "yes" && test "$ENABLED_SP" = "yes"; then ;; *cortex* | *armv7m*) if test "$ENABLED_ARMASM" = "no"; then - AM_CPPFLAGS="$AM_CPPFLAGS -march=armv7-r -D__thumb__ -DWOLFSSL_ARM_ARCH=7" + AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ARMASM_THUMB2" + AM_CPPFLAGS="$AM_CPPFLAGS -march=armv7-r -DWOLFSSL_ARMASM_THUMB2 -DWOLFSSL_ARM_ARCH=7" fi AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_ARM_CORTEX_M_ASM" AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_SP_ARM_CORTEX_M_ASM" diff --git a/wolfcrypt/src/port/arm/armv8-32-aes-asm.S b/wolfcrypt/src/port/arm/armv8-32-aes-asm.S index 45441ead1..64a0f630a 100644 --- a/wolfcrypt/src/port/arm/armv8-32-aes-asm.S +++ b/wolfcrypt/src/port/arm/armv8-32-aes-asm.S @@ -31,8 +31,7 @@ #include #ifdef WOLFSSL_ARMASM -#if !defined(__aarch64__) && defined(__arm__) && (!defined(__thumb__) || \ - defined(__THUMB_INTERWORK__)) +#if !defined(__aarch64__) && !defined(WOLFSSL_ARMASM_THUMB2) #ifndef WOLFSSL_ARMASM_INLINE #ifndef NO_AES #ifdef HAVE_AES_DECRYPT @@ -5306,7 +5305,7 @@ L_AES_GCM_encrypt_end: .size AES_GCM_encrypt,.-AES_GCM_encrypt #endif /* HAVE_AESGCM */ #endif /* !NO_AES */ -#endif /* !__aarch64__ && __arm__ && (!__thumb__ || __THUMB_INTERWORK__) */ +#endif /* !__aarch64__ && !WOLFSSL_ARMASM_THUMB2 */ #endif /* WOLFSSL_ARMASM */ #if defined(__linux__) && defined(__ELF__) diff --git a/wolfcrypt/src/port/arm/armv8-32-aes-asm_c.c b/wolfcrypt/src/port/arm/armv8-32-aes-asm_c.c index 3c34f3ef6..7f2fd804c 100644 --- a/wolfcrypt/src/port/arm/armv8-32-aes-asm_c.c +++ b/wolfcrypt/src/port/arm/armv8-32-aes-asm_c.c @@ -32,8 +32,7 @@ #include #ifdef WOLFSSL_ARMASM -#if !defined(__aarch64__) && defined(__arm__) && (!defined(__thumb__) || \ - defined(__THUMB_INTERWORK__)) +#if !defined(__aarch64__) && !defined(WOLFSSL_ARMASM_THUMB2) #include #ifdef HAVE_CONFIG_H #include @@ -4850,7 +4849,7 @@ void AES_GCM_encrypt(const unsigned char* in_p, unsigned char* out_p, #endif /* HAVE_AESGCM */ #endif /* !NO_AES */ -#endif /* !__aarch64__ && __arm__ && (!__thumb__ || __THUMB_INTERWORK__) */ +#endif /* !__aarch64__ && !WOLFSSL_ARMASM_THUMB2 */ #endif /* WOLFSSL_ARMASM */ #endif /* WOLFSSL_ARMASM_INLINE */ diff --git a/wolfcrypt/src/port/arm/armv8-32-chacha-asm.S b/wolfcrypt/src/port/arm/armv8-32-chacha-asm.S index 3c4119eb1..f035fbe23 100644 --- a/wolfcrypt/src/port/arm/armv8-32-chacha-asm.S +++ b/wolfcrypt/src/port/arm/armv8-32-chacha-asm.S @@ -31,8 +31,7 @@ #include #ifdef WOLFSSL_ARMASM -#if !defined(__aarch64__) && defined(__arm__) && (!defined(__thumb__) || \ - defined(__THUMB_INTERWORK__)) +#if !defined(__aarch64__) && !defined(WOLFSSL_ARMASM_THUMB2) #ifndef WOLFSSL_ARMASM_INLINE #ifdef HAVE_CHACHA .text @@ -515,7 +514,7 @@ L_chacha_arm32_over_done: .size wc_chacha_use_over,.-wc_chacha_use_over #endif /* WOLFSSL_ARMASM_NO_NEON */ #endif /* HAVE_CHACHA */ -#endif /* !__aarch64__ && __arm__ && (!__thumb__ || __THUMB_INTERWORK__) */ +#endif /* !__aarch64__ && !WOLFSSL_ARMASM_THUMB2 */ #endif /* WOLFSSL_ARMASM */ #if defined(__linux__) && defined(__ELF__) diff --git a/wolfcrypt/src/port/arm/armv8-32-chacha-asm_c.c b/wolfcrypt/src/port/arm/armv8-32-chacha-asm_c.c index aebcff155..dfbee2da0 100644 --- a/wolfcrypt/src/port/arm/armv8-32-chacha-asm_c.c +++ b/wolfcrypt/src/port/arm/armv8-32-chacha-asm_c.c @@ -32,8 +32,7 @@ #include #ifdef WOLFSSL_ARMASM -#if !defined(__aarch64__) && defined(__arm__) && (!defined(__thumb__) || \ - defined(__THUMB_INTERWORK__)) +#if !defined(__aarch64__) && !defined(WOLFSSL_ARMASM_THUMB2) #include #ifdef HAVE_CONFIG_H #include @@ -566,7 +565,7 @@ void wc_chacha_use_over(byte* over_p, byte* output_p, const byte* input_p, #endif /* WOLFSSL_ARMASM_NO_NEON */ #endif /* HAVE_CHACHA */ -#endif /* !__aarch64__ && __arm__ && (!__thumb__ || __THUMB_INTERWORK__) */ +#endif /* !__aarch64__ && !WOLFSSL_ARMASM_THUMB2 */ #endif /* WOLFSSL_ARMASM */ #endif /* WOLFSSL_ARMASM_INLINE */ diff --git a/wolfcrypt/src/port/arm/armv8-32-curve25519.S b/wolfcrypt/src/port/arm/armv8-32-curve25519.S index 1dea1e1d1..3a5d8382b 100644 --- a/wolfcrypt/src/port/arm/armv8-32-curve25519.S +++ b/wolfcrypt/src/port/arm/armv8-32-curve25519.S @@ -31,8 +31,7 @@ #include #ifdef WOLFSSL_ARMASM -#if !defined(__aarch64__) && defined(__arm__) && (!defined(__thumb__) || \ - defined(__THUMB_INTERWORK__)) +#if !defined(__aarch64__) && !defined(WOLFSSL_ARMASM_THUMB2) #ifndef WOLFSSL_ARMASM_INLINE #if defined(HAVE_CURVE25519) || defined(HAVE_ED25519) #if !defined(CURVE25519_SMALL) || !defined(ED25519_SMALL) @@ -9181,7 +9180,7 @@ sc_muladd: #endif /* !CURVE25519_SMALL || !ED25519_SMALL */ #endif /* HAVE_CURVE25519 || HAVE_ED25519 */ -#endif /* !__aarch64__ && __arm__ && (!__thumb__ || __THUMB_INTERWORK__) */ +#endif /* !__aarch64__ && !WOLFSSL_ARMASM_THUMB2 */ #endif /* WOLFSSL_ARMASM */ #if defined(__linux__) && defined(__ELF__) diff --git a/wolfcrypt/src/port/arm/armv8-32-curve25519_c.c b/wolfcrypt/src/port/arm/armv8-32-curve25519_c.c index 6871aaade..f627c5346 100644 --- a/wolfcrypt/src/port/arm/armv8-32-curve25519_c.c +++ b/wolfcrypt/src/port/arm/armv8-32-curve25519_c.c @@ -32,8 +32,7 @@ #include #ifdef WOLFSSL_ARMASM -#if !defined(__aarch64__) && defined(__arm__) && (!defined(__thumb__) || \ - defined(__THUMB_INTERWORK__)) +#if !defined(__aarch64__) && !defined(WOLFSSL_ARMASM_THUMB2) #include #ifdef HAVE_CONFIG_H #include @@ -9426,7 +9425,7 @@ void sc_muladd(byte* s_p, const byte* a_p, const byte* b_p, const byte* c_p) #endif /* !CURVE25519_SMALL || !ED25519_SMALL */ #endif /* HAVE_CURVE25519 || HAVE_ED25519 */ -#endif /* !__aarch64__ && __arm__ && (!__thumb__ || __THUMB_INTERWORK__) */ +#endif /* !__aarch64__ && !WOLFSSL_ARMASM_THUMB2 */ #endif /* WOLFSSL_ARMASM */ #endif /* WOLFSSL_ARMASM_INLINE */ diff --git a/wolfcrypt/src/port/arm/armv8-32-kyber-asm.S b/wolfcrypt/src/port/arm/armv8-32-kyber-asm.S index ec2f1352b..2a73781e2 100644 --- a/wolfcrypt/src/port/arm/armv8-32-kyber-asm.S +++ b/wolfcrypt/src/port/arm/armv8-32-kyber-asm.S @@ -31,8 +31,7 @@ #include #ifdef WOLFSSL_ARMASM -#if !defined(__aarch64__) && defined(__arm__) && (!defined(__thumb__) || \ - defined(__THUMB_INTERWORK__)) +#if !defined(__aarch64__) && !defined(WOLFSSL_ARMASM_THUMB2) #ifndef WOLFSSL_ARMASM_INLINE #ifdef WOLFSSL_WC_KYBER .text @@ -9434,7 +9433,7 @@ L_kyber_arm32_rej_uniform_done: pop {r4, r5, r6, r7, r8, pc} .size kyber_arm32_rej_uniform,.-kyber_arm32_rej_uniform #endif /* WOLFSSL_WC_KYBER */ -#endif /* !__aarch64__ && __arm__ && (!__thumb__ || __THUMB_INTERWORK__) */ +#endif /* !__aarch64__ && !WOLFSSL_ARMASM_THUMB2 */ #endif /* WOLFSSL_ARMASM */ #if defined(__linux__) && defined(__ELF__) diff --git a/wolfcrypt/src/port/arm/armv8-32-kyber-asm_c.c b/wolfcrypt/src/port/arm/armv8-32-kyber-asm_c.c index 4650b9bc8..95df90c50 100644 --- a/wolfcrypt/src/port/arm/armv8-32-kyber-asm_c.c +++ b/wolfcrypt/src/port/arm/armv8-32-kyber-asm_c.c @@ -32,8 +32,7 @@ #include #ifdef WOLFSSL_ARMASM -#if !defined(__aarch64__) && defined(__arm__) && (!defined(__thumb__) || \ - defined(__THUMB_INTERWORK__)) +#if !defined(__aarch64__) && !defined(WOLFSSL_ARMASM_THUMB2) #include #ifdef HAVE_CONFIG_H #include @@ -9229,7 +9228,7 @@ unsigned int kyber_arm32_rej_uniform(sword16* p_p, unsigned int len_p, } #endif /* WOLFSSL_WC_KYBER */ -#endif /* !__aarch64__ && __arm__ && (!__thumb__ || __THUMB_INTERWORK__) */ +#endif /* !__aarch64__ && !WOLFSSL_ARMASM_THUMB2 */ #endif /* WOLFSSL_ARMASM */ #endif /* WOLFSSL_ARMASM_INLINE */ diff --git a/wolfcrypt/src/port/arm/armv8-32-poly1305-asm.S b/wolfcrypt/src/port/arm/armv8-32-poly1305-asm.S index a7a1b9433..731836b9e 100644 --- a/wolfcrypt/src/port/arm/armv8-32-poly1305-asm.S +++ b/wolfcrypt/src/port/arm/armv8-32-poly1305-asm.S @@ -31,8 +31,7 @@ #include #ifdef WOLFSSL_ARMASM -#if !defined(__aarch64__) && defined(__arm__) && (!defined(__thumb__) || \ - defined(__THUMB_INTERWORK__)) +#if !defined(__aarch64__) && !defined(WOLFSSL_ARMASM_THUMB2) #ifndef WOLFSSL_ARMASM_INLINE #ifdef HAVE_POLY1305 .text @@ -349,7 +348,7 @@ poly1305_final: pop {r4, r5, r6, r7, r8, r9, pc} .size poly1305_final,.-poly1305_final #endif /* HAVE_POLY1305 */ -#endif /* !__aarch64__ && __arm__ && (!__thumb__ || __THUMB_INTERWORK__) */ +#endif /* !__aarch64__ && !WOLFSSL_ARMASM_THUMB2 */ #endif /* WOLFSSL_ARMASM */ #if defined(__linux__) && defined(__ELF__) diff --git a/wolfcrypt/src/port/arm/armv8-32-poly1305-asm_c.c b/wolfcrypt/src/port/arm/armv8-32-poly1305-asm_c.c index aaf596d4c..186bb5b3b 100644 --- a/wolfcrypt/src/port/arm/armv8-32-poly1305-asm_c.c +++ b/wolfcrypt/src/port/arm/armv8-32-poly1305-asm_c.c @@ -32,8 +32,7 @@ #include #ifdef WOLFSSL_ARMASM -#if !defined(__aarch64__) && defined(__arm__) && (!defined(__thumb__) || \ - defined(__THUMB_INTERWORK__)) +#if !defined(__aarch64__) && !defined(WOLFSSL_ARMASM_THUMB2) #include #ifdef HAVE_CONFIG_H #include @@ -385,7 +384,7 @@ void poly1305_final(Poly1305* ctx_p, byte* mac_p) } #endif /* HAVE_POLY1305 */ -#endif /* !__aarch64__ && __arm__ && (!__thumb__ || __THUMB_INTERWORK__) */ +#endif /* !__aarch64__ && !WOLFSSL_ARMASM_THUMB2 */ #endif /* WOLFSSL_ARMASM */ #endif /* WOLFSSL_ARMASM_INLINE */ diff --git a/wolfcrypt/src/port/arm/armv8-32-sha256-asm.S b/wolfcrypt/src/port/arm/armv8-32-sha256-asm.S index 62fc8eb1c..1a24afebf 100644 --- a/wolfcrypt/src/port/arm/armv8-32-sha256-asm.S +++ b/wolfcrypt/src/port/arm/armv8-32-sha256-asm.S @@ -31,8 +31,7 @@ #include #ifdef WOLFSSL_ARMASM -#if !defined(__aarch64__) && defined(__arm__) && (!defined(__thumb__) || \ - defined(__THUMB_INTERWORK__)) +#if !defined(__aarch64__) && !defined(WOLFSSL_ARMASM_THUMB2) #ifndef WOLFSSL_ARMASM_INLINE #ifndef NO_SHA256 #ifdef WOLFSSL_ARMASM_NO_NEON @@ -2867,7 +2866,7 @@ L_SHA256_transform_neon_len_start: .size Transform_Sha256_Len,.-Transform_Sha256_Len #endif /* WOLFSSL_ARMASM_NO_NEON */ #endif /* !NO_SHA256 */ -#endif /* !__aarch64__ && __arm__ && (!__thumb__ || __THUMB_INTERWORK__) */ +#endif /* !__aarch64__ && !WOLFSSL_ARMASM_THUMB2 */ #endif /* WOLFSSL_ARMASM */ #if defined(__linux__) && defined(__ELF__) diff --git a/wolfcrypt/src/port/arm/armv8-32-sha256-asm_c.c b/wolfcrypt/src/port/arm/armv8-32-sha256-asm_c.c index 05086af07..d85a28a81 100644 --- a/wolfcrypt/src/port/arm/armv8-32-sha256-asm_c.c +++ b/wolfcrypt/src/port/arm/armv8-32-sha256-asm_c.c @@ -32,8 +32,7 @@ #include #ifdef WOLFSSL_ARMASM -#if !defined(__aarch64__) && defined(__arm__) && (!defined(__thumb__) || \ - defined(__THUMB_INTERWORK__)) +#if !defined(__aarch64__) && !defined(WOLFSSL_ARMASM_THUMB2) #include #ifdef HAVE_CONFIG_H #include @@ -2808,7 +2807,7 @@ void Transform_Sha256_Len(wc_Sha256* sha256_p, const byte* data_p, word32 len_p) #endif /* WOLFSSL_ARMASM_NO_NEON */ #endif /* !NO_SHA256 */ -#endif /* !__aarch64__ && __arm__ && (!__thumb__ || __THUMB_INTERWORK__) */ +#endif /* !__aarch64__ && !WOLFSSL_ARMASM_THUMB2 */ #endif /* WOLFSSL_ARMASM */ #endif /* WOLFSSL_ARMASM_INLINE */ diff --git a/wolfcrypt/src/port/arm/armv8-32-sha3-asm.S b/wolfcrypt/src/port/arm/armv8-32-sha3-asm.S index 46a75cedc..0a966b769 100644 --- a/wolfcrypt/src/port/arm/armv8-32-sha3-asm.S +++ b/wolfcrypt/src/port/arm/armv8-32-sha3-asm.S @@ -31,8 +31,7 @@ #include #ifdef WOLFSSL_ARMASM -#if !defined(__aarch64__) && defined(__arm__) && (!defined(__thumb__) || \ - defined(__THUMB_INTERWORK__)) +#if !defined(__aarch64__) && !defined(WOLFSSL_ARMASM_THUMB2) #ifndef WOLFSSL_ARMASM_INLINE #ifdef WOLFSSL_SHA3 #ifndef WOLFSSL_ARMASM_NO_NEON @@ -2395,7 +2394,7 @@ L_sha3_arm32_begin: .size BlockSha3,.-BlockSha3 #endif /* WOLFSSL_ARMASM_NO_NEON */ #endif /* WOLFSSL_SHA3 */ -#endif /* !__aarch64__ && __arm__ && (!__thumb__ || __THUMB_INTERWORK__) */ +#endif /* !__aarch64__ && !WOLFSSL_ARMASM_THUMB2 */ #endif /* WOLFSSL_ARMASM */ #if defined(__linux__) && defined(__ELF__) diff --git a/wolfcrypt/src/port/arm/armv8-32-sha3-asm_c.c b/wolfcrypt/src/port/arm/armv8-32-sha3-asm_c.c index e9e227ec3..97be28562 100644 --- a/wolfcrypt/src/port/arm/armv8-32-sha3-asm_c.c +++ b/wolfcrypt/src/port/arm/armv8-32-sha3-asm_c.c @@ -32,8 +32,7 @@ #include #ifdef WOLFSSL_ARMASM -#if !defined(__aarch64__) && defined(__arm__) && (!defined(__thumb__) || \ - defined(__THUMB_INTERWORK__)) +#if !defined(__aarch64__) && !defined(WOLFSSL_ARMASM_THUMB2) #include #ifdef HAVE_CONFIG_H #include @@ -2353,7 +2352,7 @@ void BlockSha3(word64* state_p) #endif /* WOLFSSL_ARMASM_NO_NEON */ #endif /* WOLFSSL_SHA3 */ -#endif /* !__aarch64__ && __arm__ && (!__thumb__ || __THUMB_INTERWORK__) */ +#endif /* !__aarch64__ && !WOLFSSL_ARMASM_THUMB2 */ #endif /* WOLFSSL_ARMASM */ #endif /* WOLFSSL_ARMASM_INLINE */ diff --git a/wolfcrypt/src/port/arm/armv8-32-sha512-asm.S b/wolfcrypt/src/port/arm/armv8-32-sha512-asm.S index 3316e6006..ff26eaf3c 100644 --- a/wolfcrypt/src/port/arm/armv8-32-sha512-asm.S +++ b/wolfcrypt/src/port/arm/armv8-32-sha512-asm.S @@ -31,8 +31,7 @@ #include #ifdef WOLFSSL_ARMASM -#if !defined(__aarch64__) && defined(__arm__) && (!defined(__thumb__) || \ - defined(__THUMB_INTERWORK__)) +#if !defined(__aarch64__) && !defined(WOLFSSL_ARMASM_THUMB2) #ifndef WOLFSSL_ARMASM_INLINE #ifdef WOLFSSL_SHA512 #ifdef WOLFSSL_ARMASM_NO_NEON @@ -9368,7 +9367,7 @@ L_SHA512_transform_neon_len_start: .size Transform_Sha512_Len,.-Transform_Sha512_Len #endif /* !WOLFSSL_ARMASM_NO_NEON */ #endif /* WOLFSSL_SHA512 */ -#endif /* !__aarch64__ && __arm__ && (!__thumb__ || __THUMB_INTERWORK__) */ +#endif /* !__aarch64__ && !WOLFSSL_ARMASM_THUMB2 */ #endif /* WOLFSSL_ARMASM */ #if defined(__linux__) && defined(__ELF__) diff --git a/wolfcrypt/src/port/arm/armv8-32-sha512-asm_c.c b/wolfcrypt/src/port/arm/armv8-32-sha512-asm_c.c index 32506f64e..737fb0950 100644 --- a/wolfcrypt/src/port/arm/armv8-32-sha512-asm_c.c +++ b/wolfcrypt/src/port/arm/armv8-32-sha512-asm_c.c @@ -32,8 +32,7 @@ #include #ifdef WOLFSSL_ARMASM -#if !defined(__aarch64__) && defined(__arm__) && (!defined(__thumb__) || \ - defined(__THUMB_INTERWORK__)) +#if !defined(__aarch64__) && !defined(WOLFSSL_ARMASM_THUMB2) #include #ifdef HAVE_CONFIG_H #include @@ -9165,7 +9164,7 @@ void Transform_Sha512_Len(wc_Sha512* sha512_p, const byte* data_p, word32 len_p) #endif /* !WOLFSSL_ARMASM_NO_NEON */ #endif /* WOLFSSL_SHA512 */ -#endif /* !__aarch64__ && __arm__ && (!__thumb__ || __THUMB_INTERWORK__) */ +#endif /* !__aarch64__ && !WOLFSSL_ARMASM_THUMB2 */ #endif /* WOLFSSL_ARMASM */ #endif /* WOLFSSL_ARMASM_INLINE */ diff --git a/wolfcrypt/src/port/arm/armv8-poly1305.c b/wolfcrypt/src/port/arm/armv8-poly1305.c index 9527bbd9d..a258f3607 100644 --- a/wolfcrypt/src/port/arm/armv8-poly1305.c +++ b/wolfcrypt/src/port/arm/armv8-poly1305.c @@ -1120,7 +1120,7 @@ int wc_Poly1305Final(Poly1305* ctx, byte* mac) } #else -#ifdef __thumb__ +#ifdef WOLFSSL_ARMASM_THUMB2 /* Process 16 bytes of message at a time. * * @param [in] ctx Poly1305 context. @@ -1226,7 +1226,7 @@ int wc_Poly1305Final(Poly1305* ctx, byte* mac) for (; i < POLY1305_BLOCK_SIZE; i++) { ctx->buffer[i] = 0; } - #ifdef __thumb__ + #ifdef WOLFSSL_ARMASM_THUMB2 poly1305_blocks_thumb2_16(ctx, ctx->buffer, POLY1305_BLOCK_SIZE, 0); #else diff --git a/wolfcrypt/src/port/arm/thumb2-aes-asm.S b/wolfcrypt/src/port/arm/thumb2-aes-asm.S index 34f860884..362a0ab80 100644 --- a/wolfcrypt/src/port/arm/thumb2-aes-asm.S +++ b/wolfcrypt/src/port/arm/thumb2-aes-asm.S @@ -30,7 +30,7 @@ #include #ifdef WOLFSSL_ARMASM -#if !defined(__aarch64__) && defined(__thumb__) +#ifdef WOLFSSL_ARMASM_THUMB2 #ifndef WOLFSSL_ARMASM_INLINE .thumb .syntax unified @@ -3360,7 +3360,7 @@ L_AES_GCM_encrypt_end: .size AES_GCM_encrypt,.-AES_GCM_encrypt #endif /* HAVE_AESGCM */ #endif /* !NO_AES */ -#endif /* !__aarch64__ && __thumb__ */ +#endif /* WOLFSSL_ARMASM_THUMB2 */ #endif /* WOLFSSL_ARMASM */ #if defined(__linux__) && defined(__ELF__) diff --git a/wolfcrypt/src/port/arm/thumb2-aes-asm_c.c b/wolfcrypt/src/port/arm/thumb2-aes-asm_c.c index ddf9d1141..e590ad8a8 100644 --- a/wolfcrypt/src/port/arm/thumb2-aes-asm_c.c +++ b/wolfcrypt/src/port/arm/thumb2-aes-asm_c.c @@ -31,7 +31,7 @@ #include #ifdef WOLFSSL_ARMASM -#if !defined(__aarch64__) && defined(__thumb__) +#ifdef WOLFSSL_ARMASM_THUMB2 #ifdef WOLFSSL_ARMASM_INLINE #ifdef __IAR_SYSTEMS_ICC__ @@ -3347,6 +3347,6 @@ void AES_GCM_encrypt(const unsigned char* in, unsigned char* out, unsigned long #endif /* HAVE_AESGCM */ #endif /* !NO_AES */ -#endif /* !__aarch64__ && __thumb__ */ +#endif /* WOLFSSL_ARMASM_THUMB2 */ #endif /* WOLFSSL_ARMASM */ #endif /* WOLFSSL_ARMASM_INLINE */ diff --git a/wolfcrypt/src/port/arm/thumb2-chacha-asm.S b/wolfcrypt/src/port/arm/thumb2-chacha-asm.S index 4c3c2e7e7..b26d8079b 100644 --- a/wolfcrypt/src/port/arm/thumb2-chacha-asm.S +++ b/wolfcrypt/src/port/arm/thumb2-chacha-asm.S @@ -30,7 +30,7 @@ #include #ifdef WOLFSSL_ARMASM -#if !defined(__aarch64__) && defined(__thumb__) +#ifdef WOLFSSL_ARMASM_THUMB2 #ifndef WOLFSSL_ARMASM_INLINE .thumb .syntax unified @@ -566,7 +566,7 @@ L_chacha_thumb2_over_done: /* Cycle Count = 108 */ .size wc_chacha_use_over,.-wc_chacha_use_over #endif /* HAVE_CHACHA */ -#endif /* !__aarch64__ && __thumb__ */ +#endif /* WOLFSSL_ARMASM_THUMB2 */ #endif /* WOLFSSL_ARMASM */ #if defined(__linux__) && defined(__ELF__) diff --git a/wolfcrypt/src/port/arm/thumb2-chacha-asm_c.c b/wolfcrypt/src/port/arm/thumb2-chacha-asm_c.c index 0dcdc4e3e..9ae0e23c0 100644 --- a/wolfcrypt/src/port/arm/thumb2-chacha-asm_c.c +++ b/wolfcrypt/src/port/arm/thumb2-chacha-asm_c.c @@ -31,7 +31,7 @@ #include #ifdef WOLFSSL_ARMASM -#if !defined(__aarch64__) && defined(__thumb__) +#ifdef WOLFSSL_ARMASM_THUMB2 #ifdef WOLFSSL_ARMASM_INLINE #ifdef __IAR_SYSTEMS_ICC__ @@ -726,6 +726,6 @@ void wc_chacha_use_over(byte* over, byte* output, const byte* input, word32 len) } #endif /* HAVE_CHACHA */ -#endif /* !__aarch64__ && __thumb__ */ +#endif /* WOLFSSL_ARMASM_THUMB2 */ #endif /* WOLFSSL_ARMASM */ #endif /* WOLFSSL_ARMASM_INLINE */ diff --git a/wolfcrypt/src/port/arm/thumb2-chacha.c b/wolfcrypt/src/port/arm/thumb2-chacha.c index a189ccddd..041a25e03 100644 --- a/wolfcrypt/src/port/arm/thumb2-chacha.c +++ b/wolfcrypt/src/port/arm/thumb2-chacha.c @@ -26,7 +26,7 @@ #include -#if defined(WOLFSSL_ARMASM) && defined(__thumb__) +#if defined(WOLFSSL_ARMASM) && defined(WOLFSSL_ARMASM_THUMB2) #ifdef HAVE_CHACHA #include diff --git a/wolfcrypt/src/port/arm/thumb2-curve25519.S b/wolfcrypt/src/port/arm/thumb2-curve25519.S index 239203e48..298e9add7 100644 --- a/wolfcrypt/src/port/arm/thumb2-curve25519.S +++ b/wolfcrypt/src/port/arm/thumb2-curve25519.S @@ -30,7 +30,7 @@ #include #ifdef WOLFSSL_ARMASM -#if !defined(__aarch64__) && defined(__thumb__) +#ifdef WOLFSSL_ARMASM_THUMB2 #ifndef WOLFSSL_ARMASM_INLINE .thumb .syntax unified @@ -6476,7 +6476,7 @@ sc_muladd: #endif /* !CURVE25519_SMALL || !ED25519_SMALL */ #endif /* HAVE_CURVE25519 || HAVE_ED25519 */ -#endif /* !__aarch64__ && __thumb__ */ +#endif /* WOLFSSL_ARMASM_THUMB2 */ #endif /* WOLFSSL_ARMASM */ #if defined(__linux__) && defined(__ELF__) diff --git a/wolfcrypt/src/port/arm/thumb2-curve25519_c.c b/wolfcrypt/src/port/arm/thumb2-curve25519_c.c index d7ca98a6c..df8273840 100644 --- a/wolfcrypt/src/port/arm/thumb2-curve25519_c.c +++ b/wolfcrypt/src/port/arm/thumb2-curve25519_c.c @@ -31,7 +31,7 @@ #include #ifdef WOLFSSL_ARMASM -#if !defined(__aarch64__) && defined(__thumb__) +#ifdef WOLFSSL_ARMASM_THUMB2 #ifdef WOLFSSL_ARMASM_INLINE #ifdef __IAR_SYSTEMS_ICC__ @@ -7105,6 +7105,6 @@ void sc_muladd(byte* s, const byte* a, const byte* b, const byte* c) #endif /* !CURVE25519_SMALL || !ED25519_SMALL */ #endif /* HAVE_CURVE25519 || HAVE_ED25519 */ -#endif /* !__aarch64__ && __thumb__ */ +#endif /* WOLFSSL_ARMASM_THUMB2 */ #endif /* WOLFSSL_ARMASM */ #endif /* WOLFSSL_ARMASM_INLINE */ diff --git a/wolfcrypt/src/port/arm/thumb2-kyber-asm.S b/wolfcrypt/src/port/arm/thumb2-kyber-asm.S index 93e0a53e9..e3097c321 100644 --- a/wolfcrypt/src/port/arm/thumb2-kyber-asm.S +++ b/wolfcrypt/src/port/arm/thumb2-kyber-asm.S @@ -30,7 +30,7 @@ #include #ifdef WOLFSSL_ARMASM -#if !defined(__aarch64__) && defined(__thumb__) +#ifdef WOLFSSL_ARMASM_THUMB2 #ifndef WOLFSSL_ARMASM_INLINE .thumb .syntax unified @@ -3894,7 +3894,7 @@ L_kyber_thumb2_rej_uniform_done: /* Cycle Count = 225 */ .size kyber_thumb2_rej_uniform,.-kyber_thumb2_rej_uniform #endif /* WOLFSSL_WC_KYBER */ -#endif /* !__aarch64__ && __thumb__ */ +#endif /* WOLFSSL_ARMASM_THUMB2 */ #endif /* WOLFSSL_ARMASM */ #if defined(__linux__) && defined(__ELF__) diff --git a/wolfcrypt/src/port/arm/thumb2-kyber-asm_c.c b/wolfcrypt/src/port/arm/thumb2-kyber-asm_c.c index 5c0895779..2c0147baf 100644 --- a/wolfcrypt/src/port/arm/thumb2-kyber-asm_c.c +++ b/wolfcrypt/src/port/arm/thumb2-kyber-asm_c.c @@ -31,7 +31,7 @@ #include #ifdef WOLFSSL_ARMASM -#if !defined(__aarch64__) && defined(__thumb__) +#ifdef WOLFSSL_ARMASM_THUMB2 #ifdef WOLFSSL_ARMASM_INLINE #ifdef __IAR_SYSTEMS_ICC__ @@ -3846,6 +3846,6 @@ unsigned int kyber_thumb2_rej_uniform(sword16* p, unsigned int len, const byte* } #endif /* WOLFSSL_WC_KYBER */ -#endif /* !__aarch64__ && __thumb__ */ +#endif /* WOLFSSL_ARMASM_THUMB2 */ #endif /* WOLFSSL_ARMASM */ #endif /* WOLFSSL_ARMASM_INLINE */ diff --git a/wolfcrypt/src/port/arm/thumb2-poly1305-asm.S b/wolfcrypt/src/port/arm/thumb2-poly1305-asm.S index c1aec82bf..42dc8f061 100644 --- a/wolfcrypt/src/port/arm/thumb2-poly1305-asm.S +++ b/wolfcrypt/src/port/arm/thumb2-poly1305-asm.S @@ -30,7 +30,7 @@ #include #ifdef WOLFSSL_ARMASM -#if !defined(__aarch64__) && defined(__thumb__) +#ifdef WOLFSSL_ARMASM_THUMB2 #ifndef WOLFSSL_ARMASM_INLINE .thumb .syntax unified @@ -360,7 +360,7 @@ poly1305_final: /* Cycle Count = 82 */ .size poly1305_final,.-poly1305_final #endif /* HAVE_POLY1305 */ -#endif /* !__aarch64__ && __thumb__ */ +#endif /* WOLFSSL_ARMASM_THUMB2 */ #endif /* WOLFSSL_ARMASM */ #if defined(__linux__) && defined(__ELF__) diff --git a/wolfcrypt/src/port/arm/thumb2-poly1305-asm_c.c b/wolfcrypt/src/port/arm/thumb2-poly1305-asm_c.c index acf82c4a8..1862a8663 100644 --- a/wolfcrypt/src/port/arm/thumb2-poly1305-asm_c.c +++ b/wolfcrypt/src/port/arm/thumb2-poly1305-asm_c.c @@ -31,7 +31,7 @@ #include #ifdef WOLFSSL_ARMASM -#if !defined(__aarch64__) && defined(__thumb__) +#ifdef WOLFSSL_ARMASM_THUMB2 #ifdef WOLFSSL_ARMASM_INLINE #ifdef __IAR_SYSTEMS_ICC__ @@ -417,6 +417,6 @@ void poly1305_final(Poly1305* ctx, byte* mac) } #endif /* HAVE_POLY1305 */ -#endif /* !__aarch64__ && __thumb__ */ +#endif /* WOLFSSL_ARMASM_THUMB2 */ #endif /* WOLFSSL_ARMASM */ #endif /* WOLFSSL_ARMASM_INLINE */ diff --git a/wolfcrypt/src/port/arm/thumb2-poly1305.c b/wolfcrypt/src/port/arm/thumb2-poly1305.c index 0091a3283..2b262c560 100644 --- a/wolfcrypt/src/port/arm/thumb2-poly1305.c +++ b/wolfcrypt/src/port/arm/thumb2-poly1305.c @@ -27,7 +27,7 @@ #include #ifdef WOLFSSL_ARMASM -#ifdef __thumb__ +#ifdef WOLFSSL_ARMASM_THUMB2 #ifdef HAVE_POLY1305 #include @@ -138,5 +138,5 @@ int wc_Poly1305Final(Poly1305* ctx, byte* mac) } #endif /* HAVE_POLY1305 */ -#endif /* __aarch64__ */ +#endif /* WOLFSSL_ARMASM_THUMB2 */ #endif /* WOLFSSL_ARMASM */ diff --git a/wolfcrypt/src/port/arm/thumb2-sha256-asm.S b/wolfcrypt/src/port/arm/thumb2-sha256-asm.S index 4809afbc7..d004d6b67 100644 --- a/wolfcrypt/src/port/arm/thumb2-sha256-asm.S +++ b/wolfcrypt/src/port/arm/thumb2-sha256-asm.S @@ -30,7 +30,7 @@ #include #ifdef WOLFSSL_ARMASM -#if !defined(__aarch64__) && defined(__thumb__) +#ifdef WOLFSSL_ARMASM_THUMB2 #ifndef WOLFSSL_ARMASM_INLINE .thumb .syntax unified @@ -1481,7 +1481,7 @@ L_SHA256_transform_len_start: .size Transform_Sha256_Len,.-Transform_Sha256_Len #endif /* WOLFSSL_ARMASM_NO_NEON */ #endif /* !NO_SHA256 */ -#endif /* !__aarch64__ && __thumb__ */ +#endif /* WOLFSSL_ARMASM_THUMB2 */ #endif /* WOLFSSL_ARMASM */ #if defined(__linux__) && defined(__ELF__) diff --git a/wolfcrypt/src/port/arm/thumb2-sha256-asm_c.c b/wolfcrypt/src/port/arm/thumb2-sha256-asm_c.c index 903b58e3d..cdf8b4cc1 100644 --- a/wolfcrypt/src/port/arm/thumb2-sha256-asm_c.c +++ b/wolfcrypt/src/port/arm/thumb2-sha256-asm_c.c @@ -31,7 +31,7 @@ #include #ifdef WOLFSSL_ARMASM -#if !defined(__aarch64__) && defined(__thumb__) +#ifdef WOLFSSL_ARMASM_THUMB2 #ifdef WOLFSSL_ARMASM_INLINE #ifdef __IAR_SYSTEMS_ICC__ @@ -1475,6 +1475,6 @@ void Transform_Sha256_Len(wc_Sha256* sha256, const byte* data, word32 len) #endif /* WOLFSSL_ARMASM_NO_NEON */ #endif /* !NO_SHA256 */ -#endif /* !__aarch64__ && __thumb__ */ +#endif /* WOLFSSL_ARMASM_THUMB2 */ #endif /* WOLFSSL_ARMASM */ #endif /* WOLFSSL_ARMASM_INLINE */ diff --git a/wolfcrypt/src/port/arm/thumb2-sha3-asm.S b/wolfcrypt/src/port/arm/thumb2-sha3-asm.S index de12f723c..a04b5adb8 100644 --- a/wolfcrypt/src/port/arm/thumb2-sha3-asm.S +++ b/wolfcrypt/src/port/arm/thumb2-sha3-asm.S @@ -30,7 +30,7 @@ #include #ifdef WOLFSSL_ARMASM -#if !defined(__aarch64__) && defined(__thumb__) +#ifdef WOLFSSL_ARMASM_THUMB2 #ifndef WOLFSSL_ARMASM_INLINE .thumb .syntax unified @@ -1167,7 +1167,7 @@ L_sha3_thumb2_begin: /* Cycle Count = 1505 */ .size BlockSha3,.-BlockSha3 #endif /* WOLFSSL_SHA3 */ -#endif /* !__aarch64__ && __thumb__ */ +#endif /* WOLFSSL_ARMASM_THUMB2 */ #endif /* WOLFSSL_ARMASM */ #if defined(__linux__) && defined(__ELF__) diff --git a/wolfcrypt/src/port/arm/thumb2-sha3-asm_c.c b/wolfcrypt/src/port/arm/thumb2-sha3-asm_c.c index a22b9acc5..f9459f3f3 100644 --- a/wolfcrypt/src/port/arm/thumb2-sha3-asm_c.c +++ b/wolfcrypt/src/port/arm/thumb2-sha3-asm_c.c @@ -31,7 +31,7 @@ #include #ifdef WOLFSSL_ARMASM -#if !defined(__aarch64__) && defined(__thumb__) +#ifdef WOLFSSL_ARMASM_THUMB2 #ifdef WOLFSSL_ARMASM_INLINE #ifdef __IAR_SYSTEMS_ICC__ @@ -1163,6 +1163,6 @@ void BlockSha3(word64* state) } #endif /* WOLFSSL_SHA3 */ -#endif /* !__aarch64__ && __thumb__ */ +#endif /* WOLFSSL_ARMASM_THUMB2 */ #endif /* WOLFSSL_ARMASM */ #endif /* WOLFSSL_ARMASM_INLINE */ diff --git a/wolfcrypt/src/port/arm/thumb2-sha512-asm.S b/wolfcrypt/src/port/arm/thumb2-sha512-asm.S index 9170e9457..b3c355411 100644 --- a/wolfcrypt/src/port/arm/thumb2-sha512-asm.S +++ b/wolfcrypt/src/port/arm/thumb2-sha512-asm.S @@ -30,7 +30,7 @@ #include #ifdef WOLFSSL_ARMASM -#if !defined(__aarch64__) && defined(__thumb__) +#ifdef WOLFSSL_ARMASM_THUMB2 #ifndef WOLFSSL_ARMASM_INLINE .thumb .syntax unified @@ -3668,7 +3668,7 @@ L_SHA512_transform_len_start: .size Transform_Sha512_Len,.-Transform_Sha512_Len #endif /* WOLFSSL_ARMASM_NO_NEON */ #endif /* WOLFSSL_SHA512 */ -#endif /* !__aarch64__ && __thumb__ */ +#endif /* WOLFSSL_ARMASM_THUMB2 */ #endif /* WOLFSSL_ARMASM */ #if defined(__linux__) && defined(__ELF__) diff --git a/wolfcrypt/src/port/arm/thumb2-sha512-asm_c.c b/wolfcrypt/src/port/arm/thumb2-sha512-asm_c.c index bd998025a..0fc857cc0 100644 --- a/wolfcrypt/src/port/arm/thumb2-sha512-asm_c.c +++ b/wolfcrypt/src/port/arm/thumb2-sha512-asm_c.c @@ -31,7 +31,7 @@ #include #ifdef WOLFSSL_ARMASM -#if !defined(__aarch64__) && defined(__thumb__) +#ifdef WOLFSSL_ARMASM_THUMB2 #ifdef WOLFSSL_ARMASM_INLINE #ifdef __IAR_SYSTEMS_ICC__ @@ -3590,6 +3590,6 @@ void Transform_Sha512_Len(wc_Sha512* sha512, const byte* data, word32 len) #endif /* WOLFSSL_ARMASM_NO_NEON */ #endif /* WOLFSSL_SHA512 */ -#endif /* !__aarch64__ && __thumb__ */ +#endif /* WOLFSSL_ARMASM_THUMB2 */ #endif /* WOLFSSL_ARMASM */ #endif /* WOLFSSL_ARMASM_INLINE */ diff --git a/wolfcrypt/src/wc_kyber_poly.c b/wolfcrypt/src/wc_kyber_poly.c index ef38d8cd6..52c8af356 100644 --- a/wolfcrypt/src/wc_kyber_poly.c +++ b/wolfcrypt/src/wc_kyber_poly.c @@ -3371,7 +3371,7 @@ static KYBER_NOINLINE void kyber_csubq_c(sword16* p) #define kyber_csubq_c kyber_csubq_neon -#elif defined(__thumb__) +#elif defined(WOLFSSL_ARMASM_THUMB2) #define kyber_csubq_c kyber_thumb2_csubq diff --git a/wolfssl/wolfcrypt/chacha.h b/wolfssl/wolfcrypt/chacha.h index db4e5dd66..1c6ae1745 100644 --- a/wolfssl/wolfcrypt/chacha.h +++ b/wolfssl/wolfcrypt/chacha.h @@ -114,7 +114,7 @@ void wc_chacha_setiv(word32* x, const byte* iv, word32 counter); void wc_chacha_setkey(word32* x, const byte* key, word32 keySz); #endif -#if defined(WOLFSSL_ARMASM_NO_NEON) || defined(__thumb__) +#if defined(WOLFSSL_ARMASM_NO_NEON) || defined(WOLFSSL_ARMASM_THUMB2) void wc_chacha_use_over(byte* over, byte* output, const byte* input, word32 len); void wc_chacha_crypt_bytes(ChaCha* ctx, byte* c, const byte* m, word32 len); diff --git a/wolfssl/wolfcrypt/poly1305.h b/wolfssl/wolfcrypt/poly1305.h index 70ed1efa8..d4db48762 100644 --- a/wolfssl/wolfcrypt/poly1305.h +++ b/wolfssl/wolfcrypt/poly1305.h @@ -156,7 +156,7 @@ void poly1305_blocks_aarch64(Poly1305* ctx, const unsigned char *m, size_t bytes); void poly1305_block_aarch64(Poly1305* ctx, const unsigned char *m); #else -#if defined(__thumb__) +#if defined(WOLFSSL_ARMASM_THUMB2) #define poly1305_blocks poly1305_blocks_thumb2 #define poly1305_block poly1305_block_thumb2 diff --git a/wolfssl/wolfcrypt/wc_kyber.h b/wolfssl/wolfcrypt/wc_kyber.h index 71d3fe73b..79a03cbd0 100644 --- a/wolfssl/wolfcrypt/wc_kyber.h +++ b/wolfssl/wolfcrypt/wc_kyber.h @@ -310,7 +310,7 @@ WOLFSSL_LOCAL int kyber_cmp_neon(const byte* a, const byte* b, int sz); WOLFSSL_LOCAL void kyber_csubq_neon(sword16* p); WOLFSSL_LOCAL void kyber_from_msg_neon(sword16* p, const byte* msg); WOLFSSL_LOCAL void kyber_to_msg_neon(byte* msg, sword16* p); -#elif defined(__thumb__) && defined(WOLFSSL_ARMASM) +#elif defined(WOLFSSL_ARMASM_THUMB2) && defined(WOLFSSL_ARMASM) #define kyber_ntt kyber_thumb2_ntt #define kyber_invntt kyber_thumb2_invntt #define kyber_basemul_mont kyber_thumb2_basemul_mont