Disable algorithms: fixes

WOLFSSL_PUBLIC_MP and disable algorithms didn't work because of api.c.
 - mp_cond_copy not available unless ECC compiled in
 - wc_export_int not available unless ECC compiled in
Enabling only DH and using SP with SP Math didn't work as the DH
parameters were too small.
sp_cmp is needed when only DH.
mp_set_int is was not available in SP math when RSA is not defined.
mp_set is close enough for the use cases.
Configure with SP and SP math but not RSA, DH and ECC didn't configure -
now default to small maths.
This commit is contained in:
Sean Parkinson
2021-11-19 13:43:14 +10:00
parent 2841b5c93b
commit 5a72fee3df
6 changed files with 76 additions and 8 deletions

View File

@@ -4494,7 +4494,7 @@ int mp_sub_d (mp_int * a, mp_digit b, mp_int * c)
#if defined(WOLFSSL_KEY_GEN) || defined(HAVE_COMP_KEY) || defined(HAVE_ECC) || \
defined(DEBUG_WOLFSSL) || !defined(NO_RSA) || !defined(NO_DSA) || \
!defined(NO_DH)
!defined(NO_DH) || defined(WC_MP_TO_RADIX)
static const int lnz[16] = {
4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0
@@ -5202,7 +5202,7 @@ LBL_U:mp_clear (&u);
#if !defined(NO_DSA) || defined(HAVE_ECC) || defined(WOLFSSL_KEY_GEN) || \
defined(HAVE_COMP_KEY) || defined(WOLFSSL_DEBUG_MATH) || \
defined(DEBUG_WOLFSSL) || defined(OPENSSL_EXTRA)
defined(DEBUG_WOLFSSL) || defined(OPENSSL_EXTRA) || defined(WC_MP_TO_RADIX)
/* chars used in radix conversions */
const char *mp_s_rmap = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"