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

182 lines
8.3 KiB
C#

using System;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines
{
// Token: 0x02001D98 RID: 7576
[Token(Token = "0x2001D98")]
public class VmpcEngine : IStreamCipher
{
// Token: 0x17001D9A RID: 7578
// (get) Token: 0x0600BD1D RID: 48413 RVA: 0x002A2528 File Offset: 0x002A0728
[Token(Token = "0x17001D9A")]
public virtual string AlgorithmName
{
[Token(Token = "0x600BD1D")]
[Address(RVA = "0x2594E60", Offset = "0x2593E60", VA = "0x182594E60", Slot = "9")]
get
{
return "VMPC";
}
}
// Token: 0x0600BD1E RID: 48414 RVA: 0x002A253C File Offset: 0x002A073C
[Token(Token = "0x600BD1E")]
[Address(RVA = "0x25947C0", Offset = "0x25937C0", VA = "0x1825947C0", Slot = "10")]
public virtual void Init(bool forEncryption, ICipherParameters parameters)
{
/*
An exception occurred when decompiling this method (0600BD1E)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines.VmpcEngine::Init(System.Boolean,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_4C:
stloc:ArgumentException(var_8_56, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("VMPC requires 1 to 768 bytes of IV")))
}
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.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.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: 0x0600BD1F RID: 48415 RVA: 0x002A25A0 File Offset: 0x002A07A0
[Token(Token = "0x600BD1F")]
[Address(RVA = "0x2594490", Offset = "0x2593490", VA = "0x182594490", Slot = "11")]
protected virtual void InitKey(byte[] keyBytes, byte[] ivBytes)
{
this.s = (byte)((ulong)0L);
byte[] array = new byte[256];
int num = 0;
this.P = array;
byte[] p = this.P;
num++;
byte[] p2 = this.P;
int length = p2.Length;
byte b = p[keyBytes];
byte b2;
b += b2;
byte b3 = this.s;
b += b3;
byte b4;
this.s = b4;
int length2 = p2.Length;
byte[] p3 = this.P;
byte b5 = this.s;
num++;
byte[] p4 = this.P;
int length3 = p4.Length;
int length4 = ivBytes.Length;
byte b6;
byte b7;
b6 += b7;
byte b8 = this.s;
b6 += b8;
byte b9;
this.s = b9;
int length5 = p4.Length;
byte[] p5 = this.P;
byte b10 = this.s;
num++;
this.n = (byte)((ulong)0L);
}
// Token: 0x0600BD20 RID: 48416 RVA: 0x002A2698 File Offset: 0x002A0898
[Token(Token = "0x600BD20")]
[Address(RVA = "0x2594A10", Offset = "0x2593A10", VA = "0x182594A10", Slot = "12")]
public virtual void ProcessBytes(byte[] input, int inOff, int len, byte[] output, int outOff)
{
Check.DataLength(input, inOff, inOff, "input buffer too short");
if (len > 0)
{
byte[] p = this.P;
byte b = this.n;
int length = p.Length;
byte b2 = this.s;
byte b3;
b3 += b2;
byte b4;
this.s = b4;
int length2 = p.Length;
byte[] p2 = this.P;
byte b5 = this.s;
}
}
// Token: 0x0600BD21 RID: 48417 RVA: 0x002A2710 File Offset: 0x002A0910
[Token(Token = "0x600BD21")]
[Address(RVA = "0x2594CA0", Offset = "0x2593CA0", VA = "0x182594CA0", Slot = "13")]
public virtual void Reset()
{
string algorithmName = ((IStreamCipher)this).AlgorithmName;
}
// Token: 0x0600BD22 RID: 48418 RVA: 0x002A2724 File Offset: 0x002A0924
[Token(Token = "0x600BD22")]
[Address(RVA = "0x2594CC0", Offset = "0x2593CC0", VA = "0x182594CC0", Slot = "14")]
public virtual byte ReturnByte(byte input)
{
byte[] p = this.P;
byte b = this.n;
int length = p.Length;
byte b2 = this.s;
byte b3;
b3 += b2;
byte b4;
this.s = b4;
int length2 = p.Length;
byte[] p2 = this.P;
byte b5 = this.s;
byte b6;
return b6;
}
// Token: 0x0600BD23 RID: 48419 RVA: 0x002A2788 File Offset: 0x002A0988
[Token(Token = "0x600BD23")]
[Address(RVA = "0x412370", Offset = "0x411370", VA = "0x180412370")]
public VmpcEngine()
{
}
// Token: 0x040077AE RID: 30638
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40077AE")]
protected byte n;
// Token: 0x040077AF RID: 30639
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40077AF")]
protected byte[] P;
// Token: 0x040077B0 RID: 30640
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x40077B0")]
protected byte s;
// Token: 0x040077B1 RID: 30641
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x40077B1")]
protected byte[] workingIV;
// Token: 0x040077B2 RID: 30642
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x40077B2")]
protected byte[] workingKey;
}
}