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

public Class DualECSP800DRBG

extends Object
implements SP80090DRBG
Class Inheritance
All Implemented Interfaces
org.bouncycastle.crypto.prng.drbg.SP80090DRBG
Imports
java.math.BigInteger, org.bouncycastle.asn1.nist.NISTNamedCurves, org.bouncycastle.crypto.Digest, org.bouncycastle.crypto.prng.EntropySource, org.bouncycastle.math.ec.ECCurve, .ECMultiplier, .ECPoint, .FixedPointCombMultiplier, org.bouncycastle.util.Arrays, .BigIntegers

A SP800-90A Dual EC DRBG.

Field Summary

Modifier and TypeField and Description
private ECCurve.Fp
private Digest
private EntropySource
private ECMultiplier
private int
private ECPoint
private ECPoint
private long
private byte[]
private int
private int
private int
private static final int
private static final int
private static final int
private static final DualECPoints[]
private static final BigInteger
private static final BigInteger
private static final BigInteger
private static final BigInteger
private static final BigInteger
private static final BigInteger
private static final BigInteger
private static final BigInteger
private static final BigInteger
private static final BigInteger
private static final BigInteger
private static final BigInteger
private static final long

Constructor Summary

AccessConstructor and Description
public
DualECSP800DRBG(Digest
source digest to use with the DRB stream.
digest
,
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 Dual EC DRBG.

public
DualECSP800DRBG(DualECPoints[]
an array of points to choose from, in order of increasing security strength
pointSet
,
Digest
source digest to use with the DRB stream.
digest
,
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 Dual EC 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 internal 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 BigInteger
private byte[]
pad8(byte[] s, int seedlen)

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.

private byte[]
xor(byte[] a, byte[] b)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_curveback to summary
private ECCurve.Fp _curve
_digestback to summary
private Digest _digest
_entropySourceback to summary
private EntropySource _entropySource
_fixedPointMultiplierback to summary
private ECMultiplier _fixedPointMultiplier
_outlenback to summary
private int _outlen
_Pback to summary
private ECPoint _P
_Qback to summary
private ECPoint _Q
_reseedCounterback to summary
private long _reseedCounter
_sback to summary
private byte[] _s
_securityStrengthback to summary
private int _securityStrength
_seedlenback to summary
private int _seedlen
_sLengthback to summary
private int _sLength
MAX_ADDITIONAL_INPUTback to summary
private static final int MAX_ADDITIONAL_INPUT
MAX_ENTROPY_LENGTHback to summary
private static final int MAX_ENTROPY_LENGTH
MAX_PERSONALIZATION_STRINGback to summary
private static final int MAX_PERSONALIZATION_STRING
nistPointsback to summary
private static final DualECPoints[] nistPoints
p256_Pxback to summary
private static final BigInteger p256_Px
p256_Pyback to summary
private static final BigInteger p256_Py
p256_Qxback to summary
private static final BigInteger p256_Qx
p256_Qyback to summary
private static final BigInteger p256_Qy
p384_Pxback to summary
private static final BigInteger p384_Px
p384_Pyback to summary
private static final BigInteger p384_Py
p384_Qxback to summary
private static final BigInteger p384_Qx
p384_Qyback to summary
private static final BigInteger p384_Qy
p521_Pxback to summary
private static final BigInteger p521_Px
p521_Pyback to summary
private static final BigInteger p521_Py
p521_Qxback to summary
private static final BigInteger p521_Qx
p521_Qyback to summary
private static final BigInteger p521_Qy
RESEED_MAXback to summary
private static final long RESEED_MAX

Constructor Detail

DualECSP800DRBGback to summary
public DualECSP800DRBG(Digest digest, int securityStrength, EntropySource entropySource, byte[] personalizationString, byte[] nonce)

Construct a SP800-90A Dual EC DRBG.

Minimum entropy requirement is the security strength requested.

Parameters
digest:Digest

source digest to use with the DRB stream.

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

DualECSP800DRBGback to summary
public DualECSP800DRBG(DualECPoints[] pointSet, Digest digest, int securityStrength, EntropySource entropySource, byte[] personalizationString, byte[] nonce)

Construct a SP800-90A Dual EC DRBG.

Minimum entropy requirement is the security strength requested.

Parameters
pointSet:DualECPoints[]

an array of points to choose from, in order of increasing security strength

digest:Digest

source digest to use with the DRB stream.

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 internal round of the DRBG.

getEntropyback to summary
private byte[] getEntropy()
getScalarMultipleXCoordback to summary
private BigInteger getScalarMultipleXCoord(ECPoint p, BigInteger s)
pad8back to summary
private byte[] pad8(byte[] s, int seedlen)
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.

xorback to summary
private byte[] xor(byte[] a, byte[] b)