Files
Jan2021-Cpp2Il-Dump/Assembly-CSharp/BestHTTP/SecureProtocol/Org/BouncyCastle/Crypto/Digests/Sha1Digest.cs
T
2026-04-08 23:40:05 +02:00

351 lines
11 KiB
C#

using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests
{
// Token: 0x02001718 RID: 5912
[Token(Token = "0x2001718")]
[StructLayout(3)]
public class Sha1Digest : GeneralDigest
{
// Token: 0x06009F8F RID: 40847 RVA: 0x0024F4C0 File Offset: 0x0024D6C0
[Token(Token = "0x6009F8F")]
[Address(RVA = "0x224D250", Offset = "0x224BC50", VA = "0x18224D250")]
public Sha1Digest()
{
uint[] array = new uint[80];
this.X = array;
base..ctor();
IMemoable memoable = ((IMemoable)this).Copy();
}
// Token: 0x06009F90 RID: 40848 RVA: 0x0024F4EC File Offset: 0x0024D6EC
[Token(Token = "0x6009F90")]
[Address(RVA = "0x224D1E0", Offset = "0x224BBE0", VA = "0x18224D1E0")]
public Sha1Digest(Sha1Digest t)
{
uint[] array = new uint[80];
this.X = array;
base..ctor(t);
this.CopyIn(t);
}
// Token: 0x06009F91 RID: 40849 RVA: 0x0024F518 File Offset: 0x0024D718
[Token(Token = "0x6009F91")]
[Address(RVA = "0x2243A40", Offset = "0x2242440", VA = "0x182243A40")]
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: 0x1700191C RID: 6428
// (get) Token: 0x06009F92 RID: 40850 RVA: 0x0024F5B8 File Offset: 0x0024D7B8
[Token(Token = "0x1700191C")]
public override string AlgorithmName
{
[Token(Token = "0x6009F92")]
[Address(RVA = "0x224D2B0", Offset = "0x224BCB0", VA = "0x18224D2B0", Slot = "17")]
get
{
return "SHA-1";
}
}
// Token: 0x06009F93 RID: 40851 RVA: 0x0024F5CC File Offset: 0x0024D7CC
[Token(Token = "0x6009F93")]
[Address(RVA = "0x15A18C0", Offset = "0x15A02C0", VA = "0x1815A18C0", Slot = "18")]
public override int GetDigestSize()
{
return 20;
}
// Token: 0x06009F94 RID: 40852 RVA: 0x0024F5DC File Offset: 0x0024D7DC
[Token(Token = "0x6009F94")]
[Address(RVA = "0x224D050", Offset = "0x224BA50", VA = "0x18224D050", Slot = "14")]
internal override void ProcessWord(byte[] input, int inOff)
{
uint[] x = this.X;
int num = this.xOff;
x[0] = (uint)inOff;
int num2 = this.xOff;
num2++;
this.xOff = num2;
if (num2 == 16)
{
}
}
// Token: 0x06009F95 RID: 40853 RVA: 0x0024F61C File Offset: 0x0024D81C
[Token(Token = "0x6009F95")]
[Address(RVA = "0x224CFC0", Offset = "0x224B9C0", VA = "0x18224CFC0", Slot = "15")]
internal override void ProcessLength(long bitLength)
{
if (this.xOff > 14)
{
}
this.X[7] = (uint)bitLength;
this.X[7] = (uint)bitLength;
}
// Token: 0x06009F96 RID: 40854 RVA: 0x0024F654 File Offset: 0x0024D854
[Token(Token = "0x6009F96")]
[Address(RVA = "0x224C520", Offset = "0x224AF20", VA = "0x18224C520", 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: 0x06009F97 RID: 40855 RVA: 0x0024F6AC File Offset: 0x0024D8AC
[Token(Token = "0x6009F97")]
[Address(RVA = "0x224D0E0", Offset = "0x224BAE0", VA = "0x18224D0E0", 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: 0x06009F98 RID: 40856 RVA: 0x0024F730 File Offset: 0x0024D930
[Token(Token = "0x6009F98")]
[Address(RVA = "0xA94430", Offset = "0xA92E30", VA = "0x180A94430")]
private static uint F(uint u, uint v, uint w)
{
return u;
}
// Token: 0x06009F99 RID: 40857 RVA: 0x0024F740 File Offset: 0x0024D940
[Token(Token = "0x6009F99")]
[Address(RVA = "0xA94420", Offset = "0xA92E20", VA = "0x180A94420")]
private static uint H(uint u, uint v, uint w)
{
return u;
}
// Token: 0x06009F9A RID: 40858 RVA: 0x0024F750 File Offset: 0x0024D950
[Token(Token = "0x6009F9A")]
[Address(RVA = "0x224C5C0", Offset = "0x224AFC0", VA = "0x18224C5C0")]
private static uint G(uint u, uint v, uint w)
{
return v;
}
// Token: 0x06009F9B RID: 40859 RVA: 0x0024F760 File Offset: 0x0024D960
[Token(Token = "0x6009F9B")]
[Address(RVA = "0x224C5D0", Offset = "0x224AFD0", VA = "0x18224C5D0", 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: 0x06009F9C RID: 40860 RVA: 0x0024F974 File Offset: 0x0024DB74
[Token(Token = "0x6009F9C")]
[Address(RVA = "0x224C480", Offset = "0x224AE80", VA = "0x18224C480", Slot = "20")]
public override IMemoable Copy()
{
/*
An exception occurred when decompiling this method (06009F9C)
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: 0x06009F9D RID: 40861 RVA: 0x0024F9A0 File Offset: 0x0024DBA0
[Token(Token = "0x6009F9D")]
[Address(RVA = "0x224D140", Offset = "0x224BB40", VA = "0x18224D140", Slot = "21")]
public override void Reset(IMemoable other)
{
do
{
if (other == 0)
{
}
}
while (other == 0);
}
// Token: 0x040068CF RID: 26831
[Token(Token = "0x40068CF")]
private const int DigestLength = 20;
// Token: 0x040068D0 RID: 26832
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x40068D0")]
private uint H1;
// Token: 0x040068D1 RID: 26833
[global::Cpp2IlInjected.FieldOffset(Offset = "0x2C")]
[Token(Token = "0x40068D1")]
private uint H2;
// Token: 0x040068D2 RID: 26834
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
[Token(Token = "0x40068D2")]
private uint H3;
// Token: 0x040068D3 RID: 26835
[global::Cpp2IlInjected.FieldOffset(Offset = "0x34")]
[Token(Token = "0x40068D3")]
private uint H4;
// Token: 0x040068D4 RID: 26836
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
[Token(Token = "0x40068D4")]
private uint H5;
// Token: 0x040068D5 RID: 26837
[global::Cpp2IlInjected.FieldOffset(Offset = "0x40")]
[Token(Token = "0x40068D5")]
private uint[] X;
// Token: 0x040068D6 RID: 26838
[global::Cpp2IlInjected.FieldOffset(Offset = "0x48")]
[Token(Token = "0x40068D6")]
private int xOff;
// Token: 0x040068D7 RID: 26839
[Token(Token = "0x40068D7")]
private const uint Y1 = 1518500249U;
// Token: 0x040068D8 RID: 26840
[Token(Token = "0x40068D8")]
private const uint Y2 = 1859775393U;
// Token: 0x040068D9 RID: 26841
[Token(Token = "0x40068D9")]
private const uint Y3 = 2400959708U;
// Token: 0x040068DA RID: 26842
[Token(Token = "0x40068DA")]
private const uint Y4 = 3395469782U;
}
}