internal static IEngineProvider <IMac> CreateMacProvider(string name, IAuthenticationParameters <IParameters <Algorithm>, Algorithm> parameters, IEngineProvider <Org.BouncyCastle.Crypto.Internal.IBlockCipher> baseCipher) { switch (parameters.Algorithm.Mode) { case AlgorithmMode.CMAC: return(new CMacProvider(baseCipher, parameters)); default: throw new ArgumentException("Unknown MAC algorithm passed to " + name + ".Provider: " + parameters.Algorithm.Mode); } }
internal CMacProvider(IEngineProvider <Internal.IBlockCipher> baseProvider, IAuthenticationParameters <IParameters <Algorithm>, Algorithm> parameters) { this.baseProvider = baseProvider; this.macSizeInBits = parameters.MacSizeInBits; }