|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--javax.crypto.MacSpi
|
+--de.flexiprovider.api.Mac
|
+--de.flexiprovider.core.mac.CMac
This is an implementaion of the CMAC ( NIST Special Publication 800-38B).
| Inner Class Summary | |
static class |
CMac.AES128
CMAC with AES128 algorithm |
static class |
CMac.AES192
CMAC with AES192 algorithm |
static class |
CMac.AES256
CMAC with AES256 algorithm |
static class |
CMac.DESede
CMAC with DESede algorithm |
| Constructor Summary | |
protected |
CMac(BlockCipher blockCipher)
This constructor is called by every subclass for specifying the particular algorithm to be used for CMAC computation. |
| Method Summary | |
byte[] |
doFinal()
Returns the calculated MAC value. |
int |
getMacLength()
Returns the length of the calculated MAC value in bytes. |
void |
init(SecretKey key,
AlgorithmParameterSpec params)
Initializes this Mac Object with the given secret key and algorithm parameterSpec specification. |
void |
keySchedule(byte[] key)
This method implements the CMac Key expansion. |
void |
reset()
Reset this MAC object so that it may be used for further MAC computations. |
void |
update(byte b)
Processes the given byte |
void |
update(byte[] bytes,
int offset,
int len)
Processes the given number of bytes, supplied in a byte array starting at the given position. |
| Methods inherited from class de.flexiprovider.api.Mac |
doFinal, doFinal, engineDoFinal, engineGetMacLength, engineInit, engineReset, engineUpdate, engineUpdate, init, update |
| Methods inherited from class javax.crypto.MacSpi |
clone |
| Methods inherited from class java.lang.Object |
|
| Constructor Detail |
protected CMac(BlockCipher blockCipher)
blockCipher - the cipher algorithm to use| Method Detail |
public byte[] doFinal()
doFinal in class Macpublic int getMacLength()
getMacLength in class Mac
public void init(SecretKey key,
AlgorithmParameterSpec params)
throws InvalidKeyException,
InvalidAlgorithmParameterException
init in class Mackey - the secret key with which this MAC object is initialized.params - the parametersInvalidKeyException - if the key is invalid.InvalidAlgorithmParameterException - if the parameters are inappropriate for initializing the
underlying block cipher.public void keySchedule(byte[] key)
key - - the byte array containing the key.public void reset()
reset in class Macpublic void update(byte b)
update in class Macb - the byte to be processed.
public void update(byte[] bytes,
int offset,
int len)
update in class Macbytes - byte array containing the message to be processedoffset - offset into the array to start fromlen - number of bytes to be processed.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||