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

136 lines
6.1 KiB
C#

using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs
{
// Token: 0x02001672 RID: 5746
[Token(Token = "0x2001672")]
[StructLayout(3)]
public class GMac : IMac
{
// Token: 0x06009981 RID: 39297 RVA: 0x00222654 File Offset: 0x00220854
[Token(Token = "0x6009981")]
[Address(RVA = "0x20EB450", Offset = "0x20E9E50", VA = "0x1820EB450")]
public GMac(GcmBlockCipher cipher)
{
this.cipher = cipher;
this.macSizeBits = (int)((ulong)128L);
}
// Token: 0x06009982 RID: 39298 RVA: 0x0022267C File Offset: 0x0022087C
[Token(Token = "0x6009982")]
[Address(RVA = "0x67E170", Offset = "0x67CB70", VA = "0x18067E170")]
public GMac(GcmBlockCipher cipher, int macSizeBits)
{
this.cipher = cipher;
this.macSizeBits = macSizeBits;
}
// Token: 0x06009983 RID: 39299 RVA: 0x002226A0 File Offset: 0x002208A0
[Token(Token = "0x6009983")]
[Address(RVA = "0x20EB1C0", Offset = "0x20E9BC0", VA = "0x1820EB1C0", Slot = "4")]
public void Init(ICipherParameters parameters)
{
/*
An exception occurred when decompiling this method (06009983)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs.GMac::Init(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_21:
stloc:ArgumentException(var_6_2B, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("GMAC requires ParametersWithIV")))
}
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: 0x1700188F RID: 6287
// (get) Token: 0x06009984 RID: 39300 RVA: 0x002226DC File Offset: 0x002208DC
[Token(Token = "0x1700188F")]
public string AlgorithmName
{
[Token(Token = "0x6009984")]
[Address(RVA = "0x20EB480", Offset = "0x20E9E80", VA = "0x1820EB480", Slot = "5")]
get
{
IBlockCipher blockCipher = this.cipher.cipher;
string text;
return text;
}
}
// Token: 0x06009985 RID: 39301 RVA: 0x002226FC File Offset: 0x002208FC
[Token(Token = "0x6009985")]
[Address(RVA = "0x20EB1B0", Offset = "0x20E9BB0", VA = "0x1820EB1B0", Slot = "6")]
public int GetMacSize()
{
return this.macSizeBits;
}
// Token: 0x06009986 RID: 39302 RVA: 0x00222710 File Offset: 0x00220910
[Token(Token = "0x6009986")]
[Address(RVA = "0x20EB3B0", Offset = "0x20E9DB0", VA = "0x1820EB3B0", Slot = "7")]
public void Update(byte input)
{
GcmBlockCipher gcmBlockCipher = this.cipher;
gcmBlockCipher.CheckStatus();
byte[] atBlock = gcmBlockCipher.atBlock;
int atBlockPos = gcmBlockCipher.atBlockPos;
int num = gcmBlockCipher.atBlockPos;
num++;
gcmBlockCipher.atBlockPos = num;
if (num == 16)
{
byte[] atBlock2 = gcmBlockCipher.atBlock;
byte[] s_at = gcmBlockCipher.S_at;
gcmBlockCipher.gHASHBlock(s_at, atBlock2);
gcmBlockCipher.atBlockPos = (int)((ulong)0L);
}
}
// Token: 0x06009987 RID: 39303 RVA: 0x00222778 File Offset: 0x00220978
[Token(Token = "0x6009987")]
[Address(RVA = "0x20EB0B0", Offset = "0x20E9AB0", VA = "0x1820EB0B0", Slot = "8")]
public void BlockUpdate(byte[] input, int inOff, int len)
{
this.cipher.ProcessAadBytes(input, inOff, len);
}
// Token: 0x06009988 RID: 39304 RVA: 0x0022279C File Offset: 0x0022099C
[Token(Token = "0x6009988")]
[Address(RVA = "0x20EB0E0", Offset = "0x20E9AE0", VA = "0x1820EB0E0", Slot = "9")]
public int DoFinal(byte[] output, int outOff)
{
return this.cipher.DoFinal(output, outOff);
}
// Token: 0x06009989 RID: 39305 RVA: 0x002227C4 File Offset: 0x002209C4
[Token(Token = "0x6009989")]
[Address(RVA = "0x20EB380", Offset = "0x20E9D80", VA = "0x1820EB380", Slot = "10")]
public void Reset()
{
this.cipher.Reset(true);
}
// Token: 0x040064CA RID: 25802
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x40064CA")]
private readonly GcmBlockCipher cipher;
// Token: 0x040064CB RID: 25803
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x40064CB")]
private readonly int macSizeBits;
}
}