1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-01 19:42:48 -05:00

Reorganise SHA-512 to match SHA-256.

This builds on the previous refactoring by reworking the SHA-512
vtables and block layer to look more like the SHA-256 version, in
which the block and padding structure is a subroutine of the top-level
vtable methods instead of an owning layer around them.

This also organises the code in a way that makes it easy to drop in
hardware-accelerated versions alongside it: the block layer and the
big arrays of constants are now nicely separate from the inner
block-transform part.
This commit is contained in:
Simon Tatham
2020-12-24 15:20:03 +00:00
parent 43cdc3d910
commit c6d921add5
2 changed files with 201 additions and 252 deletions

1
ssh.h
View File

@ -748,6 +748,7 @@ struct ssh_hashalg {
const char *text_basename; /* the semantic name of the hash */
const char *annotation; /* extra info, e.g. which of multiple impls */
const char *text_name; /* both combined, e.g. "SHA-n (unaccelerated)" */
const void *extra; /* private to the hash implementation */
};
static inline ssh_hash *ssh_hash_new(const ssh_hashalg *alg)