[freenet-cvs] r15517 - trunk/freenet/src/freenet/crypt
nextgens at freenetproject.org
nextgens at freenetproject.org
Wed Oct 24 08:30:19 UTC 2007
Author: nextgens
Date: 2007-10-24 08:30:18 +0000 (Wed, 24 Oct 2007)
New Revision: 15517
Modified:
trunk/freenet/src/freenet/crypt/DiffieHellman.java
Log:
indent
Modified: trunk/freenet/src/freenet/crypt/DiffieHellman.java
===================================================================
--- trunk/freenet/src/freenet/crypt/DiffieHellman.java 2007-10-23 23:20:49 UTC (rev 15516)
+++ trunk/freenet/src/freenet/crypt/DiffieHellman.java 2007-10-24 08:30:18 UTC (rev 15517)
@@ -13,7 +13,7 @@
import net.i2p.util.NativeBigInteger;
public class DiffieHellman {
-
+
/**
* When the number of precalculations falls below this threshold generation
* starts up to make more.
@@ -63,23 +63,23 @@
precalcThread.setPriority(Thread.NORM_PRIORITY);
synchronized (precalcerWaitObj) {
- try {
+ try {
// Do not set the thread priority here because the
// thread may have been stopped while holding the
// precalcerWaitObj lock. The stop causes the thread
// group to be cleared and setPriority to throw a NPE.
precalcerWaitObj.wait(PRECALC_TIMEOUT);
// TODO: this timeout might very well be unneccsary
- } catch (InterruptedException ie) {
- // Ignored.
- }
+ } catch (InterruptedException ie) {
+ // Ignored.
}
}
}
}
+ }
public static void init(Random random) {
- r = random;
+ r = random;
precalcThread.start();
}
@@ -122,7 +122,7 @@
}
return new DiffieHellmanLightContext(params[0], params[1]);
}
-
+
public static NativeBigInteger[] getParams() {
synchronized (precalcBuffer) {
//Ensure that we will have something to pop (at least pretty soon)
@@ -131,7 +131,7 @@
if(!precalcBuffer.isEmpty()) {
return (NativeBigInteger[]) precalcBuffer.pop();
}
-
+
}
return genParams();
}
@@ -148,12 +148,12 @@
return group;
}
- /**
- * @return The length in bytes of the modulus. Exponentials will fit into
- * this length.
- */
- public static int modulusLengthInBytes() {
- int bitLength = getGroup().getP().bitLength();
- return (bitLength/8) + ((bitLength % 8) > 0 ? 1 : 0);
- }
+ /**
+ * @return The length in bytes of the modulus. Exponentials will fit into
+ * this length.
+ */
+ public static int modulusLengthInBytes() {
+ int bitLength = getGroup().getP().bitLength();
+ return (bitLength/8) + ((bitLength % 8) > 0 ? 1 : 0);
+ }
}
More information about the cvs
mailing list