From 567243d2578dd6e0f027edca043cbcf1dd60b0cb Mon Sep 17 00:00:00 2001 From: JacobBarthelmeh Date: Sun, 10 Dec 2023 05:47:47 -0800 Subject: [PATCH] touch up autoconf build with xilinx and sp macro guards --- configure.ac | 1 + src/include.am | 4 ++++ wolfcrypt/src/sp_int.c | 4 ++-- wolfssl/wolfcrypt/sp_int.h | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 0e2d07061..dc8d05163 100644 --- a/configure.ac +++ b/configure.ac @@ -9323,6 +9323,7 @@ AM_CONDITIONAL([BUILD_HPKE],[test "x$ENABLED_HPKE" = "xyes" || test "x$ENABLED_U AM_CONDITIONAL([BUILD_DTLS],[test "x$ENABLED_DTLS" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"]) AM_CONDITIONAL([BUILD_MAXQ10XX],[test "x$ENABLED_MAXQ10XX" = "xyes"]) AM_CONDITIONAL([BUILD_ARIA],[test "x$ENABLED_ARIA" = "xyes"]) +AM_CONDITIONAL([BUILD_XILINX],[test "x$ENABLED_XILINX" = "xyes"]) if test "$ENABLED_REPRODUCIBLE_BUILD" != "yes" && (test "$ax_enable_debug" = "yes" || diff --git a/src/include.am b/src/include.am index a69822fff..6c30e6427 100644 --- a/src/include.am +++ b/src/include.am @@ -900,6 +900,9 @@ endif endif !BUILD_CRYPTONLY +if BUILD_XILINX +src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/port/xilinx/xil-aesgcm.c +endif endif !BUILD_FIPS_RAND @@ -907,3 +910,4 @@ if BUILD_ARIA src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/port/aria/aria-crypt.c src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/port/aria/aria-cryptocb.c endif + diff --git a/wolfcrypt/src/sp_int.c b/wolfcrypt/src/sp_int.c index 94fc01c35..37a34d8e9 100644 --- a/wolfcrypt/src/sp_int.c +++ b/wolfcrypt/src/sp_int.c @@ -7031,7 +7031,7 @@ int sp_mod_d(const sp_int* a, sp_int_digit d, sp_int_digit* r) #if defined(HAVE_ECC) || !defined(NO_DSA) || defined(OPENSSL_EXTRA) || \ (!defined(NO_RSA) && !defined(WOLFSSL_RSA_VERIFY_ONLY) && \ - !defined(WOLFSSL_RSA_PUBLIC_ONLY)) + !defined(WOLFSSL_RSA_PUBLIC_ONLY)) || defined(WOLFSSL_SP_INVMOD) /* Divides a by 2 and stores in r: r = a >> 1 * * @param [in] a SP integer to divide. @@ -19254,7 +19254,7 @@ int sp_prime_is_prime_ex(const sp_int* a, int trials, int* result, WC_RNG* rng) } #endif /* WOLFSSL_SP_PRIME_GEN */ -#if !defined(NO_RSA) && defined(WOLFSSL_KEY_GEN) +#if !defined(NO_RSA) || defined(WOLFSSL_KEY_GEN) /* Calculates the Greatest Common Denominator (GCD) of a and b into r. * diff --git a/wolfssl/wolfcrypt/sp_int.h b/wolfssl/wolfcrypt/sp_int.h index e768d0cd5..cf7b8f289 100644 --- a/wolfssl/wolfcrypt/sp_int.h +++ b/wolfssl/wolfcrypt/sp_int.h @@ -1067,7 +1067,7 @@ MP_API int sp_rand_prime(sp_int* r, int len, WC_RNG* rng, void* heap); MP_API int sp_prime_is_prime(const sp_int* a, int t, int* result); MP_API int sp_prime_is_prime_ex(const sp_int* a, int t, int* result, WC_RNG* rng); -#if !defined(NO_RSA) && defined(WOLFSSL_KEY_GEN) +#if !defined(NO_RSA) || defined(WOLFSSL_KEY_GEN) MP_API int sp_gcd(const sp_int* a, const sp_int* b, sp_int* r); #endif #if !defined(NO_RSA) && defined(WOLFSSL_KEY_GEN) && \