org.bouncycastle.crypto.modes

Class CCMBlockCipher


public class CCMBlockCipher
extends java.lang.Object

Implements the Counter with Cipher Block Chaining mode (CCM) detailed in NIST Special Publication 800-38C.

Note: this mode is a packet mode - it needs all the data up front.

Constructor Summary

CCMBlockCipher(BlockCipher c)
Basic constructor.

Method Summary

String
getAlgorithmName()
byte[]
getMac()
Returns a byte array containing the mac calculated as part of the last encrypt or decrypt operation.
BlockCipher
getUnderlyingCipher()
return the underlying block cipher that we are wrapping.
void
init(boolean forEncryption, CipherParameters params)
byte[]
processPacket(byte[] in, int inOff, int inLen)

Constructor Details

CCMBlockCipher

public CCMBlockCipher(BlockCipher c)
Basic constructor.
Parameters:
c - the block cipher to be used.

Method Details

getAlgorithmName

public String getAlgorithmName()

getMac

public byte[] getMac()
Returns a byte array containing the mac calculated as part of the last encrypt or decrypt operation.
Returns:
the last mac calculated.

getUnderlyingCipher

public BlockCipher getUnderlyingCipher()
return the underlying block cipher that we are wrapping.
Returns:
the underlying block cipher that we are wrapping.

init

public void init(boolean forEncryption,
                 CipherParameters params)
            throws IllegalArgumentException

processPacket

public byte[] processPacket(byte[] in,
                            int inOff,
                            int inLen)
            throws IllegalStateException,
                   InvalidCipherTextException