a
This commit is contained in:
@@ -0,0 +1,421 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
||||
using Cpp2IlInjected;
|
||||
|
||||
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
|
||||
{
|
||||
// Token: 0x02001C5E RID: 7262
|
||||
[Token(Token = "0x2001C5E")]
|
||||
public sealed class BCrypt
|
||||
{
|
||||
// Token: 0x0600B604 RID: 46596 RVA: 0x0027C7A4 File Offset: 0x0027A9A4
|
||||
[Token(Token = "0x600B604")]
|
||||
[Address(RVA = "0x1A290D0", Offset = "0x1A27ED0", VA = "0x181A290D0")]
|
||||
private BCrypt()
|
||||
{
|
||||
uint[] array = new uint[1024];
|
||||
this.S = array;
|
||||
uint[] array2 = new uint[18];
|
||||
this.P = array2;
|
||||
}
|
||||
|
||||
// Token: 0x0600B605 RID: 46597 RVA: 0x0027C7D8 File Offset: 0x0027A9D8
|
||||
[Token(Token = "0x600B605")]
|
||||
[Address(RVA = "0x1A28560", Offset = "0x1A27360", VA = "0x181A28560")]
|
||||
private uint F(uint x)
|
||||
{
|
||||
int length = this.S.Length;
|
||||
return x;
|
||||
}
|
||||
|
||||
// Token: 0x0600B606 RID: 46598 RVA: 0x0027C7F8 File Offset: 0x0027A9F8
|
||||
[Token(Token = "0x600B606")]
|
||||
[Address(RVA = "0x1A28D90", Offset = "0x1A27B90", VA = "0x181A28D90")]
|
||||
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: 0x0600B607 RID: 46599 RVA: 0x0027C870 File Offset: 0x0027AA70
|
||||
[Token(Token = "0x600B607")]
|
||||
[Address(RVA = "0x1A28830", Offset = "0x1A27630", VA = "0x181A28830")]
|
||||
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: 0x0600B608 RID: 46600 RVA: 0x0027C91C File Offset: 0x0027AB1C
|
||||
[Token(Token = "0x600B608")]
|
||||
[Address(RVA = "0x1A27A60", Offset = "0x1A26860", VA = "0x181A27A60")]
|
||||
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: 0x0600B609 RID: 46601 RVA: 0x0027C958 File Offset: 0x0027AB58
|
||||
[Token(Token = "0x600B609")]
|
||||
[Address(RVA = "0x1A28090", Offset = "0x1A26E90", VA = "0x181A28090")]
|
||||
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: 0x0600B60A RID: 46602 RVA: 0x0027CAE0 File Offset: 0x0027ACE0
|
||||
[Token(Token = "0x600B60A")]
|
||||
[Address(RVA = "0x1A289E0", Offset = "0x1A277E0", VA = "0x181A289E0")]
|
||||
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: 0x0600B60B RID: 46603 RVA: 0x0027CBD0 File Offset: 0x0027ADD0
|
||||
[Token(Token = "0x600B60B")]
|
||||
[Address(RVA = "0x1A27B20", Offset = "0x1A26920", VA = "0x181A27B20")]
|
||||
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: 0x0600B60C RID: 46604 RVA: 0x0027CE5C File Offset: 0x0027B05C
|
||||
[Token(Token = "0x600B60C")]
|
||||
[Address(RVA = "0x1A28970", Offset = "0x1A27770", VA = "0x181A28970")]
|
||||
public static byte[] PasswordToByteArray(char[] password)
|
||||
{
|
||||
byte[] array = Strings.ToUtf8ByteArray(password);
|
||||
int num = 0;
|
||||
return Arrays.Append(array, (byte)num);
|
||||
}
|
||||
|
||||
// Token: 0x0600B60D RID: 46605 RVA: 0x0027CE7C File Offset: 0x0027B07C
|
||||
[Token(Token = "0x600B60D")]
|
||||
[Address(RVA = "0x1A28630", Offset = "0x1A27430", VA = "0x181A28630")]
|
||||
public static byte[] Generate(byte[] password, byte[] salt, int cost)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600B60D)
|
||||
|
||||
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 1660
|
||||
*/;
|
||||
}
|
||||
|
||||
// Token: 0x0600B60E RID: 46606 RVA: 0x0027CEE8 File Offset: 0x0027B0E8
|
||||
// Note: this type is marked as 'beforefieldinit'.
|
||||
[Token(Token = "0x600B60E")]
|
||||
[Address(RVA = "0x1A28F50", Offset = "0x1A27D50", VA = "0x181A28F50")]
|
||||
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: 0x0400736C RID: 29548
|
||||
[Token(Token = "0x400736C")]
|
||||
private static readonly uint[] MAGIC_STRING;
|
||||
|
||||
// Token: 0x0400736D RID: 29549
|
||||
[Token(Token = "0x400736D")]
|
||||
internal const int MAGIC_STRING_LENGTH = 6;
|
||||
|
||||
// Token: 0x0400736E RID: 29550
|
||||
[Token(Token = "0x400736E")]
|
||||
private static readonly uint[] KP;
|
||||
|
||||
// Token: 0x0400736F RID: 29551
|
||||
[Token(Token = "0x400736F")]
|
||||
private static readonly uint[] KS0;
|
||||
|
||||
// Token: 0x04007370 RID: 29552
|
||||
[Token(Token = "0x4007370")]
|
||||
private static readonly uint[] KS1;
|
||||
|
||||
// Token: 0x04007371 RID: 29553
|
||||
[Token(Token = "0x4007371")]
|
||||
private static readonly uint[] KS2;
|
||||
|
||||
// Token: 0x04007372 RID: 29554
|
||||
[Token(Token = "0x4007372")]
|
||||
private static readonly uint[] KS3;
|
||||
|
||||
// Token: 0x04007373 RID: 29555
|
||||
[Token(Token = "0x4007373")]
|
||||
private const int ROUNDS = 16;
|
||||
|
||||
// Token: 0x04007374 RID: 29556
|
||||
[Token(Token = "0x4007374")]
|
||||
private const int SBOX_SK = 256;
|
||||
|
||||
// Token: 0x04007375 RID: 29557
|
||||
[Token(Token = "0x4007375")]
|
||||
private const int SBOX_SK2 = 512;
|
||||
|
||||
// Token: 0x04007376 RID: 29558
|
||||
[Token(Token = "0x4007376")]
|
||||
private const int SBOX_SK3 = 768;
|
||||
|
||||
// Token: 0x04007377 RID: 29559
|
||||
[Token(Token = "0x4007377")]
|
||||
private const int P_SZ = 18;
|
||||
|
||||
// Token: 0x04007378 RID: 29560
|
||||
[FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x4007378")]
|
||||
private readonly uint[] S;
|
||||
|
||||
// Token: 0x04007379 RID: 29561
|
||||
[FieldOffset(Offset = "0x18")]
|
||||
[Token(Token = "0x4007379")]
|
||||
private readonly uint[] P;
|
||||
|
||||
// Token: 0x0400737A RID: 29562
|
||||
[Token(Token = "0x400737A")]
|
||||
internal const int SALT_SIZE_BYTES = 16;
|
||||
|
||||
// Token: 0x0400737B RID: 29563
|
||||
[Token(Token = "0x400737B")]
|
||||
internal const int MIN_COST = 4;
|
||||
|
||||
// Token: 0x0400737C RID: 29564
|
||||
[Token(Token = "0x400737C")]
|
||||
internal const int MAX_COST = 31;
|
||||
|
||||
// Token: 0x0400737D RID: 29565
|
||||
[Token(Token = "0x400737D")]
|
||||
internal const int MAX_PASSWORD_BYTES = 72;
|
||||
}
|
||||
}
|
||||
+137
@@ -0,0 +1,137 @@
|
||||
using System;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities;
|
||||
using Cpp2IlInjected;
|
||||
|
||||
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
|
||||
{
|
||||
// Token: 0x02001C5F RID: 7263
|
||||
[Token(Token = "0x2001C5F")]
|
||||
public class BaseKdfBytesGenerator : IDerivationFunction
|
||||
{
|
||||
// Token: 0x0600B60F RID: 46607 RVA: 0x0027CF9C File Offset: 0x0027B19C
|
||||
[Token(Token = "0x600B60F")]
|
||||
[Address(RVA = "0x4E6E10", Offset = "0x4E5C10", VA = "0x1804E6E10")]
|
||||
public BaseKdfBytesGenerator(int counterStart, IDigest digest)
|
||||
{
|
||||
this.counterStart = counterStart;
|
||||
this.digest = digest;
|
||||
}
|
||||
|
||||
// Token: 0x0600B610 RID: 46608 RVA: 0x0027CFC0 File Offset: 0x0027B1C0
|
||||
[Token(Token = "0x600B610")]
|
||||
[Address(RVA = "0x1A29510", Offset = "0x1A28310", VA = "0x181A29510", Slot = "7")]
|
||||
public virtual void Init(IDerivationParameters parameters)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600B610)
|
||||
|
||||
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 1660
|
||||
*/;
|
||||
}
|
||||
|
||||
// Token: 0x17001CB1 RID: 7345
|
||||
// (get) Token: 0x0600B611 RID: 46609 RVA: 0x0027D014 File Offset: 0x0027B214
|
||||
[Token(Token = "0x17001CB1")]
|
||||
public virtual IDigest Digest
|
||||
{
|
||||
[Token(Token = "0x600B611")]
|
||||
[Address(RVA = "0x3F5F40", Offset = "0x3F4D40", VA = "0x1803F5F40", Slot = "8")]
|
||||
get
|
||||
{
|
||||
return this.digest;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600B612 RID: 46610 RVA: 0x0027D028 File Offset: 0x0027B228
|
||||
[Token(Token = "0x600B612")]
|
||||
[Address(RVA = "0x1A29130", Offset = "0x1A27F30", VA = "0x181A29130", 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: 0x0400737E RID: 29566
|
||||
[FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x400737E")]
|
||||
private int counterStart;
|
||||
|
||||
// Token: 0x0400737F RID: 29567
|
||||
[FieldOffset(Offset = "0x18")]
|
||||
[Token(Token = "0x400737F")]
|
||||
private IDigest digest;
|
||||
|
||||
// Token: 0x04007380 RID: 29568
|
||||
[FieldOffset(Offset = "0x20")]
|
||||
[Token(Token = "0x4007380")]
|
||||
private byte[] shared;
|
||||
|
||||
// Token: 0x04007381 RID: 29569
|
||||
[FieldOffset(Offset = "0x28")]
|
||||
[Token(Token = "0x4007381")]
|
||||
private byte[] iv;
|
||||
}
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
using System;
|
||||
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: 0x02001C60 RID: 7264
|
||||
[Token(Token = "0x2001C60")]
|
||||
public class DHBasicKeyPairGenerator : IAsymmetricCipherKeyPairGenerator
|
||||
{
|
||||
// Token: 0x0600B613 RID: 46611 RVA: 0x0027D150 File Offset: 0x0027B350
|
||||
[Token(Token = "0x600B613")]
|
||||
[Address(RVA = "0x1A29800", Offset = "0x1A28600", VA = "0x181A29800", 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: 0x0600B614 RID: 46612 RVA: 0x0027D178 File Offset: 0x0027B378
|
||||
[Token(Token = "0x600B614")]
|
||||
[Address(RVA = "0x1A296B0", Offset = "0x1A284B0", VA = "0x181A296B0", 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: 0x0600B615 RID: 46613 RVA: 0x0027D1D4 File Offset: 0x0027B3D4
|
||||
[Token(Token = "0x600B615")]
|
||||
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
|
||||
public DHBasicKeyPairGenerator()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x04007382 RID: 29570
|
||||
[FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x4007382")]
|
||||
private DHKeyGenerationParameters param;
|
||||
}
|
||||
}
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
using System;
|
||||
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: 0x02001C61 RID: 7265
|
||||
[Token(Token = "0x2001C61")]
|
||||
internal class DHKeyGeneratorHelper
|
||||
{
|
||||
// Token: 0x0600B616 RID: 46614 RVA: 0x0027D1E8 File Offset: 0x0027B3E8
|
||||
[Token(Token = "0x600B616")]
|
||||
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
|
||||
private DHKeyGeneratorHelper()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x0600B617 RID: 46615 RVA: 0x0027D1FC File Offset: 0x0027B3FC
|
||||
[Token(Token = "0x600B617")]
|
||||
[Address(RVA = "0x1A298A0", Offset = "0x1A286A0", VA = "0x181A298A0")]
|
||||
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: 0x0600B618 RID: 46616 RVA: 0x0027D2A0 File Offset: 0x0027B4A0
|
||||
[Token(Token = "0x600B618")]
|
||||
[Address(RVA = "0x1A29AA0", Offset = "0x1A288A0", VA = "0x181A29AA0")]
|
||||
internal BigInteger CalculatePublic(DHParameters dhParams, BigInteger x)
|
||||
{
|
||||
BigInteger g = dhParams.g;
|
||||
BigInteger p = dhParams.p;
|
||||
return g.ModPow(x, p);
|
||||
}
|
||||
|
||||
// Token: 0x0600B619 RID: 46617 RVA: 0x0027D2CC File Offset: 0x0027B4CC
|
||||
// Note: this type is marked as 'beforefieldinit'.
|
||||
[Token(Token = "0x600B619")]
|
||||
[Address(RVA = "0x1A29AD0", Offset = "0x1A288D0", VA = "0x181A29AD0")]
|
||||
static DHKeyGeneratorHelper()
|
||||
{
|
||||
DHKeyGeneratorHelper dhkeyGeneratorHelper = new DHKeyGeneratorHelper();
|
||||
}
|
||||
|
||||
// Token: 0x04007383 RID: 29571
|
||||
[Token(Token = "0x4007383")]
|
||||
internal static readonly DHKeyGeneratorHelper Instance;
|
||||
}
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
using System;
|
||||
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: 0x02001C62 RID: 7266
|
||||
[Token(Token = "0x2001C62")]
|
||||
public class DHKeyPairGenerator : IAsymmetricCipherKeyPairGenerator
|
||||
{
|
||||
// Token: 0x0600B61A RID: 46618 RVA: 0x0027D2E0 File Offset: 0x0027B4E0
|
||||
[Token(Token = "0x600B61A")]
|
||||
[Address(RVA = "0x1A29C80", Offset = "0x1A28A80", VA = "0x181A29C80", 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: 0x0600B61B RID: 46619 RVA: 0x0027D308 File Offset: 0x0027B508
|
||||
[Token(Token = "0x600B61B")]
|
||||
[Address(RVA = "0x1A29B30", Offset = "0x1A28930", VA = "0x181A29B30", 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: 0x0600B61C RID: 46620 RVA: 0x0027D364 File Offset: 0x0027B564
|
||||
[Token(Token = "0x600B61C")]
|
||||
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
|
||||
public DHKeyPairGenerator()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x04007384 RID: 29572
|
||||
[FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x4007384")]
|
||||
private DHKeyGenerationParameters param;
|
||||
}
|
||||
}
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
using System;
|
||||
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: 0x02001C63 RID: 7267
|
||||
[Token(Token = "0x2001C63")]
|
||||
public class DHParametersGenerator
|
||||
{
|
||||
// Token: 0x0600B61D RID: 46621 RVA: 0x0027D378 File Offset: 0x0027B578
|
||||
[Token(Token = "0x600B61D")]
|
||||
[Address(RVA = "0x1A29E70", Offset = "0x1A28C70", VA = "0x181A29E70", Slot = "4")]
|
||||
public virtual void Init(int size, int certainty, SecureRandom random)
|
||||
{
|
||||
this.size = size;
|
||||
this.certainty = certainty;
|
||||
this.random = random;
|
||||
}
|
||||
|
||||
// Token: 0x0600B61E RID: 46622 RVA: 0x0027D39C File Offset: 0x0027B59C
|
||||
[Token(Token = "0x600B61E")]
|
||||
[Address(RVA = "0x1A29D20", Offset = "0x1A28B20", VA = "0x181A29D20", 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: 0x0600B61F RID: 46623 RVA: 0x0027D41C File Offset: 0x0027B61C
|
||||
[Token(Token = "0x600B61F")]
|
||||
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
|
||||
public DHParametersGenerator()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x04007385 RID: 29573
|
||||
[FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x4007385")]
|
||||
private int size;
|
||||
|
||||
// Token: 0x04007386 RID: 29574
|
||||
[FieldOffset(Offset = "0x14")]
|
||||
[Token(Token = "0x4007386")]
|
||||
private int certainty;
|
||||
|
||||
// Token: 0x04007387 RID: 29575
|
||||
[FieldOffset(Offset = "0x18")]
|
||||
[Token(Token = "0x4007387")]
|
||||
private SecureRandom random;
|
||||
}
|
||||
}
|
||||
+171
@@ -0,0 +1,171 @@
|
||||
using System;
|
||||
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: 0x02001C64 RID: 7268
|
||||
[Token(Token = "0x2001C64")]
|
||||
internal class DHParametersHelper
|
||||
{
|
||||
// Token: 0x0600B620 RID: 46624 RVA: 0x0027D430 File Offset: 0x0027B630
|
||||
[Token(Token = "0x600B620")]
|
||||
[Address(RVA = "0x1A29E80", Offset = "0x1A28C80", VA = "0x181A29E80")]
|
||||
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: 0x0600B621 RID: 46625 RVA: 0x0027D47C File Offset: 0x0027B67C
|
||||
[Token(Token = "0x600B621")]
|
||||
[Address(RVA = "0x1A29F80", Offset = "0x1A28D80", VA = "0x181A29F80")]
|
||||
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: 0x0600B622 RID: 46626 RVA: 0x0027D5F8 File Offset: 0x0027B7F8
|
||||
[Token(Token = "0x600B622")]
|
||||
[Address(RVA = "0x1A2A590", Offset = "0x1A29390", VA = "0x181A2A590")]
|
||||
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: 0x0600B623 RID: 46627 RVA: 0x0027D640 File Offset: 0x0027B840
|
||||
[Token(Token = "0x600B623")]
|
||||
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
|
||||
public DHParametersHelper()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x0600B624 RID: 46628 RVA: 0x0027D654 File Offset: 0x0027B854
|
||||
// Note: this type is marked as 'beforefieldinit'.
|
||||
[Token(Token = "0x600B624")]
|
||||
[Address(RVA = "0x1A2A6D0", Offset = "0x1A294D0", VA = "0x181A2A6D0")]
|
||||
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: 0x04007388 RID: 29576
|
||||
[Token(Token = "0x4007388")]
|
||||
private static readonly BigInteger Six;
|
||||
|
||||
// Token: 0x04007389 RID: 29577
|
||||
[Token(Token = "0x4007389")]
|
||||
private static readonly int[][] primeLists;
|
||||
|
||||
// Token: 0x0400738A RID: 29578
|
||||
[Token(Token = "0x400738A")]
|
||||
private static readonly int[] primeProducts;
|
||||
|
||||
// Token: 0x0400738B RID: 29579
|
||||
[Token(Token = "0x400738B")]
|
||||
private static readonly BigInteger[] BigPrimeProducts;
|
||||
}
|
||||
}
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
using System;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
|
||||
using Cpp2IlInjected;
|
||||
|
||||
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
|
||||
{
|
||||
// Token: 0x02001C65 RID: 7269
|
||||
[Token(Token = "0x2001C65")]
|
||||
public class DesEdeKeyGenerator : DesKeyGenerator
|
||||
{
|
||||
// Token: 0x0600B625 RID: 46629 RVA: 0x0027D6C8 File Offset: 0x0027B8C8
|
||||
[Token(Token = "0x600B625")]
|
||||
[Address(RVA = "0x1A2A890", Offset = "0x1A29690", VA = "0x181A2A890")]
|
||||
public DesEdeKeyGenerator()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x0600B626 RID: 46630 RVA: 0x0027D6DC File Offset: 0x0027B8DC
|
||||
[Token(Token = "0x600B626")]
|
||||
[Address(RVA = "0x1A2A8A0", Offset = "0x1A296A0", VA = "0x181A2A8A0")]
|
||||
internal DesEdeKeyGenerator(int defaultStrength)
|
||||
: base(defaultStrength)
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x0600B627 RID: 46631 RVA: 0x0027D6F0 File Offset: 0x0027B8F0
|
||||
[Token(Token = "0x600B627")]
|
||||
[Address(RVA = "0x1A2A980", Offset = "0x1A29780", VA = "0x181A2A980", 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: 0x0600B628 RID: 46632 RVA: 0x0027D7C4 File Offset: 0x0027B9C4
|
||||
[Token(Token = "0x600B628")]
|
||||
[Address(RVA = "0x1A2A8B0", Offset = "0x1A296B0", VA = "0x181A2A8B0", 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
using System;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
|
||||
using Cpp2IlInjected;
|
||||
|
||||
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
|
||||
{
|
||||
// Token: 0x02001C66 RID: 7270
|
||||
[Token(Token = "0x2001C66")]
|
||||
public class DesKeyGenerator : CipherKeyGenerator
|
||||
{
|
||||
// Token: 0x0600B629 RID: 46633 RVA: 0x0027D818 File Offset: 0x0027BA18
|
||||
[Token(Token = "0x600B629")]
|
||||
[Address(RVA = "0x1A2A890", Offset = "0x1A29690", VA = "0x181A2A890")]
|
||||
public DesKeyGenerator()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x0600B62A RID: 46634 RVA: 0x0027D82C File Offset: 0x0027BA2C
|
||||
[Token(Token = "0x600B62A")]
|
||||
[Address(RVA = "0x1A2A8A0", Offset = "0x1A296A0", VA = "0x181A2A8A0")]
|
||||
internal DesKeyGenerator(int defaultStrength)
|
||||
: base(defaultStrength)
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x0600B62B RID: 46635 RVA: 0x0027D840 File Offset: 0x0027BA40
|
||||
[Token(Token = "0x600B62B")]
|
||||
[Address(RVA = "0x1A2AC10", Offset = "0x1A29A10", VA = "0x181A2AC10", Slot = "4")]
|
||||
protected override void engineInit(KeyGenerationParameters parameters)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600B62B)
|
||||
|
||||
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 1660
|
||||
*/;
|
||||
}
|
||||
|
||||
// Token: 0x0600B62C RID: 46636 RVA: 0x0027D888 File Offset: 0x0027BA88
|
||||
[Token(Token = "0x600B62C")]
|
||||
[Address(RVA = "0x1A2AB60", Offset = "0x1A29960", VA = "0x181A2AB60", 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
+99
@@ -0,0 +1,99 @@
|
||||
using System;
|
||||
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: 0x02001C67 RID: 7271
|
||||
[Token(Token = "0x2001C67")]
|
||||
public class DsaKeyPairGenerator : IAsymmetricCipherKeyPairGenerator
|
||||
{
|
||||
// Token: 0x0600B62D RID: 46637 RVA: 0x0027D8C4 File Offset: 0x0027BAC4
|
||||
[Token(Token = "0x600B62D")]
|
||||
[Address(RVA = "0x1A2AFE0", Offset = "0x1A29DE0", VA = "0x181A2AFE0", Slot = "4")]
|
||||
public void Init(KeyGenerationParameters parameters)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600B62D)
|
||||
|
||||
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 1660
|
||||
*/;
|
||||
}
|
||||
|
||||
// Token: 0x0600B62E RID: 46638 RVA: 0x0027D8F0 File Offset: 0x0027BAF0
|
||||
[Token(Token = "0x600B62E")]
|
||||
[Address(RVA = "0x1A2AD00", Offset = "0x1A29B00", VA = "0x181A2AD00", 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: 0x0600B62F RID: 46639 RVA: 0x0027D984 File Offset: 0x0027BB84
|
||||
[Token(Token = "0x600B62F")]
|
||||
[Address(RVA = "0x1A2AEF0", Offset = "0x1A29CF0", VA = "0x181A2AEF0")]
|
||||
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: 0x0600B630 RID: 46640 RVA: 0x0027D9C0 File Offset: 0x0027BBC0
|
||||
[Token(Token = "0x600B630")]
|
||||
[Address(RVA = "0x1A2ACD0", Offset = "0x1A29AD0", VA = "0x181A2ACD0")]
|
||||
private static BigInteger CalculatePublicKey(BigInteger p, BigInteger g, BigInteger x)
|
||||
{
|
||||
return g.ModPow(x, p);
|
||||
}
|
||||
|
||||
// Token: 0x0600B631 RID: 46641 RVA: 0x0027D9DC File Offset: 0x0027BBDC
|
||||
[Token(Token = "0x600B631")]
|
||||
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
|
||||
public DsaKeyPairGenerator()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x0400738C RID: 29580
|
||||
[Token(Token = "0x400738C")]
|
||||
private static readonly BigInteger One = BigInteger.One;
|
||||
|
||||
// Token: 0x0400738D RID: 29581
|
||||
[FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x400738D")]
|
||||
private DsaKeyGenerationParameters param;
|
||||
}
|
||||
}
|
||||
+347
@@ -0,0 +1,347 @@
|
||||
using System;
|
||||
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: 0x02001C68 RID: 7272
|
||||
[Token(Token = "0x2001C68")]
|
||||
public class DsaParametersGenerator
|
||||
{
|
||||
// Token: 0x0600B633 RID: 46643 RVA: 0x0027DA08 File Offset: 0x0027BC08
|
||||
[Token(Token = "0x600B633")]
|
||||
[Address(RVA = "0x1A2C6E0", Offset = "0x1A2B4E0", VA = "0x181A2C6E0")]
|
||||
public DsaParametersGenerator()
|
||||
{
|
||||
Sha1Digest sha1Digest = new Sha1Digest();
|
||||
base..ctor();
|
||||
this.digest = sha1Digest;
|
||||
}
|
||||
|
||||
// Token: 0x0600B634 RID: 46644 RVA: 0x0027DA28 File Offset: 0x0027BC28
|
||||
[Token(Token = "0x600B634")]
|
||||
[Address(RVA = "0x3FFB80", Offset = "0x3FE980", VA = "0x1803FFB80")]
|
||||
public DsaParametersGenerator(IDigest digest)
|
||||
{
|
||||
this.digest = digest;
|
||||
}
|
||||
|
||||
// Token: 0x0600B635 RID: 46645 RVA: 0x0027DA44 File Offset: 0x0027BC44
|
||||
[Token(Token = "0x600B635")]
|
||||
[Address(RVA = "0x1A2C390", Offset = "0x1A2B190", VA = "0x181A2C390", Slot = "4")]
|
||||
public virtual void Init(int size, int certainty, SecureRandom random)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600B635)
|
||||
|
||||
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 1660
|
||||
*/;
|
||||
}
|
||||
|
||||
// Token: 0x0600B636 RID: 46646 RVA: 0x0027DA90 File Offset: 0x0027BC90
|
||||
[Token(Token = "0x600B636")]
|
||||
[Address(RVA = "0x1A2C450", Offset = "0x1A2B250", VA = "0x181A2C450", Slot = "5")]
|
||||
public virtual void Init(DsaParameterGenerationParameters parameters)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600B636)
|
||||
|
||||
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 1660
|
||||
*/;
|
||||
}
|
||||
|
||||
// Token: 0x0600B637 RID: 46647 RVA: 0x0027DB80 File Offset: 0x0027BD80
|
||||
[Token(Token = "0x600B637")]
|
||||
[Address(RVA = "0x1A2C250", Offset = "0x1A2B050", VA = "0x181A2C250", Slot = "6")]
|
||||
public virtual DsaParameters GenerateParameters()
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600B637)
|
||||
|
||||
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 1660
|
||||
*/;
|
||||
}
|
||||
|
||||
// Token: 0x0600B638 RID: 46648 RVA: 0x0027DB98 File Offset: 0x0027BD98
|
||||
[Token(Token = "0x600B638")]
|
||||
[Address(RVA = "0x1A2B530", Offset = "0x1A2A330", VA = "0x181A2B530", Slot = "7")]
|
||||
protected virtual DsaParameters GenerateParameters_FIPS186_2()
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600B638)
|
||||
|
||||
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 1660
|
||||
*/;
|
||||
}
|
||||
|
||||
// Token: 0x0600B639 RID: 46649 RVA: 0x0027DDE4 File Offset: 0x0027BFE4
|
||||
[Token(Token = "0x600B639")]
|
||||
[Address(RVA = "0x1A2B110", Offset = "0x1A29F10", VA = "0x181A2B110", 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: 0x0600B63A RID: 46650 RVA: 0x0027DE3C File Offset: 0x0027C03C
|
||||
[Token(Token = "0x600B63A")]
|
||||
[Address(RVA = "0x1A2BC40", Offset = "0x1A2AA40", VA = "0x181A2BC40", 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: 0x0600B63B RID: 46651 RVA: 0x0000220F File Offset: 0x0000040F
|
||||
[Token(Token = "0x600B63B")]
|
||||
[Address(RVA = "0x1A2B260", Offset = "0x1A2A060", VA = "0x181A2B260", 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: 0x0600B63C RID: 46652 RVA: 0x0027DFFC File Offset: 0x0027C1FC
|
||||
[Token(Token = "0x600B63C")]
|
||||
[Address(RVA = "0x1A2B280", Offset = "0x1A2A080", VA = "0x181A2B280", 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: 0x0600B63D RID: 46653 RVA: 0x0027E0B8 File Offset: 0x0027C2B8
|
||||
[Token(Token = "0x600B63D")]
|
||||
[Address(RVA = "0x1A2C6B0", Offset = "0x1A2B4B0", VA = "0x181A2C6B0")]
|
||||
private static bool IsValidDsaStrength(int strength)
|
||||
{
|
||||
return strength == 0;
|
||||
}
|
||||
|
||||
// Token: 0x0600B63E RID: 46654 RVA: 0x0027E0CC File Offset: 0x0027C2CC
|
||||
[Token(Token = "0x600B63E")]
|
||||
[Address(RVA = "0x1A2C2A0", Offset = "0x1A2B0A0", VA = "0x181A2C2A0")]
|
||||
protected static void Hash(IDigest d, byte[] input, byte[] output)
|
||||
{
|
||||
int length = input.Length;
|
||||
}
|
||||
|
||||
// Token: 0x0600B63F RID: 46655 RVA: 0x0027E0E8 File Offset: 0x0027C2E8
|
||||
[Token(Token = "0x600B63F")]
|
||||
[Address(RVA = "0x1A2C280", Offset = "0x1A2B080", VA = "0x181A2C280")]
|
||||
private static int GetDefaultN(int L)
|
||||
{
|
||||
return 256;
|
||||
}
|
||||
|
||||
// Token: 0x0600B640 RID: 46656 RVA: 0x0027E0FC File Offset: 0x0027C2FC
|
||||
[Token(Token = "0x600B640")]
|
||||
[Address(RVA = "0x1A2C340", Offset = "0x1A2B140", VA = "0x181A2C340")]
|
||||
protected static void Inc(byte[] buf)
|
||||
{
|
||||
if (buf.Length == buf.Length)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0400738E RID: 29582
|
||||
[FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x400738E")]
|
||||
private IDigest digest;
|
||||
|
||||
// Token: 0x0400738F RID: 29583
|
||||
[FieldOffset(Offset = "0x18")]
|
||||
[Token(Token = "0x400738F")]
|
||||
private int L;
|
||||
|
||||
// Token: 0x04007390 RID: 29584
|
||||
[FieldOffset(Offset = "0x1C")]
|
||||
[Token(Token = "0x4007390")]
|
||||
private int N;
|
||||
|
||||
// Token: 0x04007391 RID: 29585
|
||||
[FieldOffset(Offset = "0x20")]
|
||||
[Token(Token = "0x4007391")]
|
||||
private int certainty;
|
||||
|
||||
// Token: 0x04007392 RID: 29586
|
||||
[FieldOffset(Offset = "0x28")]
|
||||
[Token(Token = "0x4007392")]
|
||||
private SecureRandom random;
|
||||
|
||||
// Token: 0x04007393 RID: 29587
|
||||
[FieldOffset(Offset = "0x30")]
|
||||
[Token(Token = "0x4007393")]
|
||||
private bool use186_3;
|
||||
|
||||
// Token: 0x04007394 RID: 29588
|
||||
[FieldOffset(Offset = "0x34")]
|
||||
[Token(Token = "0x4007394")]
|
||||
private int usageIndex;
|
||||
}
|
||||
}
|
||||
+226
@@ -0,0 +1,226 @@
|
||||
using System;
|
||||
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: 0x02001C69 RID: 7273
|
||||
[Token(Token = "0x2001C69")]
|
||||
public class ECKeyPairGenerator : IAsymmetricCipherKeyPairGenerator
|
||||
{
|
||||
// Token: 0x0600B641 RID: 46657 RVA: 0x0027E120 File Offset: 0x0027C320
|
||||
[Token(Token = "0x600B641")]
|
||||
[Address(RVA = "0x1A2D060", Offset = "0x1A2BE60", VA = "0x181A2D060")]
|
||||
public ECKeyPairGenerator()
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600B641)
|
||||
|
||||
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 1660
|
||||
*/;
|
||||
}
|
||||
|
||||
// Token: 0x0600B642 RID: 46658 RVA: 0x0027E158 File Offset: 0x0027C358
|
||||
[Token(Token = "0x600B642")]
|
||||
[Address(RVA = "0x1A2CFB0", Offset = "0x1A2BDB0", VA = "0x181A2CFB0")]
|
||||
public ECKeyPairGenerator(string algorithm)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600B642)
|
||||
|
||||
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 1660
|
||||
*/;
|
||||
}
|
||||
|
||||
// Token: 0x0600B643 RID: 46659 RVA: 0x0027E188 File Offset: 0x0027C388
|
||||
[Token(Token = "0x600B643")]
|
||||
[Address(RVA = "0x1A2CBD0", Offset = "0x1A2B9D0", VA = "0x181A2CBD0", 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: 0x0600B644 RID: 46660 RVA: 0x0027E23C File Offset: 0x0027C43C
|
||||
[Token(Token = "0x600B644")]
|
||||
[Address(RVA = "0x1A2C800", Offset = "0x1A2B600", VA = "0x181A2C800", 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: 0x0600B645 RID: 46661 RVA: 0x0027E31C File Offset: 0x0027C51C
|
||||
[Token(Token = "0x600B645")]
|
||||
[Address(RVA = "0x1A2C740", Offset = "0x1A2B540", VA = "0x181A2C740", Slot = "6")]
|
||||
protected virtual ECMultiplier CreateBasePointMultiplier()
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600B645)
|
||||
|
||||
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 1660
|
||||
*/;
|
||||
}
|
||||
|
||||
// Token: 0x0600B646 RID: 46662 RVA: 0x0027E330 File Offset: 0x0027C530
|
||||
[Token(Token = "0x600B646")]
|
||||
[Address(RVA = "0x1A2C790", Offset = "0x1A2B590", VA = "0x181A2C790")]
|
||||
internal static X9ECParameters FindECCurveByOid(DerObjectIdentifier oid)
|
||||
{
|
||||
X9ECParameters byOid = CustomNamedCurves.GetByOid(oid);
|
||||
if (byOid == 0)
|
||||
{
|
||||
return ECNamedCurveTable.GetByOid(oid);
|
||||
}
|
||||
return byOid;
|
||||
}
|
||||
|
||||
// Token: 0x0600B647 RID: 46663 RVA: 0x0027E350 File Offset: 0x0027C550
|
||||
[Token(Token = "0x600B647")]
|
||||
[Address(RVA = "0x1A2CAD0", Offset = "0x1A2B8D0", VA = "0x181A2CAD0")]
|
||||
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: 0x04007395 RID: 29589
|
||||
[FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x4007395")]
|
||||
private readonly string algorithm;
|
||||
|
||||
// Token: 0x04007396 RID: 29590
|
||||
[FieldOffset(Offset = "0x18")]
|
||||
[Token(Token = "0x4007396")]
|
||||
private ECDomainParameters parameters;
|
||||
|
||||
// Token: 0x04007397 RID: 29591
|
||||
[FieldOffset(Offset = "0x20")]
|
||||
[Token(Token = "0x4007397")]
|
||||
private DerObjectIdentifier publicKeyParamSet;
|
||||
|
||||
// Token: 0x04007398 RID: 29592
|
||||
[FieldOffset(Offset = "0x28")]
|
||||
[Token(Token = "0x4007398")]
|
||||
private SecureRandom random;
|
||||
}
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
|
||||
using Cpp2IlInjected;
|
||||
|
||||
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
|
||||
{
|
||||
// Token: 0x02001C6A RID: 7274
|
||||
[Token(Token = "0x2001C6A")]
|
||||
public class Ed25519KeyPairGenerator : IAsymmetricCipherKeyPairGenerator
|
||||
{
|
||||
// Token: 0x0600B648 RID: 46664 RVA: 0x0027E3A8 File Offset: 0x0027C5A8
|
||||
[Token(Token = "0x600B648")]
|
||||
[Address(RVA = "0xF574E0", Offset = "0xF562E0", VA = "0x180F574E0", Slot = "6")]
|
||||
public virtual void Init(KeyGenerationParameters parameters)
|
||||
{
|
||||
SecureRandom secureRandom = parameters.random;
|
||||
this.random = secureRandom;
|
||||
}
|
||||
|
||||
// Token: 0x0600B649 RID: 46665 RVA: 0x0027E3CC File Offset: 0x0027C5CC
|
||||
[Token(Token = "0x600B649")]
|
||||
[Address(RVA = "0x1A2D130", Offset = "0x1A2BF30", VA = "0x181A2D130", Slot = "7")]
|
||||
public virtual AsymmetricCipherKeyPair GenerateKeyPair()
|
||||
{
|
||||
Ed25519PrivateKeyParameters ed25519PrivateKeyParameters = new Ed25519PrivateKeyParameters(this.random);
|
||||
return new AsymmetricCipherKeyPair(ed25519PrivateKeyParameters.GeneratePublicKey(), ed25519PrivateKeyParameters);
|
||||
}
|
||||
|
||||
// Token: 0x0600B64A RID: 46666 RVA: 0x0027E3F8 File Offset: 0x0027C5F8
|
||||
[Token(Token = "0x600B64A")]
|
||||
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
|
||||
public Ed25519KeyPairGenerator()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x04007399 RID: 29593
|
||||
[FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x4007399")]
|
||||
private SecureRandom random;
|
||||
}
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
|
||||
using Cpp2IlInjected;
|
||||
|
||||
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
|
||||
{
|
||||
// Token: 0x02001C6B RID: 7275
|
||||
[Token(Token = "0x2001C6B")]
|
||||
public class Ed448KeyPairGenerator : IAsymmetricCipherKeyPairGenerator
|
||||
{
|
||||
// Token: 0x0600B64B RID: 46667 RVA: 0x0027E40C File Offset: 0x0027C60C
|
||||
[Token(Token = "0x600B64B")]
|
||||
[Address(RVA = "0xF574E0", Offset = "0xF562E0", VA = "0x180F574E0", Slot = "6")]
|
||||
public virtual void Init(KeyGenerationParameters parameters)
|
||||
{
|
||||
SecureRandom secureRandom = parameters.random;
|
||||
this.random = secureRandom;
|
||||
}
|
||||
|
||||
// Token: 0x0600B64C RID: 46668 RVA: 0x0027E430 File Offset: 0x0027C630
|
||||
[Token(Token = "0x600B64C")]
|
||||
[Address(RVA = "0x1A2D1D0", Offset = "0x1A2BFD0", VA = "0x181A2D1D0", Slot = "7")]
|
||||
public virtual AsymmetricCipherKeyPair GenerateKeyPair()
|
||||
{
|
||||
Ed448PrivateKeyParameters ed448PrivateKeyParameters = new Ed448PrivateKeyParameters(this.random);
|
||||
return new AsymmetricCipherKeyPair(ed448PrivateKeyParameters.GeneratePublicKey(), ed448PrivateKeyParameters);
|
||||
}
|
||||
|
||||
// Token: 0x0600B64D RID: 46669 RVA: 0x0027E45C File Offset: 0x0027C65C
|
||||
[Token(Token = "0x600B64D")]
|
||||
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
|
||||
public Ed448KeyPairGenerator()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x0400739A RID: 29594
|
||||
[FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x400739A")]
|
||||
private SecureRandom random;
|
||||
}
|
||||
}
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
using System;
|
||||
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: 0x02001C6C RID: 7276
|
||||
[Token(Token = "0x2001C6C")]
|
||||
public class ElGamalKeyPairGenerator : IAsymmetricCipherKeyPairGenerator
|
||||
{
|
||||
// Token: 0x0600B64E RID: 46670 RVA: 0x0027E470 File Offset: 0x0027C670
|
||||
[Token(Token = "0x600B64E")]
|
||||
[Address(RVA = "0x1A2D410", Offset = "0x1A2C210", VA = "0x181A2D410", Slot = "4")]
|
||||
public void Init(KeyGenerationParameters parameters)
|
||||
{
|
||||
while (parameters != 0)
|
||||
{
|
||||
if (parameters != 0)
|
||||
{
|
||||
this.param = parameters;
|
||||
return;
|
||||
}
|
||||
}
|
||||
int num = 0;
|
||||
this.param = num;
|
||||
}
|
||||
|
||||
// Token: 0x0600B64F RID: 46671 RVA: 0x0027E498 File Offset: 0x0027C698
|
||||
[Token(Token = "0x600B64F")]
|
||||
[Address(RVA = "0x1A2D270", Offset = "0x1A2C070", VA = "0x181A2D270", 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: 0x0600B650 RID: 46672 RVA: 0x0027E528 File Offset: 0x0027C728
|
||||
[Token(Token = "0x600B650")]
|
||||
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
|
||||
public ElGamalKeyPairGenerator()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x0400739B RID: 29595
|
||||
[FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x400739B")]
|
||||
private ElGamalKeyGenerationParameters param;
|
||||
}
|
||||
}
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
using System;
|
||||
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: 0x02001C6D RID: 7277
|
||||
[Token(Token = "0x2001C6D")]
|
||||
public class ElGamalParametersGenerator
|
||||
{
|
||||
// Token: 0x0600B651 RID: 46673 RVA: 0x0027E53C File Offset: 0x0027C73C
|
||||
[Token(Token = "0x600B651")]
|
||||
[Address(RVA = "0x1A29E70", Offset = "0x1A28C70", VA = "0x181A29E70")]
|
||||
public void Init(int size, int certainty, SecureRandom random)
|
||||
{
|
||||
this.size = size;
|
||||
this.certainty = certainty;
|
||||
this.random = random;
|
||||
}
|
||||
|
||||
// Token: 0x0600B652 RID: 46674 RVA: 0x0027E560 File Offset: 0x0027C760
|
||||
[Token(Token = "0x600B652")]
|
||||
[Address(RVA = "0x1A2D4B0", Offset = "0x1A2C2B0", VA = "0x181A2D4B0")]
|
||||
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: 0x0600B653 RID: 46675 RVA: 0x0027E5CC File Offset: 0x0027C7CC
|
||||
[Token(Token = "0x600B653")]
|
||||
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
|
||||
public ElGamalParametersGenerator()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x0400739C RID: 29596
|
||||
[FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x400739C")]
|
||||
private int size;
|
||||
|
||||
// Token: 0x0400739D RID: 29597
|
||||
[FieldOffset(Offset = "0x14")]
|
||||
[Token(Token = "0x400739D")]
|
||||
private int certainty;
|
||||
|
||||
// Token: 0x0400739E RID: 29598
|
||||
[FieldOffset(Offset = "0x18")]
|
||||
[Token(Token = "0x400739E")]
|
||||
private SecureRandom random;
|
||||
}
|
||||
}
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
using System;
|
||||
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: 0x02001C6E RID: 7278
|
||||
[Token(Token = "0x2001C6E")]
|
||||
public class Gost3410KeyPairGenerator : IAsymmetricCipherKeyPairGenerator
|
||||
{
|
||||
// Token: 0x0600B654 RID: 46676 RVA: 0x0027E5E0 File Offset: 0x0027C7E0
|
||||
[Token(Token = "0x600B654")]
|
||||
[Address(RVA = "0x1A2D7C0", Offset = "0x1A2C5C0", VA = "0x181A2D7C0", 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: 0x0600B655 RID: 46677 RVA: 0x0027E644 File Offset: 0x0027C844
|
||||
[Token(Token = "0x600B655")]
|
||||
[Address(RVA = "0x1A2D5B0", Offset = "0x1A2C3B0", VA = "0x181A2D5B0", 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: 0x0600B656 RID: 46678 RVA: 0x0027E704 File Offset: 0x0027C904
|
||||
[Token(Token = "0x600B656")]
|
||||
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
|
||||
public Gost3410KeyPairGenerator()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x0400739F RID: 29599
|
||||
[FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x400739F")]
|
||||
private Gost3410KeyGenerationParameters param;
|
||||
}
|
||||
}
|
||||
+335
@@ -0,0 +1,335 @@
|
||||
using System;
|
||||
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: 0x02001C6F RID: 7279
|
||||
[Token(Token = "0x2001C6F")]
|
||||
public class Gost3410ParametersGenerator
|
||||
{
|
||||
// Token: 0x0600B657 RID: 46679 RVA: 0x0027E718 File Offset: 0x0027C918
|
||||
[Token(Token = "0x600B657")]
|
||||
[Address(RVA = "0x1A29E70", Offset = "0x1A28C70", VA = "0x181A29E70")]
|
||||
public void Init(int size, int typeProcedure, SecureRandom random)
|
||||
{
|
||||
this.size = size;
|
||||
this.typeproc = typeProcedure;
|
||||
this.init_random = random;
|
||||
}
|
||||
|
||||
// Token: 0x0600B658 RID: 46680 RVA: 0x0027E73C File Offset: 0x0027C93C
|
||||
[Token(Token = "0x600B658")]
|
||||
[Address(RVA = "0x1A2DC60", Offset = "0x1A2CA60", VA = "0x181A2DC60")]
|
||||
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: 0x0600B659 RID: 46681 RVA: 0x0027EA80 File Offset: 0x0027CC80
|
||||
[Token(Token = "0x600B659")]
|
||||
[Address(RVA = "0x1A2E760", Offset = "0x1A2D560", VA = "0x181A2E760")]
|
||||
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: 0x0600B65A RID: 46682 RVA: 0x0027EDA8 File Offset: 0x0027CFA8
|
||||
[Token(Token = "0x600B65A")]
|
||||
[Address(RVA = "0x1A2F260", Offset = "0x1A2E060", VA = "0x181A2F260")]
|
||||
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: 0x0600B65B RID: 46683 RVA: 0x0027EFD0 File Offset: 0x0027D1D0
|
||||
[Token(Token = "0x600B65B")]
|
||||
[Address(RVA = "0x1A2F9E0", Offset = "0x1A2E7E0", VA = "0x181A2F9E0")]
|
||||
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: 0x0600B65C RID: 46684 RVA: 0x0027F1CC File Offset: 0x0027D3CC
|
||||
[Token(Token = "0x600B65C")]
|
||||
[Address(RVA = "0x1A30160", Offset = "0x1A2EF60", VA = "0x181A30160")]
|
||||
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: 0x0600B65D RID: 46685 RVA: 0x0027F24C File Offset: 0x0027D44C
|
||||
[Token(Token = "0x600B65D")]
|
||||
[Address(RVA = "0x1A2D930", Offset = "0x1A2C730", VA = "0x181A2D930")]
|
||||
public Gost3410Parameters GenerateParameters()
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600B65D)
|
||||
|
||||
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 1660
|
||||
*/;
|
||||
}
|
||||
|
||||
// Token: 0x0600B65E RID: 46686 RVA: 0x0027F358 File Offset: 0x0027D558
|
||||
[Token(Token = "0x600B65E")]
|
||||
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
|
||||
public Gost3410ParametersGenerator()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x040073A0 RID: 29600
|
||||
[FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x40073A0")]
|
||||
private int size;
|
||||
|
||||
// Token: 0x040073A1 RID: 29601
|
||||
[FieldOffset(Offset = "0x14")]
|
||||
[Token(Token = "0x40073A1")]
|
||||
private int typeproc;
|
||||
|
||||
// Token: 0x040073A2 RID: 29602
|
||||
[FieldOffset(Offset = "0x18")]
|
||||
[Token(Token = "0x40073A2")]
|
||||
private SecureRandom init_random;
|
||||
}
|
||||
}
|
||||
+160
@@ -0,0 +1,160 @@
|
||||
using System;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
|
||||
using Cpp2IlInjected;
|
||||
|
||||
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
|
||||
{
|
||||
// Token: 0x02001C70 RID: 7280
|
||||
[Token(Token = "0x2001C70")]
|
||||
public class HkdfBytesGenerator : IDerivationFunction
|
||||
{
|
||||
// Token: 0x0600B65F RID: 46687 RVA: 0x0027F36C File Offset: 0x0027D56C
|
||||
[Token(Token = "0x600B65F")]
|
||||
[Address(RVA = "0x1A30A30", Offset = "0x1A2F830", VA = "0x181A30A30")]
|
||||
public HkdfBytesGenerator(IDigest hash)
|
||||
{
|
||||
HMac hmac = new HMac(hash);
|
||||
this.hMacHash = hmac;
|
||||
this.hashLen = hmac;
|
||||
}
|
||||
|
||||
// Token: 0x0600B660 RID: 46688 RVA: 0x0027F39C File Offset: 0x0027D59C
|
||||
[Token(Token = "0x600B660")]
|
||||
[Address(RVA = "0x1A30720", Offset = "0x1A2F520", VA = "0x181A30720", Slot = "7")]
|
||||
public virtual void Init(IDerivationParameters parameters)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600B660)
|
||||
|
||||
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 1660
|
||||
*/;
|
||||
}
|
||||
|
||||
// Token: 0x0600B661 RID: 46689 RVA: 0x0027F44C File Offset: 0x0027D64C
|
||||
[Token(Token = "0x600B661")]
|
||||
[Address(RVA = "0x1A30450", Offset = "0x1A2F250", VA = "0x181A30450")]
|
||||
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: 0x0600B662 RID: 46690 RVA: 0x0027F4AC File Offset: 0x0027D6AC
|
||||
[Token(Token = "0x600B662")]
|
||||
[Address(RVA = "0x1A30320", Offset = "0x1A2F120", VA = "0x181A30320")]
|
||||
private void ExpandNext()
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600B662)
|
||||
|
||||
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 1660
|
||||
*/;
|
||||
}
|
||||
|
||||
// Token: 0x17001CB2 RID: 7346
|
||||
// (get) Token: 0x0600B663 RID: 46691 RVA: 0x0027F51C File Offset: 0x0027D71C
|
||||
[Token(Token = "0x17001CB2")]
|
||||
public virtual IDigest Digest
|
||||
{
|
||||
[Token(Token = "0x600B663")]
|
||||
[Address(RVA = "0x52BD90", Offset = "0x52AB90", VA = "0x18052BD90", Slot = "8")]
|
||||
get
|
||||
{
|
||||
string algorithmName = ((IMac)this.hMacHash).AlgorithmName;
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600B664 RID: 46692 RVA: 0x0027F53C File Offset: 0x0027D73C
|
||||
[Token(Token = "0x600B664")]
|
||||
[Address(RVA = "0x1A30590", Offset = "0x1A2F390", VA = "0x181A30590", 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: 0x040073A3 RID: 29603
|
||||
[FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x40073A3")]
|
||||
private HMac hMacHash;
|
||||
|
||||
// Token: 0x040073A4 RID: 29604
|
||||
[FieldOffset(Offset = "0x18")]
|
||||
[Token(Token = "0x40073A4")]
|
||||
private int hashLen;
|
||||
|
||||
// Token: 0x040073A5 RID: 29605
|
||||
[FieldOffset(Offset = "0x20")]
|
||||
[Token(Token = "0x40073A5")]
|
||||
private byte[] info;
|
||||
|
||||
// Token: 0x040073A6 RID: 29606
|
||||
[FieldOffset(Offset = "0x28")]
|
||||
[Token(Token = "0x40073A6")]
|
||||
private byte[] currentT;
|
||||
|
||||
// Token: 0x040073A7 RID: 29607
|
||||
[FieldOffset(Offset = "0x30")]
|
||||
[Token(Token = "0x40073A7")]
|
||||
private int generatedBytes;
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using Cpp2IlInjected;
|
||||
|
||||
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
|
||||
{
|
||||
// Token: 0x02001C71 RID: 7281
|
||||
[Token(Token = "0x2001C71")]
|
||||
public class Kdf1BytesGenerator : BaseKdfBytesGenerator
|
||||
{
|
||||
// Token: 0x0600B665 RID: 46693 RVA: 0x0027F5C4 File Offset: 0x0027D7C4
|
||||
[Token(Token = "0x600B665")]
|
||||
[Address(RVA = "0x1A30AC0", Offset = "0x1A2F8C0", VA = "0x181A30AC0")]
|
||||
public Kdf1BytesGenerator(IDigest digest)
|
||||
{
|
||||
this.counterStart = (int)((ulong)0L);
|
||||
this.digest = digest;
|
||||
}
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using Cpp2IlInjected;
|
||||
|
||||
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
|
||||
{
|
||||
// Token: 0x02001C72 RID: 7282
|
||||
[Token(Token = "0x2001C72")]
|
||||
public class Kdf2BytesGenerator : BaseKdfBytesGenerator
|
||||
{
|
||||
// Token: 0x0600B666 RID: 46694 RVA: 0x0027F5E8 File Offset: 0x0027D7E8
|
||||
[Token(Token = "0x600B666")]
|
||||
[Address(RVA = "0x1A30AF0", Offset = "0x1A2F8F0", VA = "0x181A30AF0")]
|
||||
public Kdf2BytesGenerator(IDigest digest)
|
||||
{
|
||||
this.counterStart = (int)((ulong)1L);
|
||||
this.digest = digest;
|
||||
}
|
||||
}
|
||||
}
|
||||
+149
@@ -0,0 +1,149 @@
|
||||
using System;
|
||||
using Cpp2IlInjected;
|
||||
|
||||
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
|
||||
{
|
||||
// Token: 0x02001C73 RID: 7283
|
||||
[Token(Token = "0x2001C73")]
|
||||
public class Mgf1BytesGenerator : IDerivationFunction
|
||||
{
|
||||
// Token: 0x0600B667 RID: 46695 RVA: 0x0027F60C File Offset: 0x0027D80C
|
||||
[Token(Token = "0x600B667")]
|
||||
[Address(RVA = "0x1A310D0", Offset = "0x1A2FED0", VA = "0x181A310D0")]
|
||||
public Mgf1BytesGenerator(IDigest digest)
|
||||
{
|
||||
this.digest = digest;
|
||||
}
|
||||
|
||||
// Token: 0x0600B668 RID: 46696 RVA: 0x0027F62C File Offset: 0x0027D82C
|
||||
[Token(Token = "0x600B668")]
|
||||
[Address(RVA = "0x1A30FB0", Offset = "0x1A2FDB0", VA = "0x181A30FB0", Slot = "4")]
|
||||
public void Init(IDerivationParameters parameters)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600B668)
|
||||
|
||||
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 1660
|
||||
*/;
|
||||
}
|
||||
|
||||
// Token: 0x17001CB3 RID: 7347
|
||||
// (get) Token: 0x0600B669 RID: 46697 RVA: 0x0027F668 File Offset: 0x0027D868
|
||||
[Token(Token = "0x17001CB3")]
|
||||
public IDigest Digest
|
||||
{
|
||||
[Token(Token = "0x600B669")]
|
||||
[Address(RVA = "0x3F6E20", Offset = "0x3F5C20", VA = "0x1803F6E20", Slot = "5")]
|
||||
get
|
||||
{
|
||||
return this.digest;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600B66A RID: 46698 RVA: 0x0027F67C File Offset: 0x0027D87C
|
||||
[Token(Token = "0x600B66A")]
|
||||
[Address(RVA = "0x189BD10", Offset = "0x189AB10", VA = "0x18189BD10")]
|
||||
private void ItoOSP(int i, byte[] sp)
|
||||
{
|
||||
sp[0] = (byte)i;
|
||||
sp[0] = (byte)i;
|
||||
sp[0] = (byte)i;
|
||||
sp[0] = (byte)i;
|
||||
}
|
||||
|
||||
// Token: 0x0600B66B RID: 46699 RVA: 0x0027F6B0 File Offset: 0x0027D8B0
|
||||
[Token(Token = "0x600B66B")]
|
||||
[Address(RVA = "0x1A30B20", Offset = "0x1A2F920", VA = "0x181A30B20", 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: 0x040073A8 RID: 29608
|
||||
[FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x40073A8")]
|
||||
private IDigest digest;
|
||||
|
||||
// Token: 0x040073A9 RID: 29609
|
||||
[FieldOffset(Offset = "0x18")]
|
||||
[Token(Token = "0x40073A9")]
|
||||
private byte[] seed;
|
||||
|
||||
// Token: 0x040073AA RID: 29610
|
||||
[FieldOffset(Offset = "0x20")]
|
||||
[Token(Token = "0x40073AA")]
|
||||
private int hLen;
|
||||
}
|
||||
}
|
||||
+179
@@ -0,0 +1,179 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Runtime.CompilerServices;
|
||||
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: 0x02001C74 RID: 7284
|
||||
[Token(Token = "0x2001C74")]
|
||||
public class NaccacheSternKeyPairGenerator : IAsymmetricCipherKeyPairGenerator
|
||||
{
|
||||
// Token: 0x0600B66C RID: 46700 RVA: 0x0027F844 File Offset: 0x0027DA44
|
||||
[Token(Token = "0x600B66C")]
|
||||
[Address(RVA = "0x1A32530", Offset = "0x1A31330", VA = "0x181A32530", Slot = "4")]
|
||||
public void Init(KeyGenerationParameters parameters)
|
||||
{
|
||||
while (parameters != 0)
|
||||
{
|
||||
if (parameters != 0)
|
||||
{
|
||||
this.param = parameters;
|
||||
return;
|
||||
}
|
||||
}
|
||||
int num = 0;
|
||||
this.param = num;
|
||||
}
|
||||
|
||||
// Token: 0x0600B66D RID: 46701 RVA: 0x0027F86C File Offset: 0x0027DA6C
|
||||
[Token(Token = "0x600B66D")]
|
||||
[Address(RVA = "0x1A31140", Offset = "0x1A2FF40", VA = "0x181A31140", Slot = "5")]
|
||||
public AsymmetricCipherKeyPair GenerateKeyPair()
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600B66D)
|
||||
|
||||
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 1660
|
||||
*/;
|
||||
}
|
||||
|
||||
// Token: 0x0600B66E RID: 46702 RVA: 0x0027FD88 File Offset: 0x0027DF88
|
||||
[Token(Token = "0x600B66E")]
|
||||
[Address(RVA = "0x1A32760", Offset = "0x1A31560", VA = "0x181A32760")]
|
||||
private static BigInteger generatePrime(int bitLength, int certainty, SecureRandom rand)
|
||||
{
|
||||
return new BigInteger(certainty, certainty, rand);
|
||||
}
|
||||
|
||||
// Token: 0x0600B66F RID: 46703 RVA: 0x0027FDA0 File Offset: 0x0027DFA0
|
||||
[Token(Token = "0x600B66F")]
|
||||
[Address(RVA = "0x1A327E0", Offset = "0x1A315E0", VA = "0x181A327E0")]
|
||||
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)
|
||||
{
|
||||
}
|
||||
}
|
||||
while (num != 0);
|
||||
return list;
|
||||
}
|
||||
|
||||
// Token: 0x0600B670 RID: 46704 RVA: 0x0027FE40 File Offset: 0x0027E040
|
||||
[Token(Token = "0x600B670")]
|
||||
[Address(RVA = "0x1A32630", Offset = "0x1A31430", VA = "0x181A32630")]
|
||||
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: 0x0600B671 RID: 46705 RVA: 0x0027FE7C File Offset: 0x0027E07C
|
||||
[Token(Token = "0x600B671")]
|
||||
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
|
||||
public NaccacheSternKeyPairGenerator()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x0600B672 RID: 46706 RVA: 0x0027FE90 File Offset: 0x0027E090
|
||||
// Note: this type is marked as 'beforefieldinit'.
|
||||
[Token(Token = "0x600B672")]
|
||||
[Address(RVA = "0x1A325D0", Offset = "0x1A313D0", VA = "0x181A325D0")]
|
||||
static NaccacheSternKeyPairGenerator()
|
||||
{
|
||||
int[] array = new int[101];
|
||||
RuntimeHelpers.InitializeArray(array, fieldof(<PrivateImplementationDetails>.6FE282215AF15E3C00DDCAB5E6BD720D1F5BC0BC).FieldHandle);
|
||||
NaccacheSternKeyPairGenerator.smallPrimes = array;
|
||||
}
|
||||
|
||||
// Token: 0x040073AB RID: 29611
|
||||
[Token(Token = "0x40073AB")]
|
||||
private static readonly int[] smallPrimes;
|
||||
|
||||
// Token: 0x040073AC RID: 29612
|
||||
[FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x40073AC")]
|
||||
private NaccacheSternKeyGenerationParameters param;
|
||||
}
|
||||
}
|
||||
+231
@@ -0,0 +1,231 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.CompilerServices;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections;
|
||||
using Cpp2IlInjected;
|
||||
|
||||
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
|
||||
{
|
||||
// Token: 0x02001C75 RID: 7285
|
||||
[Token(Token = "0x2001C75")]
|
||||
public class OpenBsdBCrypt
|
||||
{
|
||||
// Token: 0x0600B673 RID: 46707 RVA: 0x0027FEB8 File Offset: 0x0027E0B8
|
||||
[Token(Token = "0x600B673")]
|
||||
[Address(RVA = "0x1A33EF0", Offset = "0x1A32CF0", VA = "0x181A33EF0")]
|
||||
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: 0x0600B674 RID: 46708 RVA: 0x0027FF50 File Offset: 0x0027E150
|
||||
[Token(Token = "0x600B674")]
|
||||
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
|
||||
public OpenBsdBCrypt()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x0600B675 RID: 46709 RVA: 0x0027FF64 File Offset: 0x0027E164
|
||||
[Token(Token = "0x600B675")]
|
||||
[Address(RVA = "0x1A32F10", Offset = "0x1A31D10", VA = "0x181A32F10")]
|
||||
private static string CreateBcryptString(string version, byte[] password, byte[] salt, int cost)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600B675)
|
||||
|
||||
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_A6:
|
||||
stloc:ArgumentException(var_21_B5, 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 1660
|
||||
*/;
|
||||
}
|
||||
|
||||
// Token: 0x0600B676 RID: 46710 RVA: 0x00280028 File Offset: 0x0027E228
|
||||
[Token(Token = "0x600B676")]
|
||||
[Address(RVA = "0x1A33B50", Offset = "0x1A32950", VA = "0x181A33B50")]
|
||||
public static string Generate(char[] password, byte[] salt, int cost)
|
||||
{
|
||||
return OpenBsdBCrypt.Generate(OpenBsdBCrypt.DefaultVersion, password, salt, cost);
|
||||
}
|
||||
|
||||
// Token: 0x0600B677 RID: 46711 RVA: 0x00280044 File Offset: 0x0027E244
|
||||
[Token(Token = "0x600B677")]
|
||||
[Address(RVA = "0x1A33BE0", Offset = "0x1A329E0", VA = "0x181A33BE0")]
|
||||
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: 0x0600B678 RID: 46712 RVA: 0x002800F8 File Offset: 0x0027E2F8
|
||||
[Token(Token = "0x600B678")]
|
||||
[Address(RVA = "0x1A32B30", Offset = "0x1A31930", VA = "0x181A32B30")]
|
||||
public static bool CheckPassword(string bcryptString, char[] password)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600B678)
|
||||
|
||||
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 1660
|
||||
*/;
|
||||
}
|
||||
|
||||
// Token: 0x0600B679 RID: 46713 RVA: 0x002801BC File Offset: 0x0027E3BC
|
||||
[Token(Token = "0x600B679")]
|
||||
[Address(RVA = "0x1A33770", Offset = "0x1A32570", VA = "0x181A33770")]
|
||||
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: 0x0600B67A RID: 46714 RVA: 0x0028026C File Offset: 0x0027E46C
|
||||
[Token(Token = "0x600B67A")]
|
||||
[Address(RVA = "0x1A33320", Offset = "0x1A32120", VA = "0x181A33320")]
|
||||
private static byte[] DecodeSaltString(string saltString)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600B67A)
|
||||
|
||||
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 1660
|
||||
*/;
|
||||
}
|
||||
|
||||
// Token: 0x040073AD RID: 29613
|
||||
[Token(Token = "0x40073AD")]
|
||||
private static readonly byte[] EncodingTable;
|
||||
|
||||
// Token: 0x040073AE RID: 29614
|
||||
[Token(Token = "0x40073AE")]
|
||||
private static readonly byte[] DecodingTable;
|
||||
|
||||
// Token: 0x040073AF RID: 29615
|
||||
[Token(Token = "0x40073AF")]
|
||||
private static readonly string DefaultVersion;
|
||||
|
||||
// Token: 0x040073B0 RID: 29616
|
||||
[Token(Token = "0x40073B0")]
|
||||
private static readonly ISet AllowedVersions;
|
||||
}
|
||||
}
|
||||
+227
@@ -0,0 +1,227 @@
|
||||
using System;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests;
|
||||
using Cpp2IlInjected;
|
||||
|
||||
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
|
||||
{
|
||||
// Token: 0x02001C76 RID: 7286
|
||||
[Token(Token = "0x2001C76")]
|
||||
public class OpenSslPbeParametersGenerator : PbeParametersGenerator
|
||||
{
|
||||
// Token: 0x0600B67B RID: 46715 RVA: 0x00280354 File Offset: 0x0027E554
|
||||
[Token(Token = "0x600B67B")]
|
||||
[Address(RVA = "0x1A348C0", Offset = "0x1A336C0", VA = "0x181A348C0")]
|
||||
public OpenSslPbeParametersGenerator()
|
||||
{
|
||||
MD5Digest md5Digest = new MD5Digest();
|
||||
this.digest = md5Digest;
|
||||
base..ctor();
|
||||
}
|
||||
|
||||
// Token: 0x0600B67C RID: 46716 RVA: 0x00280374 File Offset: 0x0027E574
|
||||
[Token(Token = "0x600B67C")]
|
||||
[Address(RVA = "0x1A34880", Offset = "0x1A33680", VA = "0x181A34880", Slot = "4")]
|
||||
public override void Init(byte[] password, byte[] salt, int iterationCount)
|
||||
{
|
||||
base.Init(password, salt, 1);
|
||||
}
|
||||
|
||||
// Token: 0x0600B67D RID: 46717 RVA: 0x0028038C File Offset: 0x0027E58C
|
||||
[Token(Token = "0x600B67D")]
|
||||
[Address(RVA = "0x1A348A0", Offset = "0x1A336A0", VA = "0x181A348A0", Slot = "13")]
|
||||
public virtual void Init(byte[] password, byte[] salt)
|
||||
{
|
||||
base.Init(password, salt, 1);
|
||||
}
|
||||
|
||||
// Token: 0x0600B67E RID: 46718 RVA: 0x002803A4 File Offset: 0x0027E5A4
|
||||
[Token(Token = "0x600B67E")]
|
||||
[Address(RVA = "0x1A34150", Offset = "0x1A32F50", VA = "0x181A34150")]
|
||||
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: 0x0600B67F RID: 46719 RVA: 0x002804C4 File Offset: 0x0027E6C4
|
||||
[Token(Token = "0x600B67F")]
|
||||
[Address(RVA = "0x1A34680", Offset = "0x1A33480", VA = "0x181A34680", Slot = "8")]
|
||||
[Obsolete]
|
||||
public override ICipherParameters GenerateDerivedParameters(int keySize)
|
||||
{
|
||||
return base.GenerateDerivedParameters(keySize);
|
||||
}
|
||||
|
||||
// Token: 0x0600B680 RID: 46720 RVA: 0x002804D8 File Offset: 0x0027E6D8
|
||||
[Token(Token = "0x600B680")]
|
||||
[Address(RVA = "0x1A345E0", Offset = "0x1A333E0", VA = "0x181A345E0", Slot = "9")]
|
||||
public override ICipherParameters GenerateDerivedParameters(string algorithm, int keySize)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600B680)
|
||||
|
||||
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 1660
|
||||
*/;
|
||||
}
|
||||
|
||||
// Token: 0x0600B681 RID: 46721 RVA: 0x002804F8 File Offset: 0x0027E6F8
|
||||
[Token(Token = "0x600B681")]
|
||||
[Address(RVA = "0x1A346A0", Offset = "0x1A334A0", VA = "0x181A346A0", Slot = "10")]
|
||||
[Obsolete]
|
||||
public override ICipherParameters GenerateDerivedParameters(int keySize, int ivSize)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600B681)
|
||||
|
||||
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 1660
|
||||
*/;
|
||||
}
|
||||
|
||||
// Token: 0x0600B682 RID: 46722 RVA: 0x0028050C File Offset: 0x0027E70C
|
||||
[Token(Token = "0x600B682")]
|
||||
[Address(RVA = "0x1A34780", Offset = "0x1A33580", VA = "0x181A34780", Slot = "11")]
|
||||
public override ICipherParameters GenerateDerivedParameters(string algorithm, int keySize, int ivSize)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600B682)
|
||||
|
||||
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 1660
|
||||
*/;
|
||||
}
|
||||
|
||||
// Token: 0x0600B683 RID: 46723 RVA: 0x0028052C File Offset: 0x0027E72C
|
||||
[Token(Token = "0x600B683")]
|
||||
[Address(RVA = "0x1A34550", Offset = "0x1A33350", VA = "0x181A34550", Slot = "12")]
|
||||
public override ICipherParameters GenerateDerivedMacParameters(int keySize)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600B683)
|
||||
|
||||
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 1660
|
||||
*/;
|
||||
}
|
||||
|
||||
// Token: 0x040073B1 RID: 29617
|
||||
[FieldOffset(Offset = "0x28")]
|
||||
[Token(Token = "0x40073B1")]
|
||||
private readonly IDigest digest;
|
||||
}
|
||||
}
|
||||
+336
@@ -0,0 +1,336 @@
|
||||
using System;
|
||||
using Cpp2IlInjected;
|
||||
|
||||
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
|
||||
{
|
||||
// Token: 0x02001C77 RID: 7287
|
||||
[Token(Token = "0x2001C77")]
|
||||
public class Pkcs12ParametersGenerator : PbeParametersGenerator
|
||||
{
|
||||
// Token: 0x0600B684 RID: 46724 RVA: 0x0028054C File Offset: 0x0027E74C
|
||||
[Token(Token = "0x600B684")]
|
||||
[Address(RVA = "0x1A35410", Offset = "0x1A34210", VA = "0x181A35410")]
|
||||
public Pkcs12ParametersGenerator(IDigest digest)
|
||||
{
|
||||
this.digest = digest;
|
||||
}
|
||||
|
||||
// Token: 0x0600B685 RID: 46725 RVA: 0x0028056C File Offset: 0x0027E76C
|
||||
[Token(Token = "0x600B685")]
|
||||
[Address(RVA = "0x1A34920", Offset = "0x1A33720", VA = "0x181A34920")]
|
||||
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: 0x0600B686 RID: 46726 RVA: 0x0028059C File Offset: 0x0027E79C
|
||||
[Token(Token = "0x600B686")]
|
||||
[Address(RVA = "0x1A34A10", Offset = "0x1A33810", VA = "0x181A34A10")]
|
||||
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: 0x0600B687 RID: 46727 RVA: 0x00280820 File Offset: 0x0027EA20
|
||||
[Token(Token = "0x600B687")]
|
||||
[Address(RVA = "0x1A350D0", Offset = "0x1A33ED0", VA = "0x181A350D0", Slot = "8")]
|
||||
public override ICipherParameters GenerateDerivedParameters(int keySize)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600B687)
|
||||
|
||||
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 1660
|
||||
*/;
|
||||
}
|
||||
|
||||
// Token: 0x0600B688 RID: 46728 RVA: 0x00280840 File Offset: 0x0027EA40
|
||||
[Token(Token = "0x600B688")]
|
||||
[Address(RVA = "0x1A35270", Offset = "0x1A34070", VA = "0x181A35270", Slot = "9")]
|
||||
public override ICipherParameters GenerateDerivedParameters(string algorithm, int keySize)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600B688)
|
||||
|
||||
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 1660
|
||||
*/;
|
||||
}
|
||||
|
||||
// Token: 0x0600B689 RID: 46729 RVA: 0x00280864 File Offset: 0x0027EA64
|
||||
[Token(Token = "0x600B689")]
|
||||
[Address(RVA = "0x1A35310", Offset = "0x1A34110", VA = "0x181A35310", Slot = "10")]
|
||||
public override ICipherParameters GenerateDerivedParameters(int keySize, int ivSize)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600B689)
|
||||
|
||||
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 1660
|
||||
*/;
|
||||
}
|
||||
|
||||
// Token: 0x0600B68A RID: 46730 RVA: 0x002808A4 File Offset: 0x0027EAA4
|
||||
[Token(Token = "0x600B68A")]
|
||||
[Address(RVA = "0x1A35160", Offset = "0x1A33F60", VA = "0x181A35160", Slot = "11")]
|
||||
public override ICipherParameters GenerateDerivedParameters(string algorithm, int keySize, int ivSize)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600B68A)
|
||||
|
||||
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 1660
|
||||
*/;
|
||||
}
|
||||
|
||||
// Token: 0x0600B68B RID: 46731 RVA: 0x002808E0 File Offset: 0x0027EAE0
|
||||
[Token(Token = "0x600B68B")]
|
||||
[Address(RVA = "0x1A35040", Offset = "0x1A33E40", VA = "0x181A35040", Slot = "12")]
|
||||
public override ICipherParameters GenerateDerivedMacParameters(int keySize)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600B68B)
|
||||
|
||||
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 1660
|
||||
*/;
|
||||
}
|
||||
|
||||
// Token: 0x040073B2 RID: 29618
|
||||
[Token(Token = "0x40073B2")]
|
||||
public const int KeyMaterial = 1;
|
||||
|
||||
// Token: 0x040073B3 RID: 29619
|
||||
[Token(Token = "0x40073B3")]
|
||||
public const int IVMaterial = 2;
|
||||
|
||||
// Token: 0x040073B4 RID: 29620
|
||||
[Token(Token = "0x40073B4")]
|
||||
public const int MacMaterial = 3;
|
||||
|
||||
// Token: 0x040073B5 RID: 29621
|
||||
[FieldOffset(Offset = "0x28")]
|
||||
[Token(Token = "0x40073B5")]
|
||||
private readonly IDigest digest;
|
||||
|
||||
// Token: 0x040073B6 RID: 29622
|
||||
[FieldOffset(Offset = "0x30")]
|
||||
[Token(Token = "0x40073B6")]
|
||||
private readonly int u;
|
||||
|
||||
// Token: 0x040073B7 RID: 29623
|
||||
[FieldOffset(Offset = "0x34")]
|
||||
[Token(Token = "0x40073B7")]
|
||||
private readonly int v;
|
||||
}
|
||||
}
|
||||
+111
@@ -0,0 +1,111 @@
|
||||
using System;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
|
||||
using Cpp2IlInjected;
|
||||
|
||||
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
|
||||
{
|
||||
// Token: 0x02001C78 RID: 7288
|
||||
[Token(Token = "0x2001C78")]
|
||||
public class Pkcs5S1ParametersGenerator : PbeParametersGenerator
|
||||
{
|
||||
// Token: 0x0600B68C RID: 46732 RVA: 0x00280900 File Offset: 0x0027EB00
|
||||
[Token(Token = "0x600B68C")]
|
||||
[Address(RVA = "0x1A35C10", Offset = "0x1A34A10", VA = "0x181A35C10")]
|
||||
public Pkcs5S1ParametersGenerator(IDigest digest)
|
||||
{
|
||||
this.digest = digest;
|
||||
}
|
||||
|
||||
// Token: 0x0600B68D RID: 46733 RVA: 0x0028091C File Offset: 0x0027EB1C
|
||||
[Token(Token = "0x600B68D")]
|
||||
[Address(RVA = "0x1A35490", Offset = "0x1A34290", VA = "0x181A35490")]
|
||||
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: 0x0600B68E RID: 46734 RVA: 0x002809B8 File Offset: 0x0027EBB8
|
||||
[Token(Token = "0x600B68E")]
|
||||
[Address(RVA = "0x1A34680", Offset = "0x1A33480", VA = "0x181A34680", Slot = "8")]
|
||||
public override ICipherParameters GenerateDerivedParameters(int keySize)
|
||||
{
|
||||
return base.GenerateDerivedParameters(keySize);
|
||||
}
|
||||
|
||||
// Token: 0x0600B68F RID: 46735 RVA: 0x002809CC File Offset: 0x0027EBCC
|
||||
[Token(Token = "0x600B68F")]
|
||||
[Address(RVA = "0x1A35970", Offset = "0x1A34770", VA = "0x181A35970", 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: 0x0600B690 RID: 46736 RVA: 0x002809FC File Offset: 0x0027EBFC
|
||||
[Token(Token = "0x600B690")]
|
||||
[Address(RVA = "0x1A35810", Offset = "0x1A34610", VA = "0x181A35810", Slot = "10")]
|
||||
public override ICipherParameters GenerateDerivedParameters(int keySize, int ivSize)
|
||||
{
|
||||
IDigest digest = this.digest;
|
||||
byte[] array = this.GenerateDerivedKey();
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x0600B691 RID: 46737 RVA: 0x00280A1C File Offset: 0x0027EC1C
|
||||
[Token(Token = "0x600B691")]
|
||||
[Address(RVA = "0x1A35A90", Offset = "0x1A34890", VA = "0x181A35A90", 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: 0x0600B692 RID: 46738 RVA: 0x00280A54 File Offset: 0x0027EC54
|
||||
[Token(Token = "0x600B692")]
|
||||
[Address(RVA = "0x1A35700", Offset = "0x1A34500", VA = "0x181A35700", Slot = "12")]
|
||||
public override ICipherParameters GenerateDerivedMacParameters(int keySize)
|
||||
{
|
||||
IDigest digest = this.digest;
|
||||
byte[] array = this.GenerateDerivedKey();
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x040073B8 RID: 29624
|
||||
[FieldOffset(Offset = "0x28")]
|
||||
[Token(Token = "0x40073B8")]
|
||||
private readonly IDigest digest;
|
||||
}
|
||||
}
|
||||
+223
@@ -0,0 +1,223 @@
|
||||
using System;
|
||||
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: 0x02001C79 RID: 7289
|
||||
[Token(Token = "0x2001C79")]
|
||||
public class Pkcs5S2ParametersGenerator : PbeParametersGenerator
|
||||
{
|
||||
// Token: 0x0600B693 RID: 46739 RVA: 0x00280A74 File Offset: 0x0027EC74
|
||||
[Token(Token = "0x600B693")]
|
||||
[Address(RVA = "0x1C2CAD0", Offset = "0x1C2B8D0", VA = "0x181C2CAD0")]
|
||||
public Pkcs5S2ParametersGenerator()
|
||||
{
|
||||
Sha1Digest sha1Digest = new Sha1Digest();
|
||||
}
|
||||
|
||||
// Token: 0x0600B694 RID: 46740 RVA: 0x00280A88 File Offset: 0x0027EC88
|
||||
[Token(Token = "0x600B694")]
|
||||
[Address(RVA = "0x1C2CB30", Offset = "0x1C2B930", VA = "0x181C2CB30")]
|
||||
public Pkcs5S2ParametersGenerator(IDigest digest)
|
||||
{
|
||||
HMac hmac;
|
||||
hmac.digest = digest;
|
||||
hmac.digestSize = hmac;
|
||||
hmac.blockLength = hmac;
|
||||
byte[] array = new byte[hmac];
|
||||
int blockLength = hmac.blockLength;
|
||||
hmac.inputPad = array;
|
||||
byte[] array2 = new byte[blockLength];
|
||||
hmac.outputBuf = array2;
|
||||
this.hMac = hmac;
|
||||
byte[] array3 = new byte[array2];
|
||||
this.state = array3;
|
||||
}
|
||||
|
||||
// Token: 0x0600B695 RID: 46741 RVA: 0x00280AF0 File Offset: 0x0027ECF0
|
||||
[Token(Token = "0x600B695")]
|
||||
[Address(RVA = "0x1C2C3F0", Offset = "0x1C2B1F0", VA = "0x181C2C3F0")]
|
||||
private void F(byte[] S, int c, byte[] iBuf, byte[] outBytes, int outOff)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600B695)
|
||||
|
||||
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 1660
|
||||
*/;
|
||||
}
|
||||
|
||||
// Token: 0x0600B696 RID: 46742 RVA: 0x00280B80 File Offset: 0x0027ED80
|
||||
[Token(Token = "0x600B696")]
|
||||
[Address(RVA = "0x1C2C640", Offset = "0x1C2B440", VA = "0x181C2C640")]
|
||||
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: 0x0600B697 RID: 46743 RVA: 0x00280C04 File Offset: 0x0027EE04
|
||||
[Token(Token = "0x600B697")]
|
||||
[Address(RVA = "0x1A34680", Offset = "0x1A33480", VA = "0x181A34680", Slot = "8")]
|
||||
public override ICipherParameters GenerateDerivedParameters(int keySize)
|
||||
{
|
||||
return base.GenerateDerivedParameters(keySize);
|
||||
}
|
||||
|
||||
// Token: 0x0600B698 RID: 46744 RVA: 0x00280C18 File Offset: 0x0027EE18
|
||||
[Token(Token = "0x600B698")]
|
||||
[Address(RVA = "0x1C2CA30", Offset = "0x1C2B830", VA = "0x181C2CA30", Slot = "9")]
|
||||
public override ICipherParameters GenerateDerivedParameters(string algorithm, int keySize)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600B698)
|
||||
|
||||
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 1660
|
||||
*/;
|
||||
}
|
||||
|
||||
// Token: 0x0600B699 RID: 46745 RVA: 0x00280C38 File Offset: 0x0027EE38
|
||||
[Token(Token = "0x600B699")]
|
||||
[Address(RVA = "0x1C2C950", Offset = "0x1C2B750", VA = "0x181C2C950", Slot = "10")]
|
||||
public override ICipherParameters GenerateDerivedParameters(int keySize, int ivSize)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600B699)
|
||||
|
||||
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 1660
|
||||
*/;
|
||||
}
|
||||
|
||||
// Token: 0x0600B69A RID: 46746 RVA: 0x00280C4C File Offset: 0x0027EE4C
|
||||
[Token(Token = "0x600B69A")]
|
||||
[Address(RVA = "0x1C2C850", Offset = "0x1C2B650", VA = "0x181C2C850", Slot = "11")]
|
||||
public override ICipherParameters GenerateDerivedParameters(string algorithm, int keySize, int ivSize)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600B69A)
|
||||
|
||||
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 1660
|
||||
*/;
|
||||
}
|
||||
|
||||
// Token: 0x0600B69B RID: 46747 RVA: 0x00280C6C File Offset: 0x0027EE6C
|
||||
[Token(Token = "0x600B69B")]
|
||||
[Address(RVA = "0x1C2C7C0", Offset = "0x1C2B5C0", VA = "0x181C2C7C0", Slot = "12")]
|
||||
public override ICipherParameters GenerateDerivedMacParameters(int keySize)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600B69B)
|
||||
|
||||
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 1660
|
||||
*/;
|
||||
}
|
||||
|
||||
// Token: 0x040073B9 RID: 29625
|
||||
[FieldOffset(Offset = "0x28")]
|
||||
[Token(Token = "0x40073B9")]
|
||||
private readonly IMac hMac;
|
||||
|
||||
// Token: 0x040073BA RID: 29626
|
||||
[FieldOffset(Offset = "0x30")]
|
||||
[Token(Token = "0x40073BA")]
|
||||
private readonly byte[] state;
|
||||
}
|
||||
}
|
||||
+106
@@ -0,0 +1,106 @@
|
||||
using System;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
|
||||
using Cpp2IlInjected;
|
||||
|
||||
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
|
||||
{
|
||||
// Token: 0x02001C7A RID: 7290
|
||||
[Token(Token = "0x2001C7A")]
|
||||
public class Poly1305KeyGenerator : CipherKeyGenerator
|
||||
{
|
||||
// Token: 0x0600B69C RID: 46748 RVA: 0x00280C8C File Offset: 0x0027EE8C
|
||||
[Token(Token = "0x600B69C")]
|
||||
[Address(RVA = "0x1C2D060", Offset = "0x1C2BE60", VA = "0x181C2D060", Slot = "4")]
|
||||
protected override void engineInit(KeyGenerationParameters param)
|
||||
{
|
||||
SecureRandom random = param.random;
|
||||
this.random = random;
|
||||
this.strength = (int)((ulong)32L);
|
||||
}
|
||||
|
||||
// Token: 0x0600B69D RID: 46749 RVA: 0x00280CB8 File Offset: 0x0027EEB8
|
||||
[Token(Token = "0x600B69D")]
|
||||
[Address(RVA = "0x1C2CF40", Offset = "0x1C2BD40", VA = "0x181C2CF40", Slot = "5")]
|
||||
protected override byte[] engineGenerateKey()
|
||||
{
|
||||
byte[] array;
|
||||
do
|
||||
{
|
||||
array = base.engineGenerateKey();
|
||||
}
|
||||
while (array.Length != 32);
|
||||
return array;
|
||||
}
|
||||
|
||||
// Token: 0x0600B69E RID: 46750 RVA: 0x00280CE0 File Offset: 0x0027EEE0
|
||||
[Token(Token = "0x600B69E")]
|
||||
[Address(RVA = "0x1C2CE30", Offset = "0x1C2BC30", VA = "0x181C2CE30")]
|
||||
public static void Clamp(byte[] key)
|
||||
{
|
||||
while (key.Length != 32)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600B69F RID: 46751 RVA: 0x00280D00 File Offset: 0x0027EF00
|
||||
[Token(Token = "0x600B69F")]
|
||||
[Address(RVA = "0x1C2CC50", Offset = "0x1C2BA50", VA = "0x181C2CC50")]
|
||||
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: 0x0600B6A0 RID: 46752 RVA: 0x00280D58 File Offset: 0x0027EF58
|
||||
[Token(Token = "0x600B6A0")]
|
||||
[Address(RVA = "0x1C2CDB0", Offset = "0x1C2BBB0", VA = "0x181C2CDB0")]
|
||||
private static void CheckMask(byte b, byte mask)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600B6A0)
|
||||
|
||||
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 1660
|
||||
*/;
|
||||
}
|
||||
|
||||
// Token: 0x0600B6A1 RID: 46753 RVA: 0x00280D74 File Offset: 0x0027EF74
|
||||
[Token(Token = "0x600B6A1")]
|
||||
[Address(RVA = "0x1A2A890", Offset = "0x1A29690", VA = "0x181A2A890")]
|
||||
public Poly1305KeyGenerator()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x040073BB RID: 29627
|
||||
[Token(Token = "0x40073BB")]
|
||||
private const byte R_MASK_LOW_2 = 252;
|
||||
|
||||
// Token: 0x040073BC RID: 29628
|
||||
[Token(Token = "0x40073BC")]
|
||||
private const byte R_MASK_HIGH_4 = 15;
|
||||
}
|
||||
}
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
using System;
|
||||
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: 0x02001C7B RID: 7291
|
||||
[Token(Token = "0x2001C7B")]
|
||||
public class RsaBlindingFactorGenerator
|
||||
{
|
||||
// Token: 0x0600B6A2 RID: 46754 RVA: 0x00280D88 File Offset: 0x0027EF88
|
||||
[Token(Token = "0x600B6A2")]
|
||||
[Address(RVA = "0x1C2E050", Offset = "0x1C2CE50", VA = "0x181C2E050")]
|
||||
public void Init(ICipherParameters param)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600B6A2)
|
||||
|
||||
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 1660
|
||||
*/;
|
||||
}
|
||||
|
||||
// Token: 0x0600B6A3 RID: 46755 RVA: 0x00280DF8 File Offset: 0x0027EFF8
|
||||
[Token(Token = "0x600B6A3")]
|
||||
[Address(RVA = "0x1C2DEB0", Offset = "0x1C2CCB0", VA = "0x181C2DEB0")]
|
||||
public BigInteger GenerateBlindingFactor()
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600B6A3)
|
||||
|
||||
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 1660
|
||||
*/;
|
||||
}
|
||||
|
||||
// Token: 0x0600B6A4 RID: 46756 RVA: 0x00280E58 File Offset: 0x0027F058
|
||||
[Token(Token = "0x600B6A4")]
|
||||
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
|
||||
public RsaBlindingFactorGenerator()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x040073BD RID: 29629
|
||||
[FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x40073BD")]
|
||||
private RsaKeyParameters key;
|
||||
|
||||
// Token: 0x040073BE RID: 29630
|
||||
[FieldOffset(Offset = "0x18")]
|
||||
[Token(Token = "0x40073BE")]
|
||||
private SecureRandom random;
|
||||
}
|
||||
}
|
||||
+159
@@ -0,0 +1,159 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
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: 0x02001C7C RID: 7292
|
||||
[Token(Token = "0x2001C7C")]
|
||||
public class RsaKeyPairGenerator : IAsymmetricCipherKeyPairGenerator
|
||||
{
|
||||
// Token: 0x0600B6A5 RID: 46757 RVA: 0x00280E6C File Offset: 0x0027F06C
|
||||
[Token(Token = "0x600B6A5")]
|
||||
[Address(RVA = "0x1C2E890", Offset = "0x1C2D690", VA = "0x181C2E890", 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: 0x0600B6A6 RID: 46758 RVA: 0x00280EC8 File Offset: 0x0027F0C8
|
||||
[Token(Token = "0x600B6A6")]
|
||||
[Address(RVA = "0x1C2E4B0", Offset = "0x1C2D2B0", VA = "0x181C2E4B0", 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: 0x0600B6A7 RID: 46759 RVA: 0x00280F90 File Offset: 0x0027F190
|
||||
[Token(Token = "0x600B6A7")]
|
||||
[Address(RVA = "0x1C2E230", Offset = "0x1C2D030", VA = "0x181C2E230", 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: 0x0600B6A8 RID: 46760 RVA: 0x00281028 File Offset: 0x0027F228
|
||||
[Token(Token = "0x600B6A8")]
|
||||
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
|
||||
public RsaKeyPairGenerator()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x0600B6A9 RID: 46761 RVA: 0x0028103C File Offset: 0x0027F23C
|
||||
// Note: this type is marked as 'beforefieldinit'.
|
||||
[Token(Token = "0x600B6A9")]
|
||||
[Address(RVA = "0x1C2E9F0", Offset = "0x1C2D7F0", VA = "0x181C2E9F0")]
|
||||
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: 0x040073BF RID: 29631
|
||||
[Token(Token = "0x40073BF")]
|
||||
private static readonly int[] SPECIAL_E_VALUES;
|
||||
|
||||
// Token: 0x040073C0 RID: 29632
|
||||
[Token(Token = "0x40073C0")]
|
||||
private static readonly int SPECIAL_E_HIGHEST;
|
||||
|
||||
// Token: 0x040073C1 RID: 29633
|
||||
[Token(Token = "0x40073C1")]
|
||||
private static readonly int SPECIAL_E_BITS;
|
||||
|
||||
// Token: 0x040073C2 RID: 29634
|
||||
[Token(Token = "0x40073C2")]
|
||||
protected static readonly BigInteger One;
|
||||
|
||||
// Token: 0x040073C3 RID: 29635
|
||||
[Token(Token = "0x40073C3")]
|
||||
protected static readonly BigInteger DefaultPublicExponent;
|
||||
|
||||
// Token: 0x040073C4 RID: 29636
|
||||
[Token(Token = "0x40073C4")]
|
||||
protected const int DefaultTests = 100;
|
||||
|
||||
// Token: 0x040073C5 RID: 29637
|
||||
[FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x40073C5")]
|
||||
protected RsaKeyGenerationParameters parameters;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,277 @@
|
||||
using System;
|
||||
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: 0x02001C7D RID: 7293
|
||||
[Token(Token = "0x2001C7D")]
|
||||
public class SCrypt
|
||||
{
|
||||
// Token: 0x0600B6AA RID: 46762 RVA: 0x002810A8 File Offset: 0x0027F2A8
|
||||
[Token(Token = "0x600B6AA")]
|
||||
[Address(RVA = "0x1C2ED70", Offset = "0x1C2DB70", VA = "0x181C2ED70")]
|
||||
public static byte[] Generate(byte[] P, byte[] S, int N, int r, int p, int dkLen)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600B6AA)
|
||||
|
||||
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 1660
|
||||
*/;
|
||||
}
|
||||
|
||||
// Token: 0x0600B6AB RID: 46763 RVA: 0x002810F0 File Offset: 0x0027F2F0
|
||||
[Token(Token = "0x600B6AB")]
|
||||
[Address(RVA = "0x1C2F0D0", Offset = "0x1C2DED0", VA = "0x181C2F0D0")]
|
||||
private static byte[] MFcrypt(byte[] P, byte[] S, int N, int r, int p, int dkLen)
|
||||
{
|
||||
do
|
||||
{
|
||||
int 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++;
|
||||
}
|
||||
}
|
||||
while (r != 0);
|
||||
byte[] array5;
|
||||
return array5;
|
||||
}
|
||||
|
||||
// Token: 0x0600B6AC RID: 46764 RVA: 0x002811B4 File Offset: 0x0027F3B4
|
||||
[Token(Token = "0x600B6AC")]
|
||||
[Address(RVA = "0x1C2F8F0", Offset = "0x1C2E6F0", VA = "0x181C2F8F0")]
|
||||
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: 0x0600B6AD RID: 46765 RVA: 0x002811E8 File Offset: 0x0027F3E8
|
||||
[Token(Token = "0x600B6AD")]
|
||||
[Address(RVA = "0x1C2F350", Offset = "0x1C2E150", VA = "0x181C2F350")]
|
||||
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][];
|
||||
if (num < N)
|
||||
{
|
||||
if (array5 != 0 && (array5 == 0 || array5 == 0))
|
||||
{
|
||||
goto IL_144;
|
||||
}
|
||||
array5[0] = num;
|
||||
num++;
|
||||
}
|
||||
if (num < N)
|
||||
{
|
||||
int num2 = array4.Length;
|
||||
uint num3 = array4[num];
|
||||
uint[] array6 = array5[(int)num3];
|
||||
num2--;
|
||||
num++;
|
||||
}
|
||||
int num4 = 0;
|
||||
int length = array5.Length;
|
||||
if (num4 < length)
|
||||
{
|
||||
array7 = array5[num4];
|
||||
if (array7 != 0)
|
||||
{
|
||||
int num5 = 0;
|
||||
Array.Clear(array7, num5, num4);
|
||||
}
|
||||
num4++;
|
||||
}
|
||||
Array[] array8 = new Array[4];
|
||||
if (array4 != 0)
|
||||
{
|
||||
}
|
||||
array8[0] = array4;
|
||||
if (typeof(uint[]).TypeHandle != 0)
|
||||
{
|
||||
}
|
||||
array8[1] = typeof(uint[]).TypeHandle;
|
||||
if (array8 != 0)
|
||||
{
|
||||
}
|
||||
array8[2] = array8;
|
||||
if (array8 != 0)
|
||||
{
|
||||
}
|
||||
array8[3] = array8;
|
||||
int length2 = array8.Length;
|
||||
if (num4 < length2)
|
||||
{
|
||||
Array array9 = array8[num4];
|
||||
if (array9 != 0)
|
||||
{
|
||||
int num6 = array9.System.Collections.ICollection.Count;
|
||||
int num7 = 0;
|
||||
Array.Clear(array9, num7, num6);
|
||||
}
|
||||
num4++;
|
||||
}
|
||||
}
|
||||
while (array7 != 0);
|
||||
return;
|
||||
IL_144:
|
||||
throw new IndexOutOfRangeException();
|
||||
}
|
||||
|
||||
// Token: 0x0600B6AE RID: 46766 RVA: 0x00281388 File Offset: 0x0027F588
|
||||
[Token(Token = "0x600B6AE")]
|
||||
[Address(RVA = "0x1C2EB40", Offset = "0x1C2D940", VA = "0x181C2EB40")]
|
||||
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: 0x0600B6AF RID: 46767 RVA: 0x00281410 File Offset: 0x0027F610
|
||||
[Token(Token = "0x600B6AF")]
|
||||
[Address(RVA = "0x1C2FA60", Offset = "0x1C2E860", VA = "0x181C2FA60")]
|
||||
private static void Xor(uint[] a, uint[] b, int bOff, uint[] output)
|
||||
{
|
||||
int length = output.Length;
|
||||
uint num = b[bOff];
|
||||
output[0] = num;
|
||||
}
|
||||
|
||||
// Token: 0x0600B6B0 RID: 46768 RVA: 0x0028143C File Offset: 0x0027F63C
|
||||
[Token(Token = "0x600B6B0")]
|
||||
[Address(RVA = "0x1C2ED40", Offset = "0x1C2DB40", VA = "0x181C2ED40")]
|
||||
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: 0x0600B6B1 RID: 46769 RVA: 0x00281460 File Offset: 0x0027F660
|
||||
[Token(Token = "0x600B6B1")]
|
||||
[Address(RVA = "0x1C2ECC0", Offset = "0x1C2DAC0", VA = "0x181C2ECC0")]
|
||||
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: 0x0600B6B2 RID: 46770 RVA: 0x002814A4 File Offset: 0x0027F6A4
|
||||
[Token(Token = "0x600B6B2")]
|
||||
[Address(RVA = "0x1C2F0C0", Offset = "0x1C2DEC0", VA = "0x181C2F0C0")]
|
||||
private static bool IsPowerOf2(int x)
|
||||
{
|
||||
int num = x - 1;
|
||||
return x == num;
|
||||
}
|
||||
|
||||
// Token: 0x0600B6B3 RID: 46771 RVA: 0x002814BC File Offset: 0x0027F6BC
|
||||
[Token(Token = "0x600B6B3")]
|
||||
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
|
||||
public SCrypt()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
|
||||
using Cpp2IlInjected;
|
||||
|
||||
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
|
||||
{
|
||||
// Token: 0x02001C7E RID: 7294
|
||||
[Token(Token = "0x2001C7E")]
|
||||
public class X25519KeyPairGenerator : IAsymmetricCipherKeyPairGenerator
|
||||
{
|
||||
// Token: 0x0600B6B4 RID: 46772 RVA: 0x002814D0 File Offset: 0x0027F6D0
|
||||
[Token(Token = "0x600B6B4")]
|
||||
[Address(RVA = "0xF574E0", Offset = "0xF562E0", VA = "0x180F574E0", Slot = "6")]
|
||||
public virtual void Init(KeyGenerationParameters parameters)
|
||||
{
|
||||
SecureRandom secureRandom = parameters.random;
|
||||
this.random = secureRandom;
|
||||
}
|
||||
|
||||
// Token: 0x0600B6B5 RID: 46773 RVA: 0x002814F4 File Offset: 0x0027F6F4
|
||||
[Token(Token = "0x600B6B5")]
|
||||
[Address(RVA = "0x1C33E00", Offset = "0x1C32C00", VA = "0x181C33E00", Slot = "7")]
|
||||
public virtual AsymmetricCipherKeyPair GenerateKeyPair()
|
||||
{
|
||||
X25519PrivateKeyParameters x25519PrivateKeyParameters = new X25519PrivateKeyParameters(this.random);
|
||||
return new AsymmetricCipherKeyPair(x25519PrivateKeyParameters.GeneratePublicKey(), x25519PrivateKeyParameters);
|
||||
}
|
||||
|
||||
// Token: 0x0600B6B6 RID: 46774 RVA: 0x00281520 File Offset: 0x0027F720
|
||||
[Token(Token = "0x600B6B6")]
|
||||
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
|
||||
public X25519KeyPairGenerator()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x040073C6 RID: 29638
|
||||
[FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x40073C6")]
|
||||
private SecureRandom random;
|
||||
}
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
|
||||
using Cpp2IlInjected;
|
||||
|
||||
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
|
||||
{
|
||||
// Token: 0x02001C7F RID: 7295
|
||||
[Token(Token = "0x2001C7F")]
|
||||
public class X448KeyPairGenerator : IAsymmetricCipherKeyPairGenerator
|
||||
{
|
||||
// Token: 0x0600B6B7 RID: 46775 RVA: 0x00281534 File Offset: 0x0027F734
|
||||
[Token(Token = "0x600B6B7")]
|
||||
[Address(RVA = "0xF574E0", Offset = "0xF562E0", VA = "0x180F574E0", Slot = "6")]
|
||||
public virtual void Init(KeyGenerationParameters parameters)
|
||||
{
|
||||
SecureRandom secureRandom = parameters.random;
|
||||
this.random = secureRandom;
|
||||
}
|
||||
|
||||
// Token: 0x0600B6B8 RID: 46776 RVA: 0x00281558 File Offset: 0x0027F758
|
||||
[Token(Token = "0x600B6B8")]
|
||||
[Address(RVA = "0x1C33EA0", Offset = "0x1C32CA0", VA = "0x181C33EA0", Slot = "7")]
|
||||
public virtual AsymmetricCipherKeyPair GenerateKeyPair()
|
||||
{
|
||||
X448PrivateKeyParameters x448PrivateKeyParameters = new X448PrivateKeyParameters(this.random);
|
||||
return new AsymmetricCipherKeyPair(x448PrivateKeyParameters.GeneratePublicKey(), x448PrivateKeyParameters);
|
||||
}
|
||||
|
||||
// Token: 0x0600B6B9 RID: 46777 RVA: 0x00281584 File Offset: 0x0027F784
|
||||
[Token(Token = "0x600B6B9")]
|
||||
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
|
||||
public X448KeyPairGenerator()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x040073C7 RID: 29639
|
||||
[FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x40073C7")]
|
||||
private SecureRandom random;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user