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

ElGamalPublicKeyParameters

using Org.BouncyCastle.Math; using System; namespace Org.BouncyCastle.Crypto.Parameters { public class ElGamalPublicKeyParameters : ElGamalKeyParameters { private readonly BigInteger y; public BigInteger Y => y; public ElGamalPublicKeyParameters(BigInteger y, ElGamalParameters parameters) : base(false, parameters) { if (y == null) throw new ArgumentNullException("y"); this.y = y; } public override bool Equals(object obj) { if (obj == this) return true; ElGamalPublicKeyParameters elGamalPublicKeyParameters = obj as ElGamalPublicKeyParameters; if (elGamalPublicKeyParameters == null) return false; return Equals(elGamalPublicKeyParameters); } protected bool Equals(ElGamalPublicKeyParameters other) { if (y.Equals(other.y)) return Equals((ElGamalKeyParameters)other); return false; } public override int GetHashCode() { return y.GetHashCode() ^ base.GetHashCode(); } } }