|
SSJ V. 1.2.5. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectumontreal.iro.lecuyer.rng.RandomStreamBase
umontreal.iro.lecuyer.rng.RandRijndael
public class 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 .
| Constructor Summary | |
|---|---|
RandRijndael()
Constructs a new stream. |
|
RandRijndael(String name)
Constructs a new stream with the identifier name (used in the toString method). |
|
| Method Summary | |
|---|---|
byte[] |
getState()
Returns the current state of the stream, represented as an array of four integers. |
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)
Sets the initial seed for the class RandRijndael to the 16 bytes of the vector seed[0..15]. |
void |
setSeed(byte[] seed)
This method is discouraged for normal use. |
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 |
|---|
public RandRijndael()
public RandRijndael(String name)
name - name of the stream| Method Detail |
|---|
public static void setPackageSeed(byte[] seed)
seed - array of 16 elements representing the seedpublic void setSeed(byte[] seed)
seed - array of 16 elements representing the seedpublic byte[] getState()
public void resetStartStream()
RandomStream
resetStartStream in interface RandomStreamresetStartStream in class RandomStreamBasepublic void resetStartSubstream()
RandomStream
resetStartSubstream in interface RandomStreamresetStartSubstream in class RandomStreamBasepublic void resetNextSubstream()
RandomStream
resetNextSubstream in interface RandomStreamresetNextSubstream in class RandomStreamBasepublic String toString()
RandomStream
toString in interface RandomStreamtoString in class RandomStreamBase
|
SSJ V. 1.2.5. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||