public class SICSeekableBlockCipher extends Object implements SeekableBlockCipher
SICBlockCipher class,
but allows random access to a block, too.
Like the SICBlockCipher class, the block counter is incremented
after updating the cipher input in big endian order.| Modifier and Type | Field and Description |
|---|---|
protected long |
blockCounter |
protected int |
blockSize |
protected org.bouncycastle.crypto.BlockCipher |
cipher |
protected byte[] |
cipherIn |
protected byte[] |
cipherOut |
protected byte[] |
IV |
| Constructor and Description |
|---|
SICSeekableBlockCipher(org.bouncycastle.crypto.BlockCipher cipher)
Constructs a new big endian SIC seekable block cipher mode.
|
| Modifier and Type | Method and Description |
|---|---|
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() |
org.bouncycastle.crypto.BlockCipher |
getUnderlyingCipher()
Returns the underlying block cipher which we are decorating.
|
void |
init(boolean forEncryption,
org.bouncycastle.crypto.CipherParameters params) |
int |
processBlock(byte[] in,
int inOff,
byte[] out,
int outOff) |
void |
reset() |
void |
setBlockCounter(long blockCounter)
Sets the counter so that the block with the given index, starting
at 0, can be processed next.
|
protected long blockCounter
protected final int blockSize
protected final org.bouncycastle.crypto.BlockCipher cipher
protected final byte[] cipherIn
protected final byte[] cipherOut
protected final byte[] IV
public SICSeekableBlockCipher(org.bouncycastle.crypto.BlockCipher cipher)
cipher - The underlying block cipher to use.public String getAlgorithmName()
getAlgorithmName in interface org.bouncycastle.crypto.BlockCipherpublic long getBlockCounter()
SeekableBlockCipherBlockCipher.processBlock(byte[], int, byte[], int) is called.getBlockCounter in interface SeekableBlockCipherpublic int getBlockSize()
getBlockSize in interface org.bouncycastle.crypto.BlockCipherpublic org.bouncycastle.crypto.BlockCipher getUnderlyingCipher()
public void init(boolean forEncryption,
org.bouncycastle.crypto.CipherParameters params)
init in interface org.bouncycastle.crypto.BlockCipherpublic int processBlock(byte[] in,
int inOff,
byte[] out,
int outOff)
throws org.bouncycastle.crypto.DataLengthException,
IllegalStateException
processBlock in interface org.bouncycastle.crypto.BlockCipherorg.bouncycastle.crypto.DataLengthExceptionIllegalStateExceptionpublic void reset()
reset in interface org.bouncycastle.crypto.BlockCipherpublic void setBlockCounter(long blockCounter)
SeekableBlockCiphersetBlockCounter in interface SeekableBlockCipherblockCounter - The index of the block, starting at 0, which will be
processed next when
BlockCipher.processBlock(byte[], int, byte[], int) is called.Copyright © 2005-2013 Schlichtherle IT Services. All Rights Reserved.