This commit is contained in:
niko
2026-04-08 23:40:05 +02:00
parent d6894bcbc7
commit 18dc73f922
7750 changed files with 1795369 additions and 0 deletions
@@ -0,0 +1,423 @@
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
{
// Token: 0x02001681 RID: 5761
[Token(Token = "0x2001681")]
[StructLayout(3)]
public sealed class BCrypt
{
// Token: 0x06009A2A RID: 39466 RVA: 0x0022518C File Offset: 0x0022338C
[Token(Token = "0x6009A2A")]
[Address(RVA = "0x1F4D1A0", Offset = "0x1F4BBA0", VA = "0x181F4D1A0")]
private BCrypt()
{
uint[] array = new uint[1024];
this.S = array;
uint[] array2 = new uint[18];
this.P = array2;
}
// Token: 0x06009A2B RID: 39467 RVA: 0x002251C0 File Offset: 0x002233C0
[Token(Token = "0x6009A2B")]
[Address(RVA = "0x1F4C630", Offset = "0x1F4B030", VA = "0x181F4C630")]
private uint F(uint x)
{
int length = this.S.Length;
return x;
}
// Token: 0x06009A2C RID: 39468 RVA: 0x002251E0 File Offset: 0x002233E0
[Token(Token = "0x6009A2C")]
[Address(RVA = "0x1F4CE60", Offset = "0x1F4B860", VA = "0x181F4CE60")]
private void ProcessTable(uint xl, uint xr, uint[] table)
{
int length = table.Length;
int num = 0;
if (length > 0)
{
uint[] p = this.P;
uint num2 = this.F(xl);
uint[] p2 = this.P;
uint num3 = this.F(xl);
uint[] p3 = this.P;
int length2 = p3.Length;
uint num5;
uint num4 = num5 + 1U;
num5 += (uint)2;
uint num6 = p3[8];
num++;
table[0] = xl;
num += 2;
}
}
// Token: 0x06009A2D RID: 39469 RVA: 0x00225258 File Offset: 0x00223458
[Token(Token = "0x6009A2D")]
[Address(RVA = "0x1F4C900", Offset = "0x1F4B300", VA = "0x181F4C900")]
private void InitState()
{
uint[] s = this.S;
int num = 0;
int num2 = 0;
ulong num3;
Array.Copy(BCrypt.KS0, num2, s, num, (int)num3);
uint[] s2 = this.S;
int num4 = 0;
ulong num5;
Array.Copy(BCrypt.KS1, num4, s2, 256, (int)num5);
uint[] s3 = this.S;
int num6 = 0;
ulong num7;
Array.Copy(BCrypt.KS2, num6, s3, 512, (int)num7);
uint[] s4 = this.S;
int num8 = 0;
ulong num9;
Array.Copy(BCrypt.KS3, num8, s4, 768, (int)num9);
int num10 = 0;
uint[] p = this.P;
int num11 = 0;
ulong num12;
Array.Copy(BCrypt.KP, num11, p, num10, (int)num12);
}
// Token: 0x06009A2E RID: 39470 RVA: 0x00225304 File Offset: 0x00223504
[Token(Token = "0x6009A2E")]
[Address(RVA = "0x1F4BB30", Offset = "0x1F4A530", VA = "0x181F4BB30")]
private void CyclicXorKey(byte[] key)
{
int length = key.Length;
int num = 0;
int length2 = key.Length;
int num2 = 0;
num2++;
uint[] p = this.P;
num++;
}
// Token: 0x06009A2F RID: 39471 RVA: 0x00225340 File Offset: 0x00223540
[Token(Token = "0x6009A2F")]
[Address(RVA = "0x1F4C160", Offset = "0x1F4AB60", VA = "0x181F4C160")]
private byte[] EncryptMagicString()
{
uint[] array = new uint[6];
uint num = BCrypt.MAGIC_STRING[0];
array[0] = num;
uint num2 = BCrypt.MAGIC_STRING[0];
array[0] = num2;
uint num3 = BCrypt.MAGIC_STRING[1];
array[1] = num3;
uint num4 = BCrypt.MAGIC_STRING[1];
array[1] = num4;
uint num5 = BCrypt.MAGIC_STRING[2];
array[2] = num5;
uint num6 = BCrypt.MAGIC_STRING[2];
array[2] = num6;
int num7 = 0;
int length = array.Length;
uint num8 = this.P[0];
num7 += 8;
uint num9 = this.F(num8);
uint[] p = this.P;
uint num10 = this.F(num8);
uint[] p2 = this.P;
int length2 = p2.Length;
uint num12;
uint num11 = num12 + 1U;
num12 += (uint)2;
uint num13 = p2[8];
num7.m_value = (int)num13;
num7 += 2;
array[0] = num8;
ulong num14;
num14 += (ulong)1L;
byte[] array2 = new byte[24];
int num15 = 0;
Pack.UInt32_To_BE(array, array2, num15);
int length3 = array.Length;
int num16 = 0;
Array.Clear(array, num16, length3);
uint[] p3 = this.P;
int length4 = p3.Length;
int num17 = 0;
Array.Clear(p3, num17, length4);
uint[] s = this.S;
int length5 = s.Length;
int num18 = 0;
Array.Clear(s, num18, length5);
return array2;
}
// Token: 0x06009A30 RID: 39472 RVA: 0x002254C8 File Offset: 0x002236C8
[Token(Token = "0x6009A30")]
[Address(RVA = "0x1F4CAB0", Offset = "0x1F4B4B0", VA = "0x181F4CAB0")]
private void ProcessTableWithSalt(uint[] table, uint[] salt32Bit, uint iv1, uint iv2)
{
int length = salt32Bit.Length;
uint num = salt32Bit[0];
int length2 = table.Length;
int num2 = 0;
if (length2 > 0)
{
uint[] p = this.P;
uint num3 = this.F(iv1);
uint[] p2 = this.P;
uint num4 = this.F(iv1);
int length3 = this.P.Length;
uint num6;
uint num5 = num6 + 1U;
num6 += (uint)2;
table[0] = num;
table[0] = iv1;
int length4 = salt32Bit.Length;
num2 += 2;
uint num7 = this.P[0];
uint num8 = this.F(num7);
uint[] p3 = this.P;
uint num9 = this.F(iv1);
int length5 = this.P.Length;
uint num11;
uint num10 = num11 + 1U;
num11 += (uint)2;
table[0] = iv1;
table[0] = iv1;
int length6 = salt32Bit.Length;
num2 += 4;
}
}
// Token: 0x06009A31 RID: 39473 RVA: 0x002255B8 File Offset: 0x002237B8
[Token(Token = "0x6009A31")]
[Address(RVA = "0x1F4BBF0", Offset = "0x1F4A5F0", VA = "0x181F4BBF0")]
private byte[] DeriveRawKey(int cost, byte[] salt, byte[] psw)
{
while (salt.Length != 16)
{
}
if (psw.Length == 0)
{
byte[] array = new byte[4];
}
int num = 0;
uint[] s = this.S;
int num2 = 0;
int num3 = 0;
ulong num4;
Array.Copy(BCrypt.KS0, num3, s, num2, (int)num4);
uint[] s2 = this.S;
int num5 = 0;
ulong num6;
Array.Copy(BCrypt.KS1, num5, s2, 256, (int)num6);
uint[] s3 = this.S;
int num7 = 0;
ulong num8;
Array.Copy(BCrypt.KS2, num7, s3, 512, (int)num8);
uint[] s4 = this.S;
int num9 = 0;
ulong num10;
Array.Copy(BCrypt.KS3, num9, s4, 768, (int)num10);
int num11 = 0;
uint[] p = this.P;
int num12 = 0;
ulong num13;
Array.Copy(BCrypt.KP, num12, p, num11, (int)num13);
uint[] array2 = new uint[0];
int num14 = 0;
Pack.BE_To_UInt32(salt, num14, array2);
uint[] array3 = new uint[salt.Length];
uint num15 = array2[1];
array3[0] = num15;
uint num16 = array2[1];
array3[0] = num16;
uint num17 = array2[0];
array3[1] = num17;
uint num18 = array2[0];
array3[1] = num18;
this.CyclicXorKey(psw);
uint[] p2 = this.P;
int num19 = 0;
this.ProcessTableWithSalt(p2, array2, (uint)num19, (uint)num);
int num20 = array2.Length;
int num21 = 0;
Array.Clear(array2, num21, num20);
uint[] p3 = this.P;
num20 = p3.Length;
uint num22 = p3[num21];
uint num23 = p3[num20];
uint[] s5 = this.S;
this.ProcessTableWithSalt(s5, array3, num22, num23);
int length = array3.Length;
int num24 = 0;
Array.Clear(array3, num24, length);
this.CyclicXorKey(psw);
uint[] p4 = this.P;
int num25 = 0;
int num26 = 0;
this.ProcessTable((uint)num26, (uint)num25, p4);
uint[] p5 = this.P;
int length2 = p5.Length;
uint[] s6 = this.S;
uint num27 = p5[8];
uint num28 = p5[8];
this.ProcessTable(num28, num27, s6);
this.CyclicXorKey(salt);
uint[] p6 = this.P;
int num29 = 0;
int num30 = 0;
this.ProcessTable((uint)num30, (uint)num29, p6);
uint[] p7 = this.P;
int length3 = p7.Length;
uint[] s7 = this.S;
uint num31 = p7[8];
uint num32 = p7[8];
this.ProcessTable(num32, num31, s7);
num++;
while (num != 1)
{
}
return this.EncryptMagicString();
}
// Token: 0x06009A32 RID: 39474 RVA: 0x00225844 File Offset: 0x00223A44
[Token(Token = "0x6009A32")]
[Address(RVA = "0x1F4CA40", Offset = "0x1F4B440", VA = "0x181F4CA40")]
public static byte[] PasswordToByteArray(char[] password)
{
byte[] array = Strings.ToUtf8ByteArray(password);
int num = 0;
return Arrays.Append(array, (byte)num);
}
// Token: 0x06009A33 RID: 39475 RVA: 0x00225864 File Offset: 0x00223A64
[Token(Token = "0x6009A33")]
[Address(RVA = "0x1F4C700", Offset = "0x1F4B100", VA = "0x181F4C700")]
public static byte[] Generate(byte[] password, byte[] salt, int cost)
{
/*
An exception occurred when decompiling this method (06009A33)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Byte[] BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators.BCrypt::Generate(System.Byte[],System.Byte[],System.Int32)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_43:
stloc:ArgumentNullException(var_4_4D, newobj:ArgumentNullException(ArgumentNullException::.ctor, ldstr:string("password")))
stloc:ArgumentException(var_5_5E, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("BCrypt cost must be from 4..31"), ldstr:string("cost")))
}
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: 0x06009A34 RID: 39476 RVA: 0x002258D0 File Offset: 0x00223AD0
// Note: this type is marked as 'beforefieldinit'.
[Token(Token = "0x6009A34")]
[Address(RVA = "0x1F4D020", Offset = "0x1F4BA20", VA = "0x181F4D020")]
static BCrypt()
{
uint[] array = new uint[6];
RuntimeHelpers.InitializeArray(array, fieldof(<PrivateImplementationDetails>.007AFA4B68442DD6E0877DE7624D0A5F508C474F).FieldHandle);
BCrypt.MAGIC_STRING = array;
uint[] array2 = new uint[18];
RuntimeHelpers.InitializeArray(array2, fieldof(<PrivateImplementationDetails>.643A9D76937E94519B73BE072D65E79BAFF3C213).FieldHandle);
BCrypt.KP = array2;
uint[] array3 = new uint[256];
RuntimeHelpers.InitializeArray(array3, fieldof(<PrivateImplementationDetails>.E117A40BF9A3AE32474AD7B22EB4C60E95D3BE2A).FieldHandle);
BCrypt.KS0 = array3;
uint[] array4 = new uint[256];
RuntimeHelpers.InitializeArray(array4, fieldof(<PrivateImplementationDetails>.6F576E8737EAAC9B6B12BDFC370048CD205E2CDD).FieldHandle);
BCrypt.KS1 = array4;
uint[] array5 = new uint[256];
RuntimeHelpers.InitializeArray(array5, fieldof(<PrivateImplementationDetails>.E2F8F75B7ABE5A6E4ECF5E32B935909BE2CC9F4B).FieldHandle);
BCrypt.KS2 = array5;
uint[] array6 = new uint[256];
RuntimeHelpers.InitializeArray(array6, fieldof(<PrivateImplementationDetails>.1C1237F52E2ED7B4D229AE3978DA144B9E653F5E).FieldHandle);
BCrypt.KS3 = array6;
}
// Token: 0x04006529 RID: 25897
[Token(Token = "0x4006529")]
private static readonly uint[] MAGIC_STRING;
// Token: 0x0400652A RID: 25898
[Token(Token = "0x400652A")]
internal const int MAGIC_STRING_LENGTH = 6;
// Token: 0x0400652B RID: 25899
[Token(Token = "0x400652B")]
private static readonly uint[] KP;
// Token: 0x0400652C RID: 25900
[Token(Token = "0x400652C")]
private static readonly uint[] KS0;
// Token: 0x0400652D RID: 25901
[Token(Token = "0x400652D")]
private static readonly uint[] KS1;
// Token: 0x0400652E RID: 25902
[Token(Token = "0x400652E")]
private static readonly uint[] KS2;
// Token: 0x0400652F RID: 25903
[Token(Token = "0x400652F")]
private static readonly uint[] KS3;
// Token: 0x04006530 RID: 25904
[Token(Token = "0x4006530")]
private const int ROUNDS = 16;
// Token: 0x04006531 RID: 25905
[Token(Token = "0x4006531")]
private const int SBOX_SK = 256;
// Token: 0x04006532 RID: 25906
[Token(Token = "0x4006532")]
private const int SBOX_SK2 = 512;
// Token: 0x04006533 RID: 25907
[Token(Token = "0x4006533")]
private const int SBOX_SK3 = 768;
// Token: 0x04006534 RID: 25908
[Token(Token = "0x4006534")]
private const int P_SZ = 18;
// Token: 0x04006535 RID: 25909
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006535")]
private readonly uint[] S;
// Token: 0x04006536 RID: 25910
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006536")]
private readonly uint[] P;
// Token: 0x04006537 RID: 25911
[Token(Token = "0x4006537")]
internal const int SALT_SIZE_BYTES = 16;
// Token: 0x04006538 RID: 25912
[Token(Token = "0x4006538")]
internal const int MIN_COST = 4;
// Token: 0x04006539 RID: 25913
[Token(Token = "0x4006539")]
internal const int MAX_COST = 31;
// Token: 0x0400653A RID: 25914
[Token(Token = "0x400653A")]
internal const int MAX_PASSWORD_BYTES = 72;
}
}
@@ -0,0 +1,139 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
{
// Token: 0x02001682 RID: 5762
[Token(Token = "0x2001682")]
[StructLayout(3)]
public class BaseKdfBytesGenerator : IDerivationFunction
{
// Token: 0x06009A35 RID: 39477 RVA: 0x00225984 File Offset: 0x00223B84
[Token(Token = "0x6009A35")]
[Address(RVA = "0x3C1040", Offset = "0x3BFA40", VA = "0x1803C1040")]
public BaseKdfBytesGenerator(int counterStart, IDigest digest)
{
this.counterStart = counterStart;
this.digest = digest;
}
// Token: 0x06009A36 RID: 39478 RVA: 0x002259A8 File Offset: 0x00223BA8
[Token(Token = "0x6009A36")]
[Address(RVA = "0x1F4D5E0", Offset = "0x1F4BFE0", VA = "0x181F4D5E0", Slot = "7")]
public virtual void Init(IDerivationParameters parameters)
{
/*
An exception occurred when decompiling this method (06009A36)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators.BaseKdfBytesGenerator::Init(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IDerivationParameters)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_3B:
stloc:ArgumentException(var_5_45, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("KDF parameters required for KDF Generator")))
}
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: 0x170018B0 RID: 6320
// (get) Token: 0x06009A37 RID: 39479 RVA: 0x002259FC File Offset: 0x00223BFC
[Token(Token = "0x170018B0")]
public virtual IDigest Digest
{
[Token(Token = "0x6009A37")]
[Address(RVA = "0x3C1240", Offset = "0x3BFC40", VA = "0x1803C1240", Slot = "8")]
get
{
return this.digest;
}
}
// Token: 0x06009A38 RID: 39480 RVA: 0x00225A10 File Offset: 0x00223C10
[Token(Token = "0x6009A38")]
[Address(RVA = "0x1F4D200", Offset = "0x1F4BC00", VA = "0x181F4D200", Slot = "9")]
public virtual int GenerateBytes(byte[] output, int outOff, int length)
{
int num = output.Length;
num -= length;
IDigest digest = this.digest;
IDigest digest2 = this.digest;
int num2 = length - 1;
num2 += num;
byte[] array = new byte[num2];
byte[] array2 = new byte[4];
int num3 = this.counterStart;
int num4 = 0;
Pack.UInt32_To_BE((uint)num3, array2, num4);
int num5 = this.counterStart;
int num6 = 0;
if (num2 > 0)
{
byte[] array3 = this.shared;
IDigest digest3 = this.digest;
if (num6 < num4)
{
num6 += num6;
num6++;
}
int num7 = 0;
IDigest digest4 = this.digest;
int num8 = 0;
if (num8 < num7)
{
num8 += num8;
num8++;
}
byte[] array4 = this.iv;
if (array4 != 0)
{
IDigest digest5 = this.digest;
int length2 = array4.Length;
}
IDigest digest6 = this.digest;
num8 += 4;
num8 += 19;
num8 += 4;
num8 += 19;
if (array2.Length == 3)
{
num5 += 256;
int num9 = 0;
Pack.UInt32_To_BE((uint)num5, array2, num9);
}
num6++;
}
IDigest digest7 = this.digest;
return length;
}
// Token: 0x0400653B RID: 25915
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x400653B")]
private int counterStart;
// Token: 0x0400653C RID: 25916
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x400653C")]
private IDigest digest;
// Token: 0x0400653D RID: 25917
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x400653D")]
private byte[] shared;
// Token: 0x0400653E RID: 25918
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x400653E")]
private byte[] iv;
}
}
@@ -0,0 +1,60 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
{
// Token: 0x02001683 RID: 5763
[Token(Token = "0x2001683")]
[StructLayout(3)]
public class DHBasicKeyPairGenerator : IAsymmetricCipherKeyPairGenerator
{
// Token: 0x06009A39 RID: 39481 RVA: 0x00225B38 File Offset: 0x00223D38
[Token(Token = "0x6009A39")]
[Address(RVA = "0x1F4E420", Offset = "0x1F4CE20", VA = "0x181F4E420", Slot = "6")]
public virtual void Init(KeyGenerationParameters parameters)
{
while (parameters != 0)
{
if (parameters != 0)
{
this.param = parameters;
return;
}
}
int num = 0;
this.param = num;
}
// Token: 0x06009A3A RID: 39482 RVA: 0x00225B60 File Offset: 0x00223D60
[Token(Token = "0x6009A3A")]
[Address(RVA = "0x1F4E2D0", Offset = "0x1F4CCD0", VA = "0x181F4E2D0", Slot = "7")]
public virtual AsymmetricCipherKeyPair GenerateKeyPair()
{
DHKeyGenerationParameters dhkeyGenerationParameters = this.param;
DHParameters parameters = dhkeyGenerationParameters.parameters;
SecureRandom random = dhkeyGenerationParameters.random;
BigInteger g = parameters.g;
BigInteger p = parameters.p;
BigInteger bigInteger;
DHPublicKeyParameters dhpublicKeyParameters = new DHPublicKeyParameters(g.ModPow(bigInteger, p), parameters);
DHPrivateKeyParameters dhprivateKeyParameters = new DHPrivateKeyParameters(bigInteger, parameters);
return new AsymmetricCipherKeyPair(dhpublicKeyParameters, dhprivateKeyParameters);
}
// Token: 0x06009A3B RID: 39483 RVA: 0x00225BBC File Offset: 0x00223DBC
[Token(Token = "0x6009A3B")]
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
public DHBasicKeyPairGenerator()
{
}
// Token: 0x0400653F RID: 25919
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x400653F")]
private DHKeyGenerationParameters param;
}
}
@@ -0,0 +1,81 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
{
// Token: 0x02001684 RID: 5764
[Token(Token = "0x2001684")]
[StructLayout(3)]
internal class DHKeyGeneratorHelper
{
// Token: 0x06009A3C RID: 39484 RVA: 0x00225BD0 File Offset: 0x00223DD0
[Token(Token = "0x6009A3C")]
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
private DHKeyGeneratorHelper()
{
}
// Token: 0x06009A3D RID: 39485 RVA: 0x00225BE4 File Offset: 0x00223DE4
[Token(Token = "0x6009A3D")]
[Address(RVA = "0x1F4E4C0", Offset = "0x1F4CEC0", VA = "0x181F4E4C0")]
internal BigInteger CalculatePrivate(DHParameters dhParams, SecureRandom random)
{
int l = dhParams.l;
if (l == 0)
{
int m = dhParams.m;
BigInteger two = BigInteger.Two;
if (m != 0)
{
BigInteger one = BigInteger.One;
int num = m - 1;
BigInteger bigInteger = one.ShiftLeft(num);
}
BigInteger p;
if (dhParams.q == 0)
{
p = dhParams.p;
}
BigInteger two2 = BigInteger.Two;
BigInteger bigInteger2 = p.Subtract(two2);
int bitLength = bigInteger2.BitLength;
BigInteger bigInteger3 = BigIntegers.CreateRandomInRange(two, bigInteger2, random);
int nafWeight = WNafUtilities.GetNafWeight(bigInteger3);
return bigInteger3;
}
BigInteger bigInteger4 = new BigInteger(l, random);
int num2 = l - 1;
int nafWeight2 = WNafUtilities.GetNafWeight(bigInteger4.SetBit(num2));
throw new NullReferenceException();
}
// Token: 0x06009A3E RID: 39486 RVA: 0x00225C88 File Offset: 0x00223E88
[Token(Token = "0x6009A3E")]
[Address(RVA = "0x1F4E6C0", Offset = "0x1F4D0C0", VA = "0x181F4E6C0")]
internal BigInteger CalculatePublic(DHParameters dhParams, BigInteger x)
{
BigInteger g = dhParams.g;
BigInteger p = dhParams.p;
return g.ModPow(x, p);
}
// Token: 0x06009A3F RID: 39487 RVA: 0x00225CB4 File Offset: 0x00223EB4
// Note: this type is marked as 'beforefieldinit'.
[Token(Token = "0x6009A3F")]
[Address(RVA = "0x1F4E6F0", Offset = "0x1F4D0F0", VA = "0x181F4E6F0")]
static DHKeyGeneratorHelper()
{
DHKeyGeneratorHelper dhkeyGeneratorHelper = new DHKeyGeneratorHelper();
}
// Token: 0x04006540 RID: 25920
[Token(Token = "0x4006540")]
internal static readonly DHKeyGeneratorHelper Instance;
}
}
@@ -0,0 +1,60 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
{
// Token: 0x02001685 RID: 5765
[Token(Token = "0x2001685")]
[StructLayout(3)]
public class DHKeyPairGenerator : IAsymmetricCipherKeyPairGenerator
{
// Token: 0x06009A40 RID: 39488 RVA: 0x00225CC8 File Offset: 0x00223EC8
[Token(Token = "0x6009A40")]
[Address(RVA = "0x1F4E8A0", Offset = "0x1F4D2A0", VA = "0x181F4E8A0", Slot = "6")]
public virtual void Init(KeyGenerationParameters parameters)
{
while (parameters != 0)
{
if (parameters != 0)
{
this.param = parameters;
return;
}
}
int num = 0;
this.param = num;
}
// Token: 0x06009A41 RID: 39489 RVA: 0x00225CF0 File Offset: 0x00223EF0
[Token(Token = "0x6009A41")]
[Address(RVA = "0x1F4E750", Offset = "0x1F4D150", VA = "0x181F4E750", Slot = "7")]
public virtual AsymmetricCipherKeyPair GenerateKeyPair()
{
DHKeyGenerationParameters dhkeyGenerationParameters = this.param;
DHParameters parameters = dhkeyGenerationParameters.parameters;
SecureRandom random = dhkeyGenerationParameters.random;
BigInteger g = parameters.g;
BigInteger p = parameters.p;
BigInteger bigInteger;
DHPublicKeyParameters dhpublicKeyParameters = new DHPublicKeyParameters(g.ModPow(bigInteger, p), parameters);
DHPrivateKeyParameters dhprivateKeyParameters = new DHPrivateKeyParameters(bigInteger, parameters);
return new AsymmetricCipherKeyPair(dhpublicKeyParameters, dhprivateKeyParameters);
}
// Token: 0x06009A42 RID: 39490 RVA: 0x00225D4C File Offset: 0x00223F4C
[Token(Token = "0x6009A42")]
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
public DHKeyPairGenerator()
{
}
// Token: 0x04006541 RID: 25921
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006541")]
private DHKeyGenerationParameters param;
}
}
@@ -0,0 +1,68 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
{
// Token: 0x02001686 RID: 5766
[Token(Token = "0x2001686")]
[StructLayout(3)]
public class DHParametersGenerator
{
// Token: 0x06009A43 RID: 39491 RVA: 0x00225D60 File Offset: 0x00223F60
[Token(Token = "0x6009A43")]
[Address(RVA = "0x1F4EA90", Offset = "0x1F4D490", VA = "0x181F4EA90", Slot = "4")]
public virtual void Init(int size, int certainty, SecureRandom random)
{
this.size = size;
this.certainty = certainty;
this.random = random;
}
// Token: 0x06009A44 RID: 39492 RVA: 0x00225D84 File Offset: 0x00223F84
[Token(Token = "0x6009A44")]
[Address(RVA = "0x1F4E940", Offset = "0x1F4D340", VA = "0x181F4E940", Slot = "5")]
public virtual DHParameters GenerateParameters()
{
int num = this.size;
int num2 = this.certainty;
SecureRandom secureRandom = this.random;
BigInteger[] array = DHParametersHelper.GenerateSafePrimes(num, num2, secureRandom);
int length = array.Length;
BigInteger bigInteger = array[0];
BigInteger bigInteger2 = array[1];
SecureRandom secureRandom2 = this.random;
BigInteger bigInteger3 = DHParametersHelper.SelectGenerator(bigInteger, bigInteger2, secureRandom2);
BigInteger two = BigInteger.Two;
int num3;
DHParameters dhparameters = new DHParameters(bigInteger, bigInteger3, bigInteger2, two, num3);
num3 = 0;
return dhparameters;
}
// Token: 0x06009A45 RID: 39493 RVA: 0x00225E04 File Offset: 0x00224004
[Token(Token = "0x6009A45")]
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
public DHParametersGenerator()
{
}
// Token: 0x04006542 RID: 25922
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006542")]
private int size;
// Token: 0x04006543 RID: 25923
[global::Cpp2IlInjected.FieldOffset(Offset = "0x14")]
[Token(Token = "0x4006543")]
private int certainty;
// Token: 0x04006544 RID: 25924
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006544")]
private SecureRandom random;
}
}
@@ -0,0 +1,173 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
{
// Token: 0x02001687 RID: 5767
[Token(Token = "0x2001687")]
[StructLayout(3)]
internal class DHParametersHelper
{
// Token: 0x06009A46 RID: 39494 RVA: 0x00225E18 File Offset: 0x00224018
[Token(Token = "0x6009A46")]
[Address(RVA = "0x1F4EAA0", Offset = "0x1F4D4A0", VA = "0x181F4EAA0")]
private static BigInteger[] ConstructBigPrimeProducts(int[] primeProducts)
{
BigInteger[] array = new BigInteger[primeProducts.Length];
int num = 0;
if (num < array.Length)
{
BigInteger bigInteger = BigInteger.ValueOf((long)primeProducts[num]);
throw new ArrayTypeMismatchException();
}
return array;
}
// Token: 0x06009A47 RID: 39495 RVA: 0x00225E64 File Offset: 0x00224064
[Token(Token = "0x6009A47")]
[Address(RVA = "0x1F4EBA0", Offset = "0x1F4D5A0", VA = "0x181F4EBA0")]
internal static BigInteger[] GenerateSafePrimes(int size, int certainty, SecureRandom random)
{
BigInteger bigInteger9;
BigInteger bigInteger11;
ulong num10;
do
{
int num = size - 1;
if (size > 32)
{
int num2 = 0;
int num3;
BigInteger bigInteger = new BigInteger(certainty, num3, random);
num3 = 0;
int[][] array = DHParametersHelper.primeLists;
BigInteger bigInteger6;
if (num2 < array.Length)
{
BigInteger[] bigPrimeProducts = DHParametersHelper.BigPrimeProducts;
BigInteger bigInteger3;
BigInteger bigInteger2 = bigInteger.Remainder(bigInteger3);
int num4 = 0;
int intValue = bigInteger2.IntValue;
if (num2 == 0 && size != 2)
{
BigInteger bigInteger4 = BigInteger.ValueOf((long)size);
BigInteger bigInteger5 = bigInteger.Add(bigInteger4);
int[] array2 = DHParametersHelper.primeProducts;
}
int[][] array3 = DHParametersHelper.primeLists;
if (num4 != 0 && num4 != random)
{
num2++;
num2++;
}
BigInteger six = DHParametersHelper.Six;
bigInteger6 = bigInteger.Add(six);
}
uint num5;
ulong num6;
if (bigInteger6.BitLength != num || !bigInteger6.RabinMillerTest((int)num5, random, num6 != 0UL))
{
continue;
}
BigInteger bigInteger7 = bigInteger6.ShiftLeft(1);
BigInteger one = BigInteger.One;
BigInteger bigInteger8 = bigInteger7.Add(one);
ulong num7;
ulong num8;
if (!bigInteger8.RabinMillerTest(certainty, random, num7 != 0UL) || (certainty > 2 && !bigInteger6.RabinMillerTest(certainty, random, num8 != 0UL)))
{
continue;
}
int nafWeight = WNafUtilities.GetNafWeight(bigInteger8);
BigInteger[] array4 = new BigInteger[2];
}
bigInteger9 = new BigInteger(certainty, 2, random);
BigInteger bigInteger10 = bigInteger9.ShiftLeft(1);
BigInteger one2 = BigInteger.One;
bigInteger11 = bigInteger10.Add(one2);
ulong num9;
if (!bigInteger11.IsProbablePrime(certainty, num9 != 0UL))
{
break;
}
while (certainty <= 2)
{
}
}
while (bigInteger9.IsProbablePrime(certainty, num10 != 0UL));
uint num11;
BigInteger bigInteger12 = new BigInteger(certainty, (int)num11, random);
bigInteger12.nBitLength = bigInteger11;
if (bigInteger12 != 0)
{
}
return bigInteger12;
}
// Token: 0x06009A48 RID: 39496 RVA: 0x00225FE0 File Offset: 0x002241E0
[Token(Token = "0x6009A48")]
[Address(RVA = "0x1F4F1B0", Offset = "0x1F4DBB0", VA = "0x181F4F1B0")]
internal static BigInteger SelectGenerator(BigInteger p, BigInteger q, SecureRandom random)
{
BigInteger two = BigInteger.Two;
BigInteger bigInteger = p.Subtract(two);
BigInteger bigInteger2 = BigIntegers.CreateRandomInRange(BigInteger.Two, bigInteger, random);
BigInteger two2 = BigInteger.Two;
BigInteger bigInteger3 = bigInteger2.ModPow(two2, p);
while (bigInteger3 != 0)
{
}
return bigInteger3;
}
// Token: 0x06009A49 RID: 39497 RVA: 0x00226028 File Offset: 0x00224228
[Token(Token = "0x6009A49")]
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
public DHParametersHelper()
{
}
// Token: 0x06009A4A RID: 39498 RVA: 0x0022603C File Offset: 0x0022423C
// Note: this type is marked as 'beforefieldinit'.
[Token(Token = "0x6009A4A")]
[Address(RVA = "0x1F4F2F0", Offset = "0x1F4DCF0", VA = "0x181F4F2F0")]
static DHParametersHelper()
{
BigInteger bigInteger;
DHParametersHelper.Six = bigInteger;
DHParametersHelper.primeLists = BigInteger.primeLists;
DHParametersHelper.primeProducts = BigInteger.primeProducts;
int[] array = DHParametersHelper.primeProducts;
BigInteger[] array2 = new BigInteger[array.Length];
int num = 0;
if (num < array2.Length)
{
BigInteger bigInteger2 = BigInteger.ValueOf((long)array[num]);
throw new ArrayTypeMismatchException();
}
DHParametersHelper.BigPrimeProducts = array2;
}
// Token: 0x04006545 RID: 25925
[Token(Token = "0x4006545")]
private static readonly BigInteger Six;
// Token: 0x04006546 RID: 25926
[Token(Token = "0x4006546")]
private static readonly int[][] primeLists;
// Token: 0x04006547 RID: 25927
[Token(Token = "0x4006547")]
private static readonly int[] primeProducts;
// Token: 0x04006548 RID: 25928
[Token(Token = "0x4006548")]
private static readonly BigInteger[] BigPrimeProducts;
}
}
@@ -0,0 +1,82 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
{
// Token: 0x02001688 RID: 5768
[Token(Token = "0x2001688")]
[StructLayout(3)]
public class DesEdeKeyGenerator : DesKeyGenerator
{
// Token: 0x06009A4B RID: 39499 RVA: 0x002260B0 File Offset: 0x002242B0
[Token(Token = "0x6009A4B")]
[Address(RVA = "0x1F4F4B0", Offset = "0x1F4DEB0", VA = "0x181F4F4B0")]
public DesEdeKeyGenerator()
{
}
// Token: 0x06009A4C RID: 39500 RVA: 0x002260C4 File Offset: 0x002242C4
[Token(Token = "0x6009A4C")]
[Address(RVA = "0x1F4F4C0", Offset = "0x1F4DEC0", VA = "0x181F4F4C0")]
internal DesEdeKeyGenerator(int defaultStrength)
: base(defaultStrength)
{
}
// Token: 0x06009A4D RID: 39501 RVA: 0x002260D8 File Offset: 0x002242D8
[Token(Token = "0x6009A4D")]
[Address(RVA = "0x1F4F5A0", Offset = "0x1F4DFA0", VA = "0x181F4F5A0", Slot = "4")]
protected override void engineInit(KeyGenerationParameters parameters)
{
SecureRandom random = parameters.random;
this.random = random;
int num = parameters.strength;
num += 7;
num += parameters;
this.strength = num;
if (num != 0 && num != 21)
{
if (num != 14)
{
num += -16;
if (num != -9)
{
object[] array = new object[5];
throw new NullReferenceException();
}
}
this.strength = (int)((ulong)16L);
return;
}
this.strength = (int)((ulong)24L);
}
// Token: 0x06009A4E RID: 39502 RVA: 0x002261AC File Offset: 0x002243AC
[Token(Token = "0x6009A4E")]
[Address(RVA = "0x1F4F4D0", Offset = "0x1F4DED0", VA = "0x181F4F4D0", Slot = "5")]
protected override byte[] engineGenerateKey()
{
byte[] array;
for (;;)
{
array = new byte[this.strength];
double num = this.random.NextDouble();
DesParameters.SetOddParity(array);
int length = array.Length;
int num2 = 0;
if (!DesEdeParameters.IsWeakKey(array, num2, length))
{
int num3 = 0;
if (DesEdeParameters.IsRealEdeKey(array, num3))
{
break;
}
}
}
return array;
}
}
}
@@ -0,0 +1,75 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
{
// Token: 0x02001689 RID: 5769
[Token(Token = "0x2001689")]
[StructLayout(3)]
public class DesKeyGenerator : CipherKeyGenerator
{
// Token: 0x06009A4F RID: 39503 RVA: 0x00226200 File Offset: 0x00224400
[Token(Token = "0x6009A4F")]
[Address(RVA = "0x1F4F4B0", Offset = "0x1F4DEB0", VA = "0x181F4F4B0")]
public DesKeyGenerator()
{
}
// Token: 0x06009A50 RID: 39504 RVA: 0x00226214 File Offset: 0x00224414
[Token(Token = "0x6009A50")]
[Address(RVA = "0x1F4F4C0", Offset = "0x1F4DEC0", VA = "0x181F4F4C0")]
internal DesKeyGenerator(int defaultStrength)
: base(defaultStrength)
{
}
// Token: 0x06009A51 RID: 39505 RVA: 0x00226228 File Offset: 0x00224428
[Token(Token = "0x6009A51")]
[Address(RVA = "0x1F4F830", Offset = "0x1F4E230", VA = "0x181F4F830", Slot = "4")]
protected override void engineInit(KeyGenerationParameters parameters)
{
/*
An exception occurred when decompiling this method (06009A51)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators.DesKeyGenerator::engineInit(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.KeyGenerationParameters)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_24:
stloc:ArgumentException(var_3_39, newobj:ArgumentException(ArgumentException::.ctor, call:string(string::Concat, ldstr:string[exp:object]("DES key must be "), ldloc:int32[exp:object](var_2), ldstr:string[exp:object](" bits long."))))
}
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: 0x06009A52 RID: 39506 RVA: 0x00226270 File Offset: 0x00224470
[Token(Token = "0x6009A52")]
[Address(RVA = "0x1F4F780", Offset = "0x1F4E180", VA = "0x181F4F780", Slot = "5")]
protected override byte[] engineGenerateKey()
{
byte[] array;
int num2;
do
{
array = new byte[8];
double num = this.random.NextDouble();
DesParameters.SetOddParity(array);
num2 = 0;
}
while (DesParameters.IsWeakKey(array, num2));
return array;
}
}
}
@@ -0,0 +1,101 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
{
// Token: 0x0200168A RID: 5770
[Token(Token = "0x200168A")]
[StructLayout(3)]
public class DsaKeyPairGenerator : IAsymmetricCipherKeyPairGenerator
{
// Token: 0x06009A53 RID: 39507 RVA: 0x002262AC File Offset: 0x002244AC
[Token(Token = "0x6009A53")]
[Address(RVA = "0x1F50040", Offset = "0x1F4EA40", VA = "0x181F50040", Slot = "4")]
public void Init(KeyGenerationParameters parameters)
{
/*
An exception occurred when decompiling this method (06009A53)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators.DsaKeyPairGenerator::Init(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.KeyGenerationParameters)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_12:
stloc:ArgumentNullException(var_1_1C, newobj:ArgumentNullException(ArgumentNullException::.ctor, ldstr:string("parameters")))
}
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: 0x06009A54 RID: 39508 RVA: 0x002262D8 File Offset: 0x002244D8
[Token(Token = "0x6009A54")]
[Address(RVA = "0x1F4FD60", Offset = "0x1F4E760", VA = "0x181F4FD60", Slot = "5")]
public AsymmetricCipherKeyPair GenerateKeyPair()
{
DsaKeyGenerationParameters dsaKeyGenerationParameters = this.param;
DsaParameters parameters = dsaKeyGenerationParameters.parameters;
BigInteger q = parameters.q;
SecureRandom random = dsaKeyGenerationParameters.random;
int bitLength = q.BitLength;
BigInteger one = DsaKeyPairGenerator.One;
BigInteger bigInteger = q.Subtract(one);
BigInteger bigInteger2 = BigIntegers.CreateRandomInRange(one, bigInteger, random);
int nafWeight = WNafUtilities.GetNafWeight(bigInteger2);
BigInteger g = parameters.g;
BigInteger p = parameters.p;
DsaPublicKeyParameters dsaPublicKeyParameters = new DsaPublicKeyParameters(g.ModPow(bigInteger2, p), parameters);
DsaPrivateKeyParameters dsaPrivateKeyParameters = new DsaPrivateKeyParameters(bigInteger2, parameters);
return new AsymmetricCipherKeyPair(dsaPublicKeyParameters, dsaPrivateKeyParameters);
}
// Token: 0x06009A55 RID: 39509 RVA: 0x0022636C File Offset: 0x0022456C
[Token(Token = "0x6009A55")]
[Address(RVA = "0x1F4FF50", Offset = "0x1F4E950", VA = "0x181F4FF50")]
private static BigInteger GeneratePrivateKey(BigInteger q, SecureRandom random)
{
int bitLength = q.BitLength;
BigInteger one = DsaKeyPairGenerator.One;
BigInteger bigInteger = q.Subtract(one);
BigInteger bigInteger2 = BigIntegers.CreateRandomInRange(one, bigInteger, random);
int nafWeight = WNafUtilities.GetNafWeight(bigInteger2);
return bigInteger2;
}
// Token: 0x06009A56 RID: 39510 RVA: 0x002263A8 File Offset: 0x002245A8
[Token(Token = "0x6009A56")]
[Address(RVA = "0x65C140", Offset = "0x65AB40", VA = "0x18065C140")]
private static BigInteger CalculatePublicKey(BigInteger p, BigInteger g, BigInteger x)
{
return g.ModPow(x, p);
}
// Token: 0x06009A57 RID: 39511 RVA: 0x002263C4 File Offset: 0x002245C4
[Token(Token = "0x6009A57")]
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
public DsaKeyPairGenerator()
{
}
// Token: 0x04006549 RID: 25929
[Token(Token = "0x4006549")]
private static readonly BigInteger One = BigInteger.One;
// Token: 0x0400654A RID: 25930
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x400654A")]
private DsaKeyGenerationParameters param;
}
}
@@ -0,0 +1,349 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
{
// Token: 0x0200168B RID: 5771
[Token(Token = "0x200168B")]
[StructLayout(3)]
public class DsaParametersGenerator
{
// Token: 0x06009A59 RID: 39513 RVA: 0x002263F0 File Offset: 0x002245F0
[Token(Token = "0x6009A59")]
[Address(RVA = "0x1F51740", Offset = "0x1F50140", VA = "0x181F51740")]
public DsaParametersGenerator()
{
Sha1Digest sha1Digest = new Sha1Digest();
base..ctor();
this.digest = sha1Digest;
}
// Token: 0x06009A5A RID: 39514 RVA: 0x00226410 File Offset: 0x00224610
[Token(Token = "0x6009A5A")]
[Address(RVA = "0x3C3A30", Offset = "0x3C2430", VA = "0x1803C3A30")]
public DsaParametersGenerator(IDigest digest)
{
this.digest = digest;
}
// Token: 0x06009A5B RID: 39515 RVA: 0x0022642C File Offset: 0x0022462C
[Token(Token = "0x6009A5B")]
[Address(RVA = "0x1F513F0", Offset = "0x1F4FDF0", VA = "0x181F513F0", Slot = "4")]
public virtual void Init(int size, int certainty, SecureRandom random)
{
/*
An exception occurred when decompiling this method (06009A5B)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators.DsaParametersGenerator::Init(System.Int32,System.Int32,BestHTTP.SecureProtocol.Org.BouncyCastle.Security.SecureRandom)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_2E:
stloc:ArgumentException(var_0_3D, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("size must be from 512 - 1024 and a multiple of 64"), ldstr:string("size")))
}
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: 0x06009A5C RID: 39516 RVA: 0x00226478 File Offset: 0x00224678
[Token(Token = "0x6009A5C")]
[Address(RVA = "0x1F514B0", Offset = "0x1F4FEB0", VA = "0x181F514B0", Slot = "5")]
public virtual void Init(DsaParameterGenerationParameters parameters)
{
/*
An exception occurred when decompiling this method (06009A5C)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators.DsaParametersGenerator::Init(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters.DsaParameterGenerationParameters)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_D8:
stloc:ArgumentException(var_9_E2, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("N must be 256 for L = 3072")))
}
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: 0x06009A5D RID: 39517 RVA: 0x00226568 File Offset: 0x00224768
[Token(Token = "0x6009A5D")]
[Address(RVA = "0x1F512B0", Offset = "0x1F4FCB0", VA = "0x181F512B0", Slot = "6")]
public virtual DsaParameters GenerateParameters()
{
/*
An exception occurred when decompiling this method (06009A5D)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters.DsaParameters BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators.DsaParametersGenerator::GenerateParameters()
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_00:
brtrue(IL_00, logicnot:bool(ldfld:bool(DsaParametersGenerator::use186_3, ldloc:DsaParametersGenerator(this))))
}
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: 0x06009A5E RID: 39518 RVA: 0x00226580 File Offset: 0x00224780
[Token(Token = "0x6009A5E")]
[Address(RVA = "0x1F50590", Offset = "0x1F4EF90", VA = "0x181F50590", Slot = "7")]
protected virtual DsaParameters GenerateParameters_FIPS186_2()
{
/*
An exception occurred when decompiling this method (06009A5E)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters.DsaParameters BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators.DsaParametersGenerator::GenerateParameters_FIPS186_2()
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_233:
stloc:InvalidOperationException(var_58_23D, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("can only use SHA-1 for generating FIPS 186-2 parameters")))
}
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: 0x06009A5F RID: 39519 RVA: 0x002267CC File Offset: 0x002249CC
[Token(Token = "0x6009A5F")]
[Address(RVA = "0x1F50170", Offset = "0x1F4EB70", VA = "0x181F50170", Slot = "8")]
protected virtual BigInteger CalculateGenerator_FIPS186_2(BigInteger p, BigInteger q, SecureRandom r)
{
BigInteger bigInteger3;
do
{
BigInteger one = BigInteger.One;
BigInteger bigInteger = p.Subtract(one).Divide(q);
BigInteger two = BigInteger.Two;
BigInteger bigInteger2 = p.Subtract(two);
bigInteger3 = BigIntegers.CreateRandomInRange(BigInteger.Two, bigInteger2, r).ModPow(bigInteger, p);
}
while (bigInteger3.BitLength <= 1);
return bigInteger3;
}
// Token: 0x06009A60 RID: 39520 RVA: 0x00226824 File Offset: 0x00224A24
[Token(Token = "0x6009A60")]
[Address(RVA = "0x1F50CA0", Offset = "0x1F4F6A0", VA = "0x181F50CA0", Slot = "9")]
protected virtual DsaParameters GenerateParameters_FIPS186_3()
{
IDigest digest = this.digest;
int n = this.N;
byte[] array = new byte[0];
int l = this.L;
byte[] array2 = new byte[l];
double num = this.random.NextDouble();
int length = array.Length;
BigInteger bigInteger = new BigInteger(1, array2);
BigInteger one = BigInteger.One;
int n2 = this.N;
BigInteger bigInteger2 = one.ShiftLeft(n2);
BigInteger bigInteger3 = bigInteger.Mod(bigInteger2);
int num2 = 0;
BigInteger bigInteger4 = bigInteger3.SetBit(num2);
int n3 = this.N;
BigInteger bigInteger5 = bigInteger4.SetBit(n3);
int num3 = this.certainty;
if (bigInteger5.IsProbablePrime(num3))
{
byte[] array3 = Arrays.Clone(array);
int num4 = 0;
if (this.L > 0)
{
int i = 0;
int num5 = 0;
BigInteger zero = BigInteger.Zero;
DsaParametersGenerator.Inc(array3);
DsaParametersGenerator.Hash(digest, array3, array2);
BigInteger bigInteger6 = new BigInteger(1, array2);
if (i == l)
{
BigInteger one2 = BigInteger.One;
BigInteger bigInteger8;
BigInteger bigInteger7 = bigInteger6.Mod(bigInteger8);
}
BigInteger bigInteger9 = bigInteger6.ShiftLeft(num5);
BigInteger bigInteger10 = zero.Add(bigInteger9);
i++;
while (i <= l)
{
}
BigInteger one3 = BigInteger.One;
int l2 = this.L;
BigInteger bigInteger11 = one3.ShiftLeft(l2);
BigInteger bigInteger12 = bigInteger10.Add(bigInteger11);
BigInteger bigInteger13 = bigInteger5.ShiftLeft(1);
BigInteger bigInteger14 = bigInteger12.Mod(bigInteger13);
BigInteger one4 = BigInteger.One;
BigInteger bigInteger15 = bigInteger14.Subtract(one4);
BigInteger bigInteger16 = bigInteger12.Subtract(bigInteger15);
if (bigInteger16.BitLength == this.L)
{
int num6 = this.certainty;
if (bigInteger16.IsProbablePrime(num6))
{
goto IL_19F;
}
}
num4++;
}
}
SecureRandom secureRandom = this.random;
IL_19F:
if (this.usageIndex != 0)
{
DsaParameters dsaParameters;
return dsaParameters;
}
throw new NullReferenceException();
}
// Token: 0x06009A61 RID: 39521 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x6009A61")]
[Address(RVA = "0x1F502C0", Offset = "0x1F4ECC0", VA = "0x181F502C0", Slot = "10")]
protected virtual BigInteger CalculateGenerator_FIPS186_3_Unverifiable(BigInteger p, BigInteger q, SecureRandom r)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x06009A62 RID: 39522 RVA: 0x002269E4 File Offset: 0x00224BE4
[Token(Token = "0x6009A62")]
[Address(RVA = "0x1F502E0", Offset = "0x1F4ECE0", VA = "0x181F502E0", Slot = "11")]
protected virtual BigInteger CalculateGenerator_FIPS186_3_Verifiable(IDigest d, BigInteger p, BigInteger q, byte[] seed, int index)
{
BigInteger one = BigInteger.One;
BigInteger bigInteger = p.Subtract(one).Divide(q);
byte[] array = Hex.Decode("6767656E");
int num = array.Length;
num += 3;
byte[] array2 = new byte[num];
int num2 = 0;
int length = array.Length;
int num3 = 0;
Array.Copy(array, num3, array2, num2, length);
int length2 = array2.Length;
byte[] array3 = new byte[0];
if (array2.Length == array2.Length)
{
}
DsaParametersGenerator.Hash(d, array2, array3);
BigInteger bigInteger2 = new BigInteger(1, array3).ModPow(bigInteger, p);
BigInteger two = BigInteger.Two;
int num4 = bigInteger2.CompareTo(two);
uint num5;
num5 += (uint)1;
throw new NullReferenceException();
}
// Token: 0x06009A63 RID: 39523 RVA: 0x00226AA0 File Offset: 0x00224CA0
[Token(Token = "0x6009A63")]
[Address(RVA = "0x1F51710", Offset = "0x1F50110", VA = "0x181F51710")]
private static bool IsValidDsaStrength(int strength)
{
return strength == 0;
}
// Token: 0x06009A64 RID: 39524 RVA: 0x00226AB4 File Offset: 0x00224CB4
[Token(Token = "0x6009A64")]
[Address(RVA = "0x1F51300", Offset = "0x1F4FD00", VA = "0x181F51300")]
protected static void Hash(IDigest d, byte[] input, byte[] output)
{
int length = input.Length;
}
// Token: 0x06009A65 RID: 39525 RVA: 0x00226AD0 File Offset: 0x00224CD0
[Token(Token = "0x6009A65")]
[Address(RVA = "0x1F512E0", Offset = "0x1F4FCE0", VA = "0x181F512E0")]
private static int GetDefaultN(int L)
{
return 256;
}
// Token: 0x06009A66 RID: 39526 RVA: 0x00226AE4 File Offset: 0x00224CE4
[Token(Token = "0x6009A66")]
[Address(RVA = "0x1F513A0", Offset = "0x1F4FDA0", VA = "0x181F513A0")]
protected static void Inc(byte[] buf)
{
if (buf.Length == buf.Length)
{
}
}
// Token: 0x0400654B RID: 25931
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x400654B")]
private IDigest digest;
// Token: 0x0400654C RID: 25932
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x400654C")]
private int L;
// Token: 0x0400654D RID: 25933
[global::Cpp2IlInjected.FieldOffset(Offset = "0x1C")]
[Token(Token = "0x400654D")]
private int N;
// Token: 0x0400654E RID: 25934
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x400654E")]
private int certainty;
// Token: 0x0400654F RID: 25935
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x400654F")]
private SecureRandom random;
// Token: 0x04006550 RID: 25936
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
[Token(Token = "0x4006550")]
private bool use186_3;
// Token: 0x04006551 RID: 25937
[global::Cpp2IlInjected.FieldOffset(Offset = "0x34")]
[Token(Token = "0x4006551")]
private int usageIndex;
}
}
@@ -0,0 +1,228 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.EC;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
{
// Token: 0x0200168C RID: 5772
[Token(Token = "0x200168C")]
[StructLayout(3)]
public class ECKeyPairGenerator : IAsymmetricCipherKeyPairGenerator
{
// Token: 0x06009A67 RID: 39527 RVA: 0x00226B08 File Offset: 0x00224D08
[Token(Token = "0x6009A67")]
[Address(RVA = "0x1F520C0", Offset = "0x1F50AC0", VA = "0x181F520C0")]
public ECKeyPairGenerator()
{
/*
An exception occurred when decompiling this method (06009A67)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators.ECKeyPairGenerator::.ctor()
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_21:
stloc:ArgumentNullException(var_1_2B, newobj:ArgumentNullException(ArgumentNullException::.ctor, ldstr:string("algorithm")))
}
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: 0x06009A68 RID: 39528 RVA: 0x00226B40 File Offset: 0x00224D40
[Token(Token = "0x6009A68")]
[Address(RVA = "0x1F52010", Offset = "0x1F50A10", VA = "0x181F52010")]
public ECKeyPairGenerator(string algorithm)
{
/*
An exception occurred when decompiling this method (06009A68)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators.ECKeyPairGenerator::.ctor(System.String)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_19:
stloc:ArgumentNullException(var_1_23, newobj:ArgumentNullException(ArgumentNullException::.ctor, ldstr:string("algorithm")))
}
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: 0x06009A69 RID: 39529 RVA: 0x00226B70 File Offset: 0x00224D70
[Token(Token = "0x6009A69")]
[Address(RVA = "0x1F51C30", Offset = "0x1F50630", VA = "0x181F51C30", Slot = "4")]
public void Init(KeyGenerationParameters parameters)
{
do
{
if (parameters == 0)
{
int strength = parameters.strength;
if (strength <= 239 || strength == 256)
{
}
DerObjectIdentifier prime239v = X9ObjectIdentifiers.Prime239v1;
X9ECParameters byOid;
if (CustomNamedCurves.GetByOid(prime239v) == 0)
{
byOid = ECNamedCurveTable.GetByOid(prime239v);
}
this.publicKeyParamSet = prime239v;
ECCurve curve = byOid.curve;
ECPoint g = byOid.G;
BigInteger n = byOid.n;
BigInteger h = byOid.h;
byte[] seed = byOid.seed;
ECDomainParameters ecdomainParameters = new ECDomainParameters(curve, g, n, h, seed);
}
}
while (parameters == 0);
if (parameters.random == 0)
{
SecureRandom secureRandom = new SecureRandom();
}
}
// Token: 0x06009A6A RID: 39530 RVA: 0x00226C24 File Offset: 0x00224E24
[Token(Token = "0x6009A6A")]
[Address(RVA = "0x1F51860", Offset = "0x1F50260", VA = "0x181F51860", Slot = "5")]
public AsymmetricCipherKeyPair GenerateKeyPair()
{
BigInteger n = this.parameters.n;
int bitLength = n.BitLength;
int bitLength2 = n.BitLength;
SecureRandom secureRandom = this.random;
BigInteger bigInteger = new BigInteger(bitLength2, secureRandom);
BigInteger two = BigInteger.Two;
int num = bigInteger.CompareTo(two);
int num2 = 0;
int num3 = bigInteger.CompareTo(n);
int nafWeight = WNafUtilities.GetNafWeight(bigInteger);
AsymmetricCipherKeyPair asymmetricCipherKeyPair = this.GenerateKeyPair();
ECDomainParameters ecdomainParameters = this.parameters;
int num4 = 0;
if (num4 < num2)
{
num4 += num4;
num4++;
}
ECPrivateKeyParameters ecprivateKeyParameters;
if (this.publicKeyParamSet == 0)
{
string text = this.algorithm;
ECDomainParameters ecdomainParameters2 = this.parameters;
ecprivateKeyParameters = new ECPrivateKeyParameters(text, bigInteger, ecdomainParameters2);
text += text;
}
string text2 = this.algorithm;
DerObjectIdentifier derObjectIdentifier = this.publicKeyParamSet;
ECPrivateKeyParameters ecprivateKeyParameters2 = new ECPrivateKeyParameters(text2, bigInteger, derObjectIdentifier);
return new AsymmetricCipherKeyPair(ecprivateKeyParameters, ecprivateKeyParameters2);
}
// Token: 0x06009A6B RID: 39531 RVA: 0x00226D04 File Offset: 0x00224F04
[Token(Token = "0x6009A6B")]
[Address(RVA = "0x1F517A0", Offset = "0x1F501A0", VA = "0x181F517A0", Slot = "6")]
protected virtual ECMultiplier CreateBasePointMultiplier()
{
/*
An exception occurred when decompiling this method (06009A6B)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier.ECMultiplier BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators.ECKeyPairGenerator::CreateBasePointMultiplier()
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:FixedPointCombMultiplier(var_0_05, newobj:FixedPointCombMultiplier(FixedPointCombMultiplier::.ctor))
}
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: 0x06009A6C RID: 39532 RVA: 0x00226D18 File Offset: 0x00224F18
[Token(Token = "0x6009A6C")]
[Address(RVA = "0x1F517F0", Offset = "0x1F501F0", VA = "0x181F517F0")]
internal static X9ECParameters FindECCurveByOid(DerObjectIdentifier oid)
{
X9ECParameters byOid = CustomNamedCurves.GetByOid(oid);
if (byOid == 0)
{
return ECNamedCurveTable.GetByOid(oid);
}
return byOid;
}
// Token: 0x06009A6D RID: 39533 RVA: 0x00226D38 File Offset: 0x00224F38
[Token(Token = "0x6009A6D")]
[Address(RVA = "0x1F51B30", Offset = "0x1F50530", VA = "0x181F51B30")]
internal static ECPublicKeyParameters GetCorrespondingPublicKey(ECPrivateKeyParameters privKey)
{
ECDomainParameters ecdomainParameters = privKey.parameters;
FixedPointCombMultiplier fixedPointCombMultiplier = new FixedPointCombMultiplier();
BigInteger d = privKey.d;
ECPoint g = ecdomainParameters.g;
ECPoint ecpoint = fixedPointCombMultiplier.Multiply(g, d);
DerObjectIdentifier derObjectIdentifier = privKey.publicKeyParamSet;
ECPublicKeyParameters ecpublicKeyParameters = new ECPublicKeyParameters(privKey.algorithm, ecpoint, ecdomainParameters);
if (derObjectIdentifier == 0)
{
return ecpublicKeyParameters;
}
throw new NullReferenceException();
}
// Token: 0x04006552 RID: 25938
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006552")]
private readonly string algorithm;
// Token: 0x04006553 RID: 25939
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006553")]
private ECDomainParameters parameters;
// Token: 0x04006554 RID: 25940
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x4006554")]
private DerObjectIdentifier publicKeyParamSet;
// Token: 0x04006555 RID: 25941
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x4006555")]
private SecureRandom random;
}
}
@@ -0,0 +1,44 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
{
// Token: 0x0200168D RID: 5773
[Token(Token = "0x200168D")]
[StructLayout(3)]
public class Ed25519KeyPairGenerator : IAsymmetricCipherKeyPairGenerator
{
// Token: 0x06009A6E RID: 39534 RVA: 0x00226D90 File Offset: 0x00224F90
[Token(Token = "0x6009A6E")]
[Address(RVA = "0x14EC8F0", Offset = "0x14EB2F0", VA = "0x1814EC8F0", Slot = "6")]
public virtual void Init(KeyGenerationParameters parameters)
{
SecureRandom secureRandom = parameters.random;
this.random = secureRandom;
}
// Token: 0x06009A6F RID: 39535 RVA: 0x00226DB4 File Offset: 0x00224FB4
[Token(Token = "0x6009A6F")]
[Address(RVA = "0x1F52190", Offset = "0x1F50B90", VA = "0x181F52190", Slot = "7")]
public virtual AsymmetricCipherKeyPair GenerateKeyPair()
{
Ed25519PrivateKeyParameters ed25519PrivateKeyParameters = new Ed25519PrivateKeyParameters(this.random);
return new AsymmetricCipherKeyPair(ed25519PrivateKeyParameters.GeneratePublicKey(), ed25519PrivateKeyParameters);
}
// Token: 0x06009A70 RID: 39536 RVA: 0x00226DE0 File Offset: 0x00224FE0
[Token(Token = "0x6009A70")]
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
public Ed25519KeyPairGenerator()
{
}
// Token: 0x04006556 RID: 25942
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006556")]
private SecureRandom random;
}
}
@@ -0,0 +1,44 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
{
// Token: 0x0200168E RID: 5774
[Token(Token = "0x200168E")]
[StructLayout(3)]
public class Ed448KeyPairGenerator : IAsymmetricCipherKeyPairGenerator
{
// Token: 0x06009A71 RID: 39537 RVA: 0x00226DF4 File Offset: 0x00224FF4
[Token(Token = "0x6009A71")]
[Address(RVA = "0x14EC8F0", Offset = "0x14EB2F0", VA = "0x1814EC8F0", Slot = "6")]
public virtual void Init(KeyGenerationParameters parameters)
{
SecureRandom secureRandom = parameters.random;
this.random = secureRandom;
}
// Token: 0x06009A72 RID: 39538 RVA: 0x00226E18 File Offset: 0x00225018
[Token(Token = "0x6009A72")]
[Address(RVA = "0x1F52230", Offset = "0x1F50C30", VA = "0x181F52230", Slot = "7")]
public virtual AsymmetricCipherKeyPair GenerateKeyPair()
{
Ed448PrivateKeyParameters ed448PrivateKeyParameters = new Ed448PrivateKeyParameters(this.random);
return new AsymmetricCipherKeyPair(ed448PrivateKeyParameters.GeneratePublicKey(), ed448PrivateKeyParameters);
}
// Token: 0x06009A73 RID: 39539 RVA: 0x00226E44 File Offset: 0x00225044
[Token(Token = "0x6009A73")]
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
public Ed448KeyPairGenerator()
{
}
// Token: 0x04006557 RID: 25943
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006557")]
private SecureRandom random;
}
}
@@ -0,0 +1,67 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
{
// Token: 0x0200168F RID: 5775
[Token(Token = "0x200168F")]
[StructLayout(3)]
public class ElGamalKeyPairGenerator : IAsymmetricCipherKeyPairGenerator
{
// Token: 0x06009A74 RID: 39540 RVA: 0x00226E58 File Offset: 0x00225058
[Token(Token = "0x6009A74")]
[Address(RVA = "0x1F52470", Offset = "0x1F50E70", VA = "0x181F52470", Slot = "4")]
public void Init(KeyGenerationParameters parameters)
{
while (parameters != 0)
{
if (parameters != 0)
{
this.param = parameters;
return;
}
}
int num = 0;
this.param = num;
}
// Token: 0x06009A75 RID: 39541 RVA: 0x00226E80 File Offset: 0x00225080
[Token(Token = "0x6009A75")]
[Address(RVA = "0x1F522D0", Offset = "0x1F50CD0", VA = "0x181F522D0", Slot = "5")]
public AsymmetricCipherKeyPair GenerateKeyPair()
{
ElGamalParameters parameters = this.param.parameters;
BigInteger p = parameters.p;
BigInteger g = parameters.g;
int l = parameters.l;
int num;
int num2;
DHParameters dhparameters = new DHParameters(p, g, num, num2, l);
num = 0;
num2 = 0;
SecureRandom random = this.param.random;
BigInteger g2 = dhparameters.g;
BigInteger p2 = dhparameters.p;
BigInteger bigInteger;
ElGamalPublicKeyParameters elGamalPublicKeyParameters = new ElGamalPublicKeyParameters(g2.ModPow(bigInteger, p2), parameters);
ElGamalPrivateKeyParameters elGamalPrivateKeyParameters = new ElGamalPrivateKeyParameters(bigInteger, parameters);
return new AsymmetricCipherKeyPair(elGamalPublicKeyParameters, elGamalPrivateKeyParameters);
}
// Token: 0x06009A76 RID: 39542 RVA: 0x00226F10 File Offset: 0x00225110
[Token(Token = "0x6009A76")]
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
public ElGamalKeyPairGenerator()
{
}
// Token: 0x04006558 RID: 25944
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006558")]
private ElGamalKeyGenerationParameters param;
}
}
@@ -0,0 +1,64 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
{
// Token: 0x02001690 RID: 5776
[Token(Token = "0x2001690")]
[StructLayout(3)]
public class ElGamalParametersGenerator
{
// Token: 0x06009A77 RID: 39543 RVA: 0x00226F24 File Offset: 0x00225124
[Token(Token = "0x6009A77")]
[Address(RVA = "0x1F4EA90", Offset = "0x1F4D490", VA = "0x181F4EA90")]
public void Init(int size, int certainty, SecureRandom random)
{
this.size = size;
this.certainty = certainty;
this.random = random;
}
// Token: 0x06009A78 RID: 39544 RVA: 0x00226F48 File Offset: 0x00225148
[Token(Token = "0x6009A78")]
[Address(RVA = "0x1F52510", Offset = "0x1F50F10", VA = "0x181F52510")]
public ElGamalParameters GenerateParameters()
{
int num = this.size;
int num2 = this.certainty;
SecureRandom secureRandom = this.random;
BigInteger[] array = DHParametersHelper.GenerateSafePrimes(num, num2, secureRandom);
int length = array.Length;
BigInteger bigInteger = array[0];
SecureRandom secureRandom2 = this.random;
BigInteger bigInteger2 = array[1];
BigInteger bigInteger3 = DHParametersHelper.SelectGenerator(bigInteger, bigInteger2, secureRandom2);
return new ElGamalParameters(bigInteger, bigInteger3);
}
// Token: 0x06009A79 RID: 39545 RVA: 0x00226FB4 File Offset: 0x002251B4
[Token(Token = "0x6009A79")]
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
public ElGamalParametersGenerator()
{
}
// Token: 0x04006559 RID: 25945
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006559")]
private int size;
// Token: 0x0400655A RID: 25946
[global::Cpp2IlInjected.FieldOffset(Offset = "0x14")]
[Token(Token = "0x400655A")]
private int certainty;
// Token: 0x0400655B RID: 25947
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x400655B")]
private SecureRandom random;
}
}
@@ -0,0 +1,76 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
{
// Token: 0x02001691 RID: 5777
[Token(Token = "0x2001691")]
[StructLayout(3)]
public class Gost3410KeyPairGenerator : IAsymmetricCipherKeyPairGenerator
{
// Token: 0x06009A7A RID: 39546 RVA: 0x00226FC8 File Offset: 0x002251C8
[Token(Token = "0x6009A7A")]
[Address(RVA = "0x1F52820", Offset = "0x1F51220", VA = "0x181F52820", Slot = "4")]
public void Init(KeyGenerationParameters parameters)
{
if (parameters == 0)
{
SecureRandom random = parameters.random;
DerObjectIdentifier gostR3410x94CryptoProA = CryptoProObjectIdentifiers.GostR3410x94CryptoProA;
Gost3410KeyGenerationParameters gost3410KeyGenerationParameters = new Gost3410KeyGenerationParameters(random, gostR3410x94CryptoProA);
BigInteger p = gost3410KeyGenerationParameters.parameters.p;
int bitLength = p.BitLength;
this.param = gost3410KeyGenerationParameters;
return;
}
this.param = 0;
}
// Token: 0x06009A7B RID: 39547 RVA: 0x0022702C File Offset: 0x0022522C
[Token(Token = "0x6009A7B")]
[Address(RVA = "0x1F52610", Offset = "0x1F51010", VA = "0x181F52610", Slot = "5")]
public AsymmetricCipherKeyPair GenerateKeyPair()
{
Gost3410KeyGenerationParameters gost3410KeyGenerationParameters = this.param;
Gost3410Parameters parameters = gost3410KeyGenerationParameters.parameters;
SecureRandom random = gost3410KeyGenerationParameters.random;
BigInteger q = parameters.q;
BigInteger bigInteger = new BigInteger(256, random);
int num = bigInteger.CompareTo(q);
int nafWeight = WNafUtilities.GetNafWeight(bigInteger);
BigInteger a = parameters.a;
BigInteger p = parameters.p;
BigInteger bigInteger2 = a.ModPow(bigInteger, p);
DerObjectIdentifier publicKeyParamSet = this.param.publicKeyParamSet;
if (publicKeyParamSet == 0)
{
Gost3410PublicKeyParameters gost3410PublicKeyParameters = new Gost3410PublicKeyParameters(bigInteger2, parameters);
Gost3410PrivateKeyParameters gost3410PrivateKeyParameters = new Gost3410PrivateKeyParameters(bigInteger, parameters);
return new AsymmetricCipherKeyPair(gost3410PublicKeyParameters, gost3410PrivateKeyParameters);
}
Gost3410PublicKeyParameters gost3410PublicKeyParameters2 = new Gost3410PublicKeyParameters(bigInteger2, publicKeyParamSet);
DerObjectIdentifier publicKeyParamSet2 = this.param.publicKeyParamSet;
Gost3410PrivateKeyParameters gost3410PrivateKeyParameters2 = new Gost3410PrivateKeyParameters(bigInteger, publicKeyParamSet2);
throw new NullReferenceException();
}
// Token: 0x06009A7C RID: 39548 RVA: 0x002270EC File Offset: 0x002252EC
[Token(Token = "0x6009A7C")]
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
public Gost3410KeyPairGenerator()
{
}
// Token: 0x0400655C RID: 25948
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x400655C")]
private Gost3410KeyGenerationParameters param;
}
}
@@ -0,0 +1,337 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
{
// Token: 0x02001692 RID: 5778
[Token(Token = "0x2001692")]
[StructLayout(3)]
public class Gost3410ParametersGenerator
{
// Token: 0x06009A7D RID: 39549 RVA: 0x00227100 File Offset: 0x00225300
[Token(Token = "0x6009A7D")]
[Address(RVA = "0x1F4EA90", Offset = "0x1F4D490", VA = "0x181F4EA90")]
public void Init(int size, int typeProcedure, SecureRandom random)
{
this.size = size;
this.typeproc = typeProcedure;
this.init_random = random;
}
// Token: 0x06009A7E RID: 39550 RVA: 0x00227124 File Offset: 0x00225324
[Token(Token = "0x6009A7E")]
[Address(RVA = "0x1F52CC0", Offset = "0x1F516C0", VA = "0x181F52CC0")]
private int procedure_A(int x0, int c, BigInteger[] pq, int size)
{
if (x0 > 65536)
{
SecureRandom secureRandom = this.init_random;
}
if (c > 65536 || c == 65536)
{
SecureRandom secureRandom2 = this.init_random;
}
BigInteger bigInteger = BigInteger.ValueOf((long)c);
uint num;
BigInteger bigInteger2 = BigInteger.ValueOf((long)num);
BigInteger[] array = new BigInteger[1];
BigInteger bigInteger3 = BigInteger.ValueOf((long)x0);
if (bigInteger3 != 0)
{
}
array[0] = bigInteger3;
int[] array2 = new int[1];
int num2 = 0;
int num3 = array2.Length;
num3++;
int[] array3 = new int[num3];
int length = array2.Length;
int num4 = 0;
int num5 = 0;
Array.Copy(array2, num5, array3, num4, length);
int[] array4 = new int[array3.Length];
int length2 = array3.Length;
int num6 = 0;
int num7 = 0;
Array.Copy(array3, num7, array4, num6, length2);
int length3 = array4.Length;
int num8 = array4[num2];
num8 -= num7;
array4[0] = num8;
BigInteger[] array5 = new BigInteger[num7];
BigInteger bigInteger4 = new BigInteger("8003", 16);
if (bigInteger4 != 0)
{
}
array5[0] = bigInteger4;
if (1 <= 0)
{
throw new NullReferenceException();
}
int num9 = array4[num2];
BigInteger[] array6 = new BigInteger[array.Length];
int length4 = array.Length;
int num10 = 0;
int num11 = 0;
int num12 = 0;
Array.Copy(array, num12, array6, num11, length4);
BigInteger[] array7 = new BigInteger[num9 + 1];
int length5 = array6.Length;
int num13 = 0;
int num14 = 0;
Array.Copy(array6, num14, array7, num13, length5);
if (num9 > 0)
{
BigInteger bigInteger5 = array7[num10].Multiply(bigInteger2).Add(bigInteger);
BigInteger bigInteger6 = BigInteger.Two.Pow(16);
BigInteger bigInteger7 = bigInteger5.Mod(bigInteger6);
throw new ArrayTypeMismatchException();
}
int num15 = 0;
BigInteger zero = BigInteger.Zero;
if (num9 > 0)
{
BigInteger bigInteger8 = array7[num15].ShiftLeft(num15);
BigInteger bigInteger9 = zero.Add(bigInteger8);
num15++;
}
BigInteger bigInteger10 = array7[num9];
throw new ArrayTypeMismatchException();
}
// Token: 0x06009A7F RID: 39551 RVA: 0x00227468 File Offset: 0x00225668
[Token(Token = "0x6009A7F")]
[Address(RVA = "0x1F537C0", Offset = "0x1F521C0", VA = "0x181F537C0")]
private long procedure_Aa(long x0, long c, BigInteger[] pq, int size)
{
ulong num;
if (x0 > (long)num)
{
SecureRandom secureRandom = this.init_random;
}
if (c > (long)num || c == (long)num)
{
SecureRandom secureRandom2 = this.init_random;
}
uint num2;
BigInteger bigInteger = BigInteger.ValueOf((long)num2);
BigInteger[] array = new BigInteger[1];
BigInteger bigInteger2;
if (bigInteger2 != 0)
{
}
array[0] = bigInteger2;
int[] array2 = new int[1];
int num3 = 0;
int num4 = array2.Length;
num4++;
int[] array3 = new int[num4];
int length = array2.Length;
int num5 = 0;
int num6 = 0;
Array.Copy(array2, num6, array3, num5, length);
int[] array4 = new int[array3.Length];
int length2 = array3.Length;
int num7 = 0;
int num8 = 0;
Array.Copy(array3, num8, array4, num7, length2);
int length3 = array4.Length;
int num9 = array4[num3];
num9 -= num8;
array4[0] = num9;
BigInteger[] array5 = new BigInteger[num8];
BigInteger bigInteger3 = new BigInteger("8000000B", 16);
if (bigInteger3 != 0)
{
}
array5[0] = bigInteger3;
if (1 <= 0)
{
throw new NullReferenceException();
}
int num10 = array4[num3];
BigInteger[] array6 = new BigInteger[array.Length];
int length4 = array.Length;
int num11 = 0;
int num12 = 0;
int num13 = 0;
Array.Copy(array, num13, array6, num12, length4);
BigInteger[] array7 = new BigInteger[num10 + 1];
int length5 = array6.Length;
int num14 = 0;
int num15 = 0;
Array.Copy(array6, num15, array7, num14, length5);
if (num10 > 0)
{
BigInteger bigInteger5;
BigInteger bigInteger4 = array7[num11].Multiply(bigInteger).Add(bigInteger5);
BigInteger bigInteger6 = BigInteger.Two.Pow(32);
BigInteger bigInteger7 = bigInteger4.Mod(bigInteger6);
throw new ArrayTypeMismatchException();
}
int num16 = 0;
BigInteger zero = BigInteger.Zero;
if (num10 > 0)
{
BigInteger bigInteger8 = array7[num16].ShiftLeft(num16);
BigInteger bigInteger9 = zero.Add(bigInteger8);
num16++;
}
BigInteger bigInteger10 = array7[num10];
throw new ArrayTypeMismatchException();
}
// Token: 0x06009A80 RID: 39552 RVA: 0x00227790 File Offset: 0x00225990
[Token(Token = "0x6009A80")]
[Address(RVA = "0x1F542C0", Offset = "0x1F52CC0", VA = "0x181F542C0")]
private void procedure_B(int x0, int c, BigInteger[] pq)
{
if (x0 > 65536)
{
SecureRandom secureRandom = this.init_random;
}
if (c > 65536 || c == 65536)
{
SecureRandom secureRandom2 = this.init_random;
}
BigInteger[] array = new BigInteger[2];
BigInteger bigInteger = BigInteger.ValueOf((long)c);
uint num;
BigInteger bigInteger2 = BigInteger.ValueOf((long)num);
ulong num3;
int num2 = this.procedure_A(x0, c, array, (int)num3);
BigInteger bigInteger3 = array[0];
ulong num5;
int num4 = this.procedure_A(x0, c, array, (int)num5);
BigInteger bigInteger4 = array[0];
BigInteger[] array2 = new BigInteger[0];
BigInteger bigInteger5 = BigInteger.ValueOf((long)c);
if (bigInteger5 != 0)
{
}
array2[0] = bigInteger5;
BigInteger bigInteger6 = bigInteger3.Multiply(bigInteger4);
int num6 = 0;
BigInteger bigInteger7 = array2[num6].Multiply(bigInteger2).Add(bigInteger);
BigInteger bigInteger8 = BigInteger.Two.Pow(16);
BigInteger bigInteger9 = bigInteger7.Mod(bigInteger8);
throw new ArrayTypeMismatchException();
}
// Token: 0x06009A81 RID: 39553 RVA: 0x002279B8 File Offset: 0x00225BB8
[Token(Token = "0x6009A81")]
[Address(RVA = "0x1F54A40", Offset = "0x1F53440", VA = "0x181F54A40")]
private void procedure_Bb(long x0, long c, BigInteger[] pq)
{
ulong num;
if (x0 > (long)num)
{
SecureRandom secureRandom = this.init_random;
}
if (c > (long)num || c == (long)num)
{
SecureRandom secureRandom2 = this.init_random;
}
BigInteger[] array = new BigInteger[2];
uint num2;
BigInteger bigInteger = BigInteger.ValueOf((long)num2);
BigInteger bigInteger2 = array[0];
BigInteger bigInteger3 = array[0];
BigInteger[] array2 = new BigInteger[0];
long num3;
BigInteger bigInteger4 = BigInteger.ValueOf(num3);
if (bigInteger4 != 0)
{
}
array2[0] = bigInteger4;
BigInteger bigInteger5 = bigInteger2.Multiply(bigInteger3);
int num4 = 0;
BigInteger bigInteger7;
BigInteger bigInteger6 = array2[num4].Multiply(bigInteger).Add(bigInteger7);
BigInteger bigInteger8 = BigInteger.Two.Pow(32);
BigInteger bigInteger9 = bigInteger6.Mod(bigInteger8);
throw new ArrayTypeMismatchException();
}
// Token: 0x06009A82 RID: 39554 RVA: 0x00227BB4 File Offset: 0x00225DB4
[Token(Token = "0x6009A82")]
[Address(RVA = "0x1F551C0", Offset = "0x1F53BC0", VA = "0x181F551C0")]
private BigInteger procedure_C(BigInteger p, BigInteger q)
{
BigInteger bigInteger4;
for (;;)
{
BigInteger one = BigInteger.One;
BigInteger bigInteger = p.Subtract(one);
BigInteger bigInteger2 = bigInteger.Divide(q);
int bitLength = p.BitLength;
SecureRandom secureRandom = this.init_random;
BigInteger bigInteger3 = new BigInteger(bitLength, secureRandom);
BigInteger one2 = BigInteger.One;
if (bigInteger3.CompareTo(one2) > 0)
{
int num = bigInteger3.CompareTo(bigInteger);
bigInteger4 = bigInteger3.ModPow(bigInteger2, p);
BigInteger one3 = BigInteger.One;
if (bigInteger4.CompareTo(one3) != 0)
{
break;
}
}
}
return bigInteger4;
}
// Token: 0x06009A83 RID: 39555 RVA: 0x00227C34 File Offset: 0x00225E34
[Token(Token = "0x6009A83")]
[Address(RVA = "0x1F52990", Offset = "0x1F51390", VA = "0x181F52990")]
public Gost3410Parameters GenerateParameters()
{
/*
An exception occurred when decompiling this method (06009A83)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters.Gost3410Parameters BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators.Gost3410ParametersGenerator::GenerateParameters()
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_F4:
stloc:ArgumentException(var_25_FE, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("Ooops! key size 512 or 1024 bit.")))
}
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: 0x06009A84 RID: 39556 RVA: 0x00227D40 File Offset: 0x00225F40
[Token(Token = "0x6009A84")]
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
public Gost3410ParametersGenerator()
{
}
// Token: 0x0400655D RID: 25949
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x400655D")]
private int size;
// Token: 0x0400655E RID: 25950
[global::Cpp2IlInjected.FieldOffset(Offset = "0x14")]
[Token(Token = "0x400655E")]
private int typeproc;
// Token: 0x0400655F RID: 25951
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x400655F")]
private SecureRandom init_random;
}
}
@@ -0,0 +1,162 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
{
// Token: 0x02001693 RID: 5779
[Token(Token = "0x2001693")]
[StructLayout(3)]
public class HkdfBytesGenerator : IDerivationFunction
{
// Token: 0x06009A85 RID: 39557 RVA: 0x00227D54 File Offset: 0x00225F54
[Token(Token = "0x6009A85")]
[Address(RVA = "0x1F55A90", Offset = "0x1F54490", VA = "0x181F55A90")]
public HkdfBytesGenerator(IDigest hash)
{
HMac hmac = new HMac(hash);
this.hMacHash = hmac;
this.hashLen = hmac;
}
// Token: 0x06009A86 RID: 39558 RVA: 0x00227D84 File Offset: 0x00225F84
[Token(Token = "0x6009A86")]
[Address(RVA = "0x1F55780", Offset = "0x1F54180", VA = "0x181F55780", Slot = "7")]
public virtual void Init(IDerivationParameters parameters)
{
/*
An exception occurred when decompiling this method (06009A86)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators.HkdfBytesGenerator::Init(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IDerivationParameters)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_92:
stloc:ArgumentException(var_15_A1, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("HKDF parameters required for HkdfBytesGenerator"), ldstr:string("parameters")))
}
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: 0x06009A87 RID: 39559 RVA: 0x00227E34 File Offset: 0x00226034
[Token(Token = "0x6009A87")]
[Address(RVA = "0x1F554B0", Offset = "0x1F53EB0", VA = "0x181F554B0")]
private KeyParameter Extract(byte[] salt, byte[] ikm)
{
HMac hmac = this.hMacHash;
if (salt == 0)
{
byte[] array = new byte[this.hashLen];
}
KeyParameter keyParameter = new KeyParameter(salt);
IDigest underlyingDigest = hmac.GetUnderlyingDigest();
this.hMacHash.Update(ikm);
byte[] array2 = new byte[this.hashLen];
HMac hmac2 = this.hMacHash;
return new KeyParameter(array2);
}
// Token: 0x06009A88 RID: 39560 RVA: 0x00227E94 File Offset: 0x00226094
[Token(Token = "0x6009A88")]
[Address(RVA = "0x1F55380", Offset = "0x1F53D80", VA = "0x181F55380")]
private void ExpandNext()
{
/*
An exception occurred when decompiling this method (06009A88)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators.HkdfBytesGenerator::ExpandNext()
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_58:
stloc:DataLengthException(var_6_62, newobj:DataLengthException(DataLengthException::.ctor, ldstr:string("HKDF cannot generate more than 255 blocks of HashLen size")))
}
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: 0x170018B1 RID: 6321
// (get) Token: 0x06009A89 RID: 39561 RVA: 0x00227F04 File Offset: 0x00226104
[Token(Token = "0x170018B1")]
public virtual IDigest Digest
{
[Token(Token = "0x6009A89")]
[Address(RVA = "0xA44FB0", Offset = "0xA439B0", VA = "0x180A44FB0", Slot = "8")]
get
{
string algorithmName = ((IMac)this.hMacHash).AlgorithmName;
throw new NullReferenceException();
}
}
// Token: 0x06009A8A RID: 39562 RVA: 0x00227F24 File Offset: 0x00226124
[Token(Token = "0x6009A8A")]
[Address(RVA = "0x1F555F0", Offset = "0x1F53FF0", VA = "0x181F555F0", Slot = "9")]
public virtual int GenerateBytes(byte[] output, int outOff, int len)
{
int num = this.hashLen;
long num2 = (long)(num * (int)((uint)255));
if (output == 0)
{
this.ExpandNext();
}
num -= output;
int num3 = Math.Min(num, len);
byte[] array = this.currentT;
if (len > 0)
{
this.ExpandNext();
int num4 = this.hashLen;
int num5 = Math.Min(num4, len);
byte[] array2 = this.currentT;
int num6 = 0;
Array.Copy(array2, num6, output, len, num5);
}
return len;
}
// Token: 0x04006560 RID: 25952
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006560")]
private HMac hMacHash;
// Token: 0x04006561 RID: 25953
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006561")]
private int hashLen;
// Token: 0x04006562 RID: 25954
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x4006562")]
private byte[] info;
// Token: 0x04006563 RID: 25955
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x4006563")]
private byte[] currentT;
// Token: 0x04006564 RID: 25956
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
[Token(Token = "0x4006564")]
private int generatedBytes;
}
}
@@ -0,0 +1,21 @@
using System;
using System.Runtime.InteropServices;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
{
// Token: 0x02001694 RID: 5780
[Token(Token = "0x2001694")]
[StructLayout(3)]
public class Kdf1BytesGenerator : BaseKdfBytesGenerator
{
// Token: 0x06009A8B RID: 39563 RVA: 0x00227FAC File Offset: 0x002261AC
[Token(Token = "0x6009A8B")]
[Address(RVA = "0x1F55B20", Offset = "0x1F54520", VA = "0x181F55B20")]
public Kdf1BytesGenerator(IDigest digest)
{
this.counterStart = (int)((ulong)0L);
this.digest = digest;
}
}
}
@@ -0,0 +1,21 @@
using System;
using System.Runtime.InteropServices;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
{
// Token: 0x02001695 RID: 5781
[Token(Token = "0x2001695")]
[StructLayout(3)]
public class Kdf2BytesGenerator : BaseKdfBytesGenerator
{
// Token: 0x06009A8C RID: 39564 RVA: 0x00227FD0 File Offset: 0x002261D0
[Token(Token = "0x6009A8C")]
[Address(RVA = "0x1F55B50", Offset = "0x1F54550", VA = "0x181F55B50")]
public Kdf2BytesGenerator(IDigest digest)
{
this.counterStart = (int)((ulong)1L);
this.digest = digest;
}
}
}
@@ -0,0 +1,151 @@
using System;
using System.Runtime.InteropServices;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
{
// Token: 0x02001696 RID: 5782
[Token(Token = "0x2001696")]
[StructLayout(3)]
public class Mgf1BytesGenerator : IDerivationFunction
{
// Token: 0x06009A8D RID: 39565 RVA: 0x00227FF4 File Offset: 0x002261F4
[Token(Token = "0x6009A8D")]
[Address(RVA = "0x1F56640", Offset = "0x1F55040", VA = "0x181F56640")]
public Mgf1BytesGenerator(IDigest digest)
{
this.digest = digest;
}
// Token: 0x06009A8E RID: 39566 RVA: 0x00228014 File Offset: 0x00226214
[Token(Token = "0x6009A8E")]
[Address(RVA = "0x1F56520", Offset = "0x1F54F20", VA = "0x181F56520", Slot = "4")]
public void Init(IDerivationParameters parameters)
{
/*
An exception occurred when decompiling this method (06009A8E)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators.Mgf1BytesGenerator::Init(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IDerivationParameters)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_23:
stloc:ArgumentException(var_4_2D, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("MGF parameters required for MGF1Generator")))
}
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: 0x170018B2 RID: 6322
// (get) Token: 0x06009A8F RID: 39567 RVA: 0x00228050 File Offset: 0x00226250
[Token(Token = "0x170018B2")]
public IDigest Digest
{
[Token(Token = "0x6009A8F")]
[Address(RVA = "0x3C39A0", Offset = "0x3C23A0", VA = "0x1803C39A0", Slot = "5")]
get
{
return this.digest;
}
}
// Token: 0x06009A90 RID: 39568 RVA: 0x00228064 File Offset: 0x00226264
[Token(Token = "0x6009A90")]
[Address(RVA = "0x1E44410", Offset = "0x1E42E10", VA = "0x181E44410")]
private void ItoOSP(int i, byte[] sp)
{
sp[0] = (byte)i;
sp[0] = (byte)i;
sp[0] = (byte)i;
sp[0] = (byte)i;
}
// Token: 0x06009A91 RID: 39569 RVA: 0x00228098 File Offset: 0x00226298
[Token(Token = "0x6009A91")]
[Address(RVA = "0x1F56090", Offset = "0x1F54A90", VA = "0x181F56090", Slot = "6")]
public int GenerateBytes(byte[] output, int outOff, int length)
{
int num = output.Length;
num -= length;
byte[] array = new byte[this.hLen];
byte[] array2 = new byte[4];
IDigest digest = this.digest;
int num2 = 0;
int num3 = this.hLen;
int num11;
if (length > num3)
{
array2[0] = (byte)num2;
array2[0] = (byte)num2;
array2[0] = (byte)num2;
array2[0] = (byte)num2;
byte[] array3 = this.seed;
IDigest digest2 = this.digest;
int num4 = 0;
if (num4 < num3)
{
num4 += num4;
num4++;
}
int num5 = 0;
IDigest digest3 = this.digest;
int num6 = 0;
if (num6 < num5)
{
num6 += num6;
num6++;
}
int num7 = 0;
IDigest digest4 = this.digest;
if (num6 < num7)
{
num6 += num6;
num6++;
}
int num8 = this.hLen;
int num9 = num8 * num2;
int num10 = 0;
Array.Copy(array, num10, output, num9, num8);
num11 = this.hLen;
}
if (num11 < length)
{
this.ItoOSP(1, array2);
byte[] array4 = this.seed;
IDigest digest5 = this.digest;
int length2 = array4.Length;
IDigest digest6 = this.digest;
int num12 = array2.Length;
IDigest digest7 = this.digest;
int num13 = this.hLen;
num12 = length - num13;
}
return length;
}
// Token: 0x04006565 RID: 25957
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006565")]
private IDigest digest;
// Token: 0x04006566 RID: 25958
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006566")]
private byte[] seed;
// Token: 0x04006567 RID: 25959
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x4006567")]
private int hLen;
}
}
@@ -0,0 +1,184 @@
using System;
using System.Collections;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
{
// Token: 0x02001697 RID: 5783
[Token(Token = "0x2001697")]
[StructLayout(3)]
public class NaccacheSternKeyPairGenerator : IAsymmetricCipherKeyPairGenerator
{
// Token: 0x06009A92 RID: 39570 RVA: 0x0022822C File Offset: 0x0022642C
[Token(Token = "0x6009A92")]
[Address(RVA = "0x1F57AA0", Offset = "0x1F564A0", VA = "0x181F57AA0", Slot = "4")]
public void Init(KeyGenerationParameters parameters)
{
while (parameters != 0)
{
if (parameters != 0)
{
this.param = parameters;
return;
}
}
int num = 0;
this.param = num;
}
// Token: 0x06009A93 RID: 39571 RVA: 0x00228254 File Offset: 0x00226454
[Token(Token = "0x6009A93")]
[Address(RVA = "0x1F566B0", Offset = "0x1F550B0", VA = "0x181F566B0", Slot = "5")]
public AsymmetricCipherKeyPair GenerateKeyPair()
{
/*
An exception occurred when decompiling this method (06009A93)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.AsymmetricCipherKeyPair BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators.NaccacheSternKeyPairGenerator::GenerateKeyPair()
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_454:
stloc:BigInteger(var_72_45C, call:BigInteger(BigInteger::ShiftRight, ldloc:BigInteger(var_47_291), ldc.i4:int32(2)))
stloc:BigInteger(var_73_469, call:BigInteger(BigInteger::ModPow, ldloc:BigInteger(var_66), ldloc:BigInteger(var_72_45C), ldloc:BigInteger(var_41_25F)))
stloc:BigInteger(var_74_474, call:BigInteger(BigInteger::Divide, ldloc:BigInteger(var_47_291), ldloc:BigInteger(var_27_1BF)))
stloc:BigInteger(var_75_481, call:BigInteger(BigInteger::ModPow, ldloc:BigInteger(var_66), ldloc:BigInteger(var_74_474), ldloc:BigInteger(var_41_25F)))
stloc:BigInteger(var_76_48C, call:BigInteger(BigInteger::Divide, ldloc:BigInteger(var_47_291), ldloc:BigInteger(var_33_1FA)))
stloc:BigInteger(var_77_499, call:BigInteger(BigInteger::ModPow, ldloc:BigInteger(var_66), ldloc:BigInteger(var_76_48C), ldloc:BigInteger(var_41_25F)))
stloc:BigInteger(var_78_4A4, call:BigInteger(BigInteger::Divide, ldloc:BigInteger(var_47_291), ldloc:BigInteger(var_21_182)))
stloc:BigInteger(var_79_4B1, call:BigInteger(BigInteger::ModPow, ldloc:BigInteger(var_66), ldloc:BigInteger(var_78_4A4), ldloc:BigInteger(var_41_25F)))
stloc:BigInteger(var_80_4BC, call:BigInteger(BigInteger::Divide, ldloc:BigInteger(var_47_291), ldloc:BigInteger(var_23_18F)))
stloc:BigInteger(var_81_4C9, call:BigInteger(BigInteger::ModPow, ldloc:BigInteger(var_66), ldloc:BigInteger(var_80_4BC), ldloc:BigInteger(var_41_25F)))
stloc:int32(var_82_4D2, callgetter:int32(BigInteger::get_BitLength, ldloc:BigInteger(var_18_160)))
stloc:NaccacheSternKeyParameters(var_83_4E1, newobj:NaccacheSternKeyParameters(NaccacheSternKeyParameters::.ctor, ldloc:int32[exp:bool](var_85), ldloc:BigInteger(var_66), ldloc:BigInteger(var_41_25F), ldloc:int32(var_82_4D2)))
stloc:int32(var_85, ldc.i4:int32(0))
stloc:int32(var_82_4F0, callgetter:int32(BigInteger::get_BitLength, ldloc:BigInteger(var_18_160)))
stloc:NaccacheSternPrivateKeyParameters(var_86_501, newobj:NaccacheSternPrivateKeyParameters(NaccacheSternPrivateKeyParameters::.ctor, ldloc:BigInteger(var_66), ldloc:BigInteger(var_41_25F), ldloc:int32(var_82_4F0), ldloc:IList(var_9_5F), ldloc:BigInteger(var_47_291)))
stloc:AsymmetricCipherKeyPair(var_87_50C, newobj:AsymmetricCipherKeyPair(AsymmetricCipherKeyPair::.ctor, ldloc:NaccacheSternKeyParameters[exp:AsymmetricKeyParameter](var_83_4E1), ldloc:NaccacheSternPrivateKeyParameters[exp:AsymmetricKeyParameter](var_86_501)))
}
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: 0x06009A94 RID: 39572 RVA: 0x00228770 File Offset: 0x00226970
[Token(Token = "0x6009A94")]
[Address(RVA = "0x1F57CD0", Offset = "0x1F566D0", VA = "0x181F57CD0")]
private static BigInteger generatePrime(int bitLength, int certainty, SecureRandom rand)
{
return new BigInteger(certainty, certainty, rand);
}
// Token: 0x06009A95 RID: 39573 RVA: 0x00228788 File Offset: 0x00226988
[Token(Token = "0x6009A95")]
[Address(RVA = "0x1F57D50", Offset = "0x1F56750", VA = "0x181F57D50")]
private static IList permuteList(IList arr, SecureRandom rand)
{
int num;
IList list;
do
{
num = 0;
if (num < arr)
{
num += num;
num++;
}
int num2 = 0;
if (list != 0)
{
if (num < num2)
{
num += num;
num++;
}
uint num3;
if (num < (int)num3)
{
num += num;
num++;
}
num += num;
num++;
int num4;
num4 += num4;
num += 19;
num4 += num4;
num++;
num += 19;
num4 += num4;
num++;
num += 19;
num4 += num4;
num += 8;
num += 19;
}
if (num != 0)
{
}
if (num != -1)
{
}
}
while (num != 0);
return list;
}
// Token: 0x06009A96 RID: 39574 RVA: 0x0022882C File Offset: 0x00226A2C
[Token(Token = "0x6009A96")]
[Address(RVA = "0x1F57BA0", Offset = "0x1F565A0", VA = "0x181F57BA0")]
private static IList findFirstPrimes(int count)
{
IList list = Platform.CreateArrayList(count);
int num = 0;
if (count != 0)
{
BigInteger bigInteger = BigInteger.ValueOf((long)NaccacheSternKeyPairGenerator.smallPrimes[num]);
num++;
while (num != count)
{
}
}
return list;
}
// Token: 0x06009A97 RID: 39575 RVA: 0x00228868 File Offset: 0x00226A68
[Token(Token = "0x6009A97")]
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
public NaccacheSternKeyPairGenerator()
{
}
// Token: 0x06009A98 RID: 39576 RVA: 0x0022887C File Offset: 0x00226A7C
// Note: this type is marked as 'beforefieldinit'.
[Token(Token = "0x6009A98")]
[Address(RVA = "0x1F57B40", Offset = "0x1F56540", VA = "0x181F57B40")]
static NaccacheSternKeyPairGenerator()
{
int[] array = new int[101];
RuntimeHelpers.InitializeArray(array, fieldof(<PrivateImplementationDetails>.6FE282215AF15E3C00DDCAB5E6BD720D1F5BC0BC).FieldHandle);
NaccacheSternKeyPairGenerator.smallPrimes = array;
}
// Token: 0x04006568 RID: 25960
[Token(Token = "0x4006568")]
private static readonly int[] smallPrimes;
// Token: 0x04006569 RID: 25961
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006569")]
private NaccacheSternKeyGenerationParameters param;
}
}
@@ -0,0 +1,233 @@
using System;
using System.IO;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
{
// Token: 0x02001698 RID: 5784
[Token(Token = "0x2001698")]
[StructLayout(3)]
public class OpenBsdBCrypt
{
// Token: 0x06009A99 RID: 39577 RVA: 0x002288A4 File Offset: 0x00226AA4
[Token(Token = "0x6009A99")]
[Address(RVA = "0x1F59480", Offset = "0x1F57E80", VA = "0x181F59480")]
static OpenBsdBCrypt()
{
byte[] array = new byte[64];
RuntimeHelpers.InitializeArray(array, fieldof(<PrivateImplementationDetails>.2CDACAA27B7865A56A57B156CFB369245964BD2B).FieldHandle);
OpenBsdBCrypt.EncodingTable = array;
OpenBsdBCrypt.DecodingTable = new byte[128];
OpenBsdBCrypt.DefaultVersion = "2y";
OpenBsdBCrypt.AllowedVersions = new HashSet();
ISet allowedVersions = OpenBsdBCrypt.AllowedVersions;
ISet allowedVersions2 = OpenBsdBCrypt.AllowedVersions;
ISet allowedVersions3 = OpenBsdBCrypt.AllowedVersions;
int num = 0;
byte[] decodingTable = OpenBsdBCrypt.DecodingTable;
byte[] decodingTable2;
if (num < decodingTable.Length)
{
num++;
decodingTable2 = OpenBsdBCrypt.DecodingTable;
}
if (num < decodingTable2.Length)
{
num++;
}
}
// Token: 0x06009A9A RID: 39578 RVA: 0x0022893C File Offset: 0x00226B3C
[Token(Token = "0x6009A9A")]
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
public OpenBsdBCrypt()
{
}
// Token: 0x06009A9B RID: 39579 RVA: 0x00228950 File Offset: 0x00226B50
[Token(Token = "0x6009A9B")]
[Address(RVA = "0x1F584A0", Offset = "0x1F56EA0", VA = "0x181F584A0")]
private static string CreateBcryptString(string version, byte[] password, byte[] salt, int cost)
{
/*
An exception occurred when decompiling this method (06009A9B)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.String BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators.OpenBsdBCrypt::CreateBcryptString(System.String,System.Byte[],System.Byte[],System.Int32)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_9C:
stloc:ArgumentException(var_20_AB, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("BCrypt cost must be from 4..31"), ldstr:string("cost")))
}
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: 0x06009A9C RID: 39580 RVA: 0x00228A0C File Offset: 0x00226C0C
[Token(Token = "0x6009A9C")]
[Address(RVA = "0x1F590E0", Offset = "0x1F57AE0", VA = "0x181F590E0")]
public static string Generate(char[] password, byte[] salt, int cost)
{
return OpenBsdBCrypt.Generate(OpenBsdBCrypt.DefaultVersion, password, salt, cost);
}
// Token: 0x06009A9D RID: 39581 RVA: 0x00228A28 File Offset: 0x00226C28
[Token(Token = "0x6009A9D")]
[Address(RVA = "0x1F59170", Offset = "0x1F57B70", VA = "0x181F59170")]
public static string Generate(string version, char[] password, byte[] salt, int cost)
{
do
{
ISet allowedVersions = OpenBsdBCrypt.AllowedVersions;
}
while (password == 0 || salt == 0 || salt.Length != 16);
byte[] array = Strings.ToUtf8ByteArray(password);
if (array.Length < 72)
{
}
byte[] array2 = new byte[72];
int length = array2.Length;
int num = Math.Min(array.Length, length);
int num2 = 0;
int num3 = 0;
Array.Copy(array, num3, array2, num2, num);
int length2 = array.Length;
int num4 = 0;
Array.Clear(array, num4, length2);
string text = OpenBsdBCrypt.CreateBcryptString(version, array2, salt, cost);
int length3 = array2.Length;
int num5 = 0;
Array.Clear(array2, num5, length3);
return text;
}
// Token: 0x06009A9E RID: 39582 RVA: 0x00228ADC File Offset: 0x00226CDC
[Token(Token = "0x6009A9E")]
[Address(RVA = "0x1F580C0", Offset = "0x1F56AC0", VA = "0x181F580C0")]
public static bool CheckPassword(string bcryptString, char[] password)
{
/*
An exception occurred when decompiling this method (06009A9E)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators.OpenBsdBCrypt::CheckPassword(System.String,System.Char[])
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_9D:
stloc:ArgumentException(var_14_B3, newobj:ArgumentException(ArgumentException::.ctor, call:string(string::Concat, ldstr:string[exp:object]("Invalid cost factor: "), ldloc:int32[exp:object](var_13), ldstr:string[exp:object](", 4 < cost < 31 expected."))))
}
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: 0x06009A9F RID: 39583 RVA: 0x00228BA0 File Offset: 0x00226DA0
[Token(Token = "0x6009A9F")]
[Address(RVA = "0x1F58D00", Offset = "0x1F57700", VA = "0x181F58D00")]
private static string EncodeData(byte[] data)
{
int length = data.Length;
int num = 0;
if (length != 16)
{
int num2 = length - 1;
}
byte[] array = new byte[18];
int length2 = data.Length;
int num3 = 0;
int num4 = 0;
Array.Copy(data, num4, array, num3, length2);
MemoryStream memoryStream = new MemoryStream();
if (array.Length > 0)
{
int length3 = array.Length;
num += 2;
byte b = array[num];
byte[] encodingTable = OpenBsdBCrypt.EncodingTable;
byte[] encodingTable2 = OpenBsdBCrypt.EncodingTable;
byte[] encodingTable3 = OpenBsdBCrypt.EncodingTable;
byte[] encodingTable4 = OpenBsdBCrypt.EncodingTable;
num += 3;
}
ulong num5;
if (num5 != (ulong)0L)
{
}
string text;
int stringLength = text.m_stringLength;
int num6 = 0;
return text.Substring(num6, stringLength);
}
// Token: 0x06009AA0 RID: 39584 RVA: 0x00228C50 File Offset: 0x00226E50
[Token(Token = "0x6009AA0")]
[Address(RVA = "0x1F588B0", Offset = "0x1F572B0", VA = "0x181F588B0")]
private static byte[] DecodeSaltString(string saltString)
{
/*
An exception occurred when decompiling this method (06009AA0)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Byte[] BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators.OpenBsdBCrypt::DecodeSaltString(System.String)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_C4:
stloc:ArgumentException(var_24_DA, newobj:ArgumentException(ArgumentException::.ctor, call:string(string::Concat, ldstr:string[exp:object]("Salt string contains invalid character: "), ldloc:int32[exp:object](var_23)), ldstr:string("saltString")))
}
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.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: 0x0400656A RID: 25962
[Token(Token = "0x400656A")]
private static readonly byte[] EncodingTable;
// Token: 0x0400656B RID: 25963
[Token(Token = "0x400656B")]
private static readonly byte[] DecodingTable;
// Token: 0x0400656C RID: 25964
[Token(Token = "0x400656C")]
private static readonly string DefaultVersion;
// Token: 0x0400656D RID: 25965
[Token(Token = "0x400656D")]
private static readonly ISet AllowedVersions;
}
}
@@ -0,0 +1,229 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
{
// Token: 0x02001699 RID: 5785
[Token(Token = "0x2001699")]
[StructLayout(3)]
public class OpenSslPbeParametersGenerator : PbeParametersGenerator
{
// Token: 0x06009AA1 RID: 39585 RVA: 0x00228D38 File Offset: 0x00226F38
[Token(Token = "0x6009AA1")]
[Address(RVA = "0x1F59E50", Offset = "0x1F58850", VA = "0x181F59E50")]
public OpenSslPbeParametersGenerator()
{
MD5Digest md5Digest = new MD5Digest();
this.digest = md5Digest;
base..ctor();
}
// Token: 0x06009AA2 RID: 39586 RVA: 0x00228D58 File Offset: 0x00226F58
[Token(Token = "0x6009AA2")]
[Address(RVA = "0x1F59E10", Offset = "0x1F58810", VA = "0x181F59E10", Slot = "4")]
public override void Init(byte[] password, byte[] salt, int iterationCount)
{
base.Init(password, salt, 1);
}
// Token: 0x06009AA3 RID: 39587 RVA: 0x00228D70 File Offset: 0x00226F70
[Token(Token = "0x6009AA3")]
[Address(RVA = "0x1F59E30", Offset = "0x1F58830", VA = "0x181F59E30", Slot = "13")]
public virtual void Init(byte[] password, byte[] salt)
{
base.Init(password, salt, 1);
}
// Token: 0x06009AA4 RID: 39588 RVA: 0x00228D88 File Offset: 0x00226F88
[Token(Token = "0x6009AA4")]
[Address(RVA = "0x1F596E0", Offset = "0x1F580E0", VA = "0x181F596E0")]
private byte[] GenerateDerivedKey(int bytesNeeded)
{
IDigest digest = this.digest;
byte[] array = new byte[0];
byte[] array2 = new byte[bytesNeeded];
byte[] mPassword = this.mPassword;
IDigest digest2 = this.digest;
int num = 0;
if (num < digest)
{
num += num;
num++;
}
int num2 = 0;
byte[] mSalt = this.mSalt;
IDigest digest3 = this.digest;
int num3 = 0;
if (num3 < num2)
{
num3 += num3;
num3++;
}
int num4 = 0;
IDigest digest4 = this.digest;
int num5 = 0;
if (num5 < num4)
{
num5 += num5;
num5++;
}
int num6 = array.Length;
if (bytesNeeded <= num6)
{
num6 = bytesNeeded;
}
int num7 = 0;
Array.Copy(array, num7, array2, num, num6);
num += num6;
if (bytesNeeded != num6)
{
IDigest digest5 = this.digest;
if (num5 < array2)
{
num5 += num5;
num5++;
}
IDigest digest6 = this.digest;
int length = array.Length;
uint num8;
if (num5 < (int)num8)
{
num5 += num5;
num5++;
}
byte[] mPassword2 = this.mPassword;
array += array;
array += array;
array += array;
array += array;
array += array;
}
return array2;
}
// Token: 0x06009AA5 RID: 39589 RVA: 0x00228EA8 File Offset: 0x002270A8
[Token(Token = "0x6009AA5")]
[Address(RVA = "0x1F59C10", Offset = "0x1F58610", VA = "0x181F59C10", Slot = "8")]
[Obsolete]
public override ICipherParameters GenerateDerivedParameters(int keySize)
{
return base.GenerateDerivedParameters(keySize);
}
// Token: 0x06009AA6 RID: 39590 RVA: 0x00228EBC File Offset: 0x002270BC
[Token(Token = "0x6009AA6")]
[Address(RVA = "0x1F59B70", Offset = "0x1F58570", VA = "0x181F59B70", Slot = "9")]
public override ICipherParameters GenerateDerivedParameters(string algorithm, int keySize)
{
/*
An exception occurred when decompiling this method (06009AA6)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators.OpenSslPbeParametersGenerator::GenerateDerivedParameters(System.String,System.Int32)
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:uint8[](var_0_07, call:uint8[](OpenSslPbeParametersGenerator::GenerateDerivedKey, ldloc:OpenSslPbeParametersGenerator(this), ldloc:int32(keySize)))
stloc:int32(var_2_09, ldc.i4:int32(0))
stloc:KeyParameter(var_3_13, call:KeyParameter(ParameterUtilities::CreateKeyParameter, ldloc:string(algorithm), ldloc:uint8[](var_0_07), ldloc:int32(var_2_09), ldloc:int32(keySize)))
}
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: 0x06009AA7 RID: 39591 RVA: 0x00228EDC File Offset: 0x002270DC
[Token(Token = "0x6009AA7")]
[Address(RVA = "0x1F59C30", Offset = "0x1F58630", VA = "0x181F59C30", Slot = "10")]
[Obsolete]
public override ICipherParameters GenerateDerivedParameters(int keySize, int ivSize)
{
/*
An exception occurred when decompiling this method (06009AA7)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators.OpenSslPbeParametersGenerator::GenerateDerivedParameters(System.Int32,System.Int32)
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:uint8[](var_0_07, call:uint8[](OpenSslPbeParametersGenerator::GenerateDerivedKey, ldloc:OpenSslPbeParametersGenerator(this), ldloc:int32(keySize)))
}
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: 0x06009AA8 RID: 39592 RVA: 0x00228EF0 File Offset: 0x002270F0
[Token(Token = "0x6009AA8")]
[Address(RVA = "0x1F59D10", Offset = "0x1F58710", VA = "0x181F59D10", Slot = "11")]
public override ICipherParameters GenerateDerivedParameters(string algorithm, int keySize, int ivSize)
{
/*
An exception occurred when decompiling this method (06009AA8)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators.OpenSslPbeParametersGenerator::GenerateDerivedParameters(System.String,System.Int32,System.Int32)
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:int32(var_2_01, ldc.i4:int32(0))
stloc:ParametersWithIV(var_3_13, newobj:ParametersWithIV(ParametersWithIV::.ctor, call:KeyParameter[exp:ICipherParameters](ParameterUtilities::CreateKeyParameter, ldloc:string(algorithm), ldloc:uint8[](var_0), ldloc:int32(var_2_01), ldloc:int32(ivSize)), ldloc:uint8[](var_0), ldloc:int32(ivSize), ldloc:int32(keySize)))
}
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: 0x06009AA9 RID: 39593 RVA: 0x00228F10 File Offset: 0x00227110
[Token(Token = "0x6009AA9")]
[Address(RVA = "0x1F59AE0", Offset = "0x1F584E0", VA = "0x181F59AE0", Slot = "12")]
public override ICipherParameters GenerateDerivedMacParameters(int keySize)
{
/*
An exception occurred when decompiling this method (06009AA9)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators.OpenSslPbeParametersGenerator::GenerateDerivedMacParameters(System.Int32)
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:KeyParameter(var_0_0E, newobj:KeyParameter(KeyParameter::.ctor, call:uint8[](OpenSslPbeParametersGenerator::GenerateDerivedKey, ldloc:OpenSslPbeParametersGenerator(this), ldloc:int32(keySize)), ldloc:int32(var_2), ldloc:int32(keySize)))
stloc:int32(var_2, ldc.i4:int32(0))
}
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: 0x0400656E RID: 25966
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x400656E")]
private readonly IDigest digest;
}
}
@@ -0,0 +1,338 @@
using System;
using System.Runtime.InteropServices;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
{
// Token: 0x0200169A RID: 5786
[Token(Token = "0x200169A")]
[StructLayout(3)]
public class Pkcs12ParametersGenerator : PbeParametersGenerator
{
// Token: 0x06009AAA RID: 39594 RVA: 0x00228F30 File Offset: 0x00227130
[Token(Token = "0x6009AAA")]
[Address(RVA = "0x1F5A9A0", Offset = "0x1F593A0", VA = "0x181F5A9A0")]
public Pkcs12ParametersGenerator(IDigest digest)
{
this.digest = digest;
}
// Token: 0x06009AAB RID: 39595 RVA: 0x00228F50 File Offset: 0x00227150
[Token(Token = "0x6009AAB")]
[Address(RVA = "0x1F59EB0", Offset = "0x1F588B0", VA = "0x181F59EB0")]
private void Adjust(byte[] a, int aOff, byte[] b)
{
int num = b.Length - 1;
byte b2;
byte b3;
b2 += b3;
num = b.Length;
byte b4;
b2 += b4;
byte b5;
b2 += b5;
}
// Token: 0x06009AAC RID: 39596 RVA: 0x00228F80 File Offset: 0x00227180
[Token(Token = "0x6009AAC")]
[Address(RVA = "0x1F59FA0", Offset = "0x1F589A0", VA = "0x181F59FA0")]
private byte[] GenerateDerivedKey(int idByte, int n)
{
int num = this.v;
byte[] array = new byte[num];
byte[] array2 = new byte[n];
int num2 = 0;
int length = array.Length;
if (num2 != length)
{
num2++;
}
byte[] mSalt = this.mSalt;
if (mSalt != 0)
{
int length2 = mSalt.Length;
if (length2 != 0)
{
int num3 = this.v;
int num4 = length2 - 1;
num4 += num3;
int length3 = new byte[length2].Length;
if (num2 == length3)
{
goto IL_81;
}
byte[] mSalt2 = this.mSalt;
num2++;
}
}
byte[] array3 = new byte[0];
IL_81:
byte[] mPassword = this.mPassword;
if (mPassword != 0)
{
int length4 = mPassword.Length;
if (length4 != 0)
{
int num5 = this.v;
int num6 = length4 - 1;
num6 += num5;
int length5 = new byte[length4].Length;
if (num2 == length5)
{
goto IL_D8;
}
byte[] mPassword2 = this.mPassword;
num2++;
}
}
byte[] array4 = new byte[0];
IL_D8:
byte[] array5 = new byte[array4.Length];
int length6 = array3.Length;
int num7 = 0;
int num8 = 0;
Array.Copy(array3, num8, array5, num7, length6);
int length7 = array4.Length;
int length8 = array3.Length;
int num9 = 0;
Array.Copy(array4, num9, array5, length8, length7);
int num10 = this.v;
byte[] array6 = new byte[num10];
int num11 = this.u;
int num12 = n - 1;
num12 += num11;
num10 = num11;
byte[] array7 = new byte[num10];
IDigest digest = this.digest;
int num13 = 0;
if (num13 < array5)
{
num13 += num13;
num13++;
}
int num14 = 0;
IDigest digest2 = this.digest;
int num15 = 0;
if (num15 < num14)
{
num15 += num15;
num15++;
}
int num16 = 0;
IDigest digest3 = this.digest;
int num17 = 0;
if (num17 < num16)
{
num17 += num17;
num17++;
}
IDigest digest4 = this.digest;
int length9 = array7.Length;
IDigest digest5 = this.digest;
uint num18;
num18 += (uint)1;
int length10 = array6.Length;
if (num17 != length10)
{
num17++;
num17 += num17;
num17 += num17;
num17 += num17;
}
int length11 = array5.Length;
int num19 = this.v;
if (num17 != length11)
{
int num20 = num19 * num17;
this.Adjust(array5, num20, array6);
num17++;
}
uint num21;
if (num21 != (uint)num12)
{
}
int num22 = array2.Length;
uint num23 = num21 - 1U;
num22 -= (int)num23;
int num24 = 0;
Array.Copy(array7, num24, array2, (int)num23, num22);
num21 += (uint)1;
while (num21 <= (uint)num12)
{
}
return array2;
}
// Token: 0x06009AAD RID: 39597 RVA: 0x00229204 File Offset: 0x00227404
[Token(Token = "0x6009AAD")]
[Address(RVA = "0x1F5A660", Offset = "0x1F59060", VA = "0x181F5A660", Slot = "8")]
public override ICipherParameters GenerateDerivedParameters(int keySize)
{
/*
An exception occurred when decompiling this method (06009AAD)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators.Pkcs12ParametersGenerator::GenerateDerivedParameters(System.Int32)
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:KeyParameter(var_0_0F, newobj:KeyParameter(KeyParameter::.ctor, call:uint8[](Pkcs12ParametersGenerator::GenerateDerivedKey, ldloc:Pkcs12ParametersGenerator(this), ldc.i4:int32(1), ldloc:int32(keySize)), ldloc:int32(var_2), ldloc:int32(keySize)))
stloc:int32(var_2, ldc.i4:int32(0))
}
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: 0x06009AAE RID: 39598 RVA: 0x00229224 File Offset: 0x00227424
[Token(Token = "0x6009AAE")]
[Address(RVA = "0x1F5A800", Offset = "0x1F59200", VA = "0x181F5A800", Slot = "9")]
public override ICipherParameters GenerateDerivedParameters(string algorithm, int keySize)
{
/*
An exception occurred when decompiling this method (06009AAE)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators.Pkcs12ParametersGenerator::GenerateDerivedParameters(System.String,System.Int32)
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:uint8[](var_0_08, call:uint8[](Pkcs12ParametersGenerator::GenerateDerivedKey, ldloc:Pkcs12ParametersGenerator(this), ldc.i4:int32(1), ldloc:int32(keySize)))
stloc:int32(var_2_0A, ldc.i4:int32(0))
stloc:KeyParameter(var_3_14, call:KeyParameter(ParameterUtilities::CreateKeyParameter, ldloc:string(algorithm), ldloc:uint8[](var_0_08), ldloc:int32(var_2_0A), ldloc:int32(keySize)))
}
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: 0x06009AAF RID: 39599 RVA: 0x00229248 File Offset: 0x00227448
[Token(Token = "0x6009AAF")]
[Address(RVA = "0x1F5A8A0", Offset = "0x1F592A0", VA = "0x181F5A8A0", Slot = "10")]
public override ICipherParameters GenerateDerivedParameters(int keySize, int ivSize)
{
/*
An exception occurred when decompiling this method (06009AAF)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators.Pkcs12ParametersGenerator::GenerateDerivedParameters(System.Int32,System.Int32)
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:uint8[](var_0_08, call:uint8[](Pkcs12ParametersGenerator::GenerateDerivedKey, ldloc:Pkcs12ParametersGenerator(this), ldc.i4:int32(1), ldloc:int32(ivSize)))
stloc:int32(var_1_0A, ldc.i4:int32(0))
stloc:uint8[](var_2_13, call:uint8[](Pkcs12ParametersGenerator::GenerateDerivedKey, ldloc:Pkcs12ParametersGenerator(this), ldc.i4:int32(2), ldloc:int32(ivSize)))
stloc:KeyParameter(var_3_1D, newobj:KeyParameter(KeyParameter::.ctor, ldloc:uint8[](var_0_08), ldloc:int32(var_5), ldloc:int32(var_1_0A)))
stloc:int32(var_5, ldc.i4:int32(0))
stloc:ParametersWithIV(var_6_2C, newobj:ParametersWithIV(ParametersWithIV::.ctor, ldloc:KeyParameter[exp:ICipherParameters](var_3_1D), ldloc:uint8[](var_2_13), ldloc:int32(var_7), ldloc:uint64[exp:int32](var_4)))
stloc:int32(var_7, ldc.i4:int32(0))
}
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: 0x06009AB0 RID: 39600 RVA: 0x00229288 File Offset: 0x00227488
[Token(Token = "0x6009AB0")]
[Address(RVA = "0x1F5A6F0", Offset = "0x1F590F0", VA = "0x181F5A6F0", Slot = "11")]
public override ICipherParameters GenerateDerivedParameters(string algorithm, int keySize, int ivSize)
{
/*
An exception occurred when decompiling this method (06009AB0)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators.Pkcs12ParametersGenerator::GenerateDerivedParameters(System.String,System.Int32,System.Int32)
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:uint8[](var_0_08, call:uint8[](Pkcs12ParametersGenerator::GenerateDerivedKey, ldloc:Pkcs12ParametersGenerator(this), ldc.i4:int32(1), ldloc:int32(keySize)))
stloc:int32(var_2_0A, ldc.i4:int32(0))
stloc:KeyParameter(var_3_14, call:KeyParameter(ParameterUtilities::CreateKeyParameter, ldloc:string(algorithm), ldloc:uint8[](var_0_08), ldloc:int32(var_2_0A), ldloc:int32(keySize)))
stloc:uint8[](var_4_1D, call:uint8[](Pkcs12ParametersGenerator::GenerateDerivedKey, ldloc:Pkcs12ParametersGenerator(this), ldc.i4:int32(2), ldloc:int32(var_2_0A)))
stloc:ParametersWithIV(var_5_2A, newobj:ParametersWithIV(ParametersWithIV::.ctor, ldloc:KeyParameter[exp:ICipherParameters](var_3_14), ldloc:uint8[](var_4_1D), ldloc:int32(var_6), ldloc:uint64[exp:int32](var_1)))
stloc:int32(var_6, ldc.i4:int32(0))
}
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: 0x06009AB1 RID: 39601 RVA: 0x002292C4 File Offset: 0x002274C4
[Token(Token = "0x6009AB1")]
[Address(RVA = "0x1F5A5D0", Offset = "0x1F58FD0", VA = "0x181F5A5D0", Slot = "12")]
public override ICipherParameters GenerateDerivedMacParameters(int keySize)
{
/*
An exception occurred when decompiling this method (06009AB1)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators.Pkcs12ParametersGenerator::GenerateDerivedMacParameters(System.Int32)
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:KeyParameter(var_0_0F, newobj:KeyParameter(KeyParameter::.ctor, call:uint8[](Pkcs12ParametersGenerator::GenerateDerivedKey, ldloc:Pkcs12ParametersGenerator(this), ldc.i4:int32(3), ldloc:int32(keySize)), ldloc:int32(var_2), ldloc:int32(keySize)))
stloc:int32(var_2, ldc.i4:int32(0))
}
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: 0x0400656F RID: 25967
[Token(Token = "0x400656F")]
public const int KeyMaterial = 1;
// Token: 0x04006570 RID: 25968
[Token(Token = "0x4006570")]
public const int IVMaterial = 2;
// Token: 0x04006571 RID: 25969
[Token(Token = "0x4006571")]
public const int MacMaterial = 3;
// Token: 0x04006572 RID: 25970
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x4006572")]
private readonly IDigest digest;
// Token: 0x04006573 RID: 25971
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
[Token(Token = "0x4006573")]
private readonly int u;
// Token: 0x04006574 RID: 25972
[global::Cpp2IlInjected.FieldOffset(Offset = "0x34")]
[Token(Token = "0x4006574")]
private readonly int v;
}
}
@@ -0,0 +1,113 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
{
// Token: 0x0200169B RID: 5787
[Token(Token = "0x200169B")]
[StructLayout(3)]
public class Pkcs5S1ParametersGenerator : PbeParametersGenerator
{
// Token: 0x06009AB2 RID: 39602 RVA: 0x002292E4 File Offset: 0x002274E4
[Token(Token = "0x6009AB2")]
[Address(RVA = "0x1F5B1A0", Offset = "0x1F59BA0", VA = "0x181F5B1A0")]
public Pkcs5S1ParametersGenerator(IDigest digest)
{
this.digest = digest;
}
// Token: 0x06009AB3 RID: 39603 RVA: 0x00229300 File Offset: 0x00227500
[Token(Token = "0x6009AB3")]
[Address(RVA = "0x1F5AA20", Offset = "0x1F59420", VA = "0x181F5AA20")]
private byte[] GenerateDerivedKey()
{
IDigest digest = this.digest;
byte[] array = new byte[0];
byte[] mPassword = this.mPassword;
IDigest digest2 = this.digest;
int length = mPassword.Length;
int num = 0;
byte[] mSalt = this.mSalt;
IDigest digest3 = this.digest;
int length2 = mSalt.Length;
IDigest digest4 = this.digest;
IDigest digest5 = this.digest;
if (num < digest4)
{
num += num;
num++;
}
int num2 = 0;
IDigest digest6 = this.digest;
if (num < num2)
{
num += num;
num++;
}
uint num3;
num3 += (uint)1;
return array;
}
// Token: 0x06009AB4 RID: 39604 RVA: 0x0022939C File Offset: 0x0022759C
[Token(Token = "0x6009AB4")]
[Address(RVA = "0x1F59C10", Offset = "0x1F58610", VA = "0x181F59C10", Slot = "8")]
public override ICipherParameters GenerateDerivedParameters(int keySize)
{
return base.GenerateDerivedParameters(keySize);
}
// Token: 0x06009AB5 RID: 39605 RVA: 0x002293B0 File Offset: 0x002275B0
[Token(Token = "0x6009AB5")]
[Address(RVA = "0x1F5AF00", Offset = "0x1F59900", VA = "0x181F5AF00", Slot = "9")]
public override ICipherParameters GenerateDerivedParameters(string algorithm, int keySize)
{
IDigest digest = this.digest;
byte[] array = this.GenerateDerivedKey();
int num = 0;
KeyParameter keyParameter = ParameterUtilities.CreateKeyParameter(algorithm, array, num, keySize);
throw new NullReferenceException();
}
// Token: 0x06009AB6 RID: 39606 RVA: 0x002293E0 File Offset: 0x002275E0
[Token(Token = "0x6009AB6")]
[Address(RVA = "0x1F5ADA0", Offset = "0x1F597A0", VA = "0x181F5ADA0", Slot = "10")]
public override ICipherParameters GenerateDerivedParameters(int keySize, int ivSize)
{
IDigest digest = this.digest;
byte[] array = this.GenerateDerivedKey();
throw new NullReferenceException();
}
// Token: 0x06009AB7 RID: 39607 RVA: 0x00229400 File Offset: 0x00227600
[Token(Token = "0x6009AB7")]
[Address(RVA = "0x1F5B020", Offset = "0x1F59A20", VA = "0x181F5B020", Slot = "11")]
public override ICipherParameters GenerateDerivedParameters(string algorithm, int keySize, int ivSize)
{
IDigest digest = this.digest;
byte[] array = this.GenerateDerivedKey();
int num = 0;
ulong num2;
ParametersWithIV parametersWithIV = new ParametersWithIV(ParameterUtilities.CreateKeyParameter(algorithm, array, num, ivSize), array, ivSize, (int)num2);
throw new NullReferenceException();
}
// Token: 0x06009AB8 RID: 39608 RVA: 0x00229438 File Offset: 0x00227638
[Token(Token = "0x6009AB8")]
[Address(RVA = "0x1F5AC90", Offset = "0x1F59690", VA = "0x181F5AC90", Slot = "12")]
public override ICipherParameters GenerateDerivedMacParameters(int keySize)
{
IDigest digest = this.digest;
byte[] array = this.GenerateDerivedKey();
throw new NullReferenceException();
}
// Token: 0x04006575 RID: 25973
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x4006575")]
private readonly IDigest digest;
}
}
@@ -0,0 +1,217 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
{
// Token: 0x0200169C RID: 5788
[Token(Token = "0x200169C")]
[StructLayout(3)]
public class Pkcs5S2ParametersGenerator : PbeParametersGenerator
{
// Token: 0x06009AB9 RID: 39609 RVA: 0x00229458 File Offset: 0x00227658
[Token(Token = "0x6009AB9")]
[Address(RVA = "0x1F5B8B0", Offset = "0x1F5A2B0", VA = "0x181F5B8B0")]
public Pkcs5S2ParametersGenerator()
{
Sha1Digest sha1Digest = new Sha1Digest();
}
// Token: 0x06009ABA RID: 39610 RVA: 0x0022946C File Offset: 0x0022766C
[Token(Token = "0x6009ABA")]
[Address(RVA = "0x1F5B910", Offset = "0x1F5A310", VA = "0x181F5B910")]
public Pkcs5S2ParametersGenerator(IDigest digest)
{
HMac hmac = new HMac(digest);
this.hMac = hmac;
byte[] array = new byte[hmac];
this.state = array;
}
// Token: 0x06009ABB RID: 39611 RVA: 0x002294A4 File Offset: 0x002276A4
[Token(Token = "0x6009ABB")]
[Address(RVA = "0x1F5B1D0", Offset = "0x1F59BD0", VA = "0x181F5B1D0")]
private void F(byte[] S, int c, byte[] iBuf, byte[] outBytes, int outOff)
{
/*
An exception occurred when decompiling this method (06009ABB)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators.Pkcs5S2ParametersGenerator::F(System.Byte[],System.Int32,System.Byte[],System.Byte[],System.Int32)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_78:
stloc:ArgumentException(var_12_82, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("iteration count must be at least 1.")))
}
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: 0x06009ABC RID: 39612 RVA: 0x00229534 File Offset: 0x00227734
[Token(Token = "0x6009ABC")]
[Address(RVA = "0x1F5B420", Offset = "0x1F59E20", VA = "0x181F5B420")]
private byte[] GenerateDerivedKey(int dkLen)
{
IMac mac = this.hMac;
int num = dkLen - 1;
byte[] array = new byte[4];
byte[] array2 = new byte[num];
byte[] mPassword = this.mPassword;
int num2 = 0;
KeyParameter keyParameter = new KeyParameter(mPassword);
IMac mac2 = this.hMac;
uint num3;
if (num3 == (uint)array.Length)
{
}
int mIterationCount = this.mIterationCount;
byte[] mSalt = this.mSalt;
this.F(mSalt, mIterationCount, array, array2, num2);
uint num4;
num4 += (uint)1;
while (num4 <= (uint)num)
{
}
return array2;
}
// Token: 0x06009ABD RID: 39613 RVA: 0x002295B8 File Offset: 0x002277B8
[Token(Token = "0x6009ABD")]
[Address(RVA = "0x1F59C10", Offset = "0x1F58610", VA = "0x181F59C10", Slot = "8")]
public override ICipherParameters GenerateDerivedParameters(int keySize)
{
return base.GenerateDerivedParameters(keySize);
}
// Token: 0x06009ABE RID: 39614 RVA: 0x002295CC File Offset: 0x002277CC
[Token(Token = "0x6009ABE")]
[Address(RVA = "0x1F5B810", Offset = "0x1F5A210", VA = "0x181F5B810", Slot = "9")]
public override ICipherParameters GenerateDerivedParameters(string algorithm, int keySize)
{
/*
An exception occurred when decompiling this method (06009ABE)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators.Pkcs5S2ParametersGenerator::GenerateDerivedParameters(System.String,System.Int32)
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:uint8[](var_0_07, call:uint8[](Pkcs5S2ParametersGenerator::GenerateDerivedKey, ldloc:Pkcs5S2ParametersGenerator(this), ldloc:int32(keySize)))
stloc:int32(var_2_09, ldc.i4:int32(0))
stloc:KeyParameter(var_3_13, call:KeyParameter(ParameterUtilities::CreateKeyParameter, ldloc:string(algorithm), ldloc:uint8[](var_0_07), ldloc:int32(var_2_09), ldloc:int32(keySize)))
}
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: 0x06009ABF RID: 39615 RVA: 0x002295EC File Offset: 0x002277EC
[Token(Token = "0x6009ABF")]
[Address(RVA = "0x1F5B730", Offset = "0x1F5A130", VA = "0x181F5B730", Slot = "10")]
public override ICipherParameters GenerateDerivedParameters(int keySize, int ivSize)
{
/*
An exception occurred when decompiling this method (06009ABF)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators.Pkcs5S2ParametersGenerator::GenerateDerivedParameters(System.Int32,System.Int32)
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:uint8[](var_0_07, call:uint8[](Pkcs5S2ParametersGenerator::GenerateDerivedKey, ldloc:Pkcs5S2ParametersGenerator(this), ldloc:int32(keySize)))
}
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: 0x06009AC0 RID: 39616 RVA: 0x00229600 File Offset: 0x00227800
[Token(Token = "0x6009AC0")]
[Address(RVA = "0x1F5B630", Offset = "0x1F5A030", VA = "0x181F5B630", Slot = "11")]
public override ICipherParameters GenerateDerivedParameters(string algorithm, int keySize, int ivSize)
{
/*
An exception occurred when decompiling this method (06009AC0)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators.Pkcs5S2ParametersGenerator::GenerateDerivedParameters(System.String,System.Int32,System.Int32)
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:int32(var_2_01, ldc.i4:int32(0))
stloc:ParametersWithIV(var_3_13, newobj:ParametersWithIV(ParametersWithIV::.ctor, call:KeyParameter[exp:ICipherParameters](ParameterUtilities::CreateKeyParameter, ldloc:string(algorithm), ldloc:uint8[](var_0), ldloc:int32(var_2_01), ldloc:int32(ivSize)), ldloc:uint8[](var_0), ldloc:int32(ivSize), ldloc:int32(keySize)))
}
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: 0x06009AC1 RID: 39617 RVA: 0x00229620 File Offset: 0x00227820
[Token(Token = "0x6009AC1")]
[Address(RVA = "0x1F5B5A0", Offset = "0x1F59FA0", VA = "0x181F5B5A0", Slot = "12")]
public override ICipherParameters GenerateDerivedMacParameters(int keySize)
{
/*
An exception occurred when decompiling this method (06009AC1)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators.Pkcs5S2ParametersGenerator::GenerateDerivedMacParameters(System.Int32)
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:KeyParameter(var_0_0E, newobj:KeyParameter(KeyParameter::.ctor, call:uint8[](Pkcs5S2ParametersGenerator::GenerateDerivedKey, ldloc:Pkcs5S2ParametersGenerator(this), ldloc:int32(keySize)), ldloc:int32(var_2), ldloc:int32(keySize)))
stloc:int32(var_2, ldc.i4:int32(0))
}
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: 0x04006576 RID: 25974
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x4006576")]
private readonly IMac hMac;
// Token: 0x04006577 RID: 25975
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
[Token(Token = "0x4006577")]
private readonly byte[] state;
}
}
@@ -0,0 +1,108 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
{
// Token: 0x0200169D RID: 5789
[Token(Token = "0x200169D")]
[StructLayout(3)]
public class Poly1305KeyGenerator : CipherKeyGenerator
{
// Token: 0x06009AC2 RID: 39618 RVA: 0x00229640 File Offset: 0x00227840
[Token(Token = "0x6009AC2")]
[Address(RVA = "0x1F5BDC0", Offset = "0x1F5A7C0", VA = "0x181F5BDC0", Slot = "4")]
protected override void engineInit(KeyGenerationParameters param)
{
SecureRandom random = param.random;
this.random = random;
this.strength = (int)((ulong)32L);
}
// Token: 0x06009AC3 RID: 39619 RVA: 0x0022966C File Offset: 0x0022786C
[Token(Token = "0x6009AC3")]
[Address(RVA = "0x1F5BCA0", Offset = "0x1F5A6A0", VA = "0x181F5BCA0", Slot = "5")]
protected override byte[] engineGenerateKey()
{
byte[] array;
do
{
array = base.engineGenerateKey();
}
while (array.Length != 32);
return array;
}
// Token: 0x06009AC4 RID: 39620 RVA: 0x00229694 File Offset: 0x00227894
[Token(Token = "0x6009AC4")]
[Address(RVA = "0x1F5BB90", Offset = "0x1F5A590", VA = "0x181F5BB90")]
public static void Clamp(byte[] key)
{
while (key.Length != 32)
{
}
}
// Token: 0x06009AC5 RID: 39621 RVA: 0x002296B4 File Offset: 0x002278B4
[Token(Token = "0x6009AC5")]
[Address(RVA = "0x1F5B9B0", Offset = "0x1F5A3B0", VA = "0x181F5B9B0")]
public static void CheckKey(byte[] key)
{
while (key.Length != 32)
{
}
byte b = key[0];
byte b2 = key[0];
byte b3 = key[1];
byte b4 = key[1];
byte b5 = key[0];
byte b6 = key[1];
byte b7 = key[1];
}
// Token: 0x06009AC6 RID: 39622 RVA: 0x0022970C File Offset: 0x0022790C
[Token(Token = "0x6009AC6")]
[Address(RVA = "0x1F5BB10", Offset = "0x1F5A510", VA = "0x181F5BB10")]
private static void CheckMask(byte b, byte mask)
{
/*
An exception occurred when decompiling this method (06009AC6)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators.Poly1305KeyGenerator::CheckMask(System.Byte,System.Byte)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_05:
stloc:ArgumentException(var_0_0F, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("Invalid format for r portion of Poly1305 key.")))
}
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: 0x06009AC7 RID: 39623 RVA: 0x00229728 File Offset: 0x00227928
[Token(Token = "0x6009AC7")]
[Address(RVA = "0x1F4F4B0", Offset = "0x1F4DEB0", VA = "0x181F4F4B0")]
public Poly1305KeyGenerator()
{
}
// Token: 0x04006578 RID: 25976
[Token(Token = "0x4006578")]
private const byte R_MASK_LOW_2 = 252;
// Token: 0x04006579 RID: 25977
[Token(Token = "0x4006579")]
private const byte R_MASK_HIGH_4 = 15;
}
}
@@ -0,0 +1,93 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
{
// Token: 0x0200169E RID: 5790
[Token(Token = "0x200169E")]
[StructLayout(3)]
public class RsaBlindingFactorGenerator
{
// Token: 0x06009AC8 RID: 39624 RVA: 0x0022973C File Offset: 0x0022793C
[Token(Token = "0x6009AC8")]
[Address(RVA = "0x1F5BF90", Offset = "0x1F5A990", VA = "0x181F5BF90")]
public void Init(ICipherParameters param)
{
/*
An exception occurred when decompiling this method (06009AC8)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators.RsaBlindingFactorGenerator::Init(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_56:
stloc:ArgumentException(var_7_60, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("generator requires RSA public key")))
}
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.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: 0x06009AC9 RID: 39625 RVA: 0x002297AC File Offset: 0x002279AC
[Token(Token = "0x6009AC9")]
[Address(RVA = "0x1F5BDF0", Offset = "0x1F5A7F0", VA = "0x181F5BDF0")]
public BigInteger GenerateBlindingFactor()
{
/*
An exception occurred when decompiling this method (06009AC9)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Math.BigInteger BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators.RsaBlindingFactorGenerator::GenerateBlindingFactor()
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_46:
stloc:InvalidOperationException(var_7_50, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("generator not initialised")))
}
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: 0x06009ACA RID: 39626 RVA: 0x0022980C File Offset: 0x00227A0C
[Token(Token = "0x6009ACA")]
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
public RsaBlindingFactorGenerator()
{
}
// Token: 0x0400657A RID: 25978
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x400657A")]
private RsaKeyParameters key;
// Token: 0x0400657B RID: 25979
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x400657B")]
private SecureRandom random;
}
}
@@ -0,0 +1,161 @@
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
{
// Token: 0x0200169F RID: 5791
[Token(Token = "0x200169F")]
[StructLayout(3)]
public class RsaKeyPairGenerator : IAsymmetricCipherKeyPairGenerator
{
// Token: 0x06009ACB RID: 39627 RVA: 0x00229820 File Offset: 0x00227A20
[Token(Token = "0x6009ACB")]
[Address(RVA = "0x1F5C7D0", Offset = "0x1F5B1D0", VA = "0x181F5C7D0", Slot = "6")]
public virtual void Init(KeyGenerationParameters parameters)
{
while (parameters != 0 && parameters != 0)
{
if (parameters != 0)
{
this.parameters = parameters;
return;
}
}
BigInteger defaultPublicExponent = RsaKeyPairGenerator.DefaultPublicExponent;
SecureRandom random = parameters.random;
int strength = parameters.strength;
ulong num;
RsaKeyGenerationParameters rsaKeyGenerationParameters = new RsaKeyGenerationParameters(defaultPublicExponent, random, strength, (int)num);
this.parameters = rsaKeyGenerationParameters;
}
// Token: 0x06009ACC RID: 39628 RVA: 0x0022987C File Offset: 0x00227A7C
[Token(Token = "0x6009ACC")]
[Address(RVA = "0x1F5C3F0", Offset = "0x1F5ADF0", VA = "0x181F5C3F0", Slot = "7")]
public virtual AsymmetricCipherKeyPair GenerateKeyPair()
{
RsaKeyGenerationParameters rsaKeyGenerationParameters = this.parameters;
int num = rsaKeyGenerationParameters.strength;
int num2 = num + 1;
num -= num2;
BigInteger publicExponent = rsaKeyGenerationParameters.publicExponent;
AsymmetricCipherKeyPair asymmetricCipherKeyPair = this.GenerateKeyPair();
AsymmetricCipherKeyPair asymmetricCipherKeyPair2 = this.GenerateKeyPair();
BigInteger bigInteger;
int bitLength = bigInteger.Abs().BitLength;
BigInteger bigInteger2;
if (bigInteger2.BitLength == num)
{
int nafWeight = WNafUtilities.GetNafWeight(bigInteger2);
}
BigInteger one = RsaKeyPairGenerator.One;
BigInteger one2 = RsaKeyPairGenerator.One;
BigInteger bigInteger4;
BigInteger bigInteger5;
BigInteger bigInteger3 = bigInteger4.Gcd(bigInteger5);
BigInteger bigInteger6 = bigInteger4.Divide(bigInteger3).Multiply(bigInteger5);
BigInteger bigInteger7 = publicExponent.ModInverse(bigInteger6);
int bitLength2 = bigInteger7.BitLength;
RsaKeyGenerationParameters rsaKeyGenerationParameters2 = this.parameters;
BigInteger bigInteger8 = bigInteger7.Remainder(bigInteger4);
BigInteger bigInteger9 = bigInteger7.Remainder(bigInteger5);
RsaKeyParameters rsaKeyParameters;
RsaPrivateCrtKeyParameters rsaPrivateCrtKeyParameters;
return new AsymmetricCipherKeyPair(rsaKeyParameters, rsaPrivateCrtKeyParameters);
}
// Token: 0x06009ACD RID: 39629 RVA: 0x00229944 File Offset: 0x00227B44
[Token(Token = "0x6009ACD")]
[Address(RVA = "0x1F5C170", Offset = "0x1F5AB70", VA = "0x181F5C170", Slot = "8")]
protected virtual BigInteger ChooseRandomPrime(int bitlength, BigInteger e)
{
BigInteger bigInteger;
for (;;)
{
int bitLength = e.BitLength;
int[] special_E_VALUES = RsaKeyPairGenerator.SPECIAL_E_VALUES;
int intValue = e.IntValue;
bool flag = Arrays.Contains(special_E_VALUES, intValue);
SecureRandom random = this.parameters.random;
bigInteger = new BigInteger(intValue, 1, random);
BigInteger bigInteger2 = bigInteger.Mod(e);
int certainty = this.parameters.certainty;
if (bigInteger.IsProbablePrime(certainty, true))
{
if (flag)
{
break;
}
BigInteger one = RsaKeyPairGenerator.One;
BigInteger bigInteger3 = bigInteger.Subtract(one);
if (e.Gcd(bigInteger3) != 0)
{
break;
}
}
}
return bigInteger;
}
// Token: 0x06009ACE RID: 39630 RVA: 0x002299DC File Offset: 0x00227BDC
[Token(Token = "0x6009ACE")]
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
public RsaKeyPairGenerator()
{
}
// Token: 0x06009ACF RID: 39631 RVA: 0x002299F0 File Offset: 0x00227BF0
// Note: this type is marked as 'beforefieldinit'.
[Token(Token = "0x6009ACF")]
[Address(RVA = "0x1F5C930", Offset = "0x1F5B330", VA = "0x181F5C930")]
static RsaKeyPairGenerator()
{
int[] array = new int[5];
RuntimeHelpers.InitializeArray(array, fieldof(<PrivateImplementationDetails>.1D3E73DD251585C4908CBA58A179E1911834C891).FieldHandle);
RsaKeyPairGenerator.SPECIAL_E_VALUES = array;
int[] special_E_VALUES = RsaKeyPairGenerator.SPECIAL_E_VALUES;
int num = special_E_VALUES.Length - 1;
RsaKeyPairGenerator.SPECIAL_E_HIGHEST = special_E_VALUES[num];
RsaKeyPairGenerator.SPECIAL_E_BITS = BigInteger.ValueOf((long)RsaKeyPairGenerator.SPECIAL_E_HIGHEST).BitLength;
RsaKeyPairGenerator.One = BigInteger.One;
BigInteger bigInteger;
RsaKeyPairGenerator.DefaultPublicExponent = bigInteger;
}
// Token: 0x0400657C RID: 25980
[Token(Token = "0x400657C")]
private static readonly int[] SPECIAL_E_VALUES;
// Token: 0x0400657D RID: 25981
[Token(Token = "0x400657D")]
private static readonly int SPECIAL_E_HIGHEST;
// Token: 0x0400657E RID: 25982
[Token(Token = "0x400657E")]
private static readonly int SPECIAL_E_BITS;
// Token: 0x0400657F RID: 25983
[Token(Token = "0x400657F")]
protected static readonly BigInteger One;
// Token: 0x04006580 RID: 25984
[Token(Token = "0x4006580")]
protected static readonly BigInteger DefaultPublicExponent;
// Token: 0x04006581 RID: 25985
[Token(Token = "0x4006581")]
protected const int DefaultTests = 100;
// Token: 0x04006582 RID: 25986
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006582")]
protected RsaKeyGenerationParameters parameters;
}
}
@@ -0,0 +1,288 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
{
// Token: 0x020016A0 RID: 5792
[Token(Token = "0x20016A0")]
[StructLayout(3)]
public class SCrypt
{
// Token: 0x06009AD0 RID: 39632 RVA: 0x00229A5C File Offset: 0x00227C5C
[Token(Token = "0x6009AD0")]
[Address(RVA = "0x1F5CCB0", Offset = "0x1F5B6B0", VA = "0x181F5CCB0")]
public static byte[] Generate(byte[] P, byte[] S, int N, int r, int p, int dkLen)
{
/*
An exception occurred when decompiling this method (06009AD0)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Byte[] BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators.SCrypt::Generate(System.Byte[],System.Byte[],System.Int32,System.Int32,System.Int32,System.Int32)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_2D:
stloc:ArgumentException(var_4_37, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("Cost parameter N must be > 1 and < 65536.")))
}
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.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.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.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: 0x06009AD1 RID: 39633 RVA: 0x00229AA4 File Offset: 0x00227CA4
[Token(Token = "0x6009AD1")]
[Address(RVA = "0x1F5D010", Offset = "0x1F5BA10", VA = "0x181F5D010")]
private static byte[] MFcrypt(byte[] P, byte[] S, int N, int r, int p, int dkLen)
{
int num;
do
{
num = 0;
byte[] array = SCrypt.SingleIterationPBKDF2(P, S, N);
int length = array.Length;
uint[] array2 = new uint[length];
int num2 = 0;
Pack.LE_To_UInt32(array, num2, array2);
if (num < length)
{
num += r;
}
int num3 = 0;
Pack.UInt32_To_LE(array2, array, num3);
int num4 = 0;
Array[] array3 = new Array[2];
if (array != 0)
{
}
array3[0] = array;
if (array2 != 0)
{
}
array3[1] = array2;
int length2 = array3.Length;
if (num4 < length2)
{
Array array4 = array3[num4];
if (array4 != 0)
{
int num5 = array4.System.Collections.ICollection.Count;
int num6 = 0;
Array.Clear(array4, num6, num5);
}
num4++;
}
if (num != -1)
{
}
}
while (num != 0);
byte[] array5;
return array5;
}
// Token: 0x06009AD2 RID: 39634 RVA: 0x00229B6C File Offset: 0x00227D6C
[Token(Token = "0x6009AD2")]
[Address(RVA = "0x1F5D8A0", Offset = "0x1F5C2A0", VA = "0x181F5D8A0")]
private static byte[] SingleIterationPBKDF2(byte[] P, byte[] S, int dkLen)
{
ICipherParameters cipherParameters;
do
{
string text = new Pkcs5S2ParametersGenerator(new Sha256Digest()).ToString();
}
while (cipherParameters == 0 || cipherParameters == 0);
byte[] array;
return array;
}
// Token: 0x06009AD3 RID: 39635 RVA: 0x00229BA0 File Offset: 0x00227DA0
[Token(Token = "0x6009AD3")]
[Address(RVA = "0x1F5D2D0", Offset = "0x1F5BCD0", VA = "0x181F5D2D0")]
private static void SMix(uint[] B, int BOff, int N, int r)
{
uint[] array7;
do
{
int num = 0;
uint[] array = new uint[0];
uint[] array2 = new uint[0];
uint[] array3 = new uint[r];
uint[] array4 = new uint[r];
uint[][] array5 = new uint[r][];
int num2 = 0;
Array.Copy(B, r, array4, num2, r);
if (num < N)
{
if (array5 != 0 && (array5 == 0 || array5 == 0))
{
goto IL_151;
}
array5[0] = num;
num++;
}
if (num < N)
{
int num3 = array4.Length;
uint num4 = array4[num];
uint[] array6 = array5[(int)num4];
num3--;
num++;
}
int num5 = 0;
int length = array5.Length;
if (num5 < length)
{
array7 = array5[num5];
if (array7 != 0)
{
int num6 = 0;
Array.Clear(array7, num6, num5);
}
num5++;
}
Array[] array8 = new Array[4];
if (array4 != 0)
{
}
array8[0] = array4;
if (array8 != 0)
{
}
array8[1] = array8;
if (array8 != 0)
{
}
array8[2] = array8;
if (array8 != 0)
{
}
array8[3] = array8;
int length2 = array8.Length;
if (num5 < length2)
{
Array array9 = array8[num5];
if (array9 != 0)
{
int num7 = array9.System.Collections.ICollection.Count;
int num8 = 0;
Array.Clear(array9, num8, num7);
}
num5++;
}
if (num != -1)
{
}
}
while (array7 != 0);
return;
IL_151:
throw new IndexOutOfRangeException();
}
// Token: 0x06009AD4 RID: 39636 RVA: 0x00229D4C File Offset: 0x00227F4C
[Token(Token = "0x6009AD4")]
[Address(RVA = "0x1F5CA80", Offset = "0x1F5B480", VA = "0x181F5CA80")]
private static void BlockMix(uint[] B, uint[] X1, uint[] X2, uint[] Y, int r)
{
int length = B.Length;
int num = 0;
ulong num2;
Array.Copy(B, length, X1, num, (int)num2);
int num3 = B.Length;
int num4 = 0;
int num5 = 0;
SCrypt.Xor(X1, B, num4, X2);
Salsa20Engine.SalsaCore(8, X2, X1);
int num6 = 0;
ulong num7;
Array.Copy(X1, num6, Y, num5, (int)num7);
num3 -= num5;
num3 += num4;
num4 += 16;
int length2 = Y.Length;
int num8 = 0;
int num9 = 0;
Array.Copy(Y, num9, B, num8, (int)num2);
}
// Token: 0x06009AD5 RID: 39637 RVA: 0x00229DD4 File Offset: 0x00227FD4
[Token(Token = "0x6009AD5")]
[Address(RVA = "0x1F5DA10", Offset = "0x1F5C410", VA = "0x181F5DA10")]
private static void Xor(uint[] a, uint[] b, int bOff, uint[] output)
{
int length = output.Length;
uint num = b[bOff];
output[0] = num;
}
// Token: 0x06009AD6 RID: 39638 RVA: 0x00229E00 File Offset: 0x00228000
[Token(Token = "0x6009AD6")]
[Address(RVA = "0x1F5CC80", Offset = "0x1F5B680", VA = "0x181F5CC80")]
private static void Clear(Array array)
{
if (array != 0)
{
int num = array.System.Collections.ICollection.Count;
int num2 = 0;
Array.Clear(array, num2, num);
}
}
// Token: 0x06009AD7 RID: 39639 RVA: 0x00229E24 File Offset: 0x00228024
[Token(Token = "0x6009AD7")]
[Address(RVA = "0x1F5CC00", Offset = "0x1F5B600", VA = "0x181F5CC00")]
private static void ClearAll(params Array[] arrays)
{
int num = 0;
int length = arrays.Length;
if (num < length)
{
Array array = arrays[num];
if (array != 0)
{
int num2 = array.System.Collections.ICollection.Count;
int num3 = 0;
Array.Clear(array, num3, num2);
}
num++;
}
}
// Token: 0x06009AD8 RID: 39640 RVA: 0x00229E68 File Offset: 0x00228068
[Token(Token = "0x6009AD8")]
[Address(RVA = "0x1F5D000", Offset = "0x1F5BA00", VA = "0x181F5D000")]
private static bool IsPowerOf2(int x)
{
int num = x - 1;
return x == num;
}
// Token: 0x06009AD9 RID: 39641 RVA: 0x00229E80 File Offset: 0x00228080
[Token(Token = "0x6009AD9")]
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
public SCrypt()
{
}
}
}
@@ -0,0 +1,44 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
{
// Token: 0x020016A1 RID: 5793
[Token(Token = "0x20016A1")]
[StructLayout(3)]
public class X25519KeyPairGenerator : IAsymmetricCipherKeyPairGenerator
{
// Token: 0x06009ADA RID: 39642 RVA: 0x00229E94 File Offset: 0x00228094
[Token(Token = "0x6009ADA")]
[Address(RVA = "0x14EC8F0", Offset = "0x14EB2F0", VA = "0x1814EC8F0", Slot = "6")]
public virtual void Init(KeyGenerationParameters parameters)
{
SecureRandom secureRandom = parameters.random;
this.random = secureRandom;
}
// Token: 0x06009ADB RID: 39643 RVA: 0x00229EB8 File Offset: 0x002280B8
[Token(Token = "0x6009ADB")]
[Address(RVA = "0x1F62110", Offset = "0x1F60B10", VA = "0x181F62110", Slot = "7")]
public virtual AsymmetricCipherKeyPair GenerateKeyPair()
{
X25519PrivateKeyParameters x25519PrivateKeyParameters = new X25519PrivateKeyParameters(this.random);
return new AsymmetricCipherKeyPair(x25519PrivateKeyParameters.GeneratePublicKey(), x25519PrivateKeyParameters);
}
// Token: 0x06009ADC RID: 39644 RVA: 0x00229EE4 File Offset: 0x002280E4
[Token(Token = "0x6009ADC")]
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
public X25519KeyPairGenerator()
{
}
// Token: 0x04006583 RID: 25987
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006583")]
private SecureRandom random;
}
}
@@ -0,0 +1,44 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
{
// Token: 0x020016A2 RID: 5794
[Token(Token = "0x20016A2")]
[StructLayout(3)]
public class X448KeyPairGenerator : IAsymmetricCipherKeyPairGenerator
{
// Token: 0x06009ADD RID: 39645 RVA: 0x00229EF8 File Offset: 0x002280F8
[Token(Token = "0x6009ADD")]
[Address(RVA = "0x14EC8F0", Offset = "0x14EB2F0", VA = "0x1814EC8F0", Slot = "6")]
public virtual void Init(KeyGenerationParameters parameters)
{
SecureRandom secureRandom = parameters.random;
this.random = secureRandom;
}
// Token: 0x06009ADE RID: 39646 RVA: 0x00229F1C File Offset: 0x0022811C
[Token(Token = "0x6009ADE")]
[Address(RVA = "0x1F621B0", Offset = "0x1F60BB0", VA = "0x181F621B0", Slot = "7")]
public virtual AsymmetricCipherKeyPair GenerateKeyPair()
{
X448PrivateKeyParameters x448PrivateKeyParameters = new X448PrivateKeyParameters(this.random);
return new AsymmetricCipherKeyPair(x448PrivateKeyParameters.GeneratePublicKey(), x448PrivateKeyParameters);
}
// Token: 0x06009ADF RID: 39647 RVA: 0x00229F48 File Offset: 0x00228148
[Token(Token = "0x6009ADF")]
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
public X448KeyPairGenerator()
{
}
// Token: 0x04006584 RID: 25988
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006584")]
private SecureRandom random;
}
}