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: 0x02001DD7 RID: 7639
|
|
[Token(Token = "0x2001DD7")]
|
|
public class Sha256Digest : GeneralDigest
|
|
{
|
|
// Token: 0x0600BF59 RID: 48985 RVA: 0x002B09FC File Offset: 0x002AEBFC
|
|
[Token(Token = "0x600BF59")]
|
|
[Address(RVA = "0x290DD30", Offset = "0x290CD30", VA = "0x18290DD30")]
|
|
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: 0x0600BF5A RID: 48986 RVA: 0x002B0A90 File Offset: 0x002AEC90
|
|
[Token(Token = "0x600BF5A")]
|
|
[Address(RVA = "0x290DDC0", Offset = "0x290CDC0", VA = "0x18290DDC0")]
|
|
public Sha256Digest(Sha256Digest t)
|
|
{
|
|
uint[] array = new uint[64];
|
|
this.X = array;
|
|
base..ctor(t);
|
|
this.CopyIn(t);
|
|
}
|
|
|
|
// Token: 0x0600BF5B RID: 48987 RVA: 0x002B0ABC File Offset: 0x002AECBC
|
|
[Token(Token = "0x600BF5B")]
|
|
[Address(RVA = "0x2905210", Offset = "0x2904210", VA = "0x182905210")]
|
|
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: 0x17001DBC RID: 7612
|
|
// (get) Token: 0x0600BF5C RID: 48988 RVA: 0x002B0B8C File Offset: 0x002AED8C
|
|
[Token(Token = "0x17001DBC")]
|
|
public override string AlgorithmName
|
|
{
|
|
[Token(Token = "0x600BF5C")]
|
|
[Address(RVA = "0x290DE30", Offset = "0x290CE30", VA = "0x18290DE30", Slot = "17")]
|
|
get
|
|
{
|
|
return "SHA-256";
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600BF5D RID: 48989 RVA: 0x002B0BA0 File Offset: 0x002AEDA0
|
|
[Token(Token = "0x600BF5D")]
|
|
[Address(RVA = "0x8BCAC0", Offset = "0x8BBAC0", VA = "0x1808BCAC0", Slot = "18")]
|
|
public override int GetDigestSize()
|
|
{
|
|
return 32;
|
|
}
|
|
|
|
// Token: 0x0600BF5E RID: 48990 RVA: 0x002B0BB0 File Offset: 0x002AEDB0
|
|
[Token(Token = "0x600BF5E")]
|
|
[Address(RVA = "0x290CB80", Offset = "0x290BB80", VA = "0x18290CB80", 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: 0x0600BF5F RID: 48991 RVA: 0x002B0BF8 File Offset: 0x002AEDF8
|
|
[Token(Token = "0x600BF5F")]
|
|
[Address(RVA = "0x290CAF0", Offset = "0x290BAF0", VA = "0x18290CAF0", Slot = "15")]
|
|
internal override void ProcessLength(long bitLength)
|
|
{
|
|
if (this.xOff > 14)
|
|
{
|
|
}
|
|
this.X[7] = (uint)bitLength;
|
|
this.X[7] = (uint)bitLength;
|
|
}
|
|
|
|
// Token: 0x0600BF60 RID: 48992 RVA: 0x002B0C30 File Offset: 0x002AEE30
|
|
[Token(Token = "0x600BF60")]
|
|
[Address(RVA = "0x290CFB0", Offset = "0x290BFB0", VA = "0x18290CFB0", 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: 0x0600BF61 RID: 48993 RVA: 0x002B0CB0 File Offset: 0x002AEEB0
|
|
[Token(Token = "0x600BF61")]
|
|
[Address(RVA = "0x290DBB0", Offset = "0x290CBB0", VA = "0x18290DBB0", 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: 0x0600BF62 RID: 48994 RVA: 0x002B0D5C File Offset: 0x002AEF5C
|
|
[Token(Token = "0x600BF62")]
|
|
[Address(RVA = "0x290DE60", Offset = "0x290CE60", VA = "0x18290DE60")]
|
|
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: 0x0600BF63 RID: 48995 RVA: 0x002B0DDC File Offset: 0x002AEFDC
|
|
[Token(Token = "0x600BF63")]
|
|
[Address(RVA = "0x290D090", Offset = "0x290C090", VA = "0x18290D090", 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: 0x0600BF64 RID: 48996 RVA: 0x002B10D0 File Offset: 0x002AF2D0
|
|
[Token(Token = "0x600BF64")]
|
|
[Address(RVA = "0x290DC80", Offset = "0x290CC80", VA = "0x18290DC80")]
|
|
private static uint Sum1Ch(uint x, uint y, uint z)
|
|
{
|
|
return x;
|
|
}
|
|
|
|
// Token: 0x0600BF65 RID: 48997 RVA: 0x002B10E0 File Offset: 0x002AF2E0
|
|
[Token(Token = "0x600BF65")]
|
|
[Address(RVA = "0x290DC30", Offset = "0x290CC30", VA = "0x18290DC30")]
|
|
private static uint Sum0Maj(uint x, uint y, uint z)
|
|
{
|
|
return x;
|
|
}
|
|
|
|
// Token: 0x0600BF66 RID: 48998 RVA: 0x002B10F0 File Offset: 0x002AF2F0
|
|
[Token(Token = "0x600BF66")]
|
|
[Address(RVA = "0x27F07F0", Offset = "0x27EF7F0", VA = "0x1827F07F0")]
|
|
private static uint Theta0(uint x)
|
|
{
|
|
return x;
|
|
}
|
|
|
|
// Token: 0x0600BF67 RID: 48999 RVA: 0x002B1100 File Offset: 0x002AF300
|
|
[Token(Token = "0x600BF67")]
|
|
[Address(RVA = "0x27F0820", Offset = "0x27EF820", VA = "0x1827F0820")]
|
|
private static uint Theta1(uint x)
|
|
{
|
|
return x;
|
|
}
|
|
|
|
// Token: 0x0600BF68 RID: 49000 RVA: 0x002B1110 File Offset: 0x002AF310
|
|
[Token(Token = "0x600BF68")]
|
|
[Address(RVA = "0x290CF10", Offset = "0x290BF10", VA = "0x18290CF10", Slot = "20")]
|
|
public override IMemoable Copy()
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600BF68)
|
|
|
|
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 1663
|
|
*/;
|
|
}
|
|
|
|
// Token: 0x0600BF69 RID: 49001 RVA: 0x002B113C File Offset: 0x002AF33C
|
|
[Token(Token = "0x600BF69")]
|
|
[Address(RVA = "0x290DB10", Offset = "0x290CB10", VA = "0x18290DB10", Slot = "21")]
|
|
public override void Reset(IMemoable other)
|
|
{
|
|
do
|
|
{
|
|
if (other == 0)
|
|
{
|
|
}
|
|
}
|
|
while (other == 0);
|
|
}
|
|
|
|
// Token: 0x0600BF6A RID: 49002 RVA: 0x002B1154 File Offset: 0x002AF354
|
|
// Note: this type is marked as 'beforefieldinit'.
|
|
[Token(Token = "0x600BF6A")]
|
|
[Address(RVA = "0x290DCD0", Offset = "0x290CCD0", VA = "0x18290DCD0")]
|
|
static Sha256Digest()
|
|
{
|
|
uint[] array = new uint[64];
|
|
RuntimeHelpers.InitializeArray(array, fieldof(<PrivateImplementationDetails>.433175D38B13FFE177FDD661A309F1B528B3F6E2).FieldHandle);
|
|
Sha256Digest.K = array;
|
|
}
|
|
|
|
// Token: 0x040078E3 RID: 30947
|
|
[Token(Token = "0x40078E3")]
|
|
private const int DigestLength = 32;
|
|
|
|
// Token: 0x040078E4 RID: 30948
|
|
[FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x40078E4")]
|
|
private uint H1;
|
|
|
|
// Token: 0x040078E5 RID: 30949
|
|
[FieldOffset(Offset = "0x2C")]
|
|
[Token(Token = "0x40078E5")]
|
|
private uint H2;
|
|
|
|
// Token: 0x040078E6 RID: 30950
|
|
[FieldOffset(Offset = "0x30")]
|
|
[Token(Token = "0x40078E6")]
|
|
private uint H3;
|
|
|
|
// Token: 0x040078E7 RID: 30951
|
|
[FieldOffset(Offset = "0x34")]
|
|
[Token(Token = "0x40078E7")]
|
|
private uint H4;
|
|
|
|
// Token: 0x040078E8 RID: 30952
|
|
[FieldOffset(Offset = "0x38")]
|
|
[Token(Token = "0x40078E8")]
|
|
private uint H5;
|
|
|
|
// Token: 0x040078E9 RID: 30953
|
|
[FieldOffset(Offset = "0x3C")]
|
|
[Token(Token = "0x40078E9")]
|
|
private uint H6;
|
|
|
|
// Token: 0x040078EA RID: 30954
|
|
[FieldOffset(Offset = "0x40")]
|
|
[Token(Token = "0x40078EA")]
|
|
private uint H7;
|
|
|
|
// Token: 0x040078EB RID: 30955
|
|
[FieldOffset(Offset = "0x44")]
|
|
[Token(Token = "0x40078EB")]
|
|
private uint H8;
|
|
|
|
// Token: 0x040078EC RID: 30956
|
|
[FieldOffset(Offset = "0x48")]
|
|
[Token(Token = "0x40078EC")]
|
|
private uint[] X;
|
|
|
|
// Token: 0x040078ED RID: 30957
|
|
[FieldOffset(Offset = "0x50")]
|
|
[Token(Token = "0x40078ED")]
|
|
private int xOff;
|
|
|
|
// Token: 0x040078EE RID: 30958
|
|
[Token(Token = "0x40078EE")]
|
|
private static readonly uint[] K;
|
|
}
|
|
}
|