gnu.crypto.cipher
interface IBlockCipherSpi extends Cloneable
Package-private interface exposing mandatory methods to be implemented by concrete BaseCipher sub-classes.
Version: $Revision: 1.5 $
Method Summary | |
---|---|
Iterator | blockSizes() Returns an java.util.Iterator over the supported block sizes. |
void | decrypt(byte[] in, int inOffset, byte[] out, int outOffset, Object k, int bs) Decrypts exactly one block of ciphertext. |
void | encrypt(byte[] in, int inOffset, byte[] out, int outOffset, Object k, int bs) Encrypts exactly one block of plaintext. |
Iterator | keySizes() Returns an java.util.Iterator over the supported key sizes. |
Object | makeKey(byte[] k, int bs) Expands a user-supplied key material into a session key for a designated block size. |
boolean | selfTest() A correctness test that consists of basic symmetric encryption / decryption test(s) for all supported block and key sizes, as well as one (1) variable key Known Answer Test (KAT). |
Returns an java.util.Iterator over the supported block sizes. Each element returned by this object is a java.lang.Integer.
Returns: an Iterator
over the supported block sizes.
Decrypts exactly one block of ciphertext.
Parameters: in the ciphertext. inOffset index of in
from which to start considering
data. out the plaintext. outOffset index of out
from which to store the result. k the session key to use. bs the block size to use.
Throws: IllegalArgumentException if the block size is invalid. ArrayIndexOutOfBoundsException if there is not enough room in either the plaintext or ciphertext buffers.
Encrypts exactly one block of plaintext.
Parameters: in the plaintext. inOffset index of in
from which to start considering
data. out the ciphertext. outOffset index of out
from which to store the result. k the session key to use. bs the block size to use.
Throws: IllegalArgumentException if the block size is invalid. ArrayIndexOutOfBoundsException if there is not enough room in either the plaintext or ciphertext buffers.
Returns an java.util.Iterator over the supported key sizes. Each element returned by this object is a java.lang.Integer.
Returns: an Iterator
over the supported key sizes.
Expands a user-supplied key material into a session key for a designated block size.
Parameters: k the user-supplied key material. bs the desired block size in bytes.
Returns: an Object encapsulating the session key.
Throws: IllegalArgumentException if the block size is invalid. InvalidKeyException if the key data is invalid.
A correctness test that consists of basic symmetric encryption / decryption test(s) for all supported block and key sizes, as well as one (1) variable key Known Answer Test (KAT).
Returns: true
if the implementation passes simple
correctness tests. Returns false
otherwise.