From 0538b8a3ec95b746a7e8c9e5448b3b9f7d82f008 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 26 Feb 2022 23:37:23 +0100 Subject: Keccak[] is not defined via its output size, but it is only explicitly defined for Keccak1600, so proportional for rest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libkeccak_degeneralise_spec.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'libkeccak_degeneralise_spec.c') diff --git a/libkeccak_degeneralise_spec.c b/libkeccak_degeneralise_spec.c index 99c8e00..efe5127 100644 --- a/libkeccak_degeneralise_spec.c +++ b/libkeccak_degeneralise_spec.c @@ -90,14 +90,13 @@ libkeccak_degeneralise_spec(struct libkeccak_generalised_spec *restrict spec, st } } else if (have_bitrate + have_capacity == 1) { state_size = deft(state_size, 1600L); - bitrate = deft(bitrate, state_size - capacity); capacity = deft(capacity, state_size - bitrate); + bitrate = deft(bitrate, state_size - capacity); output = deft(output, capacity * 2L <= 8 ? 8 : capacity * 2L); } else { state_size = deft(state_size, 1600L); - output = deft(output, (state_size * 32L / 100L + 7L) & ~7L); - bitrate = 2L * output; - capacity = state_size - bitrate; + capacity = state_size * 9 / 25; + bitrate = state_size - capacity; output = deft(output, bitrate / 2L <= 8 ? 8 : bitrate / 2L); } -- cgit v1.2.3-70-g09d2