129 lines
6.3 KiB
C#
129 lines
6.3 KiB
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng
|
|
{
|
|
// Token: 0x020015E1 RID: 5601
|
|
[Token(Token = "0x20015E1")]
|
|
[StructLayout(3)]
|
|
public class BasicEntropySourceProvider : IEntropySourceProvider
|
|
{
|
|
// Token: 0x060095D9 RID: 38361 RVA: 0x00213B38 File Offset: 0x00211D38
|
|
[Token(Token = "0x60095D9")]
|
|
[Address(RVA = "0x61CE20", Offset = "0x61B820", VA = "0x18061CE20")]
|
|
public BasicEntropySourceProvider(SecureRandom secureRandom, bool isPredictionResistant)
|
|
{
|
|
this.mSecureRandom = secureRandom;
|
|
this.mPredictionResistant = isPredictionResistant;
|
|
}
|
|
|
|
// Token: 0x060095DA RID: 38362 RVA: 0x00213B5C File Offset: 0x00211D5C
|
|
[Token(Token = "0x60095DA")]
|
|
[Address(RVA = "0x1DCE170", Offset = "0x1DCCB70", VA = "0x181DCE170", Slot = "4")]
|
|
public IEntropySource Get(int bitsRequired)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (060095DA)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IEntropySource BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng.BasicEntropySourceProvider::Get(System.Int32)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
Block_0:
|
|
stloc:SecureRandom(var_0_06, ldfld:SecureRandom(BasicEntropySourceProvider::mSecureRandom, ldloc:BasicEntropySourceProvider(this)))
|
|
stloc:bool(var_1_0D, ldfld:bool(BasicEntropySourceProvider::mPredictionResistant, ldloc:BasicEntropySourceProvider(this)))
|
|
stfld:bool(BasicEntropySource::mPredictionResistant, ldloc:BasicEntropySource(var_2), ldloc:bool(var_1_0D))
|
|
stfld:int32(BasicEntropySource::mEntropySize, ldloc:BasicEntropySource(var_2), ldloc:int32(bitsRequired))
|
|
stfld:SecureRandom(BasicEntropySource::mSecureRandom, ldloc:BasicEntropySource(var_2), ldloc:SecureRandom(var_0_06))
|
|
}
|
|
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
|
|
--- End of inner exception stack trace ---
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
|
|
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
|
|
*/;
|
|
}
|
|
|
|
// Token: 0x040062EF RID: 25327
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x40062EF")]
|
|
private readonly SecureRandom mSecureRandom;
|
|
|
|
// Token: 0x040062F0 RID: 25328
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x40062F0")]
|
|
private readonly bool mPredictionResistant;
|
|
|
|
// Token: 0x020015E2 RID: 5602
|
|
[Token(Token = "0x20015E2")]
|
|
private class BasicEntropySource : IEntropySource
|
|
{
|
|
// Token: 0x060095DB RID: 38363 RVA: 0x00213B8C File Offset: 0x00211D8C
|
|
[Token(Token = "0x60095DB")]
|
|
[Address(RVA = "0x1DCE260", Offset = "0x1DCCC60", VA = "0x181DCE260")]
|
|
internal BasicEntropySource(SecureRandom secureRandom, bool predictionResistant, int entropySize)
|
|
{
|
|
this.mSecureRandom = secureRandom;
|
|
this.mPredictionResistant = predictionResistant;
|
|
this.mEntropySize = entropySize;
|
|
}
|
|
|
|
// Token: 0x170017EF RID: 6127
|
|
// (get) Token: 0x060095DC RID: 38364 RVA: 0x00213BB4 File Offset: 0x00211DB4
|
|
[Token(Token = "0x170017EF")]
|
|
bool IEntropySource.IsPredictionResistant
|
|
{
|
|
[Token(Token = "0x60095DC")]
|
|
[Address(RVA = "0x4FBF40", Offset = "0x4FA940", VA = "0x1804FBF40", Slot = "4")]
|
|
get
|
|
{
|
|
return this.mPredictionResistant;
|
|
}
|
|
}
|
|
|
|
// Token: 0x060095DD RID: 38365 RVA: 0x00213BC8 File Offset: 0x00211DC8
|
|
[Token(Token = "0x60095DD")]
|
|
[Address(RVA = "0x1DCE1F0", Offset = "0x1DCCBF0", VA = "0x181DCE1F0", Slot = "5")]
|
|
byte[] IEntropySource.GetEntropy()
|
|
{
|
|
SecureRandom secureRandom = this.mSecureRandom;
|
|
byte[] array;
|
|
return array;
|
|
}
|
|
|
|
// Token: 0x170017F0 RID: 6128
|
|
// (get) Token: 0x060095DE RID: 38366 RVA: 0x00213BE0 File Offset: 0x00211DE0
|
|
[Token(Token = "0x170017F0")]
|
|
int IEntropySource.EntropySize
|
|
{
|
|
[Token(Token = "0x60095DE")]
|
|
[Address(RVA = "0x4F8C10", Offset = "0x4F7610", VA = "0x1804F8C10", Slot = "6")]
|
|
get
|
|
{
|
|
return this.mEntropySize;
|
|
}
|
|
}
|
|
|
|
// Token: 0x040062F1 RID: 25329
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x40062F1")]
|
|
private readonly SecureRandom mSecureRandom;
|
|
|
|
// Token: 0x040062F2 RID: 25330
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x40062F2")]
|
|
private readonly bool mPredictionResistant;
|
|
|
|
// Token: 0x040062F3 RID: 25331
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x1C")]
|
|
[Token(Token = "0x40062F3")]
|
|
private readonly int mEntropySize;
|
|
}
|
|
}
|
|
}
|