提交 449bd384 编写于 作者: N Nils Larsch

bugfix: 0 - w (w != 0) is actually negative

上级 3eeaab4b
...@@ -175,7 +175,13 @@ int BN_sub_word(BIGNUM *a, BN_ULONG w) ...@@ -175,7 +175,13 @@ int BN_sub_word(BIGNUM *a, BN_ULONG w)
/* degenerate case: w is zero */ /* degenerate case: w is zero */
if (!w) return 1; if (!w) return 1;
/* degenerate case: a is zero */ /* 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 */ /* handle 'a' when negative */
if (a->neg) if (a->neg)
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册