Random cleanup

This commit is contained in:
zzz
2010-12-15 23:19:34 +00:00
parent fe575a38aa
commit df3fc6e05d
3 changed files with 14 additions and 26 deletions

View File

@ -204,6 +204,7 @@ public class BufferedRandomSource extends RandomSource {
return super.nextGaussian();
}
/*****
public static void main(String args[]) {
for (int i = 0; i < 16; i++)
test();
@ -232,4 +233,5 @@ public class BufferedRandomSource extends RandomSource {
}
return buf.toString();
}
*****/
}

View File

@ -196,6 +196,7 @@ public class PooledRandomSource extends RandomSource {
return prng.harvester();
}
/*****
public static void main(String args[]) {
//PooledRandomSource prng = new PooledRandomSource(I2PAppContext.getGlobalContext());
long start = System.currentTimeMillis();
@ -214,4 +215,5 @@ public class PooledRandomSource extends RandomSource {
System.out.println("Written to random.file: create took " + (created-start) + ", generate took " + (done-created));
prng.saveSeed();
}
*****/
}

View File

@ -72,46 +72,30 @@ public class RandomSource extends SecureRandom implements EntropyHarvester {
/**
* override as synchronized, for those JVMs that don't always pull via
* nextBytes (cough ibm)
*/
@Override
public boolean nextBoolean() { return super.nextBoolean(); }
/**
* override as synchronized, for those JVMs that don't always pull via
* nextBytes (cough ibm)
*/
@Override
public void nextBytes(byte buf[]) { super.nextBytes(buf); }
/**
* override as synchronized, for those JVMs that don't always pull via
* nextBytes (cough ibm)
*/
@Override
public double nextDouble() { return super.nextDouble(); }
/**
* override as synchronized, for those JVMs that don't always pull via
* nextBytes (cough ibm)
*/
@Override
public float nextFloat() { return super.nextFloat(); }
/**
* override as synchronized, for those JVMs that don't always pull via
* nextBytes (cough ibm)
*/
@Override
public double nextGaussian() { return super.nextGaussian(); }
/**
* override as synchronized, for those JVMs that don't always pull via
* nextBytes (cough ibm)
*/
@Override
public int nextInt() { return super.nextInt(); }
/**
* override as synchronized, for those JVMs that don't always pull via
* nextBytes (cough ibm)
*/
@Override
public long nextLong() { return super.nextLong(); }
*****/
/** */
public EntropyHarvester harvester() { return _entropyHarvester; }
public void feedEntropy(String source, long data, int bitoffset, int bits) {