|
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.mac.OMAC
The One-Key CBC MAC, OMAC. This message authentication code is based on a block cipher in CBC mode.
References:
Field Summary |
---|
Fields inherited from interface gnu.crypto.mac.IMac |
---|
MAC_KEY_MATERIAL, TRUNCATED_SIZE |
Constructor Summary | |
---|---|
OMAC(IBlockCipher cipher)
|
Method Summary | |
---|---|
Object |
clone()
Returns a clone copy of this instance. |
byte[] |
digest()
Completes the MAC by performing final operations such as padding and resetting the instance. |
void |
digest(byte[] out,
int off)
|
void |
init(Map attrib)
Initialises the algorithm with designated attributes. |
int |
macSize()
Returns the output length in bytes of this MAC algorithm. |
String |
name()
Returns the canonical name of this algorithm. |
void |
reset()
Resets the algorithm instance for re-initialisation and use with other characteristics. |
boolean |
selfTest()
A basic test. |
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 |
Constructor Detail |
public OMAC(IBlockCipher cipher)
Method Detail |
public Object clone()
IMac
Returns a clone copy of this instance.
clone
in interface IMac
public String name()
IMac
Returns the canonical name of this algorithm.
name
in interface IMac
public int macSize()
IMac
Returns the output length in bytes of this MAC algorithm.
macSize
in interface IMac
public void init(Map attrib) throws InvalidKeyException
IMac
Initialises the algorithm with designated attributes. Permissible names and values are described in the class documentation above.
init
in interface IMac
attrib
- a set of name-value pairs that describe the desired
future instance behaviour.
InvalidKeyException
- if the key data is invalid.IMac.MAC_KEY_MATERIAL
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 void digest(byte[] out, int off)
public void reset()
IMac
Resets the algorithm instance for re-initialisation and use with other characteristics. This method always succeeds.
reset
in interface IMac
public boolean selfTest()
IMac
A basic test. Ensures that the MAC of a pre-determined message is equal to a known pre-computed value.
selfTest
in interface IMac
true
if the implementation passes a basic self-test.
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 |