using System; using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; using Cpp2IlInjected; namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines { // Token: 0x02001D73 RID: 7539 [Token(Token = "0x2001D73")] public class HC128Engine : IStreamCipher { // Token: 0x0600BB79 RID: 47993 RVA: 0x00294460 File Offset: 0x00292660 [Token(Token = "0x600BB79")] [Address(RVA = "0x27F07F0", Offset = "0x27EF7F0", VA = "0x1827F07F0")] private static uint F1(uint x) { return x; } // Token: 0x0600BB7A RID: 47994 RVA: 0x00294470 File Offset: 0x00292670 [Token(Token = "0x600BB7A")] [Address(RVA = "0x27F0820", Offset = "0x27EF820", VA = "0x1827F0820")] private static uint F2(uint x) { return x; } // Token: 0x0600BB7B RID: 47995 RVA: 0x00294480 File Offset: 0x00292680 [Token(Token = "0x600BB7B")] [Address(RVA = "0x27F0850", Offset = "0x27EF850", VA = "0x1827F0850")] private uint G1(uint x, uint y, uint z) { return x; } // Token: 0x0600BB7C RID: 47996 RVA: 0x00294490 File Offset: 0x00292690 [Token(Token = "0x600BB7C")] [Address(RVA = "0x27F0880", Offset = "0x27EF880", VA = "0x1827F0880")] private uint G2(uint x, uint y, uint z) { return x; } // Token: 0x0600BB7D RID: 47997 RVA: 0x002944A0 File Offset: 0x002926A0 [Token(Token = "0x600BB7D")] [Address(RVA = "0x273A370", Offset = "0x2739370", VA = "0x18273A370")] private static uint RotateLeft(uint x, int bits) { return x; } // Token: 0x0600BB7E RID: 47998 RVA: 0x002944B0 File Offset: 0x002926B0 [Token(Token = "0x600BB7E")] [Address(RVA = "0x1030AC0", Offset = "0x102FAC0", VA = "0x181030AC0")] private static uint RotateRight(uint x, int bits) { return x; } // Token: 0x0600BB7F RID: 47999 RVA: 0x002944C0 File Offset: 0x002926C0 [Token(Token = "0x600BB7F")] [Address(RVA = "0x27F0920", Offset = "0x27EF920", VA = "0x1827F0920")] private uint H1(uint x) { uint[] array = this.q; int length = array.Length; uint num = array[(int)x]; uint num2 = array[(int)x]; return num2 + num; } // Token: 0x0600BB80 RID: 48000 RVA: 0x002944F8 File Offset: 0x002926F8 [Token(Token = "0x600BB80")] [Address(RVA = "0x27F0990", Offset = "0x27EF990", VA = "0x1827F0990")] private uint H2(uint x) { uint[] array = this.p; int length = array.Length; uint num = array[(int)x]; uint num2 = array[(int)x]; return num2 + num; } // Token: 0x0600BB81 RID: 48001 RVA: 0x00294530 File Offset: 0x00292730 [Token(Token = "0x600BB81")] [Address(RVA = "0x27F1130", Offset = "0x27F0130", VA = "0x1827F1130")] private static uint Mod1024(uint x) { return x; } // Token: 0x0600BB82 RID: 48002 RVA: 0x00294540 File Offset: 0x00292740 [Token(Token = "0x600BB82")] [Address(RVA = "0x27F1140", Offset = "0x27F0140", VA = "0x1827F1140")] private static uint Mod512(uint x) { return x; } // Token: 0x0600BB83 RID: 48003 RVA: 0x00294550 File Offset: 0x00292750 [Token(Token = "0x600BB83")] [Address(RVA = "0x27F07E0", Offset = "0x27EF7E0", VA = "0x1827F07E0")] private static uint Dim(uint x, uint y) { return x; } // Token: 0x0600BB84 RID: 48004 RVA: 0x00294560 File Offset: 0x00292760 [Token(Token = "0x600BB84")] [Address(RVA = "0x27F13C0", Offset = "0x27F03C0", VA = "0x1827F13C0")] private uint Step() { uint num = this.cnt; uint[] array = this.q; int length = array.Length; uint num2 = num + 1U; uint num3 = array[(int)num2]; uint num4; num3 += num4; uint num5; num5 += num3; uint[] array2 = this.q; int length2 = array2.Length; uint[] array3 = this.p; int length3 = array3.Length; num3 += (uint)256; uint num6 = array3[(int)num3]; int length4 = array3.Length; uint num7 = array3[(int)num6]; uint num8 = num + 1U; uint num9 = array3[(int)num8]; uint num10; num9 += num10; num7 += num9; array2.m_value = num7; int length5 = this.p.Length; uint[] array4 = this.q; int length6 = array4.Length; uint num11 = array4[(int)num9]; num9 += (uint)256; uint num12 = array4[(int)num9]; num12 += num11; uint num13 = this.cnt; num13 += (uint)1; this.cnt = num13; return num12; } // Token: 0x0600BB85 RID: 48005 RVA: 0x00294678 File Offset: 0x00292878 [Token(Token = "0x600BB85")] [Address(RVA = "0x27F0A00", Offset = "0x27EFA00", VA = "0x1827F0A00")] private void Init() { /* An exception occurred when decompiling this method (0600BB85) ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines.HC128Engine::Init() ---> System.Exception: Basic block has to end with unconditional control flow. { IL_12B: stloc:ArgumentException(var_26_135, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("The key must be 128 bits long"))) } 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: 0x17001D6D RID: 7533 // (get) Token: 0x0600BB86 RID: 48006 RVA: 0x002947BC File Offset: 0x002929BC [Token(Token = "0x17001D6D")] public virtual string AlgorithmName { [Token(Token = "0x600BB86")] [Address(RVA = "0x27F1800", Offset = "0x27F0800", VA = "0x1827F1800", Slot = "9")] get { return "HC-128"; } } // Token: 0x0600BB87 RID: 48007 RVA: 0x002947D0 File Offset: 0x002929D0 [Token(Token = "0x600BB87")] [Address(RVA = "0x27F0E10", Offset = "0x27EFE10", VA = "0x1827F0E10", Slot = "10")] public virtual void Init(bool forEncryption, ICipherParameters parameters) { /* An exception occurred when decompiling this method (0600BB87) ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines.HC128Engine::Init(System.Boolean,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters) ---> System.Exception: Basic block has to end with unconditional control flow. { IL_7B: stloc:ArgumentException(var_12_91, newobj:ArgumentException(ArgumentException::.ctor, call:string(string::Concat, ldstr:string("Invalid parameter passed to HC128 init - "), ldloc:string(var_11)), ldstr:string("parameters"))) } 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: 0x0600BB88 RID: 48008 RVA: 0x00294870 File Offset: 0x00292A70 [Token(Token = "0x600BB88")] [Address(RVA = "0x27F08B0", Offset = "0x27EF8B0", VA = "0x1827F08B0")] private byte GetByte() { if (this.idx == 0) { uint num = this.Step(); byte[] array = this.buf; Pack.UInt32_To_LE(num, array); } byte[] array2 = this.buf; int num2 = this.idx + 1; this.idx = num2; byte b; return b; } // Token: 0x0600BB89 RID: 48009 RVA: 0x002948BC File Offset: 0x00292ABC [Token(Token = "0x600BB89")] [Address(RVA = "0x27F1150", Offset = "0x27F0150", VA = "0x1827F1150", Slot = "11")] public virtual void ProcessBytes(byte[] input, int inOff, int len, byte[] output, int outOff) { /* An exception occurred when decompiling this method (0600BB89) ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines.HC128Engine::ProcessBytes(System.Byte[],System.Int32,System.Int32,System.Byte[],System.Int32) ---> System.Exception: Basic block has to end with unconditional control flow. { IL_54: stloc:InvalidOperationException(var_7_5B, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldloc:string(var_6))) } 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: 0x0600BB8A RID: 48010 RVA: 0x00294928 File Offset: 0x00292B28 [Token(Token = "0x600BB8A")] [Address(RVA = "0x27F1330", Offset = "0x27F0330", VA = "0x1827F1330", Slot = "12")] public virtual void Reset() { this.Init(); } // Token: 0x0600BB8B RID: 48011 RVA: 0x0029493C File Offset: 0x00292B3C [Token(Token = "0x600BB8B")] [Address(RVA = "0x27F1340", Offset = "0x27F0340", VA = "0x1827F1340", Slot = "13")] public virtual byte ReturnByte(byte input) { if (this.idx == 0) { uint num = this.Step(); byte[] array = this.buf; Pack.UInt32_To_LE(num, array); } byte[] array2 = this.buf; int num2 = this.idx + 1; this.idx = num2; byte b; return b; } // Token: 0x0600BB8C RID: 48012 RVA: 0x00294988 File Offset: 0x00292B88 [Token(Token = "0x600BB8C")] [Address(RVA = "0x27F1780", Offset = "0x27F0780", VA = "0x1827F1780")] public HC128Engine() { uint[] array = new uint[512]; this.p = array; uint[] array2 = new uint[512]; this.q = array2; byte[] array3 = new byte[4]; this.buf = array3; base..ctor(); } // Token: 0x0400763C RID: 30268 [FieldOffset(Offset = "0x10")] [Token(Token = "0x400763C")] private uint[] p; // Token: 0x0400763D RID: 30269 [FieldOffset(Offset = "0x18")] [Token(Token = "0x400763D")] private uint[] q; // Token: 0x0400763E RID: 30270 [FieldOffset(Offset = "0x20")] [Token(Token = "0x400763E")] private uint cnt; // Token: 0x0400763F RID: 30271 [FieldOffset(Offset = "0x28")] [Token(Token = "0x400763F")] private byte[] key; // Token: 0x04007640 RID: 30272 [FieldOffset(Offset = "0x30")] [Token(Token = "0x4007640")] private byte[] iv; // Token: 0x04007641 RID: 30273 [FieldOffset(Offset = "0x38")] [Token(Token = "0x4007641")] private bool initialised; // Token: 0x04007642 RID: 30274 [FieldOffset(Offset = "0x40")] [Token(Token = "0x4007642")] private byte[] buf; // Token: 0x04007643 RID: 30275 [FieldOffset(Offset = "0x48")] [Token(Token = "0x4007643")] private int idx; } }