mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-09 23:33:46 -05:00
Add copy and free methods to 'struct ssh_hash'.
This permits a hash state to be cloned in the middle of being used, so that multiple strings with the same prefix can be hashed without having to repeat all the computation over the prefix. Having done that, we'll also sometimes need to free a hash state that we aren't generating actual hash output from, so we need a free method as well.
This commit is contained in:
2
ssh.h
2
ssh.h
@ -353,8 +353,10 @@ struct ssh_mac {
|
||||
|
||||
struct ssh_hash {
|
||||
void *(*init)(void); /* also allocates context */
|
||||
void *(*copy)(const void *);
|
||||
void (*bytes)(void *, const void *, int);
|
||||
void (*final)(void *, unsigned char *); /* also frees context */
|
||||
void (*free)(void *);
|
||||
int hlen; /* output length in bytes */
|
||||
const char *text_name;
|
||||
};
|
||||
|
Reference in New Issue
Block a user