Files
Apr2020-Cpp2Il-Dump/Assembly-CSharp/BestHTTP/SecureProtocol/Org/BouncyCastle/Crypto/CipherKeyGenerator.cs
T
niko 8fc35183db a
2026-04-11 22:19:20 +02:00

138 lines
8.5 KiB
C#

using System;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto
{
// Token: 0x02001ACB RID: 6859
[Token(Token = "0x2001ACB")]
public class CipherKeyGenerator
{
// Token: 0x0600AA9A RID: 43674 RVA: 0x00254D44 File Offset: 0x00252F44
[Token(Token = "0x600AA9A")]
[Address(RVA = "0x1B35420", Offset = "0x1B34220", VA = "0x181B35420")]
public CipherKeyGenerator()
{
}
// Token: 0x0600AA9B RID: 43675 RVA: 0x00254D60 File Offset: 0x00252F60
[Token(Token = "0x600AA9B")]
[Address(RVA = "0x1B35390", Offset = "0x1B34190", VA = "0x181B35390")]
internal CipherKeyGenerator(int defaultStrength)
{
this.defaultStrength = defaultStrength;
}
// Token: 0x17001B18 RID: 6936
// (get) Token: 0x0600AA9C RID: 43676 RVA: 0x00254D94 File Offset: 0x00252F94
[Token(Token = "0x17001B18")]
public int DefaultStrength
{
[Token(Token = "0x600AA9C")]
[Address(RVA = "0x3F7310", Offset = "0x3F6110", VA = "0x1803F7310")]
get
{
return this.defaultStrength;
}
}
// Token: 0x0600AA9D RID: 43677 RVA: 0x00254DA8 File Offset: 0x00252FA8
[Token(Token = "0x600AA9D")]
[Address(RVA = "0x1B35300", Offset = "0x1B34100", VA = "0x181B35300")]
public void Init(KeyGenerationParameters parameters)
{
/*
An exception occurred when decompiling this method (0600AA9D)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.CipherKeyGenerator::Init(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.KeyGenerationParameters)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_0C:
stloc:ArgumentNullException(var_0_16, newobj:ArgumentNullException(ArgumentNullException::.ctor, ldstr:string("parameters")))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.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: 0x0600AA9E RID: 43678 RVA: 0x00254DCC File Offset: 0x00252FCC
[Token(Token = "0x600AA9E")]
[Address(RVA = "0x1B354A0", Offset = "0x1B342A0", VA = "0x181B354A0", Slot = "4")]
protected virtual void engineInit(KeyGenerationParameters parameters)
{
SecureRandom secureRandom = parameters.random;
this.random = secureRandom;
int num = parameters.strength;
num += 7;
num += parameters;
this.strength = num;
}
// Token: 0x0600AA9F RID: 43679 RVA: 0x00254E04 File Offset: 0x00253004
[Token(Token = "0x600AA9F")]
[Address(RVA = "0x1B35200", Offset = "0x1B34000", VA = "0x181B35200")]
public byte[] GenerateKey()
{
/*
An exception occurred when decompiling this method (0600AA9F)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Byte[] BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.CipherKeyGenerator::GenerateKey()
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_2C:
stloc:InvalidOperationException(var_4_36, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("Generator has not been initialised")))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.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: 0x0600AAA0 RID: 43680 RVA: 0x00254E48 File Offset: 0x00253048
[Token(Token = "0x600AAA0")]
[Address(RVA = "0x1B35430", Offset = "0x1B34230", VA = "0x181B35430", Slot = "5")]
protected virtual byte[] engineGenerateKey()
{
SecureRandom secureRandom = this.random;
int num = this.strength;
return SecureRandom.GetNextBytes(secureRandom, num);
}
// Token: 0x04006CA3 RID: 27811
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006CA3")]
protected internal SecureRandom random;
// Token: 0x04006CA4 RID: 27812
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006CA4")]
protected internal int strength;
// Token: 0x04006CA5 RID: 27813
[FieldOffset(Offset = "0x1C")]
[Token(Token = "0x4006CA5")]
private bool uninitialised = true;
// Token: 0x04006CA6 RID: 27814
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4006CA6")]
private int defaultStrength;
}
}