mirror of
https://github.com/openssl/openssl.git
synced 2025-01-30 14:01:55 +08:00
BN_copy now propagates BN_FLG_CONSTTIME
Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4377)
This commit is contained in:
parent
3de81a5912
commit
9f9442918a
@ -332,6 +332,9 @@ BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
|
||||
if (b->top > 0)
|
||||
memcpy(a->d, b->d, sizeof(b->d[0]) * b->top);
|
||||
|
||||
if (BN_get_flags(b, BN_FLG_CONSTTIME) != 0)
|
||||
BN_set_flags(a, BN_FLG_CONSTTIME);
|
||||
|
||||
a->top = b->top;
|
||||
a->neg = b->neg;
|
||||
bn_check_top(a);
|
||||
|
@ -258,8 +258,6 @@ int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
|
||||
R = &(mont->RR); /* grab RR as a temp */
|
||||
if (!BN_copy(&(mont->N), mod))
|
||||
goto err; /* Set N */
|
||||
if (BN_get_flags(mod, BN_FLG_CONSTTIME) != 0)
|
||||
BN_set_flags(&(mont->N), BN_FLG_CONSTTIME);
|
||||
mont->N.neg = 0;
|
||||
|
||||
#ifdef MONT_WORD
|
||||
|
Loading…
Reference in New Issue
Block a user