Files
2026-04-08 23:40:05 +02:00

248 lines
12 KiB
C#

using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs
{
// Token: 0x02001671 RID: 5745
[Token(Token = "0x2001671")]
[StructLayout(3)]
public class Dstu7624Mac : IMac
{
// Token: 0x06009977 RID: 39287 RVA: 0x002222F4 File Offset: 0x002204F4
[Token(Token = "0x6009977")]
[Address(RVA = "0x20E9D80", Offset = "0x20E8780", VA = "0x1820E9D80")]
public Dstu7624Mac(int blockSizeBits, int q)
{
Dstu7624Engine dstu7624Engine = new Dstu7624Engine(blockSizeBits);
this.engine = dstu7624Engine;
this.blockSize = dstu7624Engine;
this.macSize = blockSizeBits;
byte[] array = new byte[dstu7624Engine];
int num = this.blockSize;
this.c = array;
byte[] array2 = new byte[num];
int num2 = this.blockSize;
this.cTemp = array2;
byte[] array3 = new byte[num2];
int num3 = this.blockSize;
this.kDelta = array3;
byte[] array4 = new byte[num3];
this.buf = array4;
}
// Token: 0x06009978 RID: 39288 RVA: 0x00222378 File Offset: 0x00220578
[Token(Token = "0x6009978")]
[Address(RVA = "0x20E9980", Offset = "0x20E8380", VA = "0x1820E9980", Slot = "4")]
public void Init(ICipherParameters parameters)
{
/*
An exception occurred when decompiling this method (06009978)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs.Dstu7624Mac::Init(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_25:
stloc:ArgumentException(var_6_36, newobj:ArgumentException(ArgumentException::.ctor, call:string(string::Concat, ldstr:string("invalid parameter passed to Dstu7624Mac init - "), ldloc:string(var_5))))
}
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: 0x1700188E RID: 6286
// (get) Token: 0x06009979 RID: 39289 RVA: 0x002223BC File Offset: 0x002205BC
[Token(Token = "0x1700188E")]
public string AlgorithmName
{
[Token(Token = "0x6009979")]
[Address(RVA = "0x20E9E60", Offset = "0x20E8860", VA = "0x1820E9E60", Slot = "5")]
get
{
return "Dstu7624Mac";
}
}
// Token: 0x0600997A RID: 39290 RVA: 0x002223D0 File Offset: 0x002205D0
[Token(Token = "0x600997A")]
[Address(RVA = "0x3C1C50", Offset = "0x3C0650", VA = "0x1803C1C50", Slot = "6")]
public int GetMacSize()
{
return this.macSize;
}
// Token: 0x0600997B RID: 39291 RVA: 0x002223E4 File Offset: 0x002205E4
[Token(Token = "0x600997B")]
[Address(RVA = "0x20E9BF0", Offset = "0x20E85F0", VA = "0x1820E9BF0", Slot = "7")]
public void Update(byte input)
{
byte[] array = this.buf;
int num = this.bufOff;
if (num == array.Length)
{
byte[] array2 = this.cTemp;
int num2 = 0;
byte[] array3 = this.c;
int num3 = 0;
this.Xor(array3, num3, array, num2, array2);
Dstu7624Engine dstu7624Engine = this.engine;
}
int num4 = num + 1;
this.bufOff = num4;
}
// Token: 0x0600997C RID: 39292 RVA: 0x00222448 File Offset: 0x00220648
[Token(Token = "0x600997C")]
[Address(RVA = "0x20E9660", Offset = "0x20E8060", VA = "0x1820E9660", Slot = "8")]
public void BlockUpdate(byte[] input, int inOff, int len)
{
string text = this.engine.AlgorithmName;
int num = this.bufOff;
int num2 = 0;
text -= num;
if (len > text)
{
byte[] array = this.buf;
int num3 = 0;
this.processBlock(array, num3);
this.bufOff = num2;
if (len > text)
{
byte[] array2 = this.cTemp;
byte[] array3 = this.c;
int num4 = 0;
this.Xor(array3, num4, input, inOff, array2);
Dstu7624Engine dstu7624Engine = this.engine;
}
}
byte[] array4 = this.buf;
Array.Copy(input, inOff, array4, num, len);
}
// Token: 0x0600997D RID: 39293 RVA: 0x002224D8 File Offset: 0x002206D8
[Token(Token = "0x600997D")]
[Address(RVA = "0x20E9E90", Offset = "0x20E8890", VA = "0x1820E9E90")]
private void processBlock(byte[] input, int inOff)
{
byte[] array = this.cTemp;
byte[] array2 = this.c;
int num = 0;
this.Xor(array2, num, input, inOff, array);
Dstu7624Engine dstu7624Engine = this.engine;
}
// Token: 0x0600997E RID: 39294 RVA: 0x00222510 File Offset: 0x00220710
[Token(Token = "0x600997E")]
[Address(RVA = "0x20E9CB0", Offset = "0x20E86B0", VA = "0x1820E9CB0")]
private void Xor(byte[] c, int cOff, byte[] input, int inOff, byte[] xorResult)
{
if (this.blockSize > 0)
{
byte b;
input[0] = b;
}
}
// Token: 0x0600997F RID: 39295 RVA: 0x00222534 File Offset: 0x00220734
[Token(Token = "0x600997F")]
[Address(RVA = "0x20E9800", Offset = "0x20E8200", VA = "0x1820E9800", Slot = "9")]
public int DoFinal(byte[] output, int outOff)
{
/*
An exception occurred when decompiling this method (0600997F)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int32 BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs.Dstu7624Mac::DoFinal(System.Byte[],System.Int32)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_89:
stloc:DataLengthException(var_13_93, newobj:DataLengthException(DataLengthException::.ctor, ldstr:string("Input must be a multiple of blocksize")))
}
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: 0x06009980 RID: 39296 RVA: 0x002225D8 File Offset: 0x002207D8
[Token(Token = "0x6009980")]
[Address(RVA = "0x20E9B10", Offset = "0x20E8510", VA = "0x1820E9B10", Slot = "10")]
public void Reset()
{
byte[] array = this.c;
int num = 0;
Arrays.Fill(array, (byte)num);
byte[] array2 = this.cTemp;
int num2 = 0;
Arrays.Fill(array2, (byte)num2);
byte[] array3 = this.kDelta;
int num3 = 0;
Arrays.Fill(array3, (byte)num3);
byte[] array4 = this.buf;
int num4 = 0;
Arrays.Fill(array4, (byte)num4);
bool isPartialBlockOkay = this.engine.IsPartialBlockOkay;
Dstu7624Engine dstu7624Engine = this.engine;
int num5 = 0;
this.bufOff = num5;
}
// Token: 0x040064C2 RID: 25794
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x40064C2")]
private int macSize;
// Token: 0x040064C3 RID: 25795
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x40064C3")]
private Dstu7624Engine engine;
// Token: 0x040064C4 RID: 25796
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x40064C4")]
private int blockSize;
// Token: 0x040064C5 RID: 25797
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x40064C5")]
private byte[] c;
// Token: 0x040064C6 RID: 25798
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
[Token(Token = "0x40064C6")]
private byte[] cTemp;
// Token: 0x040064C7 RID: 25799
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
[Token(Token = "0x40064C7")]
private byte[] kDelta;
// Token: 0x040064C8 RID: 25800
[global::Cpp2IlInjected.FieldOffset(Offset = "0x40")]
[Token(Token = "0x40064C8")]
private byte[] buf;
// Token: 0x040064C9 RID: 25801
[global::Cpp2IlInjected.FieldOffset(Offset = "0x48")]
[Token(Token = "0x40064C9")]
private int bufOff;
}
}