Fixes from code review

This commit is contained in:
Sean Parkinson 2018-02-14 11:09:20 +10:00
parent a3a4f2d59c
commit b18fdea2ce
3 changed files with 5 additions and 5 deletions

View File

@ -5785,6 +5785,7 @@ int wc_ecc_sig_size(ecc_key* key)
#ifndef WOLFSSL_SP_MATH
/** Our FP cache */
typedef struct {
ecc_point* g; /* cached COPY of base point */
@ -5802,7 +5803,6 @@ static THREAD_LS_T fp_cache_t fp_cache[FP_ENTRIES];
static volatile int initMutex = 0; /* prevent multiple mutex inits */
static wolfSSL_Mutex ecc_fp_lock;
#endif /* HAVE_THREAD_LS */
#endif /* WOLFSSL_SP_MATH */
/* simple table to help direct the generation of the LUT */
static const struct {
@ -6334,7 +6334,7 @@ static const struct {
#endif
};
#ifndef WOLFSSL_SP_MATH
/* find a hole and free as required, return -1 if no hole found */
static int find_hole(void)
{

View File

@ -276,7 +276,7 @@ int sp_leading_bit(sp_int* a)
d = a->dp[a->used - 1];
while (d > (sp_int_digit)0xff)
d >>= 8;
bit = d >> 7;
bit = (int)(d >> 7);
}
return bit;
@ -465,7 +465,7 @@ int sp_add(sp_int* a, sp_int* b, sp_int* r)
c = r->dp[i] == 0;
}
r->dp[i] = c;
a->used = i + c;
a->used = (int)(i + c);
return MP_OKAY;
}

View File

@ -91,7 +91,7 @@ typedef struct sp_int {
WOLFSSL_LOCAL int sp_init(sp_int* a);
WOLFSSL_LOCAL int sp_init_multi(sp_int* a, sp_int* b, sp_int* c, sp_int* d,
WOLFSSL_API int sp_init_multi(sp_int* a, sp_int* b, sp_int* c, sp_int* d,
sp_int* e, sp_int* f);
WOLFSSL_LOCAL void sp_clear(sp_int* a);
WOLFSSL_LOCAL int sp_unsigned_bin_size(sp_int* a);