Merge pull request #8015 from gojimmypi/pr-mp_read_radix

gate test mp_read_radix on OPENSSL_EXTRA or !NO_DSA or HAVE_ECC
This commit is contained in:
JacobBarthelmeh 2024-09-25 11:35:57 -06:00 committed by GitHub
commit 79b5ec86f6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 0 deletions

View File

@ -55026,6 +55026,7 @@ static wc_test_ret_t mp_test_cmp(mp_int* a, mp_int* b)
if (ret != MP_GT)
return WC_TEST_RET_ENC_NC;
#if defined(OPENSSL_EXTRA) || !defined(NO_DSA) || defined(HAVE_ECC)
mp_read_radix(b, "1234567890123456789", MP_RADIX_HEX);
ret = mp_cmp_d(b, -1);
if (ret != MP_GT)
@ -55040,9 +55041,12 @@ static wc_test_ret_t mp_test_cmp(mp_int* a, mp_int* b)
ret = mp_cmp(b, b);
if (ret != MP_EQ)
return WC_TEST_RET_ENC_NC;
#endif
#if (!defined(WOLFSSL_SP_MATH) && !defined(WOLFSSL_SP_MATH_ALL)) || \
defined(WOLFSSL_SP_INT_NEGATIVE)
#if defined(OPENSSL_EXTRA) || !defined(NO_DSA) || defined(HAVE_ECC)
mp_read_radix(a, "-1", MP_RADIX_HEX);
mp_read_radix(a, "1", MP_RADIX_HEX);
ret = mp_cmp(a, b);
@ -55059,12 +55063,15 @@ static wc_test_ret_t mp_test_cmp(mp_int* a, mp_int* b)
ret = mp_cmp(b, a);
if (ret != MP_LT)
return WC_TEST_RET_ENC_NC;
#endif
#if defined(OPENSSL_EXTRA) || !defined(NO_DSA) || defined(HAVE_ECC)
mp_read_radix(a, "-2", MP_RADIX_HEX);
ret = mp_cmp(a, b);
if (ret != MP_EQ)
return WC_TEST_RET_ENC_NC;
#endif
#endif
#if defined(HAVE_ECC) && !defined(WC_NO_RNG) && \
defined(WOLFSSL_ECC_GEN_REJECT_SAMPLING)
@ -55824,12 +55831,16 @@ static wc_test_ret_t mp_test_invmod(mp_int* a, mp_int* m, mp_int* r)
#endif
#if !defined(WOLFSSL_SP_MATH) || defined(WOLFSSL_SP_INT_NEGATIVE)
#if defined(OPENSSL_EXTRA) || !defined(NO_DSA) || defined(HAVE_ECC)
mp_read_radix(a, "-3", 16);
ret = mp_invmod(a, m, r);
if (ret != MP_OKAY)
return WC_TEST_RET_ENC_EC(ret);
#endif
#endif
#if defined(WOLFSSL_SP_MATH_ALL) && defined(HAVE_ECC)
mp_set(a, 0);
mp_set(m, 3);