aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2013-02-04 23:41:18 +0100
committerMattias Andrée <maandree@operamail.com>2013-02-04 23:41:18 +0100
commit96c39f0c265413f792da550f6ddaf514ece8c954 (patch)
tree144b95421a9a816fe714457c9401b0c924f13f46
parentadd progress info (diff)
downloadsha3sum-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>
-rw-r--r--SHA3.java6
-rwxr-xr-xsha3sum.py2
2 files changed, 3 insertions, 5 deletions
diff --git a/SHA3.java b/SHA3.java
index 8db88c4..f9b9594 100644
--- a/SHA3.java
+++ b/SHA3.java
@@ -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
}
}
-
diff --git a/sha3sum.py b/sha3sum.py
index c508254..f7e297a 100755
--- a/sha3sum.py
+++ b/sha3sum.py
@@ -532,7 +532,7 @@ class SHA3:
while (olen > 0):
i = 0
while (i < ni) and (j < nn):
- v = SHA3.S[(i % 5) * 5 + i // 5] # FIXME
+ v = SHA3.S[(i % 5) * 5 + i // 5]
for _ in range(ww):
if (j < nn):
rc[ptr] = v & 255