From 7be3d1f18d1f9e5f1d734cd2980dbfcb9db90c34 Mon Sep 17 00:00:00 2001 From: Anthony Hu Date: Tue, 31 Mar 2026 12:48:12 -0400 Subject: [PATCH] Better macro gating --- tests/api/test_ed25519.c | 2 ++ tests/api/test_ed448.c | 2 ++ tests/api/test_mldsa.c | 2 ++ tests/api/test_mlkem.c | 2 ++ 4 files changed, 8 insertions(+) diff --git a/tests/api/test_ed25519.c b/tests/api/test_ed25519.c index 4b8ba1af63..34d39099d3 100644 --- a/tests/api/test_ed25519.c +++ b/tests/api/test_ed25519.c @@ -176,6 +176,7 @@ int test_wc_ed25519_sign_msg(void) int test_wc_ed25519_sign_msg_pubonly_fails(void) { EXPECT_DECLS; +#if !defined(HAVE_FIPS) || FIPS_VERSION3_GE(7,0,0) #if defined(HAVE_ED25519) && defined(HAVE_ED25519_SIGN) && \ defined(HAVE_ED25519_KEY_IMPORT) && defined(HAVE_ED25519_KEY_EXPORT) ed25519_key fullKey; @@ -209,6 +210,7 @@ int test_wc_ed25519_sign_msg_pubonly_fails(void) DoExpectIntEQ(wc_FreeRng(&rng), 0); wc_ed25519_free(&pubOnlyKey); wc_ed25519_free(&fullKey); +#endif #endif return EXPECT_RESULT(); } /* END test_wc_ed25519_sign_msg_pubonly_fails */ diff --git a/tests/api/test_ed448.c b/tests/api/test_ed448.c index 7b03932bd2..fd2b2393bc 100644 --- a/tests/api/test_ed448.c +++ b/tests/api/test_ed448.c @@ -169,6 +169,7 @@ int test_wc_ed448_sign_msg(void) int test_wc_ed448_sign_msg_pubonly_fails(void) { EXPECT_DECLS; +#if !defined(HAVE_FIPS) || FIPS_VERSION3_GE(7,0,0) #if defined(HAVE_ED448) && defined(HAVE_ED448_SIGN) && \ defined(HAVE_ED448_KEY_IMPORT) && defined(HAVE_ED448_KEY_EXPORT) ed448_key fullKey; @@ -202,6 +203,7 @@ int test_wc_ed448_sign_msg_pubonly_fails(void) DoExpectIntEQ(wc_FreeRng(&rng), 0); wc_ed448_free(&pubOnlyKey); wc_ed448_free(&fullKey); +#endif #endif return EXPECT_RESULT(); } /* END test_wc_ed448_sign_msg_pubonly_fails */ diff --git a/tests/api/test_mldsa.c b/tests/api/test_mldsa.c index f8f4bc92da..8664ae5812 100644 --- a/tests/api/test_mldsa.c +++ b/tests/api/test_mldsa.c @@ -692,6 +692,7 @@ int test_wc_dilithium(void) int test_wc_dilithium_sign_pubonly_fails(void) { EXPECT_DECLS; +#if !defined(HAVE_FIPS) || FIPS_VERSION3_GE(7,0,0) #if defined(HAVE_DILITHIUM) && defined(WOLFSSL_WC_DILITHIUM) && \ !defined(WOLFSSL_DILITHIUM_NO_SIGN) && \ !defined(WOLFSSL_DILITHIUM_NO_MAKE_KEY) && \ @@ -757,6 +758,7 @@ int test_wc_dilithium_sign_pubonly_fails(void) XFREE(pubBuf, NULL, DYNAMIC_TYPE_TMP_BUFFER); XFREE(pubOnlyKey, NULL, DYNAMIC_TYPE_TMP_BUFFER); XFREE(key, NULL, DYNAMIC_TYPE_TMP_BUFFER); +#endif #endif return EXPECT_RESULT(); } /* END test_wc_dilithium_sign_pubonly_fails */ diff --git a/tests/api/test_mlkem.c b/tests/api/test_mlkem.c index 9a0dba69dd..e9e42661a2 100644 --- a/tests/api/test_mlkem.c +++ b/tests/api/test_mlkem.c @@ -3880,6 +3880,7 @@ int test_wc_mlkem_decapsulate_kats(void) int test_wc_mlkem_decapsulate_pubonly_fails(void) { EXPECT_DECLS; +#if !defined(HAVE_FIPS) || FIPS_VERSION3_GE(7,0,0) #if defined(WOLFSSL_HAVE_MLKEM) && defined(WOLFSSL_WC_MLKEM) && \ !defined(WOLFSSL_NO_ML_KEM) && !defined(WOLFSSL_MLKEM_NO_DECAPSULATE) && \ !defined(WOLFSSL_MLKEM_NO_ENCAPSULATE) && \ @@ -3944,6 +3945,7 @@ int test_wc_mlkem_decapsulate_pubonly_fails(void) wc_MlKemKey_Free(fullKey); XFREE(pubOnlyKey, NULL, DYNAMIC_TYPE_TMP_BUFFER); XFREE(fullKey, NULL, DYNAMIC_TYPE_TMP_BUFFER); +#endif #endif return EXPECT_RESULT(); } /* END test_wc_mlkem_decapsulate_pubonly_fails */