Update pre9
This commit is contained in:
@@ -356,11 +356,6 @@ int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
|
||||
aa = val[0];
|
||||
} else
|
||||
aa = a;
|
||||
if (BN_is_zero(aa)) {
|
||||
BN_zero(rr);
|
||||
ret = 1;
|
||||
goto err;
|
||||
}
|
||||
if (!bn_to_mont_fixed_top(val[0], aa, mont, ctx))
|
||||
goto err; /* 1 */
|
||||
|
||||
|
||||
@@ -172,16 +172,20 @@ BN_ULONG *bn_get_words(const BIGNUM *a)
|
||||
return a->d;
|
||||
}
|
||||
|
||||
void bn_set_static_words(BIGNUM *a, BN_ULONG *words, int size)
|
||||
void bn_set_static_words(BIGNUM *a, const BN_ULONG *words, int size)
|
||||
{
|
||||
a->d = words;
|
||||
/*
|
||||
* |const| qualifier omission is compensated by BN_FLG_STATIC_DATA
|
||||
* flag, which effectively means "read-only data".
|
||||
*/
|
||||
a->d = (BN_ULONG *)words;
|
||||
a->dmax = a->top = size;
|
||||
a->neg = 0;
|
||||
a->flags |= BN_FLG_STATIC_DATA;
|
||||
bn_correct_top(a);
|
||||
}
|
||||
|
||||
int bn_set_words(BIGNUM *a, BN_ULONG *words, int num_words)
|
||||
int bn_set_words(BIGNUM *a, const BN_ULONG *words, int num_words)
|
||||
{
|
||||
if (bn_wexpand(a, num_words) == NULL) {
|
||||
BNerr(BN_F_BN_SET_WORDS, ERR_R_MALLOC_FAILURE);
|
||||
|
||||
@@ -83,6 +83,7 @@ int bn_mod_add_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
|
||||
((volatile BN_ULONG *)tp)[i] = 0;
|
||||
}
|
||||
r->top = mtop;
|
||||
r->neg = 0;
|
||||
|
||||
if (tp != storage)
|
||||
OPENSSL_free(tp);
|
||||
|
||||
Reference in New Issue
Block a user