cryptix.provider.mode
Class FeedbackMode
- FeedbackCipher, Parameterized, SymmetricCipher
(package private) abstract class FeedbackMode
FeedbackMode is used to provide the functionality of an
encryption mode, such as CBC, CFB, or OFB, that works as a feedback
cipher, where the size of the IV and feedback buffer are equal to the
cipher's block size.
It is internal to Cryptix, and not intended to be used directly by
applications.
Copyright © 1997
Systemics Ltd on behalf of the
Cryptix Development Team.
All rights reserved.
$Revision: 1.5 $
- David Hopwood
- Raif S. Naffah
protected int | currentByte - Index into the ivBlock.
|
protected byte[] | ivBlock - Value of the current feedback register/queue/buffer.
|
protected byte[] | ivStart - Value of the IV at initialisation phase as supplied by user.
|
protected int | length - Size of the feedback register/queue/buffer.
|
FeedbackMode(boolean implBuffering, boolean implPadding, String provider) - Constructor for a Mode.
|
blockSize , clone , crypt , crypt , crypt , doFinal , doFinal , doFinal , doFinal , engineBlockSize , engineCiphertextBlockSize , engineCrypt , engineGetParameter , engineInBufferSize , engineInitDecrypt , engineInitEncrypt , engineOutBufferSize , enginePlaintextBlockSize , engineSetPaddingScheme , engineSetParameter , engineUpdate , getAlgorithm , getAlgorithms , getAlgorithms , getCiphertextBlockSize , getInputBlockSize , getInstance , getInstance , getInstance , getMode , getOutputBlockSize , getPadding , getPaddingScheme , getParameter , getPlaintextBlockSize , getProvider , getState , inBufferSize , inBufferSizeFinal , initDecrypt , initEncrypt , isPaddingBlockCipher , outBufferSize , outBufferSizeFinal , setParameter , toString , update , update , update , update |
currentByte
protected int currentByte
Index into the ivBlock.
ivBlock
protected byte[] ivBlock
Value of the current feedback register/queue/buffer.
ivStart
protected byte[] ivStart
Value of the IV at initialisation phase as supplied by user.
length
protected int length
Size of the feedback register/queue/buffer.
FeedbackMode
protected FeedbackMode(boolean implBuffering,
boolean implPadding,
String provider)
Constructor for a Mode. This constructor is only for use
by subclasses, which should pass the correct arguments to convey
their behaviour to the superclass. Applications typically do
not use Mode classes directly; they should call one of the
Cipher.getInstance
factory methods instead.
implBuffering
- if true, this argument indicates that data
will be passed from update/crypt to
engineUpdate/engineCrypt without modification.implPadding
- if true, this argument indicates that the
implementation can perform padding, and that
the engineCrypt method will be called when
padding is required.provider
- the name of the provider of the underlying
cryptographic engine.
engineSetCipher
protected void engineSetCipher(Cipher cipher)
SPI: Sets the underlying cipher.
For example, to create an IDEA cipher in CBC mode, the cipher
for "IDEA" would be passed to the mode for "CBC" using
this method. It is called once, immediately after the mode
object is constructed.
Subclasses that override this method (to do initialization that
depends on the cipher being set) should call
super.engineSetCipher(cipher)
first.
- engineSetCipher in interface Mode
cipher
- the underlying cipher object
getInitializationVector
public byte[] getInitializationVector()
Gets a copy of the starting initialization vector. It will
return null if the initialization vector has not been set.
- getInitializationVector in interface FeedbackCipher
- a copy of the initialization vector for this cipher object.
getInitializationVectorLength
public int getInitializationVectorLength()
Returns the size of the initialization vector expected by
setInitializationVector
. For this class, that is
the block size of the underlying cipher.
- getInitializationVectorLength in interface FeedbackCipher
- the required size of the argument to
setInitializationVector
.
setInitializationVector
public void setInitializationVector(byte[] iv)
throws InvalidParameterException
Sets the initialization vector.
Note: in JavaSoft's version of JCE, this method may only be
called when the cipher is in the
UNINITIALIZED
state.
In IJCE that is relaxed to also allow it to be called after
initEncrypt
/
initDecrypt
, but before the
first call to
update
or
crypt
, provided
that the IV is not set twice.
iv
- the initialization vector.