|
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 |
java.lang.Objectgnu.crypto.exp.Helix
public class Helix
The Helix stream cipher and message authentication code. Helix combines a word-aligned stream cipher with a message authentication code in a single cryptographic primitive.
References:
Field Summary | |
---|---|
static int |
DECRYPTION
The state constant for decryption and optional MAC. |
static int |
ENCRYPTION
The state constant for encryption and optional MAC. |
static int |
MAC
The state constant for MAC-only. |
static String |
NONCE
Property name for the nonce. |
static String |
STATE
Property name for the state. |
Fields inherited from interface gnu.crypto.cipher.IBlockCipher |
---|
CIPHER_BLOCK_SIZE, KEY_MATERIAL |
Fields inherited from interface gnu.crypto.mac.IMac |
---|
MAC_KEY_MATERIAL, TRUNCATED_SIZE |
Constructor Summary | |
---|---|
Helix()
|
Method Summary | |
---|---|
Iterator |
blockSizes()
Returns an Iterator over the supported block sizes. |
Object |
clone()
Returns a clone of this instance. |
int |
currentBlockSize()
Returns the currently set block size for this instance. |
void |
decryptBlock(byte[] in,
int inOff,
byte[] out,
int outOff)
Decrypts exactly one block of ciphertext. |
int |
defaultBlockSize()
Returns the default value, in bytes, of the algorithm's block size. |
int |
defaultKeySize()
Returns the default value, in bytes, of the algorithm's key size. |
byte[] |
digest()
Completes the MAC by performing final operations such as padding and resetting the instance. |
void |
encryptBlock(byte[] in,
int inOff,
byte[] out,
int outOff)
Encrypts exactly one block of plaintext. |
void |
init(Map attributes)
Initialises the algorithm with designated attributes. |
Iterator |
keySizes()
Returns an Iterator over the supported key sizes. |
int |
macSize()
Returns the output length in bytes of this MAC algorithm. |
String |
name()
Returns the canonical name of this instance. |
void |
reset()
Resets the algorithm instance for re-initialisation and use with other characteristics. |
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). |
void |
update(byte b)
Continues a MAC operation using the input byte. |
void |
update(byte[] buf,
int off,
int len)
Continues a MAC operation, by filling the buffer, processing data in the algorithm's MAC_SIZE-bit block(s), updating the context and count, and buffering the remaining bytes in buffer for the next operation. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String NONCE
public static final String STATE
Integer
containing one
of the constants ENCRYPTION
, DECRYPTION
, or MAC
.
If omitted, ENCRYPTION is assumed.
public static final int ENCRYPTION
public static final int DECRYPTION
public static final int MAC
Constructor Detail |
---|
public Helix()
Method Detail |
---|
public String name()
IBlockCipher
Returns the canonical name of this instance.
name
in interface IBlockCipher
name
in interface IMac
public int defaultBlockSize()
IBlockCipher
Returns the default value, in bytes, of the algorithm's block size.
defaultBlockSize
in interface IBlockCipher
public int defaultKeySize()
IBlockCipher
Returns the default value, in bytes, of the algorithm's key size.
defaultKeySize
in interface IBlockCipher
public Iterator blockSizes()
IBlockCipher
Returns an Iterator
over the supported block sizes. Each
element returned by this object is an Integer
.
blockSizes
in interface IBlockCipher
Iterator
over the supported block sizes.public Iterator keySizes()
IBlockCipher
Returns an Iterator
over the supported key sizes. Each element
returned by this object is an Integer
.
keySizes
in interface IBlockCipher
Iterator
over the supported key sizes.public int macSize()
IMac
Returns the output length in bytes of this MAC algorithm.
macSize
in interface IMac
public int currentBlockSize()
IBlockCipher
Returns the currently set block size for this instance.
currentBlockSize
in interface IBlockCipher
public Object clone()
IBlockCipher
Returns a clone of this instance.
clone
in interface IBlockCipher
clone
in interface IMac
clone
in class Object
public void reset()
IBlockCipher
Resets the algorithm instance for re-initialisation and use with other characteristics. This method always succeeds.
reset
in interface IBlockCipher
reset
in interface IMac
public void init(Map attributes) throws InvalidKeyException
IBlockCipher
Initialises the algorithm with designated attributes. Permissible names and values are described in the class documentation above.
init
in interface IBlockCipher
init
in interface IMac
attributes
- a set of name-value pairs that describes the desired
future behaviour of this instance.
InvalidKeyException
- if the key data is invalid.IBlockCipher.KEY_MATERIAL
,
IBlockCipher.CIPHER_BLOCK_SIZE
public void encryptBlock(byte[] in, int inOff, byte[] out, int outOff)
IBlockCipher
Encrypts exactly one block of plaintext.
encryptBlock
in interface IBlockCipher
in
- the plaintext.inOff
- index of in
from which to start considering
data.out
- the ciphertext.outOff
- index of out
from which to store result.public void decryptBlock(byte[] in, int inOff, byte[] out, int outOff)
IBlockCipher
Decrypts exactly one block of ciphertext.
decryptBlock
in interface IBlockCipher
in
- the plaintext.inOff
- index of in
from which to start considering
data.out
- the ciphertext.outOff
- index of out
from which to store result.public void update(byte b)
IMac
Continues a MAC operation using the input byte.
update
in interface IMac
b
- the input byte to digest.public void update(byte[] buf, int off, int len)
IMac
Continues a MAC operation, by filling the buffer, processing data in the algorithm's MAC_SIZE-bit block(s), updating the context and count, and buffering the remaining bytes in buffer for the next operation.
update
in interface IMac
buf
- the input block.off
- start of meaningful bytes in input block.len
- number of bytes, in input block, to consider.public byte[] digest()
IMac
Completes the MAC by performing final operations such as padding and resetting the instance.
digest
in interface IMac
public boolean selfTest()
IBlockCipher
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).
selfTest
in interface IBlockCipher
selfTest
in interface IMac
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 |