Commit 8b4e27e2 authored by Richard Levitte's avatar Richard Levitte
Browse files

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>
parent d6ade742
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;