Top Fields Constructors Methods
org.bouncycastle.crypto.general

pack-priv Class X931RNG

extends Object
Class Inheritance
Imports
java.util.HashMap, .Map, org.bouncycastle.crypto.EntropySource, org.bouncycastle.crypto.internal.BlockCipher, org.bouncycastle.util.encoders.Hex

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 BlockCipher
private EntropySource
private final byte[]
I

private static final Map<String, byte[][]>
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.

public int

Returns:

the number of bits produced on each internal round of the DRBG.
getBlockSize
()

Return the block size (in bits) of the DRBG.

private byte[]
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 BlockCipher engine
entropySourceback to summary
private EntropySource entropySource
Iback to summary
private final byte[] I
katsback to summary
private static final Map<String, byte[][]> kats
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.

getBlockSizeback to summary
public int getBlockSize()

Return the block size (in bits) of the DRBG.

Returns:int

the number of bits produced on each internal round of the DRBG.

getEntropyback to summary
private byte[] getEntropy()
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.