cryptix.math
Class PRSG

java.lang.Object
  |
  +--cryptix.math.PRSG

public final class PRSG
extends java.lang.Object

A pseudo-random sequence generator based on a 160-bit LFSR (this is not a cryptographically secure generator).

Copyright © 1995-1997 Systemics Ltd on behalf of the Cryptix Development Team.
All rights reserved.

$Revision: 1.1.1.1 $

Since:
Cryptix 2.2
Author:
unattributed

Field Summary
(package private)  int i0
           
(package private)  int i1
           
(package private)  int i2
           
(package private)  int i3
           
(package private)  int i4
           
 
Constructor Summary
PRSG(byte[] b)
          Creates a pseudo random number generator from the seed b.
 
Method Summary
 void clock()
          Moves the internal state on one cycle.
 byte[] toByteArray()
          Returns the current state of the generator.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

i0

int i0

i1

int i1

i2

int i2

i3

int i3

i4

int i4
Constructor Detail

PRSG

public PRSG(byte[] b)
Creates a pseudo random number generator from the seed b.
Parameters:
b - the seed for this generator
Throws:
MathError - if the seed is less than 20 bytes.
Method Detail

toByteArray

public byte[] toByteArray()
Returns the current state of the generator.
Returns:
a 20-byte array representing the current state of the generator.

clock

public void clock()
Moves the internal state on one cycle.