From 724a415d51875a6e0bca44ee377628a60195851f Mon Sep 17 00:00:00 2001 From: David Garske Date: Fri, 26 Mar 2021 13:28:15 -0700 Subject: [PATCH] Fix ARMv8 to not compile code if module is disabled --- wolfcrypt/src/port/arm/armv8-32-curve25519.S | 4 ++-- wolfcrypt/src/port/arm/armv8-32-curve25519.c | 4 ++-- wolfcrypt/src/port/arm/armv8-32-sha512-asm.S | 4 ++-- wolfcrypt/src/port/arm/armv8-32-sha512-asm.c | 4 ++-- wolfcrypt/src/port/arm/armv8-curve25519.S | 4 ++-- wolfcrypt/src/port/arm/armv8-curve25519.c | 4 ++-- wolfcrypt/src/port/arm/armv8-sha512-asm.S | 4 ++-- wolfcrypt/src/port/arm/armv8-sha512-asm.c | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/wolfcrypt/src/port/arm/armv8-32-curve25519.S b/wolfcrypt/src/port/arm/armv8-32-curve25519.S index f52fc07ac..26fe61855 100644 --- a/wolfcrypt/src/port/arm/armv8-32-curve25519.S +++ b/wolfcrypt/src/port/arm/armv8-32-curve25519.S @@ -23,7 +23,7 @@ * cd ../scripts * ruby ./x25519/x25519.rb arm32 ../wolfssl/wolfcrypt/src/port/arm/armv8-32-curve25519.S */ -#ifdef WOLFSSL_ARMASM +#if defined(WOLFSSL_ARMASM) && defined(HAVE_CURVE25519) #ifndef __aarch64__ .text .align 2 @@ -6008,7 +6008,7 @@ fe_ge_sub: pop {r4, r5, r6, r7, r8, r9, r10, r11, pc} .size fe_ge_sub,.-fe_ge_sub #endif /* !__aarch64__ */ -#endif /* WOLFSSL_ARMASM */ +#endif /* WOLFSSL_ARMASM && HAVE_CURVE25519 */ #if defined(__linux__) && defined(__ELF__) .section .note.GNU-stack,"",%progbits diff --git a/wolfcrypt/src/port/arm/armv8-32-curve25519.c b/wolfcrypt/src/port/arm/armv8-32-curve25519.c index 607ad913e..ddc08f644 100644 --- a/wolfcrypt/src/port/arm/armv8-32-curve25519.c +++ b/wolfcrypt/src/port/arm/armv8-32-curve25519.c @@ -23,7 +23,7 @@ * cd ../scripts * ruby ./x25519/x25519.rb arm32 ../wolfssl/wolfcrypt/src/port/arm/armv8-32-curve25519.c */ -#ifdef WOLFSSL_ARMASM +#if defined(WOLFSSL_ARMASM) && defined(HAVE_CURVE25519) #ifndef __aarch64__ #include #ifdef HAVE_CONFIG_H @@ -5573,4 +5573,4 @@ void fe_ge_sub(fe rx, fe ry, fe rz, fe rt, const fe px, const fe py, const fe pz } #endif /* !__aarch64__ */ -#endif /* WOLFSSL_ARMASM */ +#endif /* WOLFSSL_ARMASM && HAVE_CURVE25519 */ diff --git a/wolfcrypt/src/port/arm/armv8-32-sha512-asm.S b/wolfcrypt/src/port/arm/armv8-32-sha512-asm.S index 23e67fa3d..c42cf63b1 100644 --- a/wolfcrypt/src/port/arm/armv8-32-sha512-asm.S +++ b/wolfcrypt/src/port/arm/armv8-32-sha512-asm.S @@ -23,7 +23,7 @@ * cd ../scripts * ruby ./sha2/sha512.rb arm32 ../wolfssl/wolfcrypt/src/port/arm/armv8-32-sha512-asm.S */ -#ifdef WOLFSSL_ARMASM +#if defined(WOLFSSL_ARMASM) && defined(WOLFSSL_SHA512) #ifndef __aarch64__ #ifdef WOLFSSL_ARMASM_NO_NEON .text @@ -5331,7 +5331,7 @@ L_sha512_len_neon_start: .size Transform_Sha512_Len,.-Transform_Sha512_Len #endif /* !WOLFSSL_ARMASM_NO_NEON */ #endif /* !__aarch64__ */ -#endif /* WOLFSSL_ARMASM */ +#endif /* WOLFSSL_ARMASM && WOLFSSL_SHA512 */ #if defined(__linux__) && defined(__ELF__) .section .note.GNU-stack,"",%progbits diff --git a/wolfcrypt/src/port/arm/armv8-32-sha512-asm.c b/wolfcrypt/src/port/arm/armv8-32-sha512-asm.c index a52cd75c6..53e5b9743 100644 --- a/wolfcrypt/src/port/arm/armv8-32-sha512-asm.c +++ b/wolfcrypt/src/port/arm/armv8-32-sha512-asm.c @@ -23,7 +23,7 @@ * cd ../scripts * ruby ./sha2/sha512.rb arm32 ../wolfssl/wolfcrypt/src/port/arm/armv8-32-sha512-asm.c */ -#ifdef WOLFSSL_ARMASM +#if defined(WOLFSSL_ARMASM) && defined(WOLFSSL_SHA512) #ifndef __aarch64__ #include #ifdef HAVE_CONFIG_H @@ -4776,4 +4776,4 @@ void Transform_Sha512_Len(wc_Sha512* sha512, const byte* data, word32 len) #endif /* !WOLFSSL_ARMASM_NO_NEON */ #endif /* !__aarch64__ */ -#endif /* WOLFSSL_ARMASM */ +#endif /* WOLFSSL_ARMASM && WOLFSSL_SHA512 */ diff --git a/wolfcrypt/src/port/arm/armv8-curve25519.S b/wolfcrypt/src/port/arm/armv8-curve25519.S index b05f0a23b..d07210a68 100644 --- a/wolfcrypt/src/port/arm/armv8-curve25519.S +++ b/wolfcrypt/src/port/arm/armv8-curve25519.S @@ -28,7 +28,7 @@ * cd ../scripts * ruby ./x25519/x25519.rb arm64 ../wolfssl/wolfcrypt/src/port/arm/armv8-curve25519.S */ -#ifdef WOLFSSL_ARMASM +#if defined(WOLFSSL_ARMASM) && defined(HAVE_CURVE25519) #ifdef __aarch64__ #ifndef __APPLE__ .text @@ -7472,7 +7472,7 @@ _fe_ge_sub: .size fe_ge_sub,.-fe_ge_sub #endif /* __APPLE__ */ #endif /* __aarch64__ */ -#endif /* WOLFSSL_ARMASM */ +#endif /* WOLFSSL_ARMASM && HAVE_CURVE25519 */ #if defined(__linux__) && defined(__ELF__) .section .note.GNU-stack,"",%progbits diff --git a/wolfcrypt/src/port/arm/armv8-curve25519.c b/wolfcrypt/src/port/arm/armv8-curve25519.c index 213512297..81352c705 100644 --- a/wolfcrypt/src/port/arm/armv8-curve25519.c +++ b/wolfcrypt/src/port/arm/armv8-curve25519.c @@ -28,7 +28,7 @@ * cd ../scripts * ruby ./x25519/x25519.rb arm64 ../wolfssl/wolfcrypt/src/port/arm/armv8-curve25519.c */ -#ifdef WOLFSSL_ARMASM +#if defined(WOLFSSL_ARMASM) && defined(HAVE_CURVE25519) #ifdef __aarch64__ #include @@ -7217,4 +7217,4 @@ void fe_ge_sub(fe rx, fe ry, fe rz, fe rt, const fe px, const fe py, const fe pz } #endif /* __aarch64__ */ -#endif /* WOLFSSL_ARMASM */ +#endif /* WOLFSSL_ARMASM && HAVE_CURVE25519 */ diff --git a/wolfcrypt/src/port/arm/armv8-sha512-asm.S b/wolfcrypt/src/port/arm/armv8-sha512-asm.S index 0236bb8a4..9b28a8231 100644 --- a/wolfcrypt/src/port/arm/armv8-sha512-asm.S +++ b/wolfcrypt/src/port/arm/armv8-sha512-asm.S @@ -28,7 +28,7 @@ * cd ../scripts * ruby ./sha2/sha512.rb arm64 ../wolfssl/wolfcrypt/src/port/arm/armv8-sha512-asm.S */ -#ifdef WOLFSSL_ARMASM +#if defined(WOLFSSL_ARMASM) && defined(WOLFSSL_SHA512) #ifdef __aarch64__ #ifndef __APPLE__ .text @@ -1093,7 +1093,7 @@ L_sha512_len_neon_start: .size Transform_Sha512_Len,.-Transform_Sha512_Len #endif /* __APPLE__ */ #endif /* __aarch64__ */ -#endif /* WOLFSSL_ARMASM */ +#endif /* WOLFSSL_ARMASM && WOLFSSL_SHA512 */ #if defined(__linux__) && defined(__ELF__) .section .note.GNU-stack,"",%progbits diff --git a/wolfcrypt/src/port/arm/armv8-sha512-asm.c b/wolfcrypt/src/port/arm/armv8-sha512-asm.c index 21679d21e..87e7496f0 100644 --- a/wolfcrypt/src/port/arm/armv8-sha512-asm.c +++ b/wolfcrypt/src/port/arm/armv8-sha512-asm.c @@ -28,7 +28,7 @@ * cd ../scripts * ruby ./sha2/sha512.rb arm64 ../wolfssl/wolfcrypt/src/port/arm/armv8-sha512-asm.c */ -#ifdef WOLFSSL_ARMASM +#if defined(WOLFSSL_ARMASM) && defined(WOLFSSL_SHA512) #ifdef __aarch64__ #include @@ -1050,4 +1050,4 @@ void Transform_Sha512_Len(wc_Sha512* sha512, const byte* data, word32 len) } #endif /* __aarch64__ */ -#endif /* WOLFSSL_ARMASM */ +#endif /* WOLFSSL_ARMASM && WOLFSSL_SHA512 */