projects
/
oweals
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3eeaab4
)
bugfix: 0 - w (w != 0) is actually negative
author
Nils Larsch
<nils@openssl.org>
Sun, 17 Jul 2005 16:09:09 +0000
(16:09 +0000)
committer
Nils Larsch
<nils@openssl.org>
Sun, 17 Jul 2005 16:09:09 +0000
(16:09 +0000)
crypto/bn/bn_word.c
patch
|
blob
|
history
diff --git
a/crypto/bn/bn_word.c
b/crypto/bn/bn_word.c
index 1bcb37e29222f76dce1baefd9d1bf949389e725e..bc5905fef4279e644ae4f2090ad6e7a5f4bd0f8d 100644
(file)
--- a/
crypto/bn/bn_word.c
+++ b/
crypto/bn/bn_word.c
@@
-175,7
+175,13
@@
int BN_sub_word(BIGNUM *a, BN_ULONG w)
/* degenerate case: w is zero */
if (!w) return 1;
/* degenerate case: a is zero */
- if(BN_is_zero(a)) return BN_set_word(a,w);
+ if(BN_is_zero(a))
+ {
+ i = BN_set_word(a,w);
+ if (i != 0)
+ BN_set_negative(a, 1);
+ return i;
+ }
/* handle 'a' when negative */
if (a->neg)
{