350 lines
11 KiB
C#
350 lines
11 KiB
C#
using System;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests
|
|
{
|
|
// Token: 0x02001CF5 RID: 7413
|
|
[Token(Token = "0x2001CF5")]
|
|
public class Sha1Digest : GeneralDigest
|
|
{
|
|
// Token: 0x0600BB69 RID: 47977 RVA: 0x002A7598 File Offset: 0x002A5798
|
|
[Token(Token = "0x600BB69")]
|
|
[Address(RVA = "0x1FDF1C0", Offset = "0x1FDDFC0", VA = "0x181FDF1C0")]
|
|
public Sha1Digest()
|
|
{
|
|
uint[] array = new uint[80];
|
|
this.X = array;
|
|
base..ctor();
|
|
IMemoable memoable = ((IMemoable)this).Copy();
|
|
}
|
|
|
|
// Token: 0x0600BB6A RID: 47978 RVA: 0x002A75C4 File Offset: 0x002A57C4
|
|
[Token(Token = "0x600BB6A")]
|
|
[Address(RVA = "0x1FDF150", Offset = "0x1FDDF50", VA = "0x181FDF150")]
|
|
public Sha1Digest(Sha1Digest t)
|
|
{
|
|
uint[] array = new uint[80];
|
|
this.X = array;
|
|
base..ctor(t);
|
|
this.CopyIn(t);
|
|
}
|
|
|
|
// Token: 0x0600BB6B RID: 47979 RVA: 0x002A75F0 File Offset: 0x002A57F0
|
|
[Token(Token = "0x600BB6B")]
|
|
[Address(RVA = "0x1FD59B0", Offset = "0x1FD47B0", VA = "0x181FD59B0")]
|
|
private void CopyIn(Sha1Digest t)
|
|
{
|
|
base.CopyIn(t);
|
|
uint h = t.H1;
|
|
this.H1 = h;
|
|
uint h2 = t.H2;
|
|
this.H2 = h2;
|
|
uint h3 = t.H3;
|
|
this.H3 = h3;
|
|
uint h4 = t.H4;
|
|
this.H4 = h4;
|
|
uint h5 = t.H5;
|
|
this.H5 = h5;
|
|
uint[] x = t.X;
|
|
int length = x.Length;
|
|
int num = 0;
|
|
uint[] x2 = this.X;
|
|
int num2 = 0;
|
|
Array.Copy(x, num2, x2, num, length);
|
|
int num3 = t.xOff;
|
|
this.xOff = num3;
|
|
}
|
|
|
|
// Token: 0x17001D1D RID: 7453
|
|
// (get) Token: 0x0600BB6C RID: 47980 RVA: 0x002A7690 File Offset: 0x002A5890
|
|
[Token(Token = "0x17001D1D")]
|
|
public override string AlgorithmName
|
|
{
|
|
[Token(Token = "0x600BB6C")]
|
|
[Address(RVA = "0x1FDF220", Offset = "0x1FDE020", VA = "0x181FDF220", Slot = "17")]
|
|
get
|
|
{
|
|
return "SHA-1";
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600BB6D RID: 47981 RVA: 0x002A76A4 File Offset: 0x002A58A4
|
|
[Token(Token = "0x600BB6D")]
|
|
[Address(RVA = "0x4B5D20", Offset = "0x4B4B20", VA = "0x1804B5D20", Slot = "18")]
|
|
public override int GetDigestSize()
|
|
{
|
|
return 20;
|
|
}
|
|
|
|
// Token: 0x0600BB6E RID: 47982 RVA: 0x002A76B4 File Offset: 0x002A58B4
|
|
[Token(Token = "0x600BB6E")]
|
|
[Address(RVA = "0x1FDEFC0", Offset = "0x1FDDDC0", VA = "0x181FDEFC0", Slot = "14")]
|
|
internal override void ProcessWord(byte[] input, int inOff)
|
|
{
|
|
uint[] x = this.X;
|
|
int num = this.xOff;
|
|
uint num2 = Pack.BE_To_UInt32(input, inOff);
|
|
x[0] = num2;
|
|
int num3 = this.xOff;
|
|
num3++;
|
|
this.xOff = num3;
|
|
if (num3 == 16)
|
|
{
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600BB6F RID: 47983 RVA: 0x002A76FC File Offset: 0x002A58FC
|
|
[Token(Token = "0x600BB6F")]
|
|
[Address(RVA = "0x1FDEF30", Offset = "0x1FDDD30", VA = "0x181FDEF30", Slot = "15")]
|
|
internal override void ProcessLength(long bitLength)
|
|
{
|
|
if (this.xOff > 14)
|
|
{
|
|
}
|
|
this.X[7] = (uint)bitLength;
|
|
this.X[7] = (uint)bitLength;
|
|
}
|
|
|
|
// Token: 0x0600BB70 RID: 47984 RVA: 0x002A7734 File Offset: 0x002A5934
|
|
[Token(Token = "0x600BB70")]
|
|
[Address(RVA = "0x1FDE490", Offset = "0x1FDD290", VA = "0x181FDE490", Slot = "19")]
|
|
public override int DoFinal(byte[] output, int outOff)
|
|
{
|
|
base.Finish();
|
|
Pack.UInt32_To_BE(this.H1, output, outOff);
|
|
Pack.UInt32_To_BE(this.H2, output, outOff);
|
|
Pack.UInt32_To_BE(this.H3, output, outOff);
|
|
Pack.UInt32_To_BE(this.H4, output, outOff);
|
|
Pack.UInt32_To_BE(this.H5, output, outOff);
|
|
return 20;
|
|
}
|
|
|
|
// Token: 0x0600BB71 RID: 47985 RVA: 0x002A778C File Offset: 0x002A598C
|
|
[Token(Token = "0x600BB71")]
|
|
[Address(RVA = "0x1FDF050", Offset = "0x1FDDE50", VA = "0x181FDF050", Slot = "13")]
|
|
public override void Reset()
|
|
{
|
|
base.Reset();
|
|
uint[] x = this.X;
|
|
this.H1 = (uint)((ulong)1732584193L);
|
|
this.H2 = (uint)((ulong)4023233417L);
|
|
this.H3 = (uint)((ulong)2562383102L);
|
|
this.H4 = (uint)((ulong)271733878L);
|
|
this.H5 = (uint)((ulong)3285377520L);
|
|
this.xOff = (int)((ulong)0L);
|
|
int length = x.Length;
|
|
int num = 0;
|
|
Array.Clear(x, num, length);
|
|
}
|
|
|
|
// Token: 0x0600BB72 RID: 47986 RVA: 0x002A7810 File Offset: 0x002A5A10
|
|
[Token(Token = "0x600BB72")]
|
|
[Address(RVA = "0x1B448D0", Offset = "0x1B436D0", VA = "0x181B448D0")]
|
|
private static uint F(uint u, uint v, uint w)
|
|
{
|
|
return u;
|
|
}
|
|
|
|
// Token: 0x0600BB73 RID: 47987 RVA: 0x002A7820 File Offset: 0x002A5A20
|
|
[Token(Token = "0x600BB73")]
|
|
[Address(RVA = "0x1B448F0", Offset = "0x1B436F0", VA = "0x181B448F0")]
|
|
private static uint H(uint u, uint v, uint w)
|
|
{
|
|
return u;
|
|
}
|
|
|
|
// Token: 0x0600BB74 RID: 47988 RVA: 0x002A7830 File Offset: 0x002A5A30
|
|
[Token(Token = "0x600BB74")]
|
|
[Address(RVA = "0x1FDE530", Offset = "0x1FDD330", VA = "0x181FDE530")]
|
|
private static uint G(uint u, uint v, uint w)
|
|
{
|
|
return v;
|
|
}
|
|
|
|
// Token: 0x0600BB75 RID: 47989 RVA: 0x002A7840 File Offset: 0x002A5A40
|
|
[Token(Token = "0x600BB75")]
|
|
[Address(RVA = "0x1FDE540", Offset = "0x1FDD340", VA = "0x181FDE540", Slot = "16")]
|
|
internal override void ProcessBlock()
|
|
{
|
|
uint[] x = this.X;
|
|
int length = x.Length;
|
|
uint num;
|
|
num += (uint)1;
|
|
uint num2;
|
|
num2 += num2;
|
|
x[0] = num2;
|
|
uint num3 = this.H1;
|
|
int num4 = 0;
|
|
uint num5 = this.H2;
|
|
uint num6 = this.H3;
|
|
uint num7 = this.H4;
|
|
uint num8 = this.H5;
|
|
uint[] x2 = this.X;
|
|
int length2 = x2.Length;
|
|
num8 += (uint)1518500249;
|
|
num3 = num6;
|
|
num2 = num3;
|
|
num5 += num2;
|
|
num5 += num8;
|
|
num2 = num5;
|
|
num3 = num5;
|
|
num2 += (uint)1518500249;
|
|
num3 += num2;
|
|
num3 += num7;
|
|
num3 = num5;
|
|
num2 = num3;
|
|
num5 += (uint)1518500249;
|
|
num8 = num5;
|
|
num5 += num2;
|
|
num5 += num6;
|
|
num4 += 3;
|
|
num7 = num3;
|
|
num2 = num5;
|
|
num3 = num5;
|
|
num3 += num2;
|
|
num8 += (uint)1518500249;
|
|
num8 += num3;
|
|
num6 = num5;
|
|
num3 = num8;
|
|
num2 = num8;
|
|
num3 += num2;
|
|
num4++;
|
|
int length3 = x2.Length;
|
|
num3 = num8;
|
|
num7 += num8;
|
|
num6 += num7;
|
|
num4 += 2;
|
|
num4 += 4;
|
|
num4 += 3;
|
|
ulong num9;
|
|
num9 += (ulong)1L;
|
|
int length4 = x2.Length;
|
|
num4 += -1894007588;
|
|
num4 += 4;
|
|
num4 += 4;
|
|
num4 += -1894007588;
|
|
num4 += 1859775393;
|
|
num4 += 4;
|
|
num4 += -1894007588;
|
|
num4 += num4;
|
|
num4 += num4;
|
|
num4 += 3;
|
|
num4 += num4;
|
|
num4 += -1894007588;
|
|
ulong num10;
|
|
num10 += (ulong)1L;
|
|
int length5 = x2.Length;
|
|
num4 += num4;
|
|
num4 += num4;
|
|
num4 += 2;
|
|
num4 += -1894007588;
|
|
num4 += 3;
|
|
ulong num11;
|
|
num11 += (ulong)1L;
|
|
int num12 = 0;
|
|
num3 += 2400959708U;
|
|
Array.Clear(x2, num12, 16);
|
|
}
|
|
|
|
// Token: 0x0600BB76 RID: 47990 RVA: 0x002A7A54 File Offset: 0x002A5C54
|
|
[Token(Token = "0x600BB76")]
|
|
[Address(RVA = "0x1FDE3F0", Offset = "0x1FDD1F0", VA = "0x181FDE3F0", Slot = "20")]
|
|
public override IMemoable Copy()
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600BB76)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IMemoable BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests.Sha1Digest::Copy()
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
Block_0:
|
|
stloc:Sha1Digest(var_0_06, newobj:Sha1Digest(Sha1Digest::.ctor, ldloc:Sha1Digest(this)))
|
|
stloc:uint32[](var_1_0E, newarr:uint32[]([mscorlib]System.UInt32, ldc.i4:int32(80)))
|
|
stfld:uint32[](Sha1Digest::X, ldloc:Sha1Digest(var_0_06), ldloc:uint32[](var_1_0E))
|
|
call:void(Sha1Digest::CopyIn, ldloc:Sha1Digest(var_0_06), ldloc:Sha1Digest(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: 0x0600BB77 RID: 47991 RVA: 0x002A7A80 File Offset: 0x002A5C80
|
|
[Token(Token = "0x600BB77")]
|
|
[Address(RVA = "0x1FDF0B0", Offset = "0x1FDDEB0", VA = "0x181FDF0B0", Slot = "21")]
|
|
public override void Reset(IMemoable other)
|
|
{
|
|
do
|
|
{
|
|
if (other == 0)
|
|
{
|
|
}
|
|
}
|
|
while (other == 0);
|
|
}
|
|
|
|
// Token: 0x04007712 RID: 30482
|
|
[Token(Token = "0x4007712")]
|
|
private const int DigestLength = 20;
|
|
|
|
// Token: 0x04007713 RID: 30483
|
|
[FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x4007713")]
|
|
private uint H1;
|
|
|
|
// Token: 0x04007714 RID: 30484
|
|
[FieldOffset(Offset = "0x2C")]
|
|
[Token(Token = "0x4007714")]
|
|
private uint H2;
|
|
|
|
// Token: 0x04007715 RID: 30485
|
|
[FieldOffset(Offset = "0x30")]
|
|
[Token(Token = "0x4007715")]
|
|
private uint H3;
|
|
|
|
// Token: 0x04007716 RID: 30486
|
|
[FieldOffset(Offset = "0x34")]
|
|
[Token(Token = "0x4007716")]
|
|
private uint H4;
|
|
|
|
// Token: 0x04007717 RID: 30487
|
|
[FieldOffset(Offset = "0x38")]
|
|
[Token(Token = "0x4007717")]
|
|
private uint H5;
|
|
|
|
// Token: 0x04007718 RID: 30488
|
|
[FieldOffset(Offset = "0x40")]
|
|
[Token(Token = "0x4007718")]
|
|
private uint[] X;
|
|
|
|
// Token: 0x04007719 RID: 30489
|
|
[FieldOffset(Offset = "0x48")]
|
|
[Token(Token = "0x4007719")]
|
|
private int xOff;
|
|
|
|
// Token: 0x0400771A RID: 30490
|
|
[Token(Token = "0x400771A")]
|
|
private const uint Y1 = 1518500249U;
|
|
|
|
// Token: 0x0400771B RID: 30491
|
|
[Token(Token = "0x400771B")]
|
|
private const uint Y2 = 1859775393U;
|
|
|
|
// Token: 0x0400771C RID: 30492
|
|
[Token(Token = "0x400771C")]
|
|
private const uint Y3 = 2400959708U;
|
|
|
|
// Token: 0x0400771D RID: 30493
|
|
[Token(Token = "0x400771D")]
|
|
private const uint Y4 = 3395469782U;
|
|
}
|
|
}
|