For the latest news and information visit
The GNU Crypto project

gnu.crypto.assembly
Class ModeStage

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

class ModeStage
extends Stage

An IMode Stage in a Cascade Cipher chain.

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

Version:
$Revision: 1.2 $

Field Summary
 
Fields inherited from class gnu.crypto.assembly.Stage
DIRECTION, forward, wired
 
Constructor Summary
(package private) ModeStage(IMode mode, Direction forwardDirection)
           
 
Method Summary
 java.util.Set blockSizes()
          Returns the 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.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
 

Constructor Detail

ModeStage

ModeStage(IMode mode,
          Direction forwardDirection)
Method Detail

blockSizes

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

Specified by:
blockSizes in class Stage
Returns:
a Set of supported block sizes.

initDelegate

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

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
Returns:
the current block size for this stage.
Throws:
java.lang.IllegalStateException - if the instance is not initialised.

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
Returns:
true if the implementation passes simple correctness tests. Returns false otherwise.

For the latest news and information visit
The GNU Crypto project

Copyright © 2001, 2002, 2003 Free Software Foundation, Inc. All Rights Reserved.