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

            this.x = x;
        }
        public ElGamalPublicKeyParameters(
            BigInteger y,
            ElGamalParameters parameters)
            : base(false, parameters)
        {
            if (y == null)
            {
                throw new ArgumentNullException("y");
            }

            this.y = y;
        }
예제 #5
0
        public override bool Equals(
            object obj)
        {
            if (obj == this)
            {
                return(true);
            }

            ElGamalParameters other = obj as ElGamalParameters;

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

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