org.bouncycastle.crypto.modes

Class SICBlockCipher

Implemented Interfaces:
BlockCipher

public class SICBlockCipher
extends java.lang.Object
implements BlockCipher

Implements the Segmented Integer Counter (SIC) mode on top of a simple block cipher. This mode is also known as CTR mode.

Constructor Summary

SICBlockCipher(BlockCipher c)
Basic constructor.

Method Summary

String
getAlgorithmName()
int
getBlockSize()
BlockCipher
getUnderlyingCipher()
return the underlying block cipher that we are wrapping.
void
init(boolean forEncryption, CipherParameters params)
int
processBlock(byte[] in, int inOff, byte[] out, int outOff)
void
reset()

Constructor Details

SICBlockCipher

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

Method Details

getAlgorithmName

public String getAlgorithmName()
Specified by:
getAlgorithmName in interface BlockCipher

getBlockSize

public int getBlockSize()
Specified by:
getBlockSize in interface BlockCipher

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
Specified by:
init in interface BlockCipher

processBlock

public int processBlock(byte[] in,
                        int inOff,
                        byte[] out,
                        int outOff)
            throws DataLengthException,
                   IllegalStateException
Specified by:
processBlock in interface BlockCipher

reset

public void reset()
Specified by:
reset in interface BlockCipher