Files
Aug2021-Cpp2IL-Dump/Assembly-CSharp/BestHTTP/SecureProtocol/Org/BouncyCastle/Crypto/Macs/VmpcMac.cs
T
2026-04-10 22:50:51 +02:00

338 lines
12 KiB
C#

using System;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs
{
// Token: 0x02001C56 RID: 7254
[Token(Token = "0x2001C56")]
public class VmpcMac : IMac
{
// Token: 0x0600B5A9 RID: 46505 RVA: 0x0027B664 File Offset: 0x00279864
[Token(Token = "0x600B5A9")]
[Address(RVA = "0x1C32D40", Offset = "0x1C31B40", VA = "0x181C32D40", Slot = "11")]
public virtual int DoFinal(byte[] output, int outOff)
{
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;
byte b5 = this.x3;
byte b6 = this.x4;
b6 += b5;
uint num;
b6 = (byte)((uint)b6 + num);
b3 = b6;
byte b7;
this.x4 = b7;
b7 = (byte)((uint)b7 + num);
b3 = b7;
byte b8;
this.x3 = b8;
byte b9 = this.x1;
b8 = (byte)((uint)b8 + num);
b3 = b8;
byte b10;
this.x2 = b10;
b10 = b4;
b10 += b9;
b10 = (byte)((uint)b10 + num);
b3 = b10;
byte[] t = this.T;
byte b11;
this.x1 = b11;
byte b12 = this.g;
byte[] t2 = this.T;
byte b13 = this.g;
byte[] t3 = this.T;
byte b14 = this.g;
byte[] t4 = this.T;
byte b15 = this.g;
byte b16 = this.g;
byte[] p2 = this.P;
this.g = b16;
byte b17 = this.n;
int length2 = p2.Length;
byte b18 = this.s;
byte[] p3 = this.P;
byte b19 = this.s;
num += (uint)1;
int num2 = 0;
byte[] p4 = this.P;
int length3 = p4.Length;
byte[] t5 = this.T;
byte b20;
byte b21;
b20 += b21;
byte b22 = this.s;
b20 += b22;
byte b23;
this.s = b23;
int length4 = p4.Length;
byte[] p5 = this.P;
byte b24 = this.s;
num2++;
byte[] array = new byte[20];
int num3 = 0;
byte[] p6 = this.P;
int length5 = p6.Length;
byte b25 = this.s;
byte b26;
b26 += b25;
byte b27;
this.s = b27;
int length6 = p6.Length;
int length7 = this.P.Length;
byte b28 = this.s;
byte[] p7 = this.P;
byte b29 = this.s;
num3++;
int length8 = array.Length;
int num4 = 0;
Array.Copy(array, num4, output, outOff, length8);
return array.Length;
}
// Token: 0x17001C97 RID: 7319
// (get) Token: 0x0600B5AA RID: 46506 RVA: 0x0027B888 File Offset: 0x00279A88
[Token(Token = "0x17001C97")]
public virtual string AlgorithmName
{
[Token(Token = "0x600B5AA")]
[Address(RVA = "0x1C33AA0", Offset = "0x1C328A0", VA = "0x181C33AA0", Slot = "12")]
get
{
return "VMPC-MAC";
}
}
// Token: 0x0600B5AB RID: 46507 RVA: 0x0027B89C File Offset: 0x00279A9C
[Token(Token = "0x600B5AB")]
[Address(RVA = "0x4B5D20", Offset = "0x4B4B20", VA = "0x1804B5D20", Slot = "13")]
public virtual int GetMacSize()
{
return 20;
}
// Token: 0x0600B5AC RID: 46508 RVA: 0x0027B8AC File Offset: 0x00279AAC
[Token(Token = "0x600B5AC")]
[Address(RVA = "0x1C33400", Offset = "0x1C32200", VA = "0x181C33400", Slot = "14")]
public virtual void Init(ICipherParameters parameters)
{
/*
An exception occurred when decompiling this method (0600B5AC)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs.VmpcMac::Init(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_51:
stloc:ArgumentException(var_8_60, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("VMPC-MAC requires 1 to 768 bytes of IV"), ldstr:string("parameters")))
}
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: 0x0600B5AD RID: 46509 RVA: 0x0027B91C File Offset: 0x00279B1C
[Token(Token = "0x600B5AD")]
[Address(RVA = "0x1C33AD0", Offset = "0x1C328D0", VA = "0x181C33AD0")]
private 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: 0x0600B5AE RID: 46510 RVA: 0x0027BA14 File Offset: 0x00279C14
[Token(Token = "0x600B5AE")]
[Address(RVA = "0x1C33660", Offset = "0x1C32460", VA = "0x181C33660", Slot = "15")]
public virtual void Reset()
{
byte[] array = this.workingIV;
byte[] array2 = this.workingKey;
this.initKey(array2, array);
this.g = (byte)((ulong)0L);
this.x1 = (byte)((ulong)0L);
byte[] array3 = new byte[32];
this.T = array3;
int num = 0;
byte[] t = this.T;
num++;
}
// Token: 0x0600B5AF RID: 46511 RVA: 0x0027BA6C File Offset: 0x00279C6C
[Token(Token = "0x600B5AF")]
[Address(RVA = "0x1C33700", Offset = "0x1C32500", VA = "0x181C33700", Slot = "16")]
public virtual void Update(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 b5 = this.x3;
byte b6 = this.x4;
b6 += b5;
byte b7;
this.x4 = b7;
byte b8;
this.x3 = b8;
b7 = b8;
byte b9;
this.x2 = b9;
byte b10 = this.s;
b10 += b9;
b9 = b10;
byte[] t = this.T;
byte b11;
this.x1 = b11;
byte b12 = this.g;
byte[] t2 = this.T;
byte b13 = this.g;
byte b14 = this.x2;
byte[] t3 = this.T;
byte b15 = this.g;
byte b16 = this.x3;
byte[] t4 = this.T;
byte b17 = this.g;
byte b18 = this.g;
this.g = b18;
byte[] p2 = this.P;
byte b19 = this.n;
int length3 = p2.Length;
byte b20 = this.s;
byte b21;
p2[0] = b21;
byte[] p3 = this.P;
byte b22 = this.s;
}
// Token: 0x0600B5B0 RID: 46512 RVA: 0x0027BBA4 File Offset: 0x00279DA4
[Token(Token = "0x600B5B0")]
[Address(RVA = "0x1C32C50", Offset = "0x1C31A50", VA = "0x181C32C50", Slot = "17")]
public virtual void BlockUpdate(byte[] input, int inOff, int len)
{
if (len > 0)
{
this.Reset();
}
}
// Token: 0x0600B5B1 RID: 46513 RVA: 0x0027BBC4 File Offset: 0x00279DC4
[Token(Token = "0x600B5B1")]
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
public VmpcMac()
{
}
// Token: 0x0400734F RID: 29519
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x400734F")]
private byte g;
// Token: 0x04007350 RID: 29520
[FieldOffset(Offset = "0x11")]
[Token(Token = "0x4007350")]
private byte n;
// Token: 0x04007351 RID: 29521
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007351")]
private byte[] P;
// Token: 0x04007352 RID: 29522
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007352")]
private byte s;
// Token: 0x04007353 RID: 29523
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007353")]
private byte[] T;
// Token: 0x04007354 RID: 29524
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4007354")]
private byte[] workingIV;
// Token: 0x04007355 RID: 29525
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x4007355")]
private byte[] workingKey;
// Token: 0x04007356 RID: 29526
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x4007356")]
private byte x1;
// Token: 0x04007357 RID: 29527
[FieldOffset(Offset = "0x41")]
[Token(Token = "0x4007357")]
private byte x2;
// Token: 0x04007358 RID: 29528
[FieldOffset(Offset = "0x42")]
[Token(Token = "0x4007358")]
private byte x3;
// Token: 0x04007359 RID: 29529
[FieldOffset(Offset = "0x43")]
[Token(Token = "0x4007359")]
private byte x4;
}
}