org.bouncycastle.crypto.modes

Class CCMBlockCipher

public class CCMBlockCipher extends Object implements AEADBlockCipher

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
intdoFinal(byte[] out, int outOff)
StringgetAlgorithmName()
byte[]getMac()
Returns a byte array containing the mac calculated as part of the last encrypt or decrypt operation.
intgetOutputSize(int len)
BlockCiphergetUnderlyingCipher()
return the underlying block cipher that we are wrapping.
intgetUpdateOutputSize(int len)
voidinit(boolean forEncryption, CipherParameters params)
intprocessByte(byte in, byte[] out, int outOff)
intprocessBytes(byte[] in, int inOff, int inLen, byte[] out, int outOff)
byte[]processPacket(byte[] in, int inOff, int inLen)
voidreset()

Constructor Detail

CCMBlockCipher

public CCMBlockCipher(BlockCipher c)
Basic constructor.

Parameters: c the block cipher to be used.

Method Detail

doFinal

public int doFinal(byte[] out, int outOff)

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.

getOutputSize

public int getOutputSize(int len)

getUnderlyingCipher

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

Returns: the underlying block cipher that we are wrapping.

getUpdateOutputSize

public int getUpdateOutputSize(int len)

init

public void init(boolean forEncryption, CipherParameters params)

processByte

public int processByte(byte in, byte[] out, int outOff)

processBytes

public int processBytes(byte[] in, int inOff, int inLen, byte[] out, int outOff)

processPacket

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

reset

public void reset()