Author: nextgens
Date: 2007-10-24 09:53:20 +0000 (Wed, 24 Oct 2007)
New Revision: 15522

Modified:
   trunk/freenet/src/freenet/crypt/DiffieHellman.java
Log:
Revert r15520 to spare some cpu cycles; We are already doing that test below 
when we ensure that g^x < (p-2^24)

Modified: trunk/freenet/src/freenet/crypt/DiffieHellman.java
===================================================================
--- trunk/freenet/src/freenet/crypt/DiffieHellman.java  2007-10-24 09:44:43 UTC 
(rev 15521)
+++ trunk/freenet/src/freenet/crypt/DiffieHellman.java  2007-10-24 09:53:20 UTC 
(rev 15522)
@@ -40,7 +40,6 @@

        public static final BigInteger MIN_EXPONENTIAL_VALUE = new 
BigInteger("2").pow(24);
        public static final BigInteger MAX_EXPONENTIAL_VALUE = 
group.getP().subtract(MIN_EXPONENTIAL_VALUE);
-       public static final BigInteger FORBIDDEN_VALUE = 
group.getP().subtract(BigInteger.ONE);

        static {
                precalcThread = new PrecalcBufferFill();
@@ -176,12 +175,6 @@
                        return false;
                }

-               // Ensure that g^x != (p-1)
-               if(FORBIDDEN_VALUE.compareTo(exponential) == 0) {
-                       Logger.error(caller, "The provided exponential is p-1 
which is unacceptable!");
-                       return false;
-               }
-               
                // Ensure that g^x > 2^24
                if(MIN_EXPONENTIAL_VALUE.compareTo(exponential) > -1) {
                        Logger.error(caller, "The provided exponential is 
smaller than 2^24 which is unacceptable!");


Reply via email to