putty/test
Simon Tatham bd84c5e4b3 mp_modmul: cope with oversized base values.
Previously, I checked by assertion that the base was less than the
modulus. There were two things wrong with this policy. Firstly, it's
perfectly _meaningful_ to want to raise a large number to a power mod
a smaller number, even if it doesn't come up often in cryptography;
secondly, I didn't do it right, because the check was based on the
formal sizes (nw fields) of the mp_ints, which meant that it was
possible to have a failure of the assertion even in the case where the
numerical value of the base _was_ less than the modulus.

In particular, this could come up in Diffie-Hellman with a fixed
group, because the fixed group modulus was decoded from an MP_LITERAL
in sshdh.c which gave a minimal value of nw, but the base was the
public value sent by the other end of the connection, which would
sometimes be sent with the leading zero byte required by the SSH-2
mpint encoding, and would cause a value of nw one larger, failing the
assertion.

Fixed by simply using mp_modmul in monty_import, replacing the
previous clever-but-restricted strategy that I wrote when I thought I
could get away without having to write a general division-based
modular reduction at all.
2019-02-04 20:32:31 +00:00
..
colours.txt Rename the 'testdata' subdirectory to 'test'. 2019-01-03 16:56:02 +00:00
cryptsuite.py mp_modmul: cope with oversized base values. 2019-02-04 20:32:31 +00:00
desref.py Complete rewrite of sshdes.c. 2019-01-18 19:41:23 +00:00
display.txt Rename the 'testdata' subdirectory to 'test'. 2019-01-03 16:56:02 +00:00
eccref.py eccref.py: add a couple more methods to ModP. 2019-01-03 16:56:02 +00:00
lattrs.txt Rename the 'testdata' subdirectory to 'test'. 2019-01-03 16:56:02 +00:00
scocols.txt Rename the 'testdata' subdirectory to 'test'. 2019-01-03 16:56:02 +00:00
testcrypt.py testcrypt / cryptsuite: another set of Python 3 fixes. 2019-01-23 23:40:32 +00:00
utf8.txt Rename the 'testdata' subdirectory to 'test'. 2019-01-03 16:56:02 +00:00
vt100.txt Rename the 'testdata' subdirectory to 'test'. 2019-01-03 16:56:02 +00:00