Files
27Aug2021-Cpp2IL-Dump/Assembly-CSharp/BestHTTP/SecureProtocol/Org/BouncyCastle/Crypto/Macs/ISO9797Alg3Mac.cs
T
niko c12fbe3fc6 m
2026-04-12 16:51:38 +02:00

246 lines
11 KiB
C#

using System;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Paddings;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs
{
// Token: 0x02001D32 RID: 7474
[Token(Token = "0x2001D32")]
public class ISO9797Alg3Mac : IMac
{
// Token: 0x0600B94A RID: 47434 RVA: 0x002838A4 File Offset: 0x00281AA4
[Token(Token = "0x600B94A")]
[Address(RVA = "0x25BE020", Offset = "0x25BD020", VA = "0x1825BE020")]
public ISO9797Alg3Mac(IBlockCipher cipher)
{
}
// Token: 0x0600B94B RID: 47435 RVA: 0x002838B8 File Offset: 0x00281AB8
[Token(Token = "0x600B94B")]
[Address(RVA = "0x25BE0A0", Offset = "0x25BD0A0", VA = "0x1825BE0A0")]
public ISO9797Alg3Mac(IBlockCipher cipher, IBlockCipherPadding padding)
{
}
// Token: 0x0600B94C RID: 47436 RVA: 0x002838CC File Offset: 0x00281ACC
[Token(Token = "0x600B94C")]
[Address(RVA = "0x25BDE50", Offset = "0x25BCE50", VA = "0x1825BDE50")]
public ISO9797Alg3Mac(IBlockCipher cipher, int macSizeInBits)
{
}
// Token: 0x0600B94D RID: 47437 RVA: 0x002838DC File Offset: 0x00281ADC
[Token(Token = "0x600B94D")]
[Address(RVA = "0x25BDE70", Offset = "0x25BCE70", VA = "0x1825BDE70")]
public ISO9797Alg3Mac(IBlockCipher cipher, int macSizeInBits, IBlockCipherPadding padding)
{
/*
An exception occurred when decompiling this method (0600B94D)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs.ISO9797Alg3Mac::.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_66:
stloc:ArgumentException(var_6_70, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("cipher must be instance of DesEngine")))
}
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: 0x17001D30 RID: 7472
// (get) Token: 0x0600B94E RID: 47438 RVA: 0x0028395C File Offset: 0x00281B5C
[Token(Token = "0x17001D30")]
public string AlgorithmName
{
[Token(Token = "0x600B94E")]
[Address(RVA = "0x25BE130", Offset = "0x25BD130", VA = "0x1825BE130", Slot = "5")]
get
{
return "ISO9797Alg3";
}
}
// Token: 0x0600B94F RID: 47439 RVA: 0x00283970 File Offset: 0x00281B70
[Token(Token = "0x600B94F")]
[Address(RVA = "0x25BD830", Offset = "0x25BC830", VA = "0x1825BD830", Slot = "4")]
public void Init(ICipherParameters parameters)
{
/*
An exception occurred when decompiling this method (0600B94F)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs.ISO9797Alg3Mac::Init(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_110:
stloc:ArgumentException(var_27_11A, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("Key must be either 112 or 168 bit long")))
}
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: 0x0600B950 RID: 47440 RVA: 0x00283A98 File Offset: 0x00281C98
[Token(Token = "0x600B950")]
[Address(RVA = "0x42B830", Offset = "0x42A830", VA = "0x18042B830", Slot = "6")]
public int GetMacSize()
{
return this.macSize;
}
// Token: 0x0600B951 RID: 47441 RVA: 0x00283AAC File Offset: 0x00281CAC
[Token(Token = "0x600B951")]
[Address(RVA = "0x25BDDA0", Offset = "0x25BCDA0", VA = "0x1825BDDA0", Slot = "7")]
public void Update(byte input)
{
byte[] array = this.buf;
int num = this.bufOff;
if (num == array.Length)
{
IBlockCipher blockCipher = this.cipher;
byte[] array2 = this.mac;
}
int num2 = num + 1;
this.bufOff = num2;
}
// Token: 0x0600B952 RID: 47442 RVA: 0x00283AF8 File Offset: 0x00281CF8
[Token(Token = "0x600B952")]
[Address(RVA = "0x25BD380", Offset = "0x25BC380", VA = "0x1825BD380", Slot = "8")]
public void BlockUpdate(byte[] input, int inOff, int len)
{
IBlockCipher blockCipher = this.cipher;
int num = this.bufOff;
IBlockCipher blockCipher2 = this.cipher;
byte[] array = this.mac;
int num2 = 0;
this.bufOff = num2;
IBlockCipher blockCipher3 = this.cipher;
if (num2 < blockCipher2)
{
num2 += num2;
num2++;
}
array += num2;
byte[] array2 = this.buf;
Array.Copy(input, inOff, array2, num, len);
}
// Token: 0x0600B953 RID: 47443 RVA: 0x00283B78 File Offset: 0x00281D78
[Token(Token = "0x600B953")]
[Address(RVA = "0x25BD5A0", Offset = "0x25BC5A0", VA = "0x1825BD5A0", 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.mac;
this.bufOff = num;
}
IBlockCipher blockCipher3 = this.cipher;
byte[] array2 = this.mac;
DesEngine desEngine = new DesEngine();
int[] workingKey = desEngine.GetWorkingKey();
int blockSize = desEngine.GetBlockSize();
int[] workingKey2 = desEngine.GetWorkingKey();
int blockSize2 = desEngine.GetBlockSize();
int num2 = this.macSize;
byte[] array3 = this.mac;
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: 0x0600B954 RID: 47444 RVA: 0x00283C78 File Offset: 0x00281E78
[Token(Token = "0x600B954")]
[Address(RVA = "0x25BDD30", Offset = "0x25BCD30", VA = "0x1825BDD30", 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: 0x040074DA RID: 29914
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40074DA")]
private byte[] mac;
// Token: 0x040074DB RID: 29915
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40074DB")]
private byte[] buf;
// Token: 0x040074DC RID: 29916
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x40074DC")]
private int bufOff;
// Token: 0x040074DD RID: 29917
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x40074DD")]
private IBlockCipher cipher;
// Token: 0x040074DE RID: 29918
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x40074DE")]
private IBlockCipherPadding padding;
// Token: 0x040074DF RID: 29919
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x40074DF")]
private int macSize;
// Token: 0x040074E0 RID: 29920
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x40074E0")]
private KeyParameter lastKey2;
// Token: 0x040074E1 RID: 29921
[FieldOffset(Offset = "0x48")]
[Token(Token = "0x40074E1")]
private KeyParameter lastKey3;
}
}