Author: toad
Date: 2007-07-10 17:08:53 +0000 (Tue, 10 Jul 2007)
New Revision: 14018
Modified:
trunk/freenet/src/freenet/crypt/DSAPrivateKey.java
Log:
0 < x < q (very unlikely that 0 would ever be chosen randomly, but lets not
take that risk)
Modified: trunk/freenet/src/freenet/crypt/DSAPrivateKey.java
===================================================================
--- trunk/freenet/src/freenet/crypt/DSAPrivateKey.java 2007-07-10 16:40:52 UTC
(rev 14017)
+++ trunk/freenet/src/freenet/crypt/DSAPrivateKey.java 2007-07-10 17:08:53 UTC
(rev 14018)
@@ -35,7 +35,7 @@
BigInteger tempX;
do {
tempX = new NativeBigInteger(256, r);
- } while (tempX.compareTo(g.getQ()) > -1);
+ } while (tempX.compareTo(g.getQ()) > -1 ||
tempX.equals(BigInteger.ZERO));
this.x = tempX;
}