gnu.crypto.prng

Class Fortuna

Implemented Interfaces:
Cloneable, EventListener, Serializable, IRandom, RandomEventListener

public class Fortuna
extends BasePRNG
implements Serializable, RandomEventListener

The Fortuna continuously-seeded pseudo-random number generator. This generator is composed of two major pieces: the entropy accumulator and the generator function. The former takes in random bits and incorporates them into the generator's state. The latter takes this base entropy and generates pseudo-random bits from it.

There are some things users of this class must be aware of:

must
Serializable

References:

Nested Class Summary

static class
Fortuna.Generator
The Fortuna generator function.

Field Summary

static String
SEED

Fields inherited from class gnu.crypto.prng.BasePRNG

buffer, initialised, name, ndx

Constructor Summary

Fortuna()

Method Summary

void
addRandomByte(byte b)
void
addRandomBytes(byte[] buf, int offset, int length)
void
addRandomEvent(RandomEvent event)
void
fillBlock()
void
setup(Map attributes)

Methods inherited from class gnu.crypto.prng.BasePRNG

addRandomByte, addRandomBytes, addRandomBytes, clone, fillBlock, init, isInitialised, name, nextByte, nextBytes, nextBytes, setup

Field Details

SEED

public static final String SEED

Constructor Details

Fortuna

public Fortuna()

Method Details

addRandomByte

public void addRandomByte(byte b)
Specified by:
addRandomByte in interface IRandom
Overrides:
addRandomByte in interface BasePRNG

addRandomBytes

public void addRandomBytes(byte[] buf,
                           int offset,
                           int length)
Specified by:
addRandomBytes in interface IRandom
Overrides:
addRandomBytes in interface BasePRNG

addRandomEvent

public void addRandomEvent(RandomEvent event)
Specified by:
addRandomEvent in interface RandomEventListener

fillBlock

public void fillBlock()
            throws LimitReachedException
Overrides:
fillBlock in interface BasePRNG

setup

public void setup(Map attributes)
Overrides:
setup in interface BasePRNG

Copyright © 2001, 2002, 2003 Free Software Foundation, Inc. All Rights Reserved.