summary refs log tree commit diff
path: root/crypto/src/asn1/cryptopro
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2022-06-27 21:11:59 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2022-06-27 21:11:59 +0700
commit35cfd51633bbbbc92c2c17c76646e9a9dc945b11 (patch)
tree563cda15bf08c63de832198be2b9e0263bae5e60 /crypto/src/asn1/cryptopro
parentSplit up fast/slow tests (diff)
downloadBouncyCastle.NET-ed25519-35cfd51633bbbbc92c2c17c76646e9a9dc945b11.tar.xz
Generics migration in Asn1
Diffstat (limited to 'crypto/src/asn1/cryptopro')
-rw-r--r--crypto/src/asn1/cryptopro/ECGOST3410ParamSetParameters.cs14
-rw-r--r--crypto/src/asn1/cryptopro/GOST28147Parameters.cs19
-rw-r--r--crypto/src/asn1/cryptopro/GOST3410ParamSetParameters.cs16
3 files changed, 13 insertions, 36 deletions
diff --git a/crypto/src/asn1/cryptopro/ECGOST3410ParamSetParameters.cs b/crypto/src/asn1/cryptopro/ECGOST3410ParamSetParameters.cs
index 8e568a229..87df3c4a9 100644
--- a/crypto/src/asn1/cryptopro/ECGOST3410ParamSetParameters.cs
+++ b/crypto/src/asn1/cryptopro/ECGOST3410ParamSetParameters.cs
@@ -1,5 +1,4 @@
 using System;
-using System.Collections;
 
 using Org.BouncyCastle.Math;
 using Org.BouncyCastle.Utilities;
@@ -11,25 +10,20 @@ namespace Org.BouncyCastle.Asn1.CryptoPro
     {
         internal readonly DerInteger p, q, a, b, x, y;
 
-        public static ECGost3410ParamSetParameters GetInstance(
-            Asn1TaggedObject	obj,
-            bool				explicitly)
+        public static ECGost3410ParamSetParameters GetInstance(Asn1TaggedObject obj, bool explicitly)
         {
             return GetInstance(Asn1Sequence.GetInstance(obj, explicitly));
         }
 
-        public static ECGost3410ParamSetParameters GetInstance(
-            object obj)
+        public static ECGost3410ParamSetParameters GetInstance(object obj)
         {
             if (obj == null || obj is ECGost3410ParamSetParameters)
             {
                 return (ECGost3410ParamSetParameters) obj;
             }
 
-            if (obj is Asn1Sequence)
-            {
-                return new ECGost3410ParamSetParameters((Asn1Sequence) obj);
-            }
+            if (obj is Asn1Sequence seq)
+                return new ECGost3410ParamSetParameters(seq);
 
             throw new ArgumentException("Invalid GOST3410Parameter: " + Platform.GetTypeName(obj));
         }
diff --git a/crypto/src/asn1/cryptopro/GOST28147Parameters.cs b/crypto/src/asn1/cryptopro/GOST28147Parameters.cs
index fc0d792d1..9167cd4b5 100644
--- a/crypto/src/asn1/cryptopro/GOST28147Parameters.cs
+++ b/crypto/src/asn1/cryptopro/GOST28147Parameters.cs
@@ -1,5 +1,4 @@
 using System;
-using System.Collections;
 
 using Org.BouncyCastle.Utilities;
 
@@ -11,31 +10,23 @@ namespace Org.BouncyCastle.Asn1.CryptoPro
         private readonly Asn1OctetString iv;
         private readonly DerObjectIdentifier paramSet;
 
-		public static Gost28147Parameters GetInstance(
-            Asn1TaggedObject	obj,
-            bool				explicitly)
+		public static Gost28147Parameters GetInstance(Asn1TaggedObject obj, bool explicitly)
         {
             return GetInstance(Asn1Sequence.GetInstance(obj, explicitly));
         }
 
-		public static Gost28147Parameters GetInstance(
-            object obj)
+		public static Gost28147Parameters GetInstance(object obj)
         {
             if (obj == null || obj is Gost28147Parameters)
-            {
                 return (Gost28147Parameters) obj;
-            }
 
-            if (obj is Asn1Sequence)
-            {
-                return new Gost28147Parameters((Asn1Sequence) obj);
-            }
+            if (obj is Asn1Sequence seq)
+                return new Gost28147Parameters(seq);
 
             throw new ArgumentException("Invalid GOST3410Parameter: " + Platform.GetTypeName(obj));
         }
 
-        private Gost28147Parameters(
-            Asn1Sequence seq)
+        private Gost28147Parameters(Asn1Sequence seq)
         {
 			if (seq.Count != 2)
 				throw new ArgumentException("Wrong number of elements in sequence", "seq");
diff --git a/crypto/src/asn1/cryptopro/GOST3410ParamSetParameters.cs b/crypto/src/asn1/cryptopro/GOST3410ParamSetParameters.cs
index ee6ed8c99..c82e4248a 100644
--- a/crypto/src/asn1/cryptopro/GOST3410ParamSetParameters.cs
+++ b/crypto/src/asn1/cryptopro/GOST3410ParamSetParameters.cs
@@ -1,5 +1,4 @@
 using System;
-using System.Collections;
 
 using Org.BouncyCastle.Math;
 using Org.BouncyCastle.Utilities;
@@ -12,25 +11,18 @@ namespace Org.BouncyCastle.Asn1.CryptoPro
         private readonly int keySize;
         private readonly DerInteger	p, q, a;
 
-		public static Gost3410ParamSetParameters GetInstance(
-            Asn1TaggedObject	obj,
-            bool				explicitly)
+		public static Gost3410ParamSetParameters GetInstance(Asn1TaggedObject obj, bool explicitly)
         {
             return GetInstance(Asn1Sequence.GetInstance(obj, explicitly));
         }
 
-		public static Gost3410ParamSetParameters GetInstance(
-            object obj)
+		public static Gost3410ParamSetParameters GetInstance(object obj)
         {
             if (obj == null || obj is Gost3410ParamSetParameters)
-            {
                 return (Gost3410ParamSetParameters) obj;
-            }
 
-			if (obj is Asn1Sequence)
-            {
-                return new Gost3410ParamSetParameters((Asn1Sequence) obj);
-            }
+			if (obj is Asn1Sequence seq)
+                return new Gost3410ParamSetParameters(seq);
 
             throw new ArgumentException("Invalid GOST3410Parameter: " + Platform.GetTypeName(obj));
         }