diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-11-11 22:54:48 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-11-11 22:54:48 +0100 |
commit | d0262422cc014d64b480197fd3961dd528ba6feb (patch) | |
tree | cd1eaabe880d189102cb9689fa21ebed77a140b5 /java | |
parent | fix bug in the c versions for smaller state sizes (diff) | |
download | sha3sum-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 '')
-rw-r--r-- | java-c-jni/SHA3.c | 4 | ||||
-rw-r--r-- | java/ConcurrentSHA3.java | 4 | ||||
-rw-r--r-- | java/SHA3.java | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/java-c-jni/SHA3.c b/java-c-jni/SHA3.c index e785406..76b1d61 100644 --- a/java-c-jni/SHA3.c +++ b/java-c-jni/SHA3.c @@ -723,7 +723,7 @@ byte* digest(byte* msg, long msglen, long bits, int* suffix, long suffix_len, bo olen = n; if (withReturn) { - ni = min(25, rr); + ni = rr / ww; while (olen > 0) { i = 0; @@ -801,7 +801,7 @@ byte* squeeze() rc = (byte*)malloc(nn = (n + 7) >> 3); olen = n; j = ptr = 0; - ni = (25 < r >> 3) ? 25 : (r >> 3); + ni = (r >> 3) / ww; while (olen > 0) { diff --git a/java/ConcurrentSHA3.java b/java/ConcurrentSHA3.java index 90569f8..69425b9 100644 --- a/java/ConcurrentSHA3.java +++ b/java/ConcurrentSHA3.java @@ -832,7 +832,7 @@ public class ConcurrentSHA3 int olen = this.n; int j = 0; - int ni = Math.min(25, rr); + int ni = rr / ww; while (olen > 0) { int i = 0; @@ -931,7 +931,7 @@ public class ConcurrentSHA3 int olen = this.n; int j = 0, ptr = 0; - int ni = Math.min(25, this.r >> 3); + int ni = (this.r >> 3) / ww; while (olen > 0) { int i = 0; diff --git a/java/SHA3.java b/java/SHA3.java index fa70915..9f41a00 100644 --- a/java/SHA3.java +++ b/java/SHA3.java @@ -838,7 +838,7 @@ public class SHA3 int olen = SHA3.n; int j = 0; - int ni = Math.min(25, rr); + int ni = rr / ww; while (olen > 0) { int i = 0; @@ -937,7 +937,7 @@ public class SHA3 int olen = SHA3.n; int j = 0, ptr = 0; - int ni = Math.min(25, SHA3.r >> 3); + int ni = (SHA3.r >> 3) / ww; while (olen > 0) { int i = 0; |