From 8b4e27e26efc097dbe65b0c3cd78a2da7be310ef Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Thu, 27 Jul 2000 21:17:14 +0000 Subject: [PATCH] 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 --- crypto/bn/bn_word.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/bn/bn_word.c b/crypto/bn/bn_word.c index 73157a7d43..7e7ca58842 100644 --- a/crypto/bn/bn_word.c +++ b/crypto/bn/bn_word.c @@ -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; -- 2.25.1