196 lines
6.9 KiB
C#
196 lines
6.9 KiB
C#
using System;
|
|
using System.Collections;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Anssi
|
|
{
|
|
// Token: 0x02001F71 RID: 8049
|
|
[Token(Token = "0x2001F71")]
|
|
public class AnssiNamedCurves
|
|
{
|
|
// Token: 0x0600CBA8 RID: 52136 RVA: 0x002EAB94 File Offset: 0x002E8D94
|
|
[Token(Token = "0x600CBA8")]
|
|
[Address(RVA = "0x434BD0", Offset = "0x4339D0", VA = "0x180434BD0")]
|
|
private static ECCurve ConfigureCurve(ECCurve curve)
|
|
{
|
|
return curve;
|
|
}
|
|
|
|
// Token: 0x0600CBA9 RID: 52137 RVA: 0x002EABA4 File Offset: 0x002E8DA4
|
|
[Token(Token = "0x600CBA9")]
|
|
[Address(RVA = "0x263C320", Offset = "0x263B120", VA = "0x18263C320")]
|
|
private static BigInteger FromHex(string hex)
|
|
{
|
|
byte[] array = Hex.Decode(hex);
|
|
return new BigInteger(1, array);
|
|
}
|
|
|
|
// Token: 0x0600CBAA RID: 52138 RVA: 0x002EABC0 File Offset: 0x002E8DC0
|
|
[Token(Token = "0x600CBAA")]
|
|
[Address(RVA = "0x263C1E0", Offset = "0x263AFE0", VA = "0x18263C1E0")]
|
|
private static void DefineCurve(string name, DerObjectIdentifier oid, X9ECParametersHolder holder)
|
|
{
|
|
IDictionary dictionary = AnssiNamedCurves.objIds;
|
|
string text = Platform.ToUpperInvariant(name);
|
|
IDictionary dictionary2 = AnssiNamedCurves.names;
|
|
IDictionary dictionary3 = AnssiNamedCurves.curves;
|
|
}
|
|
|
|
// Token: 0x0600CBAB RID: 52139 RVA: 0x002EABEC File Offset: 0x002E8DEC
|
|
[Token(Token = "0x600CBAB")]
|
|
[Address(RVA = "0x263C870", Offset = "0x263B670", VA = "0x18263C870")]
|
|
static AnssiNamedCurves()
|
|
{
|
|
IDictionary dictionary = Platform.CreateHashtable();
|
|
AnssiNamedCurves.objIds = dictionary;
|
|
IDictionary dictionary2 = Platform.CreateHashtable();
|
|
AnssiNamedCurves.curves = dictionary2;
|
|
AnssiNamedCurves.names = Platform.CreateHashtable();
|
|
IDictionary dictionary3 = AnssiNamedCurves.objIds;
|
|
string text = Platform.ToUpperInvariant("FRP256v1");
|
|
IDictionary dictionary4 = AnssiNamedCurves.names;
|
|
IDictionary dictionary5 = AnssiNamedCurves.curves;
|
|
}
|
|
|
|
// Token: 0x0600CBAC RID: 52140 RVA: 0x002EAC4C File Offset: 0x002E8E4C
|
|
[Token(Token = "0x600CBAC")]
|
|
[Address(RVA = "0x263C3B0", Offset = "0x263B1B0", VA = "0x18263C3B0")]
|
|
public static X9ECParameters GetByName(string name)
|
|
{
|
|
string text;
|
|
do
|
|
{
|
|
IDictionary dictionary = AnssiNamedCurves.objIds;
|
|
text = Platform.ToUpperInvariant(name);
|
|
if (text == 0)
|
|
{
|
|
goto IL_2A;
|
|
}
|
|
}
|
|
while (text == 0);
|
|
IDictionary dictionary2 = AnssiNamedCurves.curves;
|
|
IDictionary dictionary3 = AnssiNamedCurves.objIds;
|
|
IL_2A:
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600CBAD RID: 52141 RVA: 0x002EAC8C File Offset: 0x002E8E8C
|
|
[Token(Token = "0x600CBAD")]
|
|
[Address(RVA = "0x263C5F0", Offset = "0x263B3F0", VA = "0x18263C5F0")]
|
|
public static X9ECParameters GetByOid(DerObjectIdentifier oid)
|
|
{
|
|
IDictionary dictionary = AnssiNamedCurves.curves;
|
|
IDictionary dictionary2 = AnssiNamedCurves.objIds;
|
|
X9ECParameters x9ECParameters;
|
|
return x9ECParameters;
|
|
}
|
|
|
|
// Token: 0x0600CBAE RID: 52142 RVA: 0x002EACB4 File Offset: 0x002E8EB4
|
|
[Token(Token = "0x600CBAE")]
|
|
[Address(RVA = "0x263C770", Offset = "0x263B570", VA = "0x18263C770")]
|
|
public static DerObjectIdentifier GetOid(string name)
|
|
{
|
|
string text;
|
|
do
|
|
{
|
|
IDictionary dictionary = AnssiNamedCurves.objIds;
|
|
text = Platform.ToUpperInvariant(name);
|
|
if (text == 0)
|
|
{
|
|
}
|
|
}
|
|
while (text == 0);
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600CBAF RID: 52143 RVA: 0x002EACE0 File Offset: 0x002E8EE0
|
|
[Token(Token = "0x600CBAF")]
|
|
[Address(RVA = "0x263C6D0", Offset = "0x263B4D0", VA = "0x18263C6D0")]
|
|
public static string GetName(DerObjectIdentifier oid)
|
|
{
|
|
IDictionary dictionary = AnssiNamedCurves.names;
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x1700205A RID: 8282
|
|
// (get) Token: 0x0600CBB0 RID: 52144 RVA: 0x002EACF8 File Offset: 0x002E8EF8
|
|
[Token(Token = "0x1700205A")]
|
|
public static IEnumerable Names
|
|
{
|
|
[Token(Token = "0x600CBB0")]
|
|
[Address(RVA = "0x263CA90", Offset = "0x263B890", VA = "0x18263CA90")]
|
|
get
|
|
{
|
|
IDictionary dictionary = AnssiNamedCurves.names;
|
|
throw new NullReferenceException();
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600CBB1 RID: 52145 RVA: 0x002EAD10 File Offset: 0x002E8F10
|
|
[Token(Token = "0x600CBB1")]
|
|
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
|
|
public AnssiNamedCurves()
|
|
{
|
|
}
|
|
|
|
// Token: 0x040081F2 RID: 33266
|
|
[Token(Token = "0x40081F2")]
|
|
private static readonly IDictionary objIds;
|
|
|
|
// Token: 0x040081F3 RID: 33267
|
|
[Token(Token = "0x40081F3")]
|
|
private static readonly IDictionary curves;
|
|
|
|
// Token: 0x040081F4 RID: 33268
|
|
[Token(Token = "0x40081F4")]
|
|
private static readonly IDictionary names;
|
|
|
|
// Token: 0x02001F72 RID: 8050
|
|
[Token(Token = "0x2001F72")]
|
|
internal class Frp256v1Holder : X9ECParametersHolder
|
|
{
|
|
// Token: 0x0600CBB2 RID: 52146 RVA: 0x002EAD24 File Offset: 0x002E8F24
|
|
[Token(Token = "0x600CBB2")]
|
|
[Address(RVA = "0x4093D0", Offset = "0x4081D0", VA = "0x1804093D0")]
|
|
private Frp256v1Holder()
|
|
{
|
|
}
|
|
|
|
// Token: 0x0600CBB3 RID: 52147 RVA: 0x002EAD38 File Offset: 0x002E8F38
|
|
[Token(Token = "0x600CBB3")]
|
|
[Address(RVA = "0x264D2C0", Offset = "0x264C0C0", VA = "0x18264D2C0", Slot = "4")]
|
|
protected override X9ECParameters CreateParameters()
|
|
{
|
|
BigInteger bigInteger = AnssiNamedCurves.FromHex("F1FD178C0B3AD58F10126DE8CE42435B3961ADBCABC8CA6DE8FCF353D86E9C03");
|
|
BigInteger bigInteger2 = AnssiNamedCurves.FromHex("F1FD178C0B3AD58F10126DE8CE42435B3961ADBCABC8CA6DE8FCF353D86E9C00");
|
|
BigInteger bigInteger3 = AnssiNamedCurves.FromHex("EE353FCA5428A9300D4ABA754A44C00FDFEC0C9AE4B1A1803075ED967B7BB73F");
|
|
BigInteger bigInteger4 = AnssiNamedCurves.FromHex("F1FD178C0B3AD58F10126DE8CE42435B53DC67E140D2BF941FFDD459C6D655E1");
|
|
BigInteger one = BigInteger.One;
|
|
FpCurve fpCurve = new FpCurve(bigInteger, bigInteger2, bigInteger3, bigInteger4, one);
|
|
byte[] array = Hex.Decode("04B6B3D4C356C139EB31183D4749D423958C27D2DCAF98B70164C97A2DD98F5CFF6142E0F7C8B204911F9271F0F3ECEF8C2701C307E8E4C9E183115A1554062CFB");
|
|
X9ECPoint x9ECPoint = new X9ECPoint(fpCurve, array);
|
|
X9ECParameters x9ECParameters;
|
|
return x9ECParameters;
|
|
}
|
|
|
|
// Token: 0x0600CBB4 RID: 52148 RVA: 0x002EADA0 File Offset: 0x002E8FA0
|
|
// Note: this type is marked as 'beforefieldinit'.
|
|
[Token(Token = "0x600CBB4")]
|
|
[Address(RVA = "0x264D460", Offset = "0x264C260", VA = "0x18264D460")]
|
|
static Frp256v1Holder()
|
|
{
|
|
AnssiNamedCurves.Frp256v1Holder frp256v1Holder = new AnssiNamedCurves.Frp256v1Holder();
|
|
}
|
|
|
|
// Token: 0x040081F5 RID: 33269
|
|
[Token(Token = "0x40081F5")]
|
|
internal static readonly X9ECParametersHolder Instance;
|
|
}
|
|
}
|
|
}
|