Clear hash state object once hash is finalized

This commit is contained in:
Juhani Krekelä 2021-04-04 23:17:49 +03:00
parent 92041f9fbf
commit 96f9b11cf2
1 changed files with 4 additions and 0 deletions

4
puer.c
View File

@ -211,4 +211,8 @@ void finalize_hash(struct hashstate *state, unsigned char hash[32]) {
for (size_t i = 0; i < 4; i++) {
word2bytes(&hash[i*4 + 16], state->b[i]);
}
// Clear all of the hash state, in case there was sth important
// there
explicit_bzero(state, sizeof(struct hashstate));
}