For the latest news and information visit
The GNU Crypto project

gnu.crypto.jce.cipher
Class TwofishSpi

java.lang.Object
  |
  +--javax.crypto.CipherSpi
        |
        +--gnu.crypto.jce.cipher.CipherAdapter
              |
              +--gnu.crypto.jce.cipher.TwofishSpi

public final class TwofishSpi
extends CipherAdapter

The implementation of the Twofish Service Provider Interface (SPI) adapter.

Version:
$Revision: 1.1 $

Field Summary
protected  java.util.Map attributes
          Our attributes map.
protected  int blockLen
          The length of blocks we are processing.
protected  IBlockCipher cipher
          Our cipher instance.
protected  int keyLen
          The current key size.
protected  IMode mode
          Our mode instance.
protected  IPad pad
          Our padding instance.
protected  byte[] partBlock
          An incomplete block.
protected  int partLen
          The number of bytes in CipherAdapter.partBlock.
 
Constructor Summary
TwofishSpi()
           
 
Method Summary
protected  byte[] engineDoFinal(byte[] input, int off, int len)
           
protected  int engineDoFinal(byte[] in, int inOff, int inLen, byte[] out, int outOff)
           
protected  int engineGetBlockSize()
           
protected  byte[] engineGetIV()
           
protected  int engineGetOutputSize(int inputLen)
           
protected  java.security.AlgorithmParameters engineGetParameters()
           
protected  void engineInit(int opmode, java.security.Key key, java.security.spec.AlgorithmParameterSpec params, java.security.SecureRandom random)
           
protected  void engineInit(int opmode, java.security.Key key, java.security.AlgorithmParameters params, java.security.SecureRandom random)
           
protected  void engineInit(int opmode, java.security.Key key, java.security.SecureRandom random)
           
protected  void engineSetMode(java.lang.String modeName)
           
protected  void engineSetPadding(java.lang.String padName)
           
protected  byte[] engineUpdate(byte[] input, int off, int len)
           
protected  int engineUpdate(byte[] in, int inOff, int inLen, byte[] out, int outOff)
           
 
Methods inherited from class javax.crypto.CipherSpi
engineGetKeySize, engineUnwrap, engineWrap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cipher

protected IBlockCipher cipher
Our cipher instance.


mode

protected IMode mode
Our mode instance.


pad

protected IPad pad
Our padding instance.


keyLen

protected int keyLen
The current key size.


attributes

protected java.util.Map attributes
Our attributes map.


partBlock

protected byte[] partBlock
An incomplete block.


partLen

protected int partLen
The number of bytes in CipherAdapter.partBlock.


blockLen

protected int blockLen
The length of blocks we are processing.

Constructor Detail

TwofishSpi

public TwofishSpi()
Method Detail

engineSetMode

protected void engineSetMode(java.lang.String modeName)
                      throws java.security.NoSuchAlgorithmException
Specified by:
engineSetMode in class javax.crypto.CipherSpi
java.security.NoSuchAlgorithmException

engineSetPadding

protected void engineSetPadding(java.lang.String padName)
                         throws javax.crypto.NoSuchPaddingException
Specified by:
engineSetPadding in class javax.crypto.CipherSpi
javax.crypto.NoSuchPaddingException

engineGetBlockSize

protected int engineGetBlockSize()
Specified by:
engineGetBlockSize in class javax.crypto.CipherSpi

engineGetOutputSize

protected int engineGetOutputSize(int inputLen)
Specified by:
engineGetOutputSize in class javax.crypto.CipherSpi

engineGetIV

protected byte[] engineGetIV()
Specified by:
engineGetIV in class javax.crypto.CipherSpi

engineGetParameters

protected java.security.AlgorithmParameters engineGetParameters()
Specified by:
engineGetParameters in class javax.crypto.CipherSpi

engineInit

protected void engineInit(int opmode,
                          java.security.Key key,
                          java.security.SecureRandom random)
                   throws java.security.InvalidKeyException
Specified by:
engineInit in class javax.crypto.CipherSpi
java.security.InvalidKeyException

engineInit

protected void engineInit(int opmode,
                          java.security.Key key,
                          java.security.spec.AlgorithmParameterSpec params,
                          java.security.SecureRandom random)
                   throws java.security.InvalidKeyException,
                          java.security.InvalidAlgorithmParameterException
Specified by:
engineInit in class javax.crypto.CipherSpi
java.security.InvalidKeyException
java.security.InvalidAlgorithmParameterException

engineInit

protected void engineInit(int opmode,
                          java.security.Key key,
                          java.security.AlgorithmParameters params,
                          java.security.SecureRandom random)
                   throws java.security.InvalidKeyException,
                          java.security.InvalidAlgorithmParameterException
Specified by:
engineInit in class javax.crypto.CipherSpi
java.security.InvalidKeyException
java.security.InvalidAlgorithmParameterException

engineUpdate

protected byte[] engineUpdate(byte[] input,
                              int off,
                              int len)
Specified by:
engineUpdate in class javax.crypto.CipherSpi

engineUpdate

protected int engineUpdate(byte[] in,
                           int inOff,
                           int inLen,
                           byte[] out,
                           int outOff)
                    throws javax.crypto.ShortBufferException
Specified by:
engineUpdate in class javax.crypto.CipherSpi
javax.crypto.ShortBufferException

engineDoFinal

protected byte[] engineDoFinal(byte[] input,
                               int off,
                               int len)
                        throws javax.crypto.IllegalBlockSizeException,
                               javax.crypto.BadPaddingException
Specified by:
engineDoFinal in class javax.crypto.CipherSpi
javax.crypto.IllegalBlockSizeException
javax.crypto.BadPaddingException

engineDoFinal

protected int engineDoFinal(byte[] in,
                            int inOff,
                            int inLen,
                            byte[] out,
                            int outOff)
                     throws javax.crypto.BadPaddingException,
                            javax.crypto.IllegalBlockSizeException,
                            javax.crypto.ShortBufferException
Specified by:
engineDoFinal in class javax.crypto.CipherSpi
javax.crypto.BadPaddingException
javax.crypto.IllegalBlockSizeException
javax.crypto.ShortBufferException

For the latest news and information visit
The GNU Crypto project

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