From 7f467dbdc8b94e02fdcc5c88f2e6fe1413a9fe68 Mon Sep 17 00:00:00 2001 From: zzz <zzz@mail.i2p> Date: Mon, 14 Nov 2011 15:05:26 +0000 Subject: [PATCH] cleanups --- core/java/src/net/i2p/crypto/KeyGenerator.java | 12 +++++++++--- core/java/src/net/i2p/crypto/SHA1.java | 2 ++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/core/java/src/net/i2p/crypto/KeyGenerator.java b/core/java/src/net/i2p/crypto/KeyGenerator.java index 03ef12624a..eb7d7aab86 100644 --- a/core/java/src/net/i2p/crypto/KeyGenerator.java +++ b/core/java/src/net/i2p/crypto/KeyGenerator.java @@ -30,11 +30,11 @@ import net.i2p.util.RandomSource; * @author jrandom */ public class KeyGenerator { - private final Log _log; + //private final Log _log; private final I2PAppContext _context; public KeyGenerator(I2PAppContext context) { - _log = context.logManager().getLog(KeyGenerator.class); + //_log = context.logManager().getLog(KeyGenerator.class); _context = context; } @@ -55,7 +55,12 @@ public class KeyGenerator { } private static final int PBE_ROUNDS = 1000; - /** PBE the passphrase with the salt */ + + /** + * PBE the passphrase with the salt. + * Warning - SLOW + * @deprecated unused + */ public SessionKey generateSessionKey(byte salt[], byte passphrase[]) { byte salted[] = new byte[16+passphrase.length]; System.arraycopy(salt, 0, salted, 0, Math.min(salt.length, 16)); @@ -68,6 +73,7 @@ public class KeyGenerator { /** standard exponent size */ private static final int PUBKEY_EXPONENT_SIZE_FULL = 2048; + /** * short exponent size, which should be safe for use with the Oakley primes, * per "On Diffie-Hellman Key Agreement with Short Exponents" - van Oorschot, Weiner diff --git a/core/java/src/net/i2p/crypto/SHA1.java b/core/java/src/net/i2p/crypto/SHA1.java index c8c54306da..4e5e004d3e 100644 --- a/core/java/src/net/i2p/crypto/SHA1.java +++ b/core/java/src/net/i2p/crypto/SHA1.java @@ -759,6 +759,7 @@ public final class SHA1 extends MessageDigest implements Cloneable { * * @since 0.8.7 */ +/**** public static void main(String args[]) { if (args.length <= 0) { System.err.println("Usage: SHA1 string"); @@ -797,4 +798,5 @@ public final class SHA1 extends MessageDigest implements Cloneable { System.out.println("JVM time (ms): " + time); } +****/ } -- GitLab