I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 49eeed6a authored by zzz's avatar zzz
Browse files

* Crypto: Comment out some main()

parent 35e89b76
No related branches found
No related tags found
No related merge requests found
......@@ -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);
****/
/****
}
****/
}
......@@ -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));
}
****/
}
......@@ -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);
}
****/
}
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment