public interface TlsSuiteMac
Modifier and Type | Method and Description |
---|---|
byte[] |
calculateMac(long seqNo,
short type,
byte[] message,
int offset,
int length)
Calculate the MAC for some given data.
|
byte[] |
calculateMacConstantTime(long seqNo,
short type,
byte[] message,
int offset,
int length,
int expectedLength,
byte[] randomData)
Constant time calculation of the MAC for some given data with a given expected length.
|
int |
getSize()
Return the output length (in bytes) of this MAC.
|
void |
setKey(byte[] macKey)
Set the key to be used with the MAC.
|
void setKey(byte[] macKey) throws java.io.IOException
macKey
- the bytes representing the key.java.io.IOException
- an initialization exception.int getSize()
byte[] calculateMac(long seqNo, short type, byte[] message, int offset, int length)
type
- The message type of the message.message
- A byte array containing the message.offset
- The number of bytes to skip, before the message starts.length
- The length of the message.byte[] calculateMacConstantTime(long seqNo, short type, byte[] message, int offset, int length, int expectedLength, byte[] randomData)
seqNo
- The sequence number of the cipher text.type
- The content type of the message.message
- A byte array containing the message.offset
- The number of bytes to skip, before the message starts.length
- The length of the message.expectedLength
- The expected length of the full message,randomData
- Random data for padding out the MAC calculation if required.