121 lines
5.6 KiB
C#
121 lines
5.6 KiB
C#
using System;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs
|
|
{
|
|
// Token: 0x02001D2F RID: 7471
|
|
[Token(Token = "0x2001D2F")]
|
|
public class GMac : IMac
|
|
{
|
|
// Token: 0x0600B929 RID: 47401 RVA: 0x00282E08 File Offset: 0x00281008
|
|
[Token(Token = "0x600B929")]
|
|
[Address(RVA = "0x25B93C0", Offset = "0x25B83C0", VA = "0x1825B93C0")]
|
|
public GMac(GcmBlockCipher cipher)
|
|
{
|
|
this.cipher = cipher;
|
|
this.macSizeBits = (int)((ulong)128L);
|
|
}
|
|
|
|
// Token: 0x0600B92A RID: 47402 RVA: 0x00282E30 File Offset: 0x00281030
|
|
[Token(Token = "0x600B92A")]
|
|
[Address(RVA = "0x52CBA0", Offset = "0x52BBA0", VA = "0x18052CBA0")]
|
|
public GMac(GcmBlockCipher cipher, int macSizeBits)
|
|
{
|
|
this.cipher = cipher;
|
|
this.macSizeBits = macSizeBits;
|
|
}
|
|
|
|
// Token: 0x0600B92B RID: 47403 RVA: 0x00282E54 File Offset: 0x00281054
|
|
[Token(Token = "0x600B92B")]
|
|
[Address(RVA = "0x25B91C0", Offset = "0x25B81C0", VA = "0x1825B91C0", Slot = "4")]
|
|
public void Init(ICipherParameters parameters)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600B92B)
|
|
|
|
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: 0x17001D2D RID: 7469
|
|
// (get) Token: 0x0600B92C RID: 47404 RVA: 0x00282E90 File Offset: 0x00281090
|
|
[Token(Token = "0x17001D2D")]
|
|
public string AlgorithmName
|
|
{
|
|
[Token(Token = "0x600B92C")]
|
|
[Address(RVA = "0x25B93F0", Offset = "0x25B83F0", VA = "0x1825B93F0", Slot = "5")]
|
|
get
|
|
{
|
|
IBlockCipher blockCipher = this.cipher.cipher;
|
|
string text;
|
|
return text;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600B92D RID: 47405 RVA: 0x00282EB0 File Offset: 0x002810B0
|
|
[Token(Token = "0x600B92D")]
|
|
[Address(RVA = "0x25B91B0", Offset = "0x25B81B0", VA = "0x1825B91B0", Slot = "6")]
|
|
public int GetMacSize()
|
|
{
|
|
return this.macSizeBits;
|
|
}
|
|
|
|
// Token: 0x0600B92E RID: 47406 RVA: 0x00282EC4 File Offset: 0x002810C4
|
|
[Token(Token = "0x600B92E")]
|
|
[Address(RVA = "0x25B93A0", Offset = "0x25B83A0", VA = "0x1825B93A0", Slot = "7")]
|
|
public void Update(byte input)
|
|
{
|
|
this.cipher.ProcessAadByte(input);
|
|
}
|
|
|
|
// Token: 0x0600B92F RID: 47407 RVA: 0x00282EE4 File Offset: 0x002810E4
|
|
[Token(Token = "0x600B92F")]
|
|
[Address(RVA = "0x25B90B0", Offset = "0x25B80B0", VA = "0x1825B90B0", Slot = "8")]
|
|
public void BlockUpdate(byte[] input, int inOff, int len)
|
|
{
|
|
this.cipher.ProcessAadBytes(input, inOff, len);
|
|
}
|
|
|
|
// Token: 0x0600B930 RID: 47408 RVA: 0x00282F08 File Offset: 0x00281108
|
|
[Token(Token = "0x600B930")]
|
|
[Address(RVA = "0x25B90E0", Offset = "0x25B80E0", VA = "0x1825B90E0", Slot = "9")]
|
|
public int DoFinal(byte[] output, int outOff)
|
|
{
|
|
return this.cipher.DoFinal(output, outOff);
|
|
}
|
|
|
|
// Token: 0x0600B931 RID: 47409 RVA: 0x00282F30 File Offset: 0x00281130
|
|
[Token(Token = "0x600B931")]
|
|
[Address(RVA = "0x25B9380", Offset = "0x25B8380", VA = "0x1825B9380", Slot = "10")]
|
|
public void Reset()
|
|
{
|
|
this.cipher.Reset();
|
|
}
|
|
|
|
// Token: 0x040074C6 RID: 29894
|
|
[FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x40074C6")]
|
|
private readonly GcmBlockCipher cipher;
|
|
|
|
// Token: 0x040074C7 RID: 29895
|
|
[FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x40074C7")]
|
|
private readonly int macSizeBits;
|
|
}
|
|
}
|