Top Description Fields Constructors Methods
org.bouncycastle.crypto.fips

pack-priv Class BaseKDFBytesGenerator

extends Object
implements DigestDerivationFunction
Class Inheritance
All Implemented Interfaces
org.bouncycastle.crypto.internal.DigestDerivationFunction, org.bouncycastle.crypto.internal.DerivationFunction
Known Direct Subclasses
org.bouncycastle.crypto.fips.KDF2BytesGenerator
Imports
org.bouncycastle.crypto.internal.DataLengthException, .DerivationParameters, .Digest, .DigestDerivationFunction, org.bouncycastle.crypto.internal.params.KDFParameters, org.bouncycastle.util.Pack

Basic KDF generator for derived keys and ivs as defined by IEEE P1363a/ISO 18033
This implementation is based on ISO 18033/P1363a.

Field Summary

Modifier and TypeField and Description
private int
private Digest
private byte[]
private byte[]

Constructor Summary

AccessConstructor and Description
protected
BaseKDFBytesGenerator(int
value of counter.
counterStart
,
Digest
the digest to be used as the source of derived keys.
digest
)

Construct a KDF Parameters generator.

Method Summary

Modifier and TypeMethod and Description
public int
generateBytes(byte[] out, int outOff, int len)

Implements org.bouncycastle.crypto.internal.DerivationFunction.generateBytes.

fill len bytes of the output buffer with bytes generated from the derivation function.
public Digest
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

counterStartback to summary
private int counterStart
digestback to summary
private Digest digest
ivback to summary
private byte[] iv
sharedback to summary
private byte[] shared

Constructor Detail

BaseKDFBytesGeneratorback to summary
protected BaseKDFBytesGenerator(int counterStart, Digest digest)

Construct a KDF Parameters generator.

Parameters
counterStart:int

value of counter.

digest:Digest

the digest to be used as the source of derived keys.

Method Detail

generateBytesback to summary
public int generateBytes(byte[] out, int outOff, int len) throws DataLengthException, IllegalArgumentException

Implements org.bouncycastle.crypto.internal.DerivationFunction.generateBytes.

fill len bytes of the output buffer with bytes generated from the derivation function.

Exceptions
DataLengthException:
if the out buffer is too small.
IllegalArgumentException:
if the size of the request will cause an overflow.
getDigestback to summary
public Digest getDigest()

Implements org.bouncycastle.crypto.internal.DigestDerivationFunction.getDigest.

return the underlying digest.

initback to summary
public void init(DerivationParameters param)

Implements org.bouncycastle.crypto.internal.DerivationFunction.init.