aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-12-11 16:20:04 +0000
committerlloyd <[email protected]>2010-12-11 16:20:04 +0000
commita8dc533b61713be885b7c1554ae10423c3939170 (patch)
tree4d5b56c3ad2e00038270c5dc79ac405523a52967 /src
parentb3740816ebaac71e8ddbc1bef040c210554ea62d (diff)
Reset state on finalization
Diffstat (limited to 'src')
-rw-r--r--src/hash/keccak/keccak.cpp5
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();
}
}