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

pack-priv Class MacCFBBlockCipher

Located in compilation unit of org.bouncycastle.crypto.macs.CFBBlockCipherMac.

extends Object
Class Inheritance

implements a Cipher-FeedBack (CFB) mode on top of a simple cipher.

Field Summary

Modifier and TypeField and Description
private int
private byte[]
private byte[]
private BlockCipher
private byte[]

Constructor Summary

AccessConstructor and Description
public
MacCFBBlockCipher(BlockCipher
the block cipher to be used as the basis of the feedback mode.
cipher
,
int bitBlockSize)

Basic constructor.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the name of the underlying algorithm followed by "/CFB" and the block size in bits.
getAlgorithmName
()

return the algorithm name and mode.

public int

Returns:

the block size we are operating at (in bytes).
getBlockSize
()

return the block size we are operating at.

pack-priv void
getMacBlock(byte[] mac)

public void
init(CipherParameters params)

Initialise the cipher and, possibly, the initialisation vector (IV).

public int

Returns:

the number of bytes processed and produced.
processBlock
(byte[]
the array containing the input data.
in
,
int
offset into the in array the data starts at.
inOff
,
byte[]
the array the output data will be copied into.
out
,
int
the offset into the out array the output will start at.
outOff
)

Process one block of input from the array in and write it to the out array.

public void
reset()

reset the chaining vector back to the IV and reset the underlying cipher.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

blockSizeback to summary
private int blockSize
cfbOutVback to summary
private byte[] cfbOutV
cfbVback to summary
private byte[] cfbV
cipherback to summary
private BlockCipher cipher
IVback to summary
private byte[] IV

Constructor Detail

MacCFBBlockCipherback to summary
public MacCFBBlockCipher(BlockCipher cipher, int bitBlockSize)

Basic constructor.

Parameters
cipher:BlockCipher

the block cipher to be used as the basis of the feedback mode.

Method Detail

getAlgorithmNameback to summary
public String getAlgorithmName()

return the algorithm name and mode.

Returns:String

the name of the underlying algorithm followed by "/CFB" and the block size in bits.

getBlockSizeback to summary
public int getBlockSize()

return the block size we are operating at.

Returns:int

the block size we are operating at (in bytes).

getMacBlockback to summary
pack-priv void getMacBlock(byte[] mac)
initback to summary
public void init(CipherParameters params) throws IllegalArgumentException

Initialise the cipher and, possibly, the initialisation vector (IV). If an IV isn't passed as part of the parameter, the IV will be all zeros. An IV which is too short is handled in FIPS compliant fashion.

Exceptions
IllegalArgumentException:
if the params argument is inappropriate.
processBlockback to summary
public int processBlock(byte[] in, int inOff, byte[] out, int outOff) throws DataLengthException, IllegalStateException

Process one block of input from the array in and write it to the out array.

Parameters
in:byte[]

the array containing the input data.

inOff:int

offset into the in array the data starts at.

out:byte[]

the array the output data will be copied into.

outOff:int

the offset into the out array the output will start at.

Returns:int

the number of bytes processed and produced.

Exceptions
DataLengthException:
if there isn't enough data in in, or space in out.
IllegalStateException:
if the cipher isn't initialised.
resetback to summary
public void reset()

reset the chaining vector back to the IV and reset the underlying cipher.