gnu.crypto.cipher

Class BaseCipher

public abstract class BaseCipher extends Object implements IBlockCipher, IBlockCipherSpi

A basic abstract class to facilitate implementing symmetric key block ciphers.

Version: $Revision: 1.11 $

Field Summary
protected intcurrentBlockSize
The current block size, in bytes.
protected ObjectcurrentKey
The session key for this instance.
protected intdefaultBlockSize
The default block size, in bytes.
protected intdefaultKeySize
The default key size, in bytes.
protected Objectlock
The instance lock.
protected Stringname
The canonical name prefix of the cipher.
Constructor Summary
protected BaseCipher(String name, int defaultBlockSize, int defaultKeySize)

Trivial constructor for use by concrete subclasses.

Method Summary
abstract Objectclone()
intcurrentBlockSize()
voiddecryptBlock(byte[] in, int inOffset, byte[] out, int outOffset)
intdefaultBlockSize()
intdefaultKeySize()
voidencryptBlock(byte[] in, int inOffset, byte[] out, int outOffset)
voidinit(Map attributes)
Stringname()
voidreset()
booleanselfTest()
protected booleantestKat(byte[] kb, byte[] ct)
protected booleantestKat(byte[] kb, byte[] ct, byte[] pt)

Field Detail

currentBlockSize

protected int currentBlockSize
The current block size, in bytes.

currentKey

protected transient Object currentKey
The session key for this instance.

defaultBlockSize

protected int defaultBlockSize
The default block size, in bytes.

defaultKeySize

protected int defaultKeySize
The default key size, in bytes.

lock

protected Object lock
The instance lock.

name

protected String name
The canonical name prefix of the cipher.

Constructor Detail

BaseCipher

protected BaseCipher(String name, int defaultBlockSize, int defaultKeySize)

Trivial constructor for use by concrete subclasses.

Parameters: name the canonical name prefix of this instance. defaultBlockSize the default block size in bytes. defaultKeySize the default key size in bytes.

Method Detail

clone

public abstract Object clone()

currentBlockSize

public int currentBlockSize()

decryptBlock

public void decryptBlock(byte[] in, int inOffset, byte[] out, int outOffset)

defaultBlockSize

public int defaultBlockSize()

defaultKeySize

public int defaultKeySize()

encryptBlock

public void encryptBlock(byte[] in, int inOffset, byte[] out, int outOffset)

init

public void init(Map attributes)

name

public String name()

reset

public void reset()

selfTest

public boolean selfTest()

testKat

protected boolean testKat(byte[] kb, byte[] ct)

testKat

protected boolean testKat(byte[] kb, byte[] ct, byte[] pt)
Copyright © 2001, 2002, 2003 Free Software Foundation, Inc. All Rights Reserved.