1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-17 11:00:59 -05:00

Expose blocklen in the ssh_hash structure.

Keeping that information alongside the hashes themselves seems more
sensible than having the HMAC code know that fact about everything it
can work with.
This commit is contained in:
Simon Tatham
2019-01-21 19:04:22 +00:00
parent de797aa40e
commit a53559a0dc
6 changed files with 25 additions and 16 deletions

View File

@ -13,7 +13,7 @@
typedef struct {
uint64_t h[8];
unsigned char block[128];
unsigned char block[BLKSIZE];
int blkused;
uint64_t lenhi, lenlo;
BinarySink_IMPLEMENTATION;
@ -343,7 +343,7 @@ static void sha512_final(ssh_hash *hash, unsigned char *output)
}
const ssh_hashalg ssh_sha512 = {
sha512_new, sha512_copy, sha512_final, sha512_free, 64, "SHA-512"
sha512_new, sha512_copy, sha512_final, sha512_free, 64, BLKSIZE, "SHA-512"
};
static ssh_hash *sha384_new(const ssh_hashalg *alg)
@ -363,5 +363,5 @@ static void sha384_final(ssh_hash *hash, unsigned char *output)
}
const ssh_hashalg ssh_sha384 = {
sha384_new, sha512_copy, sha384_final, sha512_free, 48, "SHA-384"
sha384_new, sha512_copy, sha384_final, sha512_free, 48, BLKSIZE, "SHA-384"
};