test cleanup

This commit is contained in:
zzz
2012-03-23 17:01:24 +00:00
parent c2e36453b8
commit c1a7f90860

View File

@ -30,6 +30,7 @@ import freenet.support.CPUInformation.VIACPUInfo;
import freenet.support.CPUInformation.UnknownCPUException;
import net.i2p.I2PAppContext;
import net.i2p.crypto.CryptoConstants;
import net.i2p.data.DataHelper;
/**
@ -324,11 +325,6 @@ public class NativeBigInteger extends BigInteger {
return cachedBa;
}
/** @deprecated unused, does not call native */
@Override
public double doubleValue() {
return super.doubleValue();
}
/**
*
* @return True iff native methods will be used by this class
@ -362,26 +358,16 @@ public class NativeBigInteger extends BigInteger {
runModPowTest(100);
}
/* the sample numbers are elG generator/prime so we can test with reasonable numbers */
private final static byte[] _sampleGenerator = new BigInteger("2").toByteArray();
private final static byte[] _samplePrime = new BigInteger("FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1"
+ "29024E088A67CC74020BBEA63B139B22514A08798E3404DD"
+ "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245"
+ "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED"
+ "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D"
+ "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F"
+ "83655D23DCA3AD961C62F356208552BB9ED529077096966D"
+ "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B"
+ "E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9"
+ "DE2BCBF6955817183995497CEA956AE515D2261898FA0510"
+ "15728E5A8AACAA68FFFFFFFFFFFFFFFF", 16).toByteArray();
private static void runModPowTest(int numRuns) {
System.out.println("DEBUG: Warming up the random number generator...");
SecureRandom rand = new SecureRandom();
rand.nextBoolean();
System.out.println("DEBUG: Random number generator warmed up");
/* the sample numbers are elG generator/prime so we can test with reasonable numbers */
byte[] _sampleGenerator = CryptoConstants.elgg.toByteArray();
byte[] _samplePrime = CryptoConstants.elgp.toByteArray();
BigInteger jg = new BigInteger(_sampleGenerator);
BigInteger jp = new BigInteger(_samplePrime);