|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.schlichtherle.crypto.modes.SICSeekableBlockCipher
public class SICSeekableBlockCipher
Implements the Segmented Integer Counter (SIC) alias Counter (CTR) mode on top of a simple block cipher. This code is based on the SICBlockCipher class (as of version 1.30 of Bouncy Castle's Lightweight API for JDK 1.4), but also allows random access to a block.
| Constructor Summary | |
|---|---|
SICSeekableBlockCipher(BlockCipher c)
Basic constructor. |
|
| Method Summary | |
|---|---|
String |
getAlgorithmName()
|
long |
getBlockCounter()
Returns the index of the block, starting at 0, which will be processed next when BlockCipher.processBlock(byte[], int, byte[], int) is called. |
int |
getBlockSize()
|
BlockCipher |
getUnderlyingCipher()
return the underlying blockCounter cipher that we are wrapping. |
void |
init(boolean forEncryption,
CipherParameters params)
|
int |
processBlock(byte[] in,
int inOff,
byte[] out,
int outOff)
|
void |
reset()
|
void |
setBlockCounter(long block)
Sets the counter so that the block with the given index, starting at 0, can be processed next. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SICSeekableBlockCipher(BlockCipher c)
c - the blockCounter cipher to be used.| Method Detail |
|---|
public BlockCipher getUnderlyingCipher()
public void init(boolean forEncryption,
CipherParameters params)
throws IllegalArgumentException
init in interface BlockCipherIllegalArgumentExceptionpublic String getAlgorithmName()
getAlgorithmName in interface BlockCipherpublic int getBlockSize()
getBlockSize in interface BlockCipher
public int processBlock(byte[] in,
int inOff,
byte[] out,
int outOff)
throws DataLengthException,
IllegalStateException
processBlock in interface BlockCipherDataLengthException
IllegalStateExceptionpublic void setBlockCounter(long block)
SeekableBlockCipher
setBlockCounter in interface SeekableBlockCipherblock - The index of the block, starting at 0, which will be
processed next when
BlockCipher.processBlock(byte[], int, byte[], int) is called.public long getBlockCounter()
SeekableBlockCipherBlockCipher.processBlock(byte[], int, byte[], int) is called.
getBlockCounter in interface SeekableBlockCipherpublic void reset()
reset in interface BlockCipher
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||