Files
Jan2021-Cpp2Il-Dump/Assembly-CSharp/BestHTTP/SecureProtocol/Org/BouncyCastle/Crypto/Modes/GcmBlockCipher.cs
T
2026-04-08 23:40:05 +02:00

713 lines
35 KiB
C#

using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes.Gcm;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes
{
// Token: 0x0200165B RID: 5723
[Token(Token = "0x200165B")]
[StructLayout(3)]
public sealed class GcmBlockCipher : IAeadBlockCipher
{
// Token: 0x06009884 RID: 39044 RVA: 0x0021D130 File Offset: 0x0021B330
[Token(Token = "0x6009884")]
[Address(RVA = "0x20ED930", Offset = "0x20EC330", VA = "0x1820ED930")]
public GcmBlockCipher(IBlockCipher c)
{
/*
An exception occurred when decompiling this method (06009884)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes.GcmBlockCipher::.ctor(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IBlockCipher)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_45:
stloc:ArgumentException(var_5_5B, newobj:ArgumentException(ArgumentException::.ctor, call:string(string::Concat, ldstr:string[exp:object]("cipher required with a block size of "), ldloc:int32[exp:object](var_4), ldstr:string[exp:object]("."))))
}
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: 0x06009885 RID: 39045 RVA: 0x0021D19C File Offset: 0x0021B39C
[Token(Token = "0x6009885")]
[Address(RVA = "0x20EDA70", Offset = "0x20EC470", VA = "0x1820EDA70")]
public GcmBlockCipher(IBlockCipher c, IGcmMultiplier m)
{
/*
An exception occurred when decompiling this method (06009885)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes.GcmBlockCipher::.ctor(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IBlockCipher,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes.Gcm.IGcmMultiplier)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_49:
stloc:ArgumentException(var_5_5F, newobj:ArgumentException(ArgumentException::.ctor, call:string(string::Concat, ldstr:string[exp:object]("cipher required with a block size of "), ldloc:int32[exp:object](var_4), ldstr:string[exp:object]("."))))
}
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: 0x1700187A RID: 6266
// (get) Token: 0x06009886 RID: 39046 RVA: 0x0021D20C File Offset: 0x0021B40C
[Token(Token = "0x1700187A")]
public string AlgorithmName
{
[Token(Token = "0x6009886")]
[Address(RVA = "0x20EDEC0", Offset = "0x20EC8C0", VA = "0x1820EDEC0", Slot = "4")]
get
{
IBlockCipher blockCipher = this.cipher;
return 0 + "/GCM";
}
}
// Token: 0x06009887 RID: 39047 RVA: 0x0021D234 File Offset: 0x0021B434
[Token(Token = "0x6009887")]
[Address(RVA = "0x3C1240", Offset = "0x3BFC40", VA = "0x1803C1240", Slot = "5")]
public IBlockCipher GetUnderlyingCipher()
{
return this.cipher;
}
// Token: 0x06009888 RID: 39048 RVA: 0x0021D248 File Offset: 0x0021B448
[Token(Token = "0x6009888")]
[Address(RVA = "0x11B1BB0", Offset = "0x11B05B0", VA = "0x1811B1BB0", Slot = "7")]
public int GetBlockSize()
{
return 16;
}
// Token: 0x06009889 RID: 39049 RVA: 0x0021D258 File Offset: 0x0021B458
[Token(Token = "0x6009889")]
[Address(RVA = "0x20EC7B0", Offset = "0x20EB1B0", VA = "0x1820EC7B0", Slot = "6")]
public void Init(bool forEncryption, ICipherParameters parameters)
{
/*
An exception occurred when decompiling this method (06009889)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes.GcmBlockCipher::Init(System.Boolean,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_291:
stloc:ArgumentException(var_45_29B, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("Key must be specified in initial init")))
}
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: 0x0600988A RID: 39050 RVA: 0x0021D504 File Offset: 0x0021B704
[Token(Token = "0x600988A")]
[Address(RVA = "0x20EC460", Offset = "0x20EAE60", VA = "0x1820EC460", Slot = "13")]
public byte[] GetMac()
{
byte[] array = this.macBlock;
if (array == 0)
{
}
return Arrays.Clone(array);
}
// Token: 0x0600988B RID: 39051 RVA: 0x0021D524 File Offset: 0x0021B724
[Token(Token = "0x600988B")]
[Address(RVA = "0x20EC690", Offset = "0x20EB090", VA = "0x1820EC690", Slot = "15")]
public 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: 0x0600988C RID: 39052 RVA: 0x0021D560 File Offset: 0x0021B760
[Token(Token = "0x600988C")]
[Address(RVA = "0x20EC6C0", Offset = "0x20EB0C0", VA = "0x1820EC6C0", Slot = "14")]
public int GetUpdateOutputSize(int len)
{
int num = this.bufOff;
num += len;
int num2;
if (!this.forEncryption)
{
num2 = this.macSize;
num -= num2;
}
if (num < num2)
{
num++;
}
return num - num;
}
// Token: 0x0600988D RID: 39053 RVA: 0x0021D59C File Offset: 0x0021B79C
[Token(Token = "0x600988D")]
[Address(RVA = "0x20ECF20", Offset = "0x20EB920", VA = "0x1820ECF20", Slot = "8")]
public void ProcessAadByte(byte input)
{
this.CheckStatus();
byte[] array = this.atBlock;
int num = this.atBlockPos;
int num2 = this.atBlockPos;
num2++;
this.atBlockPos = num2;
if (num2 == 16)
{
byte[] array2 = this.atBlock;
byte[] s_at = this.S_at;
this.gHASHBlock(s_at, array2);
this.atBlockPos = (int)((ulong)0L);
}
}
// Token: 0x0600988E RID: 39054 RVA: 0x0021D5FC File Offset: 0x0021B7FC
[Token(Token = "0x600988E")]
[Address(RVA = "0x20ECFB0", Offset = "0x20EB9B0", VA = "0x1820ECFB0", Slot = "9")]
public void ProcessAadBytes(byte[] inBytes, int inOff, int len)
{
this.CheckStatus();
if (len > 0)
{
int num = 0;
byte[] array = this.atBlock;
int num2 = this.atBlockPos;
int num3 = this.atBlockPos;
num3++;
this.atBlockPos = num3;
if (num3 == 16)
{
byte[] array2 = this.atBlock;
byte[] s_at = this.S_at;
this.gHASHBlock(s_at, array2);
this.atBlockPos = num;
}
num3 = inOff - inOff;
}
}
// Token: 0x0600988F RID: 39055 RVA: 0x0021D670 File Offset: 0x0021B870
[Token(Token = "0x600988F")]
[Address(RVA = "0x20EC6F0", Offset = "0x20EB0F0", VA = "0x1820EC6F0")]
private void InitCipher()
{
if (this.atLength > (ulong)0L)
{
byte[] s_atPre = this.S_atPre;
int num = 0;
byte[] s_at = this.S_at;
int num2 = 0;
ulong num3;
Array.Copy(s_at, num2, s_atPre, num, (int)num3);
ulong num4 = this.atLength;
this.atLengthPre = num4;
}
int num5 = this.atBlockPos;
if (num5 > 0)
{
byte[] array = this.atBlock;
int num6 = 0;
byte[] s_atPre2 = this.S_atPre;
this.gHASHPartial(s_atPre2, array, num6, num5);
}
if (this.atLengthPre != (ulong)0L)
{
byte[] s = this.S;
int num7 = 0;
byte[] s_atPre3 = this.S_atPre;
int num8 = 0;
ulong num9;
Array.Copy(s_atPre3, num8, s, num7, (int)num9);
}
}
// Token: 0x06009890 RID: 39056 RVA: 0x0021D714 File Offset: 0x0021B914
[Token(Token = "0x6009890")]
[Address(RVA = "0x20ED290", Offset = "0x20EBC90", VA = "0x1820ED290", Slot = "10")]
public int ProcessByte(byte input, byte[] output, int outOff)
{
this.CheckStatus();
byte[] array = this.bufBlock;
int num = this.bufOff;
int num2 = this.bufOff;
byte[] array2 = this.bufBlock;
num2++;
this.bufOff = num2;
if (num2 != array2.Length)
{
return 0;
}
int num3 = 0;
int num4 = 0;
this.ProcessBlock(array2, num4, output, outOff);
int num7;
if ((this.forEncryption ? 1 : 0) == num3)
{
byte[] array3 = this.bufBlock;
int num5 = this.macSize;
int num6 = 0;
Array.Copy(array3, 16, array3, num6, num5);
num7 = this.macSize;
}
this.bufOff = num7;
throw new NullReferenceException();
}
// Token: 0x06009891 RID: 39057 RVA: 0x0021D7AC File Offset: 0x0021B9AC
[Token(Token = "0x6009891")]
[Address(RVA = "0x20ED370", Offset = "0x20EBD70", VA = "0x1820ED370", Slot = "11")]
public int ProcessBytes(byte[] input, int inOff, int len, byte[] output, int outOff)
{
this.CheckStatus();
Check.DataLength(input, inOff, inOff, "input buffer too short");
int num = 0;
if ((this.forEncryption ? 1 : 0) == num)
{
if (len <= 0)
{
return num;
}
byte[] array = this.bufBlock;
int num2 = this.bufOff;
int num3 = this.bufOff;
byte[] array2 = this.bufBlock;
num3++;
this.bufOff = num3;
if (num3 == array2.Length)
{
byte[] array3 = this.bufBlock;
int num4 = 0;
int num5 = this.macSize;
Array.Copy(array3, 16, array3, num4, num5);
int num6 = this.macSize;
num += 16;
this.bufOff = num6;
}
num3 = inOff - inOff;
}
if (this.bufOff != 0 && len > 0)
{
byte[] array4 = this.bufBlock;
int num7 = this.bufOff;
num7++;
this.bufOff = num7;
if (num7 == 16)
{
this.bufOff = num;
throw new NullReferenceException();
}
}
num += 16;
while (len != 16)
{
}
if (len > 0)
{
byte[] array5 = this.bufBlock;
int num8 = 0;
Array.Copy(input, inOff, array5, num8, len);
this.bufOff = len;
}
return num;
}
// Token: 0x06009892 RID: 39058 RVA: 0x0021D8C4 File Offset: 0x0021BAC4
[Token(Token = "0x6009892")]
[Address(RVA = "0x20EBDE0", Offset = "0x20EA7E0", VA = "0x1820EBDE0", Slot = "12")]
public int DoFinal(byte[] output, int outOff)
{
/*
An exception occurred when decompiling this method (06009892)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int32 BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes.GcmBlockCipher::DoFinal(System.Byte[],System.Int32)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_2FB:
stloc:InvalidCipherTextException(var_58_305, newobj:InvalidCipherTextException(InvalidCipherTextException::.ctor, ldstr:string("mac check in GCM 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.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: 0x06009893 RID: 39059 RVA: 0x0021DBD8 File Offset: 0x0021BDD8
[Token(Token = "0x6009893")]
[Address(RVA = "0x20ED780", Offset = "0x20EC180", VA = "0x1820ED780", Slot = "16")]
public void Reset()
{
this.Reset(true);
}
// Token: 0x06009894 RID: 39060 RVA: 0x0021DBEC File Offset: 0x0021BDEC
[Token(Token = "0x6009894")]
[Address(RVA = "0x20ED790", Offset = "0x20EC190", VA = "0x1820ED790")]
private void Reset(bool clearMac)
{
IBlockCipher blockCipher = this.cipher;
byte[] array = new byte[16];
this.S = array;
byte[] array2 = new byte[16];
this.S_at = array2;
byte[] array3 = new byte[16];
this.S_atPre = array3;
byte[] array4 = new byte[16];
byte[] j = this.J0;
int num = 0;
this.atBlockPos = num;
this.atLength = (ulong)num;
this.atLengthPre = (ulong)num;
this.atBlock = array4;
byte[] array5 = Arrays.Clone(j);
byte[] array6 = this.bufBlock;
this.counter = array5;
this.blocksRemaining = (uint)((ulong)4294967294L);
this.bufOff = num;
this.totalLength = (ulong)num;
if (array6 != 0)
{
int num2 = 0;
Arrays.Fill(array6, (byte)num2);
}
if (clearMac)
{
this.macBlock = num;
}
if ((this.forEncryption ? 1 : 0) == num)
{
byte[] array7 = this.initialAssociatedText;
if (array7 != 0)
{
int length = array7.Length;
int num3 = 0;
this.ProcessAadBytes(array7, num3, length);
}
return;
}
}
// Token: 0x06009895 RID: 39061 RVA: 0x0021DCF0 File Offset: 0x0021BEF0
[Token(Token = "0x6009895")]
[Address(RVA = "0x20ED0B0", Offset = "0x20EBAB0", VA = "0x1820ED0B0")]
private void ProcessBlock(byte[] buf, int bufOff, byte[] output, int outOff)
{
if (this.totalLength == (ulong)0L)
{
this.InitCipher();
}
byte[] array = this.ctrBlock;
this.GetNextCtrBlock(array);
if (!this.forEncryption)
{
GcmUtilities.Xor(this.S, buf, bufOff);
IGcmMultiplier gcmMultiplier = this.multiplier;
byte[] array2 = this.ctrBlock;
}
GcmUtilities.Xor(this.ctrBlock, buf, bufOff);
byte[] array3 = this.ctrBlock;
byte[] s = this.S;
this.gHASHBlock(s, array3);
byte[] array4 = this.ctrBlock;
}
// Token: 0x06009896 RID: 39062 RVA: 0x0021DD78 File Offset: 0x0021BF78
[Token(Token = "0x6009896")]
[Address(RVA = "0x20ED640", Offset = "0x20EC040", VA = "0x1820ED640")]
private void ProcessPartial(byte[] buf, int off, int len, byte[] output, int outOff)
{
byte[] array = this.ctrBlock;
this.GetNextCtrBlock(array);
if (!this.forEncryption)
{
byte[] s = this.S;
this.gHASHPartial(s, buf, len, len);
byte[] array2 = this.ctrBlock;
int num = 0;
GcmUtilities.Xor(buf, off, array2, num, len);
}
byte[] array3 = this.ctrBlock;
int num2 = 0;
GcmUtilities.Xor(buf, off, array3, num2, len);
byte[] s2 = this.S;
this.gHASHPartial(s2, buf, off, len);
}
// Token: 0x06009897 RID: 39063 RVA: 0x0021DDF4 File Offset: 0x0021BFF4
[Token(Token = "0x6009897")]
[Address(RVA = "0x20EDDF0", Offset = "0x20EC7F0", VA = "0x1820EDDF0")]
private void gHASH(byte[] Y, byte[] b, int len)
{
int num = 0;
if (len > 0)
{
int num2 = Math.Min(len, 16);
this.gHASHPartial(Y, b, num, num2);
num += 16;
}
}
// Token: 0x06009898 RID: 39064 RVA: 0x0021DE20 File Offset: 0x0021C020
[Token(Token = "0x6009898")]
[Address(RVA = "0x20EDC60", Offset = "0x20EC660", VA = "0x1820EDC60")]
private void gHASHBlock(byte[] Y, byte[] b)
{
GcmUtilities.Xor(Y, b);
IGcmMultiplier gcmMultiplier = this.multiplier;
throw new NullReferenceException();
}
// Token: 0x06009899 RID: 39065 RVA: 0x0021DE40 File Offset: 0x0021C040
[Token(Token = "0x6009899")]
[Address(RVA = "0x20EDBB0", Offset = "0x20EC5B0", VA = "0x1820EDBB0")]
private void gHASHBlock(byte[] Y, byte[] b, int off)
{
GcmUtilities.Xor(Y, b, off);
IGcmMultiplier gcmMultiplier = this.multiplier;
throw new NullReferenceException();
}
// Token: 0x0600989A RID: 39066 RVA: 0x0021DE64 File Offset: 0x0021C064
[Token(Token = "0x600989A")]
[Address(RVA = "0x20EDD00", Offset = "0x20EC700", VA = "0x1820EDD00")]
private void gHASHPartial(byte[] Y, byte[] b, int off, int len)
{
IGcmMultiplier gcmMultiplier = this.multiplier;
throw new NullReferenceException();
}
// Token: 0x0600989B RID: 39067 RVA: 0x0021DE80 File Offset: 0x0021C080
[Token(Token = "0x600989B")]
[Address(RVA = "0x20EC4E0", Offset = "0x20EAEE0", VA = "0x1820EC4E0")]
private void GetNextCtrBlock(byte[] block)
{
/*
An exception occurred when decompiling this method (0600989B)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes.GcmBlockCipher::GetNextCtrBlock(System.Byte[])
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_9E:
stloc:InvalidOperationException(var_11_A8, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("Attempt to process too many blocks")))
}
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: 0x0600989C RID: 39068 RVA: 0x0021DF38 File Offset: 0x0021C138
[Token(Token = "0x600989C")]
[Address(RVA = "0x20EBD40", Offset = "0x20EA740", VA = "0x1820EBD40")]
private void CheckStatus()
{
/*
An exception occurred when decompiling this method (0600989C)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes.GcmBlockCipher::CheckStatus()
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_13:
stloc:InvalidOperationException(var_0_1D, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("GCM cipher cannot be reused for encryption")))
}
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: 0x04006432 RID: 25650
[Token(Token = "0x4006432")]
private const int BlockSize = 16;
// Token: 0x04006433 RID: 25651
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006433")]
private byte[] ctrBlock;
// Token: 0x04006434 RID: 25652
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006434")]
private readonly IBlockCipher cipher;
// Token: 0x04006435 RID: 25653
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x4006435")]
private readonly IGcmMultiplier multiplier;
// Token: 0x04006436 RID: 25654
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x4006436")]
private IGcmExponentiator exp;
// Token: 0x04006437 RID: 25655
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
[Token(Token = "0x4006437")]
private bool forEncryption;
// Token: 0x04006438 RID: 25656
[global::Cpp2IlInjected.FieldOffset(Offset = "0x31")]
[Token(Token = "0x4006438")]
private bool initialised;
// Token: 0x04006439 RID: 25657
[global::Cpp2IlInjected.FieldOffset(Offset = "0x34")]
[Token(Token = "0x4006439")]
private int macSize;
// Token: 0x0400643A RID: 25658
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
[Token(Token = "0x400643A")]
private byte[] lastKey;
// Token: 0x0400643B RID: 25659
[global::Cpp2IlInjected.FieldOffset(Offset = "0x40")]
[Token(Token = "0x400643B")]
private byte[] nonce;
// Token: 0x0400643C RID: 25660
[global::Cpp2IlInjected.FieldOffset(Offset = "0x48")]
[Token(Token = "0x400643C")]
private byte[] initialAssociatedText;
// Token: 0x0400643D RID: 25661
[global::Cpp2IlInjected.FieldOffset(Offset = "0x50")]
[Token(Token = "0x400643D")]
private byte[] H;
// Token: 0x0400643E RID: 25662
[global::Cpp2IlInjected.FieldOffset(Offset = "0x58")]
[Token(Token = "0x400643E")]
private byte[] J0;
// Token: 0x0400643F RID: 25663
[global::Cpp2IlInjected.FieldOffset(Offset = "0x60")]
[Token(Token = "0x400643F")]
private byte[] bufBlock;
// Token: 0x04006440 RID: 25664
[global::Cpp2IlInjected.FieldOffset(Offset = "0x68")]
[Token(Token = "0x4006440")]
private byte[] macBlock;
// Token: 0x04006441 RID: 25665
[global::Cpp2IlInjected.FieldOffset(Offset = "0x70")]
[Token(Token = "0x4006441")]
private byte[] S;
// Token: 0x04006442 RID: 25666
[global::Cpp2IlInjected.FieldOffset(Offset = "0x78")]
[Token(Token = "0x4006442")]
private byte[] S_at;
// Token: 0x04006443 RID: 25667
[global::Cpp2IlInjected.FieldOffset(Offset = "0x80")]
[Token(Token = "0x4006443")]
private byte[] S_atPre;
// Token: 0x04006444 RID: 25668
[global::Cpp2IlInjected.FieldOffset(Offset = "0x88")]
[Token(Token = "0x4006444")]
private byte[] counter;
// Token: 0x04006445 RID: 25669
[global::Cpp2IlInjected.FieldOffset(Offset = "0x90")]
[Token(Token = "0x4006445")]
private uint blocksRemaining;
// Token: 0x04006446 RID: 25670
[global::Cpp2IlInjected.FieldOffset(Offset = "0x94")]
[Token(Token = "0x4006446")]
private int bufOff;
// Token: 0x04006447 RID: 25671
[global::Cpp2IlInjected.FieldOffset(Offset = "0x98")]
[Token(Token = "0x4006447")]
private ulong totalLength;
// Token: 0x04006448 RID: 25672
[global::Cpp2IlInjected.FieldOffset(Offset = "0xA0")]
[Token(Token = "0x4006448")]
private byte[] atBlock;
// Token: 0x04006449 RID: 25673
[global::Cpp2IlInjected.FieldOffset(Offset = "0xA8")]
[Token(Token = "0x4006449")]
private int atBlockPos;
// Token: 0x0400644A RID: 25674
[global::Cpp2IlInjected.FieldOffset(Offset = "0xB0")]
[Token(Token = "0x400644A")]
private ulong atLength;
// Token: 0x0400644B RID: 25675
[global::Cpp2IlInjected.FieldOffset(Offset = "0xB8")]
[Token(Token = "0x400644B")]
private ulong atLengthPre;
}
}