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)
(cherry picked from commit 9f9442918aeaed5dc2442d81ab8d29fe3e1fb906)
Samuel Weiser authored 6 years ago
Matt Caswell committed 6 years ago
523 | 523 | memcpy(a->d, b->d, sizeof(b->d[0]) * b->top); |
524 | 524 | #endif |
525 | 525 | |
526 | if (BN_get_flags(b, BN_FLG_CONSTTIME) != 0) | |
527 | BN_set_flags(a, BN_FLG_CONSTTIME); | |
528 | ||
526 | 529 | a->top = b->top; |
527 | 530 | a->neg = b->neg; |
528 | 531 | bn_check_top(a); |