Interface TlsSuiteMac
- Namespace
- Org.BouncyCastle.Tls.Crypto.Impl
- Assembly
- BouncyCastle.Cryptography.dll
Base interface for a generic TLS MAC implementation for use with a bulk cipher.
public interface TlsSuiteMac
Properties
Size
Return the output length (in bytes) of this MAC.
int Size { get; }
Property Value
- int
The output length of this MAC.
Methods
CalculateMac(long, short, byte[], int, int)
Calculate the MAC for some given data.
byte[] CalculateMac(long seqNo, short type, byte[] message, int offset, int length)
Parameters
seqNolongThe sequence number of the record.
typeshortThe content type of the message.
messagebyte[]A byte array containing the message.
offsetintThe number of bytes to skip, before the message starts.
lengthintThe length of the message.
Returns
- byte[]
A new byte array containing the MAC value.
CalculateMac(long, short, ReadOnlySpan<byte>)
byte[] CalculateMac(long seqNo, short type, ReadOnlySpan<byte> message)
Parameters
seqNolongtypeshortmessageReadOnlySpan<byte>
Returns
- byte[]
CalculateMacConstantTime(long, short, byte[], int, int, int, byte[])
Constant time calculation of the MAC for some given data with a given expected length.
byte[] CalculateMacConstantTime(long seqNo, short type, byte[] message, int offset, int length, int expectedLength, byte[] randomData)
Parameters
seqNolongThe sequence number of the record.
typeshortThe content type of the message.
messagebyte[]A byte array containing the message.
offsetintThe number of bytes to skip, before the message starts.
lengthintThe length of the message.
expectedLengthintThe expected length of the full message.
randomDatabyte[]Random data for padding out the MAC calculation if required.
Returns
- byte[]
A new byte array containing the MAC value.