mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 09:58:01 +00:00
A few more modpow tests, exercising the fallback option. This is
mostly so I can valgrind both and make sure they free all their workspace - a memory leak in this code would be not merely an inconvenience but a security hazard. [originally from svn r9101]
This commit is contained in:
parent
15d7f8bb3e
commit
7a0bd8247c
4
testdata/bignum.py
vendored
4
testdata/bignum.py
vendored
@ -87,3 +87,7 @@ for i in range(64, 4097, 63):
|
|||||||
base = mathlib.sqrt(3*modulus*modulus) % modulus
|
base = mathlib.sqrt(3*modulus*modulus) % modulus
|
||||||
expt = mathlib.sqrt(modulus*modulus*2/5)
|
expt = mathlib.sqrt(modulus*modulus*2/5)
|
||||||
print "pow", hexstr(base), hexstr(expt), hexstr(modulus), hexstr(pow(base, expt, modulus))
|
print "pow", hexstr(base), hexstr(expt), hexstr(modulus), hexstr(pow(base, expt, modulus))
|
||||||
|
if i <= 1024:
|
||||||
|
# Test even moduli, which can't be done by Montgomery.
|
||||||
|
modulus = modulus - 1
|
||||||
|
print "pow", hexstr(base), hexstr(expt), hexstr(modulus), hexstr(pow(base, expt, modulus))
|
||||||
|
Loading…
Reference in New Issue
Block a user