update logic for ECC FASTMATH KEY-GEN and COMP-KEY
This commit is contained in:
parent
08959624f2
commit
121a24ba15
@ -4535,12 +4535,14 @@ LBL_U:mp_clear (&v);
|
||||
#endif /* WOLFSSL_KEY_GEN */
|
||||
|
||||
|
||||
#ifdef HAVE_ECC
|
||||
#if defined(HAVE_ECC) || defined(WOLFSSL_KEY_GEN) || defined(HAVE_COMP_KEY)
|
||||
|
||||
/* chars used in radix conversions */
|
||||
const char *mp_s_rmap = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\
|
||||
abcdefghijklmnopqrstuvwxyz+/";
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ECC
|
||||
/* read a string [ASCII] in a given radix */
|
||||
int mp_read_radix (mp_int * a, const char *str, int radix)
|
||||
{
|
||||
|
@ -2264,6 +2264,7 @@ static const int lnz[16] = {
|
||||
4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0
|
||||
};
|
||||
|
||||
#ifdef WOLFSSL_KEY_GEN
|
||||
/* swap the elements of two integers, for cases where you can't simply swap the
|
||||
* mp_int pointers around
|
||||
*/
|
||||
@ -2275,6 +2276,7 @@ static void fp_exch (fp_int * a, fp_int * b)
|
||||
*a = *b;
|
||||
*b = t;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Counts the number of lsbs which are zero before the first zero bit */
|
||||
int fp_cnt_lsb(fp_int *a)
|
||||
@ -2724,12 +2726,14 @@ int mp_add_d(fp_int *a, fp_digit b, fp_int *c)
|
||||
#endif /* HAVE_ECC || !NO_PWDBASED */
|
||||
|
||||
|
||||
#ifdef HAVE_ECC
|
||||
#if defined(HAVE_ECC) || defined(WOLFSSL_KEY_GEN) || defined(HAVE_COMP_KEY)
|
||||
|
||||
/* chars used in radix conversions */
|
||||
static const char *fp_s_rmap = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\
|
||||
abcdefghijklmnopqrstuvwxyz+/";
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ECC
|
||||
static int fp_read_radix(fp_int *a, const char *str, int radix)
|
||||
{
|
||||
int y, neg;
|
||||
@ -2842,6 +2846,7 @@ int mp_cnt_lsb(fp_int* a)
|
||||
|
||||
#endif /* HAVE_COMP_KEY */
|
||||
|
||||
#endif /* HAVE_ECC */
|
||||
|
||||
#if defined(WOLFSSL_KEY_GEN) || defined(HAVE_COMP_KEY)
|
||||
|
||||
@ -2953,7 +2958,5 @@ int mp_toradix (mp_int *a, char *str, int radix)
|
||||
|
||||
#endif /* defined(WOLFSSL_KEY_GEN) || defined(HAVE_COMP_KEY) */
|
||||
|
||||
#endif /* HAVE_ECC */
|
||||
|
||||
#endif /* USE_FAST_MATH */
|
||||
|
||||
|
@ -307,7 +307,7 @@ int mp_radix_size (mp_int * a, int radix, int *size);
|
||||
#if defined(HAVE_ECC) || defined(WOLFSSL_KEY_GEN)
|
||||
int mp_sqrmod(mp_int* a, mp_int* b, mp_int* c);
|
||||
#endif
|
||||
#ifdef HAVE_ECC
|
||||
#if defined(HAVE_ECC) || defined(WOLFSSL_KEY_GEN)
|
||||
int mp_read_radix(mp_int* a, const char* str, int radix);
|
||||
#endif
|
||||
|
||||
|
@ -215,7 +215,7 @@
|
||||
|
||||
#ifndef CTYPE_USER
|
||||
#include <ctype.h>
|
||||
#if defined(HAVE_ECC) || defined(HAVE_OCSP)
|
||||
#if defined(HAVE_ECC) || defined(HAVE_OCSP) || defined(WOLFSSL_KEY_GEN)
|
||||
#define XTOUPPER(c) toupper((c))
|
||||
#define XISALPHA(c) isalpha((c))
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user