diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2015-03-23 13:41:55 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2015-03-23 13:41:55 +0700 |
commit | 05a4b3f0a65533aae313dc5429d2dd82243cd9b6 (patch) | |
tree | 626fee4d2a24fbe3b4ecbf3a2fe1e237518e9601 /crypto/src/asn1/sec/SECNamedCurves.cs | |
parent | Update TLS for draft-ietf-tls-session-hash-04 (diff) | |
download | BouncyCastle.NET-ed25519-05a4b3f0a65533aae313dc5429d2dd82243cd9b6.tar.xz |
Add ANSSI curve FRP256v1 and refactor curve registries
Diffstat (limited to 'crypto/src/asn1/sec/SECNamedCurves.cs')
-rw-r--r-- | crypto/src/asn1/sec/SECNamedCurves.cs | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/crypto/src/asn1/sec/SECNamedCurves.cs b/crypto/src/asn1/sec/SECNamedCurves.cs index 60d456ef0..0bd60b0b8 100644 --- a/crypto/src/asn1/sec/SECNamedCurves.cs +++ b/crypto/src/asn1/sec/SECNamedCurves.cs @@ -1154,7 +1154,7 @@ namespace Org.BouncyCastle.Asn1.Sec DerObjectIdentifier oid, X9ECParametersHolder holder) { - objIds.Add(name, oid); + objIds.Add(Platform.ToLowerInvariant(name), oid); names.Add(oid, name); curves.Add(oid, holder); } @@ -1200,9 +1200,7 @@ namespace Org.BouncyCastle.Asn1.Sec public static X9ECParameters GetByName( string name) { - DerObjectIdentifier oid = (DerObjectIdentifier) - objIds[Platform.ToLowerInvariant(name)]; - + DerObjectIdentifier oid = GetOid(name); return oid == null ? null : GetByOid(oid); } @@ -1215,8 +1213,7 @@ namespace Org.BouncyCastle.Asn1.Sec public static X9ECParameters GetByOid( DerObjectIdentifier oid) { - X9ECParametersHolder holder = (X9ECParametersHolder) curves[oid]; - + X9ECParametersHolder holder = (X9ECParametersHolder)curves[oid]; return holder == null ? null : holder.Parameters; } @@ -1238,7 +1235,7 @@ namespace Org.BouncyCastle.Asn1.Sec public static string GetName( DerObjectIdentifier oid) { - return (string) names[oid]; + return (string)names[oid]; } /** @@ -1247,7 +1244,7 @@ namespace Org.BouncyCastle.Asn1.Sec */ public static IEnumerable Names { - get { return new EnumerableProxy(objIds.Keys); } + get { return new EnumerableProxy(names.Values); } } } } |