Add macro checks around new .c/.S files to allow wildcard include of source files (such as in Eclipse).

This commit is contained in:
David Garske
2019-07-18 06:49:36 -07:00
parent 7db3f8e2c6
commit 6fd623248e
13 changed files with 52 additions and 8 deletions

View File

@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#if defined(USE_INTEL_SPEEDUP) && (defined(HAVE_ED25519) || defined(HAVE_CURVE25519))
#ifndef HAVE_INTEL_AVX1
#define HAVE_INTEL_AVX1
#endif /* HAVE_INTEL_AVX1 */
@ -16175,3 +16177,5 @@ _fe_ge_sub_avx2:
.size fe_ge_sub_avx2,.-fe_ge_sub_avx2
#endif /* __APPLE__ */
#endif /* HAVE_INTEL_AVX2 */
#endif /* USE_INTEL_SPEEDUP && (HAVE_ED25519 || HAVE_CURVE25519) */

View File

@ -23,6 +23,8 @@
* cd ../scripts
* ruby ./x25519/x25519.rb arm32 ../wolfssl/wolfcrypt/src/port/arm/armv8-32-curve25519.S
*/
#ifdef WOLFSSL_ARMASM
#ifndef __aarch64__
.text
.align 2
@ -6007,3 +6009,4 @@ 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 */

View File

@ -23,13 +23,17 @@
* cd ../scripts
* ruby ./x25519/x25519.rb arm32 ../wolfssl/wolfcrypt/src/port/arm/armv8-32-curve25519.c
*/
#ifndef __aarch64__
#include <stdint.h>
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolfssl/wolfcrypt/settings.h>
#ifdef WOLFSSL_ARMASM
#include <wolfssl/wolfcrypt/fe_operations.h>
#include <stdint.h>
@ -5573,4 +5577,5 @@ void fe_ge_sub(fe rx, fe ry, fe rz, fe rt, const fe px, const fe py, const fe pz
(void)qyminusx;
}
#endif /* WOLFSSL_ARMASM */
#endif /* !__aarch64__ */

View File

@ -23,6 +23,8 @@
* cd ../scripts
* ruby ./sha2/sha512.rb arm32 ../wolfssl/wolfcrypt/src/port/arm/armv8-32-sha512-asm.S
*/
#ifdef WOLFSSL_ARMASM
#ifndef __aarch64__
#ifdef WOLFSSL_ARMASM_NO_NEON
.text
@ -5330,3 +5332,4 @@ L_sha512_len_neon_start:
.size Transform_Sha512_Len,.-Transform_Sha512_Len
#endif /* !WOLFSSL_ARMASM_NO_NEON */
#endif /* !__aarch64__ */
#endif /* WOLFSSL_ARMASM */

View File

@ -23,8 +23,17 @@
* cd ../scripts
* ruby ./sha2/sha512.rb arm32 ../wolfssl/wolfcrypt/src/port/arm/armv8-32-sha512-asm.c
*/
#ifndef __aarch64__
#include <stdint.h>
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolfssl/wolfcrypt/settings.h>
#ifdef WOLFSSL_ARMASM
#include <wolfssl/wolfcrypt/sha512.h>
#ifdef WOLFSSL_ARMASM_NO_NEON
@ -4770,4 +4779,5 @@ void Transform_Sha512_Len(wc_Sha512* sha512, const byte* data, word32 len)
}
#endif /* !WOLFSSL_ARMASM_NO_NEON */
#endif /* WOLFSSL_ARMASM */
#endif /* !__aarch64__ */

View File

@ -4650,5 +4650,4 @@ int wc_AesGcmSetKey(Aes* aes, const byte* key, word32 len)
}
#endif /* HAVE_AES_DECRYPT */
#endif /* WOLFSSL_AES_DIRECT */
#endif /* NO_AES */
#endif /* !NO_AES && WOLFSSL_ARMASM */

View File

