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

Quick Search    Search Deep

gnu.javax.crypto.assembly
Class ModeStage  view ModeStage download ModeStage.java

java.lang.Object
  extended bygnu.javax.crypto.assembly.Stage
      extended bygnu.javax.crypto.assembly.ModeStage

class ModeStage
extends Stage

An gnu.javax.crypto.mode.IMode Stage in a Cascade Cipher chain.

Such a stage wraps an implementation of a Block Cipher Mode of Operation (gnu.javax.crypto.mode.IMode) to allow inclusion of such an instance in a cascade of block ciphers.


Field Summary
private  java.util.Set cachedBlockSizes
           
private  gnu.javax.crypto.mode.IMode delegate
           
 
Fields inherited from class gnu.javax.crypto.assembly.Stage
DIRECTION, forward, wired
 
Constructor Summary
(package private) ModeStage(gnu.javax.crypto.mode.IMode mode, Direction forwardDirection)
           
 
Method Summary
 java.util.Set blockSizes()
          Returns the java.util.Set of supported block sizes for this Stage.
 int currentBlockSize()
          Returns the currently set block size for the stage.
(package private)  void initDelegate(java.util.Map attributes)
           
(package private)  void resetDelegate()
           
 boolean selfTest()
          Conducts a simple correctness test that consists of basic symmetric encryption / decryption test(s) for all supported block and key sizes of underlying block cipher(s) wrapped by Mode leafs.
(package private)  void updateDelegate(byte[] in, int inOffset, byte[] out, int outOffset)
           
 
Methods inherited from class gnu.javax.crypto.assembly.Stage
getInstance, getInstance, init, reset, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

delegate

private gnu.javax.crypto.mode.IMode delegate

cachedBlockSizes

private transient java.util.Set cachedBlockSizes
Constructor Detail

ModeStage

ModeStage(gnu.javax.crypto.mode.IMode mode,
          Direction forwardDirection)
Method Detail

blockSizes

public java.util.Set blockSizes()
Description copied from class: Stage
Returns the java.util.Set of supported block sizes for this Stage. Each element in the returned java.util.Set is an instance of java.lang.Integer.

Specified by:
blockSizes in class Stage

initDelegate

void initDelegate(java.util.Map attributes)
            throws java.security.InvalidKeyException
Specified by:
initDelegate in class Stage

currentBlockSize

public int currentBlockSize()
                     throws java.lang.IllegalStateException
Description copied from class: Stage
Returns the currently set block size for the stage.

Specified by:
currentBlockSize in class Stage

resetDelegate

void resetDelegate()
Specified by:
resetDelegate in class Stage

updateDelegate

void updateDelegate(byte[] in,
                    int inOffset,
                    byte[] out,
                    int outOffset)
Specified by:
updateDelegate in class Stage

selfTest

public boolean selfTest()
Description copied from class: Stage
Conducts a simple correctness test that consists of basic symmetric encryption / decryption test(s) for all supported block and key sizes of underlying block cipher(s) wrapped by Mode leafs. The test also includes one (1) variable key Known Answer Test (KAT) for each block cipher.

Specified by:
selfTest in class Stage