Author: nextgens
Date: 2007-09-29 19:33:23 +0000 (Sat, 29 Sep 2007)
New Revision: 15397

Modified:
   trunk/freenet/src/freenet/crypt/DiffieHellmanLightContext.java
Log:
doh!

Modified: trunk/freenet/src/freenet/crypt/DiffieHellmanLightContext.java
===================================================================
--- trunk/freenet/src/freenet/crypt/DiffieHellmanLightContext.java      
2007-09-29 19:29:05 UTC (rev 15396)
+++ trunk/freenet/src/freenet/crypt/DiffieHellmanLightContext.java      
2007-09-29 19:33:23 UTC (rev 15397)
@@ -57,64 +57,4 @@

                return sharedSecret;
        }
-}
-package freenet.crypt;
-
-import java.math.BigInteger;
-
-import freenet.support.HexUtil;
-import freenet.support.Logger;
-
-import net.i2p.util.NativeBigInteger;
-
-public class DiffieHellmanLightContext {
-
-       /** My exponent.*/
-       public final NativeBigInteger myExponent;
-       /** My exponential. This is group.g ^ myExponent mod group.p */
-       public final NativeBigInteger myExponential;
-       /** The signature of (g^r, grpR) */
-       public DSASignature signature = null;
-       
-       private final boolean logMINOR;
-
-       public String toString() {
-               StringBuffer sb = new StringBuffer();
-               sb.append(super.toString());
-               sb.append(": myExponent=");
-               sb.append(myExponent.toHexString());
-               sb.append(", myExponential=");
-               sb.append(myExponential.toHexString());
-               
-               return sb.toString();
-       }
-
-       public DiffieHellmanLightContext(NativeBigInteger myExponent, 
NativeBigInteger myExponential) {
-               this.myExponent = myExponent;
-               this.myExponential = myExponential;
-               logMINOR = Logger.shouldLog(Logger.MINOR, this);
-       }
-       
-       public void setSignature(DSASignature sig) {
-               this.signature = sig;
-       }
-       
-       /*
-        * Calling the following is costy; avoid
-        */
-       public NativeBigInteger getHMACKey(NativeBigInteger peerExponential, 
DHGroup group) {
-               BigInteger P = group.getP();
-               NativeBigInteger sharedSecret =
-                       (NativeBigInteger) peerExponential.modPow(myExponent, 
P);
-
-               if(logMINOR) {
-                       Logger.minor(this, "P: "+HexUtil.biToHex(P));
-                       Logger.minor(this, "My exponent: 
"+myExponent.toHexString());
-                       Logger.minor(this, "My exponential: 
"+myExponential.toHexString());
-                       Logger.minor(this, "Peer's exponential: 
"+peerExponential.toHexString());
-                       Logger.minor(this, "g^ir mod p = " + 
sharedSecret.toHexString());
-               }
-               
-               return sharedSecret;
-       }
 }
\ No newline at end of file


Reply via email to