summary refs log tree commit diff
path: root/crypto/src/asn1/x9/ECNamedCurveTable.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/asn1/x9/ECNamedCurveTable.cs')
-rw-r--r--crypto/src/asn1/x9/ECNamedCurveTable.cs59
1 files changed, 59 insertions, 0 deletions
diff --git a/crypto/src/asn1/x9/ECNamedCurveTable.cs b/crypto/src/asn1/x9/ECNamedCurveTable.cs
index fcd2810e7..f0d70272b 100644
--- a/crypto/src/asn1/x9/ECNamedCurveTable.cs
+++ b/crypto/src/asn1/x9/ECNamedCurveTable.cs
@@ -54,6 +54,36 @@ namespace Org.BouncyCastle.Asn1.X9
             return ecP;
         }
 
+        public static X9ECParametersHolder GetByNameLazy(string name)
+        {
+            X9ECParametersHolder holder = X962NamedCurves.GetByNameLazy(name);
+            if (null == holder)
+            {
+                holder = SecNamedCurves.GetByNameLazy(name);
+            }
+            if (null == holder)
+            {
+                holder = NistNamedCurves.GetByNameLazy(name);
+            }
+            if (null == holder)
+            {
+                holder = TeleTrusTNamedCurves.GetByNameLazy(name);
+            }
+            if (null == holder)
+            {
+                holder = AnssiNamedCurves.GetByNameLazy(name);
+            }
+            if (null == holder)
+            {
+                holder = ECGost3410NamedCurves.GetByNameLazy(name);
+            }
+            if (null == holder)
+            {
+                holder = GMNamedCurves.GetByNameLazy(name);
+            }
+            return holder;
+        }
+
         public static string GetName(DerObjectIdentifier oid)
         {
             string name = X962NamedCurves.GetName(oid);
@@ -156,6 +186,35 @@ namespace Org.BouncyCastle.Asn1.X9
             return ecP;
         }
 
+        public static X9ECParametersHolder GetByOidLazy(DerObjectIdentifier oid)
+        {
+            X9ECParametersHolder holder = X962NamedCurves.GetByOidLazy(oid);
+            if (null == holder)
+            {
+                holder = SecNamedCurves.GetByOidLazy(oid);
+            }
+
+            // NOTE: All the NIST curves are currently from SEC, so no point in redundant OID lookup
+
+            if (null == holder)
+            {
+                holder = TeleTrusTNamedCurves.GetByOidLazy(oid);
+            }
+            if (null == holder)
+            {
+                holder = AnssiNamedCurves.GetByOidLazy(oid);
+            }
+            if (null == holder)
+            {
+                holder = ECGost3410NamedCurves.GetByOidLazy(oid);
+            }
+            if (null == holder)
+            {
+                holder = GMNamedCurves.GetByOidLazy(oid);
+            }
+            return holder;
+        }
+
         /**
          * return an enumeration of the names of the available curves.
          *