Top Fields Constructors Methods
org.bouncycastle.crypto.prng

public Class VMPCRandomGenerator

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

Field Summary

Modifier and TypeField and Description
private byte
n

private byte[]
P

Permutation generated by code: // First 1850 fractional digit of Pi number.

private byte
s

Value generated in the same way as VMPCRandomGenerator#P;

Constructor Summary

AccessConstructor and Description
public

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.
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

nback to summary
private byte n
Pback to summary
private byte[] P

Permutation generated by code: // First 1850 fractional digit of Pi number. byte[] key = new BigInteger("14159265358979323846...5068006422512520511").toByteArray(); s = 0; P = new byte[256]; for (int i = 0; i < 256; i++) { P[i] = (byte) i; } for (int m = 0; m < 768; m++) { s = P[(s + P[m & 0xff] + key[m % key.length]) & 0xff]; byte temp = P[m & 0xff]; P[m & 0xff] = P[s & 0xff]; P[s & 0xff] = temp; }

sback to summary
private byte s

Value generated in the same way as VMPCRandomGenerator#P;

Constructor Detail

VMPCRandomGeneratorback to summary
public VMPCRandomGenerator()

Method Detail

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

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

Doc from 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.

Doc from 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.

nextBytesback to summary
public void nextBytes(byte[] bytes)

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

Doc from 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.

Doc from 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.