terraria-cpp2il-methodrecon v1.4.4.9
Terraria mobile dump, with reconstructed method body. Dump with CallAnalysis: https://infinitynichto.github.io/terraria-cpp2il
Loading...
Searching...
No Matches
DESTransform.cs
Go to the documentation of this file.
1using System;
3
5{
6 // Token: 0x02000311 RID: 785
8 {
9 // Token: 0x06001A91 RID: 6801 RVA: 0x00039318 File Offset: 0x00037518
10 internal DESTransform(SymmetricAlgorithm symmAlgo, bool encryption, byte[] key, byte[] iv)
11 {
12 int num = 1;
13 base..ctor(symmAlgo, encryption, iv);
14 byte[] strongKey;
15 if (key == null)
16 {
17 if (num == 0)
18 {
19 }
21 }
22 bool flag = DES.IsWeakKey(strongKey);
23 if (num == 0)
24 {
25 }
27 object obj;
28 if (strongKey == null && obj != null && obj == null)
29 {
30 throw new InvalidCastException();
31 }
32 if (num == 0)
33 {
34 }
35 }
36
37 // Token: 0x06001A92 RID: 6802 RVA: 0x00039370 File Offset: 0x00037570
38 private uint CipherFunct(uint r, int n)
39 {
40 int num = 1;
41 byte[] array = this.keySchedule;
42 if (num == 0)
43 {
44 return;
45 }
46 }
47
48 // Token: 0x06001A93 RID: 6803 RVA: 0x00039390 File Offset: 0x00037590
49 internal static void Permutation(byte[] input, byte[] output, uint[] permTab, bool preSwap)
50 {
51 if (!true)
52 {
53 }
54 }
55
56 // Token: 0x06001A94 RID: 6804 RVA: 0x000393AC File Offset: 0x000375AC
57 private static void BSwap(byte[] byteBuff)
58 {
59 }
60
61 // Token: 0x06001A95 RID: 6805 RVA: 0x000393BC File Offset: 0x000375BC
62 internal void SetKey(byte[] key)
63 {
64 int num = 1;
65 byte[] array = this.keySchedule;
66 if (num == 0)
67 {
68 }
69 }
70
71 // Token: 0x06001A96 RID: 6806 RVA: 0x000393F0 File Offset: 0x000375F0
72 public void ProcessBlock(byte[] input, byte[] output)
73 {
74 uint[] array = this.dwordBuff;
75 if (!true)
76 {
77 }
78 long num = 0L;
79 uint[] array2 = this.dwordBuff;
80 if (this.encrypt)
81 {
82 long num2 = 0L;
83 uint num3 = this.CipherFunct((uint)num, (int)num2);
84 uint num4 = this.CipherFunct(array, 1);
85 uint num5 = this.CipherFunct(array, 2);
86 uint num6 = this.CipherFunct(array, 3);
87 uint num7 = this.CipherFunct(array, 4);
88 uint num8 = this.CipherFunct(array, 5);
89 uint num9 = this.CipherFunct(array, 6);
90 uint num10 = this.CipherFunct(array, 7);
91 uint num11 = this.CipherFunct(array, 8);
92 uint num12 = this.CipherFunct(array, 9);
93 uint num13 = this.CipherFunct(array, 10);
94 uint num14 = this.CipherFunct(array, 11);
95 uint num15 = this.CipherFunct(array, 12);
96 uint num16 = this.CipherFunct(array, 13);
97 uint num17 = this.CipherFunct(array, 14);
98 return;
99 }
100 uint num18 = this.CipherFunct(array, 15);
101 uint num19 = this.CipherFunct(array, 14);
102 uint num20 = this.CipherFunct(array, 12);
103 uint num21 = this.CipherFunct(array, 11);
104 uint num22 = this.CipherFunct(array, 10);
105 uint num23 = this.CipherFunct(array, 9);
106 uint num24 = this.CipherFunct(array, 8);
107 uint num25 = this.CipherFunct(array, 7);
108 uint num26 = this.CipherFunct(array, 6);
109 uint num27 = this.CipherFunct(array, 5);
110 uint num28 = this.CipherFunct(array, 4);
111 uint num29 = this.CipherFunct(array, 3);
112 uint num30 = this.CipherFunct(array, 2);
113 uint num31 = this.CipherFunct(array, 1);
114 long num32 = 0L;
115 uint num33 = this.CipherFunct(array, (int)num32);
116 uint[] array3 = this.dwordBuff;
117 if (array2 == null)
118 {
119 }
120 }
121
122 // Token: 0x06001A97 RID: 6807 RVA: 0x00039568 File Offset: 0x00037768
123 protected override void ECB(byte[] input, byte[] output)
124 {
125 if (!true)
126 {
127 }
128 byte[] array = this.byteBuff;
129 this.ProcessBlock(output, array);
130 byte[] array2 = this.byteBuff;
131 }
132
133 // Token: 0x06001A98 RID: 6808 RVA: 0x00039590 File Offset: 0x00037790
134 internal static byte[] GetStrongKey()
135 {
136 if ("AnyAtomicType" == null)
137 {
138 }
139 byte[] array = KeyBuilder.Key(41730048);
140 bool flag = DES.IsWeakKey(array);
142 return 41730048;
143 }
144
145 // Token: 0x06001A99 RID: 6809 RVA: 0x000395C4 File Offset: 0x000377C4
146 // Note: this type is marked as 'beforefieldinit'.
148 {
149 }
150
151 // Token: 0x04000D85 RID: 3461
152 internal static readonly int KEY_BIT_SIZE;
153
154 // Token: 0x04000D86 RID: 3462
155 internal static readonly int KEY_BYTE_SIZE;
156
157 // Token: 0x04000D87 RID: 3463
158 internal static readonly int BLOCK_BIT_SIZE;
159
160 // Token: 0x04000D88 RID: 3464
161 internal static readonly int BLOCK_BYTE_SIZE;
162
163 // Token: 0x04000D89 RID: 3465
164 private byte[] keySchedule;
165
166 // Token: 0x04000D8A RID: 3466
167 private byte[] byteBuff;
168
169 // Token: 0x04000D8B RID: 3467
170 private uint[] dwordBuff;
171
172 // Token: 0x04000D8C RID: 3468
173 private static readonly uint[] spBoxes;
174
175 // Token: 0x04000D8D RID: 3469
176 private static readonly byte[] PC1;
177
178 // Token: 0x04000D8E RID: 3470
179 private static readonly byte[] leftRotTotal;
180
181 // Token: 0x04000D8F RID: 3471
182 private static readonly byte[] PC2;
183
184 // Token: 0x04000D90 RID: 3472
185 internal static readonly uint[] ipTab;
186
187 // Token: 0x04000D91 RID: 3473
188 internal static readonly uint[] fpTab;
189 }
190}
class f__AnonymousType0<< Count > j__TPar
static byte[] Key(int size)
Definition KeyBuilder.cs:38
static void BSwap(byte[] byteBuff)
static void Permutation(byte[] input, byte[] output, uint[] permTab, bool preSwap)
void ProcessBlock(byte[] input, byte[] output)
DESTransform(SymmetricAlgorithm symmAlgo, bool encryption, byte[] key, byte[] iv)
override void ECB(byte[] input, byte[] output)
static bool IsWeakKey(byte[] rgbKey)
Definition DES.cs:92
static bool IsSemiWeakKey(byte[] rgbKey)
Definition DES.cs:101