In the case where a < 0 and |a| < w, the result (assigned to a) from
BN_add_word becomes wrongly negative... This was discovered by Darrel Hankerson <dhankers@cacr.math.uwaterloo.ca>
This commit is contained in:
parent
d6ade7422a
commit
8b4e27e26e
@ -115,7 +115,7 @@ int BN_add_word(BIGNUM *a, BN_ULONG w)
|
||||
a->neg=0;
|
||||
i=BN_sub_word(a,w);
|
||||
if (!BN_is_zero(a))
|
||||
a->neg=1;
|
||||
a->neg=!(a->neg);
|
||||
return(i);
|
||||
}
|
||||
w&=BN_MASK2;
|
||||
|
Loading…
x
Reference in New Issue
Block a user