Package com.microej.crypto.internal.mac
Class AbstractMacSpi
- java.lang.Object
-
- javax.crypto.MacSpi
-
- com.microej.crypto.internal.mac.AbstractMacSpi
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected byte[]engineDoFinal()Completes the MAC computation and resets the MAC for further use, maintaining the secret key that the MAC was initialized with.protected intengineGetMacLength()Returns the length of the MAC in bytes.protected voidengineInit(Key key, AlgorithmParameterSpec params)Initializes the MAC with the given (secret) key and algorithm parameters.protected voidengineReset()Resets the MAC for further use, maintaining the secret key that the MAC was initialized with.protected voidengineUpdate(byte b)Processes the given byte.protected voidengineUpdate(byte[] b, int ofs, int len)Processes the firstlenbytes ininput, starting atoffsetinclusive.
-
-
-
Method Detail
-
engineGetMacLength
protected final int engineGetMacLength()
Description copied from class:MacSpiReturns the length of the MAC in bytes.- Specified by:
engineGetMacLengthin classMacSpi- Returns:
- the MAC length in bytes.
-
engineInit
protected void engineInit(Key key, AlgorithmParameterSpec params) throws InvalidKeyException, InvalidAlgorithmParameterException
Description copied from class:MacSpiInitializes the MAC with the given (secret) key and algorithm parameters.- Specified by:
engineInitin classMacSpi- Parameters:
key- the (secret) key.params- the algorithm parameters.- Throws:
InvalidKeyException- if the given key is inappropriate for initializing this MAC.InvalidAlgorithmParameterException- if the given algorithm parameters are inappropriate for this MAC.
-
engineUpdate
protected final void engineUpdate(byte b)
Description copied from class:MacSpiProcesses the given byte.- Specified by:
engineUpdatein classMacSpi- Parameters:
b- the input byte to be processed.
-
engineUpdate
protected final void engineUpdate(byte[] b, int ofs, int len)Description copied from class:MacSpiProcesses the firstlenbytes ininput, starting atoffsetinclusive.- Specified by:
engineUpdatein classMacSpi- Parameters:
b- the input buffer.ofs- the offset ininputwhere the input starts.len- the number of bytes to process.
-
engineDoFinal
protected final byte[] engineDoFinal()
Description copied from class:MacSpiCompletes the MAC computation and resets the MAC for further use, maintaining the secret key that the MAC was initialized with.- Specified by:
engineDoFinalin classMacSpi- Returns:
- the MAC result.
-
engineReset
protected void engineReset()
Description copied from class:MacSpiResets the MAC for further use, maintaining the secret key that the MAC was initialized with.- Specified by:
engineResetin classMacSpi
-
-