Files
27Aug2021-Cpp2IL-Dump/Assembly-CSharp/BestHTTP/SecureProtocol/Org/BouncyCastle/Crypto/Prng/BasicEntropySourceProvider.cs
T
niko c12fbe3fc6 m
2026-04-12 16:51:38 +02:00

127 lines
6.2 KiB
C#

using System;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng
{
// Token: 0x02001C9E RID: 7326
[Token(Token = "0x2001C9E")]
public class BasicEntropySourceProvider : IEntropySourceProvider
{
// Token: 0x0600B581 RID: 46465 RVA: 0x00274368 File Offset: 0x00272568
[Token(Token = "0x600B581")]
[Address(RVA = "0x741C60", Offset = "0x740C60", VA = "0x180741C60")]
public BasicEntropySourceProvider(SecureRandom secureRandom, bool isPredictionResistant)
{
this.mSecureRandom = secureRandom;
this.mPredictionResistant = isPredictionResistant;
}
// Token: 0x0600B582 RID: 46466 RVA: 0x0027438C File Offset: 0x0027258C
[Token(Token = "0x600B582")]
[Address(RVA = "0x2351430", Offset = "0x2350430", VA = "0x182351430", Slot = "4")]
public IEntropySource Get(int bitsRequired)
{
/*
An exception occurred when decompiling this method (0600B582)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IEntropySource BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng.BasicEntropySourceProvider::Get(System.Int32)
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:SecureRandom(var_0_06, ldfld:SecureRandom(BasicEntropySourceProvider::mSecureRandom, ldloc:BasicEntropySourceProvider(this)))
stloc:bool(var_1_0D, ldfld:bool(BasicEntropySourceProvider::mPredictionResistant, ldloc:BasicEntropySourceProvider(this)))
stfld:bool(BasicEntropySource::mPredictionResistant, ldloc:BasicEntropySource(var_2), ldloc:bool(var_1_0D))
stfld:int32(BasicEntropySource::mEntropySize, ldloc:BasicEntropySource(var_2), ldloc:int32(bitsRequired))
stfld:SecureRandom(BasicEntropySource::mSecureRandom, ldloc:BasicEntropySource(var_2), ldloc:SecureRandom(var_0_06))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x040072EB RID: 29419
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40072EB")]
private readonly SecureRandom mSecureRandom;
// Token: 0x040072EC RID: 29420
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40072EC")]
private readonly bool mPredictionResistant;
// Token: 0x02001C9F RID: 7327
[Token(Token = "0x2001C9F")]
private class BasicEntropySource : IEntropySource
{
// Token: 0x0600B583 RID: 46467 RVA: 0x002743BC File Offset: 0x002725BC
[Token(Token = "0x600B583")]
[Address(RVA = "0x2351520", Offset = "0x2350520", VA = "0x182351520")]
internal BasicEntropySource(SecureRandom secureRandom, bool predictionResistant, int entropySize)
{
this.mSecureRandom = secureRandom;
this.mPredictionResistant = predictionResistant;
this.mEntropySize = entropySize;
}
// Token: 0x17001C8D RID: 7309
// (get) Token: 0x0600B584 RID: 46468 RVA: 0x002743E4 File Offset: 0x002725E4
[Token(Token = "0x17001C8D")]
bool IEntropySource.IsPredictionResistant
{
[Token(Token = "0x600B584")]
[Address(RVA = "0x497570", Offset = "0x496570", VA = "0x180497570", Slot = "4")]
get
{
return this.mPredictionResistant;
}
}
// Token: 0x0600B585 RID: 46469 RVA: 0x002743F8 File Offset: 0x002725F8
[Token(Token = "0x600B585")]
[Address(RVA = "0x23514B0", Offset = "0x23504B0", VA = "0x1823514B0", Slot = "5")]
byte[] IEntropySource.GetEntropy()
{
SecureRandom secureRandom = this.mSecureRandom;
byte[] array;
return array;
}
// Token: 0x17001C8E RID: 7310
// (get) Token: 0x0600B586 RID: 46470 RVA: 0x00274410 File Offset: 0x00272610
[Token(Token = "0x17001C8E")]
int IEntropySource.EntropySize
{
[Token(Token = "0x600B586")]
[Address(RVA = "0x497590", Offset = "0x496590", VA = "0x180497590", Slot = "6")]
get
{
return this.mEntropySize;
}
}
// Token: 0x040072ED RID: 29421
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40072ED")]
private readonly SecureRandom mSecureRandom;
// Token: 0x040072EE RID: 29422
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40072EE")]
private readonly bool mPredictionResistant;
// Token: 0x040072EF RID: 29423
[FieldOffset(Offset = "0x1C")]
[Token(Token = "0x40072EF")]
private readonly int mEntropySize;
}
}
}