644 lines
27 KiB
C#
644 lines
27 KiB
C#
using System;
|
|
using System.Runtime.CompilerServices;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines
|
|
{
|
|
// Token: 0x02001D66 RID: 7526
|
|
[Token(Token = "0x2001D66")]
|
|
public class CamelliaLightEngine : IBlockCipher
|
|
{
|
|
// Token: 0x0600BAE2 RID: 47842 RVA: 0x0028E808 File Offset: 0x0028CA08
|
|
[Token(Token = "0x600BAE2")]
|
|
[Address(RVA = "0x249A960", Offset = "0x2499960", VA = "0x18249A960")]
|
|
private static uint rightRotate(uint x, int s)
|
|
{
|
|
return x;
|
|
}
|
|
|
|
// Token: 0x0600BAE3 RID: 47843 RVA: 0x0028E818 File Offset: 0x0028CA18
|
|
[Token(Token = "0x600BAE3")]
|
|
[Address(RVA = "0x2499E10", Offset = "0x2498E10", VA = "0x182499E10")]
|
|
private static uint leftRotate(uint x, int s)
|
|
{
|
|
return x;
|
|
}
|
|
|
|
// Token: 0x0600BAE4 RID: 47844 RVA: 0x0028E828 File Offset: 0x0028CA28
|
|
[Token(Token = "0x600BAE4")]
|
|
[Address(RVA = "0x249A980", Offset = "0x2499980", VA = "0x18249A980")]
|
|
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: 0x0600BAE5 RID: 47845 RVA: 0x0028E8C8 File Offset: 0x0028CAC8
|
|
[Token(Token = "0x600BAE5")]
|
|
[Address(RVA = "0x2499770", Offset = "0x2498770", VA = "0x182499770")]
|
|
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: 0x0600BAE6 RID: 47846 RVA: 0x0028E968 File Offset: 0x0028CB68
|
|
[Token(Token = "0x600BAE6")]
|
|
[Address(RVA = "0x249ACC0", Offset = "0x2499CC0", VA = "0x18249ACC0")]
|
|
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: 0x0600BAE7 RID: 47847 RVA: 0x0028EA14 File Offset: 0x0028CC14
|
|
[Token(Token = "0x600BAE7")]
|
|
[Address(RVA = "0x2499AB0", Offset = "0x2498AB0", VA = "0x182499AB0")]
|
|
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: 0x0600BAE8 RID: 47848 RVA: 0x0028EAB0 File Offset: 0x0028CCB0
|
|
[Token(Token = "0x600BAE8")]
|
|
[Address(RVA = "0x2498FC0", Offset = "0x2497FC0", VA = "0x182498FC0")]
|
|
private static uint bytes2uint(byte[] src, int offset)
|
|
{
|
|
int num = 0;
|
|
byte b;
|
|
num += (int)b;
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600BAE9 RID: 47849 RVA: 0x0028EAC8 File Offset: 0x0028CCC8
|
|
[Token(Token = "0x600BAE9")]
|
|
[Address(RVA = "0x249CE30", Offset = "0x249BE30", VA = "0x18249CE30")]
|
|
private static void uint2bytes(uint word, byte[] dst, int offset)
|
|
{
|
|
int num = 0;
|
|
num++;
|
|
}
|
|
|
|
// Token: 0x0600BAEA RID: 47850 RVA: 0x0028EAE4 File Offset: 0x0028CCE4
|
|
[Token(Token = "0x600BAEA")]
|
|
[Address(RVA = "0x27D99F0", Offset = "0x27D89F0", VA = "0x1827D99F0")]
|
|
private byte lRot8(byte v, int rot)
|
|
{
|
|
uint num;
|
|
num -= (uint)rot;
|
|
return v;
|
|
}
|
|
|
|
// Token: 0x0600BAEB RID: 47851 RVA: 0x0028EAF8 File Offset: 0x0028CCF8
|
|
[Token(Token = "0x600BAEB")]
|
|
[Address(RVA = "0x27DA5C0", Offset = "0x27D95C0", VA = "0x1827DA5C0")]
|
|
private uint sbox2(int x)
|
|
{
|
|
byte[] sbox = CamelliaLightEngine.SBOX1;
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600BAEC RID: 47852 RVA: 0x0028EB10 File Offset: 0x0028CD10
|
|
[Token(Token = "0x600BAEC")]
|
|
[Address(RVA = "0x27DA650", Offset = "0x27D9650", VA = "0x1827DA650")]
|
|
private uint sbox3(int x)
|
|
{
|
|
byte[] sbox = CamelliaLightEngine.SBOX1;
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600BAED RID: 47853 RVA: 0x0028EB28 File Offset: 0x0028CD28
|
|
[Token(Token = "0x600BAED")]
|
|
[Address(RVA = "0x27DA6E0", Offset = "0x27D96E0", VA = "0x1827DA6E0")]
|
|
private uint sbox4(int x)
|
|
{
|
|
byte[] sbox = CamelliaLightEngine.SBOX1;
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600BAEE RID: 47854 RVA: 0x0028EB40 File Offset: 0x0028CD40
|
|
[Token(Token = "0x600BAEE")]
|
|
[Address(RVA = "0x27D9330", Offset = "0x27D8330", VA = "0x1827D9330")]
|
|
private void camelliaF2(uint[] s, uint[] skey, int keyoff)
|
|
{
|
|
uint num = skey[keyoff];
|
|
uint num2 = this.sbox4((int)num);
|
|
uint num3 = this.sbox3((int)num);
|
|
uint num4 = this.sbox2((int)num);
|
|
int length = CamelliaLightEngine.SBOX1.Length;
|
|
int num5 = keyoff + 1;
|
|
uint num6 = skey[num5];
|
|
num3 = this.sbox4((int)num6);
|
|
uint num7 = this.sbox3((int)num6);
|
|
uint num8 = this.sbox2((int)num6);
|
|
num8 += num8;
|
|
num6 = num8;
|
|
num6 += num8;
|
|
byte b;
|
|
b += b;
|
|
num6 += num6;
|
|
s[1] = num6;
|
|
b += b;
|
|
uint num9 = skey[(int)b];
|
|
num6 = num9;
|
|
num7 = this.sbox4((int)num6);
|
|
num6 = num9;
|
|
num3 = this.sbox3((int)num6);
|
|
num6 = num9;
|
|
uint num10 = this.sbox2((int)num6);
|
|
int length2 = CamelliaLightEngine.SBOX1.Length;
|
|
num3 = this.sbox4((int)num10);
|
|
uint num11 = this.sbox3((int)num10);
|
|
uint num12 = this.sbox2((int)num10);
|
|
num12 += num12;
|
|
num10 = num12;
|
|
num10 += num12;
|
|
byte b2;
|
|
b2 += b2;
|
|
num10 += num10;
|
|
s[0] = num10;
|
|
b2 += b2;
|
|
}
|
|
|
|
// Token: 0x0600BAEF RID: 47855 RVA: 0x0028EC6C File Offset: 0x0028CE6C
|
|
[Token(Token = "0x600BAEF")]
|
|
[Address(RVA = "0x27D97E0", Offset = "0x27D87E0", VA = "0x1827D97E0")]
|
|
private void camelliaFLs(uint[] s, uint[] fkey, int keyoff)
|
|
{
|
|
s[0] = typeof(CamelliaLightEngine).TypeHandle;
|
|
int length = s.Length;
|
|
int num = keyoff + 1;
|
|
uint num2 = fkey[num];
|
|
s[1] = num2;
|
|
}
|
|
|
|
// Token: 0x0600BAF0 RID: 47856 RVA: 0x0028ECA8 File Offset: 0x0028CEA8
|
|
[Token(Token = "0x600BAF0")]
|
|
[Address(RVA = "0x27DA770", Offset = "0x27D9770", VA = "0x1827DA770")]
|
|
private void setKey(bool forEncryption, byte[] key)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600BAF0)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines.CamelliaLightEngine::setKey(System.Boolean,System.Byte[])
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_A9D:
|
|
stloc:uint32(var_225_AA4, ldelem:uint32([mscorlib]System.UInt32, ldloc:uint32[](var_1_06), ldc.i4:int32(0)))
|
|
stelem:uint32([mscorlib]System.UInt32, ldloc:uint32[](var_171_829), ldc.i4:int32(0), ldloc:uint32(var_225_AA4))
|
|
stloc:uint32[](var_226_AB6, ldfld:uint32[](CamelliaLightEngine::kw, ldloc:CamelliaLightEngine(this)))
|
|
stloc:uint32(var_227_ABF, ldelem:uint32([mscorlib]System.UInt32, ldloc:uint32[](var_1_06), ldc.i4:int32(0)))
|
|
stelem:uint32([mscorlib]System.UInt32, ldloc:uint32[](var_226_AB6), ldc.i4:int32(0), ldloc:uint32(var_227_ABF))
|
|
stloc:uint32[](var_228_AD1, ldfld:uint32[](CamelliaLightEngine::kw, ldloc:CamelliaLightEngine(this)))
|
|
stloc:uint32(var_229_ADA, ldelem:uint32([mscorlib]System.UInt32, ldloc:uint32[](var_1_06), ldc.i4:int32(1)))
|
|
stelem:uint32([mscorlib]System.UInt32, ldloc:uint32[](var_228_AD1), ldc.i4:int32(1), ldloc:uint32(var_229_ADA))
|
|
stloc:uint32[](var_230_AEC, ldfld:uint32[](CamelliaLightEngine::kw, ldloc:CamelliaLightEngine(this)))
|
|
stloc:uint32(var_231_AF5, ldelem:uint32([mscorlib]System.UInt32, ldloc:uint32[](var_1_06), ldc.i4:int32(1)))
|
|
stelem:uint32([mscorlib]System.UInt32, ldloc:uint32[](var_230_AEC), ldc.i4:int32(1), ldloc:uint32(var_231_AF5))
|
|
stloc:uint32[](var_232_B07, ldfld:uint32[](CamelliaLightEngine::subkey, ldloc:CamelliaLightEngine(this)))
|
|
stloc:int32(var_233_B0A, ldc.i4:int32(0))
|
|
call:void(CamelliaEngine::roldq, ldc.i4:int32(15), ldloc:uint32[](var_1_06), ldloc:int32(var_233_B0A), ldloc:uint32[](var_232_B07), ldloc:uint64[exp:int32](var_234))
|
|
stloc:uint32[](var_235_B20, ldfld:uint32[](CamelliaLightEngine::subkey, ldloc:CamelliaLightEngine(this)))
|
|
stloc:int32(var_236_B23, ldc.i4:int32(0))
|
|
call:void(CamelliaEngine::roldq, ldc.i4:int32(30), ldloc:uint32[](var_1_06), ldloc:int32(var_236_B23), ldloc:uint32[](var_235_B20), ldloc:uint64[exp:int32](var_237))
|
|
stloc:int32(var_238_B34, ldc.i4:int32(0))
|
|
call:void(CamelliaEngine::roldq, ldc.i4:int32(15), ldloc:uint32[](var_1_06), ldloc:int32(var_238_B34), ldloc:uint32[](var_7_1C), ldloc:int32(var_9_25A))
|
|
stloc:uint32[](var_239_B4A, ldfld:uint32[](CamelliaLightEngine::subkey, ldloc:CamelliaLightEngine(this)))
|
|
stloc:uint32(var_240_B54, ldelem:uint32([mscorlib]System.UInt32, ldloc:uint32[](var_7_1C), ldc.i4:int32(1)))
|
|
stelem:uint32([mscorlib]System.UInt32, ldloc:uint32[](var_239_B4A), ldc.i4:int32(9), ldloc:uint32(var_240_B54))
|
|
stloc:uint32[](var_241_B67, ldfld:uint32[](CamelliaLightEngine::subkey, ldloc:CamelliaLightEngine(this)))
|
|
stloc:uint32(var_242_B71, ldelem:uint32([mscorlib]System.UInt32, ldloc:uint32[](var_7_1C), ldc.i4:int32(1)))
|
|
stelem:uint32([mscorlib]System.UInt32, ldloc:uint32[](var_241_B67), ldc.i4:int32(9), ldloc:uint32(var_242_B71))
|
|
stloc:int32(var_243_B7F, ldc.i4:int32(0))
|
|
stloc:uint32[](var_244_B87, ldfld:uint32[](CamelliaLightEngine::ke, ldloc:CamelliaLightEngine(this)))
|
|
call:void(CamelliaEngine::roldq, ldc.i4:int32(17), ldloc:uint32[](var_1_06), ldloc:int32(var_243_B7F), ldloc:uint32[](var_244_B87), ldloc:uint64[exp:int32](var_245))
|
|
}
|
|
|
|
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: 0x0600BAF1 RID: 47857 RVA: 0x0028F84C File Offset: 0x0028DA4C
|
|
[Token(Token = "0x600BAF1")]
|
|
[Address(RVA = "0x27D9A20", Offset = "0x27D8A20", VA = "0x1827D9A20")]
|
|
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.subkey;
|
|
int num2 = 0;
|
|
uint[] array5 = this.state;
|
|
this.camelliaF2(array5, array4, num2);
|
|
uint[] array6 = this.subkey;
|
|
uint[] array7 = this.state;
|
|
uint num3;
|
|
this.camelliaF2(array7, array6, (int)num3);
|
|
uint[] array8 = this.subkey;
|
|
uint[] array9 = this.state;
|
|
uint num4;
|
|
this.camelliaF2(array9, array8, (int)num4);
|
|
uint[] array10 = this.ke;
|
|
int num5 = 0;
|
|
uint[] array11 = this.state;
|
|
this.camelliaFLs(array11, array10, num5);
|
|
uint[] array12 = this.subkey;
|
|
uint[] array13 = this.state;
|
|
uint num6;
|
|
this.camelliaF2(array13, array12, (int)num6);
|
|
uint[] array14 = this.subkey;
|
|
uint[] array15 = this.state;
|
|
uint num7;
|
|
this.camelliaF2(array15, array14, (int)num7);
|
|
uint[] array16 = this.subkey;
|
|
uint[] array17 = this.state;
|
|
uint num8;
|
|
this.camelliaF2(array17, array16, (int)num8);
|
|
uint[] array18 = this.ke;
|
|
uint[] array19 = this.state;
|
|
uint num9;
|
|
this.camelliaFLs(array19, array18, (int)num9);
|
|
uint[] array20 = this.subkey;
|
|
uint[] array21 = this.state;
|
|
uint num10;
|
|
this.camelliaF2(array21, array20, (int)num10);
|
|
uint[] array22 = this.subkey;
|
|
uint[] array23 = this.state;
|
|
uint num11;
|
|
this.camelliaF2(array23, array22, (int)num11);
|
|
uint[] array24 = this.subkey;
|
|
uint[] array25 = this.state;
|
|
uint num12;
|
|
this.camelliaF2(array25, array24, (int)num12);
|
|
uint[] array26 = this.state;
|
|
uint[] array27 = this.kw;
|
|
uint[] array28 = this.state;
|
|
uint[] array29 = this.kw;
|
|
uint[] array30 = this.state;
|
|
uint[] array31 = this.kw;
|
|
uint[] array32 = this.state;
|
|
uint[] array33 = this.kw;
|
|
uint[] array34 = this.state;
|
|
num++;
|
|
uint num13 = this.state[1];
|
|
output[0] = (byte)num13;
|
|
num++;
|
|
uint num14 = this.state[0];
|
|
output[0] = (byte)num14;
|
|
num++;
|
|
uint num15 = this.state[0];
|
|
output[0] = (byte)num15;
|
|
num++;
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600BAF2 RID: 47858 RVA: 0x0028FA64 File Offset: 0x0028DC64
|
|
[Token(Token = "0x600BAF2")]
|
|
[Address(RVA = "0x27D9FC0", Offset = "0x27D8FC0", VA = "0x1827D9FC0")]
|
|
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.subkey;
|
|
int num2 = 0;
|
|
uint[] array5 = this.state;
|
|
this.camelliaF2(array5, array4, num2);
|
|
uint[] array6 = this.subkey;
|
|
uint[] array7 = this.state;
|
|
uint num3;
|
|
this.camelliaF2(array7, array6, (int)num3);
|
|
uint[] array8 = this.subkey;
|
|
uint[] array9 = this.state;
|
|
uint num4;
|
|
this.camelliaF2(array9, array8, (int)num4);
|
|
uint[] array10 = this.ke;
|
|
int num5 = 0;
|
|
uint[] array11 = this.state;
|
|
this.camelliaFLs(array11, array10, num5);
|
|
uint[] array12 = this.subkey;
|
|
uint[] array13 = this.state;
|
|
uint num6;
|
|
this.camelliaF2(array13, array12, (int)num6);
|
|
uint[] array14 = this.subkey;
|
|
uint[] array15 = this.state;
|
|
uint num7;
|
|
this.camelliaF2(array15, array14, (int)num7);
|
|
uint[] array16 = this.subkey;
|
|
uint[] array17 = this.state;
|
|
uint num8;
|
|
this.camelliaF2(array17, array16, (int)num8);
|
|
uint[] array18 = this.ke;
|
|
uint[] array19 = this.state;
|
|
uint num9;
|
|
this.camelliaFLs(array19, array18, (int)num9);
|
|
uint[] array20 = this.subkey;
|
|
uint[] array21 = this.state;
|
|
uint num10;
|
|
this.camelliaF2(array21, array20, (int)num10);
|
|
uint[] array22 = this.subkey;
|
|
uint[] array23 = this.state;
|
|
uint num11;
|
|
this.camelliaF2(array23, array22, (int)num11);
|
|
uint[] array24 = this.subkey;
|
|
uint[] array25 = this.state;
|
|
uint num12;
|
|
this.camelliaF2(array25, array24, (int)num12);
|
|
uint[] array26 = this.ke;
|
|
uint[] array27 = this.state;
|
|
uint num13;
|
|
this.camelliaFLs(array27, array26, (int)num13);
|
|
uint[] array28 = this.subkey;
|
|
uint[] array29 = this.state;
|
|
uint num14;
|
|
this.camelliaF2(array29, array28, (int)num14);
|
|
uint[] array30 = this.subkey;
|
|
uint[] array31 = this.state;
|
|
uint num15;
|
|
this.camelliaF2(array31, array30, (int)num15);
|
|
uint[] array32 = this.subkey;
|
|
uint[] array33 = this.state;
|
|
uint num16;
|
|
this.camelliaF2(array33, array32, (int)num16);
|
|
uint[] array34 = this.state;
|
|
uint[] array35 = this.kw;
|
|
uint[] array36 = this.state;
|
|
uint[] array37 = this.kw;
|
|
uint[] array38 = this.state;
|
|
uint[] array39 = this.kw;
|
|
uint[] array40 = this.state;
|
|
uint[] array41 = this.kw;
|
|
uint[] array42 = this.state;
|
|
num++;
|
|
uint num17 = this.state[1];
|
|
output[0] = (byte)num17;
|
|
num++;
|
|
uint num18 = this.state[0];
|
|
output[0] = (byte)num18;
|
|
num++;
|
|
uint num19 = this.state[0];
|
|
output[0] = (byte)num19;
|
|
num++;
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600BAF3 RID: 47859 RVA: 0x0028FCEC File Offset: 0x0028DEEC
|
|
[Token(Token = "0x600BAF3")]
|
|
[Address(RVA = "0x27D92A0", Offset = "0x27D82A0", VA = "0x1827D92A0")]
|
|
public CamelliaLightEngine()
|
|
{
|
|
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();
|
|
this.initialised = false;
|
|
}
|
|
|
|
// Token: 0x17001D5B RID: 7515
|
|
// (get) Token: 0x0600BAF4 RID: 47860 RVA: 0x0028FD40 File Offset: 0x0028DF40
|
|
[Token(Token = "0x17001D5B")]
|
|
public virtual string AlgorithmName
|
|
{
|
|
[Token(Token = "0x600BAF4")]
|
|
[Address(RVA = "0x27D99C0", Offset = "0x27D89C0", VA = "0x1827D99C0", Slot = "10")]
|
|
get
|
|
{
|
|
return "Camellia";
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001D5C RID: 7516
|
|
// (get) Token: 0x0600BAF5 RID: 47861 RVA: 0x0028FD54 File Offset: 0x0028DF54
|
|
[Token(Token = "0x17001D5C")]
|
|
public virtual bool IsPartialBlockOkay
|
|
{
|
|
[Token(Token = "0x600BAF5")]
|
|
[Address(RVA = "0x424690", Offset = "0x423690", VA = "0x180424690", Slot = "11")]
|
|
get
|
|
{
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600BAF6 RID: 47862 RVA: 0x0028FD64 File Offset: 0x0028DF64
|
|
[Token(Token = "0x600BAF6")]
|
|
[Address(RVA = "0x8BB9C0", Offset = "0x8BA9C0", VA = "0x1808BB9C0", Slot = "12")]
|
|
public virtual int GetBlockSize()
|
|
{
|
|
return 16;
|
|
}
|
|
|
|
// Token: 0x0600BAF7 RID: 47863 RVA: 0x0028FD74 File Offset: 0x0028DF74
|
|
[Token(Token = "0x600BAF7")]
|
|
[Address(RVA = "0x27D8FA0", Offset = "0x27D7FA0", VA = "0x1827D8FA0", Slot = "13")]
|
|
public virtual void Init(bool forEncryption, ICipherParameters parameters)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600BAF7)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines.CamelliaLightEngine::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: 0x0600BAF8 RID: 47864 RVA: 0x0028FDB4 File Offset: 0x0028DFB4
|
|
[Token(Token = "0x600BAF8")]
|
|
[Address(RVA = "0x27D9100", Offset = "0x27D8100", VA = "0x1827D9100", Slot = "14")]
|
|
public virtual int ProcessBlock(byte[] input, int inOff, byte[] output, int outOff)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600BAF8)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int32 BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines.CamelliaLightEngine::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: 0x0600BAF9 RID: 47865 RVA: 0x0000220F File Offset: 0x0000040F
|
|
[Token(Token = "0x600BAF9")]
|
|
[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: 0x0600BAFA RID: 47866 RVA: 0x0028FDF0 File Offset: 0x0028DFF0
|
|
// Note: this type is marked as 'beforefieldinit'.
|
|
[Token(Token = "0x600BAFA")]
|
|
[Address(RVA = "0x27D9200", Offset = "0x27D8200", VA = "0x1827D9200")]
|
|
static CamelliaLightEngine()
|
|
{
|
|
uint[] array = new uint[12];
|
|
RuntimeHelpers.InitializeArray(array, fieldof(<PrivateImplementationDetails>.AE843E1C1136C908565A6D4E04E8564B69465B3B).FieldHandle);
|
|
CamelliaLightEngine.SIGMA = array;
|
|
byte[] array2 = new byte[256];
|
|
RuntimeHelpers.InitializeArray(array2, fieldof(<PrivateImplementationDetails>.81FDCC6319440C75C8E422A1FE4E3F1A80B89F5F).FieldHandle);
|
|
CamelliaLightEngine.SBOX1 = array2;
|
|
}
|
|
|
|
// Token: 0x040075D8 RID: 30168
|
|
[Token(Token = "0x40075D8")]
|
|
private const int BLOCK_SIZE = 16;
|
|
|
|
// Token: 0x040075D9 RID: 30169
|
|
[FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x40075D9")]
|
|
private bool initialised;
|
|
|
|
// Token: 0x040075DA RID: 30170
|
|
[FieldOffset(Offset = "0x11")]
|
|
[Token(Token = "0x40075DA")]
|
|
private bool _keyis128;
|
|
|
|
// Token: 0x040075DB RID: 30171
|
|
[FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x40075DB")]
|
|
private uint[] subkey;
|
|
|
|
// Token: 0x040075DC RID: 30172
|
|
[FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x40075DC")]
|
|
private uint[] kw;
|
|
|
|
// Token: 0x040075DD RID: 30173
|
|
[FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x40075DD")]
|
|
private uint[] ke;
|
|
|
|
// Token: 0x040075DE RID: 30174
|
|
[FieldOffset(Offset = "0x30")]
|
|
[Token(Token = "0x40075DE")]
|
|
private uint[] state;
|
|
|
|
// Token: 0x040075DF RID: 30175
|
|
[Token(Token = "0x40075DF")]
|
|
private static readonly uint[] SIGMA;
|
|
|
|
// Token: 0x040075E0 RID: 30176
|
|
[Token(Token = "0x40075E0")]
|
|
private static readonly byte[] SBOX1;
|
|
}
|
|
}
|