diff --git a/core/java/src/net/i2p/crypto/DSAEngine.java b/core/java/src/net/i2p/crypto/DSAEngine.java index ae1e708087bdf1bc8c27330ce3774390b2dc744c..fb37bbef19d8adc726c18842aadfd7628020b318 100644 --- a/core/java/src/net/i2p/crypto/DSAEngine.java +++ b/core/java/src/net/i2p/crypto/DSAEngine.java @@ -460,6 +460,7 @@ public class DSAEngine { * * TheCrypto is about 5-15% faster than java.security. */ +/**** public static void main(String args[]) { I2PAppContext ctx = I2PAppContext.getGlobalContext(); byte data[] = new byte[1024]; @@ -532,7 +533,7 @@ public class DSAEngine { } time = System.currentTimeMillis() - start; System.err.println("JavaLib time (ms): " + time); - +****/ /**** yes, arraycopy is slower for 20 bytes start = System.currentTimeMillis(); byte b[] = new byte[20]; @@ -553,5 +554,7 @@ public class DSAEngine { time = System.currentTimeMillis() - start; System.err.println("loop time (ms): " + time); ****/ +/**** } +****/ } diff --git a/core/java/src/net/i2p/crypto/ElGamalEngine.java b/core/java/src/net/i2p/crypto/ElGamalEngine.java index 1ea312d0ce167de4fbd88ba7d7d52043a4776b02..be517dec201429b8c11b2f563e1db7bf336089e9 100644 --- a/core/java/src/net/i2p/crypto/ElGamalEngine.java +++ b/core/java/src/net/i2p/crypto/ElGamalEngine.java @@ -55,8 +55,8 @@ import net.i2p.util.SimpleByteCache; */ public class ElGamalEngine { - private Log _log; - private I2PAppContext _context; + private final Log _log; + private final I2PAppContext _context; /** * The ElGamal engine should only be constructed and accessed through the @@ -75,10 +75,6 @@ public class ElGamalEngine { _log = context.logManager().getLog(ElGamalEngine.class); } - private ElGamalEngine() { // nop - } - - /** * Note that this stops the singleton precalc thread. * You don't want to do this if there are multiple routers in the JVM. @@ -176,7 +172,7 @@ public class ElGamalEngine { if (_log.shouldLog(Log.WARN)) _log.warn("Took too long to encrypt ElGamal block (" + diff + "ms)"); } - _context.statManager().addRateData("crypto.elGamal.encrypt", diff, diff); + _context.statManager().addRateData("crypto.elGamal.encrypt", diff, 0); return out; } @@ -238,7 +234,7 @@ public class ElGamalEngine { _log.warn("Took too long to decrypt and verify ElGamal block (" + diff + "ms)"); } - _context.statManager().addRateData("crypto.elGamal.decrypt", diff, diff); + _context.statManager().addRateData("crypto.elGamal.decrypt", diff, 0); if (ok) { //_log.debug("Hash matches: " + DataHelper.toString(hash.getData(), hash.getData().length)); @@ -250,6 +246,7 @@ public class ElGamalEngine { return null; } +/**** public static void main(String args[]) { long eTime = 0; long dTime = 0; @@ -306,4 +303,5 @@ public class ElGamalEngine { + " average decryption time: " + (dTime / numRuns) + " average key generation time: " + (gTime / numRuns)); } +****/ } diff --git a/core/java/src/net/i2p/crypto/SHA256Generator.java b/core/java/src/net/i2p/crypto/SHA256Generator.java index 23efa3b36137c8417032f97e84a929bb84ce845f..9dfbd793352ebf102121c63c079668b4fdc62091 100644 --- a/core/java/src/net/i2p/crypto/SHA256Generator.java +++ b/core/java/src/net/i2p/crypto/SHA256Generator.java @@ -151,6 +151,7 @@ public final class SHA256Generator { * gij 40 22417 988 * </pre> */ +/**** public static void main(String args[]) { if (args.length <= 0) { System.err.println("Usage: SHA256Generator string"); @@ -189,4 +190,5 @@ public final class SHA256Generator { System.out.println("JVM time (ms): " + time); } +****/ } diff --git a/core/java/src/net/i2p/crypto/YKGenerator.java b/core/java/src/net/i2p/crypto/YKGenerator.java index 2938226923072b9896f39f43f754d87e14ca5833..f2c3e65845cc9abd7ee8042797e7fe503bbbcec5 100644 --- a/core/java/src/net/i2p/crypto/YKGenerator.java +++ b/core/java/src/net/i2p/crypto/YKGenerator.java @@ -167,6 +167,7 @@ class YKGenerator { return yk; } +/**** private static final int RUNS = 500; public static void main(String args[]) { @@ -182,7 +183,9 @@ class YKGenerator { // 14 ms each on a 2008 netbook (with jbigi) System.out.println("YK fetch time for " + RUNS + " runs: " + negTime + " @ " + (negTime / RUNS) + "ms each"); } +****/ + /** the thread */ private static class YKPrecalcRunner implements Runnable { private final int _minSize; private final int _maxSize;