diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index bb6e7cf45c..2fa70c6b74 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -30871,10 +30871,7 @@ static wc_test_ret_t ecc_test_curve_size(WC_RNG* rng, int keySize, int testVerif #ifdef HAVE_ECC_SIGN /* ECC w/out Shamir has issue with all 0 digest */ /* WC_BIGINT doesn't have 0 len well on hardware */ - /* Cryptocell has issues with all 0 digest */ -#if defined(ECC_SHAMIR) && !defined(WOLFSSL_ASYNC_CRYPT) && \ - !defined(WOLFSSL_CRYPTOCELL) && \ - !defined(WC_TEST_NO_ECC_SIGN_VERIFY_ZERO_DIGEST) +#if defined(ECC_SHAMIR) && !defined(WC_TEST_NO_ECC_SIGN_VERIFY_ZERO_DIGEST) /* test DSA sign hash with zeros */ for (i = 0; i < (int)ECC_DIGEST_SIZE; i++) { digest[i] = 0; @@ -30911,9 +30908,7 @@ static wc_test_ret_t ecc_test_curve_size(WC_RNG* rng, int keySize, int testVerif TEST_SLEEP(); } #endif /* HAVE_ECC_VERIFY */ -#endif /* ECC_SHAMIR && !WOLFSSL_ASYNC_CRYPT && !WOLFSSL_CRYPTOCELL - * && !WC_TEST_NO_ECC_SIGN_VERIFY_ZERO_DIGEST - */ +#endif /* ECC_SHAMIR && !WC_TEST_NO_ECC_SIGN_VERIFY_ZERO_DIGEST */ /* test DSA sign hash with sequence (0,1,2,3,4,...) */ for (i = 0; i < (int)ECC_DIGEST_SIZE; i++) { diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index 440a3e5586..0d426522c6 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -3168,6 +3168,14 @@ extern void uITRON4_free(void *p) ; #undef NO_DH #endif +/* CryptoCell defines */ +#ifdef WOLFSSL_CRYPTOCELL + #if defined(HAVE_ECC) && defined(HAVE_ECC_SIGN) + /* Don't attempt to sign/verify an all-zero digest in wolfCrypt tests */ + #define WC_TEST_NO_ECC_SIGN_VERIFY_ZERO_DIGEST + #endif /* HAVE_ECC && HAVE_ECC_SIGN */ +#endif + /* Asynchronous Crypto */ #ifdef WOLFSSL_ASYNC_CRYPT #if !defined(HAVE_CAVIUM) && !defined(HAVE_INTEL_QA) && \ @@ -3192,6 +3200,12 @@ extern void uITRON4_free(void *p) ; * but not required */ #define ECC_CACHE_CURVE #endif + + #if defined(HAVE_ECC) && defined(HAVE_ECC_SIGN) + /* Don't attempt to sign/verify an all-zero digest in wolfCrypt tests */ + #define WC_TEST_NO_ECC_SIGN_VERIFY_ZERO_DIGEST + #endif /* HAVE_ECC && HAVE_ECC_SIGN */ + #endif /* WOLFSSL_ASYNC_CRYPT */ #ifndef WC_ASYNC_DEV_SIZE #define WC_ASYNC_DEV_SIZE 0