This commit is contained in:
niko
2026-04-11 22:19:20 +02:00
parent 45b857ff11
commit 8fc35183db
17034 changed files with 2863552 additions and 0 deletions
@@ -0,0 +1,126 @@
using System;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng
{
// Token: 0x02001BBE RID: 7102
[Token(Token = "0x2001BBE")]
public class BasicEntropySourceProvider : IEntropySourceProvider
{
// Token: 0x0600B1B3 RID: 45491 RVA: 0x0026B1A4 File Offset: 0x002693A4
[Token(Token = "0x600B1B3")]
[Address(RVA = "0x42C280", Offset = "0x42B080", VA = "0x18042C280")]
public BasicEntropySourceProvider(SecureRandom secureRandom, bool isPredictionResistant)
{
this.mSecureRandom = secureRandom;
this.mPredictionResistant = isPredictionResistant;
}
// Token: 0x0600B1B4 RID: 45492 RVA: 0x0026B1C8 File Offset: 0x002693C8
[Token(Token = "0x600B1B4")]
[Address(RVA = "0x17FEDC0", Offset = "0x17FDBC0", VA = "0x1817FEDC0", Slot = "4")]
public IEntropySource Get(int bitsRequired)
{
/*
An exception occurred when decompiling this method (0600B1B4)
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 1660
*/;
}
// Token: 0x04007132 RID: 28978
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007132")]
private readonly SecureRandom mSecureRandom;
// Token: 0x04007133 RID: 28979
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007133")]
private readonly bool mPredictionResistant;
// Token: 0x02001BBF RID: 7103
[Token(Token = "0x2001BBF")]
private class BasicEntropySource : IEntropySource
{
// Token: 0x0600B1B5 RID: 45493 RVA: 0x0026B1F8 File Offset: 0x002693F8
[Token(Token = "0x600B1B5")]
[Address(RVA = "0x17FEEB0", Offset = "0x17FDCB0", VA = "0x1817FEEB0")]
internal BasicEntropySource(SecureRandom secureRandom, bool predictionResistant, int entropySize)
{
this.mSecureRandom = secureRandom;
this.mPredictionResistant = predictionResistant;
this.mEntropySize = entropySize;
}
// Token: 0x17001BF0 RID: 7152
// (get) Token: 0x0600B1B6 RID: 45494 RVA: 0x0026B220 File Offset: 0x00269420
[Token(Token = "0x17001BF0")]
bool IEntropySource.IsPredictionResistant
{
[Token(Token = "0x600B1B6")]
[Address(RVA = "0x42C2C0", Offset = "0x42B0C0", VA = "0x18042C2C0", Slot = "4")]
get
{
return this.mPredictionResistant;
}
}
// Token: 0x0600B1B7 RID: 45495 RVA: 0x0026B234 File Offset: 0x00269434
[Token(Token = "0x600B1B7")]
[Address(RVA = "0x17FEE40", Offset = "0x17FDC40", VA = "0x1817FEE40", Slot = "5")]
byte[] IEntropySource.GetEntropy()
{
SecureRandom secureRandom = this.mSecureRandom;
byte[] array;
return array;
}
// Token: 0x17001BF1 RID: 7153
// (get) Token: 0x0600B1B8 RID: 45496 RVA: 0x0026B24C File Offset: 0x0026944C
[Token(Token = "0x17001BF1")]
int IEntropySource.EntropySize
{
[Token(Token = "0x600B1B8")]
[Address(RVA = "0x41F5B0", Offset = "0x41E3B0", VA = "0x18041F5B0", Slot = "6")]
get
{
return this.mEntropySize;
}
}
// Token: 0x04007134 RID: 28980
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007134")]
private readonly SecureRandom mSecureRandom;
// Token: 0x04007135 RID: 28981
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007135")]
private readonly bool mPredictionResistant;
// Token: 0x04007136 RID: 28982
[FieldOffset(Offset = "0x1C")]
[Token(Token = "0x4007136")]
private readonly int mEntropySize;
}
}
}
@@ -0,0 +1,177 @@
using System;
using System.Security.Cryptography;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng
{
// Token: 0x02001BC0 RID: 7104
[Token(Token = "0x2001BC0")]
public class CryptoApiEntropySourceProvider : IEntropySourceProvider
{
// Token: 0x0600B1B9 RID: 45497 RVA: 0x0026B260 File Offset: 0x00269460
[Token(Token = "0x600B1B9")]
[Address(RVA = "0x17FFED0", Offset = "0x17FECD0", VA = "0x1817FFED0")]
public CryptoApiEntropySourceProvider()
{
/*
An exception occurred when decompiling this method (0600B1B9)
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 1660
*/;
}
// Token: 0x0600B1BA RID: 45498 RVA: 0x0026B298 File Offset: 0x00269498
[Token(Token = "0x600B1BA")]
[Address(RVA = "0x17FFF60", Offset = "0x17FED60", VA = "0x1817FFF60")]
public CryptoApiEntropySourceProvider(RandomNumberGenerator rng, bool isPredictionResistant)
{
/*
An exception occurred when decompiling this method (0600B1BA)
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 1660
*/;
}
// Token: 0x0600B1BB RID: 45499 RVA: 0x0026B2C8 File Offset: 0x002694C8
[Token(Token = "0x600B1BB")]
[Address(RVA = "0x17FFE50", Offset = "0x17FEC50", VA = "0x1817FFE50", Slot = "4")]
public IEntropySource Get(int bitsRequired)
{
/*
An exception occurred when decompiling this method (0600B1BB)
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 1660
*/;
}
// Token: 0x04007137 RID: 28983
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007137")]
private readonly RandomNumberGenerator mRng;
// Token: 0x04007138 RID: 28984
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007138")]
private readonly bool mPredictionResistant;
// Token: 0x02001BC1 RID: 7105
[Token(Token = "0x2001BC1")]
private class CryptoApiEntropySource : IEntropySource
{
// Token: 0x0600B1BC RID: 45500 RVA: 0x0026B2F8 File Offset: 0x002694F8
[Token(Token = "0x600B1BC")]
[Address(RVA = "0x17FEEB0", Offset = "0x17FDCB0", VA = "0x1817FEEB0")]
internal CryptoApiEntropySource(RandomNumberGenerator rng, bool predictionResistant, int entropySize)
{
this.mRng = rng;
this.mPredictionResistant = predictionResistant;
this.mEntropySize = entropySize;
}
// Token: 0x17001BF2 RID: 7154
// (get) Token: 0x0600B1BD RID: 45501 RVA: 0x0026B320 File Offset: 0x00269520
[Token(Token = "0x17001BF2")]
bool IEntropySource.IsPredictionResistant
{
[Token(Token = "0x600B1BD")]
[Address(RVA = "0x42C2C0", Offset = "0x42B0C0", VA = "0x18042C2C0", Slot = "4")]
get
{
return this.mPredictionResistant;
}
}
// Token: 0x0600B1BE RID: 45502 RVA: 0x0026B334 File Offset: 0x00269534
[Token(Token = "0x600B1BE")]
[Address(RVA = "0x17FFFF0", Offset = "0x17FEDF0", VA = "0x1817FFFF0", Slot = "5")]
byte[] IEntropySource.GetEntropy()
{
int num = this.mEntropySize;
num += 7;
RandomNumberGenerator randomNumberGenerator = this.mRng;
byte[] array;
return array;
}
// Token: 0x17001BF3 RID: 7155
// (get) Token: 0x0600B1BF RID: 45503 RVA: 0x0026B35C File Offset: 0x0026955C
[Token(Token = "0x17001BF3")]
int IEntropySource.EntropySize
{
[Token(Token = "0x600B1BF")]
[Address(RVA = "0x41F5B0", Offset = "0x41E3B0", VA = "0x18041F5B0", Slot = "6")]
get
{
return this.mEntropySize;
}
}
// Token: 0x04007139 RID: 28985
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007139")]
private readonly RandomNumberGenerator mRng;
// Token: 0x0400713A RID: 28986
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x400713A")]
private readonly bool mPredictionResistant;
// Token: 0x0400713B RID: 28987
[FieldOffset(Offset = "0x1C")]
[Token(Token = "0x400713B")]
private readonly int mEntropySize;
}
}
}
@@ -0,0 +1,93 @@
using System;
using System.Security.Cryptography;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng
{
// Token: 0x02001BC2 RID: 7106
[Token(Token = "0x2001BC2")]
public class CryptoApiRandomGenerator : IRandomGenerator
{
// Token: 0x0600B1C0 RID: 45504 RVA: 0x0026B370 File Offset: 0x00269570
[Token(Token = "0x600B1C0")]
[Address(RVA = "0x18001F0", Offset = "0x17FEFF0", VA = "0x1818001F0")]
public CryptoApiRandomGenerator()
{
RandomNumberGenerator randomNumberGenerator = RandomNumberGenerator.Create();
int num = 0;
this.AddSeedMaterial((long)num);
this.rndProv = randomNumberGenerator;
}
// Token: 0x0600B1C1 RID: 45505 RVA: 0x0026B398 File Offset: 0x00269598
[Token(Token = "0x600B1C1")]
[Address(RVA = "0x3FFB80", Offset = "0x3FE980", VA = "0x1803FFB80")]
public CryptoApiRandomGenerator(RandomNumberGenerator rng)
{
int num = 0;
this.AddSeedMaterial((long)num);
this.rndProv = rng;
}
// Token: 0x0600B1C2 RID: 45506 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x600B1C2")]
[Address(RVA = "0x402080", Offset = "0x400E80", VA = "0x180402080", Slot = "8")]
public virtual void AddSeedMaterial(byte[] seed)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x0600B1C3 RID: 45507 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x600B1C3")]
[Address(RVA = "0x402080", Offset = "0x400E80", VA = "0x180402080", Slot = "9")]
public virtual void AddSeedMaterial(long seed)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x0600B1C4 RID: 45508 RVA: 0x0026B3B8 File Offset: 0x002695B8
[Token(Token = "0x600B1C4")]
[Address(RVA = "0x18001C0", Offset = "0x17FEFC0", VA = "0x1818001C0", Slot = "10")]
public virtual void NextBytes(byte[] bytes)
{
this.rndProv.GetBytes(bytes);
}
// Token: 0x0600B1C5 RID: 45509 RVA: 0x0026B3D8 File Offset: 0x002695D8
[Token(Token = "0x600B1C5")]
[Address(RVA = "0x1800070", Offset = "0x17FEE70", VA = "0x181800070", Slot = "11")]
public virtual void NextBytes(byte[] bytes, int start, int len)
{
/*
An exception occurred when decompiling this method (0600B1C5)
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 1660
*/;
}
// Token: 0x0400713C RID: 28988
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x400713C")]
private readonly RandomNumberGenerator rndProv;
}
}
@@ -0,0 +1,200 @@
using System;
using System.Threading;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng
{
// Token: 0x02001BC3 RID: 7107
[Token(Token = "0x2001BC3")]
public class DigestRandomGenerator : IRandomGenerator
{
// Token: 0x0600B1C6 RID: 45510 RVA: 0x0026B418 File Offset: 0x00269618
[Token(Token = "0x600B1C6")]
[Address(RVA = "0x1804EF0", Offset = "0x1803CF0", VA = "0x181804EF0")]
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: 0x0600B1C7 RID: 45511 RVA: 0x0026B468 File Offset: 0x00269668
[Token(Token = "0x600B1C7")]
[Address(RVA = "0x1804780", Offset = "0x1803580", VA = "0x181804780", 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);
}
while (num != 0);
}
// Token: 0x0600B1C8 RID: 45512 RVA: 0x0026B4CC File Offset: 0x002696CC
[Token(Token = "0x600B1C8")]
[Address(RVA = "0x1804640", Offset = "0x1803440", VA = "0x181804640", 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);
}
while (num != 0);
}
// Token: 0x0600B1C9 RID: 45513 RVA: 0x0026B51C File Offset: 0x0026971C
[Token(Token = "0x600B1C9")]
[Address(RVA = "0x1804EC0", Offset = "0x1803CC0", VA = "0x181804EC0", Slot = "6")]
public void NextBytes(byte[] bytes)
{
int length = bytes.Length;
int num = 0;
this.NextBytes(bytes, num, length);
}
// Token: 0x0600B1CA RID: 45514 RVA: 0x0026B544 File Offset: 0x00269744
[Token(Token = "0x600B1CA")]
[Address(RVA = "0x1804D70", Offset = "0x1803B70", VA = "0x181804D70", 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);
}
while (num != 0);
}
// Token: 0x0600B1CB RID: 45515 RVA: 0x0026B5A0 File Offset: 0x002697A0
[Token(Token = "0x600B1CB")]
[Address(RVA = "0x1804910", Offset = "0x1803710", VA = "0x181804910")]
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: 0x0600B1CC RID: 45516 RVA: 0x0026B5F0 File Offset: 0x002697F0
[Token(Token = "0x600B1CC")]
[Address(RVA = "0x1804B70", Offset = "0x1803970", VA = "0x181804B70")]
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: 0x0600B1CD RID: 45517 RVA: 0x0026B6A4 File Offset: 0x002698A4
[Token(Token = "0x600B1CD")]
[Address(RVA = "0x18049F0", Offset = "0x18037F0", VA = "0x1818049F0")]
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: 0x0600B1CE RID: 45518 RVA: 0x0026B6D4 File Offset: 0x002698D4
[Token(Token = "0x600B1CE")]
[Address(RVA = "0x1804B00", Offset = "0x1803900", VA = "0x181804B00")]
private void DigestUpdate(byte[] inSeed)
{
IDigest digest = this.digest;
int length = inSeed.Length;
}
// Token: 0x0600B1CF RID: 45519 RVA: 0x0026B6F8 File Offset: 0x002698F8
[Token(Token = "0x600B1CF")]
[Address(RVA = "0x1804A90", Offset = "0x1803890", VA = "0x181804A90")]
private void DigestDoFinal(byte[] result)
{
IDigest digest = this.digest;
}
// Token: 0x0400713D RID: 28989
[Token(Token = "0x400713D")]
private const long CYCLE_COUNT = 10L;
// Token: 0x0400713E RID: 28990
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x400713E")]
private long stateCounter;
// Token: 0x0400713F RID: 28991
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x400713F")]
private long seedCounter;
// Token: 0x04007140 RID: 28992
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007140")]
private IDigest digest;
// Token: 0x04007141 RID: 28993
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007141")]
private byte[] state;
// Token: 0x04007142 RID: 28994
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4007142")]
private byte[] seed;
}
}
@@ -0,0 +1,455 @@
using System;
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: 0x02001BD3 RID: 7123
[Token(Token = "0x2001BD3")]
public class CtrSP800Drbg : ISP80090Drbg
{
// Token: 0x0600B210 RID: 45584 RVA: 0x0026C6E0 File Offset: 0x0026A8E0
[Token(Token = "0x600B210")]
[Address(RVA = "0x1801DA0", Offset = "0x1800BA0", VA = "0x181801DA0")]
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: 0x0600B211 RID: 45585 RVA: 0x0026C74C File Offset: 0x0026A94C
[Token(Token = "0x600B211")]
[Address(RVA = "0x1800A50", Offset = "0x17FF850", VA = "0x181800A50")]
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: 0x0600B212 RID: 45586 RVA: 0x0026C7F8 File Offset: 0x0026A9F8
[Token(Token = "0x600B212")]
[Address(RVA = "0x1800D20", Offset = "0x17FFB20", VA = "0x181800D20")]
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: 0x0600B213 RID: 45587 RVA: 0x0026C8E0 File Offset: 0x0026AAE0
[Token(Token = "0x600B213")]
[Address(RVA = "0x1800C70", Offset = "0x17FFA70", VA = "0x181800C70")]
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: 0x0600B214 RID: 45588 RVA: 0x0026C92C File Offset: 0x0026AB2C
[Token(Token = "0x600B214")]
[Address(RVA = "0x1801C40", Offset = "0x1800A40", VA = "0x181801C40")]
private void XOR(byte[] output, byte[] a, byte[] b, int bOff)
{
int num = 0;
int length = output.Length;
if (num < length)
{
num++;
}
}
// Token: 0x0600B215 RID: 45589 RVA: 0x0026C950 File Offset: 0x0026AB50
[Token(Token = "0x600B215")]
[Address(RVA = "0x1800220", Offset = "0x17FF020", VA = "0x181800220")]
private void AddOneTo(byte[] longer)
{
int num = longer.Length;
uint num2;
num -= (int)num2;
byte b;
num2 += (uint)b;
}
// Token: 0x0600B216 RID: 45590 RVA: 0x0026C974 File Offset: 0x0026AB74
[Token(Token = "0x600B216")]
[Address(RVA = "0x18015A0", Offset = "0x18003A0", VA = "0x1818015A0")]
private byte[] GetEntropy()
{
IEntropySource entropySource = this.mEntropySource;
int num = this.mSecurityStrength;
num += 7;
num += typeof(IEntropySource).TypeHandle;
throw new NullReferenceException();
}
// Token: 0x0600B217 RID: 45591 RVA: 0x0026C9A0 File Offset: 0x0026ABA0
[Token(Token = "0x600B217")]
[Address(RVA = "0x1800570", Offset = "0x17FF370", VA = "0x181800570")]
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: 0x0600B218 RID: 45592 RVA: 0x0026CB94 File Offset: 0x0026AD94
[Token(Token = "0x600B218")]
[Address(RVA = "0x1800280", Offset = "0x17FF080", VA = "0x181800280")]
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: 0x0600B219 RID: 45593 RVA: 0x0026CC24 File Offset: 0x0026AE24
[Token(Token = "0x600B219")]
[Address(RVA = "0x1801FD0", Offset = "0x1800DD0", VA = "0x181801FD0")]
private void copyIntToByteArray(byte[] buf, int value, int offSet)
{
int num = offSet + 1;
}
// Token: 0x17001BF5 RID: 7157
// (get) Token: 0x0600B21A RID: 45594 RVA: 0x0026CC3C File Offset: 0x0026AE3C
[Token(Token = "0x17001BF5")]
public int BlockSize
{
[Token(Token = "0x600B21A")]
[Address(RVA = "0x1802070", Offset = "0x1800E70", VA = "0x181802070", Slot = "4")]
get
{
return this.mV.Length;
}
}
// Token: 0x0600B21B RID: 45595 RVA: 0x0026CC5C File Offset: 0x0026AE5C
[Token(Token = "0x600B21B")]
[Address(RVA = "0x1801100", Offset = "0x17FFF00", VA = "0x181801100", Slot = "5")]
public int Generate(byte[] output, byte[] additionalInput, bool predictionResistant)
{
/*
An exception occurred when decompiling this method (0600B21B)
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_25_15C, newobj:ArgumentException(ArgumentException::.ctor, call:string(string::Concat, ldstr:string[exp:object]("Number of bits per request limited to "), ldloc:ArgumentException[exp:object](var_24)), 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 1660
*/;
}
// Token: 0x0600B21C RID: 45596 RVA: 0x0026CDC8 File Offset: 0x0026AFC8
[Token(Token = "0x600B21C")]
[Address(RVA = "0x1801C30", Offset = "0x1800A30", VA = "0x181801C30", Slot = "6")]
public void Reseed(byte[] additionalInput)
{
this.CTR_DRBG_Reseed_algorithm(additionalInput);
}
// Token: 0x0600B21D RID: 45597 RVA: 0x0026CDDC File Offset: 0x0026AFDC
[Token(Token = "0x600B21D")]
[Address(RVA = "0x18016F0", Offset = "0x18004F0", VA = "0x1818016F0")]
private bool IsTdea(IBlockCipher cipher)
{
bool flag;
bool flag2;
return flag || flag2;
}
// Token: 0x0600B21E RID: 45598 RVA: 0x0026CDF8 File Offset: 0x0026AFF8
[Token(Token = "0x600B21E")]
[Address(RVA = "0x1801640", Offset = "0x1800440", VA = "0x181801640")]
private int GetMaxSecurityStrength(IBlockCipher cipher, int keySizeInBits)
{
if (!this.IsTdea(cipher) || keySizeInBits == 168)
{
}
return -1;
}
// Token: 0x0600B21F RID: 45599 RVA: 0x0026CE20 File Offset: 0x0026B020
[Token(Token = "0x600B21F")]
[Address(RVA = "0x1801030", Offset = "0x17FFE30", VA = "0x181801030")]
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: 0x0600B220 RID: 45600 RVA: 0x0026CE68 File Offset: 0x0026B068
[Token(Token = "0x600B220")]
[Address(RVA = "0x1801780", Offset = "0x1800580", VA = "0x181801780")]
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: 0x04007173 RID: 29043
[Token(Token = "0x4007173")]
private static readonly long TDEA_RESEED_MAX = (long)((uint)int.MinValue);
// Token: 0x04007174 RID: 29044
[Token(Token = "0x4007174")]
private static readonly long AES_RESEED_MAX = (long)((ulong)140737488355328L);
// Token: 0x04007175 RID: 29045
[Token(Token = "0x4007175")]
private static readonly int TDEA_MAX_BITS_REQUEST;
// Token: 0x04007176 RID: 29046
[Token(Token = "0x4007176")]
private static readonly int AES_MAX_BITS_REQUEST;
// Token: 0x04007177 RID: 29047
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007177")]
private readonly IEntropySource mEntropySource;
// Token: 0x04007178 RID: 29048
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007178")]
private readonly IBlockCipher mEngine;
// Token: 0x04007179 RID: 29049
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007179")]
private readonly int mKeySizeInBits;
// Token: 0x0400717A RID: 29050
[FieldOffset(Offset = "0x24")]
[Token(Token = "0x400717A")]
private readonly int mSeedLength;
// Token: 0x0400717B RID: 29051
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x400717B")]
private readonly int mSecurityStrength;
// Token: 0x0400717C RID: 29052
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x400717C")]
private byte[] mKey;
// Token: 0x0400717D RID: 29053
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x400717D")]
private byte[] mV;
// Token: 0x0400717E RID: 29054
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x400717E")]
private long mReseedCounter;
// Token: 0x0400717F RID: 29055
[FieldOffset(Offset = "0x48")]
[Token(Token = "0x400717F")]
private bool mIsTdea;
// Token: 0x04007180 RID: 29056
[Token(Token = "0x4007180")]
private static readonly byte[] K_BITS = Hex.Decode("000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F");
}
}
@@ -0,0 +1,129 @@
using System;
using System.Collections;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng.Drbg
{
// Token: 0x02001BD4 RID: 7124
[Token(Token = "0x2001BD4")]
internal class DrbgUtilities
{
// Token: 0x0600B222 RID: 45602 RVA: 0x0026CF34 File Offset: 0x0026B134
[Token(Token = "0x600B222")]
[Address(RVA = "0x1891A10", Offset = "0x1890810", VA = "0x181891A10")]
static DrbgUtilities()
{
IDictionary dictionary = Platform.CreateHashtable();
}
// Token: 0x0600B223 RID: 45603 RVA: 0x0026CF50 File Offset: 0x0026B150
[Token(Token = "0x600B223")]
[Address(RVA = "0x18912C0", Offset = "0x18900C0", VA = "0x1818912C0")]
internal static int GetMaxSecurityStrength(IDigest d)
{
throw new NullReferenceException();
}
// Token: 0x0600B224 RID: 45604 RVA: 0x0026CF64 File Offset: 0x0026B164
[Token(Token = "0x600B224")]
[Address(RVA = "0x1891390", Offset = "0x1890190", VA = "0x181891390")]
internal static int GetMaxSecurityStrength(IMac m)
{
throw new NullReferenceException();
}
// Token: 0x0600B225 RID: 45605 RVA: 0x0026CF80 File Offset: 0x0026B180
[Token(Token = "0x600B225")]
[Address(RVA = "0x1891490", Offset = "0x1890290", VA = "0x181891490")]
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: 0x0600B226 RID: 45606 RVA: 0x0026D0A4 File Offset: 0x0026B2A4
[Token(Token = "0x600B226")]
[Address(RVA = "0x1891A00", Offset = "0x1890800", VA = "0x181891A00")]
internal static bool IsTooLarge(byte[] bytes, int maxBytes)
{
if (bytes == 0)
{
}
return bytes.Length > maxBytes;
}
// Token: 0x0600B227 RID: 45607 RVA: 0x0026D0C0 File Offset: 0x0026B2C0
[Token(Token = "0x600B227")]
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
public DrbgUtilities()
{
}
// Token: 0x04007181 RID: 29057
[Token(Token = "0x4007181")]
private static readonly IDictionary maxSecurityStrengths;
}
}
@@ -0,0 +1,238 @@
using System;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng.Drbg
{
// Token: 0x02001BD5 RID: 7125
[Token(Token = "0x2001BD5")]
public class HMacSP800Drbg : ISP80090Drbg
{
// Token: 0x0600B228 RID: 45608 RVA: 0x0026D0D4 File Offset: 0x0026B2D4
[Token(Token = "0x600B228")]
[Address(RVA = "0x1899760", Offset = "0x1898560", VA = "0x181899760")]
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: 0x0600B229 RID: 45609 RVA: 0x0026D170 File Offset: 0x0026B370
[Token(Token = "0x600B229")]
[Address(RVA = "0x1899D30", Offset = "0x1898B30", VA = "0x181899D30")]
private void hmac_DRBG_Update(byte[] seedMaterial)
{
int num = 0;
this.hmac_DRBG_Update_Func(seedMaterial, (byte)num);
if (seedMaterial != 0)
{
}
}
// Token: 0x0600B22A RID: 45610 RVA: 0x0026D18C File Offset: 0x0026B38C
[Token(Token = "0x600B22A")]
[Address(RVA = "0x1899B40", Offset = "0x1898940", VA = "0x181899B40")]
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: 0x17001BF6 RID: 7158
// (get) Token: 0x0600B22B RID: 45611 RVA: 0x0026D228 File Offset: 0x0026B428
[Token(Token = "0x17001BF6")]
public int BlockSize
{
[Token(Token = "0x600B22B")]
[Address(RVA = "0x1899B20", Offset = "0x1898920", VA = "0x181899B20", Slot = "4")]
get
{
return this.mV.Length;
}
}
// Token: 0x0600B22C RID: 45612 RVA: 0x0026D248 File Offset: 0x0026B448
[Token(Token = "0x600B22C")]
[Address(RVA = "0x1899070", Offset = "0x1897E70", VA = "0x181899070", 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: 0x0600B22D RID: 45613 RVA: 0x0026D418 File Offset: 0x0026B618
[Token(Token = "0x600B22D")]
[Address(RVA = "0x1899650", Offset = "0x1898450", VA = "0x181899650", 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: 0x0600B22E RID: 45614 RVA: 0x0026D44C File Offset: 0x0026B64C
[Token(Token = "0x600B22E")]
[Address(RVA = "0x18995B0", Offset = "0x18983B0", VA = "0x1818995B0")]
private byte[] GetEntropy()
{
IEntropySource entropySource = this.mEntropySource;
int num = this.mSecurityStrength;
num += 7;
num += typeof(IEntropySource).TypeHandle;
throw new NullReferenceException();
}
// Token: 0x04007182 RID: 29058
[Token(Token = "0x4007182")]
private static readonly long RESEED_MAX = (long)((ulong)140737488355328L);
// Token: 0x04007183 RID: 29059
[Token(Token = "0x4007183")]
private static readonly int MAX_BITS_REQUEST;
// Token: 0x04007184 RID: 29060
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007184")]
private readonly byte[] mK;
// Token: 0x04007185 RID: 29061
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007185")]
private readonly byte[] mV;
// Token: 0x04007186 RID: 29062
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007186")]
private readonly IEntropySource mEntropySource;
// Token: 0x04007187 RID: 29063
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007187")]
private readonly IMac mHMac;
// Token: 0x04007188 RID: 29064
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4007188")]
private readonly int mSecurityStrength;
// Token: 0x04007189 RID: 29065
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x4007189")]
private long mReseedCounter;
}
}
@@ -0,0 +1,356 @@
using System;
using System.Collections;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng.Drbg
{
// Token: 0x02001BD6 RID: 7126
[Token(Token = "0x2001BD6")]
public class HashSP800Drbg : ISP80090Drbg
{
// Token: 0x0600B230 RID: 45616 RVA: 0x0026D494 File Offset: 0x0026B694
[Token(Token = "0x600B230")]
[Address(RVA = "0x189A910", Offset = "0x1899710", VA = "0x18189A910")]
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: 0x0600B231 RID: 45617 RVA: 0x0026D50C File Offset: 0x0026B70C
[Token(Token = "0x600B231")]
[Address(RVA = "0x189AC40", Offset = "0x1899A40", VA = "0x18189AC40")]
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: 0x17001BF7 RID: 7159
// (get) Token: 0x0600B232 RID: 45618 RVA: 0x0026D60C File Offset: 0x0026B80C
[Token(Token = "0x17001BF7")]
public int BlockSize
{
[Token(Token = "0x600B232")]
[Address(RVA = "0x189B0A0", Offset = "0x1899EA0", VA = "0x18189B0A0", Slot = "4")]
get
{
IDigest digest = this.mDigest;
throw new NullReferenceException();
}
}
// Token: 0x0600B233 RID: 45619 RVA: 0x0026D628 File Offset: 0x0026B828
[Token(Token = "0x600B233")]
[Address(RVA = "0x1899FA0", Offset = "0x1898DA0", VA = "0x181899FA0", 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: 0x0600B234 RID: 45620 RVA: 0x0026D8B0 File Offset: 0x0026BAB0
[Token(Token = "0x600B234")]
[Address(RVA = "0x189A500", Offset = "0x1899300", VA = "0x18189A500")]
private byte[] GetEntropy()
{
IEntropySource entropySource = this.mEntropySource;
int num = this.mSecurityStrength;
num += 7;
num += typeof(IEntropySource).TypeHandle;
throw new NullReferenceException();
}
// Token: 0x0600B235 RID: 45621 RVA: 0x0026D8DC File Offset: 0x0026BADC
[Token(Token = "0x600B235")]
[Address(RVA = "0x1899E10", Offset = "0x1898C10", VA = "0x181899E10")]
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: 0x0600B236 RID: 45622 RVA: 0x0026D91C File Offset: 0x0026BB1C
[Token(Token = "0x600B236")]
[Address(RVA = "0x189A630", Offset = "0x1899430", VA = "0x18189A630", 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: 0x0600B237 RID: 45623 RVA: 0x0026DA18 File Offset: 0x0026BC18
[Token(Token = "0x600B237")]
[Address(RVA = "0x189A5A0", Offset = "0x18993A0", VA = "0x18189A5A0")]
private byte[] Hash(byte[] input)
{
IDigest digest = this.mDigest;
byte[] array = new byte[0];
this.DoHash(input, array);
return array;
}
// Token: 0x0600B238 RID: 45624 RVA: 0x0026DA44 File Offset: 0x0026BC44
[Token(Token = "0x600B238")]
[Address(RVA = "0x1899F00", Offset = "0x1898D00", VA = "0x181899F00")]
private void DoHash(byte[] input, byte[] output)
{
IDigest digest = this.mDigest;
int length = input.Length;
IDigest digest2 = this.mDigest;
}
// Token: 0x0600B239 RID: 45625 RVA: 0x0026DA6C File Offset: 0x0026BC6C
[Token(Token = "0x600B239")]
[Address(RVA = "0x189B0F0", Offset = "0x1899EF0", VA = "0x18189B0F0")]
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: 0x0400718A RID: 29066
[Token(Token = "0x400718A")]
private static readonly byte[] ONE = new byte[] { (byte)((ulong)1L) };
// Token: 0x0400718B RID: 29067
[Token(Token = "0x400718B")]
private static readonly long RESEED_MAX = (long)((ulong)140737488355328L);
// Token: 0x0400718C RID: 29068
[Token(Token = "0x400718C")]
private static readonly int MAX_BITS_REQUEST;
// Token: 0x0400718D RID: 29069
[Token(Token = "0x400718D")]
private static readonly IDictionary seedlens = Platform.CreateHashtable();
// Token: 0x0400718E RID: 29070
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x400718E")]
private readonly IDigest mDigest;
// Token: 0x0400718F RID: 29071
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x400718F")]
private readonly IEntropySource mEntropySource;
// Token: 0x04007190 RID: 29072
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007190")]
private readonly int mSecurityStrength;
// Token: 0x04007191 RID: 29073
[FieldOffset(Offset = "0x24")]
[Token(Token = "0x4007191")]
private readonly int mSeedLength;
// Token: 0x04007192 RID: 29074
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007192")]
private byte[] mV;
// Token: 0x04007193 RID: 29075
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4007193")]
private byte[] mC;
// Token: 0x04007194 RID: 29076
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x4007194")]
private long mReseedCounter;
}
}
@@ -0,0 +1,30 @@
using System;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng.Drbg
{
// Token: 0x02001BD7 RID: 7127
[Token(Token = "0x2001BD7")]
public interface ISP80090Drbg
{
// Token: 0x17001BF8 RID: 7160
// (get) Token: 0x0600B23A RID: 45626
[Token(Token = "0x17001BF8")]
int BlockSize
{
[Token(Token = "0x600B23A")]
[Address(Slot = "0")]
get;
}
// Token: 0x0600B23B RID: 45627
[Token(Token = "0x600B23B")]
[Address(Slot = "1")]
int Generate(byte[] output, byte[] additionalInput, bool predictionResistant);
// Token: 0x0600B23C RID: 45628
[Token(Token = "0x600B23C")]
[Address(Slot = "2")]
void Reseed(byte[] additionalInput);
}
}
@@ -0,0 +1,34 @@
using System;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng
{
// Token: 0x02001BC4 RID: 7108
[Token(Token = "0x2001BC4")]
public abstract class EntropyUtilities
{
// Token: 0x0600B1D0 RID: 45520 RVA: 0x0026B714 File Offset: 0x00269914
[Token(Token = "0x600B1D0")]
[Address(RVA = "0x1896A40", Offset = "0x1895840", VA = "0x181896A40")]
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: 0x0600B1D1 RID: 45521 RVA: 0x0026B754 File Offset: 0x00269954
[Token(Token = "0x600B1D1")]
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
protected EntropyUtilities()
{
}
}
}
@@ -0,0 +1,16 @@
using System;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng.Drbg;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng
{
// Token: 0x02001BC5 RID: 7109
[Token(Token = "0x2001BC5")]
internal interface IDrbgProvider
{
// Token: 0x0600B1D2 RID: 45522
[Token(Token = "0x600B1D2")]
[Address(Slot = "0")]
ISP80090Drbg Get(IEntropySource entropySource);
}
}
@@ -0,0 +1,30 @@
using System;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng
{
// Token: 0x02001BC6 RID: 7110
[Token(Token = "0x2001BC6")]
public interface IRandomGenerator
{
// Token: 0x0600B1D3 RID: 45523
[Token(Token = "0x600B1D3")]
[Address(Slot = "0")]
void AddSeedMaterial(byte[] seed);
// Token: 0x0600B1D4 RID: 45524
[Token(Token = "0x600B1D4")]
[Address(Slot = "1")]
void AddSeedMaterial(long seed);
// Token: 0x0600B1D5 RID: 45525
[Token(Token = "0x600B1D5")]
[Address(Slot = "2")]
void NextBytes(byte[] bytes);
// Token: 0x0600B1D6 RID: 45526
[Token(Token = "0x600B1D6")]
[Address(Slot = "3")]
void NextBytes(byte[] bytes, int start, int len);
}
}
@@ -0,0 +1,133 @@
using System;
using System.Threading;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng
{
// Token: 0x02001BC7 RID: 7111
[Token(Token = "0x2001BC7")]
public class ReversedWindowGenerator : IRandomGenerator
{
// Token: 0x0600B1D7 RID: 45527 RVA: 0x0026B768 File Offset: 0x00269968
[Token(Token = "0x600B1D7")]
[Address(RVA = "0x18A0A30", Offset = "0x189F830", VA = "0x1818A0A30")]
public ReversedWindowGenerator(IRandomGenerator generator, int windowSize)
{
/*
An exception occurred when decompiling this method (0600B1D7)
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 1660
*/;
}
// Token: 0x0600B1D8 RID: 45528 RVA: 0x0026B7A0 File Offset: 0x002699A0
[Token(Token = "0x600B1D8")]
[Address(RVA = "0x18A0920", Offset = "0x189F720", VA = "0x1818A0920", Slot = "8")]
public virtual void AddSeedMaterial(byte[] seed)
{
int num;
do
{
num = 0;
this.windowCount = num;
IRandomGenerator randomGenerator = this.generator;
Monitor.Exit(this);
}
while (num != 0);
}
// Token: 0x0600B1D9 RID: 45529 RVA: 0x0026B7D0 File Offset: 0x002699D0
[Token(Token = "0x600B1D9")]
[Address(RVA = "0x18A0850", Offset = "0x189F650", VA = "0x1818A0850", Slot = "9")]
public virtual void AddSeedMaterial(long seed)
{
int num;
do
{
num = 0;
this.windowCount = num;
IRandomGenerator randomGenerator = this.generator;
Monitor.Exit(this);
}
while (num != 0);
}
// Token: 0x0600B1DA RID: 45530 RVA: 0x0026B800 File Offset: 0x00269A00
[Token(Token = "0x600B1DA")]
[Address(RVA = "0x18A0A00", Offset = "0x189F800", VA = "0x1818A0A00", Slot = "10")]
public virtual void NextBytes(byte[] bytes)
{
int length = bytes.Length;
int num = 0;
this.doNextBytes(bytes, num, length);
}
// Token: 0x0600B1DB RID: 45531 RVA: 0x0026B828 File Offset: 0x00269A28
[Token(Token = "0x600B1DB")]
[Address(RVA = "0x18A09F0", Offset = "0x189F7F0", VA = "0x1818A09F0", Slot = "11")]
public virtual void NextBytes(byte[] bytes, int start, int len)
{
this.doNextBytes(bytes, start, len);
}
// Token: 0x0600B1DC RID: 45532 RVA: 0x0026B840 File Offset: 0x00269A40
[Token(Token = "0x600B1DC")]
[Address(RVA = "0x18A0B10", Offset = "0x189F910", VA = "0x1818A0B10")]
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);
}
while (num != 0);
}
// Token: 0x04007143 RID: 28995
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007143")]
private readonly IRandomGenerator generator;
// Token: 0x04007144 RID: 28996
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007144")]
private byte[] window;
// Token: 0x04007145 RID: 28997
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007145")]
private int windowCount;
}
}
@@ -0,0 +1,150 @@
using System;
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: 0x02001BC8 RID: 7112
[Token(Token = "0x2001BC8")]
public class SP800SecureRandom : SecureRandom
{
// Token: 0x0600B1DD RID: 45533 RVA: 0x0026B8CC File Offset: 0x00269ACC
[Token(Token = "0x600B1DD")]
[Address(RVA = "0x18A3DA0", Offset = "0x18A2BA0", VA = "0x1818A3DA0")]
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: 0x0600B1DE RID: 45534 RVA: 0x0026B900 File Offset: 0x00269B00
[Token(Token = "0x600B1DE")]
[Address(RVA = "0x18A3CF0", Offset = "0x18A2AF0", VA = "0x1818A3CF0", Slot = "11")]
public override void SetSeed(byte[] seed)
{
int num;
do
{
num = 0;
if (this.mRandomSource != 0)
{
}
Monitor.Exit(this);
}
while (num != 0);
}
// Token: 0x0600B1DF RID: 45535 RVA: 0x0026B924 File Offset: 0x00269B24
[Token(Token = "0x600B1DF")]
[Address(RVA = "0x18A3C40", Offset = "0x18A2A40", VA = "0x1818A3C40", 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);
}
while (num != 0);
}
// Token: 0x0600B1E0 RID: 45536 RVA: 0x0026B950 File Offset: 0x00269B50
[Token(Token = "0x600B1E0")]
[Address(RVA = "0x18A39D0", Offset = "0x18A27D0", VA = "0x1818A39D0", 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);
}
while (num != 0);
}
// Token: 0x0600B1E1 RID: 45537 RVA: 0x0026B9BC File Offset: 0x00269BBC
[Token(Token = "0x600B1E1")]
[Address(RVA = "0x18A3920", Offset = "0x18A2720", VA = "0x1818A3920", 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: 0x0600B1E2 RID: 45538 RVA: 0x0026B9E4 File Offset: 0x00269BE4
[Token(Token = "0x600B1E2")]
[Address(RVA = "0x18A3910", Offset = "0x18A2710", VA = "0x1818A3910", Slot = "10")]
public override byte[] GenerateSeed(int numBytes)
{
return EntropyUtilities.GenerateSeed(this.mEntropySource, numBytes);
}
// Token: 0x0600B1E3 RID: 45539 RVA: 0x0026BA00 File Offset: 0x00269C00
[Token(Token = "0x600B1E3")]
[Address(RVA = "0x18A3B40", Offset = "0x18A2940", VA = "0x1818A3B40", 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);
}
while (num != 0);
}
// Token: 0x04007146 RID: 28998
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007146")]
private readonly IDrbgProvider mDrbgProvider;
// Token: 0x04007147 RID: 28999
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4007147")]
private readonly bool mPredictionResistant;
// Token: 0x04007148 RID: 29000
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x4007148")]
private readonly SecureRandom mRandomSource;
// Token: 0x04007149 RID: 29001
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x4007149")]
private readonly IEntropySource mEntropySource;
// Token: 0x0400714A RID: 29002
[FieldOffset(Offset = "0x48")]
[Token(Token = "0x400714A")]
private ISP80090Drbg mDrbg;
}
}
@@ -0,0 +1,362 @@
using System;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng.Drbg;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng
{
// Token: 0x02001BC9 RID: 7113
[Token(Token = "0x2001BC9")]
public class SP800SecureRandomBuilder
{
// Token: 0x0600B1E4 RID: 45540 RVA: 0x0026BA40 File Offset: 0x00269C40
[Token(Token = "0x600B1E4")]
[Address(RVA = "0x18A3780", Offset = "0x18A2580", VA = "0x1818A3780")]
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: 0x0600B1E5 RID: 45541 RVA: 0x0026BA8C File Offset: 0x00269C8C
[Token(Token = "0x600B1E5")]
[Address(RVA = "0x18A3880", Offset = "0x18A2680", VA = "0x1818A3880")]
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: 0x0600B1E6 RID: 45542 RVA: 0x0026BAD0 File Offset: 0x00269CD0
[Token(Token = "0x600B1E6")]
[Address(RVA = "0x18A3840", Offset = "0x18A2640", VA = "0x1818A3840")]
public SP800SecureRandomBuilder(IEntropySourceProvider entropySourceProvider)
{
this.mSecurityStrength = (int)((ulong)256L);
this.mEntropyBitsRequired = (int)((ulong)256L);
base..ctor();
this.mRandom = (ulong)0L;
this.mEntropySourceProvider = entropySourceProvider;
}
// Token: 0x0600B1E7 RID: 45543 RVA: 0x0026BB10 File Offset: 0x00269D10
[Token(Token = "0x600B1E7")]
[Address(RVA = "0x1872000", Offset = "0x1870E00", VA = "0x181872000")]
public SP800SecureRandomBuilder SetPersonalizationString(byte[] personalizationString)
{
this.mPersonalizationString = personalizationString;
return this;
}
// Token: 0x0600B1E8 RID: 45544 RVA: 0x0026BB28 File Offset: 0x00269D28
[Token(Token = "0x600B1E8")]
[Address(RVA = "0x18A3770", Offset = "0x18A2570", VA = "0x1818A3770")]
public SP800SecureRandomBuilder SetSecurityStrength(int securityStrength)
{
this.mSecurityStrength = securityStrength;
return this;
}
// Token: 0x0600B1E9 RID: 45545 RVA: 0x0026BB40 File Offset: 0x00269D40
[Token(Token = "0x600B1E9")]
[Address(RVA = "0x18A3760", Offset = "0x18A2560", VA = "0x1818A3760")]
public SP800SecureRandomBuilder SetEntropyBitsRequired(int entropyBitsRequired)
{
this.mEntropyBitsRequired = entropyBitsRequired;
return this;
}
// Token: 0x0600B1EA RID: 45546 RVA: 0x0026BB58 File Offset: 0x00269D58
[Token(Token = "0x600B1EA")]
[Address(RVA = "0x18A3670", Offset = "0x18A2470", VA = "0x1818A3670")]
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: 0x0600B1EB RID: 45547 RVA: 0x0026BBA0 File Offset: 0x00269DA0
[Token(Token = "0x600B1EB")]
[Address(RVA = "0x18A3480", Offset = "0x18A2280", VA = "0x1818A3480")]
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: 0x0600B1EC RID: 45548 RVA: 0x0026BBF0 File Offset: 0x00269DF0
[Token(Token = "0x600B1EC")]
[Address(RVA = "0x18A3580", Offset = "0x18A2380", VA = "0x1818A3580")]
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: 0x0400714B RID: 29003
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x400714B")]
private readonly SecureRandom mRandom;
// Token: 0x0400714C RID: 29004
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x400714C")]
private readonly IEntropySourceProvider mEntropySourceProvider;
// Token: 0x0400714D RID: 29005
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x400714D")]
private byte[] mPersonalizationString;
// Token: 0x0400714E RID: 29006
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x400714E")]
private int mSecurityStrength;
// Token: 0x0400714F RID: 29007
[FieldOffset(Offset = "0x2C")]
[Token(Token = "0x400714F")]
private int mEntropyBitsRequired;
// Token: 0x02001BCA RID: 7114
[Token(Token = "0x2001BCA")]
private class HashDrbgProvider : IDrbgProvider
{
// Token: 0x0600B1ED RID: 45549 RVA: 0x0026BC38 File Offset: 0x00269E38
[Token(Token = "0x600B1ED")]
[Address(RVA = "0x18986F0", Offset = "0x18974F0", VA = "0x1818986F0")]
public HashDrbgProvider(IDigest digest, byte[] nonce, byte[] personalizationString, int securityStrength)
{
this.mDigest = digest;
this.mPersonalizationString = personalizationString;
this.mSecurityStrength = 0;
this.mNonce = nonce;
}
// Token: 0x0600B1EE RID: 45550 RVA: 0x0026BC68 File Offset: 0x00269E68
[Token(Token = "0x600B1EE")]
[Address(RVA = "0x1899D70", Offset = "0x1898B70", VA = "0x181899D70", Slot = "4")]
public ISP80090Drbg Get(IEntropySource entropySource)
{
/*
An exception occurred when decompiling this method (0600B1EE)
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 1660
*/;
}
// Token: 0x04007150 RID: 29008
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007150")]
private readonly IDigest mDigest;
// Token: 0x04007151 RID: 29009
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007151")]
private readonly byte[] mNonce;
// Token: 0x04007152 RID: 29010
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007152")]
private readonly byte[] mPersonalizationString;
// Token: 0x04007153 RID: 29011
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007153")]
private readonly int mSecurityStrength;
}
// Token: 0x02001BCB RID: 7115
[Token(Token = "0x2001BCB")]
private class HMacDrbgProvider : IDrbgProvider
{
// Token: 0x0600B1EF RID: 45551 RVA: 0x0026BC9C File Offset: 0x00269E9C
[Token(Token = "0x600B1EF")]
[Address(RVA = "0x18986F0", Offset = "0x18974F0", VA = "0x1818986F0")]
public HMacDrbgProvider(IMac hMac, byte[] nonce, byte[] personalizationString, int securityStrength)
{
this.mHMac = hMac;
this.mPersonalizationString = personalizationString;
this.mSecurityStrength = 0;
this.mNonce = nonce;
}
// Token: 0x0600B1F0 RID: 45552 RVA: 0x0026BCCC File Offset: 0x00269ECC
[Token(Token = "0x600B1F0")]
[Address(RVA = "0x1898650", Offset = "0x1897450", VA = "0x181898650", Slot = "4")]
public ISP80090Drbg Get(IEntropySource entropySource)
{
/*
An exception occurred when decompiling this method (0600B1F0)
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 1660
*/;
}
// Token: 0x04007154 RID: 29012
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007154")]
private readonly IMac mHMac;
// Token: 0x04007155 RID: 29013
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007155")]
private readonly byte[] mNonce;
// Token: 0x04007156 RID: 29014
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007156")]
private readonly byte[] mPersonalizationString;
// Token: 0x04007157 RID: 29015
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007157")]
private readonly int mSecurityStrength;
}
// Token: 0x02001BCC RID: 7116
[Token(Token = "0x2001BCC")]
private class CtrDrbgProvider : IDrbgProvider
{
// Token: 0x0600B1F1 RID: 45553 RVA: 0x0026BD00 File Offset: 0x00269F00
[Token(Token = "0x600B1F1")]
[Address(RVA = "0x1891260", Offset = "0x1890060", VA = "0x181891260")]
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: 0x0600B1F2 RID: 45554 RVA: 0x0026BD38 File Offset: 0x00269F38
[Token(Token = "0x600B1F2")]
[Address(RVA = "0x18911B0", Offset = "0x188FFB0", VA = "0x1818911B0", Slot = "4")]
public ISP80090Drbg Get(IEntropySource entropySource)
{
/*
An exception occurred when decompiling this method (0600B1F2)
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 1660
*/;
}
// Token: 0x04007158 RID: 29016
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007158")]
private readonly IBlockCipher mBlockCipher;
// Token: 0x04007159 RID: 29017
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007159")]
private readonly int mKeySizeInBits;
// Token: 0x0400715A RID: 29018
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x400715A")]
private readonly byte[] mNonce;
// Token: 0x0400715B RID: 29019
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x400715B")]
private readonly byte[] mPersonalizationString;
// Token: 0x0400715C RID: 29020
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x400715C")]
private readonly int mSecurityStrength;
}
}
}
@@ -0,0 +1,110 @@
using System;
using System.Threading;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng
{
// Token: 0x02001BCD RID: 7117
[Token(Token = "0x2001BCD")]
public class ThreadedSeedGenerator
{
// Token: 0x0600B1F3 RID: 45555 RVA: 0x0026BD78 File Offset: 0x00269F78
[Token(Token = "0x600B1F3")]
[Address(RVA = "0x18A4BF0", Offset = "0x18A39F0", VA = "0x1818A4BF0")]
public byte[] GenerateSeed(int numBytes, bool fast)
{
return new ThreadedSeedGenerator.SeedGenerator().GenerateSeed(numBytes, fast);
}
// Token: 0x0600B1F4 RID: 45556 RVA: 0x0026BD98 File Offset: 0x00269F98
[Token(Token = "0x600B1F4")]
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
public ThreadedSeedGenerator()
{
}
// Token: 0x02001BCE RID: 7118
[Token(Token = "0x2001BCE")]
private class SeedGenerator
{
// Token: 0x0600B1F5 RID: 45557 RVA: 0x0026BDAC File Offset: 0x00269FAC
[Token(Token = "0x600B1F5")]
[Address(RVA = "0x18A40F0", Offset = "0x18A2EF0", VA = "0x1818A40F0")]
private void Run(object ignored)
{
while (!this.stop)
{
int num = this.counter + 1;
this.counter = num;
if (this.stop)
{
break;
}
}
}
// Token: 0x0600B1F6 RID: 45558 RVA: 0x0026BDDC File Offset: 0x00269FDC
[Token(Token = "0x600B1F6")]
[Address(RVA = "0x18A3FE0", Offset = "0x18A2DE0", VA = "0x1818A3FE0")]
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);
}
while (num != 0);
return array;
}
// Token: 0x0600B1F7 RID: 45559 RVA: 0x0026BE30 File Offset: 0x0026A030
[Token(Token = "0x600B1F7")]
[Address(RVA = "0x18A3E30", Offset = "0x18A2C30", VA = "0x1818A3E30")]
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: 0x0600B1F8 RID: 45560 RVA: 0x0026BEAC File Offset: 0x0026A0AC
[Token(Token = "0x600B1F8")]
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
public SeedGenerator()
{
}
// Token: 0x0400715D RID: 29021
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x400715D")]
private int counter;
// Token: 0x0400715E RID: 29022
[FieldOffset(Offset = "0x14")]
[Token(Token = "0x400715E")]
private bool stop;
}
}
}
@@ -0,0 +1,113 @@
using System;
using System.Runtime.CompilerServices;
using System.Threading;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng
{
// Token: 0x02001BCF RID: 7119
[Token(Token = "0x2001BCF")]
public class VmpcRandomGenerator : IRandomGenerator
{
// Token: 0x0600B1F9 RID: 45561 RVA: 0x0026BEC0 File Offset: 0x0026A0C0
[Token(Token = "0x600B1F9")]
[Address(RVA = "0x18A5110", Offset = "0x18A3F10", VA = "0x1818A5110")]
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: 0x0600B1FA RID: 45562 RVA: 0x0026BF00 File Offset: 0x0026A100
[Token(Token = "0x600B1FA")]
[Address(RVA = "0x18A4C70", Offset = "0x18A3A70", VA = "0x1818A4C70", 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: 0x0600B1FB RID: 45563 RVA: 0x0026BF74 File Offset: 0x0026A174
[Token(Token = "0x600B1FB")]
[Address(RVA = "0x18A4DD0", Offset = "0x18A3BD0", VA = "0x1818A4DD0", Slot = "9")]
public virtual void AddSeedMaterial(long seed)
{
byte[] array = Pack.UInt64_To_BE((ulong)seed);
((IRandomGenerator)this).AddSeedMaterial(array);
}
// Token: 0x0600B1FC RID: 45564 RVA: 0x0026BF90 File Offset: 0x0026A190
[Token(Token = "0x600B1FC")]
[Address(RVA = "0x18A50D0", Offset = "0x18A3ED0", VA = "0x1818A50D0", Slot = "10")]
public virtual void NextBytes(byte[] bytes)
{
this.NextBytes(bytes);
}
// Token: 0x0600B1FD RID: 45565 RVA: 0x0026BFAC File Offset: 0x0026A1AC
[Token(Token = "0x600B1FD")]
[Address(RVA = "0x18A4E10", Offset = "0x18A3C10", VA = "0x1818A4E10", 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);
}
while (num != 0);
}
// Token: 0x0400715F RID: 29023
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x400715F")]
private byte n;
// Token: 0x04007160 RID: 29024
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007160")]
private byte[] P;
// Token: 0x04007161 RID: 29025
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007161")]
private byte s;
}
}
@@ -0,0 +1,222 @@
using System;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng
{
// Token: 0x02001BD0 RID: 7120
[Token(Token = "0x2001BD0")]
internal class X931Rng
{
// Token: 0x0600B1FE RID: 45566 RVA: 0x0026C0B0 File Offset: 0x0026A2B0
[Token(Token = "0x600B1FE")]
[Address(RVA = "0x18A5850", Offset = "0x18A4650", VA = "0x1818A5850")]
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: 0x0600B1FF RID: 45567 RVA: 0x0026C128 File Offset: 0x0026A328
[Token(Token = "0x600B1FF")]
[Address(RVA = "0x18A5180", Offset = "0x18A3F80", VA = "0x1818A5180")]
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: 0x0600B200 RID: 45568 RVA: 0x0026C330 File Offset: 0x0026A530
[Token(Token = "0x600B200")]
[Address(RVA = "0x18A5790", Offset = "0x18A4590", VA = "0x1818A5790")]
internal void Reseed()
{
IEntropySource entropySource = this.mEntropySource;
IBlockCipher blockCipher = this.mEngine;
this.mReseedCounter = (long)((ulong)1L);
}
// Token: 0x17001BF4 RID: 7156
// (get) Token: 0x0600B201 RID: 45569 RVA: 0x0026C368 File Offset: 0x0026A568
[Token(Token = "0x17001BF4")]
internal IEntropySource EntropySource
{
[Token(Token = "0x600B201")]
[Address(RVA = "0x3F5F40", Offset = "0x3F4D40", VA = "0x1803F5F40")]
get
{
return this.mEntropySource;
}
}
// Token: 0x0600B202 RID: 45570 RVA: 0x0026C37C File Offset: 0x0026A57C
[Token(Token = "0x600B202")]
[Address(RVA = "0x18A5690", Offset = "0x18A4490", VA = "0x1818A5690")]
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: 0x0600B203 RID: 45571 RVA: 0x0026C3A8 File Offset: 0x0026A5A8
[Token(Token = "0x600B203")]
[Address(RVA = "0x18A5640", Offset = "0x18A4440", VA = "0x1818A5640")]
private void Increment(byte[] val)
{
if (val.Length == val.Length)
{
}
}
// Token: 0x0600B204 RID: 45572 RVA: 0x0026C3CC File Offset: 0x0026A5CC
[Token(Token = "0x600B204")]
[Address(RVA = "0x1891A00", Offset = "0x1890800", VA = "0x181891A00")]
private static bool IsTooLarge(byte[] bytes, int maxBytes)
{
if (bytes == 0)
{
}
return bytes.Length > maxBytes;
}
// Token: 0x04007162 RID: 29026
[Token(Token = "0x4007162")]
private const long BLOCK64_RESEED_MAX = 32768L;
// Token: 0x04007163 RID: 29027
[Token(Token = "0x4007163")]
private const long BLOCK128_RESEED_MAX = 8388608L;
// Token: 0x04007164 RID: 29028
[Token(Token = "0x4007164")]
private const int BLOCK64_MAX_BITS_REQUEST = 4096;
// Token: 0x04007165 RID: 29029
[Token(Token = "0x4007165")]
private const int BLOCK128_MAX_BITS_REQUEST = 262144;
// Token: 0x04007166 RID: 29030
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007166")]
private readonly IBlockCipher mEngine;
// Token: 0x04007167 RID: 29031
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007167")]
private readonly IEntropySource mEntropySource;
// Token: 0x04007168 RID: 29032
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007168")]
private readonly byte[] mDT;
// Token: 0x04007169 RID: 29033
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007169")]
private readonly byte[] mI;
// Token: 0x0400716A RID: 29034
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x400716A")]
private readonly byte[] mR;
// Token: 0x0400716B RID: 29035
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x400716B")]
private byte[] mV;
// Token: 0x0400716C RID: 29036
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x400716C")]
private long mReseedCounter = (long)((ulong)1L);
}
}
@@ -0,0 +1,119 @@
using System;
using System.Threading;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng
{
// Token: 0x02001BD1 RID: 7121
[Token(Token = "0x2001BD1")]
public class X931SecureRandom : SecureRandom
{
// Token: 0x0600B205 RID: 45573 RVA: 0x0026C3E8 File Offset: 0x0026A5E8
[Token(Token = "0x600B205")]
[Address(RVA = "0x18A6150", Offset = "0x18A4F50", VA = "0x1818A6150")]
internal X931SecureRandom(SecureRandom randomSource, X931Rng drbg, bool predictionResistant)
{
int num = 0;
base..ctor(num);
this.mRandomSource = randomSource;
this.mDrbg = drbg;
this.mPredictionResistant = predictionResistant;
}
// Token: 0x0600B206 RID: 45574 RVA: 0x0026C414 File Offset: 0x0026A614
[Token(Token = "0x600B206")]
[Address(RVA = "0x18A5FF0", Offset = "0x18A4DF0", VA = "0x1818A5FF0", Slot = "11")]
public override void SetSeed(byte[] seed)
{
int num;
do
{
num = 0;
if (this.mRandomSource != 0)
{
}
Monitor.Exit(this);
}
while (num != 0);
}
// Token: 0x0600B207 RID: 45575 RVA: 0x0026C438 File Offset: 0x0026A638
[Token(Token = "0x600B207")]
[Address(RVA = "0x18A60A0", Offset = "0x18A4EA0", VA = "0x1818A60A0", 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);
}
while (num != 0);
}
// Token: 0x0600B208 RID: 45576 RVA: 0x0026C464 File Offset: 0x0026A664
[Token(Token = "0x600B208")]
[Address(RVA = "0x18A5E40", Offset = "0x18A4C40", VA = "0x1818A5E40", 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);
}
while (num != 0);
}
// Token: 0x0600B209 RID: 45577 RVA: 0x0026C50C File Offset: 0x0026A70C
[Token(Token = "0x600B209")]
[Address(RVA = "0x18A5D90", Offset = "0x18A4B90", VA = "0x1818A5D90", 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: 0x0600B20A RID: 45578 RVA: 0x0026C534 File Offset: 0x0026A734
[Token(Token = "0x600B20A")]
[Address(RVA = "0x18A5D60", Offset = "0x18A4B60", VA = "0x1818A5D60", Slot = "10")]
public override byte[] GenerateSeed(int numBytes)
{
return EntropyUtilities.GenerateSeed(this.mDrbg.mEntropySource, numBytes);
}
// Token: 0x0400716D RID: 29037
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x400716D")]
private readonly bool mPredictionResistant;
// Token: 0x0400716E RID: 29038
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x400716E")]
private readonly SecureRandom mRandomSource;
// Token: 0x0400716F RID: 29039
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x400716F")]
private readonly X931Rng mDrbg;
}
}
@@ -0,0 +1,109 @@
using System;
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: 0x02001BD2 RID: 7122
[Token(Token = "0x2001BD2")]
public class X931SecureRandomBuilder
{
// Token: 0x0600B20B RID: 45579 RVA: 0x0026C558 File Offset: 0x0026A758
[Token(Token = "0x600B20B")]
[Address(RVA = "0x18A5C20", Offset = "0x18A4A20", VA = "0x1818A5C20")]
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: 0x0600B20C RID: 45580 RVA: 0x0026C58C File Offset: 0x0026A78C
[Token(Token = "0x600B20C")]
[Address(RVA = "0x18A5CD0", Offset = "0x18A4AD0", VA = "0x1818A5CD0")]
public X931SecureRandomBuilder(SecureRandom entropySource, bool predictionResistant)
{
this.mRandom = entropySource;
BasicEntropySourceProvider basicEntropySourceProvider = new BasicEntropySourceProvider(entropySource, predictionResistant);
this.mEntropySourceProvider = basicEntropySourceProvider;
}
// Token: 0x0600B20D RID: 45581 RVA: 0x0026C5B8 File Offset: 0x0026A7B8
[Token(Token = "0x600B20D")]
[Address(RVA = "0x18A5BF0", Offset = "0x18A49F0", VA = "0x1818A5BF0")]
public X931SecureRandomBuilder(IEntropySourceProvider entropySourceProvider)
{
this.mRandom = (ulong)0L;
this.mEntropySourceProvider = entropySourceProvider;
}
// Token: 0x0600B20E RID: 45582 RVA: 0x0026C5DC File Offset: 0x0026A7DC
[Token(Token = "0x600B20E")]
[Address(RVA = "0x1872000", Offset = "0x1870E00", VA = "0x181872000")]
public X931SecureRandomBuilder SetDateTimeVector(byte[] dateTimeVector)
{
this.mDateTimeVector = dateTimeVector;
return this;
}
// Token: 0x0600B20F RID: 45583 RVA: 0x0026C5F4 File Offset: 0x0026A7F4
[Token(Token = "0x600B20F")]
[Address(RVA = "0x18A5970", Offset = "0x18A4770", VA = "0x1818A5970")]
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: 0x04007170 RID: 29040
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007170")]
private readonly SecureRandom mRandom;
// Token: 0x04007171 RID: 29041
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007171")]
private IEntropySourceProvider mEntropySourceProvider;
// Token: 0x04007172 RID: 29042
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007172")]
private byte[] mDateTimeVector;
}
}