Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

cryptix.jce.provider.cipher
Class ModeCBC  view ModeCBC download ModeCBC.java

java.lang.Object
  extended bycryptix.jce.provider.cipher.Mode
      extended bycryptix.jce.provider.cipher.ModeCBC

final class ModeCBC
extends Mode

Please read the comments in the source.

Version:
$Revision: 1.13 $

Field Summary
private  byte[] buf
          buffers incomplete blocks
protected  int bufCount
          How many bytes the buffer holds
protected  BlockCipher cipher
          Underlying block cipher
protected  int CIPHER_BLOCK_SIZE
          Block size of underlying cipher
protected  boolean decrypt
          Decrypting?
private  byte[] IV
          the IV which is used here
private  byte[] prevBlock
          previous ciphertext block (during decryption only)
 
Constructor Summary
(package private) ModeCBC(BlockCipher cipher)
           
 
Method Summary
(package private)  byte[] coreGetIV()
           
(package private)  int coreGetOutputSize(int inputLen)
           
(package private)  java.security.spec.AlgorithmParameterSpec coreGetParamSpec()
           
(package private)  void coreInit(boolean decrypt, java.security.Key key, java.security.spec.AlgorithmParameterSpec params, java.security.SecureRandom random)
           
(package private)  int coreUpdate(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset)
           
protected  byte[] extractIV(java.security.spec.AlgorithmParameterSpec params)
           
protected  byte[] generateIV()
           
(package private)  int getBlockSize()
           
(package private)  int getBufSize()
           
(package private) static Mode getInstance(java.lang.String mode, BlockCipher cipher)
           
(package private)  byte[] getIV()
           
(package private)  int getOutputSize(int inputLen)
           
(package private)  java.security.spec.AlgorithmParameterSpec getParamSpec()
           
(package private)  void init(boolean decrypt, java.security.Key key, java.security.spec.AlgorithmParameterSpec params, java.security.SecureRandom random)
           
(package private)  boolean needsPadding()
           
(package private)  int update(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

buf

private final byte[] buf
buffers incomplete blocks


prevBlock

private final byte[] prevBlock
previous ciphertext block (during decryption only)


IV

private byte[] IV
the IV which is used here


cipher

protected final BlockCipher cipher
Underlying block cipher


CIPHER_BLOCK_SIZE

protected final int CIPHER_BLOCK_SIZE
Block size of underlying cipher


decrypt

protected boolean decrypt
Decrypting?


bufCount

protected int bufCount
How many bytes the buffer holds

Constructor Detail

ModeCBC

ModeCBC(BlockCipher cipher)
Method Detail

coreGetOutputSize

final int coreGetOutputSize(int inputLen)
Specified by:
coreGetOutputSize in class Mode

coreInit

final void coreInit(boolean decrypt,
                    java.security.Key key,
                    java.security.spec.AlgorithmParameterSpec params,
                    java.security.SecureRandom random)
             throws java.security.InvalidKeyException,
                    java.security.InvalidAlgorithmParameterException
Specified by:
coreInit in class Mode

coreUpdate

int coreUpdate(byte[] input,
               int inputOffset,
               int inputLen,
               byte[] output,
               int outputOffset)
Specified by:
coreUpdate in class Mode

coreGetIV

final byte[] coreGetIV()
Specified by:
coreGetIV in class Mode

coreGetParamSpec

final java.security.spec.AlgorithmParameterSpec coreGetParamSpec()
Specified by:
coreGetParamSpec in class Mode

needsPadding

final boolean needsPadding()
Specified by:
needsPadding in class Mode

getInstance

static Mode getInstance(java.lang.String mode,
                        BlockCipher cipher)
                 throws java.security.NoSuchAlgorithmException

init

void init(boolean decrypt,
          java.security.Key key,
          java.security.spec.AlgorithmParameterSpec params,
          java.security.SecureRandom random)
    throws java.security.InvalidKeyException,
           java.security.InvalidAlgorithmParameterException

getIV

final byte[] getIV()

getParamSpec

final java.security.spec.AlgorithmParameterSpec getParamSpec()

getOutputSize

final int getOutputSize(int inputLen)

getBlockSize

final int getBlockSize()

update

final int update(byte[] input,
                 int inputOffset,
                 int inputLen,
                 byte[] output,
                 int outputOffset)

getBufSize

final int getBufSize()

generateIV

protected byte[] generateIV()

extractIV

protected final byte[] extractIV(java.security.spec.AlgorithmParameterSpec params)
                          throws java.security.InvalidAlgorithmParameterException