|
For the latest news and information visit The GNU Crypto project |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Package-private interface exposing mandatory methods to be implemented by
concrete BaseCipher
sub-classes.
Method Summary | |
java.util.Iterator |
blockSizes()
Returns an Iterator over the supported block sizes.
|
void |
decrypt(byte[] in,
int inOffset,
byte[] out,
int outOffset,
java.lang.Object k,
int bs)
Decrypts exactly one block of ciphertext. |
void |
encrypt(byte[] in,
int inOffset,
byte[] out,
int outOffset,
java.lang.Object k,
int bs)
Encrypts exactly one block of plaintext. |
java.util.Iterator |
keySizes()
Returns an Iterator over the supported key sizes.
|
java.lang.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). |
Method Detail |
public java.util.Iterator blockSizes()
Returns an Iterator
over the supported block sizes.
Each element returned by this object is a Integer
.
Iterator
over the supported block sizes.public java.util.Iterator keySizes()
Returns an Iterator
over the supported key sizes.
Each element returned by this object is a Integer
.
Iterator
over the supported key sizes.public java.lang.Object makeKey(byte[] k, int bs) throws java.security.InvalidKeyException
Expands a user-supplied key material into a session key for a designated block size.
k
- the user-supplied key material.bs
- the desired block size in bytes.
java.lang.IllegalArgumentException
- if the block size is invalid.
java.security.InvalidKeyException
- if the key data is invalid.public void encrypt(byte[] in, int inOffset, byte[] out, int outOffset, java.lang.Object k, int bs)
Encrypts exactly one block of plaintext.
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.
java.lang.IllegalArgumentException
- if the block size is invalid.
java.lang.ArrayIndexOutOfBoundsException
- if there is not enough room in
either the plaintext or ciphertext buffers.public void decrypt(byte[] in, int inOffset, byte[] out, int outOffset, java.lang.Object k, int bs)
Decrypts exactly one block of ciphertext.
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.
java.lang.IllegalArgumentException
- if the block size is invalid.
java.lang.ArrayIndexOutOfBoundsException
- if there is not enough room in
either the plaintext or ciphertext buffers.public 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).
true
if the implementation passes simple
correctness tests. Returns false
otherwise.
|
For the latest news and information visit The GNU Crypto project |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |