479 lines
26 KiB
C#
479 lines
26 KiB
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes
|
|
{
|
|
// Token: 0x02001659 RID: 5721
|
|
[Token(Token = "0x2001659")]
|
|
[StructLayout(3)]
|
|
public class EaxBlockCipher : IAeadBlockCipher
|
|
{
|
|
// Token: 0x06009871 RID: 39025 RVA: 0x0021CA3C File Offset: 0x0021AC3C
|
|
[Token(Token = "0x6009871")]
|
|
[Address(RVA = "0x20EAEE0", Offset = "0x20E98E0", VA = "0x1820EAEE0")]
|
|
public EaxBlockCipher(IBlockCipher cipher)
|
|
{
|
|
int num = this.blockSize;
|
|
CMac cmac;
|
|
this.mac = cmac;
|
|
byte[] array = new byte[num];
|
|
IMac mac = this.mac;
|
|
this.macBlock = array;
|
|
byte[] array2 = new byte[array];
|
|
IMac mac2 = this.mac;
|
|
this.associatedTextMac = array2;
|
|
byte[] array3 = new byte[array2];
|
|
this.nonceMac = array3;
|
|
SicBlockCipher sicBlockCipher = new SicBlockCipher(cipher);
|
|
this.cipher = sicBlockCipher;
|
|
}
|
|
|
|
// Token: 0x17001879 RID: 6265
|
|
// (get) Token: 0x06009872 RID: 39026 RVA: 0x0021CAB4 File Offset: 0x0021ACB4
|
|
[Token(Token = "0x17001879")]
|
|
public virtual string AlgorithmName
|
|
{
|
|
[Token(Token = "0x6009872")]
|
|
[Address(RVA = "0x20EB040", Offset = "0x20E9A40", VA = "0x1820EB040", Slot = "17")]
|
|
get
|
|
{
|
|
this.cipher.Reset();
|
|
string text;
|
|
return text;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06009873 RID: 39027 RVA: 0x0021CAD4 File Offset: 0x0021ACD4
|
|
[Token(Token = "0x6009873")]
|
|
[Address(RVA = "0x3C39A0", Offset = "0x3C23A0", VA = "0x1803C39A0", Slot = "18")]
|
|
public virtual IBlockCipher GetUnderlyingCipher()
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (06009873)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IBlockCipher BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes.EaxBlockCipher::GetUnderlyingCipher()
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
Block_0:
|
|
stloc:SicBlockCipher(var_0_06, ldfld:SicBlockCipher(EaxBlockCipher::cipher, ldloc:EaxBlockCipher(this)))
|
|
}
|
|
|
|
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: 0x06009874 RID: 39028 RVA: 0x0021CAE8 File Offset: 0x0021ACE8
|
|
[Token(Token = "0x6009874")]
|
|
[Address(RVA = "0x20EA340", Offset = "0x20E8D40", VA = "0x1820EA340", Slot = "19")]
|
|
public virtual int GetBlockSize()
|
|
{
|
|
string algorithmName = ((IBlockCipher)this.cipher).AlgorithmName;
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x06009875 RID: 39029 RVA: 0x0021CB08 File Offset: 0x0021AD08
|
|
[Token(Token = "0x6009875")]
|
|
[Address(RVA = "0x20EA510", Offset = "0x20E8F10", VA = "0x1820EA510", Slot = "20")]
|
|
public virtual void Init(bool forEncryption, ICipherParameters parameters)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (06009875)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes.EaxBlockCipher::Init(System.Boolean,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_E3:
|
|
stloc:ArgumentException(var_22_ED, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("invalid parameters passed to EAX")))
|
|
}
|
|
|
|
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: 0x06009876 RID: 39030 RVA: 0x0021CC04 File Offset: 0x0021AE04
|
|
[Token(Token = "0x6009876")]
|
|
[Address(RVA = "0x20EA440", Offset = "0x20E8E40", VA = "0x1820EA440")]
|
|
private void InitCipher()
|
|
{
|
|
if (!this.cipherInitialized)
|
|
{
|
|
IMac mac = this.mac;
|
|
this.cipherInitialized = true;
|
|
byte[] array = new byte[this.blockSize];
|
|
int num = this.blockSize;
|
|
IMac mac2 = this.mac;
|
|
int num2 = this.blockSize;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06009877 RID: 39031 RVA: 0x0021CC54 File Offset: 0x0021AE54
|
|
[Token(Token = "0x6009877")]
|
|
[Address(RVA = "0x20E9F00", Offset = "0x20E8900", VA = "0x1820E9F00")]
|
|
private void CalculateMac()
|
|
{
|
|
byte[] array = new byte[this.blockSize];
|
|
IMac mac = this.mac;
|
|
int num = 0;
|
|
byte[] array2 = this.macBlock;
|
|
if (num < array2.Length)
|
|
{
|
|
byte[] array3 = this.nonceMac;
|
|
byte[] array4 = this.associatedTextMac;
|
|
num++;
|
|
byte[] array5 = this.macBlock;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06009878 RID: 39032 RVA: 0x0021CCA8 File Offset: 0x0021AEA8
|
|
[Token(Token = "0x6009878")]
|
|
[Address(RVA = "0x20EACF0", Offset = "0x20E96F0", VA = "0x1820EACF0", Slot = "21")]
|
|
public virtual void Reset()
|
|
{
|
|
this.Reset(true);
|
|
}
|
|
|
|
// Token: 0x06009879 RID: 39033 RVA: 0x0021CCBC File Offset: 0x0021AEBC
|
|
[Token(Token = "0x6009879")]
|
|
[Address(RVA = "0x20EAD00", Offset = "0x20E9700", VA = "0x1820EAD00")]
|
|
private void Reset(bool clearMac)
|
|
{
|
|
SicBlockCipher sicBlockCipher = this.cipher;
|
|
IMac mac = this.mac;
|
|
byte[] array = this.bufBlock;
|
|
this.bufOff = (int)((ulong)0L);
|
|
int length = array.Length;
|
|
int num = 0;
|
|
Array.Clear(array, num, length);
|
|
if (clearMac)
|
|
{
|
|
byte[] array2 = this.macBlock;
|
|
int length2 = array2.Length;
|
|
int num2 = 0;
|
|
Array.Clear(array2, num2, length2);
|
|
}
|
|
byte[] array3 = new byte[this.blockSize];
|
|
int num3 = this.blockSize;
|
|
IMac mac2 = this.mac;
|
|
int num4 = this.blockSize;
|
|
byte[] array4 = this.initialAssociatedText;
|
|
this.cipherInitialized = false;
|
|
if (array4 != 0)
|
|
{
|
|
this.ProcessAadByte(array4);
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600987A RID: 39034 RVA: 0x0021CD68 File Offset: 0x0021AF68
|
|
[Token(Token = "0x600987A")]
|
|
[Address(RVA = "0x20EA8B0", Offset = "0x20E92B0", VA = "0x1820EA8B0", Slot = "22")]
|
|
public virtual void ProcessAadByte(byte input)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600987A)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes.EaxBlockCipher::ProcessAadByte(System.Byte)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_10:
|
|
stloc:InvalidOperationException(var_1_1A, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("AAD data cannot be added after encryption/decryption processing has begun.")))
|
|
}
|
|
|
|
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: 0x0600987B RID: 39035 RVA: 0x0021CD90 File Offset: 0x0021AF90
|
|
[Token(Token = "0x600987B")]
|
|
[Address(RVA = "0x20EA940", Offset = "0x20E9340", VA = "0x1820EA940", Slot = "23")]
|
|
public virtual void ProcessAadBytes(byte[] inBytes, int inOff, int len)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600987B)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes.EaxBlockCipher::ProcessAadBytes(System.Byte[],System.Int32,System.Int32)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_11:
|
|
stloc:InvalidOperationException(var_1_1B, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("AAD data cannot be added after encryption/decryption processing has begun.")))
|
|
}
|
|
|
|
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: 0x0600987C RID: 39036 RVA: 0x0021CDB8 File Offset: 0x0021AFB8
|
|
[Token(Token = "0x600987C")]
|
|
[Address(RVA = "0x20EAA00", Offset = "0x20E9400", VA = "0x1820EAA00", Slot = "24")]
|
|
public virtual int ProcessByte(byte input, byte[] outBytes, int outOff)
|
|
{
|
|
this.InitCipher();
|
|
return this.Process(input, outBytes, outOff);
|
|
}
|
|
|
|
// Token: 0x0600987D RID: 39037 RVA: 0x0021CDD4 File Offset: 0x0021AFD4
|
|
[Token(Token = "0x600987D")]
|
|
[Address(RVA = "0x20EAA60", Offset = "0x20E9460", VA = "0x1820EAA60", Slot = "25")]
|
|
public virtual int ProcessBytes(byte[] inBytes, int inOff, int len, byte[] outBytes, int outOff)
|
|
{
|
|
this.InitCipher();
|
|
int num = 0;
|
|
if (len != 0)
|
|
{
|
|
int num2;
|
|
num += num2;
|
|
num2 = inOff;
|
|
num2 -= inOff;
|
|
while (num2 != len)
|
|
{
|
|
}
|
|
}
|
|
return num;
|
|
}
|
|
|
|
// Token: 0x0600987E RID: 39038 RVA: 0x0021CE04 File Offset: 0x0021B004
|
|
[Token(Token = "0x600987E")]
|
|
[Address(RVA = "0x20EA030", Offset = "0x20E8A30", VA = "0x1820EA030", Slot = "26")]
|
|
public virtual int DoFinal(byte[] outBytes, int outOff)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600987E)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int32 BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes.EaxBlockCipher::DoFinal(System.Byte[],System.Int32)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_148:
|
|
stloc:InvalidCipherTextException(var_22_152, newobj:InvalidCipherTextException(InvalidCipherTextException::.ctor, ldstr:string("mac check in EAX failed")))
|
|
}
|
|
|
|
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.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.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: 0x0600987F RID: 39039 RVA: 0x0021CF64 File Offset: 0x0021B164
|
|
[Token(Token = "0x600987F")]
|
|
[Address(RVA = "0x20EA370", Offset = "0x20E8D70", VA = "0x1820EA370", Slot = "27")]
|
|
public virtual byte[] GetMac()
|
|
{
|
|
byte[] array = new byte[this.macSize];
|
|
int num = this.macSize;
|
|
int num2 = 0;
|
|
int num3 = 0;
|
|
Array.Copy(this.macBlock, num3, array, num2, num);
|
|
return array;
|
|
}
|
|
|
|
// Token: 0x06009880 RID: 39040 RVA: 0x0021CF9C File Offset: 0x0021B19C
|
|
[Token(Token = "0x6009880")]
|
|
[Address(RVA = "0x20EA410", Offset = "0x20E8E10", VA = "0x1820EA410", Slot = "28")]
|
|
public virtual int GetUpdateOutputSize(int len)
|
|
{
|
|
int num = this.bufOff;
|
|
num += len;
|
|
if (!this.forEncryption)
|
|
{
|
|
int num2 = this.macSize;
|
|
num -= num2;
|
|
}
|
|
return num - len;
|
|
}
|
|
|
|
// Token: 0x06009881 RID: 39041 RVA: 0x0021CFD0 File Offset: 0x0021B1D0
|
|
[Token(Token = "0x6009881")]
|
|
[Address(RVA = "0x20EA3E0", Offset = "0x20E8DE0", VA = "0x1820EA3E0", Slot = "29")]
|
|
public virtual int GetOutputSize(int len)
|
|
{
|
|
int num = this.bufOff;
|
|
int num2 = this.macSize;
|
|
num += len;
|
|
if (this.forEncryption)
|
|
{
|
|
return num2 + num;
|
|
}
|
|
if (num < num2)
|
|
{
|
|
return 0;
|
|
}
|
|
return num - num2;
|
|
}
|
|
|
|
// Token: 0x06009882 RID: 39042 RVA: 0x0021D00C File Offset: 0x0021B20C
|
|
[Token(Token = "0x6009882")]
|
|
[Address(RVA = "0x20EAB20", Offset = "0x20E9520", VA = "0x1820EAB20")]
|
|
private int Process(byte b, byte[] outBytes, int outOff)
|
|
{
|
|
int num = this.bufOff;
|
|
byte[] array = this.bufBlock;
|
|
int num2 = num + 1;
|
|
this.bufOff = num2;
|
|
int length = this.bufBlock.Length;
|
|
if (this.bufOff != length)
|
|
{
|
|
return 0;
|
|
}
|
|
int num3 = 0;
|
|
int num4 = this.blockSize;
|
|
Check.OutputLength(outBytes, outOff, num4, "Output buffer is too short");
|
|
if ((this.forEncryption ? 1 : 0) == num3)
|
|
{
|
|
IMac mac = this.mac;
|
|
int num5 = this.blockSize;
|
|
int num6 = this.cipher.GetBlockSize();
|
|
}
|
|
int num7 = this.cipher.GetBlockSize();
|
|
IMac mac2 = this.mac;
|
|
int num8 = this.blockSize;
|
|
this.bufOff = num3;
|
|
if ((this.forEncryption ? 1 : 0) == num3)
|
|
{
|
|
byte[] array2 = this.bufBlock;
|
|
int num9 = 0;
|
|
int num10 = this.macSize;
|
|
int num11 = this.blockSize;
|
|
Array.Copy(array2, num11, array2, num9, num10);
|
|
int num12 = this.macSize;
|
|
this.bufOff = num12;
|
|
}
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x06009883 RID: 39043 RVA: 0x0021D100 File Offset: 0x0021B300
|
|
[Token(Token = "0x6009883")]
|
|
[Address(RVA = "0x20EAE50", Offset = "0x20E9850", VA = "0x1820EAE50")]
|
|
private bool VerifyMac(byte[] mac, int off)
|
|
{
|
|
int num = this.macSize;
|
|
int num2 = 0;
|
|
if (num > 0)
|
|
{
|
|
byte[] array = this.macBlock;
|
|
num2++;
|
|
}
|
|
return num2 == 0;
|
|
}
|
|
|
|
// Token: 0x04006422 RID: 25634
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x4006422")]
|
|
private SicBlockCipher cipher;
|
|
|
|
// Token: 0x04006423 RID: 25635
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x4006423")]
|
|
private bool forEncryption;
|
|
|
|
// Token: 0x04006424 RID: 25636
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x1C")]
|
|
[Token(Token = "0x4006424")]
|
|
private int blockSize;
|
|
|
|
// Token: 0x04006425 RID: 25637
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x4006425")]
|
|
private IMac mac;
|
|
|
|
// Token: 0x04006426 RID: 25638
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x4006426")]
|
|
private byte[] nonceMac;
|
|
|
|
// Token: 0x04006427 RID: 25639
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
|
|
[Token(Token = "0x4006427")]
|
|
private byte[] associatedTextMac;
|
|
|
|
// Token: 0x04006428 RID: 25640
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
|
|
[Token(Token = "0x4006428")]
|
|
private byte[] macBlock;
|
|
|
|
// Token: 0x04006429 RID: 25641
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x40")]
|
|
[Token(Token = "0x4006429")]
|
|
private int macSize;
|
|
|
|
// Token: 0x0400642A RID: 25642
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x48")]
|
|
[Token(Token = "0x400642A")]
|
|
private byte[] bufBlock;
|
|
|
|
// Token: 0x0400642B RID: 25643
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x50")]
|
|
[Token(Token = "0x400642B")]
|
|
private int bufOff;
|
|
|
|
// Token: 0x0400642C RID: 25644
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x54")]
|
|
[Token(Token = "0x400642C")]
|
|
private bool cipherInitialized;
|
|
|
|
// Token: 0x0400642D RID: 25645
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x58")]
|
|
[Token(Token = "0x400642D")]
|
|
private byte[] initialAssociatedText;
|
|
|
|
// Token: 0x0200165A RID: 5722
|
|
[Token(Token = "0x200165A")]
|
|
private enum Tag : byte
|
|
{
|
|
// Token: 0x0400642F RID: 25647
|
|
[Token(Token = "0x400642F")]
|
|
N,
|
|
// Token: 0x04006430 RID: 25648
|
|
[Token(Token = "0x4006430")]
|
|
H,
|
|
// Token: 0x04006431 RID: 25649
|
|
[Token(Token = "0x4006431")]
|
|
C
|
|
}
|
|
}
|
|
}
|