aboutsummaryrefslogtreecommitdiffstats
path: root/pure-java
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2013-02-05 16:48:09 +0100
committerMattias Andrée <maandree@operamail.com>2013-02-05 16:48:09 +0100
commit0e4ee7b1718d23c3ebc4e2dd35af2f0d4b2d05ca (patch)
tree7b8ffdda4be4f9dd429f91f7ec5774a23fa37cf4 /pure-java
parentupdate status (diff)
downloadsha3sum-0e4ee7b1718d23c3ebc4e2dd35af2f0d4b2d05ca.tar.gz
sha3sum-0e4ee7b1718d23c3ebc4e2dd35af2f0d4b2d05ca.tar.bz2
sha3sum-0e4ee7b1718d23c3ebc4e2dd35af2f0d4b2d05ca.tar.xz
beginning of porting the command to c
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'pure-java')
-rw-r--r--pure-java/sha3sum.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/pure-java/sha3sum.java b/pure-java/sha3sum.java
index ec00958..79a436f 100644
--- a/pure-java/sha3sum.java
+++ b/pure-java/sha3sum.java
@@ -52,7 +52,7 @@ public class sha3sum
if (cmd.indexOf('/') >= 0)
cmd = cmd.substring(cmd.lastIndexOf('/') + 1);
if (cmd.endsWith(".jar"))
- cmd = cmd.substring(0, cmd.length() - 3);
+ cmd = cmd.substring(0, cmd.length() - 4);
cmd = cmd.intern();
int _o, o = _o = 512; /* --outputsize */
@@ -60,7 +60,7 @@ public class sha3sum
else if (cmd == "sha3-256sum") o = _o = 256;
else if (cmd == "sha3-384sum") o = _o = 384;
else if (cmd == "sha3-512sum") o = _o = 512;
- int _s, s = _s = 1600; /* --statesiz e */
+ int _s, s = _s = 1600; /* --statesize */
int _r, r = _r = s - (o << 1); /* --bitrate */
int _c, c = _c = s - r; /* --capacity */
int _w, w = _w = s / 25; /* --wordsize */
@@ -82,6 +82,7 @@ public class sha3sum
linger[0] = linger[0].intern();
if ((linger[0] == "-h") || (linger[0] == "--help"))
{
+ System.out.println("");
System.out.println("SHA-3/Keccak checksum calculator");
System.out.println("");
System.out.println("USAGE: sha3sum [option...] < file");
@@ -127,6 +128,7 @@ public class sha3sum
System.out.println("");
System.out.println("You should have received a copy of the GNU General Public License");
System.out.println("along with this program. If not, see <http://www.gnu.org/licenses/>.");
+ System.out.println("");
System.exit(2);
}
else
@@ -195,7 +197,7 @@ public class sha3sum
files[fptr++] = null;
if (i < 1)
{
- System.err.println(cmd + ": sorry, I will only do at least one iteration!\n");
+ System.err.println(cmd + ": sorry, I will only do at least one iteration!");
System.exit(3);
}