aboutsummaryrefslogtreecommitdiffstats
path: root/SHA3.java
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2013-02-04 06:48:48 +0100
committerMattias Andrée <maandree@operamail.com>2013-02-04 06:48:48 +0100
commit2db068eabc0067244f1add78b4e829014df20d26 (patch)
treeac50905335c59b2561c1c4c749ad90e9ec6763a9 /SHA3.java
parentsupport for slaxed chunks (diff)
downloadsha3sum-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.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/SHA3.java b/SHA3.java
index 3064d8a..d1a1b0f 100644
--- a/SHA3.java
+++ b/SHA3.java
@@ -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))