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

Org.BouncyCastle.Tls.Crypto.Impl.TlsSuiteHmac

public class TlsSuiteHmac : TlsSuiteMac
A generic TLS MAC implementation, acting as an HMAC based on some underlying Digest.
namespace Org.BouncyCastle.Tls.Crypto.Impl { public class TlsSuiteHmac : TlsSuiteMac { protected readonly TlsCryptoParameters m_cryptoParams; protected readonly TlsHmac m_mac; protected readonly int m_digestBlockSize; protected readonly int m_digestOverhead; protected readonly int m_macSize; public virtual int Size { get; } protected static int GetMacSize(TlsCryptoParameters cryptoParams, TlsMac mac); public TlsSuiteHmac(TlsCryptoParameters cryptoParams, TlsHmac 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); } }