Files
2026-04-08 23:40:05 +02:00

623 lines
16 KiB
C#

using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests
{
// Token: 0x02001726 RID: 5926
[Token(Token = "0x2001726")]
[StructLayout(3)]
public class TigerDigest : IDigest, IMemoable
{
// Token: 0x0600A02B RID: 41003 RVA: 0x002525F4 File Offset: 0x002507F4
[Token(Token = "0x600A02B")]
[Address(RVA = "0x2064550", Offset = "0x2062F50", VA = "0x182064550")]
public TigerDigest()
{
byte[] array = new byte[8];
this.Buffer = array;
long[] array2 = new long[8];
this.x = array2;
base..ctor();
this.Reset();
}
// Token: 0x0600A02C RID: 41004 RVA: 0x0025262C File Offset: 0x0025082C
[Token(Token = "0x600A02C")]
[Address(RVA = "0x20643E0", Offset = "0x2062DE0", VA = "0x1820643E0")]
public TigerDigest(TigerDigest t)
{
do
{
byte[] array = new byte[8];
this.Buffer = array;
long[] array2 = new long[8];
this.x = array2;
base..ctor();
}
while (t == 0);
long num = t.a;
this.a = num;
long num2 = t.b;
this.b = num2;
long num3 = t.c;
this.c = num3;
long[] array3 = t.x;
int length = array3.Length;
int num4 = 0;
long[] array4 = this.x;
int num5 = 0;
Array.Copy(array3, num5, array4, num4, length);
int num6 = t.xOff;
this.xOff = num6;
byte[] buffer = t.Buffer;
int length2 = buffer.Length;
int num7 = 0;
byte[] buffer2 = this.Buffer;
int num8 = 0;
Array.Copy(buffer, num8, buffer2, num7, length2);
int num9 = t.bOff;
this.bOff = num9;
long num10 = t.byteCount;
this.byteCount = num10;
}
// Token: 0x1700192D RID: 6445
// (get) Token: 0x0600A02D RID: 41005 RVA: 0x00252724 File Offset: 0x00250924
[Token(Token = "0x1700192D")]
public string AlgorithmName
{
[Token(Token = "0x600A02D")]
[Address(RVA = "0x20645C0", Offset = "0x2062FC0", VA = "0x1820645C0", Slot = "4")]
get
{
return "Tiger";
}
}
// Token: 0x0600A02E RID: 41006 RVA: 0x00252738 File Offset: 0x00250938
[Token(Token = "0x600A02E")]
[Address(RVA = "0x11E7910", Offset = "0x11E6310", VA = "0x1811E7910", Slot = "5")]
public int GetDigestSize()
{
return 24;
}
// Token: 0x0600A02F RID: 41007 RVA: 0x00252748 File Offset: 0x00250948
[Token(Token = "0x600A02F")]
[Address(RVA = "0x2062AA0", Offset = "0x20614A0", VA = "0x182062AA0", Slot = "6")]
public int GetByteLength()
{
return 64;
}
// Token: 0x0600A030 RID: 41008 RVA: 0x00252758 File Offset: 0x00250958
[Token(Token = "0x600A030")]
[Address(RVA = "0x20635C0", Offset = "0x2061FC0", VA = "0x1820635C0")]
private void ProcessWord(byte[] b, int off)
{
int num = this.xOff;
long[] array = this.x;
int num2 = num + 1;
this.xOff = num2;
int length = b.Length;
int num3 = off + 1;
byte b2;
array[0] = (long)b2;
int length2 = this.x.Length;
if (this.xOff == length2)
{
this.ProcessBlock();
}
this.bOff = (int)((ulong)0L);
}
// Token: 0x0600A031 RID: 41009 RVA: 0x002527C0 File Offset: 0x002509C0
[Token(Token = "0x600A031")]
[Address(RVA = "0x2064260", Offset = "0x2062C60", VA = "0x182064260", Slot = "7")]
public void Update(byte input)
{
byte[] buffer = this.Buffer;
int num = this.bOff + 1;
this.bOff = num;
byte[] buffer2 = this.Buffer;
int length = buffer2.Length;
if (this.bOff == length)
{
int num2 = 0;
this.ProcessWord(buffer2, num2);
}
}
// Token: 0x0600A032 RID: 41010 RVA: 0x00252810 File Offset: 0x00250A10
[Token(Token = "0x600A032")]
[Address(RVA = "0x20624A0", Offset = "0x2060EA0", VA = "0x1820624A0", Slot = "8")]
public void BlockUpdate(byte[] input, int inOff, int length)
{
int num = this.bOff;
int num2;
if (num != 0 && length > 0)
{
byte[] buffer = this.Buffer;
num2 = num + 1;
this.bOff = num2;
num2 = num;
byte[] buffer2 = this.Buffer;
int num3 = this.bOff;
if (num3 == buffer2.Length)
{
int num4 = 0;
this.ProcessWord(buffer2, num4);
}
while (num3 != 0)
{
}
}
if (length > 8)
{
num2++;
this.ProcessWord(input, inOff);
while (length != 8)
{
}
}
if (length > 0)
{
int num5 = this.bOff;
byte[] buffer3 = this.Buffer;
num2 = inOff;
int num6 = num5 + 1;
this.bOff = num6;
byte[] buffer4 = this.Buffer;
int length2 = buffer4.Length;
if (this.bOff == length2)
{
int num7 = 0;
this.ProcessWord(buffer4, num7);
}
}
}
// Token: 0x0600A033 RID: 41011 RVA: 0x002528D4 File Offset: 0x00250AD4
[Token(Token = "0x600A033")]
[Address(RVA = "0x20639E0", Offset = "0x20623E0", VA = "0x1820639E0")]
private void RoundABC(long x, long mul)
{
long num = this.a;
long[] array = TigerDigest.t1;
long num2 = this.c;
long[] array2 = TigerDigest.t2;
long num3 = this.c;
long[] array3 = TigerDigest.t3;
long num4 = TigerDigest.t4[(int)num3];
num -= num4;
this.a = num;
long[] array4 = TigerDigest.t4;
long[] array5 = TigerDigest.t3;
long[] array6 = TigerDigest.t2;
long num5 = TigerDigest.t1[(int)num3] * mul;
this.b = num5;
}
// Token: 0x0600A034 RID: 41012 RVA: 0x00252958 File Offset: 0x00250B58
[Token(Token = "0x600A034")]
[Address(RVA = "0x2063C40", Offset = "0x2062640", VA = "0x182063C40")]
private void RoundBCA(long x, long mul)
{
long num = this.b;
long[] array = TigerDigest.t1;
long num2 = this.a;
long[] array2 = TigerDigest.t2;
long num3 = this.a;
long[] array3 = TigerDigest.t3;
long num4 = TigerDigest.t4[(int)num3];
num -= num4;
this.b = num;
long[] array4 = TigerDigest.t4;
long[] array5 = TigerDigest.t3;
long[] array6 = TigerDigest.t2;
long num5 = TigerDigest.t1[(int)num3] * mul;
this.c = num5;
}
// Token: 0x0600A035 RID: 41013 RVA: 0x002529DC File Offset: 0x00250BDC
[Token(Token = "0x600A035")]
[Address(RVA = "0x2063EA0", Offset = "0x20628A0", VA = "0x182063EA0")]
private void RoundCAB(long x, long mul)
{
long num = this.c;
long[] array = TigerDigest.t1;
long num2 = this.b;
long[] array2 = TigerDigest.t2;
long num3 = this.b;
long[] array3 = TigerDigest.t3;
long num4 = TigerDigest.t4[(int)num3];
num -= num4;
this.c = num;
long[] array4 = TigerDigest.t4;
long[] array5 = TigerDigest.t3;
long[] array6 = TigerDigest.t2;
long num5 = TigerDigest.t1[(int)num3] * mul;
this.a = num5;
}
// Token: 0x0600A036 RID: 41014 RVA: 0x00252A60 File Offset: 0x00250C60
[Token(Token = "0x600A036")]
[Address(RVA = "0x2062AB0", Offset = "0x20614B0", VA = "0x182062AB0")]
private void KeySchedule()
{
long[] array = this.x;
int length = array.Length;
long num = array[0];
long num2 = array[7];
num -= num2;
array[0] = num;
long[] array2 = this.x;
long[] array3 = this.x;
long[] array4 = this.x;
int length2 = array4.Length;
long num3 = array4[3];
long num4 = array4[1];
num3 -= num4;
array4[3] = num3;
long[] array5 = this.x;
long[] array6 = this.x;
long[] array7 = this.x;
int length3 = array7.Length;
long num5 = array7[6];
long num6 = array7[4];
num5 -= num6;
array7[6] = num5;
long[] array8 = this.x;
long[] array9 = this.x;
int length4 = array9.Length;
long num7 = array9[0];
array9[0] = num7;
long[] array10 = this.x;
int length5 = array10.Length;
long num8 = array10[1];
long num9 = array10[7];
num8 -= num9;
array10[1] = num8;
long[] array11 = this.x;
long[] array12 = this.x;
long[] array13 = this.x;
int length6 = array13.Length;
long num10 = array13[4];
long num11 = array13[2];
num10 -= num11;
array13[4] = num10;
long[] array14 = this.x;
long[] array15 = this.x;
long num12 = this.x[6];
}
// Token: 0x0600A037 RID: 41015 RVA: 0x00252BF0 File Offset: 0x00250DF0
[Token(Token = "0x600A037")]
[Address(RVA = "0x2062F40", Offset = "0x2061940", VA = "0x182062F40")]
private void ProcessBlock()
{
long num = this.x[0];
long num2 = this.x[1];
long num3 = this.x[2];
long num4 = this.x[3];
long num5 = this.x[4];
long num6 = this.x[5];
long num7 = this.x[6];
long num8 = this.x[7];
this.KeySchedule();
long num9 = this.x[0];
long num10 = this.x[1];
long num11 = this.x[2];
long num12 = this.x[3];
long num13 = this.x[4];
long num14 = this.x[5];
long num15 = this.x[6];
long num16 = this.x[7];
this.KeySchedule();
long num17 = this.x[0];
long num18 = this.x[1];
long num19 = this.x[2];
long num20 = this.x[3];
long num21 = this.x[4];
long num22 = this.x[5];
long num23 = this.x[6];
long num24 = this.x[7];
long[] array = this.x;
int num25 = 0;
this.xOff = num25;
if (num25 != array.Length)
{
num25++;
array[0] = (long)num25;
long[] array2 = this.x;
}
}
// Token: 0x0600A038 RID: 41016 RVA: 0x00252D94 File Offset: 0x00250F94
[Token(Token = "0x600A038")]
[Address(RVA = "0x2064100", Offset = "0x2062B00", VA = "0x182064100")]
private void UnpackWord(long r, byte[] output, int outOff)
{
int num = outOff + 1;
}
// Token: 0x0600A039 RID: 41017 RVA: 0x00252DAC File Offset: 0x00250FAC
[Token(Token = "0x600A039")]
[Address(RVA = "0x2063580", Offset = "0x2061F80", VA = "0x182063580")]
private void ProcessLength(long bitLength)
{
this.x[7] = bitLength;
}
// Token: 0x0600A03A RID: 41018 RVA: 0x00252DCC File Offset: 0x00250FCC
[Token(Token = "0x600A03A")]
[Address(RVA = "0x2062980", Offset = "0x2061380", VA = "0x182062980")]
private void Finish()
{
long num;
for (;;)
{
num = this.byteCount;
byte[] buffer = this.Buffer;
int num2 = this.bOff + 1;
this.bOff = num2;
byte[] buffer2 = this.Buffer;
int num3 = this.bOff;
if (num3 == buffer2.Length)
{
int num4 = 0;
this.ProcessWord(buffer2, num4);
}
if (num3 == 0)
{
break;
}
byte[] buffer3 = this.Buffer;
int num5 = num3 + 1;
this.bOff = num5;
byte[] buffer4 = this.Buffer;
if (this.bOff == buffer4.Length)
{
int num6 = 0;
this.ProcessWord(buffer4, num6);
if (this.bOff == 0)
{
break;
}
}
}
this.x[7] = num;
this.ProcessBlock();
}
// Token: 0x0600A03B RID: 41019 RVA: 0x00252E84 File Offset: 0x00251084
[Token(Token = "0x600A03B")]
[Address(RVA = "0x20627E0", Offset = "0x20611E0", VA = "0x1820627E0", Slot = "9")]
public int DoFinal(byte[] output, int outOff)
{
long num;
for (;;)
{
num = this.byteCount;
byte[] buffer = this.Buffer;
int num2 = this.bOff + 1;
this.bOff = num2;
byte[] buffer2 = this.Buffer;
int num3 = this.bOff;
if (num3 == buffer2.Length)
{
int num4 = 0;
this.ProcessWord(buffer2, num4);
}
if (num3 == 0)
{
break;
}
byte[] buffer3 = this.Buffer;
int num5 = num3 + 1;
this.bOff = num5;
byte[] buffer4 = this.Buffer;
if (this.bOff == buffer4.Length)
{
int num6 = 0;
this.ProcessWord(buffer4, num6);
if (this.bOff == 0)
{
break;
}
}
}
this.x[7] = num;
this.ProcessBlock();
long num7 = this.a;
this.UnpackWord(num7, output, outOff);
long num8 = this.b;
this.UnpackWord(num8, output, outOff);
long num9 = this.c;
this.UnpackWord(num9, output, outOff);
this.Reset();
return 24;
}
// Token: 0x0600A03C RID: 41020 RVA: 0x00252F80 File Offset: 0x00251180
[Token(Token = "0x600A03C")]
[Address(RVA = "0x20637D0", Offset = "0x20621D0", VA = "0x1820637D0", Slot = "10")]
public void Reset()
{
int num;
do
{
num = 0;
this.a = (long)((ulong)81985529216486895L);
this.xOff = num;
this.b = (long)((ulong)(-81985529216486896L));
this.c = (long)((ulong)(-1110518062304271993L));
long[] array = this.x;
if (num != array.Length)
{
num++;
array[0] = (long)num;
long[] array2 = this.x;
}
byte[] buffer = this.Buffer;
this.bOff = num;
if (num == buffer.Length)
{
break;
}
num++;
}
while (this.Buffer != 0);
this.byteCount = (long)num;
}
// Token: 0x0600A03D RID: 41021 RVA: 0x00253020 File Offset: 0x00251220
[Token(Token = "0x600A03D")]
[Address(RVA = "0x2062650", Offset = "0x2061050", VA = "0x182062650", Slot = "11")]
public IMemoable Copy()
{
TigerDigest tigerDigest;
do
{
tigerDigest = new TigerDigest();
byte[] array = new byte[8];
tigerDigest.Buffer = array;
long[] array2 = new long[8];
tigerDigest.x = array2;
}
while (this == 0);
long num = this.a;
tigerDigest.a = num;
long num2 = this.b;
tigerDigest.b = num2;
long num3 = this.c;
tigerDigest.c = num3;
long[] array3 = this.x;
int length = array3.Length;
int num4 = 0;
long[] array4 = tigerDigest.x;
int num5 = 0;
Array.Copy(array3, num5, array4, num4, length);
int num6 = this.xOff;
tigerDigest.xOff = num6;
byte[] buffer = this.Buffer;
int length2 = buffer.Length;
int num7 = 0;
byte[] buffer2 = tigerDigest.Buffer;
int num8 = 0;
Array.Copy(buffer, num8, buffer2, num7, length2);
int num9 = this.bOff;
tigerDigest.bOff = num9;
long num10 = this.byteCount;
tigerDigest.byteCount = num10;
throw new NullReferenceException();
}
// Token: 0x0600A03E RID: 41022 RVA: 0x00253118 File Offset: 0x00251318
[Token(Token = "0x600A03E")]
[Address(RVA = "0x20638C0", Offset = "0x20622C0", VA = "0x1820638C0", Slot = "12")]
public void Reset(IMemoable other)
{
int num;
do
{
num = 0;
}
while (other == 0);
this.a = (long)num;
this.b = (long)num;
this.c = (long)num;
this.xOff = num;
this.bOff = num;
this.byteCount = (long)num;
}
// Token: 0x0600A03F RID: 41023 RVA: 0x0025315C File Offset: 0x0025135C
// Note: this type is marked as 'beforefieldinit'.
[Token(Token = "0x600A03F")]
[Address(RVA = "0x20642D0", Offset = "0x2062CD0", VA = "0x1820642D0")]
static TigerDigest()
{
long[] array = new long[256];
RuntimeHelpers.InitializeArray(array, fieldof(<PrivateImplementationDetails>.A0FABB8173BA247898A9FA267D0CE05500B667A0).FieldHandle);
TigerDigest.t1 = array;
long[] array2 = new long[256];
RuntimeHelpers.InitializeArray(array2, fieldof(<PrivateImplementationDetails>.467C6758F235D3193618192A64129CBB602C9067).FieldHandle);
TigerDigest.t2 = array2;
long[] array3 = new long[256];
RuntimeHelpers.InitializeArray(array3, fieldof(<PrivateImplementationDetails>.1648F737A4CFFDA4E6C83A3D742109BF9DBC2446).FieldHandle);
TigerDigest.t3 = array3;
long[] array4 = new long[256];
RuntimeHelpers.InitializeArray(array4, fieldof(<PrivateImplementationDetails>.C079C42AC966756C902EC38C4D7989F3C20D3625).FieldHandle);
TigerDigest.t4 = array4;
}
// Token: 0x04006923 RID: 26915
[Token(Token = "0x4006923")]
private const int MyByteLength = 64;
// Token: 0x04006924 RID: 26916
[Token(Token = "0x4006924")]
private static readonly long[] t1;
// Token: 0x04006925 RID: 26917
[Token(Token = "0x4006925")]
private static readonly long[] t2;
// Token: 0x04006926 RID: 26918
[Token(Token = "0x4006926")]
private static readonly long[] t3;
// Token: 0x04006927 RID: 26919
[Token(Token = "0x4006927")]
private static readonly long[] t4;
// Token: 0x04006928 RID: 26920
[Token(Token = "0x4006928")]
private const int DigestLength = 24;
// Token: 0x04006929 RID: 26921
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006929")]
private long a;
// Token: 0x0400692A RID: 26922
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x400692A")]
private long b;
// Token: 0x0400692B RID: 26923
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x400692B")]
private long c;
// Token: 0x0400692C RID: 26924
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x400692C")]
private long byteCount;
// Token: 0x0400692D RID: 26925
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
[Token(Token = "0x400692D")]
private byte[] Buffer;
// Token: 0x0400692E RID: 26926
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
[Token(Token = "0x400692E")]
private int bOff;
// Token: 0x0400692F RID: 26927
[global::Cpp2IlInjected.FieldOffset(Offset = "0x40")]
[Token(Token = "0x400692F")]
private long[] x;
// Token: 0x04006930 RID: 26928
[global::Cpp2IlInjected.FieldOffset(Offset = "0x48")]
[Token(Token = "0x4006930")]
private int xOff;
}
}