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

public Class HMacSP800DRBG

extends Object
implements SP80090DRBG
Class Inheritance
All Implemented Interfaces
org.bouncycastle.crypto.prng.drbg.SP80090DRBG
Imports
org.bouncycastle.crypto.Mac, org.bouncycastle.crypto.params.KeyParameter, org.bouncycastle.crypto.prng.EntropySource, org.bouncycastle.util.Arrays

A SP800-90A HMAC DRBG.

Field Summary

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

Constructor Summary

AccessConstructor and Description
public
HMacSP800DRBG(Mac
Hash MAC to base the DRBG on.
hMac
,
int
security strength required (in bits)
securityStrength
,
EntropySource
source of entropy to use for seeding/reseeding.
entropySource
,
byte[]
personalization string to distinguish this DRBG (may be null).
personalizationString
,
byte[]
nonce to further distinguish this DRBG (may be null).
nonce
)

Construct a SP800-90A Hash DRBG.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

number of bits generated, -1 if a reseed required.
generate
(byte[]
output array for generated bits.
output
,
byte[]
additional input to be added to the DRBG in this step.
additionalInput
,
boolean
true if a reseed should be forced, false otherwise.
predictionResistant
)

Implements org.bouncycastle.crypto.prng.drbg.SP80090DRBG.generate.

Populate a passed in array with random data.

public int

Returns:

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

Implements org.bouncycastle.crypto.prng.drbg.SP80090DRBG.getBlockSize.

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

private byte[]
private void
hmac_DRBG_Update(byte[] seedMaterial)

private void
hmac_DRBG_Update_Func(byte[] seedMaterial, byte vValue)

public void
reseed(byte[]
additional input to be added to the DRBG in this step.
additionalInput
)

Implements org.bouncycastle.crypto.prng.drbg.SP80090DRBG.reseed.

Reseed the DRBG.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_entropySourceback to summary
private EntropySource _entropySource
_hMacback to summary
private Mac _hMac
_Kback to summary
private byte[] _K
_reseedCounterback to summary
private long _reseedCounter
_securityStrengthback to summary
private int _securityStrength
_Vback to summary
private byte[] _V
MAX_BITS_REQUESTback to summary
private static final int MAX_BITS_REQUEST
RESEED_MAXback to summary
private static final long RESEED_MAX

Constructor Detail

HMacSP800DRBGback to summary
public HMacSP800DRBG(Mac hMac, int securityStrength, EntropySource entropySource, byte[] personalizationString, byte[] nonce)

Construct a SP800-90A Hash DRBG.

Minimum entropy requirement is the security strength requested.

Parameters
hMac:Mac

Hash MAC to base the DRBG on.

securityStrength:int

security strength required (in bits)

entropySource:EntropySource

source of entropy to use for seeding/reseeding.

personalizationString:byte[]

personalization string to distinguish this DRBG (may be null).

nonce:byte[]

nonce to further distinguish this DRBG (may be null).

Method Detail

generateback to summary
public int generate(byte[] output, byte[] additionalInput, boolean predictionResistant)

Implements org.bouncycastle.crypto.prng.drbg.SP80090DRBG.generate.

Populate a passed in array with random data.

Parameters
output:byte[]

output array for generated bits.

additionalInput:byte[]

additional input to be added to the DRBG in this step.

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()

Implements org.bouncycastle.crypto.prng.drbg.SP80090DRBG.getBlockSize.

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

Returns:int

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

getEntropyback to summary
private byte[] getEntropy()
hmac_DRBG_Updateback to summary
private void hmac_DRBG_Update(byte[] seedMaterial)
hmac_DRBG_Update_Funcback to summary
private void hmac_DRBG_Update_Func(byte[] seedMaterial, byte vValue)
reseedback to summary
public void reseed(byte[] additionalInput)

Implements org.bouncycastle.crypto.prng.drbg.SP80090DRBG.reseed.

Reseed the DRBG.

Parameters
additionalInput:byte[]

additional input to be added to the DRBG in this step.