199 lines
7.5 KiB
C#
199 lines
7.5 KiB
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw
|
|
{
|
|
// Token: 0x020013FC RID: 5116
|
|
[Token(Token = "0x20013FC")]
|
|
[StructLayout(3)]
|
|
internal abstract class Mod
|
|
{
|
|
// Token: 0x060082B6 RID: 33462 RVA: 0x001BFAE0 File Offset: 0x001BDCE0
|
|
[Token(Token = "0x60082B6")]
|
|
[Address(RVA = "0x20AFE30", Offset = "0x20AE830", VA = "0x1820AFE30")]
|
|
public static void Invert(uint[] p, uint[] x, uint[] z)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (060082B6)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw.Mod::Invert(System.UInt32[],System.UInt32[],System.UInt32[])
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_238:
|
|
stloc:ArgumentException(var_27_247, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("cannot be 0"), ldstr:string("x")))
|
|
}
|
|
|
|
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: 0x060082B7 RID: 33463 RVA: 0x001BFD38 File Offset: 0x001BDF38
|
|
[Token(Token = "0x60082B7")]
|
|
[Address(RVA = "0x20B05C0", Offset = "0x20AEFC0", VA = "0x1820B05C0")]
|
|
public static uint[] Random(uint[] p)
|
|
{
|
|
uint[] array;
|
|
int num3;
|
|
uint num4;
|
|
do
|
|
{
|
|
int i = p.Length;
|
|
array = new uint[i];
|
|
int num = i - 1;
|
|
byte[] array2 = new byte[i];
|
|
int num2 = 0;
|
|
Pack.BE_To_UInt32(array2, num2, array);
|
|
num3 = i - 1;
|
|
while (i <= 0)
|
|
{
|
|
}
|
|
int length = array.Length;
|
|
num4 = p[num3];
|
|
}
|
|
while (array[num3] > num4);
|
|
return array;
|
|
}
|
|
|
|
// Token: 0x060082B8 RID: 33464 RVA: 0x001BFD98 File Offset: 0x001BDF98
|
|
[Token(Token = "0x60082B8")]
|
|
[Address(RVA = "0x20AFB50", Offset = "0x20AE550", VA = "0x1820AFB50")]
|
|
public static void Add(uint[] p, uint[] x, uint[] y, uint[] z)
|
|
{
|
|
int length = p.Length;
|
|
if (Nat.Add(length, x, y, z) != (uint)0)
|
|
{
|
|
int num = Nat.SubFrom(length, p, z);
|
|
}
|
|
}
|
|
|
|
// Token: 0x060082B9 RID: 33465 RVA: 0x001BFDC8 File Offset: 0x001BDFC8
|
|
[Token(Token = "0x60082B9")]
|
|
[Address(RVA = "0x20B07B0", Offset = "0x20AF1B0", VA = "0x1820B07B0")]
|
|
public static void Subtract(uint[] p, uint[] x, uint[] y, uint[] z)
|
|
{
|
|
int length = p.Length;
|
|
int num = 0;
|
|
if (length > 0)
|
|
{
|
|
uint num2 = x[num];
|
|
num++;
|
|
uint num3 = y[num];
|
|
num2 -= num3;
|
|
num += (int)num2;
|
|
z[0] = (uint)num;
|
|
}
|
|
if (num != 0 && length > 0)
|
|
{
|
|
uint num4 = z[num];
|
|
num++;
|
|
uint num5 = p[num];
|
|
num += (int)num4;
|
|
num += (int)num5;
|
|
z[0] = (uint)num;
|
|
}
|
|
}
|
|
|
|
// Token: 0x060082BA RID: 33466 RVA: 0x001BFE3C File Offset: 0x001BE03C
|
|
[Token(Token = "0x60082BA")]
|
|
[Address(RVA = "0x20AFBD0", Offset = "0x20AE5D0", VA = "0x1820AFBD0")]
|
|
private static void InversionResult(uint[] p, int ac, uint[] a, uint[] z)
|
|
{
|
|
int length = p.Length;
|
|
int num = 0;
|
|
int num2 = 0;
|
|
Array.Copy(a, num2, z, num, length);
|
|
}
|
|
|
|
// Token: 0x060082BB RID: 33467 RVA: 0x001BFE70 File Offset: 0x001BE070
|
|
[Token(Token = "0x60082BB")]
|
|
[Address(RVA = "0x20AFC30", Offset = "0x20AE630", VA = "0x1820AFC30")]
|
|
private static void InversionStep(uint[] p, uint[] u, int uLen, uint[] x, ref int xc)
|
|
{
|
|
int length = p.Length;
|
|
int num = 0;
|
|
uint num2 = u[0];
|
|
if (num2 == (uint)0)
|
|
{
|
|
int num3 = uLen - 1;
|
|
u[0] = (uint)num;
|
|
num += 32;
|
|
}
|
|
uint num5;
|
|
if (num2 == (uint)1)
|
|
{
|
|
num++;
|
|
while (num2 == (uint)1)
|
|
{
|
|
}
|
|
if (num > 0)
|
|
{
|
|
int num4 = uLen - 1;
|
|
num5 = u[num4];
|
|
u[0] = num5;
|
|
num += num;
|
|
}
|
|
}
|
|
if (num > 0)
|
|
{
|
|
if ("{il2cpp array field x->}" != (ulong)1L)
|
|
{
|
|
int num6 = Nat.SubFrom(length, p, x);
|
|
uint num7 = Nat.AddTo(length, p, x);
|
|
num7 += num5;
|
|
}
|
|
uint num8 = Nat.ShiftDownBit(length, x, (uint)num);
|
|
num++;
|
|
}
|
|
}
|
|
|
|
// Token: 0x060082BC RID: 33468 RVA: 0x001BFF10 File Offset: 0x001BE110
|
|
[Token(Token = "0x60082BC")]
|
|
[Address(RVA = "0x20AFBB0", Offset = "0x20AE5B0", VA = "0x1820AFBB0")]
|
|
private static int GetTrailingZeroes(uint x)
|
|
{
|
|
int num = 0;
|
|
if (x == (uint)1)
|
|
{
|
|
num++;
|
|
while (x == (uint)1)
|
|
{
|
|
}
|
|
}
|
|
return num;
|
|
}
|
|
|
|
// Token: 0x060082BD RID: 33469 RVA: 0x001BFF30 File Offset: 0x001BE130
|
|
[Token(Token = "0x60082BD")]
|
|
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
|
|
protected Mod()
|
|
{
|
|
}
|
|
|
|
// Token: 0x060082BE RID: 33470 RVA: 0x001BFF44 File Offset: 0x001BE144
|
|
// Note: this type is marked as 'beforefieldinit'.
|
|
[Token(Token = "0x60082BE")]
|
|
[Address(RVA = "0x20B08F0", Offset = "0x20AF2F0", VA = "0x1820B08F0")]
|
|
static Mod()
|
|
{
|
|
SecureRandom secureRandom = new SecureRandom();
|
|
}
|
|
|
|
// Token: 0x04005C10 RID: 23568
|
|
[Token(Token = "0x4005C10")]
|
|
private static readonly SecureRandom RandomSource;
|
|
}
|
|
}
|