280 lines
13 KiB
C#
280 lines
13 KiB
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC
|
|
{
|
|
// Token: 0x02001425 RID: 5157
|
|
[Token(Token = "0x2001425")]
|
|
[StructLayout(3)]
|
|
public class F2mPoint : AbstractF2mPoint
|
|
{
|
|
// Token: 0x06008568 RID: 34152 RVA: 0x001D0CC4 File Offset: 0x001CEEC4
|
|
[Token(Token = "0x6008568")]
|
|
[Address(RVA = "0x21A9D70", Offset = "0x21A8770", VA = "0x1821A9D70")]
|
|
[Obsolete]
|
|
public F2mPoint(ECCurve curve, ECFieldElement x, ECFieldElement y)
|
|
{
|
|
}
|
|
|
|
// Token: 0x06008569 RID: 34153 RVA: 0x001D0CD4 File Offset: 0x001CEED4
|
|
[Token(Token = "0x6008569")]
|
|
[Address(RVA = "0x21A9DB0", Offset = "0x21A87B0", VA = "0x1821A9DB0")]
|
|
[Obsolete]
|
|
public F2mPoint(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (06008569)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.F2mPoint::.ctor(BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.ECCurve,BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.ECFieldElement,BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.ECFieldElement,System.Boolean)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_27:
|
|
stloc:ArgumentException(var_4_31, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("Exactly one of the field elements is null")))
|
|
}
|
|
|
|
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.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
|
|
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: 0x0600856A RID: 34154 RVA: 0x001D0D14 File Offset: 0x001CEF14
|
|
[Token(Token = "0x600856A")]
|
|
[Address(RVA = "0x21A9D90", Offset = "0x21A8790", VA = "0x1821A9D90")]
|
|
internal F2mPoint(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression)
|
|
{
|
|
}
|
|
|
|
// Token: 0x0600856B RID: 34155 RVA: 0x001D0D24 File Offset: 0x001CEF24
|
|
[Token(Token = "0x600856B")]
|
|
[Address(RVA = "0x21A87F0", Offset = "0x21A71F0", VA = "0x1821A87F0", Slot = "7")]
|
|
protected override ECPoint Detach()
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600856B)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.ECPoint BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.F2mPoint::Detach()
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_22:
|
|
stloc:ArgumentException(var_5_2C, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("Exactly one of the field elements is null")))
|
|
}
|
|
|
|
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: 0x17001572 RID: 5490
|
|
// (get) Token: 0x0600856C RID: 34156 RVA: 0x001D0D60 File Offset: 0x001CEF60
|
|
[Token(Token = "0x17001572")]
|
|
public override ECFieldElement YCoord
|
|
{
|
|
[Token(Token = "0x600856C")]
|
|
[Address(RVA = "0x21A9FB0", Offset = "0x21A89B0", VA = "0x1821A9FB0", Slot = "12")]
|
|
get
|
|
{
|
|
ECPoint ecpoint = this.Detach();
|
|
if (0UL > (ulong)1L)
|
|
{
|
|
return this.m_y;
|
|
}
|
|
ECFieldElement y = this.m_y;
|
|
ECFieldElement x = this.m_x;
|
|
if ((x != 0 || y != 0) && !x.IsOne)
|
|
{
|
|
int fieldSize = y.FieldSize;
|
|
if (ecpoint != (ulong)6L || this.m_zs[0].BitLength == 0)
|
|
{
|
|
}
|
|
}
|
|
throw new NullReferenceException();
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001573 RID: 5491
|
|
// (get) Token: 0x0600856D RID: 34157 RVA: 0x001D0DC8 File Offset: 0x001CEFC8
|
|
[Token(Token = "0x17001573")]
|
|
protected internal override bool CompressionYTilde
|
|
{
|
|
[Token(Token = "0x600856D")]
|
|
[Address(RVA = "0x21A9EB0", Offset = "0x21A88B0", VA = "0x1821A9EB0", Slot = "25")]
|
|
get
|
|
{
|
|
ECFieldElement x = this.m_x;
|
|
if (!x.IsOne)
|
|
{
|
|
ECFieldElement y = this.m_y;
|
|
if (this.Detach() > (ulong)1L)
|
|
{
|
|
BigInteger bigInteger = y.Multiply(x).ToBigInteger();
|
|
}
|
|
ECFieldElement ecfieldElement;
|
|
ECFieldElement ecfieldElement2;
|
|
return ecfieldElement != ecfieldElement2;
|
|
}
|
|
throw new NullReferenceException();
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600856E RID: 34158 RVA: 0x001D0E18 File Offset: 0x001CF018
|
|
[Token(Token = "0x600856E")]
|
|
[Address(RVA = "0x21A7950", Offset = "0x21A6350", VA = "0x1821A7950", Slot = "26")]
|
|
public override ECPoint Add(ECPoint b)
|
|
{
|
|
return b;
|
|
}
|
|
|
|
// Token: 0x0600856F RID: 34159 RVA: 0x001D103C File Offset: 0x001CF23C
|
|
[Token(Token = "0x600856F")]
|
|
[Address(RVA = "0x21A92A0", Offset = "0x21A7CA0", VA = "0x1821A92A0", Slot = "30")]
|
|
public override ECPoint Twice()
|
|
{
|
|
F2mPoint f2mPoint;
|
|
ECFieldElement ecfieldElement5;
|
|
for (;;)
|
|
{
|
|
bool flag = this.SatisfiesOrder();
|
|
ECFieldElement x = this.m_x;
|
|
if (x.IsOne)
|
|
{
|
|
goto IL_1F2;
|
|
}
|
|
int fieldSize = this.m_y.Multiply(x).FieldSize;
|
|
ushort num;
|
|
TypeCode typeCode = num.GetTypeCode();
|
|
bool flag2 = flag.Equals(fieldSize != 0);
|
|
TypeCode typeCode2 = typeCode.GetTypeCode();
|
|
bool withCompression = this.m_withCompression;
|
|
if (f2mPoint == (ulong)1L)
|
|
{
|
|
break;
|
|
}
|
|
F2mPoint f2mPoint2;
|
|
if (f2mPoint2 == (ulong)6L)
|
|
{
|
|
ECFieldElement[] zs = f2mPoint.m_zs;
|
|
ECFieldElement y = f2mPoint.m_y;
|
|
ECFieldElement ecfieldElement = zs[0];
|
|
int bitLength = ecfieldElement.BitLength;
|
|
if (bitLength != 0)
|
|
{
|
|
}
|
|
ECFieldElement ecfieldElement2 = y.Subtract(ecfieldElement);
|
|
ECFieldElement ecfieldElement3 = ecfieldElement.Negate();
|
|
if (bitLength != 0)
|
|
{
|
|
}
|
|
ECFieldElement ecfieldElement4 = ecfieldElement5.Subtract(ecfieldElement5);
|
|
if (y.Negate().FieldSize.GetTypeCode() != TypeCode.Empty)
|
|
{
|
|
goto IL_1E0;
|
|
}
|
|
ECFieldElement affineXCoord = f2mPoint2.AffineXCoord;
|
|
ECFieldElement ecfieldElement6;
|
|
TypeCode typeCode3 = ecfieldElement6.FieldSize.GetTypeCode();
|
|
ushort num2;
|
|
TypeCode typeCode4 = num2.GetTypeCode();
|
|
ushort num3;
|
|
num2 = num3;
|
|
ulong num4;
|
|
if (num4 == (ulong)0L)
|
|
{
|
|
ECFieldElement ecfieldElement7 = ecfieldElement3.Negate();
|
|
}
|
|
int fieldSize2 = ecfieldElement4.FieldSize;
|
|
TypeCode typeCode5 = num2.GetTypeCode().GetTypeCode();
|
|
ushort num5;
|
|
num2 = num5;
|
|
sbyte b;
|
|
TypeCode typeCode6 = b.GetTypeCode().GetTypeCode();
|
|
if (!ecfieldElement5.IsOne)
|
|
{
|
|
goto Block_5;
|
|
}
|
|
}
|
|
}
|
|
ECFieldElement[] zs2 = f2mPoint.m_zs;
|
|
ECFieldElement y2 = f2mPoint.m_y;
|
|
ECFieldElement ecfieldElement8 = zs2[0];
|
|
int num6 = ecfieldElement8.BitLength;
|
|
if (num6 != 0)
|
|
{
|
|
}
|
|
ECFieldElement ecfieldElement9 = y2.Subtract(ecfieldElement8);
|
|
ECFieldElement ecfieldElement10;
|
|
int fieldSize3 = ecfieldElement10.FieldSize;
|
|
num6 = fieldSize3;
|
|
TypeCode typeCode7 = num6.GetTypeCode();
|
|
ECFieldElement ecfieldElement11 = ecfieldElement10.Negate();
|
|
ECFieldElement[] array = new ECFieldElement[1];
|
|
throw new ArrayTypeMismatchException();
|
|
Block_5:
|
|
if (ecfieldElement5.BitLength == 0)
|
|
{
|
|
TypeCode typeCode6;
|
|
TypeCode typeCode8 = typeCode6.GetTypeCode().GetTypeCode();
|
|
}
|
|
ECFieldElement[] array2 = new ECFieldElement[1];
|
|
throw new ArrayTypeMismatchException();
|
|
IL_1E0:
|
|
F2mPoint f2mPoint3;
|
|
ECFieldElement[] zcoords = f2mPoint3.GetZCoords();
|
|
bool withCompression2 = f2mPoint.m_withCompression;
|
|
IL_1F2:
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x06008570 RID: 34160 RVA: 0x0000220F File Offset: 0x0000040F
|
|
[Token(Token = "0x6008570")]
|
|
[Address(RVA = "0x21A8C20", Offset = "0x21A7620", VA = "0x1821A8C20", Slot = "32")]
|
|
public override ECPoint TwicePlus(ECPoint b)
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x06008571 RID: 34161 RVA: 0x001D1240 File Offset: 0x001CF440
|
|
[Token(Token = "0x6008571")]
|
|
[Address(RVA = "0x21A8910", Offset = "0x21A7310", VA = "0x1821A8910", Slot = "28")]
|
|
public override ECPoint Negate()
|
|
{
|
|
do
|
|
{
|
|
ECFieldElement x = this.m_x;
|
|
if (x == 0)
|
|
{
|
|
}
|
|
if (x.IsOne)
|
|
{
|
|
goto IL_6F;
|
|
}
|
|
}
|
|
while (this.SatisfiesOrder() > true);
|
|
int fieldSize = this.m_y.FieldSize;
|
|
bool withCompression = this.m_withCompression;
|
|
F2mPoint f2mPoint;
|
|
ECFieldElement y = f2mPoint.m_y;
|
|
ECCurve curve = f2mPoint.Curve;
|
|
ECFieldElement[] array = new ECFieldElement[1];
|
|
throw new ArrayTypeMismatchException();
|
|
IL_6F:
|
|
throw new NullReferenceException();
|
|
}
|
|
}
|
|
}
|