mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-22 14:39:24 -05:00
bignum_mod_short shouldn't be depending on a fixed place value in
the bignum data! This wasn't actually causing puttygen-zero-div (its unwarranted assumption was still correct under Windows) but it would have caused the same symptoms under Unix when I got round to porting PuTTYgen. [originally from svn r3315]
This commit is contained in:
parent
380fa0313d
commit
f9ca6e8501
2
sshbn.c
2
sshbn.c
@ -814,7 +814,7 @@ unsigned short bignum_mod_short(Bignum number, unsigned short modulus)
|
|||||||
r = 0;
|
r = 0;
|
||||||
mod = modulus;
|
mod = modulus;
|
||||||
for (i = number[0]; i > 0; i--)
|
for (i = number[0]; i > 0; i--)
|
||||||
r = (r * 65536 + number[i]) % mod;
|
r = (r * (BIGNUM_TOP_BIT % mod) * 2 + number[i] % mod) % mod;
|
||||||
return (unsigned short) r;
|
return (unsigned short) r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user