SSJ
V. labo.

umontreal.iro.lecuyer.rng
Class RandRijndael

java.lang.Object
  extended by umontreal.iro.lecuyer.rng.RandomStreamBase
      extended by umontreal.iro.lecuyer.rng.RandRijndael
All Implemented Interfaces:
Serializable, Cloneable, CloneableRandomStream, RandomStream

public class RandRijndael
extends RandomStreamBase

RandRijndael

Implements a RNG using the Rijndael block cipher algorithm (AES) with key and block lengths of 128 bits. A block of 128 bits is encrypted by the Rijndael algorithm to generate 128 pseudo-random bits. Those bits are split into four words of 32 bits which are returned successively by the method nextValue. The unencrypted block is the state of the generator. It is incremented by 1 at every four calls to nextValue. Thus, the period is 2130 and jumping ahead is easy. The values of V, W and Z are 240, 242 and 282, respectively (see RandomStream for their definition). Seeds/states must be given as 16-dimensional vectors of bytes (8-bit integers). The default initial seed is a vector filled with zeros.

The Rijndael implementation used here is that of the Cryptix Development Team, which can be found on the Rijndael creators' page http://www.esat.kuleuven.ac.be/ rijmen/rijndael/ .

See Also:
Serialized Form

Constructor Summary
RandRijndael()
          .
RandRijndael(String name)
          .
 
Method Summary
 RandRijndael clone()
          .
 byte[] getState()
          .
 void resetNextSubstream()
          Reinitializes the stream to the beginning of its next substream: Ng is computed, and Cg and Bg are set to Ng.
 void resetStartStream()
          Reinitializes the stream to its initial state Ig: Cg and Bg are set to Ig.
 void resetStartSubstream()
          Reinitializes the stream to the beginning of its current substream: Cg is set to Bg.
static void setPackageSeed(byte[] seed)
          .
 void setSeed(byte[] seed)
          .
 String toString()
          Returns a string containing the current state of this stream.
 
Methods inherited from class umontreal.iro.lecuyer.rng.RandomStreamBase
formatState, formatStateFull, increasedPrecision, nextArrayOfDouble, nextArrayOfInt, nextDouble, nextInt
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RandRijndael

public RandRijndael()
. \begin{tabb}Constructs a new stream.
 \end{tabb}


RandRijndael

public RandRijndael(String name)
. \begin{tabb}Constructs a new stream with the identifier \texttt{name}
 (used in the \texttt{toString} method).
 \end{tabb}
namename of the stream

Method Detail

setPackageSeed

public static void setPackageSeed(byte[] seed)
. \begin{tabb}Sets the initial seed for the class \texttt{RandRijndael} to the
 16...
 ...am.
 The default seed for the first stream is $(0, 0, \ldots, 0, 0)$.
 \end{tabb}
seedarray of 16 elements representing the seed


setSeed

public void setSeed(byte[] seed)
. \begin{tabb}This method is discouraged for normal use.
 Initializes the stream a...
 ...exttt{reset...} methods
 and of the stream constructor is preferable.
 \end{tabb}
seedarray of 16 elements representing the seed


getState

public byte[] getState()
. \begin{tabb}Returns the current state of the stream, represented as an
 array of...
 ... of these 4 which will be returned next is not
 given by this method.
 \end{tabb}
the current state of the stream


clone

public RandRijndael clone()
. \begin{tabb}Clones the current generator and return its copy.
 \end{tabb}
A deep copy of the current generator

Specified by:
clone in interface CloneableRandomStream
Overrides:
clone in class RandomStreamBase
Returns:
A deep copy of the current generator

resetStartStream

public void resetStartStream()
Description copied from interface: RandomStream
Reinitializes the stream to its initial state Ig: Cg and Bg are set to Ig.

Specified by:
resetStartStream in interface RandomStream
Specified by:
resetStartStream in class RandomStreamBase

resetStartSubstream

public void resetStartSubstream()
Description copied from interface: RandomStream
Reinitializes the stream to the beginning of its current substream: Cg is set to Bg.

Specified by:
resetStartSubstream in interface RandomStream
Specified by:
resetStartSubstream in class RandomStreamBase

resetNextSubstream

public void resetNextSubstream()
Description copied from interface: RandomStream
Reinitializes the stream to the beginning of its next substream: Ng is computed, and Cg and Bg are set to Ng.

Specified by:
resetNextSubstream in interface RandomStream
Specified by:
resetNextSubstream in class RandomStreamBase

toString

public String toString()
Description copied from interface: RandomStream
Returns a string containing the current state of this stream.

Specified by:
toString in interface RandomStream
Specified by:
toString in class RandomStreamBase
Returns:
the state of the generator formated as a string

SSJ
V. labo.

To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.