@ -24,14 +24,13 @@
* https://cryptojedi.org/papers/neoncrypto-20120320.pdf
*/
#ifdef WOLFSSL_ARMASM
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolfssl/wolfcrypt/settings.h>
#ifdef WOLFSSL_ARMASM
#ifdef HAVE_CHACHA
#include <wolfssl/wolfcrypt/chacha.h>
@ -2854,5 +2853,4 @@ int wc_Chacha_Process(ChaCha* ctx, byte* output, const byte* input,
}
#endif /* HAVE_CHACHA*/
#endif /* WOLFSSL_ARMASM */

View File

@ -23,6 +23,8 @@
* cd ../scripts
* ruby ./x25519/x25519.rb arm64 ../wolfssl/wolfcrypt/src/port/arm/armv8-curve25519.S
*/
#ifdef WOLFSSL_ARMASM
#ifdef __aarch64__
.text
.align 2
@ -6693,3 +6695,4 @@ fe_ge_sub:
ret
.size fe_ge_sub,.-fe_ge_sub
#endif /* __aarch64__ */
#endif /* WOLFSSL_ARMASM */

View File

@ -24,12 +24,15 @@
* ruby ./x25519/x25519.rb arm64 ../wolfssl/wolfcrypt/src/port/arm/armv8-curve25519.c
*/
#ifdef __aarch64__
#include <stdint.h>
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolfssl/wolfcrypt/settings.h>
#ifdef WOLFSSL_ARMASM
#include <wolfssl/wolfcrypt/fe_operations.h>
#include <stdint.h>
@ -6715,4 +6718,5 @@ void fe_ge_sub(fe rx, fe ry, fe rz, fe rt, const fe px, const fe py, const fe pz
(void)qyminusx;
}
#endif /* WOLFSSL_ARMASM */
#endif /* __aarch64__ */

View File

@ -25,7 +25,7 @@
*/
#if defined(WOLFSSL_ARMASM) && defined(__aarch64__)
#ifdef __aarch64__
#ifdef HAVE_CONFIG_H
#include <config.h>
@ -33,6 +33,7 @@
#include <wolfssl/wolfcrypt/settings.h>
#ifdef WOLFSSL_ARMASM
#ifdef HAVE_POLY1305
#include <wolfssl/wolfcrypt/poly1305.h>
#include <wolfssl/wolfcrypt/error-crypt.h>
@ -1166,4 +1167,4 @@ int wc_Poly1305Final(Poly1305* ctx, byte* mac)
#endif /* HAVE_POLY1305 */
#endif /* WOLFSSL_ARMASM */
#endif /* __aarch64__ */

View File

@ -23,6 +23,8 @@
* cd ../scripts
* ruby ./sha2/sha512.rb arm64 ../wolfssl/wolfcrypt/src/port/arm/armv8-sha512-asm.S
*/
#ifdef WOLFSSL_ARMASM
#ifdef __aarch64__
.text
.section .rodata
@ -1044,3 +1046,4 @@ L_sha512_len_neon_start:
ret
.size Transform_Sha512_Len,.-Transform_Sha512_Len
#endif /* __aarch64__ */
#endif /* WOLFSSL_ARMASM */

View File

@ -24,7 +24,16 @@
* ruby ./sha2/sha512.rb arm64 ../wolfssl/wolfcrypt/src/port/arm/armv8-sha512-asm.c
*/
#ifdef __aarch64__
#include <stdint.h>
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolfssl/wolfcrypt/settings.h>
#ifdef WOLFSSL_ARMASM
#include <wolfssl/wolfcrypt/sha512.h>
static const uint64_t L_SHA512_transform_neon_len_k[] = {
@ -1029,4 +1038,5 @@ void Transform_Sha512_Len(wc_Sha512* sha512, const byte* data, word32 len)
);
}
#endif /* WOLFSSL_ARMASM */
#endif /* __aarch64__ */

View File

@ -19,13 +19,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolfssl/wolfcrypt/settings.h>
#ifdef WOLFSSL_ARMASM
#if defined(WOLFSSL_SHA512) || defined(WOLFSSL_SHA384)
#include <wolfssl/wolfcrypt/sha512.h>
@ -706,3 +706,4 @@ int wc_Sha384GetFlags(wc_Sha384* sha384, word32* flags)
#endif /* WOLFSSL_SHA384 */
#endif /* WOLFSSL_SHA512 || WOLFSSL_SHA384 */
#endif /* WOLFSSL_ARMASM */