gnu.crypto.cipher
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 int | currentBlockSize The current block size, in bytes. |
protected Object | currentKey The session key for this instance. |
protected int | defaultBlockSize The default block size, in bytes. |
protected int | defaultKeySize The default key size, in bytes. |
protected Object | lock The instance lock. |
protected String | name 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 Object | clone() |
int | currentBlockSize() |
void | decryptBlock(byte[] in, int inOffset, byte[] out, int outOffset) |
int | defaultBlockSize() |
int | defaultKeySize() |
void | encryptBlock(byte[] in, int inOffset, byte[] out, int outOffset) |
void | init(Map attributes) |
String | name() |
void | reset() |
boolean | selfTest() |
protected boolean | testKat(byte[] kb, byte[] ct) |
protected boolean | testKat(byte[] kb, byte[] ct, byte[] pt) |
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.