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: 0x02001C80 RID: 7296
|
|
[Token(Token = "0x2001C80")]
|
|
public class AesEngine : IBlockCipher
|
|
{
|
|
// Token: 0x0600B6BA RID: 46778 RVA: 0x00281598 File Offset: 0x0027F798
|
|
[Token(Token = "0x600B6BA")]
|
|
[Address(RVA = "0x1A607B0", Offset = "0x1A5F5B0", VA = "0x181A607B0")]
|
|
private static uint Shift(uint r, int shift)
|
|
{
|
|
return r;
|
|
}
|
|
|
|
// Token: 0x0600B6BB RID: 46779 RVA: 0x002815A8 File Offset: 0x0027F7A8
|
|
[Token(Token = "0x600B6BB")]
|
|
[Address(RVA = "0x1A5ED00", Offset = "0x1A5DB00", VA = "0x181A5ED00")]
|
|
private static uint FFmulX(uint x)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600B6BB)
|
|
|
|
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: 0x0600B6BC RID: 46780 RVA: 0x002815BC File Offset: 0x0027F7BC
|
|
[Token(Token = "0x600B6BC")]
|
|
[Address(RVA = "0x1A5ECD0", Offset = "0x1A5DAD0", VA = "0x181A5ECD0")]
|
|
private static uint FFmulX2(uint x)
|
|
{
|
|
return x;
|
|
}
|
|
|
|
// Token: 0x0600B6BD RID: 46781 RVA: 0x002815CC File Offset: 0x0027F7CC
|
|
[Token(Token = "0x600B6BD")]
|
|
[Address(RVA = "0x1A60500", Offset = "0x1A5F300", VA = "0x181A60500")]
|
|
private static uint Inv_Mcol(uint x)
|
|
{
|
|
return x;
|
|
}
|
|
|
|
// Token: 0x0600B6BE RID: 46782 RVA: 0x002815DC File Offset: 0x0027F7DC
|
|
[Token(Token = "0x600B6BE")]
|
|
[Address(RVA = "0x1A607D0", Offset = "0x1A5F5D0", VA = "0x181A607D0")]
|
|
private static uint SubWord(uint x)
|
|
{
|
|
int length = AesEngine.S.Length;
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600B6BF RID: 46783 RVA: 0x002815FC File Offset: 0x0027F7FC
|
|
[Token(Token = "0x600B6BF")]
|
|
[Address(RVA = "0x1A5ED20", Offset = "0x1A5DB20", VA = "0x181A5ED20")]
|
|
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: 0x0600B6C0 RID: 46784 RVA: 0x00281AF0 File Offset: 0x0027FCF0
|
|
[Token(Token = "0x600B6C0")]
|
|
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
|
|
public AesEngine()
|
|
{
|
|
this.Reset();
|
|
}
|
|
|
|
// Token: 0x0600B6C1 RID: 46785 RVA: 0x00281B04 File Offset: 0x0027FD04
|
|
[Token(Token = "0x600B6C1")]
|
|
[Address(RVA = "0x1A60350", Offset = "0x1A5F150", VA = "0x181A60350", Slot = "10")]
|
|
public virtual void Init(bool forEncryption, ICipherParameters parameters)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600B6C1)
|
|
|
|
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: 0x17001CB4 RID: 7348
|
|
// (get) Token: 0x0600B6C2 RID: 46786 RVA: 0x00281B5C File Offset: 0x0027FD5C
|
|
[Token(Token = "0x17001CB4")]
|
|
public virtual string AlgorithmName
|
|
{
|
|
[Token(Token = "0x600B6C2")]
|
|
[Address(RVA = "0x1A60AA0", Offset = "0x1A5F8A0", VA = "0x181A60AA0", Slot = "11")]
|
|
get
|
|
{
|
|
return "AES";
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001CB5 RID: 7349
|
|
// (get) Token: 0x0600B6C3 RID: 46787 RVA: 0x00281B70 File Offset: 0x0027FD70
|
|
[Token(Token = "0x17001CB5")]
|
|
public virtual bool IsPartialBlockOkay
|
|
{
|
|
[Token(Token = "0x600B6C3")]
|
|
[Address(RVA = "0x403930", Offset = "0x402730", VA = "0x180403930", Slot = "12")]
|
|
get
|
|
{
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600B6C4 RID: 46788 RVA: 0x00281B80 File Offset: 0x0027FD80
|
|
[Token(Token = "0x600B6C4")]
|
|
[Address(RVA = "0x4B6B10", Offset = "0x4B5910", VA = "0x1804B6B10", Slot = "13")]
|
|
public virtual int GetBlockSize()
|
|
{
|
|
return 16;
|
|
}
|
|
|
|
// Token: 0x0600B6C5 RID: 46789 RVA: 0x00281B90 File Offset: 0x0027FD90
|
|
[Token(Token = "0x600B6C5")]
|
|
[Address(RVA = "0x1A60630", Offset = "0x1A5F430", VA = "0x181A60630", Slot = "14")]
|
|
public virtual int ProcessBlock(byte[] input, int inOff, byte[] output, int outOff)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600B6C5)
|
|
|
|
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: 0x0600B6C6 RID: 46790 RVA: 0x0000220F File Offset: 0x0000040F
|
|
[Token(Token = "0x600B6C6")]
|
|
[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: 0x0600B6C7 RID: 46791 RVA: 0x00281C08 File Offset: 0x0027FE08
|
|
[Token(Token = "0x600B6C7")]
|
|
[Address(RVA = "0x1A608F0", Offset = "0x1A5F6F0", VA = "0x181A608F0")]
|
|
private void UnPackBlock(byte[] bytes, int off)
|
|
{
|
|
}
|
|
|
|
// Token: 0x0600B6C8 RID: 46792 RVA: 0x00281C18 File Offset: 0x0027FE18
|
|
[Token(Token = "0x600B6C8")]
|
|
[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: 0x0600B6C9 RID: 46793 RVA: 0x00281C5C File Offset: 0x0027FE5C
|
|
[Token(Token = "0x600B6C9")]
|
|
[Address(RVA = "0x1A5D9B0", Offset = "0x1A5C7B0", VA = "0x181A5D9B0")]
|
|
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: 0x0600B6CA RID: 46794 RVA: 0x00281F34 File Offset: 0x00280134
|
|
[Token(Token = "0x600B6CA")]
|
|
[Address(RVA = "0x1A5C6A0", Offset = "0x1A5B4A0", VA = "0x181A5C6A0")]
|
|
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: 0x0600B6CB RID: 46795 RVA: 0x002821E4 File Offset: 0x002803E4
|
|
// Note: this type is marked as 'beforefieldinit'.
|
|
[Token(Token = "0x600B6CB")]
|
|
[Address(RVA = "0x1A60960", Offset = "0x1A5F760", VA = "0x181A60960")]
|
|
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: 0x040073C8 RID: 29640
|
|
[Token(Token = "0x40073C8")]
|
|
private static readonly byte[] S;
|
|
|
|
// Token: 0x040073C9 RID: 29641
|
|
[Token(Token = "0x40073C9")]
|
|
private static readonly byte[] Si;
|
|
|
|
// Token: 0x040073CA RID: 29642
|
|
[Token(Token = "0x40073CA")]
|
|
private static readonly byte[] rcon;
|
|
|
|
// Token: 0x040073CB RID: 29643
|
|
[Token(Token = "0x40073CB")]
|
|
private static readonly uint[] T0;
|
|
|
|
// Token: 0x040073CC RID: 29644
|
|
[Token(Token = "0x40073CC")]
|
|
private static readonly uint[] Tinv0;
|
|
|
|
// Token: 0x040073CD RID: 29645
|
|
[Token(Token = "0x40073CD")]
|
|
private const uint m1 = 2155905152U;
|
|
|
|
// Token: 0x040073CE RID: 29646
|
|
[Token(Token = "0x40073CE")]
|
|
private const uint m2 = 2139062143U;
|
|
|
|
// Token: 0x040073CF RID: 29647
|
|
[Token(Token = "0x40073CF")]
|
|
private const uint m3 = 27U;
|
|
|
|
// Token: 0x040073D0 RID: 29648
|
|
[Token(Token = "0x40073D0")]
|
|
private const uint m4 = 3233857728U;
|
|
|
|
// Token: 0x040073D1 RID: 29649
|
|
[Token(Token = "0x40073D1")]
|
|
private const uint m5 = 1061109567U;
|
|
|
|
// Token: 0x040073D2 RID: 29650
|
|
[FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x40073D2")]
|
|
private int ROUNDS;
|
|
|
|
// Token: 0x040073D3 RID: 29651
|
|
[FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x40073D3")]
|
|
private uint[][] WorkingKey;
|
|
|
|
// Token: 0x040073D4 RID: 29652
|
|
[FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x40073D4")]
|
|
private uint C0;
|
|
|
|
// Token: 0x040073D5 RID: 29653
|
|
[FieldOffset(Offset = "0x24")]
|
|
[Token(Token = "0x40073D5")]
|
|
private uint C1;
|
|
|
|
// Token: 0x040073D6 RID: 29654
|
|
[FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x40073D6")]
|
|
private uint C2;
|
|
|
|
// Token: 0x040073D7 RID: 29655
|
|
[FieldOffset(Offset = "0x2C")]
|
|
[Token(Token = "0x40073D7")]
|
|
private uint C3;
|
|
|
|
// Token: 0x040073D8 RID: 29656
|
|
[FieldOffset(Offset = "0x30")]
|
|
[Token(Token = "0x40073D8")]
|
|
private bool forEncryption;
|
|
|
|
// Token: 0x040073D9 RID: 29657
|
|
[FieldOffset(Offset = "0x38")]
|
|
[Token(Token = "0x40073D9")]
|
|
private byte[] s;
|
|
|
|
// Token: 0x040073DA RID: 29658
|
|
[Token(Token = "0x40073DA")]
|
|
private const int BLOCK_SIZE = 16;
|
|
}
|
|
}
|