Bouncy Castle Cryptography Library 1.87

org.bouncycastle.crypto.agreement.kdf
Class ConcatenationKDFGenerator

java.lang.Object
  extended byorg.bouncycastle.crypto.agreement.kdf.ConcatenationKDFGenerator
All Implemented Interfaces:
DerivationFunction

public class ConcatenationKDFGenerator
extends java.lang.Object
implements DerivationFunction

Generator for the Concatenation Key Derivation Function first specified in NIST SP 800-56A Section 5.8.1 and carried forward as the hash-based one-step key derivation function of SP 800-56C Rev. 2 Section 4.1: H(counter || Z || OtherInfo) with a 32-bit big-endian counter starting at 1.


Constructor Summary
ConcatenationKDFGenerator(Digest digest)
           
 
Method Summary
 int generateBytes(byte[] out, int outOff, int len)
          fill len bytes of the output buffer with bytes generated from the derivation function.
 Digest getDigest()
          return the underlying digest.
 void init(DerivationParameters param)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConcatenationKDFGenerator

public ConcatenationKDFGenerator(Digest digest)
Parameters:
digest - the digest to be used as the source of generated bytes
Method Detail

init

public void init(DerivationParameters param)
Specified by:
init in interface DerivationFunction

getDigest

public Digest getDigest()
return the underlying digest.


generateBytes

public int generateBytes(byte[] out,
                         int outOff,
                         int len)
                  throws DataLengthException,
                         java.lang.IllegalArgumentException
fill len bytes of the output buffer with bytes generated from the derivation function.

Specified by:
generateBytes in interface DerivationFunction
Throws:
DataLengthException - if the out buffer is too small.
java.lang.IllegalArgumentException

Bouncy Castle Cryptography Library 1.87