simon-git: putty (master): Simon Tatham
Commits to Tartarus CVS repository.
tartarus-commits at lists.tartarus.org
Mon Jun 8 19:30:13 BST 2015
TL;DR:
0aa92c8 Provide a stub random_byte() to make 'testbn' compile again.
e28b35b Improve integer-type hygiene in bignum code.
f8b2792 Use 64-bit BignumInt wherever __uint128_t is available.
Repository: git://git.tartarus.org/simon/putty.git
On the web: http://tartarus.org/~simon-git/gitweb/?p=putty.git
Branch updated: master
Committer: Simon Tatham <anakin at pobox.com>
Date: 2015-06-08 19:30:13
commit 0aa92c8fa2bee2e4c0082adcc9f06ead24989698
web diff http://tartarus.org/~simon-git/gitweb/?p=putty.git;a=commitdiff;h=0aa92c8fa2bee2e4c0082adcc9f06ead24989698;hp=7366fde1d4831dcc701bc31e9de1113636fba1c5
Author: Simon Tatham <anakin at pobox.com>
Date: Mon Jun 8 19:22:55 2015 +0100
Provide a stub random_byte() to make 'testbn' compile again.
The function bignum_random_in_range() is new to sshbn.c since I last
tried to run the bignum test code.
sshbn.c | 6 ++++++
1 file changed, 6 insertions(+)
commit e28b35b0a39de28fa2f71aa78071d1ad62deaceb
web diff http://tartarus.org/~simon-git/gitweb/?p=putty.git;a=commitdiff;h=e28b35b0a39de28fa2f71aa78071d1ad62deaceb;hp=0aa92c8fa2bee2e4c0082adcc9f06ead24989698
Author: Simon Tatham <anakin at pobox.com>
Date: Mon Jun 8 19:23:48 2015 +0100
Improve integer-type hygiene in bignum code.
In many places I was using an 'unsigned int', or an implicit int by
virtue of writing an undecorated integer literal, where what was
really wanted was a BignumInt. In particular, this substitution breaks
in any situation where BignumInt is _larger_ than unsigned - which it
is shortly about to be.
sshbn.c | 25 +++++++++++++------------
sshccp.c | 6 ++++--
2 files changed, 17 insertions(+), 14 deletions(-)
commit f8b27925eee6a37df107a7cd2e718e997a52516e
web diff http://tartarus.org/~simon-git/gitweb/?p=putty.git;a=commitdiff;h=f8b27925eee6a37df107a7cd2e718e997a52516e;hp=e28b35b0a39de28fa2f71aa78071d1ad62deaceb
Author: Simon Tatham <anakin at pobox.com>
Date: Mon Jun 8 19:24:58 2015 +0100
Use 64-bit BignumInt wherever __uint128_t is available.
gcc and clang both provide a type called __uint128_t when compiling
for 64-bit targets, code-generated more or less similarly to the way
64-bit long longs are handled on 32-bit targets (spanning two
registers, using ADD/ADC, that sort of thing). Where this is available
(and they also provide a handy macro to make it easy to detect), we
should obviously use it, so that we can handle bignums a larger chunk
at a time and make use of the full width of the hardware's multiplier.
Preliminary benchmarking using 'testbn' suggests a factor of about 2.5
improvement.
I've added the new possibility to the ifdefs in sshbn.h, and also
re-run contrib/make1305.py to generate a set of variants of the
poly1305 arithmetic for the new size of BignumInt.
sshbn.h | 19 +++++++++-
sshccp.c | 120 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
2 files changed, 135 insertions(+), 4 deletions(-)
More information about the tartarus-commits
mailing list