public class SICSeekableBlockCipher extends java.lang.Object implements SeekableBlockCipher
SICBlockCipher class,
but also allows random access to a block.| Modifier and Type | Field and Description |
|---|---|
private long |
blockCounter |
private int |
blockSize |
private BlockCipher |
cipher |
private byte[] |
counterIn |
private byte[] |
counterOut |
private byte[] |
IV |
| Constructor and Description |
|---|
SICSeekableBlockCipher(BlockCipher cipher)
Basic constructor.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.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()
Returns the underlying block cipher which we are decorating.
|
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.
|
private void |
updateCounter() |
private final BlockCipher cipher
private final int blockSize
private final byte[] IV
private final byte[] counterIn
private long blockCounter
private final byte[] counterOut
public SICSeekableBlockCipher(BlockCipher cipher)
cipher - The block cipher to be used.public BlockCipher getUnderlyingCipher()
public void init(boolean forEncryption,
CipherParameters params)
throws java.lang.IllegalArgumentException
init in interface BlockCipherjava.lang.IllegalArgumentExceptionpublic java.lang.String getAlgorithmName()
getAlgorithmName in interface BlockCipherpublic int getBlockSize()
getBlockSize in interface BlockCipherpublic int processBlock(byte[] in,
int inOff,
byte[] out,
int outOff)
throws DataLengthException,
java.lang.IllegalStateException
processBlock in interface BlockCipherDataLengthExceptionjava.lang.IllegalStateExceptionprivate void updateCounter()
public void setBlockCounter(long block)
SeekableBlockCiphersetBlockCounter 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 BlockCipherCopyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.