Merge branch 'kaleb'

This commit is contained in:
toddouska 2015-08-04 15:33:05 -07:00
commit f30a11f5ce
4 changed files with 11 additions and 6 deletions

View File

@ -4535,12 +4535,14 @@ LBL_U:mp_clear (&v);
#endif /* WOLFSSL_KEY_GEN */ #endif /* WOLFSSL_KEY_GEN */
#ifdef HAVE_ECC #if defined(HAVE_ECC) || defined(WOLFSSL_KEY_GEN) || defined(HAVE_COMP_KEY)
/* chars used in radix conversions */ /* chars used in radix conversions */
const char *mp_s_rmap = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\ const char *mp_s_rmap = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\
abcdefghijklmnopqrstuvwxyz+/"; abcdefghijklmnopqrstuvwxyz+/";
#endif
#ifdef HAVE_ECC
/* read a string [ASCII] in a given radix */ /* read a string [ASCII] in a given radix */
int mp_read_radix (mp_int * a, const char *str, int radix) int mp_read_radix (mp_int * a, const char *str, int radix)
{ {

View File

@ -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 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 /* swap the elements of two integers, for cases where you can't simply swap the
* mp_int pointers around * mp_int pointers around
*/ */
@ -2275,6 +2276,7 @@ static void fp_exch (fp_int * a, fp_int * b)
*a = *b; *a = *b;
*b = t; *b = t;
} }
#endif
/* Counts the number of lsbs which are zero before the first zero bit */ /* Counts the number of lsbs which are zero before the first zero bit */
int fp_cnt_lsb(fp_int *a) 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 */ #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 */ /* chars used in radix conversions */
static const char *fp_s_rmap = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\ static const char *fp_s_rmap = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\
abcdefghijklmnopqrstuvwxyz+/"; abcdefghijklmnopqrstuvwxyz+/";
#endif
#ifdef HAVE_ECC
static int fp_read_radix(fp_int *a, const char *str, int radix) static int fp_read_radix(fp_int *a, const char *str, int radix)
{ {
int y, neg; int y, neg;
@ -2842,6 +2846,7 @@ int mp_cnt_lsb(fp_int* a)
#endif /* HAVE_COMP_KEY */ #endif /* HAVE_COMP_KEY */
#endif /* HAVE_ECC */
#if defined(WOLFSSL_KEY_GEN) || defined(HAVE_COMP_KEY) #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 /* defined(WOLFSSL_KEY_GEN) || defined(HAVE_COMP_KEY) */
#endif /* HAVE_ECC */
#endif /* USE_FAST_MATH */ #endif /* USE_FAST_MATH */

View File

@ -307,7 +307,7 @@ int mp_radix_size (mp_int * a, int radix, int *size);
#if defined(HAVE_ECC) || defined(WOLFSSL_KEY_GEN) #if defined(HAVE_ECC) || defined(WOLFSSL_KEY_GEN)
int mp_sqrmod(mp_int* a, mp_int* b, mp_int* c); int mp_sqrmod(mp_int* a, mp_int* b, mp_int* c);
#endif #endif
#ifdef HAVE_ECC #if defined(HAVE_ECC) || defined(WOLFSSL_KEY_GEN)
int mp_read_radix(mp_int* a, const char* str, int radix); int mp_read_radix(mp_int* a, const char* str, int radix);
#endif #endif

View File

@ -215,7 +215,7 @@
#ifndef CTYPE_USER #ifndef CTYPE_USER
#include <ctype.h> #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 XTOUPPER(c) toupper((c))
#define XISALPHA(c) isalpha((c)) #define XISALPHA(c) isalpha((c))
#endif #endif