cryptix.provider.mode
public class CBC extends FeedbackMode
References:
Copyright © 1997, 1998
Systemics Ltd on behalf of the
Cryptix Development Team.
All rights reserved.
$Revision: 1.7 $
Since: Cryptix 2.2.2
Field Summary | |
---|---|
protected byte[] | xorBlock
Temporary buffer to hold input bytes when there's not enough of
them to cipher. |
Constructor Summary | |
---|---|
CBC()
Constructs a CBC cipher, assuming that the IV will be provided
via setInitializationVector .
| |
CBC(Cipher cipher)
Constructs a CBC cipher, assuming that the IV will be provided
via setInitializationVector .
| |
CBC(Cipher cipher, byte[] iv)
Constructs a CBC cipher, using an initialization vector
provided in the constructor.
|
Method Summary | |
---|---|
protected int | engineBlockSize() |
protected void | engineInitDecrypt(Key newkey) |
protected void | engineInitEncrypt(Key newkey) |
protected void | engineSetCipher(Cipher cipher) |
protected int | engineUpdate(byte[] in, int inOffset, int inLen, byte[] out, int outOffset)
SPI: This is the main engine method for updating data.
|
setInitializationVector
.
The IV value should be random, but unlike CFB mode, it is not absolutely required to be unique.
setInitializationVector
.
See the previous constructor for more details.
Parameters: cipher the cipher object to use in CBC mode.
Throws: NullPointerException if cipher == null IllegalBlockSizeException if cipher.getPlaintextBlockSize() != cipher.getCiphertextBlockSize()
For CBC mode the IV value should be random, but unlike CFB mode, it is not absolutely required to be unique.
Parameters: cipher the block cipher to use iv the initial value for the shift register (IV)
Throws: NullPointerException if cipher == null
in
and out
may be the same array, and the
input and output regions may overlap.
Parameters: in the input data. inOffset the offset into in
specifying where
the data starts. inLen the length of the subarray. out the output array. outOffset the offset indicating where to start writing into
the out
array.
Returns: the number of bytes written.