From a8dc533b61713be885b7c1554ae10423c3939170 Mon Sep 17 00:00:00 2001 From: lloyd Date: Sat, 11 Dec 2010 16:20:04 +0000 Subject: Reset state on finalization --- src/hash/keccak/keccak.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') 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(); } } -- cgit v1.2.3