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

Org.BouncyCastle.Security.MacUtilities

public static class MacUtilities
Factory for IMac instances (HMAC, CMAC, GMAC, Poly1305, etc.) and convenience helpers for one-shot MAC computation.
namespace Org.BouncyCastle.Security { public static class MacUtilities { public static byte[] CalculateMac(string algorithm, ICipherParameters cp, byte[] input); public static byte[] DoFinal(IMac mac); public static byte[] DoFinal(IMac mac, byte[] input); public static string GetAlgorithmName(DerObjectIdentifier oid); public static IMac GetMac(DerObjectIdentifier id); public static IMac GetMac(string algorithm); } }