diff options
author | Mattias Andrée <maandree@operamail.com> | 2013-02-04 06:48:48 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2013-02-04 06:48:48 +0100 |
commit | 2db068eabc0067244f1add78b4e829014df20d26 (patch) | |
tree | ac50905335c59b2561c1c4c749ad90e9ec6763a9 /SHA3.java | |
parent | support for slaxed chunks (diff) | |
download | sha3sum-2db068eabc0067244f1add78b4e829014df20d26.tar.gz sha3sum-2db068eabc0067244f1add78b4e829014df20d26.tar.bz2 sha3sum-2db068eabc0067244f1add78b4e829014df20d26.tar.xz |
the java program (does not hash as python, but I think python also got som bug sneaked in)
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'SHA3.java')
-rw-r--r-- | SHA3.java | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -417,7 +417,7 @@ public class SHA3 * @param c The capacity * @param n The output size */ - private static void initalise(int r, int c, int n) + public static void initalise(int r, int c, int n) { SHA3.r = r; SHA3.c = c; @@ -438,7 +438,7 @@ public class SHA3 * * @param msg The partial message */ - private static void update(byte[] msg) + public static void update(byte[] msg) { update(msg, msg.length); } @@ -450,7 +450,7 @@ public class SHA3 * @param msg The partial message * @param msglen The length of the partial message */ - private static void update(byte[] msg, int msglen) + public static void update(byte[] msg, int msglen) { int rr = SHA3.r >> 3; int ww = SHA3.w >> 3; @@ -509,7 +509,7 @@ public class SHA3 /** * Squeeze the Keccak sponge */ - private static byte[] digest() + public static byte[] digest() { return digest(null); } @@ -520,9 +520,9 @@ public class SHA3 * * @param msg The rest of the message */ - private static byte[] digest(byte[] msg) + public static byte[] digest(byte[] msg) { - return digest(msg, msg.length); + return digest(msg, msg == null ? 0 : msg.length); } @@ -532,7 +532,7 @@ public class SHA3 * @param msg The rest of the message * @param msglen The length of the partial message */ - private static byte[] digest(byte[] msg, int msglen) + public static byte[] digest(byte[] msg, int msglen) { byte[] message; if ((msg == null) || (msglen == 0)) |