This commit is contained in:
niko
2026-04-08 23:40:05 +02:00
parent d6894bcbc7
commit 18dc73f922
7750 changed files with 1795369 additions and 0 deletions
@@ -0,0 +1,128 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng
{
// Token: 0x020015E1 RID: 5601
[Token(Token = "0x20015E1")]
[StructLayout(3)]
public class BasicEntropySourceProvider : IEntropySourceProvider
{
// Token: 0x060095D9 RID: 38361 RVA: 0x00213B38 File Offset: 0x00211D38
[Token(Token = "0x60095D9")]
[Address(RVA = "0x61CE20", Offset = "0x61B820", VA = "0x18061CE20")]
public BasicEntropySourceProvider(SecureRandom secureRandom, bool isPredictionResistant)
{
this.mSecureRandom = secureRandom;
this.mPredictionResistant = isPredictionResistant;
}
// Token: 0x060095DA RID: 38362 RVA: 0x00213B5C File Offset: 0x00211D5C
[Token(Token = "0x60095DA")]
[Address(RVA = "0x1DCE170", Offset = "0x1DCCB70", VA = "0x181DCE170", Slot = "4")]
public IEntropySource Get(int bitsRequired)
{
/*
An exception occurred when decompiling this method (060095DA)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IEntropySource BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng.BasicEntropySourceProvider::Get(System.Int32)
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:SecureRandom(var_0_06, ldfld:SecureRandom(BasicEntropySourceProvider::mSecureRandom, ldloc:BasicEntropySourceProvider(this)))
stloc:bool(var_1_0D, ldfld:bool(BasicEntropySourceProvider::mPredictionResistant, ldloc:BasicEntropySourceProvider(this)))
stfld:bool(BasicEntropySource::mPredictionResistant, ldloc:BasicEntropySource(var_2), ldloc:bool(var_1_0D))
stfld:int32(BasicEntropySource::mEntropySize, ldloc:BasicEntropySource(var_2), ldloc:int32(bitsRequired))
stfld:SecureRandom(BasicEntropySource::mSecureRandom, ldloc:BasicEntropySource(var_2), ldloc:SecureRandom(var_0_06))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x040062EF RID: 25327
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x40062EF")]
private readonly SecureRandom mSecureRandom;
// Token: 0x040062F0 RID: 25328
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x40062F0")]
private readonly bool mPredictionResistant;
// Token: 0x020015E2 RID: 5602
[Token(Token = "0x20015E2")]
private class BasicEntropySource : IEntropySource
{
// Token: 0x060095DB RID: 38363 RVA: 0x00213B8C File Offset: 0x00211D8C
[Token(Token = "0x60095DB")]
[Address(RVA = "0x1DCE260", Offset = "0x1DCCC60", VA = "0x181DCE260")]
internal BasicEntropySource(SecureRandom secureRandom, bool predictionResistant, int entropySize)
{
this.mSecureRandom = secureRandom;
this.mPredictionResistant = predictionResistant;
this.mEntropySize = entropySize;
}
// Token: 0x170017EF RID: 6127
// (get) Token: 0x060095DC RID: 38364 RVA: 0x00213BB4 File Offset: 0x00211DB4
[Token(Token = "0x170017EF")]
bool IEntropySource.IsPredictionResistant
{
[Token(Token = "0x60095DC")]
[Address(RVA = "0x4FBF40", Offset = "0x4FA940", VA = "0x1804FBF40", Slot = "4")]
get
{
return this.mPredictionResistant;
}
}
// Token: 0x060095DD RID: 38365 RVA: 0x00213BC8 File Offset: 0x00211DC8
[Token(Token = "0x60095DD")]
[Address(RVA = "0x1DCE1F0", Offset = "0x1DCCBF0", VA = "0x181DCE1F0", Slot = "5")]
byte[] IEntropySource.GetEntropy()
{
SecureRandom secureRandom = this.mSecureRandom;
byte[] array;
return array;
}
// Token: 0x170017F0 RID: 6128
// (get) Token: 0x060095DE RID: 38366 RVA: 0x00213BE0 File Offset: 0x00211DE0
[Token(Token = "0x170017F0")]
int IEntropySource.EntropySize
{
[Token(Token = "0x60095DE")]
[Address(RVA = "0x4F8C10", Offset = "0x4F7610", VA = "0x1804F8C10", Slot = "6")]
get
{
return this.mEntropySize;
}
}
// Token: 0x040062F1 RID: 25329
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x40062F1")]
private readonly SecureRandom mSecureRandom;
// Token: 0x040062F2 RID: 25330
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x40062F2")]
private readonly bool mPredictionResistant;
// Token: 0x040062F3 RID: 25331
[global::Cpp2IlInjected.FieldOffset(Offset = "0x1C")]
[Token(Token = "0x40062F3")]
private readonly int mEntropySize;
}
}
}
@@ -0,0 +1,179 @@
using System;
using System.Runtime.InteropServices;
using System.Security.Cryptography;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng
{
// Token: 0x020015E3 RID: 5603
[Token(Token = "0x20015E3")]
[StructLayout(3)]
public class CryptoApiEntropySourceProvider : IEntropySourceProvider
{
// Token: 0x060095DF RID: 38367 RVA: 0x00213BF4 File Offset: 0x00211DF4
[Token(Token = "0x60095DF")]
[Address(RVA = "0x1DCF280", Offset = "0x1DCDC80", VA = "0x181DCF280")]
public CryptoApiEntropySourceProvider()
{
/*
An exception occurred when decompiling this method (060095DF)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng.CryptoApiEntropySourceProvider::.ctor()
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_21:
stloc:ArgumentNullException(var_2_2B, newobj:ArgumentNullException(ArgumentNullException::.ctor, ldstr:string("rng")))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x060095E0 RID: 38368 RVA: 0x00213C2C File Offset: 0x00211E2C
[Token(Token = "0x60095E0")]
[Address(RVA = "0x1DCF310", Offset = "0x1DCDD10", VA = "0x181DCF310")]
public CryptoApiEntropySourceProvider(RandomNumberGenerator rng, bool isPredictionResistant)
{
/*
An exception occurred when decompiling this method (060095E0)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng.CryptoApiEntropySourceProvider::.ctor(System.Security.Cryptography.RandomNumberGenerator,System.Boolean)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_19:
stloc:ArgumentNullException(var_0_23, newobj:ArgumentNullException(ArgumentNullException::.ctor, ldstr:string("rng")))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x060095E1 RID: 38369 RVA: 0x00213C5C File Offset: 0x00211E5C
[Token(Token = "0x60095E1")]
[Address(RVA = "0x1DCF200", Offset = "0x1DCDC00", VA = "0x181DCF200", Slot = "4")]
public IEntropySource Get(int bitsRequired)
{
/*
An exception occurred when decompiling this method (060095E1)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IEntropySource BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng.CryptoApiEntropySourceProvider::Get(System.Int32)
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:RandomNumberGenerator(var_0_06, ldfld:RandomNumberGenerator(CryptoApiEntropySourceProvider::mRng, ldloc:CryptoApiEntropySourceProvider(this)))
stloc:bool(var_1_0D, ldfld:bool(CryptoApiEntropySourceProvider::mPredictionResistant, ldloc:CryptoApiEntropySourceProvider(this)))
stfld:bool(CryptoApiEntropySource::mPredictionResistant, ldloc:CryptoApiEntropySource(var_2), ldloc:bool(var_1_0D))
stfld:int32(CryptoApiEntropySource::mEntropySize, ldloc:CryptoApiEntropySource(var_2), ldloc:int32(bitsRequired))
stfld:RandomNumberGenerator(CryptoApiEntropySource::mRng, ldloc:CryptoApiEntropySource(var_2), ldloc:RandomNumberGenerator(var_0_06))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x040062F4 RID: 25332
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x40062F4")]
private readonly RandomNumberGenerator mRng;
// Token: 0x040062F5 RID: 25333
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x40062F5")]
private readonly bool mPredictionResistant;
// Token: 0x020015E4 RID: 5604
[Token(Token = "0x20015E4")]
private class CryptoApiEntropySource : IEntropySource
{
// Token: 0x060095E2 RID: 38370 RVA: 0x00213C8C File Offset: 0x00211E8C
[Token(Token = "0x60095E2")]
[Address(RVA = "0x1DCE260", Offset = "0x1DCCC60", VA = "0x181DCE260")]
internal CryptoApiEntropySource(RandomNumberGenerator rng, bool predictionResistant, int entropySize)
{
this.mRng = rng;
this.mPredictionResistant = predictionResistant;
this.mEntropySize = entropySize;
}
// Token: 0x170017F1 RID: 6129
// (get) Token: 0x060095E3 RID: 38371 RVA: 0x00213CB4 File Offset: 0x00211EB4
[Token(Token = "0x170017F1")]
bool IEntropySource.IsPredictionResistant
{
[Token(Token = "0x60095E3")]
[Address(RVA = "0x4FBF40", Offset = "0x4FA940", VA = "0x1804FBF40", Slot = "4")]
get
{
return this.mPredictionResistant;
}
}
// Token: 0x060095E4 RID: 38372 RVA: 0x00213CC8 File Offset: 0x00211EC8
[Token(Token = "0x60095E4")]
[Address(RVA = "0x1DCF3A0", Offset = "0x1DCDDA0", VA = "0x181DCF3A0", Slot = "5")]
byte[] IEntropySource.GetEntropy()
{
int num = this.mEntropySize;
num += 7;
RandomNumberGenerator randomNumberGenerator = this.mRng;
byte[] array;
return array;
}
// Token: 0x170017F2 RID: 6130
// (get) Token: 0x060095E5 RID: 38373 RVA: 0x00213CF0 File Offset: 0x00211EF0
[Token(Token = "0x170017F2")]
int IEntropySource.EntropySize
{
[Token(Token = "0x60095E5")]
[Address(RVA = "0x4F8C10", Offset = "0x4F7610", VA = "0x1804F8C10", Slot = "6")]
get
{
return this.mEntropySize;
}
}
// Token: 0x040062F6 RID: 25334
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x40062F6")]
private readonly RandomNumberGenerator mRng;
// Token: 0x040062F7 RID: 25335
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x40062F7")]
private readonly bool mPredictionResistant;
// Token: 0x040062F8 RID: 25336
[global::Cpp2IlInjected.FieldOffset(Offset = "0x1C")]
[Token(Token = "0x40062F8")]
private readonly int mEntropySize;
}
}
}
@@ -0,0 +1,95 @@
using System;
using System.Runtime.InteropServices;
using System.Security.Cryptography;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng
{
// Token: 0x020015E5 RID: 5605
[Token(Token = "0x20015E5")]
[StructLayout(3)]
public class CryptoApiRandomGenerator : IRandomGenerator
{
// Token: 0x060095E6 RID: 38374 RVA: 0x00213D04 File Offset: 0x00211F04
[Token(Token = "0x60095E6")]
[Address(RVA = "0x1DCF5A0", Offset = "0x1DCDFA0", VA = "0x181DCF5A0")]
public CryptoApiRandomGenerator()
{
RandomNumberGenerator randomNumberGenerator = RandomNumberGenerator.Create();
int num = 0;
this.AddSeedMaterial((long)num);
this.rndProv = randomNumberGenerator;
}
// Token: 0x060095E7 RID: 38375 RVA: 0x00213D2C File Offset: 0x00211F2C
[Token(Token = "0x60095E7")]
[Address(RVA = "0x3C3A30", Offset = "0x3C2430", VA = "0x1803C3A30")]
public CryptoApiRandomGenerator(RandomNumberGenerator rng)
{
int num = 0;
this.AddSeedMaterial((long)num);
this.rndProv = rng;
}
// Token: 0x060095E8 RID: 38376 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x60095E8")]
[Address(RVA = "0x3C9F60", Offset = "0x3C8960", VA = "0x1803C9F60", Slot = "8")]
public virtual void AddSeedMaterial(byte[] seed)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x060095E9 RID: 38377 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x60095E9")]
[Address(RVA = "0x3C9F60", Offset = "0x3C8960", VA = "0x1803C9F60", Slot = "9")]
public virtual void AddSeedMaterial(long seed)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x060095EA RID: 38378 RVA: 0x00213D4C File Offset: 0x00211F4C
[Token(Token = "0x60095EA")]
[Address(RVA = "0x1DCF570", Offset = "0x1DCDF70", VA = "0x181DCF570", Slot = "10")]
public virtual void NextBytes(byte[] bytes)
{
this.rndProv.GetBytes(bytes);
}
// Token: 0x060095EB RID: 38379 RVA: 0x00213D6C File Offset: 0x00211F6C
[Token(Token = "0x60095EB")]
[Address(RVA = "0x1DCF420", Offset = "0x1DCDE20", VA = "0x181DCF420", Slot = "11")]
public virtual void NextBytes(byte[] bytes, int start, int len)
{
/*
An exception occurred when decompiling this method (060095EB)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng.CryptoApiRandomGenerator::NextBytes(System.Byte[],System.Int32,System.Int32)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_0E:
stloc:uint8[](var_0_14, newarr:uint8[]([mscorlib]System.Byte, ldloc:int32(len)))
stloc:int32(var_2_16, ldc.i4:int32(0))
call:void(Array::Copy, ldloc:uint8[][exp:Array](var_0_14), ldloc:int32(var_2_16), ldloc:uint8[][exp:Array](bytes), ldloc:int32(start), ldloc:int32(len))
stloc:ArgumentException(var_3_30, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("Start offset cannot be negative"), ldstr:string("start")))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x040062F9 RID: 25337
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x40062F9")]
private readonly RandomNumberGenerator rndProv;
}
}
@@ -0,0 +1,211 @@
using System;
using System.Runtime.InteropServices;
using System.Threading;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng
{
// Token: 0x020015E6 RID: 5606
[Token(Token = "0x20015E6")]
[StructLayout(3)]
public class DigestRandomGenerator : IRandomGenerator
{
// Token: 0x060095EC RID: 38380 RVA: 0x00213DAC File Offset: 0x00211FAC
[Token(Token = "0x60095EC")]
[Address(RVA = "0x1DD4310", Offset = "0x1DD2D10", VA = "0x181DD4310")]
public DigestRandomGenerator(IDigest digest)
{
this.digest = digest;
byte[] array = new byte[0];
this.seed = array;
this.seedCounter = (long)((ulong)1L);
byte[] array2 = new byte[array];
this.state = array2;
this.stateCounter = (long)((ulong)1L);
}
// Token: 0x060095ED RID: 38381 RVA: 0x00213DFC File Offset: 0x00211FFC
[Token(Token = "0x60095ED")]
[Address(RVA = "0x1DD3B60", Offset = "0x1DD2560", VA = "0x181DD3B60", Slot = "4")]
public void AddSeedMaterial(byte[] inSeed)
{
int num;
do
{
num = 0;
IDigest digest = this.digest;
int length = inSeed.Length;
byte[] array = this.seed;
IDigest digest2 = this.digest;
int length2 = array.Length;
IDigest digest3 = this.digest;
Monitor.Exit(this);
if (num != -1)
{
}
}
while (num != 0);
}
// Token: 0x060095EE RID: 38382 RVA: 0x00213E64 File Offset: 0x00212064
[Token(Token = "0x60095EE")]
[Address(RVA = "0x1DD39F0", Offset = "0x1DD23F0", VA = "0x181DD39F0", Slot = "5")]
public void AddSeedMaterial(long rSeed)
{
int num;
do
{
num = 0;
this.DigestAddCounter(rSeed);
byte[] array = this.seed;
IDigest digest = this.digest;
int length = array.Length;
IDigest digest2 = this.digest;
Monitor.Exit(this);
if (num != -1)
{
}
}
while (num != 0);
}
// Token: 0x060095EF RID: 38383 RVA: 0x00213EB8 File Offset: 0x002120B8
[Token(Token = "0x60095EF")]
[Address(RVA = "0x1DD42E0", Offset = "0x1DD2CE0", VA = "0x181DD42E0", Slot = "6")]
public void NextBytes(byte[] bytes)
{
int length = bytes.Length;
int num = 0;
this.NextBytes(bytes, num, length);
}
// Token: 0x060095F0 RID: 38384 RVA: 0x00213EE0 File Offset: 0x002120E0
[Token(Token = "0x60095F0")]
[Address(RVA = "0x1DD4170", Offset = "0x1DD2B70", VA = "0x181DD4170", Slot = "7")]
public void NextBytes(byte[] bytes, int start, int len)
{
int num;
do
{
num = 0;
this.GenerateState();
if (start < len)
{
byte[] array = this.state;
if (num == array.Length)
{
this.GenerateState();
}
num++;
}
Monitor.Exit(this);
if (num != -1)
{
}
}
while (num != 0);
}
// Token: 0x060095F1 RID: 38385 RVA: 0x00213F40 File Offset: 0x00212140
[Token(Token = "0x60095F1")]
[Address(RVA = "0x1DD3D10", Offset = "0x1DD2710", VA = "0x181DD3D10")]
private void CycleSeed()
{
byte[] array = this.seed;
IDigest digest = this.digest;
int length = array.Length;
long num = this.seedCounter;
long num2 = num + 1L;
this.seedCounter = num2;
this.DigestAddCounter(num);
IDigest digest2 = this.digest;
}
// Token: 0x060095F2 RID: 38386 RVA: 0x00213F90 File Offset: 0x00212190
[Token(Token = "0x60095F2")]
[Address(RVA = "0x1DD3F70", Offset = "0x1DD2970", VA = "0x181DD3F70")]
private void GenerateState()
{
long num = this.stateCounter;
long num2 = num + 1L;
this.stateCounter = num2;
this.DigestAddCounter(num);
byte[] array = this.state;
IDigest digest = this.digest;
int length = array.Length;
byte[] array2 = this.seed;
IDigest digest2 = this.digest;
int length2 = array2.Length;
IDigest digest3 = this.digest;
if (this.stateCounter == typeof(IDigest).TypeHandle)
{
byte[] array3 = this.seed;
IDigest digest4 = this.digest;
int length3 = array3.Length;
long num3 = this.seedCounter;
long num4 = num3 + 1L;
this.seedCounter = num4;
this.DigestAddCounter(num3);
IDigest digest5 = this.digest;
}
}
// Token: 0x060095F3 RID: 38387 RVA: 0x00214044 File Offset: 0x00212244
[Token(Token = "0x60095F3")]
[Address(RVA = "0x1DD3DF0", Offset = "0x1DD27F0", VA = "0x181DD3DF0")]
private void DigestAddCounter(long seedVal)
{
byte[] array = new byte[8];
Pack.UInt64_To_LE((ulong)seedVal, array);
IDigest digest = this.digest;
int length = array.Length;
}
// Token: 0x060095F4 RID: 38388 RVA: 0x00214074 File Offset: 0x00212274
[Token(Token = "0x60095F4")]
[Address(RVA = "0x1DD3F00", Offset = "0x1DD2900", VA = "0x181DD3F00")]
private void DigestUpdate(byte[] inSeed)
{
IDigest digest = this.digest;
int length = inSeed.Length;
}
// Token: 0x060095F5 RID: 38389 RVA: 0x00214098 File Offset: 0x00212298
[Token(Token = "0x60095F5")]
[Address(RVA = "0x1DD3E90", Offset = "0x1DD2890", VA = "0x181DD3E90")]
private void DigestDoFinal(byte[] result)
{
IDigest digest = this.digest;
}
// Token: 0x040062FA RID: 25338
[Token(Token = "0x40062FA")]
private const long CYCLE_COUNT = 10L;
// Token: 0x040062FB RID: 25339
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x40062FB")]
private long stateCounter;
// Token: 0x040062FC RID: 25340
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x40062FC")]
private long seedCounter;
// Token: 0x040062FD RID: 25341
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x40062FD")]
private IDigest digest;
// Token: 0x040062FE RID: 25342
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x40062FE")]
private byte[] state;
// Token: 0x040062FF RID: 25343
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
[Token(Token = "0x40062FF")]
private byte[] seed;
}
}
@@ -0,0 +1,457 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng.Drbg
{
// Token: 0x020015F6 RID: 5622
[Token(Token = "0x20015F6")]
[StructLayout(3)]
public class CtrSP800Drbg : ISP80090Drbg
{
// Token: 0x06009636 RID: 38454 RVA: 0x002150C0 File Offset: 0x002132C0
[Token(Token = "0x6009636")]
[Address(RVA = "0x1DD1150", Offset = "0x1DCFB50", VA = "0x181DD1150")]
public CtrSP800Drbg(IBlockCipher engine, int keySizeInBits, int securityStrength, IEntropySource entropySource, byte[] personalizationString, byte[] nonce)
{
if (!this.IsTdea(engine) || keySizeInBits == 168)
{
}
this.mEntropySource = 0;
this.mEngine = engine;
this.mKeySizeInBits = keySizeInBits;
this.mSecurityStrength = securityStrength;
this.mSeedLength = (int)((uint)2);
bool flag = this.IsTdea(engine);
this.mIsTdea = flag;
byte[] entropy = this.GetEntropy();
}
// Token: 0x06009637 RID: 38455 RVA: 0x0021512C File Offset: 0x0021332C
[Token(Token = "0x6009637")]
[Address(RVA = "0x1DCFE00", Offset = "0x1DCE800", VA = "0x181DCFE00")]
private void CTR_DRBG_Instantiate_algorithm(byte[] entropy, byte[] nonce, byte[] personalisationString)
{
byte[][] array = new byte[3][];
if (entropy != 0)
{
}
array[0] = entropy;
if (nonce != 0)
{
}
array[1] = nonce;
if (personalisationString != 0)
{
}
array[2] = personalisationString;
byte[] array2 = Arrays.ConcatenateAll(array);
int num = this.mSeedLength;
byte[] array3 = this.Block_Cipher_df(array2, num);
IBlockCipher blockCipher = this.mEngine;
int num2 = this.mKeySizeInBits;
num2 += 7;
byte[] array4 = new byte[0];
this.mKey = array4;
byte[] array5 = new byte[array3];
byte[] array6 = this.mKey;
this.mV = array5;
this.CTR_DRBG_Update(array3, array6, array5);
this.mReseedCounter = (long)((ulong)1L);
}
// Token: 0x06009638 RID: 38456 RVA: 0x002151D8 File Offset: 0x002133D8
[Token(Token = "0x6009638")]
[Address(RVA = "0x1DD00D0", Offset = "0x1DCEAD0", VA = "0x181DD00D0")]
private void CTR_DRBG_Update(byte[] seed, byte[] key, byte[] v)
{
byte[] array = new byte[seed.Length];
IBlockCipher blockCipher = this.mEngine;
byte[] array2 = new byte[array];
IBlockCipher blockCipher2 = this.mEngine;
IBlockCipher blockCipher3 = this.mEngine;
KeyParameter keyParameter = new KeyParameter(this.ExpandKey(key));
int num = 0;
int num6;
if (num < seed.Length)
{
int num2 = v.Length;
uint num3;
num2 -= (int)num3;
byte b;
num3 += (uint)b;
IBlockCipher blockCipher4 = this.mEngine;
if (num < num2)
{
num += num;
num++;
}
int num4 = array.Length;
num4 -= num;
int num5 = 0;
num += array2;
num6 = 0;
num5 += num5;
num += 4;
num += 19;
}
int length = array.Length;
if (num6 < length)
{
num6++;
}
int num7 = 0;
int length2 = v.Length;
int num8 = 0;
Array.Copy(array, num7, v, num8, length2);
}
// Token: 0x06009639 RID: 38457 RVA: 0x002152C0 File Offset: 0x002134C0
[Token(Token = "0x6009639")]
[Address(RVA = "0x1DD0020", Offset = "0x1DCEA20", VA = "0x181DD0020")]
private void CTR_DRBG_Reseed_algorithm(byte[] additionalInput)
{
byte[] array = Arrays.Concatenate(this.GetEntropy(), additionalInput);
int num = this.mSeedLength;
byte[] array2 = this.Block_Cipher_df(array, num);
byte[] array3 = this.mV;
byte[] array4 = this.mKey;
this.CTR_DRBG_Update(array2, array4, array3);
this.mReseedCounter = (long)((ulong)1L);
}
// Token: 0x0600963A RID: 38458 RVA: 0x0021530C File Offset: 0x0021350C
[Token(Token = "0x600963A")]
[Address(RVA = "0x1DD0FF0", Offset = "0x1DCF9F0", VA = "0x181DD0FF0")]
private void XOR(byte[] output, byte[] a, byte[] b, int bOff)
{
int num = 0;
int length = output.Length;
if (num < length)
{
num++;
}
}
// Token: 0x0600963B RID: 38459 RVA: 0x00215330 File Offset: 0x00213530
[Token(Token = "0x600963B")]
[Address(RVA = "0x1DCF5D0", Offset = "0x1DCDFD0", VA = "0x181DCF5D0")]
private void AddOneTo(byte[] longer)
{
int num = longer.Length;
uint num2;
num -= (int)num2;
byte b;
num2 += (uint)b;
}
// Token: 0x0600963C RID: 38460 RVA: 0x00215354 File Offset: 0x00213554
[Token(Token = "0x600963C")]
[Address(RVA = "0x1DD0950", Offset = "0x1DCF350", VA = "0x181DD0950")]
private byte[] GetEntropy()
{
IEntropySource entropySource = this.mEntropySource;
int num = this.mSecurityStrength;
num += 7;
num += typeof(IEntropySource).TypeHandle;
throw new NullReferenceException();
}
// Token: 0x0600963D RID: 38461 RVA: 0x00215380 File Offset: 0x00213580
[Token(Token = "0x600963D")]
[Address(RVA = "0x1DCF920", Offset = "0x1DCE320", VA = "0x181DCF920")]
private byte[] Block_Cipher_df(byte[] inputString, int bitLength)
{
IBlockCipher blockCipher = this.mEngine;
int length = inputString.Length;
byte[] array = new byte[0];
int num = 0;
int num2 = 0;
this.copyIntToByteArray(array, length, num2);
this.copyIntToByteArray(array, length, 4);
int num3 = 0;
Array.Copy(inputString, num3, array, 8, length);
int num4 = this.mKeySizeInBits;
num3 += num4;
byte[] array2 = new byte[num3];
byte[] array3 = new byte[num3];
byte[] array4 = new byte[num3];
int num5 = this.mKeySizeInBits;
num3 += num5;
byte[] array5 = new byte[num3];
int num6 = 0;
int length2 = array5.Length;
int num7 = 0;
byte[] k_BITS = CtrSP800Drbg.K_BITS;
Array.Copy(k_BITS, num7, array5, num6, length2);
int num9;
if (k_BITS > 0)
{
array4[0] = (byte)num;
array4[0] = (byte)num;
array4[0] = (byte)num;
array4[0] = (byte)num;
this.BCC(array3, array5, array4, array);
int num8 = array2.Length;
num8 -= num;
num9 = 0;
Array.Copy(array3, num9, array2, num, num8);
int num10 = this.mKeySizeInBits;
num += num9;
num10 += num9;
num++;
}
byte[] array6 = new byte[num9];
int length3 = array5.Length;
int num11 = 0;
int num12 = 0;
Array.Copy(array2, num12, array5, num11, length3);
int length4 = array6.Length;
int num13 = 0;
int length5 = array5.Length;
Array.Copy(array2, length5, array6, num13, length4);
byte[] array7 = new byte[0];
IBlockCipher blockCipher2 = this.mEngine;
KeyParameter keyParameter = new KeyParameter(this.ExpandKey(array5));
int num14 = 0;
if (num14 < array7.Length)
{
IBlockCipher blockCipher3 = this.mEngine;
if (num14 < blockCipher2)
{
num14 += num14;
num14++;
}
int num15 = array7.Length;
num15 -= num14;
int num16 = 0;
Array.Copy(array6, num16, array7, num14, num15);
num16 += num16;
num14 += 4;
num14 += 19;
}
return array7;
}
// Token: 0x0600963E RID: 38462 RVA: 0x00215574 File Offset: 0x00213774
[Token(Token = "0x600963E")]
[Address(RVA = "0x1DCF630", Offset = "0x1DCE030", VA = "0x181DCF630")]
private void BCC(byte[] bccOut, byte[] k, byte[] iV, byte[] data)
{
IBlockCipher blockCipher = this.mEngine;
byte[] array = new byte[0];
byte[] array2 = new byte[0];
IBlockCipher blockCipher2 = this.mEngine;
KeyParameter keyParameter = new KeyParameter(this.ExpandKey(k));
IBlockCipher blockCipher3 = this.mEngine;
int num = 0;
int length = array2.Length;
if (num < length)
{
num++;
}
IBlockCipher blockCipher4 = this.mEngine;
int num2 = 0;
if (num2 < num)
{
num2 += num2;
num2++;
}
num++;
}
// Token: 0x0600963F RID: 38463 RVA: 0x00215604 File Offset: 0x00213804
[Token(Token = "0x600963F")]
[Address(RVA = "0x1DD1380", Offset = "0x1DCFD80", VA = "0x181DD1380")]
private void copyIntToByteArray(byte[] buf, int value, int offSet)
{
int num = offSet + 1;
}
// Token: 0x170017F4 RID: 6132
// (get) Token: 0x06009640 RID: 38464 RVA: 0x0021561C File Offset: 0x0021381C
[Token(Token = "0x170017F4")]
public int BlockSize
{
[Token(Token = "0x6009640")]
[Address(RVA = "0x1DD1420", Offset = "0x1DCFE20", VA = "0x181DD1420", Slot = "4")]
get
{
return this.mV.Length;
}
}
// Token: 0x06009641 RID: 38465 RVA: 0x0021563C File Offset: 0x0021383C
[Token(Token = "0x6009641")]
[Address(RVA = "0x1DD04B0", Offset = "0x1DCEEB0", VA = "0x181DD04B0", Slot = "5")]
public int Generate(byte[] output, byte[] additionalInput, bool predictionResistant)
{
/*
An exception occurred when decompiling this method (06009641)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int32 BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng.Drbg.CtrSP800Drbg::Generate(System.Byte[],System.Byte[],System.Boolean)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_146:
stloc:ArgumentException(var_26_15C, newobj:ArgumentException(ArgumentException::.ctor, call:string(string::Concat, ldstr:string[exp:object]("Number of bits per request limited to "), ldloc:Camera[exp:object](var_25)), ldstr:string("output")))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x06009642 RID: 38466 RVA: 0x002157A8 File Offset: 0x002139A8
[Token(Token = "0x6009642")]
[Address(RVA = "0x1DD0FE0", Offset = "0x1DCF9E0", VA = "0x181DD0FE0", Slot = "6")]
public void Reseed(byte[] additionalInput)
{
this.CTR_DRBG_Reseed_algorithm(additionalInput);
}
// Token: 0x06009643 RID: 38467 RVA: 0x002157BC File Offset: 0x002139BC
[Token(Token = "0x6009643")]
[Address(RVA = "0x1DD0AA0", Offset = "0x1DCF4A0", VA = "0x181DD0AA0")]
private bool IsTdea(IBlockCipher cipher)
{
bool flag;
bool flag2;
return flag || flag2;
}
// Token: 0x06009644 RID: 38468 RVA: 0x002157D8 File Offset: 0x002139D8
[Token(Token = "0x6009644")]
[Address(RVA = "0x1DD09F0", Offset = "0x1DCF3F0", VA = "0x181DD09F0")]
private int GetMaxSecurityStrength(IBlockCipher cipher, int keySizeInBits)
{
if (!this.IsTdea(cipher) || keySizeInBits == 168)
{
}
return -1;
}
// Token: 0x06009645 RID: 38469 RVA: 0x00215800 File Offset: 0x00213A00
[Token(Token = "0x6009645")]
[Address(RVA = "0x1DD03E0", Offset = "0x1DCEDE0", VA = "0x181DD03E0")]
private byte[] ExpandKey(byte[] key)
{
if (!this.mIsTdea)
{
return key;
}
byte[] array = new byte[24];
int num = 0;
int num2 = 0;
this.PadKey(key, num2, array, num);
ulong num3;
this.PadKey(key, 7, array, (int)num3);
ulong num4;
this.PadKey(key, 14, array, (int)num4);
return array;
}
// Token: 0x06009646 RID: 38470 RVA: 0x00215848 File Offset: 0x00213A48
[Token(Token = "0x6009646")]
[Address(RVA = "0x1DD0B30", Offset = "0x1DCF530", VA = "0x181DD0B30")]
private void PadKey(byte[] keyMaster, int keyOff, byte[] tmp, int tmpOff)
{
int length = keyMaster.Length;
int num = keyOff + 1;
byte b;
tmp[0] = b;
int length2 = keyMaster.Length;
byte b2;
tmp[0] = b2;
int length3 = keyMaster.Length;
byte b3;
tmp[0] = b3;
int length4 = keyMaster.Length;
byte b4;
tmp[0] = b4;
int length5 = keyMaster.Length;
byte b5;
tmp[0] = b5;
int length6 = keyMaster.Length;
byte b6;
b6 += b6;
int length7 = tmp.Length;
int length8 = tmp.Length;
byte b7;
tmp[0] = b7;
}
// Token: 0x04006330 RID: 25392
[Token(Token = "0x4006330")]
private static readonly long TDEA_RESEED_MAX = (long)((uint)int.MinValue);
// Token: 0x04006331 RID: 25393
[Token(Token = "0x4006331")]
private static readonly long AES_RESEED_MAX = (long)((ulong)140737488355328L);
// Token: 0x04006332 RID: 25394
[Token(Token = "0x4006332")]
private static readonly int TDEA_MAX_BITS_REQUEST;
// Token: 0x04006333 RID: 25395
[Token(Token = "0x4006333")]
private static readonly int AES_MAX_BITS_REQUEST;
// Token: 0x04006334 RID: 25396
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006334")]
private readonly IEntropySource mEntropySource;
// Token: 0x04006335 RID: 25397
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006335")]
private readonly IBlockCipher mEngine;
// Token: 0x04006336 RID: 25398
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x4006336")]
private readonly int mKeySizeInBits;
// Token: 0x04006337 RID: 25399
[global::Cpp2IlInjected.FieldOffset(Offset = "0x24")]
[Token(Token = "0x4006337")]
private readonly int mSeedLength;
// Token: 0x04006338 RID: 25400
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x4006338")]
private readonly int mSecurityStrength;
// Token: 0x04006339 RID: 25401
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
[Token(Token = "0x4006339")]
private byte[] mKey;
// Token: 0x0400633A RID: 25402
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
[Token(Token = "0x400633A")]
private byte[] mV;
// Token: 0x0400633B RID: 25403
[global::Cpp2IlInjected.FieldOffset(Offset = "0x40")]
[Token(Token = "0x400633B")]
private long mReseedCounter;
// Token: 0x0400633C RID: 25404
[global::Cpp2IlInjected.FieldOffset(Offset = "0x48")]
[Token(Token = "0x400633C")]
private bool mIsTdea;
// Token: 0x0400633D RID: 25405
[Token(Token = "0x400633D")]
private static readonly byte[] K_BITS = Hex.Decode("000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F");
}
}
@@ -0,0 +1,131 @@
using System;
using System.Collections;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng.Drbg
{
// Token: 0x020015F7 RID: 5623
[Token(Token = "0x20015F7")]
[StructLayout(3)]
internal class DrbgUtilities
{
// Token: 0x06009648 RID: 38472 RVA: 0x00215914 File Offset: 0x00213B14
[Token(Token = "0x6009648")]
[Address(RVA = "0x1E3A1F0", Offset = "0x1E38BF0", VA = "0x181E3A1F0")]
static DrbgUtilities()
{
IDictionary dictionary = Platform.CreateHashtable();
}
// Token: 0x06009649 RID: 38473 RVA: 0x00215930 File Offset: 0x00213B30
[Token(Token = "0x6009649")]
[Address(RVA = "0x1E39AA0", Offset = "0x1E384A0", VA = "0x181E39AA0")]
internal static int GetMaxSecurityStrength(IDigest d)
{
throw new NullReferenceException();
}
// Token: 0x0600964A RID: 38474 RVA: 0x00215944 File Offset: 0x00213B44
[Token(Token = "0x600964A")]
[Address(RVA = "0x1E39B70", Offset = "0x1E38570", VA = "0x181E39B70")]
internal static int GetMaxSecurityStrength(IMac m)
{
throw new NullReferenceException();
}
// Token: 0x0600964B RID: 38475 RVA: 0x00215960 File Offset: 0x00213B60
[Token(Token = "0x600964B")]
[Address(RVA = "0x1E39C70", Offset = "0x1E38670", VA = "0x181E39C70")]
internal static byte[] HashDF(IDigest digest, byte[] seedMaterial, int seedLength)
{
byte[] array = new byte[seedMaterial];
byte[] array2 = new byte[array.Length];
int num = 0;
if (num < digest)
{
num += num;
num++;
}
num += num;
num++;
num += num;
num++;
num += num;
num++;
num += num;
num++;
int num2 = seedMaterial.Length;
uint num3;
if (num < (int)num3)
{
num += num;
num++;
}
if (num < num2)
{
num += num;
num++;
}
int num4 = array2.Length;
num2 = num4;
int num5 = array.Length;
num5 -= num2;
if (num5 <= num4)
{
num4 = num5;
}
int num6 = 0;
Array.Copy(array2, num6, array, num2, num4);
if (seedLength != 0)
{
uint num7;
num7 -= (uint)seedLength;
int length = array.Length;
if (num != length)
{
num++;
byte b;
b += b;
b = (byte)((int)b + seedLength);
b += b;
b = (byte)((int)b + seedLength);
b += b;
b = (byte)((int)b + seedLength);
b += b;
b = (byte)((int)b + seedLength);
b += b;
b = (byte)((int)b + seedLength);
b += b;
b = (byte)((int)b + seedLength);
b += b;
b = (byte)((int)b + seedLength);
}
}
return array;
}
// Token: 0x0600964C RID: 38476 RVA: 0x00215A84 File Offset: 0x00213C84
[Token(Token = "0x600964C")]
[Address(RVA = "0x1E3A1E0", Offset = "0x1E38BE0", VA = "0x181E3A1E0")]
internal static bool IsTooLarge(byte[] bytes, int maxBytes)
{
if (bytes == 0)
{
}
return bytes.Length > maxBytes;
}
// Token: 0x0600964D RID: 38477 RVA: 0x00215AA0 File Offset: 0x00213CA0
[Token(Token = "0x600964D")]
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
public DrbgUtilities()
{
}
// Token: 0x0400633E RID: 25406
[Token(Token = "0x400633E")]
private static readonly IDictionary maxSecurityStrengths;
}
}
@@ -0,0 +1,240 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng.Drbg
{
// Token: 0x020015F8 RID: 5624
[Token(Token = "0x20015F8")]
[StructLayout(3)]
public class HMacSP800Drbg : ISP80090Drbg
{
// Token: 0x0600964E RID: 38478 RVA: 0x00215AB4 File Offset: 0x00213CB4
[Token(Token = "0x600964E")]
[Address(RVA = "0x1E41E60", Offset = "0x1E40860", VA = "0x181E41E60")]
public HMacSP800Drbg(IMac hMac, int securityStrength, IEntropySource entropySource, byte[] personalizationString, byte[] nonce)
{
this.mHMac = hMac;
this.mSecurityStrength = securityStrength;
this.mEntropySource = entropySource;
byte[] entropy = this.GetEntropy();
byte[][] array = new byte[3][];
if (entropy != 0)
{
}
array[0] = entropy;
byte[] array2 = Arrays.ConcatenateAll(array);
byte[] array3 = new byte[array2];
this.mK = array3;
byte[] array4 = new byte[array3.Length];
this.mV = array4;
int num = 0;
this.hmac_DRBG_Update_Func(array2, (byte)num);
if (array2 != 0)
{
}
this.mReseedCounter = (long)((ulong)1L);
}
// Token: 0x0600964F RID: 38479 RVA: 0x00215B50 File Offset: 0x00213D50
[Token(Token = "0x600964F")]
[Address(RVA = "0x1E42430", Offset = "0x1E40E30", VA = "0x181E42430")]
private void hmac_DRBG_Update(byte[] seedMaterial)
{
int num = 0;
this.hmac_DRBG_Update_Func(seedMaterial, (byte)num);
if (seedMaterial != 0)
{
}
}
// Token: 0x06009650 RID: 38480 RVA: 0x00215B6C File Offset: 0x00213D6C
[Token(Token = "0x6009650")]
[Address(RVA = "0x1E42240", Offset = "0x1E40C40", VA = "0x181E42240")]
private void hmac_DRBG_Update_Func(byte[] seedMaterial, byte vValue)
{
IMac mac = this.mHMac;
KeyParameter keyParameter = new KeyParameter(this.mK);
byte[] array = this.mV;
IMac mac2 = this.mHMac;
int length = array.Length;
IMac mac3 = this.mHMac;
if (seedMaterial != 0)
{
IMac mac4 = this.mHMac;
int length2 = seedMaterial.Length;
}
IMac mac5 = this.mHMac;
IMac mac6 = this.mHMac;
KeyParameter keyParameter2 = new KeyParameter(this.mK);
byte[] array2 = this.mV;
IMac mac7 = this.mHMac;
int length3 = array2.Length;
IMac mac8 = this.mHMac;
}
// Token: 0x170017F5 RID: 6133
// (get) Token: 0x06009651 RID: 38481 RVA: 0x00215C08 File Offset: 0x00213E08
[Token(Token = "0x170017F5")]
public int BlockSize
{
[Token(Token = "0x6009651")]
[Address(RVA = "0x1E42220", Offset = "0x1E40C20", VA = "0x181E42220", Slot = "4")]
get
{
return this.mV.Length;
}
}
// Token: 0x06009652 RID: 38482 RVA: 0x00215C28 File Offset: 0x00213E28
[Token(Token = "0x6009652")]
[Address(RVA = "0x1E41770", Offset = "0x1E40170", VA = "0x181E41770", Slot = "5")]
public int Generate(byte[] output, byte[] additionalInput, bool predictionResistant)
{
int length = output.Length;
long num = this.mReseedCounter;
if (predictionResistant)
{
byte[] array = Arrays.Concatenate(this.GetEntropy(), additionalInput);
int num2 = 0;
this.hmac_DRBG_Update_Func(array, (byte)num2);
if (array != 0)
{
ulong num3;
this.hmac_DRBG_Update_Func(array, (byte)num3);
}
this.mReseedCounter = (long)((ulong)1L);
}
if (additionalInput != 0)
{
int num4 = 0;
this.hmac_DRBG_Update_Func(additionalInput, (byte)num4);
ulong num5;
this.hmac_DRBG_Update_Func(additionalInput, (byte)num5);
}
byte[] array2 = new byte[output.Length];
byte[] array3 = this.mV;
int length2 = output.Length;
IMac mac = this.mHMac;
KeyParameter keyParameter = new KeyParameter(this.mK);
int num6 = 0;
int num10;
if (length2 > 0)
{
byte[] array4 = this.mV;
IMac mac2 = this.mHMac;
int num7 = 0;
if (num7 < mac)
{
num7 += num7;
num7++;
}
int num8 = 0;
IMac mac3 = this.mHMac;
int num9 = 0;
if (num9 < num8)
{
num9 += num9;
num9++;
}
byte[] array5 = this.mV;
num10 = array5.Length;
int num11 = num10 * num6;
int num12 = 0;
Array.Copy(array5, num12, array2, num11, num10);
num6++;
}
num10 = this.mV.Length;
if (num10 * length2 < array2.Length)
{
IMac mac4 = this.mHMac;
IMac mac5 = this.mHMac;
byte[] array6 = this.mV;
int length3 = array6.Length;
int num13 = array2.Length;
int num14 = 0;
int num15 = length3 * length2;
num13 -= num15;
Array.Copy(array6, num14, array2, num15, num13);
}
int num16 = 0;
this.hmac_DRBG_Update_Func(additionalInput, (byte)num16);
if (additionalInput != 0)
{
ulong num17;
this.hmac_DRBG_Update_Func(additionalInput, (byte)num17);
}
int num18 = 0;
int length4 = output.Length;
int num19 = 0;
Array.Copy(array2, num19, output, num18, length4);
return length;
}
// Token: 0x06009653 RID: 38483 RVA: 0x00215DF8 File Offset: 0x00213FF8
[Token(Token = "0x6009653")]
[Address(RVA = "0x1E41D50", Offset = "0x1E40750", VA = "0x181E41D50", Slot = "6")]
public void Reseed(byte[] additionalInput)
{
byte[] array = Arrays.Concatenate(this.GetEntropy(), additionalInput);
int num = 0;
this.hmac_DRBG_Update_Func(array, (byte)num);
if (array != 0)
{
}
this.mReseedCounter = (long)((ulong)1L);
}
// Token: 0x06009654 RID: 38484 RVA: 0x00215E2C File Offset: 0x0021402C
[Token(Token = "0x6009654")]
[Address(RVA = "0x1E41CB0", Offset = "0x1E406B0", VA = "0x181E41CB0")]
private byte[] GetEntropy()
{
IEntropySource entropySource = this.mEntropySource;
int num = this.mSecurityStrength;
num += 7;
num += typeof(IEntropySource).TypeHandle;
throw new NullReferenceException();
}
// Token: 0x0400633F RID: 25407
[Token(Token = "0x400633F")]
private static readonly long RESEED_MAX = (long)((ulong)140737488355328L);
// Token: 0x04006340 RID: 25408
[Token(Token = "0x4006340")]
private static readonly int MAX_BITS_REQUEST;
// Token: 0x04006341 RID: 25409
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006341")]
private readonly byte[] mK;
// Token: 0x04006342 RID: 25410
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006342")]
private readonly byte[] mV;
// Token: 0x04006343 RID: 25411
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x4006343")]
private readonly IEntropySource mEntropySource;
// Token: 0x04006344 RID: 25412
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x4006344")]
private readonly IMac mHMac;
// Token: 0x04006345 RID: 25413
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
[Token(Token = "0x4006345")]
private readonly int mSecurityStrength;
// Token: 0x04006346 RID: 25414
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
[Token(Token = "0x4006346")]
private long mReseedCounter;
}
}
@@ -0,0 +1,358 @@
using System;
using System.Collections;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng.Drbg
{
// Token: 0x020015F9 RID: 5625
[Token(Token = "0x20015F9")]
[StructLayout(3)]
public class HashSP800Drbg : ISP80090Drbg
{
// Token: 0x06009656 RID: 38486 RVA: 0x00215E74 File Offset: 0x00214074
[Token(Token = "0x6009656")]
[Address(RVA = "0x1E43010", Offset = "0x1E41A10", VA = "0x181E43010")]
static HashSP800Drbg()
{
IDictionary dictionary = HashSP800Drbg.seedlens;
IDictionary dictionary2 = HashSP800Drbg.seedlens;
IDictionary dictionary3 = HashSP800Drbg.seedlens;
IDictionary dictionary4 = HashSP800Drbg.seedlens;
IDictionary dictionary5 = HashSP800Drbg.seedlens;
IDictionary dictionary6 = HashSP800Drbg.seedlens;
IDictionary dictionary7 = HashSP800Drbg.seedlens;
}
// Token: 0x06009657 RID: 38487 RVA: 0x00215EEC File Offset: 0x002140EC
[Token(Token = "0x6009657")]
[Address(RVA = "0x1E43340", Offset = "0x1E41D40", VA = "0x181E43340")]
public HashSP800Drbg(IDigest digest, int securityStrength, IEntropySource entropySource, byte[] personalizationString, byte[] nonce)
{
int num;
do
{
base..ctor();
this.mDigest = digest;
this.mEntropySource = entropySource;
this.mSecurityStrength = securityStrength;
IDictionary dictionary = HashSP800Drbg.seedlens;
num = 0;
}
while ("{il2cpp array field local12->}" != num);
byte[] one = HashSP800Drbg.ONE;
this.mSeedLength = one;
byte[] entropy = this.GetEntropy();
byte[][] array = new byte[3][];
if (entropy != 0)
{
}
array[0] = entropy;
byte[] array2 = Arrays.ConcatenateAll(array);
IDigest digest2 = this.mDigest;
int num2 = this.mSeedLength;
byte[] array3 = DrbgUtilities.HashDF(digest2, array2, num2);
this.mV = array3;
int num3 = array3.Length;
num3++;
byte[] array4 = new byte[num3];
byte[] array5 = this.mV;
int length = array5.Length;
int num4 = 0;
Array.Copy(array5, num4, array4, 1, length);
int num5 = this.mSeedLength;
byte[] array6 = DrbgUtilities.HashDF(this.mDigest, array4, num5);
this.mC = array6;
this.mReseedCounter = (long)((ulong)1L);
}
// Token: 0x170017F6 RID: 6134
// (get) Token: 0x06009658 RID: 38488 RVA: 0x00215FEC File Offset: 0x002141EC
[Token(Token = "0x170017F6")]
public int BlockSize
{
[Token(Token = "0x6009658")]
[Address(RVA = "0x1E437A0", Offset = "0x1E421A0", VA = "0x181E437A0", Slot = "4")]
get
{
IDigest digest = this.mDigest;
throw new NullReferenceException();
}
}
// Token: 0x06009659 RID: 38489 RVA: 0x00216008 File Offset: 0x00214208
[Token(Token = "0x6009659")]
[Address(RVA = "0x1E426A0", Offset = "0x1E410A0", VA = "0x181E426A0", Slot = "5")]
public int Generate(byte[] output, byte[] additionalInput, bool predictionResistant)
{
int length = output.Length;
long num = this.mReseedCounter;
if (predictionResistant)
{
this.Reseed(additionalInput);
}
if (additionalInput != 0)
{
byte[] array = this.mV;
int num2 = additionalInput.Length;
num2++;
byte[] array2 = new byte[num2];
array2[0] = (byte)((ulong)2L);
byte[] array3 = this.mV;
int length2 = array3.Length;
int num3 = 0;
uint num4;
Array.Copy(array3, num3, array2, (int)num4, length2);
int num5 = this.mV.Length;
int length3 = additionalInput.Length;
num5++;
int num6 = 0;
Array.Copy(additionalInput, num6, array2, num5, length3);
byte[] array4 = this.Hash(array2);
byte[] array5 = this.mV;
this.AddTo(array5, array4);
}
byte[] array6 = this.mV;
IDigest digest = this.mDigest;
byte[] array7 = new byte[array6.Length];
int length4 = array6.Length;
int num7 = 0;
int num8 = 0;
Array.Copy(array6, num8, array7, num7, length4);
byte[] array8 = new byte[additionalInput];
IDigest digest2 = this.mDigest;
byte[] array9 = new byte[array8];
int i = 0;
this.DoHash(array7, array9);
int num9 = array9.Length;
int num10 = array8.Length;
int num11 = i * num9;
num10 -= num11;
if (num10 <= num9)
{
num9 = num10;
}
int num12 = 0;
Array.Copy(array9, num12, array8, num11, num9);
byte[] one = HashSP800Drbg.ONE;
this.AddTo(array7, one);
i++;
while (i <= additionalInput)
{
}
int num13 = this.mV.Length;
num13++;
byte[] array10 = new byte[num13];
byte[] array11 = this.mV;
int length5 = array11.Length;
int num14 = 0;
Array.Copy(array11, num14, array10, 1, length5);
array10[0] = (byte)((ulong)3L);
byte[] array12 = this.Hash(array10);
byte[] array13 = this.mV;
this.AddTo(array13, array12);
byte[] array14 = this.mC;
byte[] array15 = this.mV;
this.AddTo(array15, array14);
byte[] array16 = new byte[0];
long num15 = this.mReseedCounter;
array16[0] = (byte)num15;
long num16 = this.mReseedCounter;
array16[0] = (byte)num16;
long num17 = this.mReseedCounter;
array16[0] = (byte)num17;
long num18 = this.mReseedCounter;
array16[0] = (byte)num18;
byte[] array17 = this.mV;
this.AddTo(array17, array16);
int num19 = 0;
int length6 = output.Length;
int num20 = 0;
Array.Copy(array8, num20, output, num19, length6);
return length;
}
// Token: 0x0600965A RID: 38490 RVA: 0x00216290 File Offset: 0x00214490
[Token(Token = "0x600965A")]
[Address(RVA = "0x1E42C00", Offset = "0x1E41600", VA = "0x181E42C00")]
private byte[] GetEntropy()
{
IEntropySource entropySource = this.mEntropySource;
int num = this.mSecurityStrength;
num += 7;
num += typeof(IEntropySource).TypeHandle;
throw new NullReferenceException();
}
// Token: 0x0600965B RID: 38491 RVA: 0x002162BC File Offset: 0x002144BC
[Token(Token = "0x600965B")]
[Address(RVA = "0x1E42510", Offset = "0x1E40F10", VA = "0x181E42510")]
private void AddTo(byte[] longer, byte[] shorter)
{
int length = shorter.Length;
int num = 0;
int num2 = longer.Length;
int num3 = length - 1;
num2 -= length;
byte b;
num += (int)b;
byte b2;
num += (int)b2;
num3 = num2 - 1;
byte b3;
num += (int)b3;
}
// Token: 0x0600965C RID: 38492 RVA: 0x002162FC File Offset: 0x002144FC
[Token(Token = "0x600965C")]
[Address(RVA = "0x1E42D30", Offset = "0x1E41730", VA = "0x181E42D30", Slot = "6")]
public void Reseed(byte[] additionalInput)
{
byte[] entropy = this.GetEntropy();
byte[][] array = new byte[4][];
byte[] one = HashSP800Drbg.ONE;
if (one != 0)
{
}
array[0] = one;
byte[] array2 = this.mV;
if (array2 != 0)
{
}
array[1] = array2;
if (entropy != 0)
{
}
array[2] = entropy;
if (additionalInput != 0)
{
}
array[3] = additionalInput;
byte[] array3 = Arrays.ConcatenateAll(array);
IDigest digest = this.mDigest;
int num = this.mSeedLength;
byte[] array4 = DrbgUtilities.HashDF(digest, array3, num);
this.mV = array4;
int num2 = array4.Length;
num2++;
byte[] array5 = new byte[num2];
array5[0] = (byte)((ulong)0L);
byte[] array6 = this.mV;
int length = array6.Length;
int num3 = 0;
Array.Copy(array6, num3, array5, 1, length);
int num4 = this.mSeedLength;
byte[] array7 = DrbgUtilities.HashDF(this.mDigest, array5, num4);
this.mC = array7;
this.mReseedCounter = (long)((ulong)1L);
}
// Token: 0x0600965D RID: 38493 RVA: 0x002163F8 File Offset: 0x002145F8
[Token(Token = "0x600965D")]
[Address(RVA = "0x1E42CA0", Offset = "0x1E416A0", VA = "0x181E42CA0")]
private byte[] Hash(byte[] input)
{
IDigest digest = this.mDigest;
byte[] array = new byte[0];
this.DoHash(input, array);
return array;
}
// Token: 0x0600965E RID: 38494 RVA: 0x00216424 File Offset: 0x00214624
[Token(Token = "0x600965E")]
[Address(RVA = "0x1E42600", Offset = "0x1E41000", VA = "0x181E42600")]
private void DoHash(byte[] input, byte[] output)
{
IDigest digest = this.mDigest;
int length = input.Length;
IDigest digest2 = this.mDigest;
}
// Token: 0x0600965F RID: 38495 RVA: 0x0021644C File Offset: 0x0021464C
[Token(Token = "0x600965F")]
[Address(RVA = "0x1E437F0", Offset = "0x1E421F0", VA = "0x181E437F0")]
private byte[] hashgen(byte[] input, int lengthInBits)
{
IDigest digest = this.mDigest;
byte[] array = new byte[input.Length];
int length = input.Length;
int i = 0;
int num = 0;
int num2 = 0;
Array.Copy(input, num2, array, num, length);
byte[] array2 = new byte[lengthInBits];
IDigest digest2 = this.mDigest;
byte[] array3 = new byte[array2];
this.DoHash(array, array3);
int num3 = array3.Length;
int num4 = array2.Length;
int num5 = num3 * i;
num4 -= num5;
if (num4 <= num3)
{
num3 = num4;
}
int num6 = 0;
Array.Copy(array3, num6, array2, num5, num3);
byte[] one = HashSP800Drbg.ONE;
this.AddTo(array, one);
i++;
while (i <= lengthInBits)
{
}
return array2;
}
// Token: 0x04006347 RID: 25415
[Token(Token = "0x4006347")]
private static readonly byte[] ONE = new byte[] { (byte)((ulong)1L) };
// Token: 0x04006348 RID: 25416
[Token(Token = "0x4006348")]
private static readonly long RESEED_MAX = (long)((ulong)140737488355328L);
// Token: 0x04006349 RID: 25417
[Token(Token = "0x4006349")]
private static readonly int MAX_BITS_REQUEST;
// Token: 0x0400634A RID: 25418
[Token(Token = "0x400634A")]
private static readonly IDictionary seedlens = Platform.CreateHashtable();
// Token: 0x0400634B RID: 25419
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x400634B")]
private readonly IDigest mDigest;
// Token: 0x0400634C RID: 25420
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x400634C")]
private readonly IEntropySource mEntropySource;
// Token: 0x0400634D RID: 25421
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x400634D")]
private readonly int mSecurityStrength;
// Token: 0x0400634E RID: 25422
[global::Cpp2IlInjected.FieldOffset(Offset = "0x24")]
[Token(Token = "0x400634E")]
private readonly int mSeedLength;
// Token: 0x0400634F RID: 25423
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x400634F")]
private byte[] mV;
// Token: 0x04006350 RID: 25424
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
[Token(Token = "0x4006350")]
private byte[] mC;
// Token: 0x04006351 RID: 25425
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
[Token(Token = "0x4006351")]
private long mReseedCounter;
}
}
@@ -0,0 +1,32 @@
using System;
using System.Runtime.InteropServices;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng.Drbg
{
// Token: 0x020015FA RID: 5626
[Token(Token = "0x20015FA")]
[StructLayout(3)]
public interface ISP80090Drbg
{
// Token: 0x170017F7 RID: 6135
// (get) Token: 0x06009660 RID: 38496
[Token(Token = "0x170017F7")]
int BlockSize
{
[Token(Token = "0x6009660")]
[Address(Slot = "0")]
get;
}
// Token: 0x06009661 RID: 38497
[Token(Token = "0x6009661")]
[Address(Slot = "1")]
int Generate(byte[] output, byte[] additionalInput, bool predictionResistant);
// Token: 0x06009662 RID: 38498
[Token(Token = "0x6009662")]
[Address(Slot = "2")]
void Reseed(byte[] additionalInput);
}
}
@@ -0,0 +1,36 @@
using System;
using System.Runtime.InteropServices;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng
{
// Token: 0x020015E7 RID: 5607
[Token(Token = "0x20015E7")]
[StructLayout(3)]
public abstract class EntropyUtilities
{
// Token: 0x060095F6 RID: 38390 RVA: 0x002140B4 File Offset: 0x002122B4
[Token(Token = "0x60095F6")]
[Address(RVA = "0x1E3F1C0", Offset = "0x1E3DBC0", VA = "0x181E3F1C0")]
public static byte[] GenerateSeed(IEntropySource entropySource, int numBytes)
{
byte[] array = new byte[numBytes];
int num = 0;
if (numBytes > 0)
{
int num2 = Math.Min(array.Length, numBytes);
int num3 = 0;
Array.Copy(array, num3, array, num, num2);
num += num2;
}
return array;
}
// Token: 0x060095F7 RID: 38391 RVA: 0x002140F4 File Offset: 0x002122F4
[Token(Token = "0x60095F7")]
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
protected EntropyUtilities()
{
}
}
}
@@ -0,0 +1,18 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng.Drbg;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng
{
// Token: 0x020015E8 RID: 5608
[Token(Token = "0x20015E8")]
[StructLayout(3)]
internal interface IDrbgProvider
{
// Token: 0x060095F8 RID: 38392
[Token(Token = "0x60095F8")]
[Address(Slot = "0")]
ISP80090Drbg Get(IEntropySource entropySource);
}
}
@@ -0,0 +1,32 @@
using System;
using System.Runtime.InteropServices;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng
{
// Token: 0x020015E9 RID: 5609
[Token(Token = "0x20015E9")]
[StructLayout(3)]
public interface IRandomGenerator
{
// Token: 0x060095F9 RID: 38393
[Token(Token = "0x60095F9")]
[Address(Slot = "0")]
void AddSeedMaterial(byte[] seed);
// Token: 0x060095FA RID: 38394
[Token(Token = "0x60095FA")]
[Address(Slot = "1")]
void AddSeedMaterial(long seed);
// Token: 0x060095FB RID: 38395
[Token(Token = "0x60095FB")]
[Address(Slot = "2")]
void NextBytes(byte[] bytes);
// Token: 0x060095FC RID: 38396
[Token(Token = "0x60095FC")]
[Address(Slot = "3")]
void NextBytes(byte[] bytes, int start, int len);
}
}
@@ -0,0 +1,150 @@
using System;
using System.Runtime.InteropServices;
using System.Threading;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng
{
// Token: 0x020015EA RID: 5610
[Token(Token = "0x20015EA")]
[StructLayout(3)]
public class ReversedWindowGenerator : IRandomGenerator
{
// Token: 0x060095FD RID: 38397 RVA: 0x00214108 File Offset: 0x00212308
[Token(Token = "0x60095FD")]
[Address(RVA = "0x1E491D0", Offset = "0x1E47BD0", VA = "0x181E491D0")]
public ReversedWindowGenerator(IRandomGenerator generator, int windowSize)
{
/*
An exception occurred when decompiling this method (060095FD)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng.ReversedWindowGenerator::.ctor(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng.IRandomGenerator,System.Int32)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_20:
stloc:ArgumentNullException(var_1_2A, newobj:ArgumentNullException(ArgumentNullException::.ctor, ldstr:string("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.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x060095FE RID: 38398 RVA: 0x00214140 File Offset: 0x00212340
[Token(Token = "0x60095FE")]
[Address(RVA = "0x1E49090", Offset = "0x1E47A90", VA = "0x181E49090", Slot = "8")]
public virtual void AddSeedMaterial(byte[] seed)
{
int num;
do
{
num = 0;
this.windowCount = num;
IRandomGenerator randomGenerator = this.generator;
Monitor.Exit(this);
if (num != -1)
{
}
}
while (num != 0);
}
// Token: 0x060095FF RID: 38399 RVA: 0x00214174 File Offset: 0x00212374
[Token(Token = "0x60095FF")]
[Address(RVA = "0x1E48F40", Offset = "0x1E47940", VA = "0x181E48F40", Slot = "9")]
public virtual void AddSeedMaterial(long seed)
{
int num;
do
{
num = 0;
int num2 = 0;
this.windowCount = num;
IRandomGenerator randomGenerator = this.generator;
if (num < num2)
{
num += num;
num++;
}
Monitor.Exit(this);
if (num != -1)
{
}
}
while (num != 0);
}
// Token: 0x06009600 RID: 38400 RVA: 0x002141B4 File Offset: 0x002123B4
[Token(Token = "0x6009600")]
[Address(RVA = "0x1E491A0", Offset = "0x1E47BA0", VA = "0x181E491A0", Slot = "10")]
public virtual void NextBytes(byte[] bytes)
{
int length = bytes.Length;
int num = 0;
this.doNextBytes(bytes, num, length);
}
// Token: 0x06009601 RID: 38401 RVA: 0x002141DC File Offset: 0x002123DC
[Token(Token = "0x6009601")]
[Address(RVA = "0x1E49190", Offset = "0x1E47B90", VA = "0x181E49190", Slot = "11")]
public virtual void NextBytes(byte[] bytes, int start, int len)
{
this.doNextBytes(bytes, start, len);
}
// Token: 0x06009602 RID: 38402 RVA: 0x002141F4 File Offset: 0x002123F4
[Token(Token = "0x6009602")]
[Address(RVA = "0x1E492B0", Offset = "0x1E47CB0", VA = "0x181E492B0")]
private void doNextBytes(byte[] bytes, int start, int len)
{
int num;
do
{
num = 0;
if (num < len)
{
int num2 = this.windowCount;
if (num2 < 1)
{
IRandomGenerator randomGenerator = this.generator;
int length = this.window.Length;
byte[] array = this.window;
}
byte[] array2 = this.window;
num++;
int num3 = num2 - 1;
this.windowCount = num3;
}
Monitor.Exit(this);
if (num != -1)
{
}
}
while (num != 0);
}
// Token: 0x04006300 RID: 25344
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006300")]
private readonly IRandomGenerator generator;
// Token: 0x04006301 RID: 25345
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006301")]
private byte[] window;
// Token: 0x04006302 RID: 25346
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x4006302")]
private int windowCount;
}
}
@@ -0,0 +1,164 @@
using System;
using System.Runtime.InteropServices;
using System.Threading;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng.Drbg;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng
{
// Token: 0x020015EB RID: 5611
[Token(Token = "0x20015EB")]
[StructLayout(3)]
public class SP800SecureRandom : SecureRandom
{
// Token: 0x06009603 RID: 38403 RVA: 0x00214284 File Offset: 0x00212484
[Token(Token = "0x6009603")]
[Address(RVA = "0x1E4C5F0", Offset = "0x1E4AFF0", VA = "0x181E4C5F0")]
internal SP800SecureRandom(SecureRandom randomSource, IEntropySource entropySource, IDrbgProvider drbgProvider, bool predictionResistant)
{
int num = 0;
base..ctor(num);
this.mRandomSource = randomSource;
this.mEntropySource = entropySource;
this.mPredictionResistant = false;
this.mDrbgProvider = drbgProvider;
}
// Token: 0x06009604 RID: 38404 RVA: 0x002142B8 File Offset: 0x002124B8
[Token(Token = "0x6009604")]
[Address(RVA = "0x1E4C520", Offset = "0x1E4AF20", VA = "0x181E4C520", Slot = "11")]
public override void SetSeed(byte[] seed)
{
int num;
do
{
num = 0;
if (this.mRandomSource != 0)
{
}
Monitor.Exit(this);
if (num != -1)
{
}
}
while (num != 0);
}
// Token: 0x06009605 RID: 38405 RVA: 0x002142E0 File Offset: 0x002124E0
[Token(Token = "0x6009605")]
[Address(RVA = "0x1E4C450", Offset = "0x1E4AE50", VA = "0x181E4C450", Slot = "12")]
public override void SetSeed(long seed)
{
int num;
do
{
num = 0;
SecureRandom secureRandom = this.mRandomSource;
if (secureRandom != 0)
{
secureRandom.SetSeed(seed);
}
Monitor.Exit(this);
if (num != -1)
{
}
}
while (num != 0);
}
// Token: 0x06009606 RID: 38406 RVA: 0x00214310 File Offset: 0x00212510
[Token(Token = "0x6009606")]
[Address(RVA = "0x1E4C190", Offset = "0x1E4AB90", VA = "0x181E4C190", Slot = "9")]
public override void NextBytes(byte[] bytes)
{
int num;
do
{
num = 0;
ISP80090Drbg isp80090Drbg = this.mDrbg;
if (isp80090Drbg == 0)
{
IDrbgProvider drbgProvider = this.mDrbgProvider;
this.mDrbg = isp80090Drbg;
}
bool flag = this.mPredictionResistant;
ISP80090Drbg isp80090Drbg2 = this.mDrbg;
ISP80090Drbg isp80090Drbg3 = this.mDrbg;
bool flag2 = this.mPredictionResistant;
Monitor.Exit(this);
if (num != -1)
{
}
}
while (num != 0);
}
// Token: 0x06009607 RID: 38407 RVA: 0x00214380 File Offset: 0x00212580
[Token(Token = "0x6009607")]
[Address(RVA = "0x1E4C0E0", Offset = "0x1E4AAE0", VA = "0x181E4C0E0", Slot = "13")]
public override void NextBytes(byte[] buf, int off, int len)
{
byte[] array = new byte[len];
double num = this.NextDouble();
int num2 = 0;
Array.Copy(array, num2, buf, off, len);
}
// Token: 0x06009608 RID: 38408 RVA: 0x002143A8 File Offset: 0x002125A8
[Token(Token = "0x6009608")]
[Address(RVA = "0x1E4C0D0", Offset = "0x1E4AAD0", VA = "0x181E4C0D0", Slot = "10")]
public override byte[] GenerateSeed(int numBytes)
{
return EntropyUtilities.GenerateSeed(this.mEntropySource, numBytes);
}
// Token: 0x06009609 RID: 38409 RVA: 0x002143C4 File Offset: 0x002125C4
[Token(Token = "0x6009609")]
[Address(RVA = "0x1E4C320", Offset = "0x1E4AD20", VA = "0x181E4C320", Slot = "16")]
public virtual void Reseed(byte[] additionalInput)
{
int num;
do
{
num = 0;
ISP80090Drbg isp80090Drbg = this.mDrbg;
if (isp80090Drbg == 0)
{
IDrbgProvider drbgProvider = this.mDrbgProvider;
this.mDrbg = isp80090Drbg;
}
Monitor.Exit(this);
if (num != -1)
{
}
}
while (num != 0);
}
// Token: 0x04006303 RID: 25347
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x4006303")]
private readonly IDrbgProvider mDrbgProvider;
// Token: 0x04006304 RID: 25348
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
[Token(Token = "0x4006304")]
private readonly bool mPredictionResistant;
// Token: 0x04006305 RID: 25349
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
[Token(Token = "0x4006305")]
private readonly SecureRandom mRandomSource;
// Token: 0x04006306 RID: 25350
[global::Cpp2IlInjected.FieldOffset(Offset = "0x40")]
[Token(Token = "0x4006306")]
private readonly IEntropySource mEntropySource;
// Token: 0x04006307 RID: 25351
[global::Cpp2IlInjected.FieldOffset(Offset = "0x48")]
[Token(Token = "0x4006307")]
private ISP80090Drbg mDrbg;
}
}
@@ -0,0 +1,364 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng.Drbg;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng
{
// Token: 0x020015EC RID: 5612
[Token(Token = "0x20015EC")]
[StructLayout(3)]
public class SP800SecureRandomBuilder
{
// Token: 0x0600960A RID: 38410 RVA: 0x00214408 File Offset: 0x00212608
[Token(Token = "0x600960A")]
[Address(RVA = "0x1E4BF40", Offset = "0x1E4A940", VA = "0x181E4BF40")]
public SP800SecureRandomBuilder()
{
SecureRandom secureRandom = new SecureRandom();
this.mSecurityStrength = (int)((ulong)256L);
this.mEntropyBitsRequired = (int)((ulong)256L);
base..ctor();
this.mRandom = secureRandom;
int num;
BasicEntropySourceProvider basicEntropySourceProvider = new BasicEntropySourceProvider(secureRandom, num != 0);
num = 0;
this.mEntropySourceProvider = basicEntropySourceProvider;
}
// Token: 0x0600960B RID: 38411 RVA: 0x00214454 File Offset: 0x00212654
[Token(Token = "0x600960B")]
[Address(RVA = "0x1E4C040", Offset = "0x1E4AA40", VA = "0x181E4C040")]
public SP800SecureRandomBuilder(SecureRandom entropySource, bool predictionResistant)
{
this.mSecurityStrength = (int)((ulong)256L);
this.mEntropyBitsRequired = (int)((ulong)256L);
base..ctor();
this.mRandom = entropySource;
BasicEntropySourceProvider basicEntropySourceProvider = new BasicEntropySourceProvider(entropySource, predictionResistant);
this.mEntropySourceProvider = basicEntropySourceProvider;
}
// Token: 0x0600960C RID: 38412 RVA: 0x00214498 File Offset: 0x00212698
[Token(Token = "0x600960C")]
[Address(RVA = "0x1E4C000", Offset = "0x1E4AA00", VA = "0x181E4C000")]
public SP800SecureRandomBuilder(IEntropySourceProvider entropySourceProvider)
{
this.mSecurityStrength = (int)((ulong)256L);
this.mEntropyBitsRequired = (int)((ulong)256L);
base..ctor();
this.mRandom = (ulong)0L;
this.mEntropySourceProvider = entropySourceProvider;
}
// Token: 0x0600960D RID: 38413 RVA: 0x002144D8 File Offset: 0x002126D8
[Token(Token = "0x600960D")]
[Address(RVA = "0x665670", Offset = "0x664070", VA = "0x180665670")]
public SP800SecureRandomBuilder SetPersonalizationString(byte[] personalizationString)
{
this.mPersonalizationString = personalizationString;
return this;
}
// Token: 0x0600960E RID: 38414 RVA: 0x002144F0 File Offset: 0x002126F0
[Token(Token = "0x600960E")]
[Address(RVA = "0x1E4BF30", Offset = "0x1E4A930", VA = "0x181E4BF30")]
public SP800SecureRandomBuilder SetSecurityStrength(int securityStrength)
{
this.mSecurityStrength = securityStrength;
return this;
}
// Token: 0x0600960F RID: 38415 RVA: 0x00214508 File Offset: 0x00212708
[Token(Token = "0x600960F")]
[Address(RVA = "0x1E4BF20", Offset = "0x1E4A920", VA = "0x181E4BF20")]
public SP800SecureRandomBuilder SetEntropyBitsRequired(int entropyBitsRequired)
{
this.mEntropyBitsRequired = entropyBitsRequired;
return this;
}
// Token: 0x06009610 RID: 38416 RVA: 0x00214520 File Offset: 0x00212720
[Token(Token = "0x6009610")]
[Address(RVA = "0x1E4BE30", Offset = "0x1E4A830", VA = "0x181E4BE30")]
public SP800SecureRandom BuildHash(IDigest digest, byte[] nonce, bool predictionResistant)
{
IEntropySourceProvider entropySourceProvider = this.mEntropySourceProvider;
byte[] array = this.mPersonalizationString;
int num = this.mSecurityStrength;
SP800SecureRandomBuilder.HashDrbgProvider hashDrbgProvider;
hashDrbgProvider.mDigest = digest;
hashDrbgProvider.mNonce = nonce;
hashDrbgProvider.mPersonalizationString = array;
hashDrbgProvider.mSecurityStrength = num;
SP800SecureRandom sp800SecureRandom;
return sp800SecureRandom;
}
// Token: 0x06009611 RID: 38417 RVA: 0x00214568 File Offset: 0x00212768
[Token(Token = "0x6009611")]
[Address(RVA = "0x1E4BC40", Offset = "0x1E4A640", VA = "0x181E4BC40")]
public SP800SecureRandom BuildCtr(IBlockCipher cipher, int keySizeInBits, byte[] nonce, bool predictionResistant)
{
IEntropySourceProvider entropySourceProvider = this.mEntropySourceProvider;
byte[] array = this.mPersonalizationString;
int num = this.mSecurityStrength;
SP800SecureRandomBuilder.CtrDrbgProvider ctrDrbgProvider;
ctrDrbgProvider.mBlockCipher = cipher;
ctrDrbgProvider.mKeySizeInBits = keySizeInBits;
ctrDrbgProvider.mNonce = nonce;
ctrDrbgProvider.mPersonalizationString = array;
ctrDrbgProvider.mSecurityStrength = num;
SP800SecureRandom sp800SecureRandom;
return sp800SecureRandom;
}
// Token: 0x06009612 RID: 38418 RVA: 0x002145B8 File Offset: 0x002127B8
[Token(Token = "0x6009612")]
[Address(RVA = "0x1E4BD40", Offset = "0x1E4A740", VA = "0x181E4BD40")]
public SP800SecureRandom BuildHMac(IMac hMac, byte[] nonce, bool predictionResistant)
{
IEntropySourceProvider entropySourceProvider = this.mEntropySourceProvider;
byte[] array = this.mPersonalizationString;
int num = this.mSecurityStrength;
SP800SecureRandomBuilder.HMacDrbgProvider hmacDrbgProvider;
hmacDrbgProvider.mHMac = hMac;
hmacDrbgProvider.mNonce = nonce;
hmacDrbgProvider.mPersonalizationString = array;
hmacDrbgProvider.mSecurityStrength = num;
SP800SecureRandom sp800SecureRandom;
return sp800SecureRandom;
}
// Token: 0x04006308 RID: 25352
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006308")]
private readonly SecureRandom mRandom;
// Token: 0x04006309 RID: 25353
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006309")]
private readonly IEntropySourceProvider mEntropySourceProvider;
// Token: 0x0400630A RID: 25354
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x400630A")]
private byte[] mPersonalizationString;
// Token: 0x0400630B RID: 25355
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x400630B")]
private int mSecurityStrength;
// Token: 0x0400630C RID: 25356
[global::Cpp2IlInjected.FieldOffset(Offset = "0x2C")]
[Token(Token = "0x400630C")]
private int mEntropyBitsRequired;
// Token: 0x020015ED RID: 5613
[Token(Token = "0x20015ED")]
private class HashDrbgProvider : IDrbgProvider
{
// Token: 0x06009613 RID: 38419 RVA: 0x00214600 File Offset: 0x00212800
[Token(Token = "0x6009613")]
[Address(RVA = "0x683A80", Offset = "0x682480", VA = "0x180683A80")]
public HashDrbgProvider(IDigest digest, byte[] nonce, byte[] personalizationString, int securityStrength)
{
this.mDigest = digest;
this.mPersonalizationString = personalizationString;
this.mSecurityStrength = 0;
this.mNonce = nonce;
}
// Token: 0x06009614 RID: 38420 RVA: 0x00214630 File Offset: 0x00212830
[Token(Token = "0x6009614")]
[Address(RVA = "0x1E42470", Offset = "0x1E40E70", VA = "0x181E42470", Slot = "4")]
public ISP80090Drbg Get(IEntropySource entropySource)
{
/*
An exception occurred when decompiling this method (06009614)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng.Drbg.ISP80090Drbg BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng.SP800SecureRandomBuilder/HashDrbgProvider::Get(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IEntropySource)
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:IDigest(var_0_06, ldfld:IDigest(HashDrbgProvider::mDigest, ldloc:HashDrbgProvider(this)))
stloc:int32(var_1_0D, ldfld:int32(HashDrbgProvider::mSecurityStrength, ldloc:HashDrbgProvider(this)))
stloc:uint8[](var_2_14, ldfld:uint8[](HashDrbgProvider::mPersonalizationString, ldloc:HashDrbgProvider(this)))
stloc:uint8[](var_3_1B, ldfld:uint8[](HashDrbgProvider::mNonce, ldloc:HashDrbgProvider(this)))
stloc:HashSP800Drbg(var_4_26, newobj:HashSP800Drbg(HashSP800Drbg::.ctor, ldloc:IDigest(var_0_06), ldloc:int32(var_1_0D), ldloc:IEntropySource(entropySource), ldloc:uint8[](var_2_14), ldloc:uint8[](var_3_1B)))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x0400630D RID: 25357
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x400630D")]
private readonly IDigest mDigest;
// Token: 0x0400630E RID: 25358
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x400630E")]
private readonly byte[] mNonce;
// Token: 0x0400630F RID: 25359
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x400630F")]
private readonly byte[] mPersonalizationString;
// Token: 0x04006310 RID: 25360
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x4006310")]
private readonly int mSecurityStrength;
}
// Token: 0x020015EE RID: 5614
[Token(Token = "0x20015EE")]
private class HMacDrbgProvider : IDrbgProvider
{
// Token: 0x06009615 RID: 38421 RVA: 0x00214664 File Offset: 0x00212864
[Token(Token = "0x6009615")]
[Address(RVA = "0x683A80", Offset = "0x682480", VA = "0x180683A80")]
public HMacDrbgProvider(IMac hMac, byte[] nonce, byte[] personalizationString, int securityStrength)
{
this.mHMac = hMac;
this.mPersonalizationString = personalizationString;
this.mSecurityStrength = 0;
this.mNonce = nonce;
}
// Token: 0x06009616 RID: 38422 RVA: 0x00214694 File Offset: 0x00212894
[Token(Token = "0x6009616")]
[Address(RVA = "0x1E40DA0", Offset = "0x1E3F7A0", VA = "0x181E40DA0", Slot = "4")]
public ISP80090Drbg Get(IEntropySource entropySource)
{
/*
An exception occurred when decompiling this method (06009616)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng.Drbg.ISP80090Drbg BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng.SP800SecureRandomBuilder/HMacDrbgProvider::Get(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IEntropySource)
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:IMac(var_0_06, ldfld:IMac(HMacDrbgProvider::mHMac, ldloc:HMacDrbgProvider(this)))
stloc:int32(var_1_0D, ldfld:int32(HMacDrbgProvider::mSecurityStrength, ldloc:HMacDrbgProvider(this)))
stloc:uint8[](var_2_14, ldfld:uint8[](HMacDrbgProvider::mPersonalizationString, ldloc:HMacDrbgProvider(this)))
stloc:uint8[](var_3_1B, ldfld:uint8[](HMacDrbgProvider::mNonce, ldloc:HMacDrbgProvider(this)))
stloc:HMacSP800Drbg(var_4_26, newobj:HMacSP800Drbg(HMacSP800Drbg::.ctor, ldloc:IMac(var_0_06), ldloc:int32(var_1_0D), ldloc:IEntropySource(entropySource), ldloc:uint8[](var_2_14), ldloc:uint8[](var_3_1B)))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x04006311 RID: 25361
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006311")]
private readonly IMac mHMac;
// Token: 0x04006312 RID: 25362
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006312")]
private readonly byte[] mNonce;
// Token: 0x04006313 RID: 25363
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x4006313")]
private readonly byte[] mPersonalizationString;
// Token: 0x04006314 RID: 25364
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x4006314")]
private readonly int mSecurityStrength;
}
// Token: 0x020015EF RID: 5615
[Token(Token = "0x20015EF")]
private class CtrDrbgProvider : IDrbgProvider
{
// Token: 0x06009617 RID: 38423 RVA: 0x002146C8 File Offset: 0x002128C8
[Token(Token = "0x6009617")]
[Address(RVA = "0x1E39A40", Offset = "0x1E38440", VA = "0x181E39A40")]
public CtrDrbgProvider(IBlockCipher blockCipher, int keySizeInBits, byte[] nonce, byte[] personalizationString, int securityStrength)
{
this.mPersonalizationString = 0;
this.mBlockCipher = blockCipher;
this.mNonce = nonce;
this.mSecurityStrength = 0;
this.mKeySizeInBits = keySizeInBits;
}
// Token: 0x06009618 RID: 38424 RVA: 0x00214700 File Offset: 0x00212900
[Token(Token = "0x6009618")]
[Address(RVA = "0x1E39990", Offset = "0x1E38390", VA = "0x181E39990", Slot = "4")]
public ISP80090Drbg Get(IEntropySource entropySource)
{
/*
An exception occurred when decompiling this method (06009618)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng.Drbg.ISP80090Drbg BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng.SP800SecureRandomBuilder/CtrDrbgProvider::Get(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IEntropySource)
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:IBlockCipher(var_0_06, ldfld:IBlockCipher(CtrDrbgProvider::mBlockCipher, ldloc:CtrDrbgProvider(this)))
stloc:int32(var_1_0D, ldfld:int32(CtrDrbgProvider::mKeySizeInBits, ldloc:CtrDrbgProvider(this)))
stloc:int32(var_2_14, ldfld:int32(CtrDrbgProvider::mSecurityStrength, ldloc:CtrDrbgProvider(this)))
stloc:uint8[](var_3_1B, ldfld:uint8[](CtrDrbgProvider::mPersonalizationString, ldloc:CtrDrbgProvider(this)))
stloc:uint8[](var_4_22, ldfld:uint8[](CtrDrbgProvider::mNonce, ldloc:CtrDrbgProvider(this)))
stloc:CtrSP800Drbg(var_5_30, newobj:CtrSP800Drbg(CtrSP800Drbg::.ctor, ldloc:IBlockCipher(var_0_06), ldloc:int32(var_1_0D), ldloc:int32(var_2_14), ldloc:IEntropySource(entropySource), ldloc:uint8[](var_3_1B), ldloc:uint8[](var_4_22)))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x04006315 RID: 25365
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006315")]
private readonly IBlockCipher mBlockCipher;
// Token: 0x04006316 RID: 25366
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006316")]
private readonly int mKeySizeInBits;
// Token: 0x04006317 RID: 25367
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x4006317")]
private readonly byte[] mNonce;
// Token: 0x04006318 RID: 25368
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x4006318")]
private readonly byte[] mPersonalizationString;
// Token: 0x04006319 RID: 25369
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
[Token(Token = "0x4006319")]
private readonly int mSecurityStrength;
}
}
}
@@ -0,0 +1,115 @@
using System;
using System.Runtime.InteropServices;
using System.Threading;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng
{
// Token: 0x020015F0 RID: 5616
[Token(Token = "0x20015F0")]
[StructLayout(3)]
public class ThreadedSeedGenerator
{
// Token: 0x06009619 RID: 38425 RVA: 0x00214740 File Offset: 0x00212940
[Token(Token = "0x6009619")]
[Address(RVA = "0x1E4D460", Offset = "0x1E4BE60", VA = "0x181E4D460")]
public byte[] GenerateSeed(int numBytes, bool fast)
{
return new ThreadedSeedGenerator.SeedGenerator().GenerateSeed(numBytes, fast);
}
// Token: 0x0600961A RID: 38426 RVA: 0x00214760 File Offset: 0x00212960
[Token(Token = "0x600961A")]
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
public ThreadedSeedGenerator()
{
}
// Token: 0x020015F1 RID: 5617
[Token(Token = "0x20015F1")]
private class SeedGenerator
{
// Token: 0x0600961B RID: 38427 RVA: 0x00214774 File Offset: 0x00212974
[Token(Token = "0x600961B")]
[Address(RVA = "0x1E4C960", Offset = "0x1E4B360", VA = "0x181E4C960")]
private void Run(object ignored)
{
while (!this.stop)
{
int num = this.counter + 1;
this.counter = num;
if (this.stop)
{
break;
}
}
}
// Token: 0x0600961C RID: 38428 RVA: 0x002147A4 File Offset: 0x002129A4
[Token(Token = "0x600961C")]
[Address(RVA = "0x1E4C830", Offset = "0x1E4B230", VA = "0x181E4C830")]
public byte[] GenerateSeed(int numBytes, bool fast)
{
int num;
byte[] array;
do
{
num = 0;
ThreadPriority priority = Thread.CurrentThread.Priority;
Thread.CurrentThread.Priority = ThreadPriority.Normal;
array = this.DoGenerateSeed(numBytes, fast);
Thread.CurrentThread.SetPriorityNative(numBytes);
if (num != -1)
{
}
}
while (num != 0);
return array;
}
// Token: 0x0600961D RID: 38429 RVA: 0x002147FC File Offset: 0x002129FC
[Token(Token = "0x600961D")]
[Address(RVA = "0x1E4C680", Offset = "0x1E4B080", VA = "0x181E4C680")]
private byte[] DoGenerateSeed(int numBytes, bool fast)
{
int num = 0;
this.counter = num;
this.stop = num != 0;
byte[] array = new byte[numBytes];
WaitCallback waitCallback = new WaitCallback(this.Run);
int num2 = 0;
bool flag = ThreadPool.QueueUserWorkItem(waitCallback);
if (this.counter == num)
{
Thread.Sleep(1);
}
int num3 = this.counter;
num += num2;
byte b;
b += b;
num++;
int length = array.Length;
num++;
this.stop = true;
return array;
}
// Token: 0x0600961E RID: 38430 RVA: 0x00214878 File Offset: 0x00212A78
[Token(Token = "0x600961E")]
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
public SeedGenerator()
{
}
// Token: 0x0400631A RID: 25370
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x400631A")]
private int counter;
// Token: 0x0400631B RID: 25371
[global::Cpp2IlInjected.FieldOffset(Offset = "0x14")]
[Token(Token = "0x400631B")]
private bool stop;
}
}
}
@@ -0,0 +1,118 @@
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Threading;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng
{
// Token: 0x020015F2 RID: 5618
[Token(Token = "0x20015F2")]
[StructLayout(3)]
public class VmpcRandomGenerator : IRandomGenerator
{
// Token: 0x0600961F RID: 38431 RVA: 0x0021488C File Offset: 0x00212A8C
[Token(Token = "0x600961F")]
[Address(RVA = "0x1E4D9B0", Offset = "0x1E4C3B0", VA = "0x181E4D9B0")]
public VmpcRandomGenerator()
{
byte[] array = new byte[256];
RuntimeHelpers.InitializeArray(array, fieldof(<PrivateImplementationDetails>.B31A9EA1A2718942996E7F94106F0FC798C174C8).FieldHandle);
this.P = array;
this.s = (byte)((ulong)190L);
base..ctor();
}
// Token: 0x06009620 RID: 38432 RVA: 0x002148CC File Offset: 0x00212ACC
[Token(Token = "0x6009620")]
[Address(RVA = "0x1E4D4E0", Offset = "0x1E4BEE0", VA = "0x181E4D4E0", Slot = "8")]
public virtual void AddSeedMaterial(byte[] seed)
{
int num = 0;
int length = seed.Length;
if (num < length)
{
byte[] p = this.P;
byte b = this.n;
int length2 = p.Length;
byte b2;
byte b3;
b2 += b3;
byte b4 = this.s;
b2 += b4;
byte b5;
this.s = b5;
int length3 = p.Length;
byte[] p2 = this.P;
byte b6 = this.s;
num++;
}
}
// Token: 0x06009621 RID: 38433 RVA: 0x00214940 File Offset: 0x00212B40
[Token(Token = "0x6009621")]
[Address(RVA = "0x1E4D640", Offset = "0x1E4C040", VA = "0x181E4D640", Slot = "9")]
public virtual void AddSeedMaterial(long seed)
{
byte[] array = Pack.UInt64_To_BE((ulong)seed);
((IRandomGenerator)this).AddSeedMaterial(array);
}
// Token: 0x06009622 RID: 38434 RVA: 0x0021495C File Offset: 0x00212B5C
[Token(Token = "0x6009622")]
[Address(RVA = "0x1E4D970", Offset = "0x1E4C370", VA = "0x181E4D970", Slot = "10")]
public virtual void NextBytes(byte[] bytes)
{
this.NextBytes(bytes);
}
// Token: 0x06009623 RID: 38435 RVA: 0x00214978 File Offset: 0x00212B78
[Token(Token = "0x6009623")]
[Address(RVA = "0x1E4D680", Offset = "0x1E4C080", VA = "0x181E4D680", Slot = "11")]
public virtual void NextBytes(byte[] bytes, int start, int len)
{
int num;
do
{
num = 0;
byte[] p = this.P;
byte[] p2 = this.P;
byte b = this.n;
int length = p2.Length;
byte b2 = this.s;
byte b3;
b3 += b2;
byte b4;
this.s = b4;
int length2 = p2.Length;
byte[] p3 = this.P;
byte b5 = this.n;
int length3 = p3.Length;
byte b6 = this.s;
byte[] p4 = this.P;
byte b7 = this.s;
Monitor.Exit(p);
if (num != -1)
{
}
}
while (num != 0);
}
// Token: 0x0400631C RID: 25372
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x400631C")]
private byte n;
// Token: 0x0400631D RID: 25373
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x400631D")]
private byte[] P;
// Token: 0x0400631E RID: 25374
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x400631E")]
private byte s;
}
}
@@ -0,0 +1,224 @@
using System;
using System.Runtime.InteropServices;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng
{
// Token: 0x020015F3 RID: 5619
[Token(Token = "0x20015F3")]
[StructLayout(3)]
internal class X931Rng
{
// Token: 0x06009624 RID: 38436 RVA: 0x00214A84 File Offset: 0x00212C84
[Token(Token = "0x6009624")]
[Address(RVA = "0x1E4E0F0", Offset = "0x1E4CAF0", VA = "0x181E4E0F0")]
internal X931Rng(IBlockCipher engine, byte[] dateTimeVector, IEntropySource entropySource)
{
this.mEngine = engine;
this.mEntropySource = entropySource;
byte[] array = new byte[0];
this.mDT = array;
int length = array.Length;
int num = 0;
int num2 = 0;
Array.Copy(dateTimeVector, num2, array, num, length);
byte[] array2 = new byte[array];
this.mI = array2;
byte[] array3 = new byte[array2];
this.mR = array3;
}
// Token: 0x06009625 RID: 38437 RVA: 0x00214AFC File Offset: 0x00212CFC
[Token(Token = "0x6009625")]
[Address(RVA = "0x1E4DA20", Offset = "0x1E4C420", VA = "0x181E4DA20")]
internal int Generate(byte[] output, bool predictionResistant)
{
IBlockCipher blockCipher;
int length;
int num2;
do
{
byte[] array = this.mR;
long num = this.mReseedCounter;
if ((array.Length != 8 && output == 0) || output != 0)
{
}
if (predictionResistant || this.mV == (ulong)0L)
{
IEntropySource entropySource = this.mEntropySource;
this.mV = array;
blockCipher = this.mEngine;
if (array.Length != array)
{
continue;
}
}
byte[] array2 = this.mR;
length = output.Length;
num2 = 0;
}
while (length <= 0);
IBlockCipher blockCipher2 = this.mEngine;
int num3 = 0;
if (num3 < blockCipher)
{
num3 += num3;
num3++;
}
byte[] array3 = this.mV;
byte[] array4 = this.mI;
byte[] array5 = this.mR;
this.Process(array5, array4, array3);
byte[] array6 = this.mI;
byte[] array7 = this.mR;
byte[] array8 = this.mV;
this.Process(array8, array7, array6);
byte[] array9 = this.mR;
int length2 = array9.Length;
int num4 = length2 * num2;
int num5 = 0;
Array.Copy(array9, num5, output, num4, length2);
byte[] array10 = this.mDT;
if (array10.Length == array10.Length)
{
}
num2++;
int length3 = this.mR.Length;
int num6 = output.Length;
int num7 = length3 * length;
num6 -= num7;
if (num6 > 0)
{
IBlockCipher blockCipher3 = this.mEngine;
byte[] array11 = this.mI;
byte[] array12 = this.mV;
byte[] array13 = this.mI;
byte[] array14 = this.mR;
this.Process(array14, array13, array12);
byte[] array15 = this.mI;
byte[] array16 = this.mR;
byte[] array17 = this.mV;
this.Process(array17, array16, array15);
byte[] array18 = this.mR;
int num8 = array18.Length * length;
int num9 = 0;
Array.Copy(array18, num9, output, num8, num6);
byte[] array19 = this.mDT;
int length4 = array19.Length;
if (length4 == array19.Length)
{
}
}
return output.Length;
}
// Token: 0x06009626 RID: 38438 RVA: 0x00214D04 File Offset: 0x00212F04
[Token(Token = "0x6009626")]
[Address(RVA = "0x1E4E030", Offset = "0x1E4CA30", VA = "0x181E4E030")]
internal void Reseed()
{
IEntropySource entropySource = this.mEntropySource;
IBlockCipher blockCipher = this.mEngine;
this.mReseedCounter = (long)((ulong)1L);
}
// Token: 0x170017F3 RID: 6131
// (get) Token: 0x06009627 RID: 38439 RVA: 0x00214D3C File Offset: 0x00212F3C
[Token(Token = "0x170017F3")]
internal IEntropySource EntropySource
{
[Token(Token = "0x6009627")]
[Address(RVA = "0x3C1240", Offset = "0x3BFC40", VA = "0x1803C1240")]
get
{
return this.mEntropySource;
}
}
// Token: 0x06009628 RID: 38440 RVA: 0x00214D50 File Offset: 0x00212F50
[Token(Token = "0x6009628")]
[Address(RVA = "0x1E4DF30", Offset = "0x1E4C930", VA = "0x181E4DF30")]
private void Process(byte[] res, byte[] a, byte[] b)
{
int num = 0;
int length = res.Length;
if (num != length)
{
num++;
}
IBlockCipher blockCipher = this.mEngine;
}
// Token: 0x06009629 RID: 38441 RVA: 0x00214D7C File Offset: 0x00212F7C
[Token(Token = "0x6009629")]
[Address(RVA = "0x1E4DEE0", Offset = "0x1E4C8E0", VA = "0x181E4DEE0")]
private void Increment(byte[] val)
{
if (val.Length == val.Length)
{
}
}
// Token: 0x0600962A RID: 38442 RVA: 0x00214DA0 File Offset: 0x00212FA0
[Token(Token = "0x600962A")]
[Address(RVA = "0x1E3A1E0", Offset = "0x1E38BE0", VA = "0x181E3A1E0")]
private static bool IsTooLarge(byte[] bytes, int maxBytes)
{
if (bytes == 0)
{
}
return bytes.Length > maxBytes;
}
// Token: 0x0400631F RID: 25375
[Token(Token = "0x400631F")]
private const long BLOCK64_RESEED_MAX = 32768L;
// Token: 0x04006320 RID: 25376
[Token(Token = "0x4006320")]
private const long BLOCK128_RESEED_MAX = 8388608L;
// Token: 0x04006321 RID: 25377
[Token(Token = "0x4006321")]
private const int BLOCK64_MAX_BITS_REQUEST = 4096;
// Token: 0x04006322 RID: 25378
[Token(Token = "0x4006322")]
private const int BLOCK128_MAX_BITS_REQUEST = 262144;
// Token: 0x04006323 RID: 25379
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006323")]
private readonly IBlockCipher mEngine;
// Token: 0x04006324 RID: 25380
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006324")]
private readonly IEntropySource mEntropySource;
// Token: 0x04006325 RID: 25381
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x4006325")]
private readonly byte[] mDT;
// Token: 0x04006326 RID: 25382
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x4006326")]
private readonly byte[] mI;
// Token: 0x04006327 RID: 25383
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
[Token(Token = "0x4006327")]
private readonly byte[] mR;
// Token: 0x04006328 RID: 25384
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
[Token(Token = "0x4006328")]
private byte[] mV;
// Token: 0x04006329 RID: 25385
[global::Cpp2IlInjected.FieldOffset(Offset = "0x40")]
[Token(Token = "0x4006329")]
private long mReseedCounter = (long)((ulong)1L);
}
}
@@ -0,0 +1,130 @@
using System;
using System.Runtime.InteropServices;
using System.Threading;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng
{
// Token: 0x020015F4 RID: 5620
[Token(Token = "0x20015F4")]
[StructLayout(3)]
public class X931SecureRandom : SecureRandom
{
// Token: 0x0600962B RID: 38443 RVA: 0x00214DBC File Offset: 0x00212FBC
[Token(Token = "0x600962B")]
[Address(RVA = "0x1E4EA50", Offset = "0x1E4D450", VA = "0x181E4EA50")]
internal X931SecureRandom(SecureRandom randomSource, X931Rng drbg, bool predictionResistant)
{
int num = 0;
base..ctor(num);
this.mRandomSource = randomSource;
this.mDrbg = drbg;
this.mPredictionResistant = predictionResistant;
}
// Token: 0x0600962C RID: 38444 RVA: 0x00214DE8 File Offset: 0x00212FE8
[Token(Token = "0x600962C")]
[Address(RVA = "0x1E4E8B0", Offset = "0x1E4D2B0", VA = "0x181E4E8B0", Slot = "11")]
public override void SetSeed(byte[] seed)
{
int num;
do
{
num = 0;
if (this.mRandomSource != 0)
{
}
Monitor.Exit(this);
if (num != -1)
{
}
}
while (num != 0);
}
// Token: 0x0600962D RID: 38445 RVA: 0x00214E10 File Offset: 0x00213010
[Token(Token = "0x600962D")]
[Address(RVA = "0x1E4E980", Offset = "0x1E4D380", VA = "0x181E4E980", Slot = "12")]
public override void SetSeed(long seed)
{
int num;
do
{
num = 0;
SecureRandom secureRandom = this.mRandomSource;
if (secureRandom != 0)
{
secureRandom.SetSeed(seed);
}
Monitor.Exit(this);
if (num != -1)
{
}
}
while (num != 0);
}
// Token: 0x0600962E RID: 38446 RVA: 0x00214E40 File Offset: 0x00213040
[Token(Token = "0x600962E")]
[Address(RVA = "0x1E4E6E0", Offset = "0x1E4D0E0", VA = "0x181E4E6E0", Slot = "9")]
public override void NextBytes(byte[] bytes)
{
int num;
do
{
num = 0;
X931Rng x931Rng = this.mDrbg;
bool flag = this.mPredictionResistant;
int num2 = x931Rng.Generate(bytes, flag);
X931Rng x931Rng2 = this.mDrbg;
IEntropySource mEntropySource = x931Rng2.mEntropySource;
x931Rng2.mV = num2;
IBlockCipher mEngine = x931Rng2.mEngine;
x931Rng2.mReseedCounter = (long)((ulong)1L);
X931Rng x931Rng3 = this.mDrbg;
bool flag2 = this.mPredictionResistant;
int num3 = x931Rng3.Generate(bytes, flag2);
Monitor.Exit(this);
if (num != -1)
{
}
}
while (num != 0);
}
// Token: 0x0600962F RID: 38447 RVA: 0x00214EEC File Offset: 0x002130EC
[Token(Token = "0x600962F")]
[Address(RVA = "0x1E4E630", Offset = "0x1E4D030", VA = "0x181E4E630", Slot = "13")]
public override void NextBytes(byte[] buf, int off, int len)
{
byte[] array = new byte[len];
double num = this.NextDouble();
int num2 = 0;
Array.Copy(array, num2, buf, off, len);
}
// Token: 0x06009630 RID: 38448 RVA: 0x00214F14 File Offset: 0x00213114
[Token(Token = "0x6009630")]
[Address(RVA = "0x1E4E600", Offset = "0x1E4D000", VA = "0x181E4E600", Slot = "10")]
public override byte[] GenerateSeed(int numBytes)
{
return EntropyUtilities.GenerateSeed(this.mDrbg.mEntropySource, numBytes);
}
// Token: 0x0400632A RID: 25386
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x400632A")]
private readonly bool mPredictionResistant;
// Token: 0x0400632B RID: 25387
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
[Token(Token = "0x400632B")]
private readonly SecureRandom mRandomSource;
// Token: 0x0400632C RID: 25388
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
[Token(Token = "0x400632C")]
private readonly X931Rng mDrbg;
}
}
@@ -0,0 +1,111 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Date;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng
{
// Token: 0x020015F5 RID: 5621
[Token(Token = "0x20015F5")]
[StructLayout(3)]
public class X931SecureRandomBuilder
{
// Token: 0x06009631 RID: 38449 RVA: 0x00214F38 File Offset: 0x00213138
[Token(Token = "0x6009631")]
[Address(RVA = "0x1E4E4C0", Offset = "0x1E4CEC0", VA = "0x181E4E4C0")]
public X931SecureRandomBuilder()
{
SecureRandom secureRandom = new SecureRandom();
base..ctor();
this.mRandom = secureRandom;
int num;
BasicEntropySourceProvider basicEntropySourceProvider = new BasicEntropySourceProvider(secureRandom, num != 0);
num = 0;
this.mEntropySourceProvider = basicEntropySourceProvider;
}
// Token: 0x06009632 RID: 38450 RVA: 0x00214F6C File Offset: 0x0021316C
[Token(Token = "0x6009632")]
[Address(RVA = "0x1E4E570", Offset = "0x1E4CF70", VA = "0x181E4E570")]
public X931SecureRandomBuilder(SecureRandom entropySource, bool predictionResistant)
{
this.mRandom = entropySource;
BasicEntropySourceProvider basicEntropySourceProvider = new BasicEntropySourceProvider(entropySource, predictionResistant);
this.mEntropySourceProvider = basicEntropySourceProvider;
}
// Token: 0x06009633 RID: 38451 RVA: 0x00214F98 File Offset: 0x00213198
[Token(Token = "0x6009633")]
[Address(RVA = "0x1E4E490", Offset = "0x1E4CE90", VA = "0x181E4E490")]
public X931SecureRandomBuilder(IEntropySourceProvider entropySourceProvider)
{
this.mRandom = (ulong)0L;
this.mEntropySourceProvider = entropySourceProvider;
}
// Token: 0x06009634 RID: 38452 RVA: 0x00214FBC File Offset: 0x002131BC
[Token(Token = "0x6009634")]
[Address(RVA = "0x665670", Offset = "0x664070", VA = "0x180665670")]
public X931SecureRandomBuilder SetDateTimeVector(byte[] dateTimeVector)
{
this.mDateTimeVector = dateTimeVector;
return this;
}
// Token: 0x06009635 RID: 38453 RVA: 0x00214FD4 File Offset: 0x002131D4
[Token(Token = "0x6009635")]
[Address(RVA = "0x1E4E210", Offset = "0x1E4CC10", VA = "0x181E4E210")]
public X931SecureRandom Build(IBlockCipher engine, KeyParameter key, bool predictionResistant)
{
if (this.mDateTimeVector == (ulong)0L)
{
byte[] array = new byte[0];
this.mDateTimeVector = array;
long num = DateTimeUtilities.CurrentUnixMs();
byte[] array2 = this.mDateTimeVector;
int num2 = 0;
Pack.UInt64_To_BE((ulong)num, array2, num2);
}
SecureRandom secureRandom = this.mRandom;
byte[] array3 = this.mDateTimeVector;
IEntropySourceProvider entropySourceProvider = this.mEntropySourceProvider;
X931Rng x931Rng;
x931Rng.mReseedCounter = (long)((ulong)1L);
x931Rng.mEngine = engine;
x931Rng.mEntropySource = key;
byte[] array4 = new byte[x931Rng];
x931Rng.mDT = array4;
int length = array4.Length;
int num3 = 0;
int num4 = 0;
Array.Copy(array3, num4, array4, num3, length);
byte[] array5 = new byte[array4];
x931Rng.mI = array5;
byte[] array6 = new byte[array5];
x931Rng.mR = array6;
X931SecureRandom x931SecureRandom;
x931SecureRandom.mRandomSource = secureRandom;
x931SecureRandom.mDrbg = x931Rng;
x931SecureRandom.mPredictionResistant = predictionResistant;
return x931SecureRandom;
}
// Token: 0x0400632D RID: 25389
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x400632D")]
private readonly SecureRandom mRandom;
// Token: 0x0400632E RID: 25390
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x400632E")]
private IEntropySourceProvider mEntropySourceProvider;
// Token: 0x0400632F RID: 25391
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x400632F")]
private byte[] mDateTimeVector;
}
}