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:
Richard Levitte 2000-07-27 21:17:14 +00:00
parent d6ade7422a
commit 8b4e27e26e

View File

@ -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;