638 lines
24 KiB
C#
638 lines
24 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: 0x02001D60 RID: 7520
|
|
[Token(Token = "0x2001D60")]
|
|
public class AesEngine : IBlockCipher
|
|
{
|
|
// Token: 0x0600BA88 RID: 47752 RVA: 0x0028A6A4 File Offset: 0x002888A4
|
|
[Token(Token = "0x600BA88")]
|
|
[Address(RVA = "0x1030AC0", Offset = "0x102FAC0", VA = "0x181030AC0")]
|
|
private static uint Shift(uint r, int shift)
|
|
{
|
|
return r;
|
|
}
|
|
|
|
// Token: 0x0600BA89 RID: 47753 RVA: 0x0028A6B4 File Offset: 0x002888B4
|
|
[Token(Token = "0x600BA89")]
|
|
[Address(RVA = "0x248D8D0", Offset = "0x248C8D0", VA = "0x18248D8D0")]
|
|
private static uint FFmulX(uint x)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600BA89)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.UInt32 BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines.AesEngine::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: 0x0600BA8A RID: 47754 RVA: 0x0028A6C8 File Offset: 0x002888C8
|
|
[Token(Token = "0x600BA8A")]
|
|
[Address(RVA = "0x248D8A0", Offset = "0x248C8A0", VA = "0x18248D8A0")]
|
|
private static uint FFmulX2(uint x)
|
|
{
|
|
return x;
|
|
}
|
|
|
|
// Token: 0x0600BA8B RID: 47755 RVA: 0x0028A6D8 File Offset: 0x002888D8
|
|
[Token(Token = "0x600BA8B")]
|
|
[Address(RVA = "0x248F0D0", Offset = "0x248E0D0", VA = "0x18248F0D0")]
|
|
private static uint Inv_Mcol(uint x)
|
|
{
|
|
return x;
|
|
}
|
|
|
|
// Token: 0x0600BA8C RID: 47756 RVA: 0x0028A6E8 File Offset: 0x002888E8
|
|
[Token(Token = "0x600BA8C")]
|
|
[Address(RVA = "0x248F380", Offset = "0x248E380", VA = "0x18248F380")]
|
|
private static uint SubWord(uint x)
|
|
{
|
|
int length = AesEngine.S.Length;
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600BA8D RID: 47757 RVA: 0x0028A708 File Offset: 0x00288908
|
|
[Token(Token = "0x600BA8D")]
|
|
[Address(RVA = "0x248D8F0", Offset = "0x248C8F0", VA = "0x18248D8F0")]
|
|
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.rcon)
|
|
{
|
|
}
|
|
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 = AesEngine.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 = AesEngine.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 = AesEngine.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 = AesEngine.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 = AesEngine.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 = AesEngine.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 = AesEngine.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 = AesEngine.SubWord(array20);
|
|
byte[] array21 = AesEngine.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 = AesEngine.Inv_Mcol(array23[num18]);
|
|
num18++;
|
|
array23[0] = num19;
|
|
num17 += (uint)1;
|
|
return array;
|
|
}
|
|
|
|
// Token: 0x0600BA8E RID: 47758 RVA: 0x0028ABFC File Offset: 0x00288DFC
|
|
[Token(Token = "0x600BA8E")]
|
|
[Address(RVA = "0x412370", Offset = "0x411370", VA = "0x180412370")]
|
|
public AesEngine()
|
|
{
|
|
this.Reset();
|
|
}
|
|
|
|
// Token: 0x0600BA8F RID: 47759 RVA: 0x0028AC10 File Offset: 0x00288E10
|
|
[Token(Token = "0x600BA8F")]
|
|
[Address(RVA = "0x248EF20", Offset = "0x248DF20", VA = "0x18248EF20", Slot = "10")]
|
|
public virtual void Init(bool forEncryption, ICipherParameters parameters)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600BA8F)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines.AesEngine::Init(System.Boolean,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_38:
|
|
stloc:ArgumentException(var_5_49, newobj:ArgumentException(ArgumentException::.ctor, call:string(string::Concat, ldstr:string("invalid parameter passed to AES init - "), ldloc:string(var_4))))
|
|
}
|
|
|
|
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: 0x17001D51 RID: 7505
|
|
// (get) Token: 0x0600BA90 RID: 47760 RVA: 0x0028AC68 File Offset: 0x00288E68
|
|
[Token(Token = "0x17001D51")]
|
|
public virtual string AlgorithmName
|
|
{
|
|
[Token(Token = "0x600BA90")]
|
|
[Address(RVA = "0x248F650", Offset = "0x248E650", VA = "0x18248F650", Slot = "11")]
|
|
get
|
|
{
|
|
return "AES";
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001D52 RID: 7506
|
|
// (get) Token: 0x0600BA91 RID: 47761 RVA: 0x0028AC7C File Offset: 0x00288E7C
|
|
[Token(Token = "0x17001D52")]
|
|
public virtual bool IsPartialBlockOkay
|
|
{
|
|
[Token(Token = "0x600BA91")]
|
|
[Address(RVA = "0x424690", Offset = "0x423690", VA = "0x180424690", Slot = "12")]
|
|
get
|
|
{
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600BA92 RID: 47762 RVA: 0x0028AC8C File Offset: 0x00288E8C
|
|
[Token(Token = "0x600BA92")]
|
|
[Address(RVA = "0x8BB9C0", Offset = "0x8BA9C0", VA = "0x1808BB9C0", Slot = "13")]
|
|
public virtual int GetBlockSize()
|
|
{
|
|
return 16;
|
|
}
|
|
|
|
// Token: 0x0600BA93 RID: 47763 RVA: 0x0028AC9C File Offset: 0x00288E9C
|
|
[Token(Token = "0x600BA93")]
|
|
[Address(RVA = "0x248F200", Offset = "0x248E200", VA = "0x18248F200", Slot = "14")]
|
|
public virtual int ProcessBlock(byte[] input, int inOff, byte[] output, int outOff)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600BA93)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int32 BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines.AesEngine::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: 0x0600BA94 RID: 47764 RVA: 0x0000220F File Offset: 0x0000040F
|
|
[Token(Token = "0x600BA94")]
|
|
[Address(RVA = "0x4242D0", Offset = "0x4232D0", VA = "0x1804242D0", Slot = "15")]
|
|
public virtual void Reset()
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x0600BA95 RID: 47765 RVA: 0x0028AD14 File Offset: 0x00288F14
|
|
[Token(Token = "0x600BA95")]
|
|
[Address(RVA = "0x248F4A0", Offset = "0x248E4A0", VA = "0x18248F4A0")]
|
|
private void UnPackBlock(byte[] bytes, int off)
|
|
{
|
|
}
|
|
|
|
// Token: 0x0600BA96 RID: 47766 RVA: 0x0028AD24 File Offset: 0x00288F24
|
|
[Token(Token = "0x600BA96")]
|
|
[Address(RVA = "0x248F190", Offset = "0x248E190", VA = "0x18248F190")]
|
|
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: 0x0600BA97 RID: 47767 RVA: 0x0028AD68 File Offset: 0x00288F68
|
|
[Token(Token = "0x600BA97")]
|
|
[Address(RVA = "0x248C580", Offset = "0x248B580", VA = "0x18248C580")]
|
|
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 = AesEngine.T0;
|
|
int length3 = t.Length;
|
|
num2 = num4;
|
|
uint[] array2;
|
|
int length4 = array2.Length;
|
|
uint num5 = t[(int)num2];
|
|
num2 = num5;
|
|
uint num6 = t[(int)num2];
|
|
num2 = num6;
|
|
num = num2;
|
|
num2 = num3;
|
|
num6 = num2;
|
|
num2 = num4;
|
|
num5 = num2;
|
|
num2 = num;
|
|
uint num7 = t[(int)num2];
|
|
uint num8 = t[(int)num5];
|
|
uint num9 = t[(int)num6];
|
|
num = num3;
|
|
num2 = num4;
|
|
num9 = num2;
|
|
num2 = num;
|
|
num8 = num2;
|
|
uint num10 = t[(int)num2];
|
|
uint num11 = t[(int)num8];
|
|
uint num12 = t[(int)num9];
|
|
num2 = num12;
|
|
num12 = num;
|
|
num11 = num2;
|
|
uint num13 = t[(int)num3];
|
|
num = num13;
|
|
uint num14 = t[(int)num11];
|
|
uint num15 = t[(int)num12];
|
|
uint num16;
|
|
num16 += (uint)1;
|
|
num15 = num7;
|
|
num7 = num10;
|
|
num14 = num7;
|
|
uint num17 = t[(int)num14];
|
|
uint num18 = t[(int)num15];
|
|
num7 = num18;
|
|
num3 = num7;
|
|
num7 = num10;
|
|
num18 = num7;
|
|
num7 = num;
|
|
num17 = num7;
|
|
uint num19 = t[(int)num17];
|
|
uint num20 = t[(int)num18];
|
|
num7 = num;
|
|
num20 = num7;
|
|
num19 = num7;
|
|
uint num21 = t[(int)num19];
|
|
num7 = t[(int)num20];
|
|
}
|
|
uint[] t2 = AesEngine.T0;
|
|
int length5 = t2.Length;
|
|
num = num2;
|
|
uint num22 = t2[(int)num];
|
|
num2 = num3;
|
|
num = num2;
|
|
num2 = num4;
|
|
uint num23 = t2[(int)num2];
|
|
uint[] array3;
|
|
int length6 = array3.Length;
|
|
num2 = num;
|
|
uint num24 = t2[(int)num2];
|
|
num24 = num3;
|
|
uint num25 = t2[(int)num24];
|
|
num25 = num2;
|
|
uint num26 = t2[(int)num25];
|
|
uint num27 = t2[(int)num3];
|
|
uint num28;
|
|
num28 += (uint)1;
|
|
int length7 = AesEngine.S.Length;
|
|
int length8 = AesEngine.S.Length;
|
|
int length9 = AesEngine.S.Length;
|
|
byte[] array4 = AesEngine.S;
|
|
}
|
|
|
|
// Token: 0x0600BA98 RID: 47768 RVA: 0x0028B040 File Offset: 0x00289240
|
|
[Token(Token = "0x600BA98")]
|
|
[Address(RVA = "0x248B270", Offset = "0x248A270", VA = "0x18248B270")]
|
|
private void DecryptBlock(uint[][] KW)
|
|
{
|
|
int length = KW.Length;
|
|
uint[] array;
|
|
int length2 = array.Length;
|
|
uint num = array[0];
|
|
uint num2 = array[1];
|
|
uint num3 = array[1];
|
|
if (array > (ulong)1L)
|
|
{
|
|
uint[] array2 = KW[array];
|
|
uint[] tinv = AesEngine.Tinv0;
|
|
int length3 = tinv.Length;
|
|
num3 = num2;
|
|
int length4 = array2.Length;
|
|
uint num4 = tinv[(int)num3];
|
|
uint num5 = tinv[(int)num3];
|
|
num3 = num5;
|
|
uint num6 = tinv[(int)num3];
|
|
num3 = num;
|
|
num6 = num3;
|
|
num5 = num3;
|
|
uint num7 = tinv[(int)num5];
|
|
uint num8 = tinv[(int)num6];
|
|
num3 = num8;
|
|
num = num2;
|
|
num8 = num3;
|
|
num3 = num;
|
|
num7 = num3;
|
|
uint num9 = tinv[(int)num7];
|
|
uint num10 = tinv[(int)num8];
|
|
num3 = num10;
|
|
num10 = num2;
|
|
num = tinv[(int)num];
|
|
uint num11 = tinv[(int)num9];
|
|
uint num12 = tinv[(int)num10];
|
|
num2 = num4;
|
|
num12 = num;
|
|
num11 = num;
|
|
uint num13 = tinv[(int)num11];
|
|
uint num14 = tinv[(int)num12];
|
|
num = num4;
|
|
num14 = num;
|
|
num13 = num;
|
|
uint num15 = tinv[(int)num];
|
|
uint num16 = tinv[(int)num13];
|
|
uint num17 = tinv[(int)num14];
|
|
num = num17;
|
|
num16 = num;
|
|
num = num4;
|
|
num17 = num;
|
|
num = tinv[(int)num16];
|
|
num = tinv[(int)num17];
|
|
}
|
|
uint[] array3 = KW[1];
|
|
uint[] tinv2 = AesEngine.Tinv0;
|
|
int length5 = tinv2.Length;
|
|
num = num3;
|
|
uint num18 = tinv2[(int)num];
|
|
num3 = num2;
|
|
num = num3;
|
|
uint num19 = tinv2[(int)num3];
|
|
int length6 = array3.Length;
|
|
num3 = num;
|
|
num19 = num3;
|
|
uint num20 = tinv2[(int)num19];
|
|
num3 = num2;
|
|
uint num21 = tinv2[(int)num3];
|
|
num3 = num20;
|
|
num21 = num2;
|
|
uint num22 = tinv2[(int)num21];
|
|
num22 = num3;
|
|
uint num23 = tinv2[(int)num22];
|
|
num20 = num23;
|
|
num22 = num2;
|
|
uint num24 = tinv2[(int)num22];
|
|
uint num25 = tinv2[(int)num22];
|
|
uint num26 = tinv2[(int)num];
|
|
int length7 = AesEngine.Si.Length;
|
|
byte[] si = AesEngine.Si;
|
|
num23 = num20;
|
|
int length8 = AesEngine.Si.Length;
|
|
byte b = AesEngine.Si[(int)num23];
|
|
}
|
|
|
|
// Token: 0x0600BA99 RID: 47769 RVA: 0x0028B2F0 File Offset: 0x002894F0
|
|
// Note: this type is marked as 'beforefieldinit'.
|
|
[Token(Token = "0x600BA99")]
|
|
[Address(RVA = "0x248F510", Offset = "0x248E510", VA = "0x18248F510")]
|
|
static AesEngine()
|
|
{
|
|
byte[] array = new byte[256];
|
|
RuntimeHelpers.InitializeArray(array, fieldof(<PrivateImplementationDetails>.8F22C9ECE1331718CBD268A9BBFD2F5E451441E3).FieldHandle);
|
|
AesEngine.S = array;
|
|
byte[] array2 = new byte[256];
|
|
RuntimeHelpers.InitializeArray(array2, fieldof(<PrivateImplementationDetails>.0C4110BC17D746F018F47B49E0EB0D6590F69939).FieldHandle);
|
|
AesEngine.Si = array2;
|
|
byte[] array3 = new byte[30];
|
|
RuntimeHelpers.InitializeArray(array3, fieldof(<PrivateImplementationDetails>.B8DB0CB599EDD82A386D1A154FB3EB9235513DAD).FieldHandle);
|
|
AesEngine.rcon = array3;
|
|
uint[] array4 = new uint[256];
|
|
RuntimeHelpers.InitializeArray(array4, fieldof(<PrivateImplementationDetails>.B68637EF60D499620B99E336C59E4865FFC4C5D7).FieldHandle);
|
|
AesEngine.T0 = array4;
|
|
uint[] array5 = new uint[256];
|
|
RuntimeHelpers.InitializeArray(array5, fieldof(<PrivateImplementationDetails>.1AFB455399A50580CF1039188ABA6BE82F309543).FieldHandle);
|
|
AesEngine.Tinv0 = array5;
|
|
}
|
|
|
|
// Token: 0x04007581 RID: 30081
|
|
[Token(Token = "0x4007581")]
|
|
private static readonly byte[] S;
|
|
|
|
// Token: 0x04007582 RID: 30082
|
|
[Token(Token = "0x4007582")]
|
|
private static readonly byte[] Si;
|
|
|
|
// Token: 0x04007583 RID: 30083
|
|
[Token(Token = "0x4007583")]
|
|
private static readonly byte[] rcon;
|
|
|
|
// Token: 0x04007584 RID: 30084
|
|
[Token(Token = "0x4007584")]
|
|
private static readonly uint[] T0;
|
|
|
|
// Token: 0x04007585 RID: 30085
|
|
[Token(Token = "0x4007585")]
|
|
private static readonly uint[] Tinv0;
|
|
|
|
// Token: 0x04007586 RID: 30086
|
|
[Token(Token = "0x4007586")]
|
|
private const uint m1 = 2155905152U;
|
|
|
|
// Token: 0x04007587 RID: 30087
|
|
[Token(Token = "0x4007587")]
|
|
private const uint m2 = 2139062143U;
|
|
|
|
// Token: 0x04007588 RID: 30088
|
|
[Token(Token = "0x4007588")]
|
|
private const uint m3 = 27U;
|
|
|
|
// Token: 0x04007589 RID: 30089
|
|
[Token(Token = "0x4007589")]
|
|
private const uint m4 = 3233857728U;
|
|
|
|
// Token: 0x0400758A RID: 30090
|
|
[Token(Token = "0x400758A")]
|
|
private const uint m5 = 1061109567U;
|
|
|
|
// Token: 0x0400758B RID: 30091
|
|
[FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x400758B")]
|
|
private int ROUNDS;
|
|
|
|
// Token: 0x0400758C RID: 30092
|
|
[FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x400758C")]
|
|
private uint[][] WorkingKey;
|
|
|
|
// Token: 0x0400758D RID: 30093
|
|
[FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x400758D")]
|
|
private uint C0;
|
|
|
|
// Token: 0x0400758E RID: 30094
|
|
[FieldOffset(Offset = "0x24")]
|
|
[Token(Token = "0x400758E")]
|
|
private uint C1;
|
|
|
|
// Token: 0x0400758F RID: 30095
|
|
[FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x400758F")]
|
|
private uint C2;
|
|
|
|
// Token: 0x04007590 RID: 30096
|
|
[FieldOffset(Offset = "0x2C")]
|
|
[Token(Token = "0x4007590")]
|
|
private uint C3;
|
|
|
|
// Token: 0x04007591 RID: 30097
|
|
[FieldOffset(Offset = "0x30")]
|
|
[Token(Token = "0x4007591")]
|
|
private bool forEncryption;
|
|
|
|
// Token: 0x04007592 RID: 30098
|
|
[FieldOffset(Offset = "0x38")]
|
|
[Token(Token = "0x4007592")]
|
|
private byte[] s;
|
|
|
|
// Token: 0x04007593 RID: 30099
|
|
[Token(Token = "0x4007593")]
|
|
private const int BLOCK_SIZE = 16;
|
|
}
|
|
}
|