diff options
author | lloyd <[email protected]> | 2010-12-11 16:20:04 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-12-11 16:20:04 +0000 |
commit | a8dc533b61713be885b7c1554ae10423c3939170 (patch) | |
tree | 4d5b56c3ad2e00038270c5dc79ac405523a52967 /src/hash | |
parent | b3740816ebaac71e8ddbc1bef040c210554ea62d (diff) |
Reset state on finalization
Diffstat (limited to 'src/hash')
-rw-r--r-- | src/hash/keccak/keccak.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/hash/keccak/keccak.cpp b/src/hash/keccak/keccak.cpp index d26f574b0..4e5d3744f 100644 --- a/src/hash/keccak/keccak.cpp +++ b/src/hash/keccak/keccak.cpp @@ -163,10 +163,7 @@ void Keccak_1600::final_result(byte output[]) add_data(padding, sizeof(padding)); if(S_pos) - { keccak_f_1600(&S[0]); - S_pos = 0; - } /* * We never have to run the permutation again because we only support @@ -174,6 +171,8 @@ void Keccak_1600::final_result(byte output[]) */ for(size_t i = 0; i != output_bits/8; ++i) output[i] = get_byte(7 - (i % 8), S[i/8]); + + clear(); } } |