diff options
Diffstat (limited to '')
-rw-r--r-- | c/sha3.c | 2 | ||||
-rw-r--r-- | pure-java/SHA3.java | 2 |
2 files changed, 2 insertions, 2 deletions
@@ -382,7 +382,7 @@ extern void initialise(long bitrate, long capacity, long output) w = b / 25; l = lb(w); nr = 12 + (l << 1); - wmod = (1L << w) - 1L; + wmod = w == 64 ? -1LL ? (1LL << w) - 1LL; S = (llong*)malloc(25 * sizeof(llong)); M = (byte*)malloc(mlen = (r * b) >> 2); mptr = 0; diff --git a/pure-java/SHA3.java b/pure-java/SHA3.java index 700e469..2e0f774 100644 --- a/pure-java/SHA3.java +++ b/pure-java/SHA3.java @@ -362,7 +362,7 @@ public class SHA3 SHA3.w = SHA3.b / 25; SHA3.l = SHA3.lb(SHA3.w); SHA3.nr = 12 + (SHA3.l << 1); - SHA3.wmod = (1L << SHA3.w) - 1L; + SHA3.wmod = w == 64 ? -1L : (1L << SHA3.w) - 1L; SHA3.S = new long[25]; SHA3.M = new byte[(SHA3.r * SHA3.b) >> 2]; SHA3.mptr = 0; |