432 lines
13 KiB
C#
432 lines
13 KiB
C#
using System;
|
|
using System.Runtime.CompilerServices;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests
|
|
{
|
|
// Token: 0x02001CF7 RID: 7415
|
|
[Token(Token = "0x2001CF7")]
|
|
public class Sha256Digest : GeneralDigest
|
|
{
|
|
// Token: 0x0600BB8B RID: 48011 RVA: 0x002A8144 File Offset: 0x002A6344
|
|
[Token(Token = "0x600BB8B")]
|
|
[Address(RVA = "0x1FE10A0", Offset = "0x1FDFEA0", VA = "0x181FE10A0")]
|
|
public Sha256Digest()
|
|
{
|
|
uint[] array = new uint[64];
|
|
this.X = array;
|
|
base..ctor();
|
|
this.H1 = (uint)((ulong)1779033703L);
|
|
this.H2 = (uint)((ulong)3144134277L);
|
|
this.H3 = (uint)((ulong)1013904242L);
|
|
this.H4 = (uint)((ulong)2773480762L);
|
|
this.H5 = (uint)((ulong)1359893119L);
|
|
this.H6 = (uint)((ulong)2600822924L);
|
|
this.H7 = (uint)((ulong)528734635L);
|
|
this.H8 = (uint)((ulong)1541459225L);
|
|
}
|
|
|
|
// Token: 0x0600BB8C RID: 48012 RVA: 0x002A81D8 File Offset: 0x002A63D8
|
|
[Token(Token = "0x600BB8C")]
|
|
[Address(RVA = "0x1FE1130", Offset = "0x1FDFF30", VA = "0x181FE1130")]
|
|
public Sha256Digest(Sha256Digest t)
|
|
{
|
|
uint[] array = new uint[64];
|
|
this.X = array;
|
|
base..ctor(t);
|
|
this.CopyIn(t);
|
|
}
|
|
|
|
// Token: 0x0600BB8D RID: 48013 RVA: 0x002A8204 File Offset: 0x002A6404
|
|
[Token(Token = "0x600BB8D")]
|
|
[Address(RVA = "0x1FD8560", Offset = "0x1FD7360", VA = "0x181FD8560")]
|
|
private void CopyIn(Sha256Digest 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 h6 = t.H6;
|
|
this.H6 = h6;
|
|
uint h7 = t.H7;
|
|
this.H7 = h7;
|
|
uint h8 = t.H8;
|
|
this.H8 = h8;
|
|
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: 0x17001D1F RID: 7455
|
|
// (get) Token: 0x0600BB8E RID: 48014 RVA: 0x002A82D4 File Offset: 0x002A64D4
|
|
[Token(Token = "0x17001D1F")]
|
|
public override string AlgorithmName
|
|
{
|
|
[Token(Token = "0x600BB8E")]
|
|
[Address(RVA = "0x1FE11A0", Offset = "0x1FDFFA0", VA = "0x181FE11A0", Slot = "17")]
|
|
get
|
|
{
|
|
return "SHA-256";
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600BB8F RID: 48015 RVA: 0x002A82E8 File Offset: 0x002A64E8
|
|
[Token(Token = "0x600BB8F")]
|
|
[Address(RVA = "0x55EA70", Offset = "0x55D870", VA = "0x18055EA70", Slot = "18")]
|
|
public override int GetDigestSize()
|
|
{
|
|
return 32;
|
|
}
|
|
|
|
// Token: 0x0600BB90 RID: 48016 RVA: 0x002A82F8 File Offset: 0x002A64F8
|
|
[Token(Token = "0x600BB90")]
|
|
[Address(RVA = "0x1FDFEF0", Offset = "0x1FDECF0", VA = "0x181FDFEF0", 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: 0x0600BB91 RID: 48017 RVA: 0x002A8340 File Offset: 0x002A6540
|
|
[Token(Token = "0x600BB91")]
|
|
[Address(RVA = "0x1FDFE60", Offset = "0x1FDEC60", VA = "0x181FDFE60", Slot = "15")]
|
|
internal override void ProcessLength(long bitLength)
|
|
{
|
|
if (this.xOff > 14)
|
|
{
|
|
}
|
|
this.X[7] = (uint)bitLength;
|
|
this.X[7] = (uint)bitLength;
|
|
}
|
|
|
|
// Token: 0x0600BB92 RID: 48018 RVA: 0x002A8378 File Offset: 0x002A6578
|
|
[Token(Token = "0x600BB92")]
|
|
[Address(RVA = "0x1FE0320", Offset = "0x1FDF120", VA = "0x181FE0320", 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);
|
|
Pack.UInt32_To_BE(this.H6, output, outOff);
|
|
Pack.UInt32_To_BE(this.H7, output, outOff);
|
|
Pack.UInt32_To_BE(this.H8, output, outOff);
|
|
return 32;
|
|
}
|
|
|
|
// Token: 0x0600BB93 RID: 48019 RVA: 0x002A83F8 File Offset: 0x002A65F8
|
|
[Token(Token = "0x600BB93")]
|
|
[Address(RVA = "0x1FE0F20", Offset = "0x1FDFD20", VA = "0x181FE0F20", Slot = "13")]
|
|
public override void Reset()
|
|
{
|
|
base.Reset();
|
|
uint[] x = this.X;
|
|
this.H1 = (uint)((ulong)1779033703L);
|
|
this.H2 = (uint)((ulong)3144134277L);
|
|
this.H3 = (uint)((ulong)1013904242L);
|
|
this.H4 = (uint)((ulong)2773480762L);
|
|
this.H5 = (uint)((ulong)1359893119L);
|
|
this.H6 = (uint)((ulong)2600822924L);
|
|
this.H7 = (uint)((ulong)528734635L);
|
|
this.H8 = (uint)((ulong)1541459225L);
|
|
this.xOff = (int)((ulong)0L);
|
|
int length = x.Length;
|
|
int num = 0;
|
|
Array.Clear(x, num, length);
|
|
}
|
|
|
|
// Token: 0x0600BB94 RID: 48020 RVA: 0x002A84A4 File Offset: 0x002A66A4
|
|
[Token(Token = "0x600BB94")]
|
|
[Address(RVA = "0x1FE11D0", Offset = "0x1FDFFD0", VA = "0x181FE11D0")]
|
|
private void initHs()
|
|
{
|
|
this.H1 = (uint)((ulong)1779033703L);
|
|
this.H2 = (uint)((ulong)3144134277L);
|
|
this.H3 = (uint)((ulong)1013904242L);
|
|
this.H4 = (uint)((ulong)2773480762L);
|
|
this.H5 = (uint)((ulong)1359893119L);
|
|
this.H6 = (uint)((ulong)2600822924L);
|
|
this.H7 = (uint)((ulong)528734635L);
|
|
this.H8 = (uint)((ulong)1541459225L);
|
|
}
|
|
|
|
// Token: 0x0600BB95 RID: 48021 RVA: 0x002A8524 File Offset: 0x002A6724
|
|
[Token(Token = "0x600BB95")]
|
|
[Address(RVA = "0x1FE0400", Offset = "0x1FDF200", VA = "0x181FE0400", Slot = "16")]
|
|
internal override void ProcessBlock()
|
|
{
|
|
uint[] x = this.X;
|
|
int length = this.X.Length;
|
|
uint num;
|
|
num += (uint)1;
|
|
uint num2;
|
|
num2 += num2;
|
|
x[0] = num2;
|
|
while (num <= (uint)63)
|
|
{
|
|
}
|
|
uint num3 = this.H4;
|
|
int num4 = 0;
|
|
uint num5 = this.H3;
|
|
uint num6 = this.H5;
|
|
uint num7 = this.H1;
|
|
uint num8 = this.H2;
|
|
uint num9 = this.H6;
|
|
uint num10 = this.H7;
|
|
uint num11 = this.H8;
|
|
num6 = num2;
|
|
int length2 = Sha256Digest.K.Length;
|
|
int length3 = this.X.Length;
|
|
num2 = num6;
|
|
num6 = num9;
|
|
num2 += num6;
|
|
num11 += num2;
|
|
num2 = num7;
|
|
num11 = num8;
|
|
num11 += num2;
|
|
num2 = num3;
|
|
num11 = num3;
|
|
num2 += num3;
|
|
num6 = num11;
|
|
num10 += num2;
|
|
num2 = num11;
|
|
num11 += num10;
|
|
num11 += num2;
|
|
num2 = num5;
|
|
num11 = num5;
|
|
num2 += num5;
|
|
num9 += num2;
|
|
num8 += num9;
|
|
num2 = num11;
|
|
num3 = num11;
|
|
num5 = num11;
|
|
num9 += num5;
|
|
num9 += num2;
|
|
num4 += 3;
|
|
num2 = num8;
|
|
num11 = num8;
|
|
num5 = num9;
|
|
num2 += num5;
|
|
num6 += num2;
|
|
num2 = num9;
|
|
num7 += num6;
|
|
num11 += num6;
|
|
num11 += num2;
|
|
num2 = num7;
|
|
num11 = num8;
|
|
num5 = num7;
|
|
num2 += num5;
|
|
num3 += num2;
|
|
num2 = num11;
|
|
num3 = num9;
|
|
num5 = num9;
|
|
num3 += num2;
|
|
num4 += 5;
|
|
num2 = num11;
|
|
num3 = num11;
|
|
num2 += num11;
|
|
num11 = num3;
|
|
num5 += num2;
|
|
num2 = num3;
|
|
num11 += num5;
|
|
num11 += num2;
|
|
num2 = num11;
|
|
num3 = num11;
|
|
num2 += num3;
|
|
num8 += num2;
|
|
num9 += num8;
|
|
num2 = num11;
|
|
num3 = num11;
|
|
num8 += num3;
|
|
num8 += num2;
|
|
num4 += 7;
|
|
num2 = num9;
|
|
num4 += 8;
|
|
num3 = num8;
|
|
num2 += num3;
|
|
num7 += num2;
|
|
num11 += num7;
|
|
num2 = num8;
|
|
num3 = num11;
|
|
num7 += num3;
|
|
num4++;
|
|
num7 += num2;
|
|
int num12 = 0;
|
|
uint[] x2 = this.X;
|
|
this.H5 = num3;
|
|
this.H6 = num3;
|
|
this.H7 = num3;
|
|
this.xOff = (int)((ulong)0L);
|
|
Array.Clear(x2, num12, 16);
|
|
}
|
|
|
|
// Token: 0x0600BB96 RID: 48022 RVA: 0x002A8818 File Offset: 0x002A6A18
|
|
[Token(Token = "0x600BB96")]
|
|
[Address(RVA = "0x1FE0FF0", Offset = "0x1FDFDF0", VA = "0x181FE0FF0")]
|
|
private static uint Sum1Ch(uint x, uint y, uint z)
|
|
{
|
|
return x;
|
|
}
|
|
|
|
// Token: 0x0600BB97 RID: 48023 RVA: 0x002A8828 File Offset: 0x002A6A28
|
|
[Token(Token = "0x600BB97")]
|
|
[Address(RVA = "0x1FE0FA0", Offset = "0x1FDFDA0", VA = "0x181FE0FA0")]
|
|
private static uint Sum0Maj(uint x, uint y, uint z)
|
|
{
|
|
return x;
|
|
}
|
|
|
|
// Token: 0x0600BB98 RID: 48024 RVA: 0x002A8838 File Offset: 0x002A6A38
|
|
[Token(Token = "0x600BB98")]
|
|
[Address(RVA = "0x1DCE330", Offset = "0x1DCD130", VA = "0x181DCE330")]
|
|
private static uint Theta0(uint x)
|
|
{
|
|
return x;
|
|
}
|
|
|
|
// Token: 0x0600BB99 RID: 48025 RVA: 0x002A8848 File Offset: 0x002A6A48
|
|
[Token(Token = "0x600BB99")]
|
|
[Address(RVA = "0x1DCE360", Offset = "0x1DCD160", VA = "0x181DCE360")]
|
|
private static uint Theta1(uint x)
|
|
{
|
|
return x;
|
|
}
|
|
|
|
// Token: 0x0600BB9A RID: 48026 RVA: 0x002A8858 File Offset: 0x002A6A58
|
|
[Token(Token = "0x600BB9A")]
|
|
[Address(RVA = "0x1FE0280", Offset = "0x1FDF080", VA = "0x181FE0280", Slot = "20")]
|
|
public override IMemoable Copy()
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600BB9A)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IMemoable BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests.Sha256Digest::Copy()
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
Block_0:
|
|
stloc:Sha256Digest(var_0_06, newobj:Sha256Digest(Sha256Digest::.ctor, ldloc:Sha256Digest(this)))
|
|
stloc:uint32[](var_1_0E, newarr:uint32[]([mscorlib]System.UInt32, ldc.i4:int32(64)))
|
|
stfld:uint32[](Sha256Digest::X, ldloc:Sha256Digest(var_0_06), ldloc:uint32[](var_1_0E))
|
|
call:void(Sha256Digest::CopyIn, ldloc:Sha256Digest(var_0_06), ldloc:Sha256Digest(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 1660
|
|
*/;
|
|
}
|
|
|
|
// Token: 0x0600BB9B RID: 48027 RVA: 0x002A8884 File Offset: 0x002A6A84
|
|
[Token(Token = "0x600BB9B")]
|
|
[Address(RVA = "0x1FE0E80", Offset = "0x1FDFC80", VA = "0x181FE0E80", Slot = "21")]
|
|
public override void Reset(IMemoable other)
|
|
{
|
|
do
|
|
{
|
|
if (other == 0)
|
|
{
|
|
}
|
|
}
|
|
while (other == 0);
|
|
}
|
|
|
|
// Token: 0x0600BB9C RID: 48028 RVA: 0x002A889C File Offset: 0x002A6A9C
|
|
// Note: this type is marked as 'beforefieldinit'.
|
|
[Token(Token = "0x600BB9C")]
|
|
[Address(RVA = "0x1FE1040", Offset = "0x1FDFE40", VA = "0x181FE1040")]
|
|
static Sha256Digest()
|
|
{
|
|
uint[] array = new uint[64];
|
|
RuntimeHelpers.InitializeArray(array, fieldof(<PrivateImplementationDetails>.433175D38B13FFE177FDD661A309F1B528B3F6E2).FieldHandle);
|
|
Sha256Digest.K = array;
|
|
}
|
|
|
|
// Token: 0x0400772A RID: 30506
|
|
[Token(Token = "0x400772A")]
|
|
private const int DigestLength = 32;
|
|
|
|
// Token: 0x0400772B RID: 30507
|
|
[FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x400772B")]
|
|
private uint H1;
|
|
|
|
// Token: 0x0400772C RID: 30508
|
|
[FieldOffset(Offset = "0x2C")]
|
|
[Token(Token = "0x400772C")]
|
|
private uint H2;
|
|
|
|
// Token: 0x0400772D RID: 30509
|
|
[FieldOffset(Offset = "0x30")]
|
|
[Token(Token = "0x400772D")]
|
|
private uint H3;
|
|
|
|
// Token: 0x0400772E RID: 30510
|
|
[FieldOffset(Offset = "0x34")]
|
|
[Token(Token = "0x400772E")]
|
|
private uint H4;
|
|
|
|
// Token: 0x0400772F RID: 30511
|
|
[FieldOffset(Offset = "0x38")]
|
|
[Token(Token = "0x400772F")]
|
|
private uint H5;
|
|
|
|
// Token: 0x04007730 RID: 30512
|
|
[FieldOffset(Offset = "0x3C")]
|
|
[Token(Token = "0x4007730")]
|
|
private uint H6;
|
|
|
|
// Token: 0x04007731 RID: 30513
|
|
[FieldOffset(Offset = "0x40")]
|
|
[Token(Token = "0x4007731")]
|
|
private uint H7;
|
|
|
|
// Token: 0x04007732 RID: 30514
|
|
[FieldOffset(Offset = "0x44")]
|
|
[Token(Token = "0x4007732")]
|
|
private uint H8;
|
|
|
|
// Token: 0x04007733 RID: 30515
|
|
[FieldOffset(Offset = "0x48")]
|
|
[Token(Token = "0x4007733")]
|
|
private uint[] X;
|
|
|
|
// Token: 0x04007734 RID: 30516
|
|
[FieldOffset(Offset = "0x50")]
|
|
[Token(Token = "0x4007734")]
|
|
private int xOff;
|
|
|
|
// Token: 0x04007735 RID: 30517
|
|
[Token(Token = "0x4007735")]
|
|
private static readonly uint[] K;
|
|
}
|
|
}
|