From 0a9fd0ca7575e96c7eac5a80dacedd074e568226 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 21 Aug 2014 18:22:25 +0200 Subject: beginning on support for partial bytes, c implemention is not working correctly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- java-c-jni/sha3sum.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'java-c-jni/sha3sum.java') diff --git a/java-c-jni/sha3sum.java b/java-c-jni/sha3sum.java index a7abd07..c3c63a5 100644 --- a/java-c-jni/sha3sum.java +++ b/java-c-jni/sha3sum.java @@ -355,9 +355,9 @@ public class sha3sum else { int n = read >> 1; - for (int _ = 0; _ < n; _++) - { byte a = chunk[_ << 1], b = chunk[(_ << 1) | 1]; - chunk[_] = (byte)((((a & 15) + (a <= '9' ? 0 : 9)) << 4) | ((b & 15) + (b <= '9' ? 0 : 9))); + for (int k = 0; k < n; k++) + { byte a = chunk[k << 1], b = chunk[(k << 1) | 1]; + chunk[k] = (byte)((((a & 15) + (a <= '9' ? 0 : 9)) << 4) | ((b & 15) + (b <= '9' ? 0 : 9))); } SHA3.update(chunk, n); } @@ -374,7 +374,7 @@ public class sha3sum bs = stdin; if (multi == 0) { - for (int _ = 1; _ < i; _++) + for (int k = 1; k < i; k++) { SHA3.initialise(r, c, o); bs = SHA3.digest(bs, j == 1); @@ -409,7 +409,7 @@ public class sha3sum out[out.length - 1] = '\n'; System.out.write(out); } - for (int _ = 1; _ < i; _++) + for (int k = 1; k < i; k++) { SHA3.initialise(r, c, o); bs = SHA3.digest(bs, j == 1); @@ -434,9 +434,9 @@ public class sha3sum HashSet got = new HashSet(); String loop = null; byte[] out = new byte[(bs.length << 1)]; - for (int _ = 0; _ < i; _++) + for (int k = 0; k < i; k++) { - if (_ > 0) + if (k > 0) { SHA3.initialise(r, c, o); bs = SHA3.digest(bs, j == 1); if (j > 2) -- cgit v1.2.3-70-g09d2