aboutsummaryrefslogtreecommitdiffstats
path: root/c/sha3.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-11-11 22:54:48 +0100
committerMattias Andrée <maandree@operamail.com>2014-11-11 22:54:48 +0100
commitd0262422cc014d64b480197fd3961dd528ba6feb (patch)
treecd1eaabe880d189102cb9689fa21ebed77a140b5 /c/sha3.c
parentfix bug in the c versions for smaller state sizes (diff)
downloadsha3sum-d0262422cc014d64b480197fd3961dd528ba6feb.tar.gz
sha3sum-d0262422cc014d64b480197fd3961dd528ba6feb.tar.bz2
sha3sum-d0262422cc014d64b480197fd3961dd528ba6feb.tar.xz
fix bug
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'c/sha3.c')
-rw-r--r--c/sha3.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/c/sha3.c b/c/sha3.c
index 996894c..50ba85b 100644
--- a/c/sha3.c
+++ b/c/sha3.c
@@ -787,7 +787,7 @@ byte* sha3_digest(byte* restrict_ msg, long msglen, long bits, char* restrict_ s
olen = n;
if (withReturn)
{
- ni = min(25, rr);
+ ni = rr / ww;
while (olen > 0)
{
i = 0;
@@ -865,7 +865,7 @@ byte* sha3_squeeze(void)
rc = (byte*)malloc((nn = (n + 7) >> 3) * sizeof(byte));
olen = n;
j = ptr = 0;
- ni = (25 < r >> 3) ? 25 : (r >> 3);
+ ni = (r >> 3) / ww;
while (olen > 0)
{