summaryrefslogtreecommitdiffstats
path: root/crypto/bn/bn_word.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2000-07-27 21:17:14 +0000
committerRichard Levitte <levitte@openssl.org>2000-07-27 21:17:14 +0000
commit8b4e27e26efc097dbe65b0c3cd78a2da7be310ef (patch)
tree5716e45546badd5618f14a14b0cc0618fee9e28b /crypto/bn/bn_word.c
parentd6ade7422ab60259c1d7b825ee0ff9a5361c7f42 (diff)
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>
Diffstat (limited to 'crypto/bn/bn_word.c')
-rw-r--r--crypto/bn/bn_word.c2
1 files changed, 1 insertions, 1 deletions
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;