Top Fields Constructors Methods
org.bouncycastle.crypto.prng

public Class X931RNG

extends Object
Class Inheritance
Imports
org.bouncycastle.crypto.BlockCipher

Field Summary

Modifier and TypeField and Description
private static final int
private static final long
private static final int
private static final long
private final byte[]
private final BlockCipher
private final EntropySource
private final byte[]
I

private final byte[]
R

private long
private byte[]
V

Constructor Summary

AccessConstructor and Description
public
X931RNG(BlockCipher engine, byte[] dateTimeVector, EntropySource entropySource)

Method Summary

Modifier and TypeMethod and Description
pack-priv int

Returns:

number of bits generated, -1 if a reseed required.
generate
(byte[]
output array for generated bits.
output
,
boolean
true if a reseed should be forced, false otherwise.
predictionResistant
)

Populate a passed in array with random data.

pack-priv EntropySource
private void
increment(byte[] val)

private static boolean
isTooLarge(byte[] bytes, int maxBytes)

private void
process(byte[] res, byte[] a, byte[] b)

pack-priv void
reseed()

Reseed the RNG.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BLOCK128_MAX_BITS_REQUESTback to summary
private static final int BLOCK128_MAX_BITS_REQUEST
BLOCK128_RESEED_MAXback to summary
private static final long BLOCK128_RESEED_MAX
BLOCK64_MAX_BITS_REQUESTback to summary
private static final int BLOCK64_MAX_BITS_REQUEST
BLOCK64_RESEED_MAXback to summary
private static final long BLOCK64_RESEED_MAX
DTback to summary
private final byte[] DT
engineback to summary
private final BlockCipher engine
entropySourceback to summary
private final EntropySource entropySource
Iback to summary
private final byte[] I
Rback to summary
private final byte[] R
reseedCounterback to summary
private long reseedCounter
Vback to summary
private byte[] V

Constructor Detail

X931RNGback to summary
public X931RNG(BlockCipher engine, byte[] dateTimeVector, EntropySource entropySource)

Method Detail

generateback to summary
pack-priv int generate(byte[] output, boolean predictionResistant)

Populate a passed in array with random data.

Parameters
output:byte[]

output array for generated bits.

predictionResistant:boolean

true if a reseed should be forced, false otherwise.

Returns:int

number of bits generated, -1 if a reseed required.

getEntropySourceback to summary
pack-priv EntropySource getEntropySource()
incrementback to summary
private void increment(byte[] val)
isTooLargeback to summary
private static boolean isTooLarge(byte[] bytes, int maxBytes)
processback to summary
private void process(byte[] res, byte[] a, byte[] b)
reseedback to summary
pack-priv void reseed()

Reseed the RNG.