Latest update.
This commit is contained in:
+6
-2
@@ -322,15 +322,19 @@ BIGNUM *BN_dup(const BIGNUM *a)
|
||||
|
||||
BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
|
||||
{
|
||||
int bn_words;
|
||||
|
||||
bn_check_top(b);
|
||||
|
||||
bn_words = BN_get_flags(b, BN_FLG_CONSTTIME) ? b->dmax : b->top;
|
||||
|
||||
if (a == b)
|
||||
return a;
|
||||
if (bn_wexpand(a, b->top) == NULL)
|
||||
if (bn_wexpand(a, bn_words) == NULL)
|
||||
return NULL;
|
||||
|
||||
if (b->top > 0)
|
||||
memcpy(a->d, b->d, sizeof(b->d[0]) * b->top);
|
||||
memcpy(a->d, b->d, sizeof(b->d[0]) * bn_words);
|
||||
|
||||
a->neg = b->neg;
|
||||
a->top = b->top;
|
||||
|
||||
Reference in New Issue
Block a user