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

DefaultMacResult

public sealed class DefaultMacResult : IBlockResult
using Org.BouncyCastle.Security; namespace Org.BouncyCastle.Crypto.Operators { public sealed class DefaultMacResult : IBlockResult { private readonly IMac m_mac; public DefaultMacResult(IMac mac) { m_mac = mac; } public byte[] Collect() { return MacUtilities.DoFinal(m_mac); } public int Collect(byte[] buf, int off) { return m_mac.DoFinal(buf, off); } public int GetMaxResultLength() { return m_mac.GetMacSize(); } } }