Inheritance: ICipherParameters
 public Gost3410KeyGenerationParameters(
     SecureRandom random,
     Gost3410Parameters parameters)
     : base(random, parameters.P.BitLength - 1)
 {
     this.parameters = parameters;
 }
		protected Gost3410KeyParameters(
			bool				isPrivate,
			Gost3410Parameters	parameters)
			: base(isPrivate)
		{
			this.parameters = parameters;
		}
        public Gost3410KeyGenerationParameters(
			ISecureRandom random,
			Gost3410Parameters parameters)
            : base(random, parameters.P.BitLength - 1)
        {
            this.parameters = parameters;
        }
Beispiel #4
0
 protected Gost3410KeyParameters(
     bool isPrivate,
     Gost3410Parameters parameters)
     : base(isPrivate)
 {
     this.parameters = parameters;
 }
 public Gost3410PublicKeyParameters(BigInteger y, Gost3410Parameters parameters) : base(false, parameters)
 {
     if (y.SignValue < 1 || y.CompareTo(base.Parameters.P) >= 0)
     {
         throw new ArgumentException("Invalid y for GOST3410 public key", "y");
     }
     this.y = y;
 }
		protected Gost3410KeyParameters(
			bool				isPrivate,
			DerObjectIdentifier	publicKeyParamSet)
			: base(isPrivate)
		{
			this.parameters = LookupParameters(publicKeyParamSet);
			this.publicKeyParamSet = publicKeyParamSet;
		}
 protected bool Equals(Gost3410Parameters other)
 {
     if (p.Equals(other.p) && q.Equals(other.q))
     {
         return(a.Equals(other.a));
     }
     return(false);
 }
Beispiel #8
0
 public Gost3410PrivateKeyParameters(BigInteger x, Gost3410Parameters parameters) : base(true, parameters)
 {
     if (x.SignValue < 1 || x.BitLength > 256 || x.CompareTo(base.Parameters.Q) >= 0)
     {
         throw new ArgumentException("Invalid x for GOST3410 private key", "x");
     }
     this.x = x;
 }
Beispiel #9
0
 protected Gost3410KeyParameters(
     bool isPrivate,
     DerObjectIdentifier publicKeyParamSet)
     : base(isPrivate)
 {
     this.parameters        = LookupParameters(publicKeyParamSet);
     this.publicKeyParamSet = publicKeyParamSet;
 }
		public Gost3410PrivateKeyParameters(
			BigInteger			x,
			Gost3410Parameters	parameters)
			: base(true, parameters)
		{
			if (x.SignValue < 1 || x.BitLength > 256 || x.CompareTo(Parameters.Q) >= 0)
				throw new ArgumentException("Invalid x for GOST3410 private key", "x");

			this.x = x;
		}
Beispiel #11
0
        public override bool Equals(object obj)
        {
            if (obj == this)
            {
                return(true);
            }
            Gost3410Parameters gost3410Parameters = obj as Gost3410Parameters;

            return(gost3410Parameters != null && this.Equals(gost3410Parameters));
        }
 public Gost3410PrivateKeyParameters(BigInteger x, Gost3410Parameters parameters)
     : base(isPrivate: true, parameters)
 {
     //IL_003c: Unknown result type (might be due to invalid IL or missing references)
     if (x.SignValue < 1 || x.BitLength > 256 || x.CompareTo(base.Parameters.Q) >= 0)
     {
         throw new ArgumentException("Invalid x for GOST3410 private key", "x");
     }
     this.x = x;
 }
 public Gost3410PublicKeyParameters(BigInteger y, Gost3410Parameters parameters)
     : base(isPrivate: false, parameters)
 {
     //IL_002f: Unknown result type (might be due to invalid IL or missing references)
     if (y.SignValue < 1 || y.CompareTo(base.Parameters.P) >= 0)
     {
         throw new ArgumentException("Invalid y for GOST3410 public key", "y");
     }
     this.y = y;
 }
		public Gost3410PublicKeyParameters(
			BigInteger y,
			Gost3410Parameters parameters)
			: base(false, parameters)
		{
			if (y.SignValue < 1 || y.CompareTo(Parameters.P) >= 0)
				throw new ArgumentException("Invalid y for GOST3410 public key", "y");

			this.y = y;
		}
        public override bool Equals(object obj)
        {
            if (obj == this)
            {
                return(true);
            }
            Gost3410Parameters other = obj as Gost3410Parameters;

            if (other == null)
            {
                return(false);
            }
            return(this.Equals(other));
        }
        public override bool Equals(object obj)
        {
            if (obj == this)
            {
                return(true);
            }
            Gost3410Parameters gost3410Parameters = obj as Gost3410Parameters;

            if (gost3410Parameters == null)
            {
                return(false);
            }
            return(Equals(gost3410Parameters));
        }
        protected bool Equals(
			Gost3410Parameters other)
        {
            return p.Equals(other.p) && q.Equals(other.q) && a.Equals(other.a);
        }
		public void TestGost3410()
		{
			BigInteger a = BigInteger.ValueOf(1), b = BigInteger.ValueOf(2), c = BigInteger.ValueOf(3);

			Gost3410Parameters g1 = new Gost3410Parameters(a, b, c);
			Gost3410Parameters g2 = new Gost3410Parameters(a, b, c);
			Gost3410Parameters g3 = new Gost3410Parameters(a, c, c);

			doTest(g1, g2, g3);

			Gost3410ValidationParameters v1 = new Gost3410ValidationParameters(100, 1);
			Gost3410ValidationParameters v2 = new Gost3410ValidationParameters(100, 1);
			Gost3410ValidationParameters v3 = new Gost3410ValidationParameters(101, 1);

			doTest(v1, v2, v3);

			v3 = new Gost3410ValidationParameters(100, 2);

			doTest(v1, v2, v3);

			v1 = new Gost3410ValidationParameters(100L, 1L);
			v2 = new Gost3410ValidationParameters(100L, 1L);
			v3 = new Gost3410ValidationParameters(101L, 1L);

			doTest(v1, v2, v3);

			v3 = new Gost3410ValidationParameters(100L, 2L);

			doTest(v1, v2, v3);
		}
Beispiel #19
0
 protected bool Equals(
     Gost3410Parameters other)
 {
     return(p.Equals(other.p) && q.Equals(other.q) && a.Equals(other.a));
 }
Beispiel #20
0
 protected bool Equals(Gost3410Parameters other)
 {
     return(this.p.Equals(other.p) && this.q.Equals(other.q) && this.a.Equals(other.a));
 }
 protected bool Equals(Gost3410Parameters other) =>
 ((this.p.Equals(other.p) && this.q.Equals(other.q)) && this.a.Equals(other.a));