674 lines
27 KiB
C#
674 lines
27 KiB
C#
using System;
|
|
using System.Runtime.CompilerServices;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Rfc8032;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines
|
|
{
|
|
// Token: 0x02001C81 RID: 7297
|
|
[Token(Token = "0x2001C81")]
|
|
[Obsolete]
|
|
public class AesFastEngine : IBlockCipher
|
|
{
|
|
// Token: 0x0600B6CC RID: 46796 RVA: 0x00282280 File Offset: 0x00280480
|
|
[Token(Token = "0x600B6CC")]
|
|
[Address(RVA = "0x1A607B0", Offset = "0x1A5F5B0", VA = "0x181A607B0")]
|
|
private static uint Shift(uint r, int shift)
|
|
{
|
|
return r;
|
|
}
|
|
|
|
// Token: 0x0600B6CD RID: 46797 RVA: 0x00282290 File Offset: 0x00280490
|
|
[Token(Token = "0x600B6CD")]
|
|
[Address(RVA = "0x1A5ED00", Offset = "0x1A5DB00", VA = "0x181A5ED00")]
|
|
private static uint FFmulX(uint x)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600B6CD)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.UInt32 BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines.AesFastEngine::FFmulX(System.UInt32)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
Block_0:
|
|
stloc:int64(var_0_05, mul:uint32[exp:int64](ldloc:uint32(x), conv.u4:uint32(ldc.i4:int32[exp:uint32](27))))
|
|
}
|
|
|
|
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: 0x0600B6CE RID: 46798 RVA: 0x002822A4 File Offset: 0x002804A4
|
|
[Token(Token = "0x600B6CE")]
|
|
[Address(RVA = "0x1A5ECD0", Offset = "0x1A5DAD0", VA = "0x181A5ECD0")]
|
|
private static uint FFmulX2(uint x)
|
|
{
|
|
return x;
|
|
}
|
|
|
|
// Token: 0x0600B6CF RID: 46799 RVA: 0x002822B4 File Offset: 0x002804B4
|
|
[Token(Token = "0x600B6CF")]
|
|
[Address(RVA = "0x1A64690", Offset = "0x1A63490", VA = "0x181A64690")]
|
|
private static uint Inv_Mcol(uint x)
|
|
{
|
|
return x;
|
|
}
|
|
|
|
// Token: 0x0600B6D0 RID: 46800 RVA: 0x002822C4 File Offset: 0x002804C4
|
|
[Token(Token = "0x600B6D0")]
|
|
[Address(RVA = "0x1A648D0", Offset = "0x1A636D0", VA = "0x181A648D0")]
|
|
private static uint SubWord(uint x)
|
|
{
|
|
int length = AesFastEngine.S.Length;
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600B6D1 RID: 46801 RVA: 0x002822E4 File Offset: 0x002804E4
|
|
[Token(Token = "0x600B6D1")]
|
|
[Address(RVA = "0x1A62F50", Offset = "0x1A61D50", VA = "0x181A62F50")]
|
|
private uint[][] GenerateWorkingKey(byte[] key, bool forEncryption)
|
|
{
|
|
uint[][] array;
|
|
int i;
|
|
for (;;)
|
|
{
|
|
if (key.Length == 7)
|
|
{
|
|
this.ROUNDS = key;
|
|
array = new uint[key][];
|
|
i = 0;
|
|
uint[] array2 = new uint[4];
|
|
if (array2 != 0)
|
|
{
|
|
}
|
|
i++;
|
|
array[0] = array2;
|
|
while (i <= this.ROUNDS)
|
|
{
|
|
}
|
|
if (typeof(uint[]).TypeHandle == 0)
|
|
{
|
|
goto IL_3FB;
|
|
}
|
|
if (typeof(uint[]).TypeHandle != 0)
|
|
{
|
|
if (typeof(uint[]).TypeHandle == 0)
|
|
{
|
|
goto IL_1E5;
|
|
}
|
|
uint num;
|
|
if (typeof(uint[]).TypeHandle != 0 && typeof(uint[]).TypeHandle == num)
|
|
{
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
uint[] array3 = array[0];
|
|
array3[0] = (uint)i;
|
|
uint[] array4 = array[0];
|
|
array4[0] = array3;
|
|
uint[] array5 = array[0];
|
|
array5[1] = array4;
|
|
uint[] array6 = array[0];
|
|
array6[1] = array5;
|
|
uint[] array7 = array[1];
|
|
array7[0] = array6;
|
|
uint[] array8 = array[1];
|
|
array8[0] = array7;
|
|
uint[] array9 = array[1];
|
|
array9[1] = array8;
|
|
array[1][1] = array9;
|
|
uint num2;
|
|
num2 += num2;
|
|
uint num3 = AesFastEngine.SubWord(array9);
|
|
ulong num4;
|
|
array[(int)num4][0] = i;
|
|
array[(int)num4][0] = array3;
|
|
array[(int)num4][1] = array4;
|
|
array[(int)num4][1] = array5;
|
|
uint num5 = AesFastEngine.SubWord(array5);
|
|
ulong num6 = num4 + 1UL;
|
|
array[(int)num6][0] = array6;
|
|
array[(int)num6][0] = array7;
|
|
array[(int)num6][1] = array8;
|
|
array[(int)num6][1] = array9;
|
|
uint num7 = AesFastEngine.SubWord(array9);
|
|
array[14][0] = (uint)i;
|
|
array[14][0] = array3;
|
|
array[14][1] = array4;
|
|
uint[] array10 = array[14];
|
|
array10[1] = array5;
|
|
IL_1E5:
|
|
uint[] array11 = array[0];
|
|
array11[0] = array10;
|
|
uint[] array12 = array[0];
|
|
array12[0] = array11;
|
|
uint[] array13 = array[0];
|
|
array13[1] = array12;
|
|
uint[] array14 = array[0];
|
|
array14[1] = array13;
|
|
uint[] array15 = array[1];
|
|
array15[0] = array14;
|
|
array[1][0] = array15;
|
|
uint num8 = AesFastEngine.SubWord(array15);
|
|
array[1][1] = num8;
|
|
array[1][1] = array11;
|
|
array[2][0] = array12;
|
|
array[2][0] = array13;
|
|
array[2][1] = array14;
|
|
array[2][1] = array15;
|
|
ulong num9;
|
|
num9 += num9;
|
|
uint num10 = AesFastEngine.SubWord(array15);
|
|
uint num11;
|
|
array[(int)num11][0] = num8;
|
|
array[(int)num11][0] = array11;
|
|
array[(int)num11][1] = array12;
|
|
array[(int)num11][1] = array13;
|
|
uint num12 = num11 + 1U;
|
|
array[(int)num12][0] = array14;
|
|
array[(int)num12][0] = array15;
|
|
num9 += num9;
|
|
uint num13 = AesFastEngine.SubWord(array15);
|
|
array[(int)num12][1] = num8;
|
|
array[(int)num12][1] = array11;
|
|
num11 += (uint)2;
|
|
array[(int)num11][0] = array12;
|
|
array[(int)num11][0] = array13;
|
|
array[(int)num11][1] = array14;
|
|
uint[] array16 = array[(int)num11];
|
|
num11 += (uint)3;
|
|
array16[1] = array15;
|
|
uint num14 = AesFastEngine.SubWord(array15);
|
|
array[12][0] = num8;
|
|
array[12][0] = array11;
|
|
array[12][1] = array12;
|
|
uint[] array17 = array[12];
|
|
array17[1] = array13;
|
|
IL_3FB:
|
|
uint[] array18 = array[0];
|
|
array18[0] = array17;
|
|
uint[] array19 = array[0];
|
|
array19[0] = array18;
|
|
uint[] array20 = array[0];
|
|
array20[1] = array19;
|
|
array[0][1] = array20;
|
|
uint num15 = AesFastEngine.SubWord(array20);
|
|
byte[] array21 = AesFastEngine.rcon;
|
|
uint num17;
|
|
uint num16 = num17 - 1U;
|
|
array[(int)num17][0] = array17;
|
|
array[(int)num17][0] = array18;
|
|
array[(int)num17][1] = array19;
|
|
uint[] array22 = array[(int)num17];
|
|
num17 += (uint)1;
|
|
array22[1] = array20;
|
|
while (num17 <= (uint)10)
|
|
{
|
|
}
|
|
int num18 = 0;
|
|
uint[] array23 = array[(int)num17];
|
|
uint num19 = AesFastEngine.Inv_Mcol(array23[num18]);
|
|
num18++;
|
|
array23[0] = num19;
|
|
num17 += (uint)1;
|
|
return array;
|
|
}
|
|
|
|
// Token: 0x0600B6D2 RID: 46802 RVA: 0x002827D8 File Offset: 0x002809D8
|
|
[Token(Token = "0x600B6D2")]
|
|
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
|
|
public AesFastEngine()
|
|
{
|
|
this.Reset();
|
|
}
|
|
|
|
// Token: 0x0600B6D3 RID: 46803 RVA: 0x002827EC File Offset: 0x002809EC
|
|
[Token(Token = "0x600B6D3")]
|
|
[Address(RVA = "0x1A64580", Offset = "0x1A63380", VA = "0x181A64580", Slot = "10")]
|
|
public virtual void Init(bool forEncryption, ICipherParameters parameters)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600B6D3)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines.AesFastEngine::Init(System.Boolean,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_22:
|
|
stloc:ArgumentException(var_4_32, newobj:ArgumentException(ArgumentException::.ctor, call:string(string::Concat, ldstr:string("invalid parameter passed to AES init - "), ldloc:string(var_3))))
|
|
}
|
|
|
|
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 1663
|
|
*/;
|
|
}
|
|
|
|
// Token: 0x17001CB6 RID: 7350
|
|
// (get) Token: 0x0600B6D4 RID: 46804 RVA: 0x0028282C File Offset: 0x00280A2C
|
|
[Token(Token = "0x17001CB6")]
|
|
public virtual string AlgorithmName
|
|
{
|
|
[Token(Token = "0x600B6D4")]
|
|
[Address(RVA = "0x1A64C80", Offset = "0x1A63A80", VA = "0x181A64C80", Slot = "11")]
|
|
get
|
|
{
|
|
return "AES";
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001CB7 RID: 7351
|
|
// (get) Token: 0x0600B6D5 RID: 46805 RVA: 0x00282840 File Offset: 0x00280A40
|
|
[Token(Token = "0x17001CB7")]
|
|
public virtual bool IsPartialBlockOkay
|
|
{
|
|
[Token(Token = "0x600B6D5")]
|
|
[Address(RVA = "0x403930", Offset = "0x402730", VA = "0x180403930", Slot = "12")]
|
|
get
|
|
{
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600B6D6 RID: 46806 RVA: 0x00282850 File Offset: 0x00280A50
|
|
[Token(Token = "0x600B6D6")]
|
|
[Address(RVA = "0x4B6B10", Offset = "0x4B5910", VA = "0x1804B6B10", Slot = "13")]
|
|
public virtual int GetBlockSize()
|
|
{
|
|
return 16;
|
|
}
|
|
|
|
// Token: 0x0600B6D7 RID: 46807 RVA: 0x00282860 File Offset: 0x00280A60
|
|
[Token(Token = "0x600B6D7")]
|
|
[Address(RVA = "0x1A64750", Offset = "0x1A63550", VA = "0x181A64750", Slot = "14")]
|
|
public virtual int ProcessBlock(byte[] input, int inOff, byte[] output, int outOff)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600B6D7)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int32 BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines.AesFastEngine::ProcessBlock(System.Byte[],System.Int32,System.Byte[],System.Int32)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_5D:
|
|
stloc:InvalidOperationException(var_7_67, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("AES 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.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 1663
|
|
*/;
|
|
}
|
|
|
|
// Token: 0x0600B6D8 RID: 46808 RVA: 0x0000220F File Offset: 0x0000040F
|
|
[Token(Token = "0x600B6D8")]
|
|
[Address(RVA = "0x402080", Offset = "0x400E80", VA = "0x180402080", Slot = "15")]
|
|
public virtual void Reset()
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x0600B6D9 RID: 46809 RVA: 0x002828D8 File Offset: 0x00280AD8
|
|
[Token(Token = "0x600B6D9")]
|
|
[Address(RVA = "0x1A608F0", Offset = "0x1A5F6F0", VA = "0x181A608F0")]
|
|
private void UnPackBlock(byte[] bytes, int off)
|
|
{
|
|
}
|
|
|
|
// Token: 0x0600B6DA RID: 46810 RVA: 0x002828E8 File Offset: 0x00280AE8
|
|
[Token(Token = "0x600B6DA")]
|
|
[Address(RVA = "0x1A605C0", Offset = "0x1A5F3C0", VA = "0x181A605C0")]
|
|
private void PackBlock(byte[] bytes, int off)
|
|
{
|
|
Ed25519.Encode32(this.C0, bytes, off);
|
|
Ed25519.Encode32(this.C1, bytes, off);
|
|
Ed25519.Encode32(this.C2, bytes, off);
|
|
Ed25519.Encode32(this.C3, bytes, off);
|
|
}
|
|
|
|
// Token: 0x0600B6DB RID: 46811 RVA: 0x0028292C File Offset: 0x00280B2C
|
|
[Token(Token = "0x600B6DB")]
|
|
[Address(RVA = "0x1A61D00", Offset = "0x1A60B00", VA = "0x181A61D00")]
|
|
private void EncryptBlock(uint[][] KW)
|
|
{
|
|
int length = KW.Length;
|
|
uint[] array = KW[0];
|
|
int length2 = array.Length;
|
|
uint num = array[0];
|
|
uint num2 = array[0];
|
|
uint num3 = array[1];
|
|
uint num4 = array[1];
|
|
if (array > (uint)1)
|
|
{
|
|
uint[] t = AesFastEngine.T0;
|
|
int length3 = t.Length;
|
|
uint[] t2 = AesFastEngine.T1;
|
|
int length4 = t2.Length;
|
|
uint[] t3 = AesFastEngine.T2;
|
|
int length5 = t3.Length;
|
|
num2 = num3;
|
|
num = num2;
|
|
uint[] t4 = AesFastEngine.T3;
|
|
int length6 = t4.Length;
|
|
uint[] array2;
|
|
int length7 = array2.Length;
|
|
num2 = num;
|
|
uint num5 = t4[(int)num2];
|
|
num2 = num4;
|
|
num = num2;
|
|
uint num6 = t4[(int)num];
|
|
num2 = num4;
|
|
num = num2;
|
|
int length8 = t4.Length;
|
|
uint num7 = t4[(int)num];
|
|
int length9 = t.Length;
|
|
int length10 = t3.Length;
|
|
uint num8 = t4[(int)num3];
|
|
uint num9;
|
|
num9 += (uint)1;
|
|
int length11 = t2.Length;
|
|
num5 = num6;
|
|
num4 = num5;
|
|
int length12 = t4.Length;
|
|
num5 = num4;
|
|
uint num10 = t3[(int)num5];
|
|
int length13 = t.Length;
|
|
num5 = num8;
|
|
uint num11 = t3[(int)num5];
|
|
num5 = num6;
|
|
uint num12 = t2[(int)num5];
|
|
num = num5;
|
|
}
|
|
uint[] t5 = AesFastEngine.T0;
|
|
int length14 = t5.Length;
|
|
uint num13 = t5[(int)num];
|
|
uint[] t6 = AesFastEngine.T1;
|
|
int length15 = t6.Length;
|
|
num13 = num2;
|
|
uint num14 = t6[(int)num13];
|
|
uint[] t7 = AesFastEngine.T2;
|
|
int length16 = t7.Length;
|
|
num14 = num3;
|
|
uint[] t8 = AesFastEngine.T3;
|
|
uint num15 = t7[(int)num14];
|
|
int length17 = t8.Length;
|
|
num15 = num4;
|
|
uint num16 = t8[(int)num15];
|
|
uint[] array3;
|
|
int length18 = array3.Length;
|
|
uint num17 = array3[0];
|
|
num16 = num2;
|
|
uint num18 = t5[(int)num16];
|
|
num16 = num3;
|
|
uint num19 = t6[(int)num16];
|
|
num19 = num4;
|
|
num16 = num19;
|
|
uint num20 = t7[(int)num16];
|
|
uint num21 = t8[(int)num];
|
|
uint num22 = array3[0];
|
|
num21 = num3;
|
|
uint num23 = t5[(int)num21];
|
|
num23 = num4;
|
|
num21 = num23;
|
|
uint num24 = t6[(int)num21];
|
|
num = num2;
|
|
int length19 = t8.Length;
|
|
uint num25 = t8[(int)num];
|
|
uint num26 = array3[1];
|
|
uint num27 = array3[1];
|
|
uint num28;
|
|
num28 += (uint)1;
|
|
int length20 = AesFastEngine.S.Length;
|
|
int length21 = AesFastEngine.S.Length;
|
|
int length22 = AesFastEngine.S.Length;
|
|
int length23 = AesFastEngine.S.Length;
|
|
}
|
|
|
|
// Token: 0x0600B6DC RID: 46812 RVA: 0x00282C30 File Offset: 0x00280E30
|
|
[Token(Token = "0x600B6DC")]
|
|
[Address(RVA = "0x1A60AD0", Offset = "0x1A5F8D0", VA = "0x181A60AD0")]
|
|
private void DecryptBlock(uint[][] KW)
|
|
{
|
|
int length = KW.Length;
|
|
uint[] array;
|
|
int length2 = array.Length;
|
|
uint num = array[0];
|
|
uint num2 = array[0];
|
|
uint num3 = array[1];
|
|
if (array > (ulong)1L)
|
|
{
|
|
uint[] array2 = KW[array];
|
|
uint[] tinv = AesFastEngine.Tinv0;
|
|
int length3 = tinv.Length;
|
|
int length4 = AesFastEngine.Tinv1.Length;
|
|
uint[] tinv2 = AesFastEngine.Tinv2;
|
|
int length5 = tinv2.Length;
|
|
num = num3;
|
|
uint[] tinv3 = AesFastEngine.Tinv3;
|
|
int length6 = tinv3.Length;
|
|
int length7 = array2.Length;
|
|
num3 = num;
|
|
uint num4 = tinv3[(int)num3];
|
|
num3 = num;
|
|
num = num3;
|
|
uint num5 = tinv3[(int)num];
|
|
num3 = num2;
|
|
int length8 = tinv3.Length;
|
|
num = num3;
|
|
uint num6 = tinv3[(int)num];
|
|
int length9 = tinv.Length;
|
|
int length10 = tinv2.Length;
|
|
uint num7 = tinv3[(int)num];
|
|
int length11 = tinv3.Length;
|
|
uint num8 = tinv3[(int)num5];
|
|
num4 = num7;
|
|
num8 = num4;
|
|
uint num9 = tinv2[(int)num8];
|
|
num3 = num7;
|
|
}
|
|
uint[] array3 = KW[1];
|
|
uint[] tinv4 = AesFastEngine.Tinv0;
|
|
int length12 = tinv4.Length;
|
|
uint num10 = tinv4[(int)num];
|
|
uint[] tinv5 = AesFastEngine.Tinv1;
|
|
int length13 = tinv5.Length;
|
|
num10 = num3;
|
|
uint num11 = tinv5[(int)num10];
|
|
uint[] tinv6 = AesFastEngine.Tinv2;
|
|
int length14 = tinv6.Length;
|
|
uint[] tinv7 = AesFastEngine.Tinv3;
|
|
uint num12 = tinv6[(int)num11];
|
|
num12 = num2;
|
|
uint num13 = tinv7[(int)num12];
|
|
int length15 = array3.Length;
|
|
uint num14 = array3[0];
|
|
num13 = num2;
|
|
uint num15 = tinv4[(int)num13];
|
|
num13 = num;
|
|
uint num16 = tinv5[(int)num13];
|
|
num16 = num3;
|
|
num13 = num16;
|
|
uint num17 = tinv6[(int)num13];
|
|
uint num18 = tinv7[(int)num17];
|
|
uint num19 = array3[0];
|
|
uint num20 = tinv4[(int)num18];
|
|
num18 = num2;
|
|
uint num21 = tinv5[(int)num18];
|
|
int length16 = tinv7.Length;
|
|
num = num3;
|
|
uint num22 = tinv7[(int)num];
|
|
uint num23 = array3[1];
|
|
uint num24 = array3[1];
|
|
int length17 = AesFastEngine.Si.Length;
|
|
int length18 = AesFastEngine.Si.Length;
|
|
int length19 = AesFastEngine.Si.Length;
|
|
int length20 = AesFastEngine.Si.Length;
|
|
}
|
|
|
|
// Token: 0x0600B6DD RID: 46813 RVA: 0x00282EEC File Offset: 0x002810EC
|
|
// Note: this type is marked as 'beforefieldinit'.
|
|
[Token(Token = "0x600B6DD")]
|
|
[Address(RVA = "0x1A649F0", Offset = "0x1A637F0", VA = "0x181A649F0")]
|
|
static AesFastEngine()
|
|
{
|
|
byte[] array = new byte[256];
|
|
RuntimeHelpers.InitializeArray(array, fieldof(<PrivateImplementationDetails>.8F22C9ECE1331718CBD268A9BBFD2F5E451441E3).FieldHandle);
|
|
AesFastEngine.S = array;
|
|
byte[] array2 = new byte[256];
|
|
RuntimeHelpers.InitializeArray(array2, fieldof(<PrivateImplementationDetails>.0C4110BC17D746F018F47B49E0EB0D6590F69939).FieldHandle);
|
|
AesFastEngine.Si = array2;
|
|
byte[] array3 = new byte[30];
|
|
RuntimeHelpers.InitializeArray(array3, fieldof(<PrivateImplementationDetails>.B8DB0CB599EDD82A386D1A154FB3EB9235513DAD).FieldHandle);
|
|
AesFastEngine.rcon = array3;
|
|
uint[] array4 = new uint[256];
|
|
RuntimeHelpers.InitializeArray(array4, fieldof(<PrivateImplementationDetails>.B68637EF60D499620B99E336C59E4865FFC4C5D7).FieldHandle);
|
|
AesFastEngine.T0 = array4;
|
|
uint[] array5 = new uint[256];
|
|
RuntimeHelpers.InitializeArray(array5, fieldof(<PrivateImplementationDetails>.102C522344FCAC1545BDA50C0FC675C502FFEC53).FieldHandle);
|
|
AesFastEngine.T1 = array5;
|
|
uint[] array6 = new uint[256];
|
|
RuntimeHelpers.InitializeArray(array6, fieldof(<PrivateImplementationDetails>.29EC5E8FCA12DB9EC0B5E6D2DE67B624D2E2372C).FieldHandle);
|
|
AesFastEngine.T2 = array6;
|
|
uint[] array7 = new uint[256];
|
|
RuntimeHelpers.InitializeArray(array7, fieldof(<PrivateImplementationDetails>.95CA85749ADCFBF9A2B82C0381DBCF95D175524C).FieldHandle);
|
|
AesFastEngine.T3 = array7;
|
|
uint[] array8 = new uint[256];
|
|
RuntimeHelpers.InitializeArray(array8, fieldof(<PrivateImplementationDetails>.1AFB455399A50580CF1039188ABA6BE82F309543).FieldHandle);
|
|
AesFastEngine.Tinv0 = array8;
|
|
uint[] array9 = new uint[256];
|
|
RuntimeHelpers.InitializeArray(array9, fieldof(<PrivateImplementationDetails>.D9C221237B647EC215A7BCDED447349810E6BF9C).FieldHandle);
|
|
AesFastEngine.Tinv1 = array9;
|
|
uint[] array10 = new uint[256];
|
|
RuntimeHelpers.InitializeArray(array10, fieldof(<PrivateImplementationDetails>.E43F6BA634642FB90FEEE1A8F9905E957741960C).FieldHandle);
|
|
AesFastEngine.Tinv2 = array10;
|
|
uint[] array11 = new uint[256];
|
|
RuntimeHelpers.InitializeArray(array11, fieldof(<PrivateImplementationDetails>.04D2A79C8A779AFAA779125335E9334C245EBB46).FieldHandle);
|
|
AesFastEngine.Tinv3 = array11;
|
|
}
|
|
|
|
// Token: 0x040073DB RID: 29659
|
|
[Token(Token = "0x40073DB")]
|
|
private static readonly byte[] S;
|
|
|
|
// Token: 0x040073DC RID: 29660
|
|
[Token(Token = "0x40073DC")]
|
|
private static readonly byte[] Si;
|
|
|
|
// Token: 0x040073DD RID: 29661
|
|
[Token(Token = "0x40073DD")]
|
|
private static readonly byte[] rcon;
|
|
|
|
// Token: 0x040073DE RID: 29662
|
|
[Token(Token = "0x40073DE")]
|
|
private static readonly uint[] T0;
|
|
|
|
// Token: 0x040073DF RID: 29663
|
|
[Token(Token = "0x40073DF")]
|
|
private static readonly uint[] T1;
|
|
|
|
// Token: 0x040073E0 RID: 29664
|
|
[Token(Token = "0x40073E0")]
|
|
private static readonly uint[] T2;
|
|
|
|
// Token: 0x040073E1 RID: 29665
|
|
[Token(Token = "0x40073E1")]
|
|
private static readonly uint[] T3;
|
|
|
|
// Token: 0x040073E2 RID: 29666
|
|
[Token(Token = "0x40073E2")]
|
|
private static readonly uint[] Tinv0;
|
|
|
|
// Token: 0x040073E3 RID: 29667
|
|
[Token(Token = "0x40073E3")]
|
|
private static readonly uint[] Tinv1;
|
|
|
|
// Token: 0x040073E4 RID: 29668
|
|
[Token(Token = "0x40073E4")]
|
|
private static readonly uint[] Tinv2;
|
|
|
|
// Token: 0x040073E5 RID: 29669
|
|
[Token(Token = "0x40073E5")]
|
|
private static readonly uint[] Tinv3;
|
|
|
|
// Token: 0x040073E6 RID: 29670
|
|
[Token(Token = "0x40073E6")]
|
|
private const uint m1 = 2155905152U;
|
|
|
|
// Token: 0x040073E7 RID: 29671
|
|
[Token(Token = "0x40073E7")]
|
|
private const uint m2 = 2139062143U;
|
|
|
|
// Token: 0x040073E8 RID: 29672
|
|
[Token(Token = "0x40073E8")]
|
|
private const uint m3 = 27U;
|
|
|
|
// Token: 0x040073E9 RID: 29673
|
|
[Token(Token = "0x40073E9")]
|
|
private const uint m4 = 3233857728U;
|
|
|
|
// Token: 0x040073EA RID: 29674
|
|
[Token(Token = "0x40073EA")]
|
|
private const uint m5 = 1061109567U;
|
|
|
|
// Token: 0x040073EB RID: 29675
|
|
[FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x40073EB")]
|
|
private int ROUNDS;
|
|
|
|
// Token: 0x040073EC RID: 29676
|
|
[FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x40073EC")]
|
|
private uint[][] WorkingKey;
|
|
|
|
// Token: 0x040073ED RID: 29677
|
|
[FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x40073ED")]
|
|
private uint C0;
|
|
|
|
// Token: 0x040073EE RID: 29678
|
|
[FieldOffset(Offset = "0x24")]
|
|
[Token(Token = "0x40073EE")]
|
|
private uint C1;
|
|
|
|
// Token: 0x040073EF RID: 29679
|
|
[FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x40073EF")]
|
|
private uint C2;
|
|
|
|
// Token: 0x040073F0 RID: 29680
|
|
[FieldOffset(Offset = "0x2C")]
|
|
[Token(Token = "0x40073F0")]
|
|
private uint C3;
|
|
|
|
// Token: 0x040073F1 RID: 29681
|
|
[FieldOffset(Offset = "0x30")]
|
|
[Token(Token = "0x40073F1")]
|
|
private bool forEncryption;
|
|
|
|
// Token: 0x040073F2 RID: 29682
|
|
[Token(Token = "0x40073F2")]
|
|
private const int BLOCK_SIZE = 16;
|
|
}
|
|
}
|