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

public Class KDFCounterBytesGenerator

extends Object
implements MacDerivationFunction
Class Inheritance
All Implemented Interfaces
org.bouncycastle.crypto.MacDerivationFunction, org.bouncycastle.crypto.DerivationFunction
Imports
java.math.BigInteger, org.bouncycastle.crypto.DataLengthException, .DerivationParameters, .Mac, .MacDerivationFunction, org.bouncycastle.crypto.params.KDFCounterParameters, .KeyParameter

This KDF has been defined by the publicly available NIST SP 800-108 specification. NIST SP800-108 allows for alternative orderings of the input fields, meaning that the input can be formated in multiple ways. There are 3 supported formats: - Below [i]_2 is a counter of r-bits length concatenated to the fixedInputData. This function must be called with the following KDFCounterParameters(): Resulting function calls assuming an 8 bit counter.

Field Summary

Modifier and TypeField and Description
private byte[]
private byte[]
private int
private final int
h

private static final BigInteger
private byte[]
private byte[]
k

private int
private final Mac
private static final BigInteger

Constructor Summary

AccessConstructor and Description
public

Method Summary

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

Implements org.bouncycastle.crypto.DerivationFunction.generateBytes.

private void
public Mac
getMac()

Implements org.bouncycastle.crypto.MacDerivationFunction.getMac.

return the MAC used as the basis for the function

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fixedInputData_afterCtrback to summary
private byte[] fixedInputData_afterCtr
fixedInputDataCtrPrefixback to summary
private byte[] fixedInputDataCtrPrefix
generatedBytesback to summary
private int generatedBytes
hback to summary
private final int h
INTEGER_MAXback to summary
private static final BigInteger INTEGER_MAX
iosback to summary
private byte[] ios
kback to summary
private byte[] k
maxSizeExclback to summary
private int maxSizeExcl
prfback to summary
private final Mac prf
TWOback to summary
private static final BigInteger TWO

Constructor Detail

KDFCounterBytesGeneratorback to summary
public KDFCounterBytesGenerator(Mac prf)

Method Detail

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

Implements org.bouncycastle.crypto.DerivationFunction.generateBytes.

generateNextback to summary
private void generateNext()
getMacback to summary
public Mac getMac()

Implements org.bouncycastle.crypto.MacDerivationFunction.getMac.

Doc from org.bouncycastle.crypto.MacDerivationFunction.getMac.

return the MAC used as the basis for the function

Returns:Mac

the Mac.

initback to summary
public void init(DerivationParameters param)

Implements org.bouncycastle.crypto.DerivationFunction.init.