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

pack-priv Class KDFCounterBytesGenerator

extends Object
Class Inheritance
Imports
java.math.BigInteger, org.bouncycastle.crypto.internal.DataLengthException, .DerivationParameters, .Mac, org.bouncycastle.crypto.internal.params.KDFCounterParameters, .KeyParameterImpl

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(): - KI
- The part of the fixedInputData that comes BEFORE the counter OR null
- the part of the fixedInputData that comes AFTER the counter OR null
- the length of the counter in bits (not bytes)

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)

private void
public Mac
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
generateNextback to summary
private void generateNext()
getMacback to summary
public Mac getMac()
initback to summary
public void init(DerivationParameters param)