563 lines
26 KiB
C#
563 lines
26 KiB
C#
using System;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Runtime.InteropServices;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines
|
|
{
|
|
// Token: 0x020016A8 RID: 5800
|
|
[Token(Token = "0x20016A8")]
|
|
[StructLayout(3)]
|
|
public class CamelliaEngine : IBlockCipher
|
|
{
|
|
// Token: 0x06009B25 RID: 39717 RVA: 0x0022CBA8 File Offset: 0x0022ADA8
|
|
[Token(Token = "0x6009B25")]
|
|
[Address(RVA = "0x22DFAE0", Offset = "0x22DE4E0", VA = "0x1822DFAE0")]
|
|
private static uint rightRotate(uint x, int s)
|
|
{
|
|
return x;
|
|
}
|
|
|
|
// Token: 0x06009B26 RID: 39718 RVA: 0x0022CBB8 File Offset: 0x0022ADB8
|
|
[Token(Token = "0x6009B26")]
|
|
[Address(RVA = "0x22DEF90", Offset = "0x22DD990", VA = "0x1822DEF90")]
|
|
private static uint leftRotate(uint x, int s)
|
|
{
|
|
return x;
|
|
}
|
|
|
|
// Token: 0x06009B27 RID: 39719 RVA: 0x0022CBC8 File Offset: 0x0022ADC8
|
|
[Token(Token = "0x6009B27")]
|
|
[Address(RVA = "0x22DFB00", Offset = "0x22DE500", VA = "0x1822DFB00")]
|
|
private static void roldq(int rot, uint[] ki, int ioff, uint[] ko, int ooff)
|
|
{
|
|
int length = ki.Length;
|
|
uint num = ki[ioff];
|
|
int num2 = ioff + 1;
|
|
uint num3 = ki[num2];
|
|
ko[0] = num3;
|
|
int length2 = ki.Length;
|
|
uint num4 = ki[(int)num];
|
|
ko[0] = num4;
|
|
int length3 = ki.Length;
|
|
uint num5 = ki[(int)num4];
|
|
ko[0] = num5;
|
|
int length4 = ki.Length;
|
|
ko[0] = num5;
|
|
uint num6;
|
|
ki[0] = num6;
|
|
uint num7;
|
|
ki[0] = num7;
|
|
ki[0] = num7;
|
|
}
|
|
|
|
// Token: 0x06009B28 RID: 39720 RVA: 0x0022CC68 File Offset: 0x0022AE68
|
|
[Token(Token = "0x6009B28")]
|
|
[Address(RVA = "0x22DE8F0", Offset = "0x22DD2F0", VA = "0x1822DE8F0")]
|
|
private static void decroldq(int rot, uint[] ki, int ioff, uint[] ko, int ooff)
|
|
{
|
|
int length = ki.Length;
|
|
uint num = ki[ioff];
|
|
int num2 = ioff + 1;
|
|
uint num3 = ki[num2];
|
|
ko[0] = num3;
|
|
int length2 = ki.Length;
|
|
uint num4 = ki[(int)num];
|
|
ko[0] = num4;
|
|
int length3 = ki.Length;
|
|
uint num5 = ki[(int)num];
|
|
uint num6 = ki[(int)num4];
|
|
ko[0] = num6;
|
|
int length4 = ki.Length;
|
|
ko[0] = num6;
|
|
uint num7;
|
|
ki[0] = num7;
|
|
uint num8;
|
|
ki[0] = num8;
|
|
ki[0] = num8;
|
|
}
|
|
|
|
// Token: 0x06009B29 RID: 39721 RVA: 0x0022CD08 File Offset: 0x0022AF08
|
|
[Token(Token = "0x6009B29")]
|
|
[Address(RVA = "0x22DFE40", Offset = "0x22DE840", VA = "0x1822DFE40")]
|
|
private static void roldqo32(int rot, uint[] ki, int ioff, uint[] ko, int ooff)
|
|
{
|
|
int length = ki.Length;
|
|
int num = ioff + 1;
|
|
uint num2;
|
|
ko[0] = num2;
|
|
int length2 = ki.Length;
|
|
uint num3 = ki[(int)num2];
|
|
ko[0] = num3;
|
|
int length3 = ki.Length;
|
|
uint num4 = ki[(int)num2];
|
|
uint num5 = ki[ioff];
|
|
ko[0] = num5;
|
|
int length4 = ki.Length;
|
|
uint num6 = ki[num];
|
|
ko[0] = num6;
|
|
uint num7;
|
|
ki[0] = num7;
|
|
uint num8;
|
|
ki[0] = num8;
|
|
uint num9 = ko[(int)num3];
|
|
ki[0] = num9;
|
|
}
|
|
|
|
// Token: 0x06009B2A RID: 39722 RVA: 0x0022CDB4 File Offset: 0x0022AFB4
|
|
[Token(Token = "0x6009B2A")]
|
|
[Address(RVA = "0x22DEC30", Offset = "0x22DD630", VA = "0x1822DEC30")]
|
|
private static void decroldqo32(int rot, uint[] ki, int ioff, uint[] ko, int ooff)
|
|
{
|
|
int length = ki.Length;
|
|
int num = ioff + 1;
|
|
uint num2;
|
|
ko[0] = num2;
|
|
int length2 = ki.Length;
|
|
uint num3 = ki[(int)num2];
|
|
ko[0] = num3;
|
|
int length3 = ki.Length;
|
|
uint num4 = ki[(int)num2];
|
|
uint num5 = ki[ioff];
|
|
ko[0] = num5;
|
|
int length4 = ki.Length;
|
|
uint num6 = ki[num];
|
|
ko[0] = num6;
|
|
uint num7;
|
|
ki[0] = num7;
|
|
uint num8;
|
|
ki[0] = num8;
|
|
uint num9;
|
|
ki[0] = num9;
|
|
}
|
|
|
|
// Token: 0x06009B2B RID: 39723 RVA: 0x0022CE50 File Offset: 0x0022B050
|
|
[Token(Token = "0x6009B2B")]
|
|
[Address(RVA = "0x22DE140", Offset = "0x22DCB40", VA = "0x1822DE140")]
|
|
private static uint bytes2uint(byte[] src, int offset)
|
|
{
|
|
int num = 0;
|
|
byte b;
|
|
num += (int)b;
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x06009B2C RID: 39724 RVA: 0x0022CE68 File Offset: 0x0022B068
|
|
[Token(Token = "0x6009B2C")]
|
|
[Address(RVA = "0x22E1FB0", Offset = "0x22E09B0", VA = "0x1822E1FB0")]
|
|
private static void uint2bytes(uint word, byte[] dst, int offset)
|
|
{
|
|
int num = 0;
|
|
num++;
|
|
}
|
|
|
|
// Token: 0x06009B2D RID: 39725 RVA: 0x0022CE84 File Offset: 0x0022B084
|
|
[Token(Token = "0x6009B2D")]
|
|
[Address(RVA = "0x22DE1A0", Offset = "0x22DCBA0", VA = "0x1822DE1A0")]
|
|
private static void camelliaF2(uint[] s, uint[] skey, int keyoff)
|
|
{
|
|
uint num = skey[keyoff];
|
|
uint[] sbox4_ = CamelliaEngine.SBOX4_4404;
|
|
uint[] sbox3_ = CamelliaEngine.SBOX3_3033;
|
|
uint num2 = sbox4_[(int)num];
|
|
uint[] sbox2_ = CamelliaEngine.SBOX2_0222;
|
|
uint[] sbox1_ = CamelliaEngine.SBOX1_1110;
|
|
int length = s.Length;
|
|
int num3 = keyoff + 1;
|
|
uint num4 = skey[num3];
|
|
num4 += num4;
|
|
s[1] = num4;
|
|
uint num5 = skey[(int)num4];
|
|
uint[] sbox4_2 = CamelliaEngine.SBOX4_4404;
|
|
uint[] sbox3_2 = CamelliaEngine.SBOX3_3033;
|
|
uint[] sbox2_2 = CamelliaEngine.SBOX2_0222;
|
|
int length2 = CamelliaEngine.SBOX1_1110.Length;
|
|
uint num6 = skey[(int)num5];
|
|
uint num7 = s[0];
|
|
s[0] = num7;
|
|
num6 += num7;
|
|
s[0] = num6;
|
|
}
|
|
|
|
// Token: 0x06009B2E RID: 39726 RVA: 0x0022CF50 File Offset: 0x0022B150
|
|
[Token(Token = "0x6009B2E")]
|
|
[Address(RVA = "0x22DE710", Offset = "0x22DD110", VA = "0x1822DE710")]
|
|
private static void camelliaFLs(uint[] s, uint[] fkey, int keyoff)
|
|
{
|
|
s[0] = typeof(CamelliaEngine).TypeHandle;
|
|
int length = s.Length;
|
|
int num = keyoff + 1;
|
|
uint num2 = fkey[num];
|
|
s[1] = num2;
|
|
}
|
|
|
|
// Token: 0x06009B2F RID: 39727 RVA: 0x0022CF8C File Offset: 0x0022B18C
|
|
[Token(Token = "0x6009B2F")]
|
|
[Address(RVA = "0x22E0170", Offset = "0x22DEB70", VA = "0x1822E0170")]
|
|
private void setKey(bool forEncryption, byte[] key)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (06009B2F)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines.CamelliaEngine::setKey(System.Boolean,System.Byte[])
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_A98:
|
|
stloc:uint32(var_223_A9F, ldelem:uint32([mscorlib]System.UInt32, ldloc:uint32[](var_1_06), ldc.i4:int32(0)))
|
|
stelem:uint32([mscorlib]System.UInt32, ldloc:uint32[](var_169_824), ldc.i4:int32(0), ldloc:uint32(var_223_A9F))
|
|
stloc:uint32[](var_224_AB1, ldfld:uint32[](CamelliaEngine::kw, ldloc:CamelliaEngine(this)))
|
|
stloc:uint32(var_225_ABA, ldelem:uint32([mscorlib]System.UInt32, ldloc:uint32[](var_1_06), ldc.i4:int32(0)))
|
|
stelem:uint32([mscorlib]System.UInt32, ldloc:uint32[](var_224_AB1), ldc.i4:int32(0), ldloc:uint32(var_225_ABA))
|
|
stloc:uint32[](var_226_ACC, ldfld:uint32[](CamelliaEngine::kw, ldloc:CamelliaEngine(this)))
|
|
stloc:uint32(var_227_AD5, ldelem:uint32([mscorlib]System.UInt32, ldloc:uint32[](var_1_06), ldc.i4:int32(1)))
|
|
stelem:uint32([mscorlib]System.UInt32, ldloc:uint32[](var_226_ACC), ldc.i4:int32(1), ldloc:uint32(var_227_AD5))
|
|
stloc:uint32[](var_228_AE7, ldfld:uint32[](CamelliaEngine::kw, ldloc:CamelliaEngine(this)))
|
|
stloc:uint32(var_229_AF0, ldelem:uint32([mscorlib]System.UInt32, ldloc:uint32[](var_1_06), ldc.i4:int32(1)))
|
|
stelem:uint32([mscorlib]System.UInt32, ldloc:uint32[](var_228_AE7), ldc.i4:int32(1), ldloc:uint32(var_229_AF0))
|
|
stloc:uint32[](var_230_B02, ldfld:uint32[](CamelliaEngine::subkey, ldloc:CamelliaEngine(this)))
|
|
stloc:int32(var_231_B05, ldc.i4:int32(0))
|
|
call:void(CamelliaEngine::roldq, ldc.i4:int32(15), ldloc:uint32[](var_1_06), ldloc:int32(var_231_B05), ldloc:uint32[](var_230_B02), ldloc:uint64[exp:int32](var_232))
|
|
stloc:uint32[](var_233_B1B, ldfld:uint32[](CamelliaEngine::subkey, ldloc:CamelliaEngine(this)))
|
|
stloc:int32(var_234_B1E, ldc.i4:int32(0))
|
|
call:void(CamelliaEngine::roldq, ldc.i4:int32(30), ldloc:uint32[](var_1_06), ldloc:int32(var_234_B1E), ldloc:uint32[](var_233_B1B), ldloc:uint64[exp:int32](var_235))
|
|
stloc:int32(var_236_B2F, ldc.i4:int32(0))
|
|
call:void(CamelliaEngine::roldq, ldc.i4:int32(15), ldloc:uint32[](var_1_06), ldloc:int32(var_236_B2F), ldloc:uint32[](var_7_1C), ldloc:int32(var_9_259))
|
|
stloc:uint32[](var_237_B45, ldfld:uint32[](CamelliaEngine::subkey, ldloc:CamelliaEngine(this)))
|
|
stloc:uint32(var_238_B4F, ldelem:uint32([mscorlib]System.UInt32, ldloc:uint32[](var_7_1C), ldc.i4:int32(1)))
|
|
stelem:uint32([mscorlib]System.UInt32, ldloc:uint32[](var_237_B45), ldc.i4:int32(9), ldloc:uint32(var_238_B4F))
|
|
stloc:uint32[](var_239_B62, ldfld:uint32[](CamelliaEngine::subkey, ldloc:CamelliaEngine(this)))
|
|
stloc:uint32(var_240_B6C, ldelem:uint32([mscorlib]System.UInt32, ldloc:uint32[](var_7_1C), ldc.i4:int32(1)))
|
|
stelem:uint32([mscorlib]System.UInt32, ldloc:uint32[](var_239_B62), ldc.i4:int32(9), ldloc:uint32(var_240_B6C))
|
|
stloc:int32(var_241_B7A, ldc.i4:int32(0))
|
|
stloc:uint32[](var_242_B82, ldfld:uint32[](CamelliaEngine::ke, ldloc:CamelliaEngine(this)))
|
|
call:void(CamelliaEngine::roldq, ldc.i4:int32(17), ldloc:uint32[](var_1_06), ldloc:int32(var_241_B7A), ldloc:uint32[](var_242_B82), ldloc:uint64[exp:int32](var_243))
|
|
}
|
|
|
|
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: 0x06009B30 RID: 39728 RVA: 0x0022DB2C File Offset: 0x0022BD2C
|
|
[Token(Token = "0x6009B30")]
|
|
[Address(RVA = "0x22DEFB0", Offset = "0x22DD9B0", VA = "0x1822DEFB0")]
|
|
private int processBlock128(byte[] input, int inOff, byte[] output, int outOff)
|
|
{
|
|
int num = 0;
|
|
uint[] array = this.state;
|
|
num++;
|
|
byte b;
|
|
num += (int)b;
|
|
array[0] = (uint)num;
|
|
uint[] array2 = this.state;
|
|
uint[] array3 = this.kw;
|
|
num++;
|
|
uint[] array4 = this.state;
|
|
uint[] array5 = this.subkey;
|
|
int num2 = 0;
|
|
CamelliaEngine.camelliaF2(array4, array5, num2);
|
|
uint[] array6 = this.subkey;
|
|
CamelliaEngine.camelliaF2(this.state, array6, 4);
|
|
uint[] array7 = this.subkey;
|
|
CamelliaEngine.camelliaF2(this.state, array7, 8);
|
|
uint[] array8 = this.ke;
|
|
uint[] array9 = this.state;
|
|
int num3 = 0;
|
|
CamelliaEngine.camelliaFLs(array9, array8, num3);
|
|
uint[] array10 = this.subkey;
|
|
CamelliaEngine.camelliaF2(this.state, array10, 12);
|
|
uint[] array11 = this.subkey;
|
|
CamelliaEngine.camelliaF2(this.state, array11, 16);
|
|
uint[] array12 = this.subkey;
|
|
CamelliaEngine.camelliaF2(this.state, array12, 20);
|
|
uint[] array13 = this.ke;
|
|
CamelliaEngine.camelliaFLs(this.state, array13, 4);
|
|
uint[] array14 = this.subkey;
|
|
CamelliaEngine.camelliaF2(this.state, array14, 24);
|
|
uint[] array15 = this.subkey;
|
|
CamelliaEngine.camelliaF2(this.state, array15, 28);
|
|
uint[] array16 = this.subkey;
|
|
CamelliaEngine.camelliaF2(this.state, array16, 32);
|
|
uint[] array17 = this.state;
|
|
uint[] array18 = this.kw;
|
|
uint[] array19 = this.state;
|
|
uint[] array20 = this.kw;
|
|
uint[] array21 = this.state;
|
|
uint[] array22 = this.kw;
|
|
uint[] array23 = this.state;
|
|
uint[] array24 = this.kw;
|
|
uint[] array25 = this.state;
|
|
num++;
|
|
uint[] array26 = this.state;
|
|
num++;
|
|
uint[] array27 = this.state;
|
|
num++;
|
|
uint[] array28 = this.state;
|
|
num++;
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x06009B31 RID: 39729 RVA: 0x0022DCE4 File Offset: 0x0022BEE4
|
|
[Token(Token = "0x6009B31")]
|
|
[Address(RVA = "0x22DF520", Offset = "0x22DDF20", VA = "0x1822DF520")]
|
|
private int processBlock192or256(byte[] input, int inOff, byte[] output, int outOff)
|
|
{
|
|
int num = 0;
|
|
uint[] array = this.state;
|
|
num++;
|
|
byte b;
|
|
num += (int)b;
|
|
array[0] = (uint)num;
|
|
uint[] array2 = this.state;
|
|
uint[] array3 = this.kw;
|
|
num++;
|
|
uint[] array4 = this.state;
|
|
uint[] array5 = this.subkey;
|
|
int num2 = 0;
|
|
CamelliaEngine.camelliaF2(array4, array5, num2);
|
|
uint[] array6 = this.subkey;
|
|
CamelliaEngine.camelliaF2(this.state, array6, 4);
|
|
uint[] array7 = this.subkey;
|
|
CamelliaEngine.camelliaF2(this.state, array7, 8);
|
|
uint[] array8 = this.ke;
|
|
uint[] array9 = this.state;
|
|
int num3 = 0;
|
|
CamelliaEngine.camelliaFLs(array9, array8, num3);
|
|
uint[] array10 = this.subkey;
|
|
CamelliaEngine.camelliaF2(this.state, array10, 12);
|
|
uint[] array11 = this.subkey;
|
|
CamelliaEngine.camelliaF2(this.state, array11, 16);
|
|
uint[] array12 = this.subkey;
|
|
CamelliaEngine.camelliaF2(this.state, array12, 20);
|
|
uint[] array13 = this.ke;
|
|
CamelliaEngine.camelliaFLs(this.state, array13, 4);
|
|
uint[] array14 = this.subkey;
|
|
CamelliaEngine.camelliaF2(this.state, array14, 24);
|
|
uint[] array15 = this.subkey;
|
|
CamelliaEngine.camelliaF2(this.state, array15, 28);
|
|
uint[] array16 = this.subkey;
|
|
CamelliaEngine.camelliaF2(this.state, array16, 32);
|
|
uint[] array17 = this.ke;
|
|
CamelliaEngine.camelliaFLs(this.state, array17, 8);
|
|
uint[] array18 = this.subkey;
|
|
CamelliaEngine.camelliaF2(this.state, array18, 36);
|
|
uint[] array19 = this.subkey;
|
|
CamelliaEngine.camelliaF2(this.state, array19, 40);
|
|
uint[] array20 = this.subkey;
|
|
CamelliaEngine.camelliaF2(this.state, array20, 44);
|
|
uint[] array21 = this.state;
|
|
uint[] array22 = this.kw;
|
|
uint[] array23 = this.state;
|
|
uint[] array24 = this.kw;
|
|
uint[] array25 = this.state;
|
|
uint[] array26 = this.kw;
|
|
uint[] array27 = this.state;
|
|
uint[] array28 = this.kw;
|
|
uint[] array29 = this.state;
|
|
num++;
|
|
uint[] array30 = this.state;
|
|
num++;
|
|
uint[] array31 = this.state;
|
|
num++;
|
|
uint[] array32 = this.state;
|
|
num++;
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x06009B32 RID: 39730 RVA: 0x0022DEF8 File Offset: 0x0022C0F8
|
|
[Token(Token = "0x6009B32")]
|
|
[Address(RVA = "0x22DE0B0", Offset = "0x22DCAB0", VA = "0x1822DE0B0")]
|
|
public CamelliaEngine()
|
|
{
|
|
uint[] array = new uint[96];
|
|
this.subkey = array;
|
|
uint[] array2 = new uint[8];
|
|
this.kw = array2;
|
|
uint[] array3 = new uint[12];
|
|
this.ke = array3;
|
|
uint[] array4 = new uint[4];
|
|
this.state = array4;
|
|
this.Reset();
|
|
}
|
|
|
|
// Token: 0x06009B33 RID: 39731 RVA: 0x0022DF48 File Offset: 0x0022C148
|
|
[Token(Token = "0x6009B33")]
|
|
[Address(RVA = "0x22DDD10", Offset = "0x22DC710", VA = "0x1822DDD10", Slot = "10")]
|
|
public virtual void Init(bool forEncryption, ICipherParameters parameters)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (06009B33)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines.CamelliaEngine::Init(System.Boolean,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_26:
|
|
stloc:ArgumentException(var_4_30, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("only simple KeyParameter expected.")))
|
|
}
|
|
|
|
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: 0x170018BB RID: 6331
|
|
// (get) Token: 0x06009B34 RID: 39732 RVA: 0x0022DF88 File Offset: 0x0022C188
|
|
[Token(Token = "0x170018BB")]
|
|
public virtual string AlgorithmName
|
|
{
|
|
[Token(Token = "0x6009B34")]
|
|
[Address(RVA = "0x22DEF60", Offset = "0x22DD960", VA = "0x1822DEF60", Slot = "11")]
|
|
get
|
|
{
|
|
return "Camellia";
|
|
}
|
|
}
|
|
|
|
// Token: 0x170018BC RID: 6332
|
|
// (get) Token: 0x06009B35 RID: 39733 RVA: 0x0022DF9C File Offset: 0x0022C19C
|
|
[Token(Token = "0x170018BC")]
|
|
public virtual bool IsPartialBlockOkay
|
|
{
|
|
[Token(Token = "0x6009B35")]
|
|
[Address(RVA = "0x413970", Offset = "0x412370", VA = "0x180413970", Slot = "12")]
|
|
get
|
|
{
|
|
}
|
|
}
|
|
|
|
// Token: 0x06009B36 RID: 39734 RVA: 0x0022DFAC File Offset: 0x0022C1AC
|
|
[Token(Token = "0x6009B36")]
|
|
[Address(RVA = "0x11B1BB0", Offset = "0x11B05B0", VA = "0x1811B1BB0", Slot = "13")]
|
|
public virtual int GetBlockSize()
|
|
{
|
|
return 16;
|
|
}
|
|
|
|
// Token: 0x06009B37 RID: 39735 RVA: 0x0022DFBC File Offset: 0x0022C1BC
|
|
[Token(Token = "0x6009B37")]
|
|
[Address(RVA = "0x22DDE70", Offset = "0x22DC870", VA = "0x1822DDE70", Slot = "14")]
|
|
public virtual int ProcessBlock(byte[] input, int inOff, byte[] output, int outOff)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (06009B37)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int32 BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines.CamelliaEngine::ProcessBlock(System.Byte[],System.Int32,System.Byte[],System.Int32)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_24:
|
|
stloc:InvalidOperationException(var_3_2E, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("Camellia 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: 0x06009B38 RID: 39736 RVA: 0x0000220F File Offset: 0x0000040F
|
|
[Token(Token = "0x6009B38")]
|
|
[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: 0x06009B39 RID: 39737 RVA: 0x0022DFF8 File Offset: 0x0022C1F8
|
|
// Note: this type is marked as 'beforefieldinit'.
|
|
[Token(Token = "0x6009B39")]
|
|
[Address(RVA = "0x22DDF70", Offset = "0x22DC970", VA = "0x1822DDF70")]
|
|
static CamelliaEngine()
|
|
{
|
|
uint[] array = new uint[12];
|
|
RuntimeHelpers.InitializeArray(array, fieldof(<PrivateImplementationDetails>.AE843E1C1136C908565A6D4E04E8564B69465B3B).FieldHandle);
|
|
CamelliaEngine.SIGMA = array;
|
|
uint[] array2 = new uint[256];
|
|
RuntimeHelpers.InitializeArray(array2, fieldof(<PrivateImplementationDetails>.B1108EE6609DB783B2EC606B3BFDD544A7D4C2B3).FieldHandle);
|
|
CamelliaEngine.SBOX1_1110 = array2;
|
|
uint[] array3 = new uint[256];
|
|
RuntimeHelpers.InitializeArray(array3, fieldof(<PrivateImplementationDetails>.14F6FAB1B4065EBADBBA4A3661ADE689FF444EDD).FieldHandle);
|
|
CamelliaEngine.SBOX4_4404 = array3;
|
|
uint[] array4 = new uint[256];
|
|
RuntimeHelpers.InitializeArray(array4, fieldof(<PrivateImplementationDetails>.B718C95C87C6B65DFA29D58A10442CEC9EBBDF1F).FieldHandle);
|
|
CamelliaEngine.SBOX2_0222 = array4;
|
|
uint[] array5 = new uint[256];
|
|
RuntimeHelpers.InitializeArray(array5, fieldof(<PrivateImplementationDetails>.124B1C35B19149213F8F7D40AA8E0ABA15DD70EC).FieldHandle);
|
|
CamelliaEngine.SBOX3_3033 = array5;
|
|
}
|
|
|
|
// Token: 0x040065D0 RID: 26064
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x40065D0")]
|
|
private bool initialised;
|
|
|
|
// Token: 0x040065D1 RID: 26065
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x11")]
|
|
[Token(Token = "0x40065D1")]
|
|
private bool _keyIs128;
|
|
|
|
// Token: 0x040065D2 RID: 26066
|
|
[Token(Token = "0x40065D2")]
|
|
private const int BLOCK_SIZE = 16;
|
|
|
|
// Token: 0x040065D3 RID: 26067
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x40065D3")]
|
|
private uint[] subkey;
|
|
|
|
// Token: 0x040065D4 RID: 26068
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x40065D4")]
|
|
private uint[] kw;
|
|
|
|
// Token: 0x040065D5 RID: 26069
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x40065D5")]
|
|
private uint[] ke;
|
|
|
|
// Token: 0x040065D6 RID: 26070
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
|
|
[Token(Token = "0x40065D6")]
|
|
private uint[] state;
|
|
|
|
// Token: 0x040065D7 RID: 26071
|
|
[Token(Token = "0x40065D7")]
|
|
private static readonly uint[] SIGMA;
|
|
|
|
// Token: 0x040065D8 RID: 26072
|
|
[Token(Token = "0x40065D8")]
|
|
private static readonly uint[] SBOX1_1110;
|
|
|
|
// Token: 0x040065D9 RID: 26073
|
|
[Token(Token = "0x40065D9")]
|
|
private static readonly uint[] SBOX4_4404;
|
|
|
|
// Token: 0x040065DA RID: 26074
|
|
[Token(Token = "0x40065DA")]
|
|
private static readonly uint[] SBOX2_0222;
|
|
|
|
// Token: 0x040065DB RID: 26075
|
|
[Token(Token = "0x40065DB")]
|
|
private static readonly uint[] SBOX3_3033;
|
|
}
|
|
}
|