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

ECMqvWithKdfBasicAgreement

using Org.BouncyCastle.Math; using System; namespace Org.BouncyCastle.Crypto.Agreement { public class ECMqvWithKdfBasicAgreement : ECMqvBasicAgreement { private readonly string m_algorithm; private readonly IDerivationFunction m_kdf; public ECMqvWithKdfBasicAgreement(string algorithm, IDerivationFunction kdf) { if (algorithm == null) throw new ArgumentNullException("algorithm"); m_algorithm = algorithm; if (kdf == null) throw new ArgumentNullException("kdf"); m_kdf = kdf; } public override BigInteger CalculateAgreement(ICipherParameters pubKey) { BigInteger result = base.CalculateAgreement(pubKey); return BasicAgreementWithKdf.CalculateAgreementWithKdf(m_algorithm, m_kdf, GetFieldSize(), result); } } }