377 lines
11 KiB
C#
377 lines
11 KiB
C#
using System;
|
|
using System.Runtime.CompilerServices;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests
|
|
{
|
|
// Token: 0x02001CEA RID: 7402
|
|
[Token(Token = "0x2001CEA")]
|
|
public class MD2Digest : IDigest, IMemoable
|
|
{
|
|
// Token: 0x0600BAB2 RID: 47794 RVA: 0x002A26A0 File Offset: 0x002A08A0
|
|
[Token(Token = "0x600BAB2")]
|
|
[Address(RVA = "0x1B43410", Offset = "0x1B42210", VA = "0x181B43410")]
|
|
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: 0x0600BAB3 RID: 47795 RVA: 0x002A26E8 File Offset: 0x002A08E8
|
|
[Token(Token = "0x600BAB3")]
|
|
[Address(RVA = "0x1B43490", Offset = "0x1B42290", VA = "0x181B43490")]
|
|
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: 0x0600BAB4 RID: 47796 RVA: 0x002A2730 File Offset: 0x002A0930
|
|
[Token(Token = "0x600BAB4")]
|
|
[Address(RVA = "0x1B42B80", Offset = "0x1B41980", VA = "0x181B42B80")]
|
|
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: 0x17001D12 RID: 7442
|
|
// (get) Token: 0x0600BAB5 RID: 47797 RVA: 0x002A27F4 File Offset: 0x002A09F4
|
|
[Token(Token = "0x17001D12")]
|
|
public string AlgorithmName
|
|
{
|
|
[Token(Token = "0x600BAB5")]
|
|
[Address(RVA = "0x1B43520", Offset = "0x1B42320", VA = "0x181B43520", Slot = "4")]
|
|
get
|
|
{
|
|
return "MD2";
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600BAB6 RID: 47798 RVA: 0x002A2808 File Offset: 0x002A0A08
|
|
[Token(Token = "0x600BAB6")]
|
|
[Address(RVA = "0x4B6B10", Offset = "0x4B5910", VA = "0x1804B6B10", Slot = "5")]
|
|
public int GetDigestSize()
|
|
{
|
|
return 16;
|
|
}
|
|
|
|
// Token: 0x0600BAB7 RID: 47799 RVA: 0x002A2818 File Offset: 0x002A0A18
|
|
[Token(Token = "0x600BAB7")]
|
|
[Address(RVA = "0x4B6B10", Offset = "0x4B5910", VA = "0x1804B6B10", Slot = "6")]
|
|
public int GetByteLength()
|
|
{
|
|
return 16;
|
|
}
|
|
|
|
// Token: 0x0600BAB8 RID: 47800 RVA: 0x002A2828 File Offset: 0x002A0A28
|
|
[Token(Token = "0x600BAB8")]
|
|
[Address(RVA = "0x1B42D00", Offset = "0x1B41B00", VA = "0x181B42D00", 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: 0x0600BAB9 RID: 47801 RVA: 0x002A28AC File Offset: 0x002A0AAC
|
|
[Token(Token = "0x600BAB9")]
|
|
[Address(RVA = "0x1B43180", Offset = "0x1B41F80", VA = "0x181B43180", 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: 0x0600BABA RID: 47802 RVA: 0x002A2930 File Offset: 0x002A0B30
|
|
[Token(Token = "0x600BABA")]
|
|
[Address(RVA = "0x1B43340", Offset = "0x1B42140", VA = "0x181B43340", 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: 0x0600BABB RID: 47803 RVA: 0x002A298C File Offset: 0x002A0B8C
|
|
[Token(Token = "0x600BABB")]
|
|
[Address(RVA = "0x1B429B0", Offset = "0x1B417B0", VA = "0x181B429B0", 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: 0x0600BABC RID: 47804 RVA: 0x002A2AA0 File Offset: 0x002A0CA0
|
|
[Token(Token = "0x600BABC")]
|
|
[Address(RVA = "0x1B43000", Offset = "0x1B41E00", VA = "0x181B43000")]
|
|
internal void ProcessChecksum(byte[] m)
|
|
{
|
|
byte b = this.C[1];
|
|
int num = 0;
|
|
byte[] s = MD2Digest.S;
|
|
byte[] c = this.C;
|
|
num++;
|
|
}
|
|
|
|
// Token: 0x0600BABD RID: 47805 RVA: 0x002A2AD4 File Offset: 0x002A0CD4
|
|
[Token(Token = "0x600BABD")]
|
|
[Address(RVA = "0x1B42DF0", Offset = "0x1B41BF0", VA = "0x181B42DF0")]
|
|
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: 0x0600BABE RID: 47806 RVA: 0x002A2B38 File Offset: 0x002A0D38
|
|
[Token(Token = "0x600BABE")]
|
|
[Address(RVA = "0x1B42C40", Offset = "0x1B41A40", VA = "0x181B42C40", Slot = "11")]
|
|
public IMemoable Copy()
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600BABE)
|
|
|
|
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: 0x0600BABF RID: 47807 RVA: 0x002A2B80 File Offset: 0x002A0D80
|
|
[Token(Token = "0x600BABF")]
|
|
[Address(RVA = "0x1B432A0", Offset = "0x1B420A0", VA = "0x181B432A0", Slot = "12")]
|
|
public void Reset(IMemoable other)
|
|
{
|
|
do
|
|
{
|
|
if (other == 0)
|
|
{
|
|
}
|
|
}
|
|
while (other == 0);
|
|
}
|
|
|
|
// Token: 0x0600BAC0 RID: 47808 RVA: 0x002A2B98 File Offset: 0x002A0D98
|
|
// Note: this type is marked as 'beforefieldinit'.
|
|
[Token(Token = "0x600BAC0")]
|
|
[Address(RVA = "0x1B433B0", Offset = "0x1B421B0", VA = "0x181B433B0")]
|
|
static MD2Digest()
|
|
{
|
|
byte[] array = new byte[256];
|
|
RuntimeHelpers.InitializeArray(array, fieldof(<PrivateImplementationDetails>.D2C5BAE967587C6F3D9F2C4551911E0575A1101F).FieldHandle);
|
|
MD2Digest.S = array;
|
|
}
|
|
|
|
// Token: 0x040076AF RID: 30383
|
|
[Token(Token = "0x40076AF")]
|
|
private const int DigestLength = 16;
|
|
|
|
// Token: 0x040076B0 RID: 30384
|
|
[Token(Token = "0x40076B0")]
|
|
private const int BYTE_LENGTH = 16;
|
|
|
|
// Token: 0x040076B1 RID: 30385
|
|
[FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x40076B1")]
|
|
private byte[] X;
|
|
|
|
// Token: 0x040076B2 RID: 30386
|
|
[FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x40076B2")]
|
|
private int xOff;
|
|
|
|
// Token: 0x040076B3 RID: 30387
|
|
[FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x40076B3")]
|
|
private byte[] M;
|
|
|
|
// Token: 0x040076B4 RID: 30388
|
|
[FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x40076B4")]
|
|
private int mOff;
|
|
|
|
// Token: 0x040076B5 RID: 30389
|
|
[FieldOffset(Offset = "0x30")]
|
|
[Token(Token = "0x40076B5")]
|
|
private byte[] C;
|
|
|
|
// Token: 0x040076B6 RID: 30390
|
|
[FieldOffset(Offset = "0x38")]
|
|
[Token(Token = "0x40076B6")]
|
|
private int COff;
|
|
|
|
// Token: 0x040076B7 RID: 30391
|
|
[Token(Token = "0x40076B7")]
|
|
private static readonly byte[] S;
|
|
}
|
|
}
|