mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-16 10:37:38 -05:00
Adopt the new hash API functions where they're useful.
This commit switches as many ssh_hash_free / ssh_hash_new pairs as possible to reuse the previous hash object via ssh_hash_reset. Also a few other cleanups: use the wrapper function hash_simple() where possible, and I've also introduced ssh_hash_digest_nondestructive() and switched to that where possible as well.
This commit is contained in:
10
testcrypt.c
10
testcrypt.c
@ -623,6 +623,16 @@ mp_int *monty_modulus_wrapper(MontyContext *mc)
|
||||
}
|
||||
#define monty_modulus monty_modulus_wrapper
|
||||
|
||||
strbuf *ssh_hash_digest_wrapper(ssh_hash *h)
|
||||
{
|
||||
strbuf *sb = strbuf_new();
|
||||
void *p = strbuf_append(sb, ssh_hash_alg(h)->hlen);
|
||||
ssh_hash_digest(h, p);
|
||||
return sb;
|
||||
}
|
||||
#undef ssh_hash_digest
|
||||
#define ssh_hash_digest ssh_hash_digest_wrapper
|
||||
|
||||
strbuf *ssh_hash_final_wrapper(ssh_hash *h)
|
||||
{
|
||||
strbuf *sb = strbuf_new();
|
||||
|
Reference in New Issue
Block a user