Top Description Fields Constructors Methods
org.bouncycastle.crypto.prng

public Class ReversedWindowGenerator

extends Object
implements RandomGenerator
Class Inheritance
All Implemented Interfaces
org.bouncycastle.crypto.prng.RandomGenerator

Takes bytes generated by an underling RandomGenerator and reverses the order in each small window (of configurable size).

Access to internals is synchronized so a single one of these can be shared.

Field Summary

Modifier and TypeField and Description
private final RandomGenerator
private byte[]
private int

Constructor Summary

AccessConstructor and Description
public
ReversedWindowGenerator(RandomGenerator generator, int windowSize)

Method Summary

Modifier and TypeMethod and Description
public void
addSeedMaterial(byte[]
a byte array to be mixed into the generator's state.
seed
)

Implements org.bouncycastle.crypto.prng.RandomGenerator.addSeedMaterial.

Add more seed material to the generator.
public void
addSeedMaterial(long
a long value to be mixed into the generator's state.
seed
)

Implements org.bouncycastle.crypto.prng.RandomGenerator.addSeedMaterial.

Add more seed material to the generator.
private void
doNextBytes(byte[] bytes, int start, int len)

public void
nextBytes(byte[]
byte array to be filled.
bytes
)

Implements org.bouncycastle.crypto.prng.RandomGenerator.nextBytes.

Fill bytes with random values.
public void
nextBytes(byte[]
byte array to be filled.
bytes
,
int
index to start filling at.
start
,
int
length of segment to fill.
len
)

Implements org.bouncycastle.crypto.prng.RandomGenerator.nextBytes.

Fill part of bytes with random values.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

generatorback to summary
private final RandomGenerator generator
windowback to summary
private byte[] window
windowCountback to summary
private int windowCount

Constructor Detail

ReversedWindowGeneratorback to summary
public ReversedWindowGenerator(RandomGenerator generator, int windowSize)

Method Detail

addSeedMaterialback to summary
public void addSeedMaterial(byte[] seed)

Implements org.bouncycastle.crypto.prng.RandomGenerator.addSeedMaterial.

Add more seed material to the generator.

Parameters
seed:byte[]

a byte array to be mixed into the generator's state.

addSeedMaterialback to summary
public void addSeedMaterial(long seed)

Implements org.bouncycastle.crypto.prng.RandomGenerator.addSeedMaterial.

Add more seed material to the generator.

Parameters
seed:long

a long value to be mixed into the generator's state.

doNextBytesback to summary
private void doNextBytes(byte[] bytes, int start, int len)
nextBytesback to summary
public void nextBytes(byte[] bytes)

Implements org.bouncycastle.crypto.prng.RandomGenerator.nextBytes.

Fill bytes with random values.

Parameters
bytes:byte[]

byte array to be filled.

nextBytesback to summary
public void nextBytes(byte[] bytes, int start, int len)

Implements org.bouncycastle.crypto.prng.RandomGenerator.nextBytes.

Fill part of bytes with random values.

Parameters
bytes:byte[]

byte array to be filled.

start:int

index to start filling at.

len:int

length of segment to fill.