diff options
-rw-r--r-- | src/lib/libcrypto/bn/bn_word.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libcrypto/bn/bn_word.c b/src/lib/libcrypto/bn/bn_word.c index a44221c35f..c900f9ee2e 100644 --- a/src/lib/libcrypto/bn/bn_word.c +++ b/src/lib/libcrypto/bn/bn_word.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bn_word.c,v 1.18 2023/02/13 04:25:37 jsing Exp $ */ | 1 | /* $OpenBSD: bn_word.c,v 1.19 2023/03/11 14:13:11 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -152,7 +152,7 @@ BN_add_word(BIGNUM *a, BN_ULONG w) | |||
152 | if (a->neg) { | 152 | if (a->neg) { |
153 | a->neg = 0; | 153 | a->neg = 0; |
154 | i = BN_sub_word(a, w); | 154 | i = BN_sub_word(a, w); |
155 | BN_set_negative(a, 1); | 155 | BN_set_negative(a, !a->neg); |
156 | return (i); | 156 | return (i); |
157 | } | 157 | } |
158 | for (i = 0; w != 0 && i < a->top; i++) { | 158 | for (i = 0; w != 0 && i < a->top; i++) { |
@@ -189,7 +189,7 @@ BN_sub_word(BIGNUM *a, BN_ULONG w) | |||
189 | if (a->neg) { | 189 | if (a->neg) { |
190 | a->neg = 0; | 190 | a->neg = 0; |
191 | i = BN_add_word(a, w); | 191 | i = BN_add_word(a, w); |
192 | BN_set_negative(a, 1); | 192 | BN_set_negative(a, !a->neg); |
193 | return (i); | 193 | return (i); |
194 | } | 194 | } |
195 | 195 | ||