309 lines
13 KiB
C#
309 lines
13 KiB
C#
using System;
|
|
using System.IO;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9
|
|
{
|
|
// Token: 0x02001DE5 RID: 7653
|
|
[Token(Token = "0x2001DE5")]
|
|
public class X9ECParameters : Asn1Encodable
|
|
{
|
|
// Token: 0x0600C188 RID: 49544 RVA: 0x002C0694 File Offset: 0x002BE894
|
|
[Token(Token = "0x600C188")]
|
|
[Address(RVA = "0x16729E0", Offset = "0x16717E0", VA = "0x1816729E0")]
|
|
public static X9ECParameters GetInstance(object obj)
|
|
{
|
|
while (obj != 0)
|
|
{
|
|
Asn1Sequence instance;
|
|
if (obj == 0)
|
|
{
|
|
instance = Asn1Sequence.GetInstance(obj);
|
|
return new X9ECParameters(instance);
|
|
}
|
|
if (instance != 0)
|
|
{
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600C189 RID: 49545 RVA: 0x002C06C8 File Offset: 0x002BE8C8
|
|
[Token(Token = "0x600C189")]
|
|
[Address(RVA = "0x1673280", Offset = "0x1672080", VA = "0x181673280")]
|
|
public X9ECParameters(Asn1Sequence seq)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600C189)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9.X9ECParameters::.ctor(BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Asn1Sequence)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_102:
|
|
stloc:ArgumentException(var_29_10C, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("bad version in X9ECParameters")))
|
|
}
|
|
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
|
|
--- End of inner exception stack trace ---
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
|
|
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
|
|
*/;
|
|
}
|
|
|
|
// Token: 0x0600C18A RID: 49546 RVA: 0x002C07E4 File Offset: 0x002BE9E4
|
|
[Token(Token = "0x600C18A")]
|
|
[Address(RVA = "0x1672E80", Offset = "0x1671C80", VA = "0x181672E80")]
|
|
public X9ECParameters(ECCurve curve, ECPoint g, BigInteger n)
|
|
{
|
|
}
|
|
|
|
// Token: 0x0600C18B RID: 49547 RVA: 0x002C07F4 File Offset: 0x002BE9F4
|
|
[Token(Token = "0x600C18B")]
|
|
[Address(RVA = "0x1672E50", Offset = "0x1671C50", VA = "0x181672E50")]
|
|
public X9ECParameters(ECCurve curve, X9ECPoint g, BigInteger n, BigInteger h)
|
|
{
|
|
}
|
|
|
|
// Token: 0x0600C18C RID: 49548 RVA: 0x002C0804 File Offset: 0x002BEA04
|
|
[Token(Token = "0x600C18C")]
|
|
[Address(RVA = "0x16738B0", Offset = "0x16726B0", VA = "0x1816738B0")]
|
|
public X9ECParameters(ECCurve curve, ECPoint g, BigInteger n, BigInteger h)
|
|
{
|
|
}
|
|
|
|
// Token: 0x0600C18D RID: 49549 RVA: 0x002C0814 File Offset: 0x002BEA14
|
|
[Token(Token = "0x600C18D")]
|
|
[Address(RVA = "0x16737A0", Offset = "0x16725A0", VA = "0x1816737A0")]
|
|
public X9ECParameters(ECCurve curve, ECPoint g, BigInteger n, BigInteger h, byte[] seed)
|
|
{
|
|
bool flag = g.IsNormalized();
|
|
X9ECPoint x9ECPoint;
|
|
x9ECPoint.p = flag;
|
|
byte[] array;
|
|
DerOctetString derOctetString = new DerOctetString(array);
|
|
x9ECPoint.encoding = derOctetString;
|
|
}
|
|
|
|
// Token: 0x0600C18E RID: 49550 RVA: 0x002C0848 File Offset: 0x002BEA48
|
|
[Token(Token = "0x600C18E")]
|
|
[Address(RVA = "0x1672EA0", Offset = "0x1671CA0", VA = "0x181672EA0")]
|
|
public X9ECParameters(ECCurve curve, X9ECPoint g, BigInteger n, BigInteger h, byte[] seed)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600C18E)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9.X9ECParameters::.ctor(BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.ECCurve,BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9.X9ECPoint,BestHTTP.SecureProtocol.Org.BouncyCastle.Math.BigInteger,BestHTTP.SecureProtocol.Org.BouncyCastle.Math.BigInteger,System.Byte[])
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_C5:
|
|
stloc:ArgumentException(var_10_CF, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("'curve' is of an unsupported type")))
|
|
}
|
|
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
|
|
--- End of inner exception stack trace ---
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
|
|
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
|
|
*/;
|
|
}
|
|
|
|
// Token: 0x17001DD0 RID: 7632
|
|
// (get) Token: 0x0600C18F RID: 49551 RVA: 0x002C0928 File Offset: 0x002BEB28
|
|
[Token(Token = "0x17001DD0")]
|
|
public ECCurve Curve
|
|
{
|
|
[Token(Token = "0x600C18F")]
|
|
[Address(RVA = "0x3F5F40", Offset = "0x3F4D40", VA = "0x1803F5F40")]
|
|
get
|
|
{
|
|
return this.curve;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001DD1 RID: 7633
|
|
// (get) Token: 0x0600C190 RID: 49552 RVA: 0x002C093C File Offset: 0x002BEB3C
|
|
[Token(Token = "0x17001DD1")]
|
|
public ECPoint G
|
|
{
|
|
[Token(Token = "0x600C190")]
|
|
[Address(RVA = "0x1673950", Offset = "0x1672750", VA = "0x181673950")]
|
|
get
|
|
{
|
|
X9ECPoint x9ECPoint = this.g;
|
|
ECPoint p = x9ECPoint.p;
|
|
if (p == 0)
|
|
{
|
|
Asn1OctetString encoding = x9ECPoint.encoding;
|
|
ECCurve c = x9ECPoint.c;
|
|
Stream octetStream = encoding.GetOctetStream();
|
|
ECMultiplier multiplier = c.GetMultiplier();
|
|
}
|
|
return p;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001DD2 RID: 7634
|
|
// (get) Token: 0x0600C191 RID: 49553 RVA: 0x002C0980 File Offset: 0x002BEB80
|
|
[Token(Token = "0x17001DD2")]
|
|
public BigInteger N
|
|
{
|
|
[Token(Token = "0x600C191")]
|
|
[Address(RVA = "0x3F63E0", Offset = "0x3F51E0", VA = "0x1803F63E0")]
|
|
get
|
|
{
|
|
return this.n;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001DD3 RID: 7635
|
|
// (get) Token: 0x0600C192 RID: 49554 RVA: 0x002C0994 File Offset: 0x002BEB94
|
|
[Token(Token = "0x17001DD3")]
|
|
public BigInteger H
|
|
{
|
|
[Token(Token = "0x600C192")]
|
|
[Address(RVA = "0x3FA180", Offset = "0x3F8F80", VA = "0x1803FA180")]
|
|
get
|
|
{
|
|
return this.h;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600C193 RID: 49555 RVA: 0x002C09A8 File Offset: 0x002BEBA8
|
|
[Token(Token = "0x600C193")]
|
|
[Address(RVA = "0x3F63D0", Offset = "0x3F51D0", VA = "0x1803F63D0")]
|
|
public byte[] GetSeed()
|
|
{
|
|
return this.seed;
|
|
}
|
|
|
|
// Token: 0x17001DD4 RID: 7636
|
|
// (get) Token: 0x0600C194 RID: 49556 RVA: 0x002C09BC File Offset: 0x002BEBBC
|
|
[Token(Token = "0x17001DD4")]
|
|
public X9Curve CurveEntry
|
|
{
|
|
[Token(Token = "0x600C194")]
|
|
[Address(RVA = "0x16738E0", Offset = "0x16726E0", VA = "0x1816738E0")]
|
|
get
|
|
{
|
|
ECCurve eccurve = this.curve;
|
|
byte[] array = this.seed;
|
|
return new X9Curve(eccurve, array);
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001DD5 RID: 7637
|
|
// (get) Token: 0x0600C195 RID: 49557 RVA: 0x002C09E0 File Offset: 0x002BEBE0
|
|
[Token(Token = "0x17001DD5")]
|
|
public X9FieldID FieldIDEntry
|
|
{
|
|
[Token(Token = "0x600C195")]
|
|
[Address(RVA = "0x3F6E20", Offset = "0x3F5C20", VA = "0x1803F6E20")]
|
|
get
|
|
{
|
|
return this.fieldID;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001DD6 RID: 7638
|
|
// (get) Token: 0x0600C196 RID: 49558 RVA: 0x002C09F4 File Offset: 0x002BEBF4
|
|
[Token(Token = "0x17001DD6")]
|
|
public X9ECPoint BaseEntry
|
|
{
|
|
[Token(Token = "0x600C196")]
|
|
[Address(RVA = "0x3F6400", Offset = "0x3F5200", VA = "0x1803F6400")]
|
|
get
|
|
{
|
|
return this.g;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600C197 RID: 49559 RVA: 0x002C0A08 File Offset: 0x002BEC08
|
|
[Token(Token = "0x600C197")]
|
|
[Address(RVA = "0x1672AE0", Offset = "0x16718E0", VA = "0x181672AE0", Slot = "5")]
|
|
public override Asn1Object ToAsn1Object()
|
|
{
|
|
Asn1Encodable[] array = new Asn1Encodable[5];
|
|
DerInteger derInteger = new DerInteger(BigInteger.One);
|
|
if (derInteger != 0)
|
|
{
|
|
}
|
|
array[0] = derInteger;
|
|
X9FieldID x9FieldID = this.fieldID;
|
|
if (x9FieldID != 0)
|
|
{
|
|
}
|
|
array[1] = x9FieldID;
|
|
ECCurve eccurve = this.curve;
|
|
byte[] array2 = this.seed;
|
|
X9Curve x9Curve = new X9Curve(eccurve, array2);
|
|
if (x9Curve != 0)
|
|
{
|
|
}
|
|
array[2] = x9Curve;
|
|
X9ECPoint x9ECPoint = this.g;
|
|
if (x9ECPoint != 0)
|
|
{
|
|
}
|
|
array[3] = x9ECPoint;
|
|
DerInteger derInteger2 = new DerInteger(this.n);
|
|
if (derInteger2 != 0)
|
|
{
|
|
}
|
|
array[4] = derInteger2;
|
|
Asn1EncodableVector asn1EncodableVector = new Asn1EncodableVector(array);
|
|
if (this.h != (ulong)0L)
|
|
{
|
|
Asn1Encodable[] array3 = new Asn1Encodable[1];
|
|
DerInteger derInteger3 = new DerInteger(this.h);
|
|
if (derInteger3 != 0)
|
|
{
|
|
}
|
|
array3[0] = derInteger3;
|
|
asn1EncodableVector.Add(array3);
|
|
}
|
|
DerSequence derSequence = new DerSequence(asn1EncodableVector);
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x04007A02 RID: 31234
|
|
[FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x4007A02")]
|
|
private X9FieldID fieldID;
|
|
|
|
// Token: 0x04007A03 RID: 31235
|
|
[FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x4007A03")]
|
|
private ECCurve curve;
|
|
|
|
// Token: 0x04007A04 RID: 31236
|
|
[FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x4007A04")]
|
|
private X9ECPoint g;
|
|
|
|
// Token: 0x04007A05 RID: 31237
|
|
[FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x4007A05")]
|
|
private BigInteger n;
|
|
|
|
// Token: 0x04007A06 RID: 31238
|
|
[FieldOffset(Offset = "0x30")]
|
|
[Token(Token = "0x4007A06")]
|
|
private BigInteger h;
|
|
|
|
// Token: 0x04007A07 RID: 31239
|
|
[FieldOffset(Offset = "0x38")]
|
|
[Token(Token = "0x4007A07")]
|
|
private byte[] seed;
|
|
}
|
|
}
|