When BN_add_word() reaches top, it shouldn't try to add the the corresponding
word, since that word may not be zero.
This commit is contained in:
parent
f6733ae577
commit
09db11783d
1 changed files with 4 additions and 1 deletions
|
@ -123,7 +123,10 @@ int BN_add_word(BIGNUM *a, BN_ULONG w)
|
|||
i=0;
|
||||
for (;;)
|
||||
{
|
||||
l=(a->d[i]+(BN_ULONG)w)&BN_MASK2;
|
||||
if (i >= a->top)
|
||||
l=w;
|
||||
else
|
||||
l=(a->d[i]+(BN_ULONG)w)&BN_MASK2;
|
||||
a->d[i]=l;
|
||||
if (w > l)
|
||||
w=1;
|
||||
|
|
Loading…
Reference in a new issue