public ElGamalKeyGenerationParameters(
     SecureRandom random,
     ElGamalParameters parameters)
     : base(random, GetStrength(parameters))
 {
     this.parameters = parameters;
 }
 protected ElGamalKeyParameters(
     bool isPrivate,
     ElGamalParameters parameters)
     : base(isPrivate)
 {
     // TODO Should we allow 'parameters' to be null?
     this.parameters = parameters;
 }
Beispiel #3
0
        public ElGamalPrivateKeyParameters(
            BigInteger x,
            ElGamalParameters parameters)
            : base(true, parameters)
        {
            if (x == null)
            {
                throw new ArgumentNullException("x");
            }

            this.x = x;
        }
Beispiel #4
0
        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);
            }

            ElGamalParameters other = obj as ElGamalParameters;

            if (other == null)
            {
                return(false);
            }

            return(Equals(other));
        }
 internal static int GetStrength(
     ElGamalParameters parameters)
 {
     return(parameters.L != 0 ? parameters.L : parameters.P.BitLength);
 }
 protected bool Equals(
     ElGamalParameters other)
 {
     return(p.Equals(other.p) && g.Equals(other.g) && l == other.l);
 }