aboutsummaryrefslogtreecommitdiffstats
path: root/pure-java/sha3sum.java
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2013-06-17 00:42:07 +0200
committerMattias Andrée <maandree@operamail.com>2013-06-17 00:42:07 +0200
commit938aa55a95fda70b403fa5cabb43c6cc37292ebf (patch)
treef77e74b2f02b38e35997182984ce2a05aeb146f3 /pure-java/sha3sum.java
parentm + fix for python version (diff)
downloadsha3sum-938aa55a95fda70b403fa5cabb43c6cc37292ebf.tar.gz
sha3sum-938aa55a95fda70b403fa5cabb43c6cc37292ebf.tar.bz2
sha3sum-938aa55a95fda70b403fa5cabb43c6cc37292ebf.tar.xz
change defaults (conflicts with Wikipedia but is based on official Keccak defaults; no defaults have yet been standardised)
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'pure-java/sha3sum.java')
-rw-r--r--pure-java/sha3sum.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/pure-java/sha3sum.java b/pure-java/sha3sum.java
index 783e41b..22427a5 100644
--- a/pure-java/sha3sum.java
+++ b/pure-java/sha3sum.java
@@ -61,8 +61,8 @@ public class sha3sum
else if (cmd == "sha3-384sum") _o = 384;
else if (cmd == "sha3-512sum") _o = 512;
Integer S = null; int _s = 1600; /* --statesize */
- Integer R = null; int _r = _s - (_o << 1); /* --bitrate */
- Integer C = null; int _c = _s - _r; /* --capacity */
+ Integer C = null; int _c = _s - (_o << 1); /* --capacity */
+ Integer R = null; int _r = _s - _c; /* --bitrate */
Integer W = null; int _w = _s / 25; /* --wordsize */
Integer I = null; int _i = 1; /* --iterations */
Integer J = null; int _j = 1; /* --squeezes */
@@ -270,7 +270,7 @@ public class sha3sum
if ((R == null) && (C == null) && (O == null)) // s?
- { r = -((c = (o = ((((s = S == null ? _s : s) << 5) / 100 + 7) >> 3) << 3) << 1) - s);
+ { c = -((r = (o = ((((s = S == null ? _s : s) << 5) / 100 + 7) >> 3) << 3) << 1) - s);
o = o < 8 ? 8 : o;
}
else if ((R == null) && (C == null)) // !o s?