forked from wolfSSL/wolfssl
Fixes from code review
This commit is contained in:
@@ -5785,6 +5785,7 @@ int wc_ecc_sig_size(ecc_key* key)
|
|||||||
|
|
||||||
|
|
||||||
#ifndef WOLFSSL_SP_MATH
|
#ifndef WOLFSSL_SP_MATH
|
||||||
|
|
||||||
/** Our FP cache */
|
/** Our FP cache */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ecc_point* g; /* cached COPY of base point */
|
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 volatile int initMutex = 0; /* prevent multiple mutex inits */
|
||||||
static wolfSSL_Mutex ecc_fp_lock;
|
static wolfSSL_Mutex ecc_fp_lock;
|
||||||
#endif /* HAVE_THREAD_LS */
|
#endif /* HAVE_THREAD_LS */
|
||||||
#endif /* WOLFSSL_SP_MATH */
|
|
||||||
|
|
||||||
/* simple table to help direct the generation of the LUT */
|
/* simple table to help direct the generation of the LUT */
|
||||||
static const struct {
|
static const struct {
|
||||||
@@ -6334,7 +6334,7 @@ static const struct {
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef WOLFSSL_SP_MATH
|
|
||||||
/* find a hole and free as required, return -1 if no hole found */
|
/* find a hole and free as required, return -1 if no hole found */
|
||||||
static int find_hole(void)
|
static int find_hole(void)
|
||||||
{
|
{
|
||||||
|
@@ -276,7 +276,7 @@ int sp_leading_bit(sp_int* a)
|
|||||||
d = a->dp[a->used - 1];
|
d = a->dp[a->used - 1];
|
||||||
while (d > (sp_int_digit)0xff)
|
while (d > (sp_int_digit)0xff)
|
||||||
d >>= 8;
|
d >>= 8;
|
||||||
bit = d >> 7;
|
bit = (int)(d >> 7);
|
||||||
}
|
}
|
||||||
|
|
||||||
return bit;
|
return bit;
|
||||||
@@ -465,7 +465,7 @@ int sp_add(sp_int* a, sp_int* b, sp_int* r)
|
|||||||
c = r->dp[i] == 0;
|
c = r->dp[i] == 0;
|
||||||
}
|
}
|
||||||
r->dp[i] = c;
|
r->dp[i] = c;
|
||||||
a->used = i + c;
|
a->used = (int)(i + c);
|
||||||
|
|
||||||
return MP_OKAY;
|
return MP_OKAY;
|
||||||
}
|
}
|
||||||
|
@@ -91,7 +91,7 @@ typedef struct sp_int {
|
|||||||
|
|
||||||
|
|
||||||
WOLFSSL_LOCAL int sp_init(sp_int* a);
|
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);
|
sp_int* e, sp_int* f);
|
||||||
WOLFSSL_LOCAL void sp_clear(sp_int* a);
|
WOLFSSL_LOCAL void sp_clear(sp_int* a);
|
||||||
WOLFSSL_LOCAL int sp_unsigned_bin_size(sp_int* a);
|
WOLFSSL_LOCAL int sp_unsigned_bin_size(sp_int* a);
|
||||||
|
Reference in New Issue
Block a user