add all
This commit is contained in:
112
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/DHDomainParameters.cs
vendored
Normal file
112
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/DHDomainParameters.cs
vendored
Normal file
@@ -0,0 +1,112 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9
|
||||
{
|
||||
public class DHDomainParameters
|
||||
: Asn1Encodable
|
||||
{
|
||||
private readonly DerInteger p, g, q, j;
|
||||
private readonly DHValidationParms validationParms;
|
||||
|
||||
public static DHDomainParameters GetInstance(Asn1TaggedObject obj, bool isExplicit)
|
||||
{
|
||||
return GetInstance(Asn1Sequence.GetInstance(obj, isExplicit));
|
||||
}
|
||||
|
||||
public static DHDomainParameters GetInstance(object obj)
|
||||
{
|
||||
if (obj == null || obj is DHDomainParameters)
|
||||
return (DHDomainParameters)obj;
|
||||
|
||||
if (obj is Asn1Sequence)
|
||||
return new DHDomainParameters((Asn1Sequence)obj);
|
||||
|
||||
throw new ArgumentException("Invalid DHDomainParameters: " + Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj");
|
||||
}
|
||||
|
||||
public DHDomainParameters(DerInteger p, DerInteger g, DerInteger q, DerInteger j,
|
||||
DHValidationParms validationParms)
|
||||
{
|
||||
if (p == null)
|
||||
throw new ArgumentNullException("p");
|
||||
if (g == null)
|
||||
throw new ArgumentNullException("g");
|
||||
if (q == null)
|
||||
throw new ArgumentNullException("q");
|
||||
|
||||
this.p = p;
|
||||
this.g = g;
|
||||
this.q = q;
|
||||
this.j = j;
|
||||
this.validationParms = validationParms;
|
||||
}
|
||||
|
||||
private DHDomainParameters(Asn1Sequence seq)
|
||||
{
|
||||
if (seq.Count < 3 || seq.Count > 5)
|
||||
throw new ArgumentException("Bad sequence size: " + seq.Count, "seq");
|
||||
|
||||
var e = seq.GetEnumerator();
|
||||
this.p = DerInteger.GetInstance(GetNext(e));
|
||||
this.g = DerInteger.GetInstance(GetNext(e));
|
||||
this.q = DerInteger.GetInstance(GetNext(e));
|
||||
|
||||
Asn1Encodable next = GetNext(e);
|
||||
|
||||
if (next != null && next is DerInteger)
|
||||
{
|
||||
this.j = DerInteger.GetInstance(next);
|
||||
next = GetNext(e);
|
||||
}
|
||||
|
||||
if (next != null)
|
||||
{
|
||||
this.validationParms = DHValidationParms.GetInstance(next.ToAsn1Object());
|
||||
}
|
||||
}
|
||||
|
||||
private static Asn1Encodable GetNext(IEnumerator<Asn1Encodable> e)
|
||||
{
|
||||
return e.MoveNext() ? (Asn1Encodable)e.Current : null;
|
||||
}
|
||||
|
||||
public DerInteger P
|
||||
{
|
||||
get { return this.p; }
|
||||
}
|
||||
|
||||
public DerInteger G
|
||||
{
|
||||
get { return this.g; }
|
||||
}
|
||||
|
||||
public DerInteger Q
|
||||
{
|
||||
get { return this.q; }
|
||||
}
|
||||
|
||||
public DerInteger J
|
||||
{
|
||||
get { return this.j; }
|
||||
}
|
||||
|
||||
public DHValidationParms ValidationParms
|
||||
{
|
||||
get { return this.validationParms; }
|
||||
}
|
||||
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
Asn1EncodableVector v = new Asn1EncodableVector(p, g, q);
|
||||
v.AddOptional(j, validationParms);
|
||||
return new DerSequence(v);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
11
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/DHDomainParameters.cs.meta
vendored
Normal file
11
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/DHDomainParameters.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8abddd5c60d99094c97eb6a91e6f4722
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
50
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/DHPublicKey.cs
vendored
Normal file
50
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/DHPublicKey.cs
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System;
|
||||
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9
|
||||
{
|
||||
public class DHPublicKey
|
||||
: Asn1Encodable
|
||||
{
|
||||
private readonly DerInteger y;
|
||||
|
||||
public static DHPublicKey GetInstance(Asn1TaggedObject obj, bool isExplicit)
|
||||
{
|
||||
return GetInstance(DerInteger.GetInstance(obj, isExplicit));
|
||||
}
|
||||
|
||||
public static DHPublicKey GetInstance(object obj)
|
||||
{
|
||||
if (obj == null || obj is DHPublicKey)
|
||||
return (DHPublicKey)obj;
|
||||
|
||||
if (obj is DerInteger)
|
||||
return new DHPublicKey((DerInteger)obj);
|
||||
|
||||
throw new ArgumentException("Invalid DHPublicKey: " + Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj");
|
||||
}
|
||||
|
||||
public DHPublicKey(DerInteger y)
|
||||
{
|
||||
if (y == null)
|
||||
throw new ArgumentNullException("y");
|
||||
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
public DerInteger Y
|
||||
{
|
||||
get { return this.y; }
|
||||
}
|
||||
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
return this.y;
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
11
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/DHPublicKey.cs.meta
vendored
Normal file
11
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/DHPublicKey.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6ca804dc18294264b91512f870334b63
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
68
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/DHValidationParms.cs
vendored
Normal file
68
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/DHValidationParms.cs
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System;
|
||||
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9
|
||||
{
|
||||
public class DHValidationParms
|
||||
: Asn1Encodable
|
||||
{
|
||||
private readonly DerBitString seed;
|
||||
private readonly DerInteger pgenCounter;
|
||||
|
||||
public static DHValidationParms GetInstance(Asn1TaggedObject obj, bool isExplicit)
|
||||
{
|
||||
return GetInstance(Asn1Sequence.GetInstance(obj, isExplicit));
|
||||
}
|
||||
|
||||
public static DHValidationParms GetInstance(object obj)
|
||||
{
|
||||
if (obj == null || obj is DHValidationParms)
|
||||
return (DHValidationParms)obj;
|
||||
|
||||
if (obj is Asn1Sequence)
|
||||
return new DHValidationParms((Asn1Sequence)obj);
|
||||
|
||||
throw new ArgumentException("Invalid DHValidationParms: " + Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj");
|
||||
}
|
||||
|
||||
public DHValidationParms(DerBitString seed, DerInteger pgenCounter)
|
||||
{
|
||||
if (seed == null)
|
||||
throw new ArgumentNullException("seed");
|
||||
if (pgenCounter == null)
|
||||
throw new ArgumentNullException("pgenCounter");
|
||||
|
||||
this.seed = seed;
|
||||
this.pgenCounter = pgenCounter;
|
||||
}
|
||||
|
||||
private DHValidationParms(Asn1Sequence seq)
|
||||
{
|
||||
if (seq.Count != 2)
|
||||
throw new ArgumentException("Bad sequence size: " + seq.Count, "seq");
|
||||
|
||||
this.seed = DerBitString.GetInstance(seq[0]);
|
||||
this.pgenCounter = DerInteger.GetInstance(seq[1]);
|
||||
}
|
||||
|
||||
public DerBitString Seed
|
||||
{
|
||||
get { return this.seed; }
|
||||
}
|
||||
|
||||
public DerInteger PgenCounter
|
||||
{
|
||||
get { return this.pgenCounter; }
|
||||
}
|
||||
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
return new DerSequence(seed, pgenCounter);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
11
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/DHValidationParms.cs.meta
vendored
Normal file
11
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/DHValidationParms.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7b9d7fbb7b559f64789c0233158c7d80
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
237
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/ECNamedCurveTable.cs
vendored
Normal file
237
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/ECNamedCurveTable.cs
vendored
Normal file
@@ -0,0 +1,237 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Anssi;
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro;
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.GM;
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist;
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Sec;
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.TeleTrust;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9
|
||||
{
|
||||
/// <summary>A unified elliptic curve registry of the various standard-specific registries.</summary>
|
||||
public class ECNamedCurveTable
|
||||
{
|
||||
/// <summary>Look up the <see cref="X9ECParameters"/> for the curve with the given name.</summary>
|
||||
/// <param name="name">The name of the curve.</param>
|
||||
public static X9ECParameters GetByName(string name)
|
||||
{
|
||||
X9ECParameters ecP = X962NamedCurves.GetByName(name);
|
||||
if (ecP == null)
|
||||
{
|
||||
ecP = SecNamedCurves.GetByName(name);
|
||||
}
|
||||
if (ecP == null)
|
||||
{
|
||||
ecP = NistNamedCurves.GetByName(name);
|
||||
}
|
||||
if (ecP == null)
|
||||
{
|
||||
ecP = TeleTrusTNamedCurves.GetByName(name);
|
||||
}
|
||||
if (ecP == null)
|
||||
{
|
||||
ecP = AnssiNamedCurves.GetByName(name);
|
||||
}
|
||||
if (ecP == null)
|
||||
{
|
||||
ecP = ECGost3410NamedCurves.GetByName(name);
|
||||
}
|
||||
if (ecP == null)
|
||||
{
|
||||
ecP = GMNamedCurves.GetByName(name);
|
||||
}
|
||||
return ecP;
|
||||
}
|
||||
|
||||
/// <summary>Look up an <see cref="X9ECParametersHolder"/> for the curve with the given name.</summary>
|
||||
/// <remarks>
|
||||
/// Allows accessing the <see cref="Math.EC.ECCurve">curve</see> without necessarily triggering the creation of
|
||||
/// the full <see cref="X9ECParameters"/>.
|
||||
/// </remarks>
|
||||
/// <param name="name">The name of the curve.</param>
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary>Look up the <see cref="X9ECParameters"/> for the curve with the given
|
||||
/// <see cref="DerObjectIdentifier">OID</see>.</summary>
|
||||
/// <param name="oid">The <see cref="DerObjectIdentifier">OID</see> for the curve.</param>
|
||||
public static X9ECParameters GetByOid(DerObjectIdentifier oid)
|
||||
{
|
||||
X9ECParameters ecP = X962NamedCurves.GetByOid(oid);
|
||||
if (ecP == null)
|
||||
{
|
||||
ecP = SecNamedCurves.GetByOid(oid);
|
||||
}
|
||||
|
||||
// NOTE: All the NIST curves are currently from SEC, so no point in redundant OID lookup
|
||||
|
||||
if (ecP == null)
|
||||
{
|
||||
ecP = TeleTrusTNamedCurves.GetByOid(oid);
|
||||
}
|
||||
if (ecP == null)
|
||||
{
|
||||
ecP = AnssiNamedCurves.GetByOid(oid);
|
||||
}
|
||||
if (ecP == null)
|
||||
{
|
||||
ecP = ECGost3410NamedCurves.GetByOid(oid);
|
||||
}
|
||||
if (ecP == null)
|
||||
{
|
||||
ecP = GMNamedCurves.GetByOid(oid);
|
||||
}
|
||||
return ecP;
|
||||
}
|
||||
|
||||
/// <summary>Look up an <see cref="X9ECParametersHolder"/> for the curve with the given
|
||||
/// <see cref="DerObjectIdentifier">OID</see>.</summary>
|
||||
/// <remarks>
|
||||
/// Allows accessing the <see cref="Math.EC.ECCurve">curve</see> without necessarily triggering the creation of
|
||||
/// the full <see cref="X9ECParameters"/>.
|
||||
/// </remarks>
|
||||
/// <param name="oid">The <see cref="DerObjectIdentifier">OID</see> for the curve.</param>
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary>Look up the name of the curve with the given <see cref="DerObjectIdentifier">OID</see>.</summary>
|
||||
/// <param name="oid">The <see cref="DerObjectIdentifier">OID</see> for the curve.</param>
|
||||
public static string GetName(DerObjectIdentifier oid)
|
||||
{
|
||||
string name = X962NamedCurves.GetName(oid);
|
||||
if (name == null)
|
||||
{
|
||||
name = SecNamedCurves.GetName(oid);
|
||||
}
|
||||
if (name == null)
|
||||
{
|
||||
name = NistNamedCurves.GetName(oid);
|
||||
}
|
||||
if (name == null)
|
||||
{
|
||||
name = TeleTrusTNamedCurves.GetName(oid);
|
||||
}
|
||||
if (name == null)
|
||||
{
|
||||
name = AnssiNamedCurves.GetName(oid);
|
||||
}
|
||||
if (name == null)
|
||||
{
|
||||
name = ECGost3410NamedCurves.GetName(oid);
|
||||
}
|
||||
if (name == null)
|
||||
{
|
||||
name = GMNamedCurves.GetName(oid);
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
/// <summary>Look up the <see cref="DerObjectIdentifier">OID</see> of the curve with the given name.</summary>
|
||||
/// <param name="name">The name of the curve.</param>
|
||||
public static DerObjectIdentifier GetOid(string name)
|
||||
{
|
||||
DerObjectIdentifier oid = X962NamedCurves.GetOid(name);
|
||||
if (oid == null)
|
||||
{
|
||||
oid = SecNamedCurves.GetOid(name);
|
||||
}
|
||||
if (oid == null)
|
||||
{
|
||||
oid = NistNamedCurves.GetOid(name);
|
||||
}
|
||||
if (oid == null)
|
||||
{
|
||||
oid = TeleTrusTNamedCurves.GetOid(name);
|
||||
}
|
||||
if (oid == null)
|
||||
{
|
||||
oid = AnssiNamedCurves.GetOid(name);
|
||||
}
|
||||
if (oid == null)
|
||||
{
|
||||
oid = ECGost3410NamedCurves.GetOid(name);
|
||||
}
|
||||
if (oid == null)
|
||||
{
|
||||
oid = GMNamedCurves.GetOid(name);
|
||||
}
|
||||
return oid;
|
||||
}
|
||||
|
||||
/// <summary>Enumerate the available curve names in all the registries.</summary>
|
||||
public static IEnumerable<string> Names
|
||||
{
|
||||
get
|
||||
{
|
||||
var result = new List<string>();
|
||||
result.AddRange(X962NamedCurves.Names);
|
||||
result.AddRange(SecNamedCurves.Names);
|
||||
result.AddRange(NistNamedCurves.Names);
|
||||
result.AddRange(TeleTrusTNamedCurves.Names);
|
||||
result.AddRange(AnssiNamedCurves.Names);
|
||||
result.AddRange(ECGost3410NamedCurves.Names);
|
||||
result.AddRange(GMNamedCurves.Names);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
11
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/ECNamedCurveTable.cs.meta
vendored
Normal file
11
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/ECNamedCurveTable.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7ef707e98faa62d4b9ff0a2661d09be2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
59
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/KeySpecificInfo.cs
vendored
Normal file
59
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/KeySpecificInfo.cs
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9
|
||||
{
|
||||
/**
|
||||
* ASN.1 def for Diffie-Hellman key exchange KeySpecificInfo structure. See
|
||||
* RFC 2631, or X9.42, for further details.
|
||||
*/
|
||||
public class KeySpecificInfo
|
||||
: Asn1Encodable
|
||||
{
|
||||
private DerObjectIdentifier algorithm;
|
||||
private Asn1OctetString counter;
|
||||
|
||||
public KeySpecificInfo(
|
||||
DerObjectIdentifier algorithm,
|
||||
Asn1OctetString counter)
|
||||
{
|
||||
this.algorithm = algorithm;
|
||||
this.counter = counter;
|
||||
}
|
||||
|
||||
public KeySpecificInfo(Asn1Sequence seq)
|
||||
{
|
||||
var e = seq.GetEnumerator();
|
||||
|
||||
e.MoveNext();
|
||||
algorithm = (DerObjectIdentifier)e.Current;
|
||||
e.MoveNext();
|
||||
counter = (Asn1OctetString)e.Current;
|
||||
}
|
||||
|
||||
public DerObjectIdentifier Algorithm
|
||||
{
|
||||
get { return algorithm; }
|
||||
}
|
||||
|
||||
public Asn1OctetString Counter
|
||||
{
|
||||
get { return counter; }
|
||||
}
|
||||
|
||||
/**
|
||||
* Produce an object suitable for an Asn1OutputStream.
|
||||
* <pre>
|
||||
* KeySpecificInfo ::= Sequence {
|
||||
* algorithm OBJECT IDENTIFIER,
|
||||
* counter OCTET STRING SIZE (4..4)
|
||||
* }
|
||||
* </pre>
|
||||
*/
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
return new DerSequence(algorithm, counter);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
11
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/KeySpecificInfo.cs.meta
vendored
Normal file
11
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/KeySpecificInfo.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ae2146f35a96e774182e1e3ac7aecc34
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
83
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/OtherInfo.cs
vendored
Normal file
83
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/OtherInfo.cs
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9
|
||||
{
|
||||
/**
|
||||
* ANS.1 def for Diffie-Hellman key exchange OtherInfo structure. See
|
||||
* RFC 2631, or X9.42, for further details.
|
||||
*/
|
||||
public class OtherInfo
|
||||
: Asn1Encodable
|
||||
{
|
||||
private KeySpecificInfo keyInfo;
|
||||
private Asn1OctetString partyAInfo;
|
||||
private Asn1OctetString suppPubInfo;
|
||||
|
||||
public OtherInfo(
|
||||
KeySpecificInfo keyInfo,
|
||||
Asn1OctetString partyAInfo,
|
||||
Asn1OctetString suppPubInfo)
|
||||
{
|
||||
this.keyInfo = keyInfo;
|
||||
this.partyAInfo = partyAInfo;
|
||||
this.suppPubInfo = suppPubInfo;
|
||||
}
|
||||
|
||||
public OtherInfo(Asn1Sequence seq)
|
||||
{
|
||||
var e = seq.GetEnumerator();
|
||||
|
||||
e.MoveNext();
|
||||
keyInfo = new KeySpecificInfo((Asn1Sequence)e.Current);
|
||||
|
||||
while (e.MoveNext())
|
||||
{
|
||||
Asn1TaggedObject o = (Asn1TaggedObject)e.Current;
|
||||
|
||||
if (o.TagNo == 0)
|
||||
{
|
||||
partyAInfo = (Asn1OctetString)o.GetObject();
|
||||
}
|
||||
else if ((int) o.TagNo == 2)
|
||||
{
|
||||
suppPubInfo = (Asn1OctetString)o.GetObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public KeySpecificInfo KeyInfo
|
||||
{
|
||||
get { return keyInfo; }
|
||||
}
|
||||
|
||||
public Asn1OctetString PartyAInfo
|
||||
{
|
||||
get { return partyAInfo; }
|
||||
}
|
||||
|
||||
public Asn1OctetString SuppPubInfo
|
||||
{
|
||||
get { return suppPubInfo; }
|
||||
}
|
||||
|
||||
/**
|
||||
* Produce an object suitable for an Asn1OutputStream.
|
||||
* <pre>
|
||||
* OtherInfo ::= Sequence {
|
||||
* keyInfo KeySpecificInfo,
|
||||
* partyAInfo [0] OCTET STRING OPTIONAL,
|
||||
* suppPubInfo [2] OCTET STRING
|
||||
* }
|
||||
* </pre>
|
||||
*/
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
Asn1EncodableVector v = new Asn1EncodableVector(keyInfo);
|
||||
v.AddOptionalTagged(true, 0, partyAInfo);
|
||||
v.Add(new DerTaggedObject(2, suppPubInfo));
|
||||
return new DerSequence(v);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
11
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/OtherInfo.cs.meta
vendored
Normal file
11
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/OtherInfo.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 04bfdb3f609c0ef45b4d49bdde370acb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
866
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/X962NamedCurves.cs
vendored
Normal file
866
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/X962NamedCurves.cs
vendored
Normal file
@@ -0,0 +1,866 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Math;
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Math.EC;
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier;
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections;
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9
|
||||
{
|
||||
/// <summary>Elliptic curve registry for the curves defined in X.962 EC-DSA.</summary>
|
||||
public static class X962NamedCurves
|
||||
{
|
||||
private static X9ECPoint ConfigureBasepoint(ECCurve curve, string encoding)
|
||||
{
|
||||
X9ECPoint G = new X9ECPoint(curve, Hex.DecodeStrict(encoding));
|
||||
WNafUtilities.ConfigureBasepoint(G.Point);
|
||||
return G;
|
||||
}
|
||||
|
||||
private static ECCurve ConfigureCurve(ECCurve curve)
|
||||
{
|
||||
return curve;
|
||||
}
|
||||
|
||||
private static BigInteger FromHex(string hex)
|
||||
{
|
||||
return new BigInteger(1, Hex.DecodeStrict(hex));
|
||||
}
|
||||
|
||||
internal class Prime192v1Holder
|
||||
: X9ECParametersHolder
|
||||
{
|
||||
private Prime192v1Holder() {}
|
||||
|
||||
internal static readonly X9ECParametersHolder Instance = new Prime192v1Holder();
|
||||
|
||||
protected override ECCurve CreateCurve()
|
||||
{
|
||||
BigInteger n = FromHex("ffffffffffffffffffffffff99def836146bc9b1b4d22831");
|
||||
BigInteger h = BigInteger.One;
|
||||
|
||||
return ConfigureCurve(new FpCurve(
|
||||
FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF"),
|
||||
FromHex("fffffffffffffffffffffffffffffffefffffffffffffffc"),
|
||||
FromHex("64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1"),
|
||||
n, h, true));
|
||||
}
|
||||
|
||||
protected override X9ECParameters CreateParameters()
|
||||
{
|
||||
byte[] S = Hex.DecodeStrict("3045AE6FC8422f64ED579528D38120EAE12196D5");
|
||||
ECCurve curve = Curve;
|
||||
|
||||
X9ECPoint G = ConfigureBasepoint(curve,
|
||||
"03188da80eb03090f67cbf20eb43a18800f4ff0afd82ff1012");
|
||||
|
||||
return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S);
|
||||
}
|
||||
}
|
||||
|
||||
internal class Prime192v2Holder
|
||||
: X9ECParametersHolder
|
||||
{
|
||||
private Prime192v2Holder() {}
|
||||
|
||||
internal static readonly X9ECParametersHolder Instance = new Prime192v2Holder();
|
||||
|
||||
protected override ECCurve CreateCurve()
|
||||
{
|
||||
BigInteger n = FromHex("fffffffffffffffffffffffe5fb1a724dc80418648d8dd31");
|
||||
BigInteger h = BigInteger.One;
|
||||
|
||||
return ConfigureCurve(new FpCurve(
|
||||
FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF"),
|
||||
FromHex("fffffffffffffffffffffffffffffffefffffffffffffffc"),
|
||||
FromHex("cc22d6dfb95c6b25e49c0d6364a4e5980c393aa21668d953"),
|
||||
n, h, true));
|
||||
}
|
||||
|
||||
protected override X9ECParameters CreateParameters()
|
||||
{
|
||||
byte[] S = Hex.DecodeStrict("31a92ee2029fd10d901b113e990710f0d21ac6b6");
|
||||
ECCurve curve = Curve;
|
||||
|
||||
X9ECPoint G = ConfigureBasepoint(curve,
|
||||
"03eea2bae7e1497842f2de7769cfe9c989c072ad696f48034a");
|
||||
|
||||
return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S);
|
||||
}
|
||||
}
|
||||
|
||||
internal class Prime192v3Holder
|
||||
: X9ECParametersHolder
|
||||
{
|
||||
private Prime192v3Holder() {}
|
||||
|
||||
internal static readonly X9ECParametersHolder Instance = new Prime192v3Holder();
|
||||
|
||||
protected override ECCurve CreateCurve()
|
||||
{
|
||||
BigInteger n = FromHex("ffffffffffffffffffffffff7a62d031c83f4294f640ec13");
|
||||
BigInteger h = BigInteger.One;
|
||||
|
||||
return ConfigureCurve(new FpCurve(
|
||||
FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF"),
|
||||
FromHex("fffffffffffffffffffffffffffffffefffffffffffffffc"),
|
||||
FromHex("22123dc2395a05caa7423daeccc94760a7d462256bd56916"),
|
||||
n, h, true));
|
||||
}
|
||||
|
||||
protected override X9ECParameters CreateParameters()
|
||||
{
|
||||
byte[] S = Hex.DecodeStrict("c469684435deb378c4b65ca9591e2a5763059a2e");
|
||||
ECCurve curve = Curve;
|
||||
|
||||
X9ECPoint G = ConfigureBasepoint(curve,
|
||||
"027d29778100c65a1da1783716588dce2b8b4aee8e228f1896");
|
||||
|
||||
return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S);
|
||||
}
|
||||
}
|
||||
|
||||
internal class Prime239v1Holder
|
||||
: X9ECParametersHolder
|
||||
{
|
||||
private Prime239v1Holder() {}
|
||||
|
||||
internal static readonly X9ECParametersHolder Instance = new Prime239v1Holder();
|
||||
|
||||
protected override ECCurve CreateCurve()
|
||||
{
|
||||
BigInteger n = FromHex("7fffffffffffffffffffffff7fffff9e5e9a9f5d9071fbd1522688909d0b");
|
||||
BigInteger h = BigInteger.One;
|
||||
|
||||
return ConfigureCurve(new FpCurve(
|
||||
new BigInteger("883423532389192164791648750360308885314476597252960362792450860609699839"),
|
||||
FromHex("7fffffffffffffffffffffff7fffffffffff8000000000007ffffffffffc"),
|
||||
FromHex("6b016c3bdcf18941d0d654921475ca71a9db2fb27d1d37796185c2942c0a"),
|
||||
n, h, true));
|
||||
}
|
||||
|
||||
protected override X9ECParameters CreateParameters()
|
||||
{
|
||||
byte[] S = Hex.DecodeStrict("e43bb460f0b80cc0c0b075798e948060f8321b7d");
|
||||
ECCurve curve = Curve;
|
||||
|
||||
X9ECPoint G = ConfigureBasepoint(curve,
|
||||
"020ffa963cdca8816ccc33b8642bedf905c3d358573d3f27fbbd3b3cb9aaaf");
|
||||
|
||||
return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S);
|
||||
}
|
||||
}
|
||||
|
||||
internal class Prime239v2Holder
|
||||
: X9ECParametersHolder
|
||||
{
|
||||
private Prime239v2Holder() {}
|
||||
|
||||
internal static readonly X9ECParametersHolder Instance = new Prime239v2Holder();
|
||||
|
||||
protected override ECCurve CreateCurve()
|
||||
{
|
||||
BigInteger n = FromHex("7fffffffffffffffffffffff800000cfa7e8594377d414c03821bc582063");
|
||||
BigInteger h = BigInteger.One;
|
||||
|
||||
return ConfigureCurve(new FpCurve(
|
||||
new BigInteger("883423532389192164791648750360308885314476597252960362792450860609699839"),
|
||||
FromHex("7fffffffffffffffffffffff7fffffffffff8000000000007ffffffffffc"),
|
||||
FromHex("617fab6832576cbbfed50d99f0249c3fee58b94ba0038c7ae84c8c832f2c"),
|
||||
n, h, true));
|
||||
}
|
||||
|
||||
protected override X9ECParameters CreateParameters()
|
||||
{
|
||||
byte[] S = Hex.DecodeStrict("e8b4011604095303ca3b8099982be09fcb9ae616");
|
||||
ECCurve curve = Curve;
|
||||
|
||||
X9ECPoint G = ConfigureBasepoint(curve,
|
||||
"0238af09d98727705120c921bb5e9e26296a3cdcf2f35757a0eafd87b830e7");
|
||||
|
||||
return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S);
|
||||
}
|
||||
}
|
||||
|
||||
internal class Prime239v3Holder
|
||||
: X9ECParametersHolder
|
||||
{
|
||||
private Prime239v3Holder() {}
|
||||
|
||||
internal static readonly X9ECParametersHolder Instance = new Prime239v3Holder();
|
||||
|
||||
protected override ECCurve CreateCurve()
|
||||
{
|
||||
BigInteger n = FromHex("7fffffffffffffffffffffff7fffff975deb41b3a6057c3c432146526551");
|
||||
BigInteger h = BigInteger.One;
|
||||
|
||||
return ConfigureCurve(new FpCurve(
|
||||
new BigInteger("883423532389192164791648750360308885314476597252960362792450860609699839"),
|
||||
FromHex("7fffffffffffffffffffffff7fffffffffff8000000000007ffffffffffc"),
|
||||
FromHex("255705fa2a306654b1f4cb03d6a750a30c250102d4988717d9ba15ab6d3e"),
|
||||
n, h, true));
|
||||
}
|
||||
|
||||
protected override X9ECParameters CreateParameters()
|
||||
{
|
||||
byte[] S = Hex.DecodeStrict("7d7374168ffe3471b60a857686a19475d3bfa2ff");
|
||||
ECCurve curve = Curve;
|
||||
|
||||
X9ECPoint G = ConfigureBasepoint(curve,
|
||||
"036768ae8e18bb92cfcf005c949aa2c6d94853d0e660bbf854b1c9505fe95a");
|
||||
|
||||
return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S);
|
||||
}
|
||||
}
|
||||
|
||||
internal class Prime256v1Holder
|
||||
: X9ECParametersHolder
|
||||
{
|
||||
private Prime256v1Holder() {}
|
||||
|
||||
internal static readonly X9ECParametersHolder Instance = new Prime256v1Holder();
|
||||
|
||||
protected override ECCurve CreateCurve()
|
||||
{
|
||||
BigInteger n = FromHex("ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551");
|
||||
BigInteger h = BigInteger.One;
|
||||
|
||||
return ConfigureCurve(new FpCurve(
|
||||
new BigInteger("115792089210356248762697446949407573530086143415290314195533631308867097853951"),
|
||||
FromHex("ffffffff00000001000000000000000000000000fffffffffffffffffffffffc"),
|
||||
FromHex("5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),
|
||||
n, h, true));
|
||||
}
|
||||
|
||||
protected override X9ECParameters CreateParameters()
|
||||
{
|
||||
byte[] S = Hex.DecodeStrict("c49d360886e704936a6678e1139d26b7819f7e90");
|
||||
ECCurve curve = Curve;
|
||||
|
||||
X9ECPoint G = ConfigureBasepoint(curve,
|
||||
"036b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296");
|
||||
|
||||
return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S);
|
||||
}
|
||||
}
|
||||
|
||||
internal class C2pnb163v1Holder
|
||||
: X9ECParametersHolder
|
||||
{
|
||||
private C2pnb163v1Holder() {}
|
||||
|
||||
internal static readonly X9ECParametersHolder Instance = new C2pnb163v1Holder();
|
||||
|
||||
protected override ECCurve CreateCurve()
|
||||
{
|
||||
BigInteger n = FromHex("0400000000000000000001E60FC8821CC74DAEAFC1");
|
||||
BigInteger h = BigInteger.Two;
|
||||
|
||||
return ConfigureCurve(new F2mCurve(
|
||||
163,
|
||||
1, 2, 8,
|
||||
FromHex("072546B5435234A422E0789675F432C89435DE5242"),
|
||||
FromHex("00C9517D06D5240D3CFF38C74B20B6CD4D6F9DD4D9"),
|
||||
n, h));
|
||||
}
|
||||
|
||||
protected override X9ECParameters CreateParameters()
|
||||
{
|
||||
byte[] S = Hex.DecodeStrict("D2C0FB15760860DEF1EEF4D696E6768756151754");
|
||||
ECCurve curve = Curve;
|
||||
|
||||
X9ECPoint G = ConfigureBasepoint(curve,
|
||||
"0307AF69989546103D79329FCC3D74880F33BBE803CB");
|
||||
|
||||
return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S);
|
||||
}
|
||||
}
|
||||
|
||||
internal class C2pnb163v2Holder
|
||||
: X9ECParametersHolder
|
||||
{
|
||||
private C2pnb163v2Holder() {}
|
||||
|
||||
internal static readonly X9ECParametersHolder Instance = new C2pnb163v2Holder();
|
||||
|
||||
protected override ECCurve CreateCurve()
|
||||
{
|
||||
BigInteger n = FromHex("03FFFFFFFFFFFFFFFFFFFDF64DE1151ADBB78F10A7");
|
||||
BigInteger h = BigInteger.Two;
|
||||
|
||||
return ConfigureCurve(new F2mCurve(
|
||||
163,
|
||||
1, 2, 8,
|
||||
FromHex("0108B39E77C4B108BED981ED0E890E117C511CF072"),
|
||||
FromHex("0667ACEB38AF4E488C407433FFAE4F1C811638DF20"),
|
||||
n, h));
|
||||
}
|
||||
|
||||
protected override X9ECParameters CreateParameters()
|
||||
{
|
||||
byte[] S = null;
|
||||
ECCurve curve = Curve;
|
||||
|
||||
X9ECPoint G = ConfigureBasepoint(curve,
|
||||
"030024266E4EB5106D0A964D92C4860E2671DB9B6CC5");
|
||||
|
||||
return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S);
|
||||
}
|
||||
}
|
||||
|
||||
internal class C2pnb163v3Holder
|
||||
: X9ECParametersHolder
|
||||
{
|
||||
private C2pnb163v3Holder() {}
|
||||
|
||||
internal static readonly X9ECParametersHolder Instance = new C2pnb163v3Holder();
|
||||
|
||||
protected override ECCurve CreateCurve()
|
||||
{
|
||||
BigInteger n = FromHex("03FFFFFFFFFFFFFFFFFFFE1AEE140F110AFF961309");
|
||||
BigInteger h = BigInteger.Two;
|
||||
|
||||
return ConfigureCurve(new F2mCurve(
|
||||
163,
|
||||
1, 2, 8,
|
||||
FromHex("07A526C63D3E25A256A007699F5447E32AE456B50E"),
|
||||
FromHex("03F7061798EB99E238FD6F1BF95B48FEEB4854252B"),
|
||||
n, h));
|
||||
}
|
||||
|
||||
protected override X9ECParameters CreateParameters()
|
||||
{
|
||||
byte[] S = null;
|
||||
ECCurve curve = Curve;
|
||||
|
||||
X9ECPoint G = ConfigureBasepoint(curve,
|
||||
"0202F9F87B7C574D0BDECF8A22E6524775F98CDEBDCB");
|
||||
|
||||
return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S);
|
||||
}
|
||||
}
|
||||
|
||||
internal class C2pnb176w1Holder
|
||||
: X9ECParametersHolder
|
||||
{
|
||||
private C2pnb176w1Holder() {}
|
||||
|
||||
internal static readonly X9ECParametersHolder Instance = new C2pnb176w1Holder();
|
||||
|
||||
protected override ECCurve CreateCurve()
|
||||
{
|
||||
BigInteger n = FromHex("010092537397ECA4F6145799D62B0A19CE06FE26AD");
|
||||
BigInteger h = BigInteger.ValueOf(0xFF6E);
|
||||
|
||||
return ConfigureCurve(new F2mCurve(
|
||||
176,
|
||||
1, 2, 43,
|
||||
FromHex("E4E6DB2995065C407D9D39B8D0967B96704BA8E9C90B"),
|
||||
FromHex("5DDA470ABE6414DE8EC133AE28E9BBD7FCEC0AE0FFF2"),
|
||||
n, h));
|
||||
}
|
||||
|
||||
protected override X9ECParameters CreateParameters()
|
||||
{
|
||||
byte[] S = null;
|
||||
ECCurve curve = Curve;
|
||||
|
||||
X9ECPoint G = ConfigureBasepoint(curve,
|
||||
"038D16C2866798B600F9F08BB4A8E860F3298CE04A5798");
|
||||
|
||||
return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S);
|
||||
}
|
||||
}
|
||||
|
||||
internal class C2tnb191v1Holder
|
||||
: X9ECParametersHolder
|
||||
{
|
||||
private C2tnb191v1Holder() {}
|
||||
|
||||
internal static readonly X9ECParametersHolder Instance = new C2tnb191v1Holder();
|
||||
|
||||
protected override ECCurve CreateCurve()
|
||||
{
|
||||
BigInteger n = FromHex("40000000000000000000000004A20E90C39067C893BBB9A5");
|
||||
BigInteger h = BigInteger.Two;
|
||||
|
||||
return ConfigureCurve(new F2mCurve(
|
||||
191,
|
||||
9,
|
||||
FromHex("2866537B676752636A68F56554E12640276B649EF7526267"),
|
||||
FromHex("2E45EF571F00786F67B0081B9495A3D95462F5DE0AA185EC"),
|
||||
n, h));
|
||||
}
|
||||
|
||||
protected override X9ECParameters CreateParameters()
|
||||
{
|
||||
byte[] S = Hex.DecodeStrict("4E13CA542744D696E67687561517552F279A8C84");
|
||||
ECCurve curve = Curve;
|
||||
|
||||
X9ECPoint G = ConfigureBasepoint(curve,
|
||||
"0236B3DAF8A23206F9C4F299D7B21A9C369137F2C84AE1AA0D");
|
||||
|
||||
return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S);
|
||||
}
|
||||
}
|
||||
|
||||
internal class C2tnb191v2Holder
|
||||
: X9ECParametersHolder
|
||||
{
|
||||
private C2tnb191v2Holder() {}
|
||||
|
||||
internal static readonly X9ECParametersHolder Instance = new C2tnb191v2Holder();
|
||||
|
||||
protected override ECCurve CreateCurve()
|
||||
{
|
||||
BigInteger n = FromHex("20000000000000000000000050508CB89F652824E06B8173");
|
||||
BigInteger h = BigInteger.ValueOf(4);
|
||||
|
||||
return ConfigureCurve(new F2mCurve(
|
||||
191,
|
||||
9,
|
||||
FromHex("401028774D7777C7B7666D1366EA432071274F89FF01E718"),
|
||||
FromHex("0620048D28BCBD03B6249C99182B7C8CD19700C362C46A01"),
|
||||
n, h));
|
||||
}
|
||||
|
||||
protected override X9ECParameters CreateParameters()
|
||||
{
|
||||
byte[] S = null;
|
||||
ECCurve curve = Curve;
|
||||
|
||||
X9ECPoint G = ConfigureBasepoint(curve,
|
||||
"023809B2B7CC1B28CC5A87926AAD83FD28789E81E2C9E3BF10");
|
||||
|
||||
return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S);
|
||||
}
|
||||
}
|
||||
|
||||
internal class C2tnb191v3Holder
|
||||
: X9ECParametersHolder
|
||||
{
|
||||
private C2tnb191v3Holder() {}
|
||||
|
||||
internal static readonly X9ECParametersHolder Instance = new C2tnb191v3Holder();
|
||||
|
||||
protected override ECCurve CreateCurve()
|
||||
{
|
||||
BigInteger n = FromHex("155555555555555555555555610C0B196812BFB6288A3EA3");
|
||||
BigInteger h = BigInteger.ValueOf(6);
|
||||
|
||||
return ConfigureCurve(new F2mCurve(
|
||||
191,
|
||||
9,
|
||||
FromHex("6C01074756099122221056911C77D77E77A777E7E7E77FCB"),
|
||||
FromHex("71FE1AF926CF847989EFEF8DB459F66394D90F32AD3F15E8"),
|
||||
n, h));
|
||||
}
|
||||
|
||||
protected override X9ECParameters CreateParameters()
|
||||
{
|
||||
byte[] S = null;
|
||||
ECCurve curve = Curve;
|
||||
|
||||
X9ECPoint G = ConfigureBasepoint(curve,
|
||||
"03375D4CE24FDE434489DE8746E71786015009E66E38A926DD");
|
||||
|
||||
return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S);
|
||||
}
|
||||
}
|
||||
|
||||
internal class C2pnb208w1Holder
|
||||
: X9ECParametersHolder
|
||||
{
|
||||
private C2pnb208w1Holder() {}
|
||||
|
||||
internal static readonly X9ECParametersHolder Instance = new C2pnb208w1Holder();
|
||||
|
||||
protected override ECCurve CreateCurve()
|
||||
{
|
||||
BigInteger n = FromHex("0101BAF95C9723C57B6C21DA2EFF2D5ED588BDD5717E212F9D");
|
||||
BigInteger h = BigInteger.ValueOf(0xFE48);
|
||||
|
||||
return ConfigureCurve(new F2mCurve(
|
||||
208,
|
||||
1, 2, 83,
|
||||
BigInteger.Zero,
|
||||
FromHex("C8619ED45A62E6212E1160349E2BFA844439FAFC2A3FD1638F9E"),
|
||||
n, h));
|
||||
}
|
||||
|
||||
protected override X9ECParameters CreateParameters()
|
||||
{
|
||||
byte[] S = null;
|
||||
ECCurve curve = Curve;
|
||||
|
||||
X9ECPoint G = ConfigureBasepoint(curve,
|
||||
"0289FDFBE4ABE193DF9559ECF07AC0CE78554E2784EB8C1ED1A57A");
|
||||
|
||||
return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S);
|
||||
}
|
||||
}
|
||||
|
||||
internal class C2tnb239v1Holder
|
||||
: X9ECParametersHolder
|
||||
{
|
||||
private C2tnb239v1Holder() {}
|
||||
|
||||
internal static readonly X9ECParametersHolder Instance = new C2tnb239v1Holder();
|
||||
|
||||
protected override ECCurve CreateCurve()
|
||||
{
|
||||
BigInteger n = FromHex("2000000000000000000000000000000F4D42FFE1492A4993F1CAD666E447");
|
||||
BigInteger h = BigInteger.ValueOf(4);
|
||||
|
||||
return ConfigureCurve(new F2mCurve(
|
||||
239,
|
||||
36,
|
||||
FromHex("32010857077C5431123A46B808906756F543423E8D27877578125778AC76"),
|
||||
FromHex("790408F2EEDAF392B012EDEFB3392F30F4327C0CA3F31FC383C422AA8C16"),
|
||||
n, h));
|
||||
}
|
||||
|
||||
protected override X9ECParameters CreateParameters()
|
||||
{
|
||||
byte[] S = null;
|
||||
ECCurve curve = Curve;
|
||||
|
||||
X9ECPoint G = ConfigureBasepoint(curve,
|
||||
"0257927098FA932E7C0A96D3FD5B706EF7E5F5C156E16B7E7C86038552E91D");
|
||||
|
||||
return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S);
|
||||
}
|
||||
}
|
||||
|
||||
internal class C2tnb239v2Holder
|
||||
: X9ECParametersHolder
|
||||
{
|
||||
private C2tnb239v2Holder() {}
|
||||
|
||||
internal static readonly X9ECParametersHolder Instance = new C2tnb239v2Holder();
|
||||
|
||||
protected override ECCurve CreateCurve()
|
||||
{
|
||||
BigInteger n = FromHex("1555555555555555555555555555553C6F2885259C31E3FCDF154624522D");
|
||||
BigInteger h = BigInteger.ValueOf(6);
|
||||
|
||||
return ConfigureCurve(new F2mCurve(
|
||||
239,
|
||||
36,
|
||||
FromHex("4230017757A767FAE42398569B746325D45313AF0766266479B75654E65F"),
|
||||
FromHex("5037EA654196CFF0CD82B2C14A2FCF2E3FF8775285B545722F03EACDB74B"),
|
||||
n, h));
|
||||
}
|
||||
|
||||
protected override X9ECParameters CreateParameters()
|
||||
{
|
||||
byte[] S = null;
|
||||
ECCurve curve = Curve;
|
||||
|
||||
X9ECPoint G = ConfigureBasepoint(curve,
|
||||
"0228F9D04E900069C8DC47A08534FE76D2B900B7D7EF31F5709F200C4CA205");
|
||||
|
||||
return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S);
|
||||
}
|
||||
}
|
||||
|
||||
internal class C2tnb239v3Holder
|
||||
: X9ECParametersHolder
|
||||
{
|
||||
private C2tnb239v3Holder() {}
|
||||
|
||||
internal static readonly X9ECParametersHolder Instance = new C2tnb239v3Holder();
|
||||
|
||||
protected override ECCurve CreateCurve()
|
||||
{
|
||||
BigInteger n = FromHex("0CCCCCCCCCCCCCCCCCCCCCCCCCCCCCAC4912D2D9DF903EF9888B8A0E4CFF");
|
||||
BigInteger h = BigInteger.ValueOf(10);
|
||||
|
||||
return ConfigureCurve(new F2mCurve(
|
||||
239,
|
||||
36,
|
||||
FromHex("01238774666A67766D6676F778E676B66999176666E687666D8766C66A9F"),
|
||||
FromHex("6A941977BA9F6A435199ACFC51067ED587F519C5ECB541B8E44111DE1D40"),
|
||||
n, h));
|
||||
}
|
||||
|
||||
protected override X9ECParameters CreateParameters()
|
||||
{
|
||||
byte[] S = null;
|
||||
ECCurve curve = Curve;
|
||||
|
||||
X9ECPoint G = ConfigureBasepoint(curve,
|
||||
"0370F6E9D04D289C4E89913CE3530BFDE903977D42B146D539BF1BDE4E9C92");
|
||||
|
||||
return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S);
|
||||
}
|
||||
}
|
||||
|
||||
internal class C2pnb272w1Holder
|
||||
: X9ECParametersHolder
|
||||
{
|
||||
private C2pnb272w1Holder() {}
|
||||
|
||||
internal static readonly X9ECParametersHolder Instance = new C2pnb272w1Holder();
|
||||
|
||||
protected override ECCurve CreateCurve()
|
||||
{
|
||||
BigInteger n = FromHex("0100FAF51354E0E39E4892DF6E319C72C8161603FA45AA7B998A167B8F1E629521");
|
||||
BigInteger h = BigInteger.ValueOf(0xFF06);
|
||||
|
||||
return ConfigureCurve(new F2mCurve(
|
||||
272,
|
||||
1, 3, 56,
|
||||
FromHex("91A091F03B5FBA4AB2CCF49C4EDD220FB028712D42BE752B2C40094DBACDB586FB20"),
|
||||
FromHex("7167EFC92BB2E3CE7C8AAAFF34E12A9C557003D7C73A6FAF003F99F6CC8482E540F7"),
|
||||
n, h));
|
||||
}
|
||||
|
||||
protected override X9ECParameters CreateParameters()
|
||||
{
|
||||
byte[] S = null;
|
||||
ECCurve curve = Curve;
|
||||
|
||||
X9ECPoint G = ConfigureBasepoint(curve,
|
||||
"026108BABB2CEEBCF787058A056CBE0CFE622D7723A289E08A07AE13EF0D10D171DD8D");
|
||||
|
||||
return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S);
|
||||
}
|
||||
}
|
||||
|
||||
internal class C2pnb304w1Holder
|
||||
: X9ECParametersHolder
|
||||
{
|
||||
private C2pnb304w1Holder() {}
|
||||
|
||||
internal static readonly X9ECParametersHolder Instance = new C2pnb304w1Holder();
|
||||
|
||||
protected override ECCurve CreateCurve()
|
||||
{
|
||||
BigInteger n = FromHex("0101D556572AABAC800101D556572AABAC8001022D5C91DD173F8FB561DA6899164443051D");
|
||||
BigInteger h = BigInteger.ValueOf(0xFE2E);
|
||||
|
||||
return ConfigureCurve(new F2mCurve(
|
||||
304,
|
||||
1, 2, 11,
|
||||
FromHex("FD0D693149A118F651E6DCE6802085377E5F882D1B510B44160074C1288078365A0396C8E681"),
|
||||
FromHex("BDDB97E555A50A908E43B01C798EA5DAA6788F1EA2794EFCF57166B8C14039601E55827340BE"),
|
||||
n, h));
|
||||
}
|
||||
|
||||
protected override X9ECParameters CreateParameters()
|
||||
{
|
||||
byte[] S = null;
|
||||
ECCurve curve = Curve;
|
||||
|
||||
X9ECPoint G = ConfigureBasepoint(curve,
|
||||
"02197B07845E9BE2D96ADB0F5F3C7F2CFFBD7A3EB8B6FEC35C7FD67F26DDF6285A644F740A2614");
|
||||
|
||||
return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S);
|
||||
}
|
||||
}
|
||||
|
||||
internal class C2tnb359v1Holder
|
||||
: X9ECParametersHolder
|
||||
{
|
||||
private C2tnb359v1Holder() {}
|
||||
|
||||
internal static readonly X9ECParametersHolder Instance = new C2tnb359v1Holder();
|
||||
|
||||
protected override ECCurve CreateCurve()
|
||||
{
|
||||
BigInteger n = FromHex("01AF286BCA1AF286BCA1AF286BCA1AF286BCA1AF286BC9FB8F6B85C556892C20A7EB964FE7719E74F490758D3B");
|
||||
BigInteger h = BigInteger.ValueOf(0x4C);
|
||||
|
||||
return ConfigureCurve(new F2mCurve(
|
||||
359,
|
||||
68,
|
||||
FromHex("5667676A654B20754F356EA92017D946567C46675556F19556A04616B567D223A5E05656FB549016A96656A557"),
|
||||
FromHex("2472E2D0197C49363F1FE7F5B6DB075D52B6947D135D8CA445805D39BC345626089687742B6329E70680231988"),
|
||||
n, h));
|
||||
}
|
||||
|
||||
protected override X9ECParameters CreateParameters()
|
||||
{
|
||||
byte[] S = null;
|
||||
ECCurve curve = Curve;
|
||||
|
||||
X9ECPoint G = ConfigureBasepoint(curve,
|
||||
"033C258EF3047767E7EDE0F1FDAA79DAEE3841366A132E163ACED4ED2401DF9C6BDCDE98E8E707C07A2239B1B097");
|
||||
|
||||
return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S);
|
||||
}
|
||||
}
|
||||
|
||||
internal class C2pnb368w1Holder
|
||||
: X9ECParametersHolder
|
||||
{
|
||||
private C2pnb368w1Holder() {}
|
||||
|
||||
internal static readonly X9ECParametersHolder Instance = new C2pnb368w1Holder();
|
||||
|
||||
protected override ECCurve CreateCurve()
|
||||
{
|
||||
BigInteger n = FromHex("010090512DA9AF72B08349D98A5DD4C7B0532ECA51CE03E2D10F3B7AC579BD87E909AE40A6F131E9CFCE5BD967");
|
||||
BigInteger h = BigInteger.ValueOf(0xFF70);
|
||||
|
||||
return ConfigureCurve(new F2mCurve(
|
||||
368,
|
||||
1, 2, 85,
|
||||
FromHex("E0D2EE25095206F5E2A4F9ED229F1F256E79A0E2B455970D8D0D865BD94778C576D62F0AB7519CCD2A1A906AE30D"),
|
||||
FromHex("FC1217D4320A90452C760A58EDCD30C8DD069B3C34453837A34ED50CB54917E1C2112D84D164F444F8F74786046A"),
|
||||
n, h));
|
||||
}
|
||||
|
||||
protected override X9ECParameters CreateParameters()
|
||||
{
|
||||
byte[] S = null;
|
||||
ECCurve curve = Curve;
|
||||
|
||||
X9ECPoint G = ConfigureBasepoint(curve,
|
||||
"021085E2755381DCCCE3C1557AFA10C2F0C0C2825646C5B34A394CBCFA8BC16B22E7E789E927BE216F02E1FB136A5F");
|
||||
|
||||
return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S);
|
||||
}
|
||||
}
|
||||
|
||||
internal class C2tnb431r1Holder
|
||||
: X9ECParametersHolder
|
||||
{
|
||||
private C2tnb431r1Holder() {}
|
||||
|
||||
internal static readonly X9ECParametersHolder Instance = new C2tnb431r1Holder();
|
||||
|
||||
protected override ECCurve CreateCurve()
|
||||
{
|
||||
BigInteger n = FromHex("0340340340340340340340340340340340340340340340340340340323C313FAB50589703B5EC68D3587FEC60D161CC149C1AD4A91");
|
||||
BigInteger h = BigInteger.ValueOf(0x2760);
|
||||
|
||||
return ConfigureCurve(new F2mCurve(
|
||||
431,
|
||||
120,
|
||||
FromHex("1A827EF00DD6FC0E234CAF046C6A5D8A85395B236CC4AD2CF32A0CADBDC9DDF620B0EB9906D0957F6C6FEACD615468DF104DE296CD8F"),
|
||||
FromHex("10D9B4A3D9047D8B154359ABFB1B7F5485B04CEB868237DDC9DEDA982A679A5A919B626D4E50A8DD731B107A9962381FB5D807BF2618"),
|
||||
n, h));
|
||||
}
|
||||
|
||||
protected override X9ECParameters CreateParameters()
|
||||
{
|
||||
byte[] S = null;
|
||||
ECCurve curve = Curve;
|
||||
|
||||
X9ECPoint G = ConfigureBasepoint(curve,
|
||||
"02120FC05D3C67A99DE161D2F4092622FECA701BE4F50F4758714E8A87BBF2A658EF8C21E7C5EFE965361F6C2999C0C247B0DBD70CE6B7");
|
||||
|
||||
return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S);
|
||||
}
|
||||
}
|
||||
|
||||
private static readonly Dictionary<string, DerObjectIdentifier> objIds =
|
||||
new Dictionary<string, DerObjectIdentifier>(StringComparer.OrdinalIgnoreCase);
|
||||
private static readonly Dictionary<DerObjectIdentifier, X9ECParametersHolder> curves =
|
||||
new Dictionary<DerObjectIdentifier, X9ECParametersHolder>();
|
||||
private static readonly Dictionary<DerObjectIdentifier, string> names =
|
||||
new Dictionary<DerObjectIdentifier, string>();
|
||||
|
||||
private static void DefineCurve(string name, DerObjectIdentifier oid, X9ECParametersHolder holder)
|
||||
{
|
||||
objIds.Add(name, oid);
|
||||
names.Add(oid, name);
|
||||
curves.Add(oid, holder);
|
||||
}
|
||||
|
||||
static X962NamedCurves()
|
||||
{
|
||||
DefineCurve("prime192v1", X9ObjectIdentifiers.Prime192v1, Prime192v1Holder.Instance);
|
||||
DefineCurve("prime192v2", X9ObjectIdentifiers.Prime192v2, Prime192v2Holder.Instance);
|
||||
DefineCurve("prime192v3", X9ObjectIdentifiers.Prime192v3, Prime192v3Holder.Instance);
|
||||
DefineCurve("prime239v1", X9ObjectIdentifiers.Prime239v1, Prime239v1Holder.Instance);
|
||||
DefineCurve("prime239v2", X9ObjectIdentifiers.Prime239v2, Prime239v2Holder.Instance);
|
||||
DefineCurve("prime239v3", X9ObjectIdentifiers.Prime239v3, Prime239v3Holder.Instance);
|
||||
DefineCurve("prime256v1", X9ObjectIdentifiers.Prime256v1, Prime256v1Holder.Instance);
|
||||
DefineCurve("c2pnb163v1", X9ObjectIdentifiers.C2Pnb163v1, C2pnb163v1Holder.Instance);
|
||||
DefineCurve("c2pnb163v2", X9ObjectIdentifiers.C2Pnb163v2, C2pnb163v2Holder.Instance);
|
||||
DefineCurve("c2pnb163v3", X9ObjectIdentifiers.C2Pnb163v3, C2pnb163v3Holder.Instance);
|
||||
DefineCurve("c2pnb176w1", X9ObjectIdentifiers.C2Pnb176w1, C2pnb176w1Holder.Instance);
|
||||
DefineCurve("c2tnb191v1", X9ObjectIdentifiers.C2Tnb191v1, C2tnb191v1Holder.Instance);
|
||||
DefineCurve("c2tnb191v2", X9ObjectIdentifiers.C2Tnb191v2, C2tnb191v2Holder.Instance);
|
||||
DefineCurve("c2tnb191v3", X9ObjectIdentifiers.C2Tnb191v3, C2tnb191v3Holder.Instance);
|
||||
DefineCurve("c2pnb208w1", X9ObjectIdentifiers.C2Pnb208w1, C2pnb208w1Holder.Instance);
|
||||
DefineCurve("c2tnb239v1", X9ObjectIdentifiers.C2Tnb239v1, C2tnb239v1Holder.Instance);
|
||||
DefineCurve("c2tnb239v2", X9ObjectIdentifiers.C2Tnb239v2, C2tnb239v2Holder.Instance);
|
||||
DefineCurve("c2tnb239v3", X9ObjectIdentifiers.C2Tnb239v3, C2tnb239v3Holder.Instance);
|
||||
DefineCurve("c2pnb272w1", X9ObjectIdentifiers.C2Pnb272w1, C2pnb272w1Holder.Instance);
|
||||
DefineCurve("c2pnb304w1", X9ObjectIdentifiers.C2Pnb304w1, C2pnb304w1Holder.Instance);
|
||||
DefineCurve("c2tnb359v1", X9ObjectIdentifiers.C2Tnb359v1, C2tnb359v1Holder.Instance);
|
||||
DefineCurve("c2pnb368w1", X9ObjectIdentifiers.C2Pnb368w1, C2pnb368w1Holder.Instance);
|
||||
DefineCurve("c2tnb431r1", X9ObjectIdentifiers.C2Tnb431r1, C2tnb431r1Holder.Instance);
|
||||
}
|
||||
|
||||
/// <summary>Look up the <see cref="X9ECParameters"/> for the curve with the given name.</summary>
|
||||
/// <param name="name">The name of the curve.</param>
|
||||
public static X9ECParameters GetByName(string name)
|
||||
{
|
||||
DerObjectIdentifier oid = GetOid(name);
|
||||
return oid == null ? null : GetByOid(oid);
|
||||
}
|
||||
|
||||
/// <summary>Look up an <see cref="X9ECParametersHolder"/> for the curve with the given name.</summary>
|
||||
/// <remarks>
|
||||
/// Allows accessing the <see cref="ECCurve">curve</see> without necessarily triggering the creation of the
|
||||
/// full <see cref="X9ECParameters"/>.
|
||||
/// </remarks>
|
||||
/// <param name="name">The name of the curve.</param>
|
||||
public static X9ECParametersHolder GetByNameLazy(string name)
|
||||
{
|
||||
DerObjectIdentifier oid = GetOid(name);
|
||||
return oid == null ? null : GetByOidLazy(oid);
|
||||
}
|
||||
|
||||
/// <summary>Look up the <see cref="X9ECParameters"/> for the curve with the given
|
||||
/// <see cref="DerObjectIdentifier">OID</see>.</summary>
|
||||
/// <param name="oid">The <see cref="DerObjectIdentifier">OID</see> for the curve.</param>
|
||||
public static X9ECParameters GetByOid(DerObjectIdentifier oid)
|
||||
{
|
||||
return GetByOidLazy(oid)?.Parameters;
|
||||
}
|
||||
|
||||
/// <summary>Look up an <see cref="X9ECParametersHolder"/> for the curve with the given
|
||||
/// <see cref="DerObjectIdentifier">OID</see>.</summary>
|
||||
/// <remarks>
|
||||
/// Allows accessing the <see cref="ECCurve">curve</see> without necessarily triggering the creation of the
|
||||
/// full <see cref="X9ECParameters"/>.
|
||||
/// </remarks>
|
||||
/// <param name="oid">The <see cref="DerObjectIdentifier">OID</see> for the curve.</param>
|
||||
public static X9ECParametersHolder GetByOidLazy(DerObjectIdentifier oid)
|
||||
{
|
||||
return CollectionUtilities.GetValueOrNull(curves, oid);
|
||||
}
|
||||
|
||||
/// <summary>Look up the name of the curve with the given <see cref="DerObjectIdentifier">OID</see>.</summary>
|
||||
/// <param name="oid">The <see cref="DerObjectIdentifier">OID</see> for the curve.</param>
|
||||
public static string GetName(DerObjectIdentifier oid)
|
||||
{
|
||||
return CollectionUtilities.GetValueOrNull(names, oid);
|
||||
}
|
||||
|
||||
/// <summary>Look up the <see cref="DerObjectIdentifier">OID</see> of the curve with the given name.</summary>
|
||||
/// <param name="name">The name of the curve.</param>
|
||||
public static DerObjectIdentifier GetOid(string name)
|
||||
{
|
||||
return CollectionUtilities.GetValueOrNull(objIds, name);
|
||||
}
|
||||
|
||||
/// <summary>Enumerate the available curve names in this registry.</summary>
|
||||
public static IEnumerable<string> Names
|
||||
{
|
||||
get { return CollectionUtilities.Proxy(objIds.Keys); }
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
11
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/X962NamedCurves.cs.meta
vendored
Normal file
11
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/X962NamedCurves.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f0521d3266cf319469437cb894183b5c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
97
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/X962Parameters.cs
vendored
Normal file
97
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/X962Parameters.cs
vendored
Normal file
@@ -0,0 +1,97 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System;
|
||||
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9
|
||||
{
|
||||
public class X962Parameters
|
||||
: Asn1Encodable, IAsn1Choice
|
||||
{
|
||||
private readonly Asn1Object _params;
|
||||
|
||||
public static X962Parameters GetInstance(
|
||||
object obj)
|
||||
{
|
||||
if (obj == null || obj is X962Parameters)
|
||||
{
|
||||
return (X962Parameters)obj;
|
||||
}
|
||||
|
||||
if (obj is Asn1Object)
|
||||
{
|
||||
return new X962Parameters((Asn1Object)obj);
|
||||
}
|
||||
|
||||
if (obj is byte[])
|
||||
{
|
||||
try
|
||||
{
|
||||
return new X962Parameters(Asn1Object.FromByteArray((byte[])obj));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new ArgumentException("unable to parse encoded data: " + e.Message, e);
|
||||
}
|
||||
}
|
||||
|
||||
throw new ArgumentException("unknown object in getInstance()");
|
||||
}
|
||||
|
||||
public X962Parameters(
|
||||
X9ECParameters ecParameters)
|
||||
{
|
||||
this._params = ecParameters.ToAsn1Object();
|
||||
}
|
||||
|
||||
public X962Parameters(
|
||||
DerObjectIdentifier namedCurve)
|
||||
{
|
||||
this._params = namedCurve;
|
||||
}
|
||||
|
||||
public X962Parameters(
|
||||
Asn1Null obj)
|
||||
{
|
||||
this._params = obj;
|
||||
}
|
||||
|
||||
private X962Parameters(Asn1Object obj)
|
||||
{
|
||||
this._params = obj;
|
||||
}
|
||||
|
||||
public bool IsNamedCurve
|
||||
{
|
||||
get { return (_params is DerObjectIdentifier); }
|
||||
}
|
||||
|
||||
public bool IsImplicitlyCA
|
||||
{
|
||||
get { return (_params is Asn1Null); }
|
||||
}
|
||||
|
||||
public Asn1Object Parameters
|
||||
{
|
||||
get { return _params; }
|
||||
}
|
||||
|
||||
/**
|
||||
* Produce an object suitable for an Asn1OutputStream.
|
||||
* <pre>
|
||||
* Parameters ::= CHOICE {
|
||||
* ecParameters ECParameters,
|
||||
* namedCurve CURVES.&id({CurveNames}),
|
||||
* implicitlyCA Null
|
||||
* }
|
||||
* </pre>
|
||||
*/
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
return _params;
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
11
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/X962Parameters.cs.meta
vendored
Normal file
11
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/X962Parameters.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8e60703378e65eb4b8964d7c819ddbd2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
151
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/X9Curve.cs
vendored
Normal file
151
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/X9Curve.cs
vendored
Normal file
@@ -0,0 +1,151 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System;
|
||||
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Math;
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Math.EC;
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9
|
||||
{
|
||||
/**
|
||||
* ASN.1 def for Elliptic-Curve Curve structure. See
|
||||
* X9.62, for further details.
|
||||
*/
|
||||
public class X9Curve
|
||||
: Asn1Encodable
|
||||
{
|
||||
private readonly ECCurve curve;
|
||||
private readonly byte[] seed;
|
||||
private readonly DerObjectIdentifier fieldIdentifier;
|
||||
|
||||
public X9Curve(
|
||||
ECCurve curve)
|
||||
: this(curve, null)
|
||||
{
|
||||
}
|
||||
|
||||
public X9Curve(
|
||||
ECCurve curve,
|
||||
byte[] seed)
|
||||
{
|
||||
if (curve == null)
|
||||
throw new ArgumentNullException("curve");
|
||||
|
||||
this.curve = curve;
|
||||
this.seed = Arrays.Clone(seed);
|
||||
|
||||
if (ECAlgorithms.IsFpCurve(curve))
|
||||
{
|
||||
this.fieldIdentifier = X9ObjectIdentifiers.PrimeField;
|
||||
}
|
||||
else if (ECAlgorithms.IsF2mCurve(curve))
|
||||
{
|
||||
this.fieldIdentifier = X9ObjectIdentifiers.CharacteristicTwoField;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentException("This type of ECCurve is not implemented");
|
||||
}
|
||||
}
|
||||
|
||||
public X9Curve(
|
||||
X9FieldID fieldID,
|
||||
BigInteger order,
|
||||
BigInteger cofactor,
|
||||
Asn1Sequence seq)
|
||||
{
|
||||
if (fieldID == null)
|
||||
throw new ArgumentNullException("fieldID");
|
||||
if (seq == null)
|
||||
throw new ArgumentNullException("seq");
|
||||
|
||||
this.fieldIdentifier = fieldID.Identifier;
|
||||
|
||||
if (fieldIdentifier.Equals(X9ObjectIdentifiers.PrimeField))
|
||||
{
|
||||
BigInteger p = ((DerInteger)fieldID.Parameters).Value;
|
||||
BigInteger A = new BigInteger(1, Asn1OctetString.GetInstance(seq[0]).GetOctets());
|
||||
BigInteger B = new BigInteger(1, Asn1OctetString.GetInstance(seq[1]).GetOctets());
|
||||
curve = new FpCurve(p, A, B, order, cofactor);
|
||||
}
|
||||
else if (fieldIdentifier.Equals(X9ObjectIdentifiers.CharacteristicTwoField))
|
||||
{
|
||||
// Characteristic two field
|
||||
DerSequence parameters = (DerSequence)fieldID.Parameters;
|
||||
int m = ((DerInteger)parameters[0]).IntValueExact;
|
||||
DerObjectIdentifier representation = (DerObjectIdentifier)parameters[1];
|
||||
|
||||
int k1 = 0;
|
||||
int k2 = 0;
|
||||
int k3 = 0;
|
||||
if (representation.Equals(X9ObjectIdentifiers.TPBasis))
|
||||
{
|
||||
// Trinomial basis representation
|
||||
k1 = ((DerInteger)parameters[2]).IntValueExact;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Pentanomial basis representation
|
||||
DerSequence pentanomial = (DerSequence) parameters[2];
|
||||
k1 = ((DerInteger)pentanomial[0]).IntValueExact;
|
||||
k2 = ((DerInteger)pentanomial[1]).IntValueExact;
|
||||
k3 = ((DerInteger)pentanomial[2]).IntValueExact;
|
||||
}
|
||||
BigInteger A = new BigInteger(1, Asn1OctetString.GetInstance(seq[0]).GetOctets());
|
||||
BigInteger B = new BigInteger(1, Asn1OctetString.GetInstance(seq[1]).GetOctets());
|
||||
curve = new F2mCurve(m, k1, k2, k3, A, B, order, cofactor);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentException("This type of ECCurve is not implemented");
|
||||
}
|
||||
|
||||
if (seq.Count == 3)
|
||||
{
|
||||
seed = ((DerBitString)seq[2]).GetBytes();
|
||||
}
|
||||
}
|
||||
|
||||
public ECCurve Curve
|
||||
{
|
||||
get { return curve; }
|
||||
}
|
||||
|
||||
public byte[] GetSeed()
|
||||
{
|
||||
return Arrays.Clone(seed);
|
||||
}
|
||||
|
||||
/**
|
||||
* Produce an object suitable for an Asn1OutputStream.
|
||||
* <pre>
|
||||
* Curve ::= Sequence {
|
||||
* a FieldElement,
|
||||
* b FieldElement,
|
||||
* seed BIT STRING OPTIONAL
|
||||
* }
|
||||
* </pre>
|
||||
*/
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
Asn1EncodableVector v = new Asn1EncodableVector();
|
||||
|
||||
if (fieldIdentifier.Equals(X9ObjectIdentifiers.PrimeField)
|
||||
|| fieldIdentifier.Equals(X9ObjectIdentifiers.CharacteristicTwoField))
|
||||
{
|
||||
v.Add(new X9FieldElement(curve.A).ToAsn1Object());
|
||||
v.Add(new X9FieldElement(curve.B).ToAsn1Object());
|
||||
}
|
||||
|
||||
if (seed != null)
|
||||
{
|
||||
v.Add(new DerBitString(seed));
|
||||
}
|
||||
|
||||
return new DerSequence(v);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
11
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/X9Curve.cs.meta
vendored
Normal file
11
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/X9Curve.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 43714f898930c7f4d849ef473c1358fd
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
215
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/X9ECParameters.cs
vendored
Normal file
215
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/X9ECParameters.cs
vendored
Normal file
@@ -0,0 +1,215 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System;
|
||||
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Math;
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Math.EC;
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Math.Field;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9
|
||||
{
|
||||
/**
|
||||
* ASN.1 def for Elliptic-Curve ECParameters structure. See
|
||||
* X9.62, for further details.
|
||||
*/
|
||||
public class X9ECParameters
|
||||
: Asn1Encodable
|
||||
{
|
||||
private X9FieldID fieldID;
|
||||
private ECCurve curve;
|
||||
private X9ECPoint g;
|
||||
private BigInteger n;
|
||||
private BigInteger h;
|
||||
private byte[] seed;
|
||||
|
||||
public static X9ECParameters GetInstance(object obj)
|
||||
{
|
||||
if (obj is X9ECParameters)
|
||||
return (X9ECParameters)obj;
|
||||
|
||||
if (obj != null)
|
||||
return new X9ECParameters(Asn1Sequence.GetInstance(obj));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public X9ECParameters(
|
||||
Asn1Sequence seq)
|
||||
{
|
||||
if (!(seq[0] is DerInteger)
|
||||
|| !((DerInteger)seq[0]).HasValue(1))
|
||||
{
|
||||
throw new ArgumentException("bad version in X9ECParameters");
|
||||
}
|
||||
|
||||
this.n = ((DerInteger)seq[4]).Value;
|
||||
|
||||
if (seq.Count == 6)
|
||||
{
|
||||
this.h = ((DerInteger)seq[5]).Value;
|
||||
}
|
||||
|
||||
X9Curve x9c = new X9Curve(
|
||||
X9FieldID.GetInstance(seq[1]), n, h,
|
||||
Asn1Sequence.GetInstance(seq[2]));
|
||||
|
||||
this.curve = x9c.Curve;
|
||||
object p = seq[3];
|
||||
|
||||
if (p is X9ECPoint)
|
||||
{
|
||||
this.g = (X9ECPoint)p;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.g = new X9ECPoint(curve, (Asn1OctetString)p);
|
||||
}
|
||||
|
||||
this.seed = x9c.GetSeed();
|
||||
}
|
||||
|
||||
public X9ECParameters(
|
||||
ECCurve curve,
|
||||
X9ECPoint g,
|
||||
BigInteger n)
|
||||
: this(curve, g, n, null, null)
|
||||
{
|
||||
}
|
||||
|
||||
public X9ECParameters(
|
||||
ECCurve curve,
|
||||
X9ECPoint g,
|
||||
BigInteger n,
|
||||
BigInteger h)
|
||||
: this(curve, g, n, h, null)
|
||||
{
|
||||
}
|
||||
|
||||
public X9ECParameters(
|
||||
ECCurve curve,
|
||||
X9ECPoint g,
|
||||
BigInteger n,
|
||||
BigInteger h,
|
||||
byte[] seed)
|
||||
{
|
||||
this.curve = curve;
|
||||
this.g = g;
|
||||
this.n = n;
|
||||
this.h = h;
|
||||
this.seed = seed;
|
||||
|
||||
if (ECAlgorithms.IsFpCurve(curve))
|
||||
{
|
||||
this.fieldID = new X9FieldID(curve.Field.Characteristic);
|
||||
}
|
||||
else if (ECAlgorithms.IsF2mCurve(curve))
|
||||
{
|
||||
IPolynomialExtensionField field = (IPolynomialExtensionField)curve.Field;
|
||||
int[] exponents = field.MinimalPolynomial.GetExponentsPresent();
|
||||
if (exponents.Length == 3)
|
||||
{
|
||||
this.fieldID = new X9FieldID(exponents[2], exponents[1]);
|
||||
}
|
||||
else if (exponents.Length == 5)
|
||||
{
|
||||
this.fieldID = new X9FieldID(exponents[4], exponents[1], exponents[2], exponents[3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentException("Only trinomial and pentomial curves are supported");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentException("'curve' is of an unsupported type");
|
||||
}
|
||||
}
|
||||
|
||||
public ECCurve Curve
|
||||
{
|
||||
get { return curve; }
|
||||
}
|
||||
|
||||
public ECPoint G
|
||||
{
|
||||
get { return g.Point; }
|
||||
}
|
||||
|
||||
public BigInteger N
|
||||
{
|
||||
get { return n; }
|
||||
}
|
||||
|
||||
public BigInteger H
|
||||
{
|
||||
get { return h; }
|
||||
}
|
||||
|
||||
public byte[] GetSeed()
|
||||
{
|
||||
return seed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the ASN.1 entry representing the Curve.
|
||||
*
|
||||
* @return the X9Curve for the curve in these parameters.
|
||||
*/
|
||||
public X9Curve CurveEntry
|
||||
{
|
||||
get { return new X9Curve(curve, seed); }
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the ASN.1 entry representing the FieldID.
|
||||
*
|
||||
* @return the X9FieldID for the FieldID in these parameters.
|
||||
*/
|
||||
public X9FieldID FieldIDEntry
|
||||
{
|
||||
get { return fieldID; }
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the ASN.1 entry representing the base point G.
|
||||
*
|
||||
* @return the X9ECPoint for the base point in these parameters.
|
||||
*/
|
||||
public X9ECPoint BaseEntry
|
||||
{
|
||||
get { return g; }
|
||||
}
|
||||
|
||||
/**
|
||||
* Produce an object suitable for an Asn1OutputStream.
|
||||
* <pre>
|
||||
* ECParameters ::= Sequence {
|
||||
* version Integer { ecpVer1(1) } (ecpVer1),
|
||||
* fieldID FieldID {{FieldTypes}},
|
||||
* curve X9Curve,
|
||||
* base X9ECPoint,
|
||||
* order Integer,
|
||||
* cofactor Integer OPTIONAL
|
||||
* }
|
||||
* </pre>
|
||||
*/
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
Asn1EncodableVector v = new Asn1EncodableVector(
|
||||
new DerInteger(BigInteger.One),
|
||||
fieldID,
|
||||
new X9Curve(curve, seed),
|
||||
g,
|
||||
new DerInteger(n));
|
||||
|
||||
if (h != null)
|
||||
{
|
||||
v.Add(new DerInteger(h));
|
||||
}
|
||||
|
||||
return new DerSequence(v);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
11
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/X9ECParameters.cs.meta
vendored
Normal file
11
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/X9ECParameters.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3d36db2fddc293f448a749a23a74b090
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
53
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/X9ECParametersHolder.cs
vendored
Normal file
53
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/X9ECParametersHolder.cs
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Math.EC;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9
|
||||
{
|
||||
public abstract class X9ECParametersHolder
|
||||
{
|
||||
private ECCurve m_curve;
|
||||
private X9ECParameters m_parameters;
|
||||
|
||||
public ECCurve Curve
|
||||
{
|
||||
get
|
||||
{
|
||||
lock (this)
|
||||
{
|
||||
if (m_curve == null)
|
||||
{
|
||||
m_curve = CreateCurve();
|
||||
}
|
||||
|
||||
return m_curve;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public X9ECParameters Parameters
|
||||
{
|
||||
get
|
||||
{
|
||||
lock (this)
|
||||
{
|
||||
if (m_parameters == null)
|
||||
{
|
||||
m_parameters = CreateParameters();
|
||||
}
|
||||
|
||||
return m_parameters;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual ECCurve CreateCurve()
|
||||
{
|
||||
return CreateParameters().Curve;
|
||||
}
|
||||
|
||||
protected abstract X9ECParameters CreateParameters();
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f9087f34f38c5e344bcb031600c3e7b1
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
79
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/X9ECPoint.cs
vendored
Normal file
79
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/X9ECPoint.cs
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Math.EC;
|
||||
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9
|
||||
{
|
||||
/**
|
||||
* class for describing an ECPoint as a Der object.
|
||||
*/
|
||||
public class X9ECPoint
|
||||
: Asn1Encodable
|
||||
{
|
||||
private readonly Asn1OctetString encoding;
|
||||
|
||||
private ECCurve c;
|
||||
private ECPoint p;
|
||||
|
||||
public X9ECPoint(ECPoint p, bool compressed)
|
||||
{
|
||||
this.p = p.Normalize();
|
||||
this.encoding = new DerOctetString(p.GetEncoded(compressed));
|
||||
}
|
||||
|
||||
public X9ECPoint(ECCurve c, byte[] encoding)
|
||||
{
|
||||
this.c = c;
|
||||
this.encoding = new DerOctetString(Arrays.Clone(encoding));
|
||||
}
|
||||
|
||||
public X9ECPoint(ECCurve c, Asn1OctetString s)
|
||||
: this(c, s.GetOctets())
|
||||
{
|
||||
}
|
||||
|
||||
public byte[] GetPointEncoding()
|
||||
{
|
||||
return Arrays.Clone(encoding.GetOctets());
|
||||
}
|
||||
|
||||
public ECPoint Point
|
||||
{
|
||||
get
|
||||
{
|
||||
if (p == null)
|
||||
{
|
||||
p = c.DecodePoint(encoding.GetOctets()).Normalize();
|
||||
}
|
||||
|
||||
return p;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsPointCompressed
|
||||
{
|
||||
get
|
||||
{
|
||||
byte[] octets = encoding.GetOctets();
|
||||
return octets != null && octets.Length > 0 && (octets[0] == 2 || octets[0] == 3);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Produce an object suitable for an Asn1OutputStream.
|
||||
* <pre>
|
||||
* ECPoint ::= OCTET STRING
|
||||
* </pre>
|
||||
* <p>
|
||||
* Octet string produced using ECPoint.GetEncoded().</p>
|
||||
*/
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
return encoding;
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
11
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/X9ECPoint.cs.meta
vendored
Normal file
11
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/X9ECPoint.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fb799dd6e0a957945b44491bdc9d1e23
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
56
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/X9FieldElement.cs
vendored
Normal file
56
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/X9FieldElement.cs
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System;
|
||||
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Math;
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Math.EC;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9
|
||||
{
|
||||
/**
|
||||
* Class for processing an ECFieldElement as a DER object.
|
||||
*/
|
||||
public class X9FieldElement
|
||||
: Asn1Encodable
|
||||
{
|
||||
private ECFieldElement f;
|
||||
|
||||
public X9FieldElement(
|
||||
ECFieldElement f)
|
||||
{
|
||||
this.f = f;
|
||||
}
|
||||
|
||||
public ECFieldElement Value
|
||||
{
|
||||
get { return f; }
|
||||
}
|
||||
|
||||
/**
|
||||
* Produce an object suitable for an Asn1OutputStream.
|
||||
* <pre>
|
||||
* FieldElement ::= OCTET STRING
|
||||
* </pre>
|
||||
* <p>
|
||||
* <ol>
|
||||
* <li> if <i>q</i> is an odd prime then the field element is
|
||||
* processed as an Integer and converted to an octet string
|
||||
* according to x 9.62 4.3.1.</li>
|
||||
* <li> if <i>q</i> is 2<sup>m</sup> then the bit string
|
||||
* contained in the field element is converted into an octet
|
||||
* string with the same ordering padded at the front if necessary.
|
||||
* </li>
|
||||
* </ol>
|
||||
* </p>
|
||||
*/
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
int byteCount = X9IntegerConverter.GetByteLength(f);
|
||||
byte[] paddedBigInteger = X9IntegerConverter.IntegerToBytes(f.ToBigInteger(), byteCount);
|
||||
|
||||
return new DerOctetString(paddedBigInteger);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
11
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/X9FieldElement.cs.meta
vendored
Normal file
11
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/X9FieldElement.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0314589f21ded704b8eed94852256818
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
136
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/X9FieldID.cs
vendored
Normal file
136
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/X9FieldID.cs
vendored
Normal file
@@ -0,0 +1,136 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System;
|
||||
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Math;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9
|
||||
{
|
||||
/**
|
||||
* ASN.1 def for Elliptic-Curve Field ID structure. See
|
||||
* X9.62, for further details.
|
||||
*/
|
||||
public class X9FieldID
|
||||
: Asn1Encodable
|
||||
{
|
||||
private readonly DerObjectIdentifier id;
|
||||
private readonly Asn1Object parameters;
|
||||
|
||||
/**
|
||||
* Constructor for elliptic curves over prime fields
|
||||
* <code>F<sub>2</sub></code>.
|
||||
* @param primeP The prime <code>p</code> defining the prime field.
|
||||
*/
|
||||
public X9FieldID(
|
||||
BigInteger primeP)
|
||||
{
|
||||
this.id = X9ObjectIdentifiers.PrimeField;
|
||||
this.parameters = new DerInteger(primeP);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for elliptic curves over binary fields
|
||||
* <code>F<sub>2<sup>m</sup></sub></code>.
|
||||
* @param m The exponent <code>m</code> of
|
||||
* <code>F<sub>2<sup>m</sup></sub></code>.
|
||||
* @param k1 The integer <code>k1</code> where <code>x<sup>m</sup> +
|
||||
* x<sup>k1</sup> + 1</code>
|
||||
* represents the reduction polynomial <code>f(z)</code>.
|
||||
*/
|
||||
public X9FieldID(int m, int k1)
|
||||
: this(m, k1, 0, 0)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for elliptic curves over binary fields
|
||||
* <code>F<sub>2<sup>m</sup></sub></code>.
|
||||
* @param m The exponent <code>m</code> of
|
||||
* <code>F<sub>2<sup>m</sup></sub></code>.
|
||||
* @param k1 The integer <code>k1</code> where <code>x<sup>m</sup> +
|
||||
* x<sup>k3</sup> + x<sup>k2</sup> + x<sup>k1</sup> + 1</code>
|
||||
* represents the reduction polynomial <code>f(z)</code>.
|
||||
* @param k2 The integer <code>k2</code> where <code>x<sup>m</sup> +
|
||||
* x<sup>k3</sup> + x<sup>k2</sup> + x<sup>k1</sup> + 1</code>
|
||||
* represents the reduction polynomial <code>f(z)</code>.
|
||||
* @param k3 The integer <code>k3</code> where <code>x<sup>m</sup> +
|
||||
* x<sup>k3</sup> + x<sup>k2</sup> + x<sup>k1</sup> + 1</code>
|
||||
* represents the reduction polynomial <code>f(z)</code>..
|
||||
*/
|
||||
public X9FieldID(
|
||||
int m,
|
||||
int k1,
|
||||
int k2,
|
||||
int k3)
|
||||
{
|
||||
this.id = X9ObjectIdentifiers.CharacteristicTwoField;
|
||||
|
||||
Asn1EncodableVector fieldIdParams = new Asn1EncodableVector(new DerInteger(m));
|
||||
|
||||
if (k2 == 0)
|
||||
{
|
||||
if (k3 != 0)
|
||||
throw new ArgumentException("inconsistent k values");
|
||||
|
||||
fieldIdParams.Add(
|
||||
X9ObjectIdentifiers.TPBasis,
|
||||
new DerInteger(k1));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (k2 <= k1 || k3 <= k2)
|
||||
throw new ArgumentException("inconsistent k values");
|
||||
|
||||
fieldIdParams.Add(
|
||||
X9ObjectIdentifiers.PPBasis,
|
||||
new DerSequence(
|
||||
new DerInteger(k1),
|
||||
new DerInteger(k2),
|
||||
new DerInteger(k3)));
|
||||
}
|
||||
|
||||
this.parameters = new DerSequence(fieldIdParams);
|
||||
}
|
||||
|
||||
private X9FieldID(Asn1Sequence seq)
|
||||
{
|
||||
this.id = DerObjectIdentifier.GetInstance(seq[0]);
|
||||
this.parameters = seq[1].ToAsn1Object();
|
||||
}
|
||||
|
||||
public static X9FieldID GetInstance(object obj)
|
||||
{
|
||||
if (obj is X9FieldID)
|
||||
return (X9FieldID)obj;
|
||||
if (obj == null)
|
||||
return null;
|
||||
return new X9FieldID(Asn1Sequence.GetInstance(obj));
|
||||
}
|
||||
|
||||
public DerObjectIdentifier Identifier
|
||||
{
|
||||
get { return id; }
|
||||
}
|
||||
|
||||
public Asn1Object Parameters
|
||||
{
|
||||
get { return parameters; }
|
||||
}
|
||||
|
||||
/**
|
||||
* Produce a Der encoding of the following structure.
|
||||
* <pre>
|
||||
* FieldID ::= Sequence {
|
||||
* fieldType FIELD-ID.&id({IOSet}),
|
||||
* parameters FIELD-ID.&Type({IOSet}{@fieldType})
|
||||
* }
|
||||
* </pre>
|
||||
*/
|
||||
public override Asn1Object ToAsn1Object()
|
||||
{
|
||||
return new DerSequence(id, parameters);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
11
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/X9FieldID.cs.meta
vendored
Normal file
11
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/X9FieldID.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 95a5e4d382eb29b45b39b6da740a4fc3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
44
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/X9IntegerConverter.cs
vendored
Normal file
44
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/X9IntegerConverter.cs
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System;
|
||||
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Math;
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Math.EC;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9
|
||||
{
|
||||
public abstract class X9IntegerConverter
|
||||
{
|
||||
public static int GetByteLength(ECFieldElement fe)
|
||||
{
|
||||
return (fe.FieldSize + 7) / 8;
|
||||
}
|
||||
|
||||
public static int GetByteLength(ECCurve c)
|
||||
{
|
||||
return (c.FieldSize + 7) / 8;
|
||||
}
|
||||
|
||||
public static byte[] IntegerToBytes(BigInteger s, int qLength)
|
||||
{
|
||||
byte[] bytes = s.ToByteArrayUnsigned();
|
||||
|
||||
if (qLength < bytes.Length)
|
||||
{
|
||||
byte[] tmp = new byte[qLength];
|
||||
Array.Copy(bytes, bytes.Length - tmp.Length, tmp, 0, tmp.Length);
|
||||
return tmp;
|
||||
}
|
||||
else if (qLength > bytes.Length)
|
||||
{
|
||||
byte[] tmp = new byte[qLength];
|
||||
Array.Copy(bytes, 0, tmp, tmp.Length - bytes.Length, bytes.Length);
|
||||
return tmp;
|
||||
}
|
||||
|
||||
return bytes;
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
11
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/X9IntegerConverter.cs.meta
vendored
Normal file
11
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/X9IntegerConverter.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c8d8bbe58cf32c041bb340c35ccb68ef
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
135
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/X9ObjectIdentifiers.cs
vendored
Normal file
135
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/X9ObjectIdentifiers.cs
vendored
Normal file
@@ -0,0 +1,135 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9
|
||||
{
|
||||
public abstract class X9ObjectIdentifiers
|
||||
{
|
||||
//
|
||||
// X9.62
|
||||
//
|
||||
// ansi-X9-62 OBJECT IDENTIFIER ::= { iso(1) member-body(2)
|
||||
// us(840) ansi-x962(10045) }
|
||||
//
|
||||
|
||||
public static readonly DerObjectIdentifier ansi_X9_62 = new DerObjectIdentifier("1.2.840.10045");
|
||||
|
||||
public static readonly DerObjectIdentifier IdFieldType = ansi_X9_62.Branch("1");
|
||||
|
||||
public static readonly DerObjectIdentifier PrimeField = IdFieldType.Branch("1");
|
||||
public static readonly DerObjectIdentifier CharacteristicTwoField = IdFieldType.Branch("2");
|
||||
|
||||
public static readonly DerObjectIdentifier GNBasis = CharacteristicTwoField.Branch("3.1");
|
||||
public static readonly DerObjectIdentifier TPBasis = CharacteristicTwoField.Branch("3.2");
|
||||
public static readonly DerObjectIdentifier PPBasis = CharacteristicTwoField.Branch("3.3");
|
||||
|
||||
public static readonly DerObjectIdentifier id_ecSigType = ansi_X9_62.Branch("4");
|
||||
|
||||
public static readonly DerObjectIdentifier ECDsaWithSha1 = id_ecSigType.Branch("1");
|
||||
|
||||
public static readonly DerObjectIdentifier id_publicKeyType = ansi_X9_62.Branch("2");
|
||||
|
||||
public static readonly DerObjectIdentifier IdECPublicKey = id_publicKeyType.Branch("1");
|
||||
|
||||
public static readonly DerObjectIdentifier ECDsaWithSha2 = id_ecSigType.Branch("3");
|
||||
|
||||
public static readonly DerObjectIdentifier ECDsaWithSha224 = ECDsaWithSha2.Branch("1");
|
||||
public static readonly DerObjectIdentifier ECDsaWithSha256 = ECDsaWithSha2.Branch("2");
|
||||
public static readonly DerObjectIdentifier ECDsaWithSha384 = ECDsaWithSha2.Branch("3");
|
||||
public static readonly DerObjectIdentifier ECDsaWithSha512 = ECDsaWithSha2.Branch("4");
|
||||
|
||||
|
||||
//
|
||||
// named curves
|
||||
//
|
||||
public static readonly DerObjectIdentifier EllipticCurve = ansi_X9_62.Branch("3");
|
||||
|
||||
//
|
||||
// Two Curves
|
||||
//
|
||||
public static readonly DerObjectIdentifier CTwoCurve = EllipticCurve.Branch("0");
|
||||
|
||||
public static readonly DerObjectIdentifier C2Pnb163v1 = CTwoCurve.Branch("1");
|
||||
public static readonly DerObjectIdentifier C2Pnb163v2 = CTwoCurve.Branch("2");
|
||||
public static readonly DerObjectIdentifier C2Pnb163v3 = CTwoCurve.Branch("3");
|
||||
public static readonly DerObjectIdentifier C2Pnb176w1 = CTwoCurve.Branch("4");
|
||||
public static readonly DerObjectIdentifier C2Tnb191v1 = CTwoCurve.Branch("5");
|
||||
public static readonly DerObjectIdentifier C2Tnb191v2 = CTwoCurve.Branch("6");
|
||||
public static readonly DerObjectIdentifier C2Tnb191v3 = CTwoCurve.Branch("7");
|
||||
public static readonly DerObjectIdentifier C2Onb191v4 = CTwoCurve.Branch("8");
|
||||
public static readonly DerObjectIdentifier C2Onb191v5 = CTwoCurve.Branch("9");
|
||||
public static readonly DerObjectIdentifier C2Pnb208w1 = CTwoCurve.Branch("10");
|
||||
public static readonly DerObjectIdentifier C2Tnb239v1 = CTwoCurve.Branch("11");
|
||||
public static readonly DerObjectIdentifier C2Tnb239v2 = CTwoCurve.Branch("12");
|
||||
public static readonly DerObjectIdentifier C2Tnb239v3 = CTwoCurve.Branch("13");
|
||||
public static readonly DerObjectIdentifier C2Onb239v4 = CTwoCurve.Branch("14");
|
||||
public static readonly DerObjectIdentifier C2Onb239v5 = CTwoCurve.Branch("15");
|
||||
public static readonly DerObjectIdentifier C2Pnb272w1 = CTwoCurve.Branch("16");
|
||||
public static readonly DerObjectIdentifier C2Pnb304w1 = CTwoCurve.Branch("17");
|
||||
public static readonly DerObjectIdentifier C2Tnb359v1 = CTwoCurve.Branch("18");
|
||||
public static readonly DerObjectIdentifier C2Pnb368w1 = CTwoCurve.Branch("19");
|
||||
public static readonly DerObjectIdentifier C2Tnb431r1 = CTwoCurve.Branch("20");
|
||||
|
||||
//
|
||||
// Prime
|
||||
//
|
||||
public static readonly DerObjectIdentifier PrimeCurve = EllipticCurve.Branch("1");
|
||||
|
||||
public static readonly DerObjectIdentifier Prime192v1 = PrimeCurve.Branch("1");
|
||||
public static readonly DerObjectIdentifier Prime192v2 = PrimeCurve.Branch("2");
|
||||
public static readonly DerObjectIdentifier Prime192v3 = PrimeCurve.Branch("3");
|
||||
public static readonly DerObjectIdentifier Prime239v1 = PrimeCurve.Branch("4");
|
||||
public static readonly DerObjectIdentifier Prime239v2 = PrimeCurve.Branch("5");
|
||||
public static readonly DerObjectIdentifier Prime239v3 = PrimeCurve.Branch("6");
|
||||
public static readonly DerObjectIdentifier Prime256v1 = PrimeCurve.Branch("7");
|
||||
|
||||
//
|
||||
// DSA
|
||||
//
|
||||
// dsapublicnumber OBJECT IDENTIFIER ::= { iso(1) member-body(2)
|
||||
// us(840) ansi-x957(10040) number-type(4) 1 }
|
||||
public static readonly DerObjectIdentifier IdDsa = new DerObjectIdentifier("1.2.840.10040.4.1");
|
||||
|
||||
/**
|
||||
* id-dsa-with-sha1 OBJECT IDENTIFIER ::= { iso(1) member-body(2)
|
||||
* us(840) x9-57 (10040) x9cm(4) 3 }
|
||||
*/
|
||||
public static readonly DerObjectIdentifier IdDsaWithSha1 = new DerObjectIdentifier("1.2.840.10040.4.3");
|
||||
|
||||
/**
|
||||
* X9.63
|
||||
*/
|
||||
public static readonly DerObjectIdentifier X9x63Scheme = new DerObjectIdentifier("1.3.133.16.840.63.0");
|
||||
public static readonly DerObjectIdentifier DHSinglePassStdDHSha1KdfScheme = X9x63Scheme.Branch("2");
|
||||
public static readonly DerObjectIdentifier DHSinglePassCofactorDHSha1KdfScheme = X9x63Scheme.Branch("3");
|
||||
public static readonly DerObjectIdentifier MqvSinglePassSha1KdfScheme = X9x63Scheme.Branch("16");
|
||||
|
||||
/**
|
||||
* X9.42
|
||||
*/
|
||||
|
||||
public static readonly DerObjectIdentifier ansi_x9_42 = new DerObjectIdentifier("1.2.840.10046");
|
||||
|
||||
//
|
||||
// Diffie-Hellman
|
||||
//
|
||||
// dhpublicnumber OBJECT IDENTIFIER ::= { iso(1) member-body(2)
|
||||
// us(840) ansi-x942(10046) number-type(2) 1 }
|
||||
//
|
||||
public static readonly DerObjectIdentifier DHPublicNumber = ansi_x9_42.Branch("2.1");
|
||||
|
||||
public static readonly DerObjectIdentifier X9x42Schemes = ansi_x9_42.Branch("2.3");
|
||||
|
||||
public static readonly DerObjectIdentifier DHStatic = X9x42Schemes.Branch("1");
|
||||
public static readonly DerObjectIdentifier DHEphem = X9x42Schemes.Branch("2");
|
||||
public static readonly DerObjectIdentifier DHOneFlow = X9x42Schemes.Branch("3");
|
||||
public static readonly DerObjectIdentifier DHHybrid1 = X9x42Schemes.Branch("4");
|
||||
public static readonly DerObjectIdentifier DHHybrid2 = X9x42Schemes.Branch("5");
|
||||
public static readonly DerObjectIdentifier DHHybridOneFlow = X9x42Schemes.Branch("6");
|
||||
public static readonly DerObjectIdentifier Mqv2 = X9x42Schemes.Branch("7");
|
||||
public static readonly DerObjectIdentifier Mqv1 = X9x42Schemes.Branch("8");
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
11
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/X9ObjectIdentifiers.cs.meta
vendored
Normal file
11
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/asn1/x9/X9ObjectIdentifiers.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 670f9d39edf0d194887b3dc5dbe03827
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user