379 lines
12 KiB
C#
379 lines
12 KiB
C#
using System;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Runtime.InteropServices;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests
|
|
{
|
|
// Token: 0x0200170D RID: 5901
|
|
[Token(Token = "0x200170D")]
|
|
[StructLayout(3)]
|
|
public class MD2Digest : IDigest, IMemoable
|
|
{
|
|
// Token: 0x06009ED8 RID: 40664 RVA: 0x0024A58C File Offset: 0x0024878C
|
|
[Token(Token = "0x6009ED8")]
|
|
[Address(RVA = "0x2186640", Offset = "0x2185040", VA = "0x182186640")]
|
|
public MD2Digest()
|
|
{
|
|
byte[] array = new byte[48];
|
|
this.X = array;
|
|
byte[] array2 = new byte[16];
|
|
this.M = array2;
|
|
byte[] array3 = new byte[16];
|
|
this.C = array3;
|
|
base..ctor();
|
|
this.Reset();
|
|
}
|
|
|
|
// Token: 0x06009ED9 RID: 40665 RVA: 0x0024A5D4 File Offset: 0x002487D4
|
|
[Token(Token = "0x6009ED9")]
|
|
[Address(RVA = "0x21866C0", Offset = "0x21850C0", VA = "0x1821866C0")]
|
|
public MD2Digest(MD2Digest t)
|
|
{
|
|
byte[] array = new byte[48];
|
|
this.X = array;
|
|
byte[] array2 = new byte[16];
|
|
this.M = array2;
|
|
byte[] array3 = new byte[16];
|
|
this.C = array3;
|
|
base..ctor();
|
|
this.CopyIn(t);
|
|
}
|
|
|
|
// Token: 0x06009EDA RID: 40666 RVA: 0x0024A61C File Offset: 0x0024881C
|
|
[Token(Token = "0x6009EDA")]
|
|
[Address(RVA = "0x2185DB0", Offset = "0x21847B0", VA = "0x182185DB0")]
|
|
private void CopyIn(MD2Digest t)
|
|
{
|
|
byte[] x = t.X;
|
|
int length = x.Length;
|
|
int num = 0;
|
|
byte[] x2 = this.X;
|
|
int num2 = 0;
|
|
Array.Copy(x, num2, x2, num, length);
|
|
int num3 = t.xOff;
|
|
this.xOff = num3;
|
|
byte[] m = t.M;
|
|
int length2 = m.Length;
|
|
int num4 = 0;
|
|
byte[] m2 = this.M;
|
|
int num5 = 0;
|
|
Array.Copy(m, num5, m2, num4, length2);
|
|
int num6 = t.mOff;
|
|
this.mOff = num6;
|
|
byte[] c = t.C;
|
|
int length3 = c.Length;
|
|
int num7 = 0;
|
|
byte[] c2 = this.C;
|
|
int num8 = 0;
|
|
Array.Copy(c, num8, c2, num7, length3);
|
|
int coff = t.COff;
|
|
this.COff = coff;
|
|
}
|
|
|
|
// Token: 0x17001911 RID: 6417
|
|
// (get) Token: 0x06009EDB RID: 40667 RVA: 0x0024A6E0 File Offset: 0x002488E0
|
|
[Token(Token = "0x17001911")]
|
|
public string AlgorithmName
|
|
{
|
|
[Token(Token = "0x6009EDB")]
|
|
[Address(RVA = "0x2186750", Offset = "0x2185150", VA = "0x182186750", Slot = "4")]
|
|
get
|
|
{
|
|
return "MD2";
|
|
}
|
|
}
|
|
|
|
// Token: 0x06009EDC RID: 40668 RVA: 0x0024A6F4 File Offset: 0x002488F4
|
|
[Token(Token = "0x6009EDC")]
|
|
[Address(RVA = "0x11B1BB0", Offset = "0x11B05B0", VA = "0x1811B1BB0", Slot = "5")]
|
|
public int GetDigestSize()
|
|
{
|
|
return 16;
|
|
}
|
|
|
|
// Token: 0x06009EDD RID: 40669 RVA: 0x0024A704 File Offset: 0x00248904
|
|
[Token(Token = "0x6009EDD")]
|
|
[Address(RVA = "0x11B1BB0", Offset = "0x11B05B0", VA = "0x1811B1BB0", Slot = "6")]
|
|
public int GetByteLength()
|
|
{
|
|
return 16;
|
|
}
|
|
|
|
// Token: 0x06009EDE RID: 40670 RVA: 0x0024A714 File Offset: 0x00248914
|
|
[Token(Token = "0x6009EDE")]
|
|
[Address(RVA = "0x2185F30", Offset = "0x2184930", VA = "0x182185F30", Slot = "9")]
|
|
public int DoFinal(byte[] output, int outOff)
|
|
{
|
|
byte[] m = this.M;
|
|
int length = m.Length;
|
|
int num = this.mOff;
|
|
byte[] m2;
|
|
if (num < m.Length)
|
|
{
|
|
num++;
|
|
m2 = this.M;
|
|
}
|
|
this.ProcessChecksum(m2);
|
|
byte[] m3 = this.M;
|
|
this.ProcessBlock(m3);
|
|
byte[] c = this.C;
|
|
this.ProcessBlock(c);
|
|
int num2 = this.xOff;
|
|
ulong num3;
|
|
Array.Copy(this.X, num2, output, outOff, (int)num3);
|
|
this.Reset();
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x06009EDF RID: 40671 RVA: 0x0024A798 File Offset: 0x00248998
|
|
[Token(Token = "0x6009EDF")]
|
|
[Address(RVA = "0x21863B0", Offset = "0x2184DB0", VA = "0x1821863B0", Slot = "10")]
|
|
public void Reset()
|
|
{
|
|
do
|
|
{
|
|
int num = 0;
|
|
this.xOff = num;
|
|
byte[] x = this.X;
|
|
if (num != x.Length)
|
|
{
|
|
num++;
|
|
byte[] x2 = this.X;
|
|
}
|
|
byte[] m = this.M;
|
|
this.mOff = num;
|
|
if (num != m.Length)
|
|
{
|
|
num++;
|
|
if (this.M != 0)
|
|
{
|
|
continue;
|
|
}
|
|
}
|
|
byte[] c = this.C;
|
|
this.COff = num;
|
|
if (num == c.Length)
|
|
{
|
|
break;
|
|
}
|
|
num++;
|
|
}
|
|
while (this.C != 0);
|
|
}
|
|
|
|
// Token: 0x06009EE0 RID: 40672 RVA: 0x0024A81C File Offset: 0x00248A1C
|
|
[Token(Token = "0x6009EE0")]
|
|
[Address(RVA = "0x2186570", Offset = "0x2184F70", VA = "0x182186570", Slot = "7")]
|
|
public void Update(byte input)
|
|
{
|
|
byte[] m = this.M;
|
|
int num = this.mOff + 1;
|
|
this.mOff = num;
|
|
if (this.mOff == 16)
|
|
{
|
|
byte[] m2 = this.M;
|
|
this.ProcessChecksum(m2);
|
|
byte[] m3 = this.M;
|
|
this.ProcessBlock(m3);
|
|
this.mOff = (int)((ulong)0L);
|
|
}
|
|
}
|
|
|
|
// Token: 0x06009EE1 RID: 40673 RVA: 0x0024A878 File Offset: 0x00248A78
|
|
[Token(Token = "0x6009EE1")]
|
|
[Address(RVA = "0x2185BE0", Offset = "0x21845E0", VA = "0x182185BE0", Slot = "8")]
|
|
public void BlockUpdate(byte[] input, int inOff, int length)
|
|
{
|
|
int num = 0;
|
|
int num2 = this.mOff;
|
|
int num3;
|
|
if (num2 != 0 && length > 0)
|
|
{
|
|
byte[] m = this.M;
|
|
num3 = num2 + 1;
|
|
this.mOff = num3;
|
|
num3 = num2;
|
|
int num4 = this.mOff;
|
|
if (num4 == 16)
|
|
{
|
|
byte[] m2 = this.M;
|
|
this.ProcessChecksum(m2);
|
|
byte[] m3 = this.M;
|
|
this.ProcessBlock(m3);
|
|
this.mOff = num;
|
|
}
|
|
while (num4 != 0)
|
|
{
|
|
}
|
|
}
|
|
if (length > 16)
|
|
{
|
|
num3++;
|
|
byte[] m4 = this.M;
|
|
int num5 = 0;
|
|
ulong num6;
|
|
Array.Copy(input, inOff, m4, num5, (int)num6);
|
|
byte[] m5 = this.M;
|
|
this.ProcessChecksum(m5);
|
|
byte[] m6 = this.M;
|
|
this.ProcessBlock(m6);
|
|
while (length != 16)
|
|
{
|
|
}
|
|
}
|
|
if (length > 0)
|
|
{
|
|
int num7 = this.mOff;
|
|
byte[] m7 = this.M;
|
|
num3 = inOff;
|
|
int num8 = num7 + 1;
|
|
this.mOff = num8;
|
|
if (this.mOff == 16)
|
|
{
|
|
byte[] m8 = this.M;
|
|
this.ProcessChecksum(m8);
|
|
byte[] m9 = this.M;
|
|
this.ProcessBlock(m9);
|
|
this.mOff = num;
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x06009EE2 RID: 40674 RVA: 0x0024A98C File Offset: 0x00248B8C
|
|
[Token(Token = "0x6009EE2")]
|
|
[Address(RVA = "0x2186230", Offset = "0x2184C30", VA = "0x182186230")]
|
|
internal void ProcessChecksum(byte[] m)
|
|
{
|
|
byte b = this.C[1];
|
|
int num = 0;
|
|
byte[] s = MD2Digest.S;
|
|
byte[] c = this.C;
|
|
num++;
|
|
}
|
|
|
|
// Token: 0x06009EE3 RID: 40675 RVA: 0x0024A9C0 File Offset: 0x00248BC0
|
|
[Token(Token = "0x6009EE3")]
|
|
[Address(RVA = "0x2186020", Offset = "0x2184A20", VA = "0x182186020")]
|
|
internal void ProcessBlock(byte[] m)
|
|
{
|
|
int num = 0;
|
|
byte[] x = this.X;
|
|
int length = this.X.Length;
|
|
num++;
|
|
int num2 = 0;
|
|
int num3 = 0;
|
|
byte[] x2 = this.X;
|
|
num3 += x2;
|
|
byte[] s = MD2Digest.S;
|
|
num3++;
|
|
byte b = (byte)((int)b + num2);
|
|
if (num3 < 48)
|
|
{
|
|
}
|
|
num2++;
|
|
}
|
|
|
|
// Token: 0x06009EE4 RID: 40676 RVA: 0x0024AA24 File Offset: 0x00248C24
|
|
[Token(Token = "0x6009EE4")]
|
|
[Address(RVA = "0x2185E70", Offset = "0x2184870", VA = "0x182185E70", Slot = "11")]
|
|
public IMemoable Copy()
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (06009EE4)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IMemoable BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests.MD2Digest::Copy()
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
Block_0:
|
|
stloc:MD2Digest(var_0_05, newobj:MD2Digest(MD2Digest::.ctor))
|
|
stloc:uint8[](var_1_0D, newarr:uint8[]([mscorlib]System.Byte, ldc.i4:int32(48)))
|
|
stfld:uint8[](MD2Digest::X, ldloc:MD2Digest(var_0_05), ldloc:uint8[](var_1_0D))
|
|
stloc:uint8[](var_2_1C, newarr:uint8[]([mscorlib]System.Byte, ldc.i4:int32(16)))
|
|
stfld:uint8[](MD2Digest::M, ldloc:MD2Digest(var_0_05), ldloc:uint8[](var_2_1C))
|
|
stloc:uint8[](var_3_2B, newarr:uint8[]([mscorlib]System.Byte, ldc.i4:int32(16)))
|
|
stfld:uint8[](MD2Digest::C, ldloc:MD2Digest(var_0_05), ldloc:uint8[](var_3_2B))
|
|
call:void(MD2Digest::CopyIn, ldloc:MD2Digest(var_0_05), ldloc:MD2Digest(this))
|
|
}
|
|
|
|
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: 0x06009EE5 RID: 40677 RVA: 0x0024AA6C File Offset: 0x00248C6C
|
|
[Token(Token = "0x6009EE5")]
|
|
[Address(RVA = "0x21864D0", Offset = "0x2184ED0", VA = "0x1821864D0", Slot = "12")]
|
|
public void Reset(IMemoable other)
|
|
{
|
|
do
|
|
{
|
|
if (other == 0)
|
|
{
|
|
}
|
|
}
|
|
while (other == 0);
|
|
}
|
|
|
|
// Token: 0x06009EE6 RID: 40678 RVA: 0x0024AA84 File Offset: 0x00248C84
|
|
// Note: this type is marked as 'beforefieldinit'.
|
|
[Token(Token = "0x6009EE6")]
|
|
[Address(RVA = "0x21865E0", Offset = "0x2184FE0", VA = "0x1821865E0")]
|
|
static MD2Digest()
|
|
{
|
|
byte[] array = new byte[256];
|
|
RuntimeHelpers.InitializeArray(array, fieldof(<PrivateImplementationDetails>.D2C5BAE967587C6F3D9F2C4551911E0575A1101F).FieldHandle);
|
|
MD2Digest.S = array;
|
|
}
|
|
|
|
// Token: 0x0400686C RID: 26732
|
|
[Token(Token = "0x400686C")]
|
|
private const int DigestLength = 16;
|
|
|
|
// Token: 0x0400686D RID: 26733
|
|
[Token(Token = "0x400686D")]
|
|
private const int BYTE_LENGTH = 16;
|
|
|
|
// Token: 0x0400686E RID: 26734
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x400686E")]
|
|
private byte[] X;
|
|
|
|
// Token: 0x0400686F RID: 26735
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x400686F")]
|
|
private int xOff;
|
|
|
|
// Token: 0x04006870 RID: 26736
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x4006870")]
|
|
private byte[] M;
|
|
|
|
// Token: 0x04006871 RID: 26737
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x4006871")]
|
|
private int mOff;
|
|
|
|
// Token: 0x04006872 RID: 26738
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
|
|
[Token(Token = "0x4006872")]
|
|
private byte[] C;
|
|
|
|
// Token: 0x04006873 RID: 26739
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
|
|
[Token(Token = "0x4006873")]
|
|
private int COff;
|
|
|
|
// Token: 0x04006874 RID: 26740
|
|
[Token(Token = "0x4006874")]
|
|
private static readonly byte[] S;
|
|
}
|
|
}
|