]> asedeno.scripts.mit.edu Git - PuTTY.git/commit
Remove pointless NULL checks in the ECC code.
authorSimon Tatham <anakin@pobox.com>
Fri, 15 May 2015 12:27:15 +0000 (13:27 +0100)
committerSimon Tatham <anakin@pobox.com>
Fri, 15 May 2015 12:35:23 +0000 (13:35 +0100)
commit8dab2c24404b6f14ffb9472799d7621077a73bd6
tree1d9b8ae335edacd231a5eff0dd777d906b071196
parent64d283702bbf0bde117fec5306d7f5cccfe75570
Remove pointless NULL checks in the ECC code.

snew(), and most of the bignum functions, are deliberately written to
fail an assertion and terminate the program rather than return NULL,
so there's no point carefully checking their every return value for
NULL. This removes a huge amount of pointless error-checking code, and
makes the elliptic curve arithmetic almost legible in places :-)

I've kept error checks after modinv(), because that can return NULL if
asked to invert zero. bigsub() can also fail in principle, because our
bignums are non-negative only, but in the couple of cases where it's
used there's a preceding compare that should prevent it, so I've just
added assertions.
sshbn.c
sshecc.c