is.logi.crypto.random
Class RandomSpinner
java.lang.Object
|
+--java.util.Random
|
+--is.logi.crypto.random.RandomSpinner
- public class RandomSpinner
- extends java.util.Random
This class uses the scheduler to generate random numbers. It counts the
number of times a loop is repeated before a thread has slept for a
specified number of milliseconds. These numbers are then fed to a hash
function to mask any possible correlations.
Before any random bytes are returned the internal entropy pool is filled
with the specified number of bytes from the scheduler. This initialization
is performed in a separate thread and may take a few seconds. You should
therefore create instances of the RandomSpinner well before using them.
The helper class
which is used to gather entropy was written by
Henry Strickland (strix@versant.com) and
Greg Noel (greg@qualcomm.com). It is based on
similar C code
by Matt Blaze, Jack Lacy, and Don Mitchell.
This generator is normally somewhat slower than the SecureRandom generator in
the java library, since it spends some time collecting entropy.
- Author:
- Logi Ragnarsson (logir@hi.is)
- See Also:
- Serialized Form
Methods inherited from class java.util.Random |
nextBoolean,
nextBytes,
nextDouble,
nextFloat,
nextGaussian,
nextInt,
nextInt,
nextLong,
setSeed |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
RandomSpinner
public RandomSpinner(int initial,
int round)
- Creates a new instance of the RandomSpinner class. It will be
initialized with
initial
bytes from the Spinner and
collect round
bytes from it for every 16 bytes it outputs.
- Parameters:
round
- must be in the range 0..64
RandomSpinner
public RandomSpinner()
Copyright 1997-1999 Logi Ragnarsson