<PackageReference Include="BouncyCastle.Cryptography" Version="2.4.0" />

TlsSuiteHmac

public class TlsSuiteHmac : TlsSuiteMac
A generic TLS MAC implementation, acting as an HMAC based on some underlying Digest.

protected readonly int m_digestBlockSize

protected readonly int m_digestOverhead

protected readonly TlsHmac m_mac

protected readonly int m_macSize

public virtual int Size { get; }

public TlsSuiteHmac(TlsCryptoParameters cryptoParams, TlsHmac mac)

Generate a new instance of a TlsMac.

protected static int GetMacSize(TlsCryptoParameters cryptoParams, TlsMac mac)

public virtual byte[] CalculateMac(long seqNo, short type, byte[] msg, int msgOff, int msgLen)

public virtual byte[] CalculateMac(long seqNo, short type, byte[] connectionID, byte[] msg, int msgOff, int msgLen)

public virtual byte[] CalculateMacConstantTime(long seqNo, short type, byte[] msg, int msgOff, int msgLen, int fullLength, byte[] dummyData)

public virtual byte[] CalculateMacConstantTime(long seqNo, short type, byte[] connectionID, byte[] msg, int msgOff, int msgLen, int fullLength, byte[] dummyData)

protected virtual int GetDigestBlockCount(int inputLength)

protected virtual int GetHeaderLength(byte[] connectionID)

protected virtual byte[] Truncate(byte[] bs)