net.burtleburtle.bob.rand
Class ISAACEngine

java.lang.Object
  extended by java.security.SecureRandomSpi
      extended by net.burtleburtle.bob.rand.ISAACEngine
All Implemented Interfaces:
java.io.Serializable

public class ISAACEngine
extends java.security.SecureRandomSpi

This class defines the Service Provider for the ISAAC algorithm.

Author:
Daniel Berlin
See Also:
Serialized Form

Constructor Summary
ISAACEngine()
          Creates a new instance and seeds it with random data obtained from java.security.SecureRandom's getSeed() method.
 
Method Summary
 byte[] engineGenerateSeed(int numBytes)
          Returns the given number of seed bytes computed using the ISAAC algorithm.
 void engineNextBytes(byte[] bytes)
          Generates a user-specified number of random bytes.
 void engineSetSeed(byte[] seed)
          Reseeds this random object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ISAACEngine

public ISAACEngine()
Creates a new instance and seeds it with random data obtained from java.security.SecureRandom's getSeed() method.

Method Detail

engineGenerateSeed

public byte[] engineGenerateSeed(int numBytes)
Returns the given number of seed bytes computed using the ISAAC algorithm.
It just calls engineNextBytes() internally.
This call may be used to seed other random number generators.

Specified by:
engineGenerateSeed in class java.security.SecureRandomSpi
Parameters:
numBytes - The number of seed bytes to generate.
Returns:
The seed bytes.

engineNextBytes

public void engineNextBytes(byte[] bytes)
Generates a user-specified number of random bytes.

Specified by:
engineNextBytes in class java.security.SecureRandomSpi
Parameters:
bytes - The array to fill with random bytes.

engineSetSeed

public void engineSetSeed(byte[] seed)
Reseeds this random object. The given seed supplements, rather than replaces, the existing seed.

Specified by:
engineSetSeed in class java.security.SecureRandomSpi
Parameters:
seed - The seed.