197 lines
7.4 KiB
C#
197 lines
7.4 KiB
C#
using System;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw
|
|
{
|
|
// Token: 0x020019D9 RID: 6617
|
|
[Token(Token = "0x20019D9")]
|
|
internal abstract class Mod
|
|
{
|
|
// Token: 0x06009E90 RID: 40592 RVA: 0x00217094 File Offset: 0x00215294
|
|
[Token(Token = "0x6009E90")]
|
|
[Address(RVA = "0x1F6D430", Offset = "0x1F6C230", VA = "0x181F6D430")]
|
|
public static void Invert(uint[] p, uint[] x, uint[] z)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (06009E90)
|
|
|
|
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: 0x06009E91 RID: 40593 RVA: 0x002172EC File Offset: 0x002154EC
|
|
[Token(Token = "0x6009E91")]
|
|
[Address(RVA = "0x1F6DBC0", Offset = "0x1F6C9C0", VA = "0x181F6DBC0")]
|
|
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: 0x06009E92 RID: 40594 RVA: 0x0021734C File Offset: 0x0021554C
|
|
[Token(Token = "0x6009E92")]
|
|
[Address(RVA = "0x1F6D150", Offset = "0x1F6BF50", VA = "0x181F6D150")]
|
|
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: 0x06009E93 RID: 40595 RVA: 0x0021737C File Offset: 0x0021557C
|
|
[Token(Token = "0x6009E93")]
|
|
[Address(RVA = "0x1F6DDB0", Offset = "0x1F6CBB0", VA = "0x181F6DDB0")]
|
|
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: 0x06009E94 RID: 40596 RVA: 0x002173F0 File Offset: 0x002155F0
|
|
[Token(Token = "0x6009E94")]
|
|
[Address(RVA = "0x1F6D1D0", Offset = "0x1F6BFD0", VA = "0x181F6D1D0")]
|
|
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: 0x06009E95 RID: 40597 RVA: 0x00217424 File Offset: 0x00215624
|
|
[Token(Token = "0x6009E95")]
|
|
[Address(RVA = "0x1F6D230", Offset = "0x1F6C030", VA = "0x181F6D230")]
|
|
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: 0x06009E96 RID: 40598 RVA: 0x002174C4 File Offset: 0x002156C4
|
|
[Token(Token = "0x6009E96")]
|
|
[Address(RVA = "0x1F6D1B0", Offset = "0x1F6BFB0", VA = "0x181F6D1B0")]
|
|
private static int GetTrailingZeroes(uint x)
|
|
{
|
|
int num = 0;
|
|
if (x == (uint)1)
|
|
{
|
|
num++;
|
|
while (x == (uint)1)
|
|
{
|
|
}
|
|
}
|
|
return num;
|
|
}
|
|
|
|
// Token: 0x06009E97 RID: 40599 RVA: 0x002174E4 File Offset: 0x002156E4
|
|
[Token(Token = "0x6009E97")]
|
|
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
|
|
protected Mod()
|
|
{
|
|
}
|
|
|
|
// Token: 0x06009E98 RID: 40600 RVA: 0x002174F8 File Offset: 0x002156F8
|
|
// Note: this type is marked as 'beforefieldinit'.
|
|
[Token(Token = "0x6009E98")]
|
|
[Address(RVA = "0x1F6DEF0", Offset = "0x1F6CCF0", VA = "0x181F6DEF0")]
|
|
static Mod()
|
|
{
|
|
SecureRandom secureRandom = new SecureRandom();
|
|
}
|
|
|
|
// Token: 0x04006A53 RID: 27219
|
|
[Token(Token = "0x4006A53")]
|
|
private static readonly SecureRandom RandomSource;
|
|
}
|
|
}
|