1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-04 13:02:47 -05:00

Add some tests of Miller-Rabin to cryptsuite.

I'm about to rewrite the Miller-Rabin testing code, so let's start by
introducing a test suite that the old version passes, and then I can
make sure the new one does too.
This commit is contained in:
Simon Tatham
2021-08-27 17:43:40 +01:00
parent 59409d0947
commit 23431f8ff4
6 changed files with 112 additions and 8 deletions

View File

@ -235,7 +235,7 @@ def make_retval(rettype, word, unpack_strings):
elif rettype == "boolean":
assert word == b"true" or word == b"false"
return word == b"true"
elif rettype == "pocklestatus":
elif rettype in {"pocklestatus", "mr_result"}:
return word.decode("ASCII")
raise TypeError("Can't deal with return value {!r} of type {!r}"
.format(word, rettype))