diff options
author | Mattias Andrée <maandree@operamail.com> | 2013-02-04 23:41:18 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2013-02-04 23:41:18 +0100 |
commit | 96c39f0c265413f792da550f6ddaf514ece8c954 (patch) | |
tree | 144b95421a9a816fe714457c9401b0c924f13f46 /SHA3.java | |
parent | add progress info (diff) | |
download | sha3sum-96c39f0c265413f792da550f6ddaf514ece8c954.tar.gz sha3sum-96c39f0c265413f792da550f6ddaf514ece8c954.tar.bz2 sha3sum-96c39f0c265413f792da550f6ddaf514ece8c954.tar.xz |
m + twist at squeeze in java
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'SHA3.java')
-rw-r--r-- | SHA3.java | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -458,8 +458,7 @@ public class SHA3 if (SHA3.mptr + msglen > SHA3.M.length) System.arraycopy(SHA3.M, 0, SHA3.M = new byte[(SHA3.M.length + msglen) << 1], 0, SHA3.mptr); System.arraycopy(msg, 0, SHA3.M, SHA3.mptr, msglen); - SHA3.mptr += msglen; - int len = SHA3.mptr; + int len = SHA3.mptr += msglen; len -= len % ((SHA3.r * SHA3.b) >> 3); byte[] message; System.arraycopy(SHA3.M, 0, message = new byte[len], 0, len); @@ -647,7 +646,7 @@ public class SHA3 int i = 0; while ((i < ni) && (j < nn)) { - long v = SHA3.S[i]; + long v = SHA3.S[(i % 5) * 5 + i / 5]; for (int _ = 0; _ < ww; _++) { if (j < nn) @@ -668,4 +667,3 @@ public class SHA3 } } - |