216 lines
9.0 KiB
C#
216 lines
9.0 KiB
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Paddings;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs
|
|
{
|
|
// Token: 0x0200166D RID: 5741
|
|
[Token(Token = "0x200166D")]
|
|
[StructLayout(3)]
|
|
public class CbcBlockCipherMac : IMac
|
|
{
|
|
// Token: 0x0600994F RID: 39247 RVA: 0x002216B8 File Offset: 0x0021F8B8
|
|
[Token(Token = "0x600994F")]
|
|
[Address(RVA = "0x20E5120", Offset = "0x20E3B20", VA = "0x1820E5120")]
|
|
public CbcBlockCipherMac(IBlockCipher cipher)
|
|
{
|
|
}
|
|
|
|
// Token: 0x06009950 RID: 39248 RVA: 0x002216CC File Offset: 0x0021F8CC
|
|
[Token(Token = "0x6009950")]
|
|
[Address(RVA = "0x20E5070", Offset = "0x20E3A70", VA = "0x1820E5070")]
|
|
public CbcBlockCipherMac(IBlockCipher cipher, IBlockCipherPadding padding)
|
|
{
|
|
}
|
|
|
|
// Token: 0x06009951 RID: 39249 RVA: 0x002216E0 File Offset: 0x0021F8E0
|
|
[Token(Token = "0x6009951")]
|
|
[Address(RVA = "0x20E5100", Offset = "0x20E3B00", VA = "0x1820E5100")]
|
|
public CbcBlockCipherMac(IBlockCipher cipher, int macSizeInBits)
|
|
{
|
|
}
|
|
|
|
// Token: 0x06009952 RID: 39250 RVA: 0x002216F0 File Offset: 0x0021F8F0
|
|
[Token(Token = "0x6009952")]
|
|
[Address(RVA = "0x20E4F60", Offset = "0x20E3960", VA = "0x1820E4F60")]
|
|
public CbcBlockCipherMac(IBlockCipher cipher, int macSizeInBits, IBlockCipherPadding padding)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (06009952)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs.CbcBlockCipherMac::.ctor(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IBlockCipher,System.Int32,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Paddings.IBlockCipherPadding)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_40:
|
|
stloc:ArgumentException(var_3_4A, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("MAC size must be multiple of 8")))
|
|
}
|
|
|
|
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: 0x17001889 RID: 6281
|
|
// (get) Token: 0x06009953 RID: 39251 RVA: 0x00221748 File Offset: 0x0021F948
|
|
[Token(Token = "0x17001889")]
|
|
public string AlgorithmName
|
|
{
|
|
[Token(Token = "0x6009953")]
|
|
[Address(RVA = "0x20E51A0", Offset = "0x20E3BA0", VA = "0x1820E51A0", Slot = "5")]
|
|
get
|
|
{
|
|
IBlockCipher blockCipher = this.cipher;
|
|
throw new NullReferenceException();
|
|
}
|
|
}
|
|
|
|
// Token: 0x06009954 RID: 39252 RVA: 0x00221764 File Offset: 0x0021F964
|
|
[Token(Token = "0x6009954")]
|
|
[Address(RVA = "0x20E4D80", Offset = "0x20E3780", VA = "0x1820E4D80", Slot = "4")]
|
|
public void Init(ICipherParameters parameters)
|
|
{
|
|
byte[] array = this.buf;
|
|
int length = array.Length;
|
|
int num = 0;
|
|
Array.Clear(array, num, length);
|
|
IBlockCipher blockCipher = this.cipher;
|
|
this.bufOff = (int)((ulong)0L);
|
|
IBlockCipher blockCipher2 = this.cipher;
|
|
}
|
|
|
|
// Token: 0x06009955 RID: 39253 RVA: 0x002217A8 File Offset: 0x0021F9A8
|
|
[Token(Token = "0x6009955")]
|
|
[Address(RVA = "0x3EDF60", Offset = "0x3EC960", VA = "0x1803EDF60", Slot = "6")]
|
|
public int GetMacSize()
|
|
{
|
|
return this.macSize;
|
|
}
|
|
|
|
// Token: 0x06009956 RID: 39254 RVA: 0x002217BC File Offset: 0x0021F9BC
|
|
[Token(Token = "0x6009956")]
|
|
[Address(RVA = "0x20E4EB0", Offset = "0x20E38B0", VA = "0x1820E4EB0", Slot = "7")]
|
|
public void Update(byte input)
|
|
{
|
|
byte[] array = this.buf;
|
|
int num = this.bufOff;
|
|
if (num == array.Length)
|
|
{
|
|
IBlockCipher blockCipher = this.cipher;
|
|
}
|
|
int num2 = num + 1;
|
|
this.bufOff = num2;
|
|
}
|
|
|
|
// Token: 0x06009957 RID: 39255 RVA: 0x00221800 File Offset: 0x0021FA00
|
|
[Token(Token = "0x6009957")]
|
|
[Address(RVA = "0x20E49B0", Offset = "0x20E33B0", VA = "0x1820E49B0", Slot = "8")]
|
|
public void BlockUpdate(byte[] input, int inOff, int len)
|
|
{
|
|
IBlockCipher blockCipher = this.cipher;
|
|
int num = this.bufOff;
|
|
int num2 = 0;
|
|
IBlockCipher blockCipher2 = this.cipher;
|
|
byte[] array = this.buf;
|
|
this.bufOff = num2;
|
|
IBlockCipher blockCipher3 = this.cipher;
|
|
if (num2 < blockCipher2)
|
|
{
|
|
num2 += num2;
|
|
num2++;
|
|
}
|
|
byte[] array2 = this.buf;
|
|
Array.Copy(input, inOff, array2, num, len);
|
|
}
|
|
|
|
// Token: 0x06009958 RID: 39256 RVA: 0x00221868 File Offset: 0x0021FA68
|
|
[Token(Token = "0x6009958")]
|
|
[Address(RVA = "0x20E4BB0", Offset = "0x20E35B0", VA = "0x1820E4BB0", Slot = "9")]
|
|
public int DoFinal(byte[] output, int outOff)
|
|
{
|
|
IBlockCipher blockCipher = this.cipher;
|
|
int num = 0;
|
|
IBlockCipherPadding blockCipherPadding = this.padding;
|
|
int i = this.bufOff;
|
|
if (blockCipherPadding != 0)
|
|
{
|
|
if (i == blockCipher)
|
|
{
|
|
IBlockCipher blockCipher2 = this.cipher;
|
|
byte[] array = this.buf;
|
|
this.bufOff = num;
|
|
}
|
|
IBlockCipher blockCipher3 = this.cipher;
|
|
byte[] array2 = this.buf;
|
|
int num2 = this.macSize;
|
|
byte[] array3 = this.buf;
|
|
int num3 = 0;
|
|
Array.Copy(array3, num3, output, outOff, num2);
|
|
byte[] array4 = this.buf;
|
|
int length = array4.Length;
|
|
int num4 = 0;
|
|
Array.Clear(array4, num4, length);
|
|
IBlockCipher blockCipher4 = this.cipher;
|
|
this.bufOff = num;
|
|
return this.macSize;
|
|
}
|
|
while (i >= blockCipher)
|
|
{
|
|
}
|
|
byte[] array5 = this.buf;
|
|
int num5 = i + 1;
|
|
this.bufOff = num5;
|
|
int num6 = this.bufOff;
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x06009959 RID: 39257 RVA: 0x0022193C File Offset: 0x0021FB3C
|
|
[Token(Token = "0x6009959")]
|
|
[Address(RVA = "0x20E4E40", Offset = "0x20E3840", VA = "0x1820E4E40", Slot = "10")]
|
|
public void Reset()
|
|
{
|
|
byte[] array = this.buf;
|
|
int length = array.Length;
|
|
int num = 0;
|
|
Array.Clear(array, num, length);
|
|
IBlockCipher blockCipher = this.cipher;
|
|
this.bufOff = (int)((ulong)0L);
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x040064AD RID: 25773
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x40064AD")]
|
|
private byte[] buf;
|
|
|
|
// Token: 0x040064AE RID: 25774
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x40064AE")]
|
|
private int bufOff;
|
|
|
|
// Token: 0x040064AF RID: 25775
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x40064AF")]
|
|
private IBlockCipher cipher;
|
|
|
|
// Token: 0x040064B0 RID: 25776
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x40064B0")]
|
|
private IBlockCipherPadding padding;
|
|
|
|
// Token: 0x040064B1 RID: 25777
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
|
|
[Token(Token = "0x40064B1")]
|
|
private int macSize;
|
|
}
|
|
}
|