gnu.crypto.cipher
Class BaseCipher
java.lang.Object
gnu.crypto.cipher.BaseCipher
- Cloneable, IBlockCipher, IBlockCipherSpi
public abstract class BaseCipher
extends java.lang.Object
A basic abstract class to facilitate implementing symmetric key block
ciphers.
Version:
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.
|
BaseCipher(String name, int defaultBlockSize, int defaultKeySize) - Trivial constructor for use by concrete subclasses.
|
currentBlockSize
protected int currentBlockSize
The current block size, in bytes.
currentKey
protected 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.
BaseCipher
protected BaseCipher(String name,
int defaultBlockSize,
int defaultKeySize)
Trivial constructor for use by concrete subclasses.
name
- the canonical name prefix of this instance.defaultBlockSize
- the default block size in bytes.defaultKeySize
- the default key size in bytes.
decryptBlock
public void decryptBlock(byte[] in,
int inOffset,
byte[] out,
int outOffset)
throws IllegalStateException
- decryptBlock in interface IBlockCipher
encryptBlock
public void encryptBlock(byte[] in,
int inOffset,
byte[] out,
int outOffset)
throws IllegalStateException
- encryptBlock in interface IBlockCipher
init
public void init(Map attributes)
throws InvalidKeyException
- init in interface IBlockCipher
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.