public class SM3HMac
extends javax.crypto.MacSpi
| Constructor and Description |
|---|
SM3HMac() |
| Modifier and Type | Method and Description |
|---|---|
protected byte[] |
engineDoFinal()
Completes the HMAC computation and resets the HMAC for further use,
maintaining the secret key that the HMAC was initialized with.
|
protected int |
engineGetMacLength()
Returns the length of the HMAC in bytes.
|
protected void |
engineInit(java.security.Key key,
java.security.spec.AlgorithmParameterSpec params)
Initializes the HMAC with the given secret key and algorithm parameters.
|
protected void |
engineReset()
Resets the HMAC for further use, maintaining the secret key that the
HMAC was initialized with.
|
protected void |
engineUpdate(byte input)
Processes the given byte.
|
protected void |
engineUpdate(byte[] input,
int offset,
int len)
Processes the first
len bytes in input,
starting at offset. |
protected void |
engineUpdate(java.nio.ByteBuffer input)
Processes the
input.remaining() bytes in the ByteBuffer
input. |
protected int engineGetMacLength()
engineGetMacLength in class javax.crypto.MacSpiprotected void engineInit(java.security.Key key,
java.security.spec.AlgorithmParameterSpec params)
throws java.security.InvalidKeyException,
java.security.InvalidAlgorithmParameterException
engineInit in class javax.crypto.MacSpikey - the secret key.params - the algorithm parameters.java.security.InvalidKeyException - if the given key is inappropriate for
initializing this MAC.java.security.InvalidAlgorithmParameterException - if the given algorithm
parameters are inappropriate for this MAC.protected void engineUpdate(byte input)
engineUpdate in class javax.crypto.MacSpiinput - the input byte to be processed.protected void engineUpdate(byte[] input,
int offset,
int len)
len bytes in input,
starting at offset.engineUpdate in class javax.crypto.MacSpiinput - the input buffer.offset - the offset in input where the input starts.len - the number of bytes to process.protected void engineUpdate(java.nio.ByteBuffer input)
input.remaining() bytes in the ByteBuffer
input.engineUpdate in class javax.crypto.MacSpiinput - the input byte buffer.protected byte[] engineDoFinal()
engineDoFinal in class javax.crypto.MacSpiprotected void engineReset()
engineReset in class javax.crypto.MacSpi