summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn/bn_word.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/bn/bn_word.c')
-rw-r--r--src/lib/libcrypto/bn/bn_word.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/libcrypto/bn/bn_word.c b/src/lib/libcrypto/bn/bn_word.c
index 988e0ca7b3..de610ce54c 100644
--- a/src/lib/libcrypto/bn/bn_word.c
+++ b/src/lib/libcrypto/bn/bn_word.c
@@ -110,6 +110,9 @@ int BN_add_word(BIGNUM *a, BN_ULONG w)
110 BN_ULONG l; 110 BN_ULONG l;
111 int i; 111 int i;
112 112
113 if ((w & BN_MASK2) == 0)
114 return(1);
115
113 if (a->neg) 116 if (a->neg)
114 { 117 {
115 a->neg=0; 118 a->neg=0;
@@ -143,6 +146,9 @@ int BN_sub_word(BIGNUM *a, BN_ULONG w)
143 { 146 {
144 int i; 147 int i;
145 148
149 if ((w & BN_MASK2) == 0)
150 return(1);
151
146 if (BN_is_zero(a) || a->neg) 152 if (BN_is_zero(a) || a->neg)
147 { 153 {
148 a->neg=0; 154 a->neg=0;