using System; using System.Runtime.CompilerServices; using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; using Cpp2IlInjected; namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests { // Token: 0x02001DE3 RID: 7651 [Token(Token = "0x2001DE3")] public class TigerDigest : IDigest, IMemoable { // Token: 0x0600BFD3 RID: 49107 RVA: 0x002B329C File Offset: 0x002B149C [Token(Token = "0x600BFD3")] [Address(RVA = "0x24A7BF0", Offset = "0x24A6BF0", VA = "0x1824A7BF0")] public TigerDigest() { byte[] array = new byte[8]; this.Buffer = array; long[] array2 = new long[8]; this.x = array2; base..ctor(); this.Reset(); } // Token: 0x0600BFD4 RID: 49108 RVA: 0x002B32D4 File Offset: 0x002B14D4 [Token(Token = "0x600BFD4")] [Address(RVA = "0x24A7A80", Offset = "0x24A6A80", VA = "0x1824A7A80")] 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: 0x17001DCB RID: 7627 // (get) Token: 0x0600BFD5 RID: 49109 RVA: 0x002B33CC File Offset: 0x002B15CC [Token(Token = "0x17001DCB")] public string AlgorithmName { [Token(Token = "0x600BFD5")] [Address(RVA = "0x24A7C60", Offset = "0x24A6C60", VA = "0x1824A7C60", Slot = "4")] get { return "Tiger"; } } // Token: 0x0600BFD6 RID: 49110 RVA: 0x002B33E0 File Offset: 0x002B15E0 [Token(Token = "0x600BFD6")] [Address(RVA = "0xC42F00", Offset = "0xC41F00", VA = "0x180C42F00", Slot = "5")] public int GetDigestSize() { return 24; } // Token: 0x0600BFD7 RID: 49111 RVA: 0x002B33F0 File Offset: 0x002B15F0 [Token(Token = "0x600BFD7")] [Address(RVA = "0x8BCFC0", Offset = "0x8BBFC0", VA = "0x1808BCFC0", Slot = "6")] public int GetByteLength() { return 64; } // Token: 0x0600BFD8 RID: 49112 RVA: 0x002B3400 File Offset: 0x002B1600 [Token(Token = "0x600BFD8")] [Address(RVA = "0x24A6C60", Offset = "0x24A5C60", VA = "0x1824A6C60")] 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: 0x0600BFD9 RID: 49113 RVA: 0x002B3468 File Offset: 0x002B1668 [Token(Token = "0x600BFD9")] [Address(RVA = "0x24A7900", Offset = "0x24A6900", VA = "0x1824A7900", 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: 0x0600BFDA RID: 49114 RVA: 0x002B34B8 File Offset: 0x002B16B8 [Token(Token = "0x600BFDA")] [Address(RVA = "0x24A5B50", Offset = "0x24A4B50", VA = "0x1824A5B50", 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: 0x0600BFDB RID: 49115 RVA: 0x002B357C File Offset: 0x002B177C [Token(Token = "0x600BFDB")] [Address(RVA = "0x24A7080", Offset = "0x24A6080", VA = "0x1824A7080")] 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: 0x0600BFDC RID: 49116 RVA: 0x002B3600 File Offset: 0x002B1800 [Token(Token = "0x600BFDC")] [Address(RVA = "0x24A72E0", Offset = "0x24A62E0", VA = "0x1824A72E0")] 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: 0x0600BFDD RID: 49117 RVA: 0x002B3684 File Offset: 0x002B1884 [Token(Token = "0x600BFDD")] [Address(RVA = "0x24A7540", Offset = "0x24A6540", VA = "0x1824A7540")] 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: 0x0600BFDE RID: 49118 RVA: 0x002B3708 File Offset: 0x002B1908 [Token(Token = "0x600BFDE")] [Address(RVA = "0x24A6150", Offset = "0x24A5150", VA = "0x1824A6150")] 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: 0x0600BFDF RID: 49119 RVA: 0x002B3898 File Offset: 0x002B1A98 [Token(Token = "0x600BFDF")] [Address(RVA = "0x24A65E0", Offset = "0x24A55E0", VA = "0x1824A65E0")] 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: 0x0600BFE0 RID: 49120 RVA: 0x002B3A3C File Offset: 0x002B1C3C [Token(Token = "0x600BFE0")] [Address(RVA = "0x24A77A0", Offset = "0x24A67A0", VA = "0x1824A77A0")] private void UnpackWord(long r, byte[] output, int outOff) { int num = outOff + 1; } // Token: 0x0600BFE1 RID: 49121 RVA: 0x002B3A54 File Offset: 0x002B1C54 [Token(Token = "0x600BFE1")] [Address(RVA = "0x24A6C20", Offset = "0x24A5C20", VA = "0x1824A6C20")] private void ProcessLength(long bitLength) { this.x[7] = bitLength; } // Token: 0x0600BFE2 RID: 49122 RVA: 0x002B3A74 File Offset: 0x002B1C74 [Token(Token = "0x600BFE2")] [Address(RVA = "0x24A6030", Offset = "0x24A5030", VA = "0x1824A6030")] 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: 0x0600BFE3 RID: 49123 RVA: 0x002B3B2C File Offset: 0x002B1D2C [Token(Token = "0x600BFE3")] [Address(RVA = "0x24A5E90", Offset = "0x24A4E90", VA = "0x1824A5E90", 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: 0x0600BFE4 RID: 49124 RVA: 0x002B3C28 File Offset: 0x002B1E28 [Token(Token = "0x600BFE4")] [Address(RVA = "0x24A6E70", Offset = "0x24A5E70", VA = "0x1824A6E70", 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: 0x0600BFE5 RID: 49125 RVA: 0x002B3CC8 File Offset: 0x002B1EC8 [Token(Token = "0x600BFE5")] [Address(RVA = "0x24A5D00", Offset = "0x24A4D00", VA = "0x1824A5D00", 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: 0x0600BFE6 RID: 49126 RVA: 0x002B3DC0 File Offset: 0x002B1FC0 [Token(Token = "0x600BFE6")] [Address(RVA = "0x24A6F60", Offset = "0x24A5F60", VA = "0x1824A6F60", 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: 0x0600BFE7 RID: 49127 RVA: 0x002B3E04 File Offset: 0x002B2004 // Note: this type is marked as 'beforefieldinit'. [Token(Token = "0x600BFE7")] [Address(RVA = "0x24A7970", Offset = "0x24A6970", VA = "0x1824A7970")] static TigerDigest() { long[] array = new long[256]; RuntimeHelpers.InitializeArray(array, fieldof(.A0FABB8173BA247898A9FA267D0CE05500B667A0).FieldHandle); TigerDigest.t1 = array; long[] array2 = new long[256]; RuntimeHelpers.InitializeArray(array2, fieldof(.467C6758F235D3193618192A64129CBB602C9067).FieldHandle); TigerDigest.t2 = array2; long[] array3 = new long[256]; RuntimeHelpers.InitializeArray(array3, fieldof(.1648F737A4CFFDA4E6C83A3D742109BF9DBC2446).FieldHandle); TigerDigest.t3 = array3; long[] array4 = new long[256]; RuntimeHelpers.InitializeArray(array4, fieldof(.C079C42AC966756C902EC38C4D7989F3C20D3625).FieldHandle); TigerDigest.t4 = array4; } // Token: 0x0400791F RID: 31007 [Token(Token = "0x400791F")] private const int MyByteLength = 64; // Token: 0x04007920 RID: 31008 [Token(Token = "0x4007920")] private static readonly long[] t1; // Token: 0x04007921 RID: 31009 [Token(Token = "0x4007921")] private static readonly long[] t2; // Token: 0x04007922 RID: 31010 [Token(Token = "0x4007922")] private static readonly long[] t3; // Token: 0x04007923 RID: 31011 [Token(Token = "0x4007923")] private static readonly long[] t4; // Token: 0x04007924 RID: 31012 [Token(Token = "0x4007924")] private const int DigestLength = 24; // Token: 0x04007925 RID: 31013 [FieldOffset(Offset = "0x10")] [Token(Token = "0x4007925")] private long a; // Token: 0x04007926 RID: 31014 [FieldOffset(Offset = "0x18")] [Token(Token = "0x4007926")] private long b; // Token: 0x04007927 RID: 31015 [FieldOffset(Offset = "0x20")] [Token(Token = "0x4007927")] private long c; // Token: 0x04007928 RID: 31016 [FieldOffset(Offset = "0x28")] [Token(Token = "0x4007928")] private long byteCount; // Token: 0x04007929 RID: 31017 [FieldOffset(Offset = "0x30")] [Token(Token = "0x4007929")] private byte[] Buffer; // Token: 0x0400792A RID: 31018 [FieldOffset(Offset = "0x38")] [Token(Token = "0x400792A")] private int bOff; // Token: 0x0400792B RID: 31019 [FieldOffset(Offset = "0x40")] [Token(Token = "0x400792B")] private long[] x; // Token: 0x0400792C RID: 31020 [FieldOffset(Offset = "0x48")] [Token(Token = "0x400792C")] private int xOff; } }