Files
2026-04-08 23:40:05 +02:00

314 lines
14 KiB
C#

using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines
{
// Token: 0x020016CB RID: 5835
[Token(Token = "0x20016CB")]
[StructLayout(3)]
public class SeedEngine : IBlockCipher
{
// Token: 0x06009CC0 RID: 40128 RVA: 0x0023993C File Offset: 0x00237B3C
[Token(Token = "0x6009CC0")]
[Address(RVA = "0x2101BF0", Offset = "0x21005F0", VA = "0x182101BF0", Slot = "10")]
public virtual void Init(bool forEncryption, ICipherParameters parameters)
{
do
{
this.forEncryption = forEncryption;
}
while (parameters == 0 || parameters == 0);
byte[] array2;
int[] array = this.createWorkingKey(array2);
this.wKey = array;
}
// Token: 0x170018EB RID: 6379
// (get) Token: 0x06009CC1 RID: 40129 RVA: 0x00239974 File Offset: 0x00237B74
[Token(Token = "0x170018EB")]
public virtual string AlgorithmName
{
[Token(Token = "0x6009CC1")]
[Address(RVA = "0x2102490", Offset = "0x2100E90", VA = "0x182102490", Slot = "11")]
get
{
return "SEED";
}
}
// Token: 0x170018EC RID: 6380
// (get) Token: 0x06009CC2 RID: 40130 RVA: 0x00239988 File Offset: 0x00237B88
[Token(Token = "0x170018EC")]
public virtual bool IsPartialBlockOkay
{
[Token(Token = "0x6009CC2")]
[Address(RVA = "0x413970", Offset = "0x412370", VA = "0x180413970", Slot = "12")]
get
{
}
}
// Token: 0x06009CC3 RID: 40131 RVA: 0x00239998 File Offset: 0x00237B98
[Token(Token = "0x6009CC3")]
[Address(RVA = "0x11B1BB0", Offset = "0x11B05B0", VA = "0x1811B1BB0", Slot = "13")]
public virtual int GetBlockSize()
{
return 16;
}
// Token: 0x06009CC4 RID: 40132 RVA: 0x002399A8 File Offset: 0x00237BA8
[Token(Token = "0x6009CC4")]
[Address(RVA = "0x2101CF0", Offset = "0x21006F0", VA = "0x182101CF0", Slot = "14")]
public virtual int ProcessBlock(byte[] inBuf, int inOff, byte[] outBuf, int outOff)
{
/*
An exception occurred when decompiling this method (06009CC4)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int32 BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines.SeedEngine::ProcessBlock(System.Byte[],System.Int32,System.Byte[],System.Int32)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_B1:
stloc:InvalidOperationException(var_18_BB, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("SEED engine not 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 1663
*/;
}
// Token: 0x06009CC5 RID: 40133 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x6009CC5")]
[Address(RVA = "0x3C9F60", Offset = "0x3C8960", VA = "0x1803C9F60", Slot = "15")]
public virtual void Reset()
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x06009CC6 RID: 40134 RVA: 0x00239A74 File Offset: 0x00237C74
[Token(Token = "0x6009CC6")]
[Address(RVA = "0x21021C0", Offset = "0x2100BC0", VA = "0x1821021C0")]
private int[] createWorkingKey(byte[] inKey)
{
int[] array = new int[32];
int i = 0;
int length = inKey.Length;
i++;
byte b;
i += (int)b;
while (i <= 7)
{
}
i += 8;
i++;
byte b2 = (byte)((int)b2 + i);
while (i <= 7)
{
}
uint[] kc = SeedEngine.KC;
b2 = (byte)((int)b2 + i);
int num = this.G((int)b2);
array[0] = num;
uint[] kc2 = SeedEngine.KC;
i++;
int num2;
array[0] = num2;
if (i != 1)
{
}
i++;
i += 2;
return array;
}
// Token: 0x06009CC7 RID: 40135 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x6009CC7")]
[Address(RVA = "0x4577C0", Offset = "0x4561C0", VA = "0x1804577C0")]
private int extractW1(long lVal)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x06009CC8 RID: 40136 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x6009CC8")]
[Address(RVA = "0x2102480", Offset = "0x2100E80", VA = "0x182102480")]
private int extractW0(long lVal)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x06009CC9 RID: 40137 RVA: 0x00239AF8 File Offset: 0x00237CF8
[Token(Token = "0x6009CC9")]
[Address(RVA = "0x21025D0", Offset = "0x2100FD0", VA = "0x1821025D0")]
private long rotateLeft8(long x)
{
return x;
}
// Token: 0x06009CCA RID: 40138 RVA: 0x00239B08 File Offset: 0x00237D08
[Token(Token = "0x6009CCA")]
[Address(RVA = "0x21025E0", Offset = "0x2100FE0", VA = "0x1821025E0")]
private long rotateRight8(long x)
{
return x;
}
// Token: 0x06009CCB RID: 40139 RVA: 0x00239B18 File Offset: 0x00237D18
[Token(Token = "0x6009CCB")]
[Address(RVA = "0x2102160", Offset = "0x2100B60", VA = "0x182102160")]
private long bytesToLong(byte[] src, int srcOff)
{
int num = 0;
byte b;
num += (int)b;
while (srcOff <= 7)
{
}
throw new NullReferenceException();
}
// Token: 0x06009CCC RID: 40140 RVA: 0x00239B34 File Offset: 0x00237D34
[Token(Token = "0x6009CCC")]
[Address(RVA = "0x21024C0", Offset = "0x2100EC0", VA = "0x1821024C0")]
private void longToBytes(byte[] dest, int destOff, long value)
{
}
// Token: 0x06009CCD RID: 40141 RVA: 0x00239B48 File Offset: 0x00237D48
[Token(Token = "0x6009CCD")]
[Address(RVA = "0x2101AD0", Offset = "0x21004D0", VA = "0x182101AD0")]
private int G(int x)
{
uint[] ss = SeedEngine.SS0;
uint[] ss2 = SeedEngine.SS1;
uint[] ss3 = SeedEngine.SS2;
uint num = SeedEngine.SS3[x];
throw new NullReferenceException();
}
// Token: 0x06009CCE RID: 40142 RVA: 0x00239B78 File Offset: 0x00237D78
[Token(Token = "0x6009CCE")]
[Address(RVA = "0x2101A00", Offset = "0x2100400", VA = "0x182101A00")]
private long F(int ki0, int ki1, long r)
{
/*
An exception occurred when decompiling this method (06009CCE)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int64 BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines.SeedEngine::F(System.Int32,System.Int32,System.Int64)
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:int32(var_0_07, call:int32(SeedEngine::G, ldloc:SeedEngine(this), ldloc:int64[exp:int32](r)))
stloc:int32(var_1_0F, call:int32(SeedEngine::G, ldloc:SeedEngine(this), ldloc:int64[exp:int32](r)))
stloc:int32(var_2_17, call:int32(SeedEngine::G, ldloc:SeedEngine(this), ldloc:int64[exp:int32](r)))
stloc:int32(var_1_1F, call:int32(SeedEngine::G, ldloc:SeedEngine(this), ldloc:int64[exp:int32](r)))
stloc:int32(var_3_27, call:int32(SeedEngine::G, ldloc:SeedEngine(this), ldloc:int64[exp:int32](r)))
stloc:int32(var_4_2F, call:int32(SeedEngine::G, ldloc:SeedEngine(this), ldloc:int64[exp:int32](r)))
stloc:int32(var_4_35, add:int32(ldloc:int32(var_4_2F), ldloc:int32(var_1_1F)))
}
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: 0x06009CCF RID: 40143 RVA: 0x00239BBC File Offset: 0x00237DBC
[Token(Token = "0x6009CCF")]
[Address(RVA = "0x2102520", Offset = "0x2100F20", VA = "0x182102520")]
private int phaseCalc1(int r0, int ki0, int r1, int ki1)
{
int num = this.G(r0);
return this.G(r0);
}
// Token: 0x06009CD0 RID: 40144 RVA: 0x00239BD8 File Offset: 0x00237DD8
[Token(Token = "0x6009CD0")]
[Address(RVA = "0x2102560", Offset = "0x2100F60", VA = "0x182102560")]
private int phaseCalc2(int r0, int ki0, int r1, int ki1)
{
int num = this.G(r0);
int num2 = this.G(r0);
int num3 = this.G(r0);
return this.G(r0);
}
// Token: 0x06009CD1 RID: 40145 RVA: 0x00239C04 File Offset: 0x00237E04
[Token(Token = "0x6009CD1")]
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
public SeedEngine()
{
this.Reset();
}
// Token: 0x06009CD2 RID: 40146 RVA: 0x00239C18 File Offset: 0x00237E18
// Note: this type is marked as 'beforefieldinit'.
[Token(Token = "0x6009CD2")]
[Address(RVA = "0x2102020", Offset = "0x2100A20", VA = "0x182102020")]
static SeedEngine()
{
uint[] array = new uint[256];
RuntimeHelpers.InitializeArray(array, fieldof(<PrivateImplementationDetails>.D9642D3FF9879EC5C4BB28AE7001CEE3D43956AB).FieldHandle);
SeedEngine.SS0 = array;
uint[] array2 = new uint[256];
RuntimeHelpers.InitializeArray(array2, fieldof(<PrivateImplementationDetails>.8C7FEE53346CDB1B119FCAD8D605F476400A03CE).FieldHandle);
SeedEngine.SS1 = array2;
uint[] array3 = new uint[256];
RuntimeHelpers.InitializeArray(array3, fieldof(<PrivateImplementationDetails>.EEDBCB52C67688DE5F5FD9209E8A25BC786A2430).FieldHandle);
SeedEngine.SS2 = array3;
uint[] array4 = new uint[256];
RuntimeHelpers.InitializeArray(array4, fieldof(<PrivateImplementationDetails>.F8AB5CA414AD9084F3E8B8D887217E6DFC32C62C).FieldHandle);
SeedEngine.SS3 = array4;
uint[] array5 = new uint[16];
RuntimeHelpers.InitializeArray(array5, fieldof(<PrivateImplementationDetails>.641D0D9E9CE6DDAC3F12536417A6A64C8DDD4776).FieldHandle);
SeedEngine.KC = array5;
}
// Token: 0x040066C3 RID: 26307
[Token(Token = "0x40066C3")]
private const int BlockSize = 16;
// Token: 0x040066C4 RID: 26308
[Token(Token = "0x40066C4")]
private static readonly uint[] SS0;
// Token: 0x040066C5 RID: 26309
[Token(Token = "0x40066C5")]
private static readonly uint[] SS1;
// Token: 0x040066C6 RID: 26310
[Token(Token = "0x40066C6")]
private static readonly uint[] SS2;
// Token: 0x040066C7 RID: 26311
[Token(Token = "0x40066C7")]
private static readonly uint[] SS3;
// Token: 0x040066C8 RID: 26312
[Token(Token = "0x40066C8")]
private static readonly uint[] KC;
// Token: 0x040066C9 RID: 26313
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x40066C9")]
private int[] wKey;
// Token: 0x040066CA RID: 26314
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x40066CA")]
private bool forEncryption;
}
}