2aba9d2253d248a6200ce51bf85dc04941500afb
[hashcat.git] / OpenCL / m13100_a1.cl
1 /**
2  * Authors......: Jens Steube <jens.steube@gmail.com>
3  *                Fist0urs <eddy.maaalou@gmail.com>
4  *                Gabriele Gristina <matrix@hashcat.net>
5  *
6  * License.....: MIT
7  */
8
9 #define _KRB5TGS_
10
11 //too much register pressure
12 //#define NEW_SIMD_CODE
13
14 #include "inc_hash_constants.h"
15 #include "inc_vendor.cl"
16
17 #define DGST_R0 0
18 #define DGST_R1 1
19 #define DGST_R2 2
20 #define DGST_R3 3
21
22 #include "inc_hash_functions.cl"
23 #include "inc_types.cl"
24 #include "inc_common.cl"
25 #include "inc_simd.cl"
26
27 typedef struct
28 {
29   u8 S[256];
30
31   u32 wtf_its_faster;
32
33 } RC4_KEY;
34
35 void swap (__local RC4_KEY *rc4_key, const u8 i, const u8 j)
36 {
37   u8 tmp;
38
39   tmp           = rc4_key->S[i];
40   rc4_key->S[i] = rc4_key->S[j];
41   rc4_key->S[j] = tmp;
42 }
43
44 void rc4_init_16 (__local RC4_KEY *rc4_key, const u32 data[4])
45 {
46   u32 v = 0x03020100;
47   u32 a = 0x04040404;
48
49   __local u32 *ptr = (__local u32 *) rc4_key->S;
50
51   #ifdef _unroll
52   #pragma unroll
53   #endif
54   for (u32 i = 0; i < 64; i++)
55   {
56     *ptr++ = v; v += a;
57   }
58
59   u32 j = 0;
60
61   for (u32 i = 0; i < 16; i++)
62   {
63     u32 idx = i * 16;
64
65     u32 v;
66
67     v = data[0];
68
69     j += rc4_key->S[idx] + (v >>  0); swap (rc4_key, idx, j); idx++;
70     j += rc4_key->S[idx] + (v >>  8); swap (rc4_key, idx, j); idx++;
71     j += rc4_key->S[idx] + (v >> 16); swap (rc4_key, idx, j); idx++;
72     j += rc4_key->S[idx] + (v >> 24); swap (rc4_key, idx, j); idx++;
73
74     v = data[1];
75
76     j += rc4_key->S[idx] + (v >>  0); swap (rc4_key, idx, j); idx++;
77     j += rc4_key->S[idx] + (v >>  8); swap (rc4_key, idx, j); idx++;
78     j += rc4_key->S[idx] + (v >> 16); swap (rc4_key, idx, j); idx++;
79     j += rc4_key->S[idx] + (v >> 24); swap (rc4_key, idx, j); idx++;
80
81     v = data[2];
82
83     j += rc4_key->S[idx] + (v >>  0); swap (rc4_key, idx, j); idx++;
84     j += rc4_key->S[idx] + (v >>  8); swap (rc4_key, idx, j); idx++;
85     j += rc4_key->S[idx] + (v >> 16); swap (rc4_key, idx, j); idx++;
86     j += rc4_key->S[idx] + (v >> 24); swap (rc4_key, idx, j); idx++;
87
88     v = data[3];
89
90     j += rc4_key->S[idx] + (v >>  0); swap (rc4_key, idx, j); idx++;
91     j += rc4_key->S[idx] + (v >>  8); swap (rc4_key, idx, j); idx++;
92     j += rc4_key->S[idx] + (v >> 16); swap (rc4_key, idx, j); idx++;
93     j += rc4_key->S[idx] + (v >> 24); swap (rc4_key, idx, j); idx++;
94   }
95 }
96
97 u8 rc4_next_16 (__local RC4_KEY *rc4_key, u8 i, u8 j, __global u32 *in, u32 out[4])
98 {
99   #ifdef _unroll
100   #pragma unroll
101   #endif
102   for (u32 k = 0; k < 4; k++)
103   {
104     u32 xor4 = 0;
105
106     u8 idx;
107
108     i += 1;
109     j += rc4_key->S[i];
110
111     swap (rc4_key, i, j);
112
113     idx = rc4_key->S[i] + rc4_key->S[j];
114
115     xor4 |= rc4_key->S[idx] <<  0;
116
117     i += 1;
118     j += rc4_key->S[i];
119
120     swap (rc4_key, i, j);
121
122     idx = rc4_key->S[i] + rc4_key->S[j];
123
124     xor4 |= rc4_key->S[idx] <<  8;
125
126     i += 1;
127     j += rc4_key->S[i];
128
129     swap (rc4_key, i, j);
130
131     idx = rc4_key->S[i] + rc4_key->S[j];
132
133     xor4 |= rc4_key->S[idx] << 16;
134
135     i += 1;
136     j += rc4_key->S[i];
137
138     swap (rc4_key, i, j);
139
140     idx = rc4_key->S[i] + rc4_key->S[j];
141
142     xor4 |= rc4_key->S[idx] << 24;
143
144     out[k] = in[k] ^ xor4;
145   }
146
147   return j;
148 }
149
150 void md4_transform (const u32 w0[4], const u32 w1[4], const u32 w2[4], const u32 w3[4], u32 digest[4])
151 {
152   u32 a = digest[0];
153   u32 b = digest[1];
154   u32 c = digest[2];
155   u32 d = digest[3];
156
157   MD4_STEP (MD4_Fo, a, b, c, d, w0[0], MD4C00, MD4S00);
158   MD4_STEP (MD4_Fo, d, a, b, c, w0[1], MD4C00, MD4S01);
159   MD4_STEP (MD4_Fo, c, d, a, b, w0[2], MD4C00, MD4S02);
160   MD4_STEP (MD4_Fo, b, c, d, a, w0[3], MD4C00, MD4S03);
161   MD4_STEP (MD4_Fo, a, b, c, d, w1[0], MD4C00, MD4S00);
162   MD4_STEP (MD4_Fo, d, a, b, c, w1[1], MD4C00, MD4S01);
163   MD4_STEP (MD4_Fo, c, d, a, b, w1[2], MD4C00, MD4S02);
164   MD4_STEP (MD4_Fo, b, c, d, a, w1[3], MD4C00, MD4S03);
165   MD4_STEP (MD4_Fo, a, b, c, d, w2[0], MD4C00, MD4S00);
166   MD4_STEP (MD4_Fo, d, a, b, c, w2[1], MD4C00, MD4S01);
167   MD4_STEP (MD4_Fo, c, d, a, b, w2[2], MD4C00, MD4S02);
168   MD4_STEP (MD4_Fo, b, c, d, a, w2[3], MD4C00, MD4S03);
169   MD4_STEP (MD4_Fo, a, b, c, d, w3[0], MD4C00, MD4S00);
170   MD4_STEP (MD4_Fo, d, a, b, c, w3[1], MD4C00, MD4S01);
171   MD4_STEP (MD4_Fo, c, d, a, b, w3[2], MD4C00, MD4S02);
172   MD4_STEP (MD4_Fo, b, c, d, a, w3[3], MD4C00, MD4S03);
173
174   MD4_STEP (MD4_Go, a, b, c, d, w0[0], MD4C01, MD4S10);
175   MD4_STEP (MD4_Go, d, a, b, c, w1[0], MD4C01, MD4S11);
176   MD4_STEP (MD4_Go, c, d, a, b, w2[0], MD4C01, MD4S12);
177   MD4_STEP (MD4_Go, b, c, d, a, w3[0], MD4C01, MD4S13);
178   MD4_STEP (MD4_Go, a, b, c, d, w0[1], MD4C01, MD4S10);
179   MD4_STEP (MD4_Go, d, a, b, c, w1[1], MD4C01, MD4S11);
180   MD4_STEP (MD4_Go, c, d, a, b, w2[1], MD4C01, MD4S12);
181   MD4_STEP (MD4_Go, b, c, d, a, w3[1], MD4C01, MD4S13);
182   MD4_STEP (MD4_Go, a, b, c, d, w0[2], MD4C01, MD4S10);
183   MD4_STEP (MD4_Go, d, a, b, c, w1[2], MD4C01, MD4S11);
184   MD4_STEP (MD4_Go, c, d, a, b, w2[2], MD4C01, MD4S12);
185   MD4_STEP (MD4_Go, b, c, d, a, w3[2], MD4C01, MD4S13);
186   MD4_STEP (MD4_Go, a, b, c, d, w0[3], MD4C01, MD4S10);
187   MD4_STEP (MD4_Go, d, a, b, c, w1[3], MD4C01, MD4S11);
188   MD4_STEP (MD4_Go, c, d, a, b, w2[3], MD4C01, MD4S12);
189   MD4_STEP (MD4_Go, b, c, d, a, w3[3], MD4C01, MD4S13);
190
191   MD4_STEP (MD4_H , a, b, c, d, w0[0], MD4C02, MD4S20);
192   MD4_STEP (MD4_H , d, a, b, c, w2[0], MD4C02, MD4S21);
193   MD4_STEP (MD4_H , c, d, a, b, w1[0], MD4C02, MD4S22);
194   MD4_STEP (MD4_H , b, c, d, a, w3[0], MD4C02, MD4S23);
195   MD4_STEP (MD4_H , a, b, c, d, w0[2], MD4C02, MD4S20);
196   MD4_STEP (MD4_H , d, a, b, c, w2[2], MD4C02, MD4S21);
197   MD4_STEP (MD4_H , c, d, a, b, w1[2], MD4C02, MD4S22);
198   MD4_STEP (MD4_H , b, c, d, a, w3[2], MD4C02, MD4S23);
199   MD4_STEP (MD4_H , a, b, c, d, w0[1], MD4C02, MD4S20);
200   MD4_STEP (MD4_H , d, a, b, c, w2[1], MD4C02, MD4S21);
201   MD4_STEP (MD4_H , c, d, a, b, w1[1], MD4C02, MD4S22);
202   MD4_STEP (MD4_H , b, c, d, a, w3[1], MD4C02, MD4S23);
203   MD4_STEP (MD4_H , a, b, c, d, w0[3], MD4C02, MD4S20);
204   MD4_STEP (MD4_H , d, a, b, c, w2[3], MD4C02, MD4S21);
205   MD4_STEP (MD4_H , c, d, a, b, w1[3], MD4C02, MD4S22);
206   MD4_STEP (MD4_H , b, c, d, a, w3[3], MD4C02, MD4S23);
207
208   digest[0] += a;
209   digest[1] += b;
210   digest[2] += c;
211   digest[3] += d;
212 }
213
214 void md5_transform (const u32 w0[4], const u32 w1[4], const u32 w2[4], const u32 w3[4], u32 digest[4])
215 {
216   u32 a = digest[0];
217   u32 b = digest[1];
218   u32 c = digest[2];
219   u32 d = digest[3];
220
221   u32 w0_t = w0[0];
222   u32 w1_t = w0[1];
223   u32 w2_t = w0[2];
224   u32 w3_t = w0[3];
225   u32 w4_t = w1[0];
226   u32 w5_t = w1[1];
227   u32 w6_t = w1[2];
228   u32 w7_t = w1[3];
229   u32 w8_t = w2[0];
230   u32 w9_t = w2[1];
231   u32 wa_t = w2[2];
232   u32 wb_t = w2[3];
233   u32 wc_t = w3[0];
234   u32 wd_t = w3[1];
235   u32 we_t = w3[2];
236   u32 wf_t = w3[3];
237
238   MD5_STEP (MD5_Fo, a, b, c, d, w0_t, MD5C00, MD5S00);
239   MD5_STEP (MD5_Fo, d, a, b, c, w1_t, MD5C01, MD5S01);
240   MD5_STEP (MD5_Fo, c, d, a, b, w2_t, MD5C02, MD5S02);
241   MD5_STEP (MD5_Fo, b, c, d, a, w3_t, MD5C03, MD5S03);
242   MD5_STEP (MD5_Fo, a, b, c, d, w4_t, MD5C04, MD5S00);
243   MD5_STEP (MD5_Fo, d, a, b, c, w5_t, MD5C05, MD5S01);
244   MD5_STEP (MD5_Fo, c, d, a, b, w6_t, MD5C06, MD5S02);
245   MD5_STEP (MD5_Fo, b, c, d, a, w7_t, MD5C07, MD5S03);
246   MD5_STEP (MD5_Fo, a, b, c, d, w8_t, MD5C08, MD5S00);
247   MD5_STEP (MD5_Fo, d, a, b, c, w9_t, MD5C09, MD5S01);
248   MD5_STEP (MD5_Fo, c, d, a, b, wa_t, MD5C0a, MD5S02);
249   MD5_STEP (MD5_Fo, b, c, d, a, wb_t, MD5C0b, MD5S03);
250   MD5_STEP (MD5_Fo, a, b, c, d, wc_t, MD5C0c, MD5S00);
251   MD5_STEP (MD5_Fo, d, a, b, c, wd_t, MD5C0d, MD5S01);
252   MD5_STEP (MD5_Fo, c, d, a, b, we_t, MD5C0e, MD5S02);
253   MD5_STEP (MD5_Fo, b, c, d, a, wf_t, MD5C0f, MD5S03);
254
255   MD5_STEP (MD5_Go, a, b, c, d, w1_t, MD5C10, MD5S10);
256   MD5_STEP (MD5_Go, d, a, b, c, w6_t, MD5C11, MD5S11);
257   MD5_STEP (MD5_Go, c, d, a, b, wb_t, MD5C12, MD5S12);
258   MD5_STEP (MD5_Go, b, c, d, a, w0_t, MD5C13, MD5S13);
259   MD5_STEP (MD5_Go, a, b, c, d, w5_t, MD5C14, MD5S10);
260   MD5_STEP (MD5_Go, d, a, b, c, wa_t, MD5C15, MD5S11);
261   MD5_STEP (MD5_Go, c, d, a, b, wf_t, MD5C16, MD5S12);
262   MD5_STEP (MD5_Go, b, c, d, a, w4_t, MD5C17, MD5S13);
263   MD5_STEP (MD5_Go, a, b, c, d, w9_t, MD5C18, MD5S10);
264   MD5_STEP (MD5_Go, d, a, b, c, we_t, MD5C19, MD5S11);
265   MD5_STEP (MD5_Go, c, d, a, b, w3_t, MD5C1a, MD5S12);
266   MD5_STEP (MD5_Go, b, c, d, a, w8_t, MD5C1b, MD5S13);
267   MD5_STEP (MD5_Go, a, b, c, d, wd_t, MD5C1c, MD5S10);
268   MD5_STEP (MD5_Go, d, a, b, c, w2_t, MD5C1d, MD5S11);
269   MD5_STEP (MD5_Go, c, d, a, b, w7_t, MD5C1e, MD5S12);
270   MD5_STEP (MD5_Go, b, c, d, a, wc_t, MD5C1f, MD5S13);
271
272   MD5_STEP (MD5_H , a, b, c, d, w5_t, MD5C20, MD5S20);
273   MD5_STEP (MD5_H , d, a, b, c, w8_t, MD5C21, MD5S21);
274   MD5_STEP (MD5_H , c, d, a, b, wb_t, MD5C22, MD5S22);
275   MD5_STEP (MD5_H , b, c, d, a, we_t, MD5C23, MD5S23);
276   MD5_STEP (MD5_H , a, b, c, d, w1_t, MD5C24, MD5S20);
277   MD5_STEP (MD5_H , d, a, b, c, w4_t, MD5C25, MD5S21);
278   MD5_STEP (MD5_H , c, d, a, b, w7_t, MD5C26, MD5S22);
279   MD5_STEP (MD5_H , b, c, d, a, wa_t, MD5C27, MD5S23);
280   MD5_STEP (MD5_H , a, b, c, d, wd_t, MD5C28, MD5S20);
281   MD5_STEP (MD5_H , d, a, b, c, w0_t, MD5C29, MD5S21);
282   MD5_STEP (MD5_H , c, d, a, b, w3_t, MD5C2a, MD5S22);
283   MD5_STEP (MD5_H , b, c, d, a, w6_t, MD5C2b, MD5S23);
284   MD5_STEP (MD5_H , a, b, c, d, w9_t, MD5C2c, MD5S20);
285   MD5_STEP (MD5_H , d, a, b, c, wc_t, MD5C2d, MD5S21);
286   MD5_STEP (MD5_H , c, d, a, b, wf_t, MD5C2e, MD5S22);
287   MD5_STEP (MD5_H , b, c, d, a, w2_t, MD5C2f, MD5S23);
288
289   MD5_STEP (MD5_I , a, b, c, d, w0_t, MD5C30, MD5S30);
290   MD5_STEP (MD5_I , d, a, b, c, w7_t, MD5C31, MD5S31);
291   MD5_STEP (MD5_I , c, d, a, b, we_t, MD5C32, MD5S32);
292   MD5_STEP (MD5_I , b, c, d, a, w5_t, MD5C33, MD5S33);
293   MD5_STEP (MD5_I , a, b, c, d, wc_t, MD5C34, MD5S30);
294   MD5_STEP (MD5_I , d, a, b, c, w3_t, MD5C35, MD5S31);
295   MD5_STEP (MD5_I , c, d, a, b, wa_t, MD5C36, MD5S32);
296   MD5_STEP (MD5_I , b, c, d, a, w1_t, MD5C37, MD5S33);
297   MD5_STEP (MD5_I , a, b, c, d, w8_t, MD5C38, MD5S30);
298   MD5_STEP (MD5_I , d, a, b, c, wf_t, MD5C39, MD5S31);
299   MD5_STEP (MD5_I , c, d, a, b, w6_t, MD5C3a, MD5S32);
300   MD5_STEP (MD5_I , b, c, d, a, wd_t, MD5C3b, MD5S33);
301   MD5_STEP (MD5_I , a, b, c, d, w4_t, MD5C3c, MD5S30);
302   MD5_STEP (MD5_I , d, a, b, c, wb_t, MD5C3d, MD5S31);
303   MD5_STEP (MD5_I , c, d, a, b, w2_t, MD5C3e, MD5S32);
304   MD5_STEP (MD5_I , b, c, d, a, w9_t, MD5C3f, MD5S33);
305
306   digest[0] += a;
307   digest[1] += b;
308   digest[2] += c;
309   digest[3] += d;
310 }
311
312 void hmac_md5_pad (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], u32 ipad[4], u32 opad[4])
313 {
314   w0[0] = w0[0] ^ 0x36363636;
315   w0[1] = w0[1] ^ 0x36363636;
316   w0[2] = w0[2] ^ 0x36363636;
317   w0[3] = w0[3] ^ 0x36363636;
318   w1[0] = w1[0] ^ 0x36363636;
319   w1[1] = w1[1] ^ 0x36363636;
320   w1[2] = w1[2] ^ 0x36363636;
321   w1[3] = w1[3] ^ 0x36363636;
322   w2[0] = w2[0] ^ 0x36363636;
323   w2[1] = w2[1] ^ 0x36363636;
324   w2[2] = w2[2] ^ 0x36363636;
325   w2[3] = w2[3] ^ 0x36363636;
326   w3[0] = w3[0] ^ 0x36363636;
327   w3[1] = w3[1] ^ 0x36363636;
328   w3[2] = w3[2] ^ 0x36363636;
329   w3[3] = w3[3] ^ 0x36363636;
330
331   ipad[0] = MD5M_A;
332   ipad[1] = MD5M_B;
333   ipad[2] = MD5M_C;
334   ipad[3] = MD5M_D;
335
336   md5_transform (w0, w1, w2, w3, ipad);
337
338   w0[0] = w0[0] ^ 0x6a6a6a6a;
339   w0[1] = w0[1] ^ 0x6a6a6a6a;
340   w0[2] = w0[2] ^ 0x6a6a6a6a;
341   w0[3] = w0[3] ^ 0x6a6a6a6a;
342   w1[0] = w1[0] ^ 0x6a6a6a6a;
343   w1[1] = w1[1] ^ 0x6a6a6a6a;
344   w1[2] = w1[2] ^ 0x6a6a6a6a;
345   w1[3] = w1[3] ^ 0x6a6a6a6a;
346   w2[0] = w2[0] ^ 0x6a6a6a6a;
347   w2[1] = w2[1] ^ 0x6a6a6a6a;
348   w2[2] = w2[2] ^ 0x6a6a6a6a;
349   w2[3] = w2[3] ^ 0x6a6a6a6a;
350   w3[0] = w3[0] ^ 0x6a6a6a6a;
351   w3[1] = w3[1] ^ 0x6a6a6a6a;
352   w3[2] = w3[2] ^ 0x6a6a6a6a;
353   w3[3] = w3[3] ^ 0x6a6a6a6a;
354
355   opad[0] = MD5M_A;
356   opad[1] = MD5M_B;
357   opad[2] = MD5M_C;
358   opad[3] = MD5M_D;
359
360   md5_transform (w0, w1, w2, w3, opad);
361 }
362
363 void hmac_md5_run (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], u32 ipad[4], u32 opad[4], u32 digest[4])
364 {
365   digest[0] = ipad[0];
366   digest[1] = ipad[1];
367   digest[2] = ipad[2];
368   digest[3] = ipad[3];
369
370   md5_transform (w0, w1, w2, w3, digest);
371
372   w0[0] = digest[0];
373   w0[1] = digest[1];
374   w0[2] = digest[2];
375   w0[3] = digest[3];
376   w1[0] = 0x80;
377   w1[1] = 0;
378   w1[2] = 0;
379   w1[3] = 0;
380   w2[0] = 0;
381   w2[1] = 0;
382   w2[2] = 0;
383   w2[3] = 0;
384   w3[0] = 0;
385   w3[1] = 0;
386   w3[2] = (64 + 16) * 8;
387   w3[3] = 0;
388
389   digest[0] = opad[0];
390   digest[1] = opad[1];
391   digest[2] = opad[2];
392   digest[3] = opad[3];
393
394   md5_transform (w0, w1, w2, w3, digest);
395 }
396
397 int decrypt_and_check (__local RC4_KEY *rc4_key, u32 data[4], __global u32 *edata2, const u32 edata2_len, const u32 K2[4], const u32 checksum[4])
398 {
399   rc4_init_16 (rc4_key, data);
400
401   u32 out0[4];
402   u32 out1[4];
403
404   u8 i = 0;
405   u8 j = 0;
406
407   /*
408     8 first bytes are nonce, then ASN1 structs (DER encoding: type-length-data)
409
410     if length >= 128 bytes:
411         length is on 2 bytes and type is \x63\x82 (encode_krb5_enc_tkt_part) and data is an ASN1 sequence \x30\x82
412     else:
413         length is on 1 byte and type is \x63\x81 and data is an ASN1 sequence \x30\x81
414
415     next headers follow the same ASN1 "type-length-data" scheme
416   */
417
418   j = rc4_next_16 (rc4_key, i, j, edata2 + 0, out0); i += 16;
419
420   if (((out0[2] & 0xff00ffff) != 0x30008163) && ((out0[2] & 0x0000ffff) != 0x00008263)) return 0;
421
422   j = rc4_next_16 (rc4_key, i, j, edata2 + 4, out1); i += 16;
423
424   if (((out1[0] & 0x00ffffff) != 0x00000503) && (out1[0] != 0x050307A0)) return 0;
425
426   rc4_init_16 (rc4_key, data);
427
428   i = 0;
429   j = 0;
430
431   // init hmac
432
433   u32 w0[4];
434   u32 w1[4];
435   u32 w2[4];
436   u32 w3[4];
437
438   w0[0] = K2[0];
439   w0[1] = K2[1];
440   w0[2] = K2[2];
441   w0[3] = K2[3];
442   w1[0] = 0;
443   w1[1] = 0;
444   w1[2] = 0;
445   w1[3] = 0;
446   w2[0] = 0;
447   w2[1] = 0;
448   w2[2] = 0;
449   w2[3] = 0;
450   w3[0] = 0;
451   w3[1] = 0;
452   w3[2] = 0;
453   w3[3] = 0;
454
455   u32 ipad[4];
456   u32 opad[4];
457
458   hmac_md5_pad (w0, w1, w2, w3, ipad, opad);
459
460   int edata2_left;
461
462   for (edata2_left = edata2_len; edata2_left >= 64; edata2_left -= 64)
463   {
464     j = rc4_next_16 (rc4_key, i, j, edata2, w0); i += 16; edata2 += 4;
465     j = rc4_next_16 (rc4_key, i, j, edata2, w1); i += 16; edata2 += 4;
466     j = rc4_next_16 (rc4_key, i, j, edata2, w2); i += 16; edata2 += 4;
467     j = rc4_next_16 (rc4_key, i, j, edata2, w3); i += 16; edata2 += 4;
468
469     md5_transform (w0, w1, w2, w3, ipad);
470   }
471
472   w0[0] = 0;
473   w0[1] = 0;
474   w0[2] = 0;
475   w0[3] = 0;
476   w1[0] = 0;
477   w1[1] = 0;
478   w1[2] = 0;
479   w1[3] = 0;
480   w2[0] = 0;
481   w2[1] = 0;
482   w2[2] = 0;
483   w2[3] = 0;
484   w3[0] = 0;
485   w3[1] = 0;
486   w3[2] = 0;
487   w3[3] = 0;
488
489   if (edata2_left < 16)
490   {
491     j = rc4_next_16 (rc4_key, i, j, edata2, w0); i += 16; edata2 += 4;
492
493     truncate_block  (w0, edata2_left & 0xf);
494     append_0x80_1x4 (w0, edata2_left & 0xf);
495
496     w3[2] = (64 + edata2_len) * 8;
497     w3[3] = 0;
498
499     md5_transform (w0, w1, w2, w3, ipad);
500   }
501   else if (edata2_left < 32)
502   {
503     j = rc4_next_16 (rc4_key, i, j, edata2, w0); i += 16; edata2 += 4;
504     j = rc4_next_16 (rc4_key, i, j, edata2, w1); i += 16; edata2 += 4;
505
506     truncate_block  (w1, edata2_left & 0xf);
507     append_0x80_1x4 (w1, edata2_left & 0xf);
508
509     w3[2] = (64 + edata2_len) * 8;
510     w3[3] = 0;
511
512     md5_transform (w0, w1, w2, w3, ipad);
513   }
514   else if (edata2_left < 48)
515   {
516     j = rc4_next_16 (rc4_key, i, j, edata2, w0); i += 16; edata2 += 4;
517     j = rc4_next_16 (rc4_key, i, j, edata2, w1); i += 16; edata2 += 4;
518     j = rc4_next_16 (rc4_key, i, j, edata2, w2); i += 16; edata2 += 4;
519
520     truncate_block  (w2, edata2_left & 0xf);
521     append_0x80_1x4 (w2, edata2_left & 0xf);
522
523     w3[2] = (64 + edata2_len) * 8;
524     w3[3] = 0;
525
526     md5_transform (w0, w1, w2, w3, ipad);
527   }
528   else
529   {
530     j = rc4_next_16 (rc4_key, i, j, edata2, w0); i += 16; edata2 += 4;
531     j = rc4_next_16 (rc4_key, i, j, edata2, w1); i += 16; edata2 += 4;
532     j = rc4_next_16 (rc4_key, i, j, edata2, w2); i += 16; edata2 += 4;
533     j = rc4_next_16 (rc4_key, i, j, edata2, w3); i += 16; edata2 += 4;
534
535     truncate_block  (w3, edata2_left & 0xf);
536     append_0x80_1x4 (w3, edata2_left & 0xf);
537
538     if (edata2_left < 56)
539     {
540       w3[2] = (64 + edata2_len) * 8;
541       w3[3] = 0;
542
543       md5_transform (w0, w1, w2, w3, ipad);
544     }
545     else
546     {
547       md5_transform (w0, w1, w2, w3, ipad);
548
549       w0[0] = 0;
550       w0[1] = 0;
551       w0[2] = 0;
552       w0[3] = 0;
553       w1[0] = 0;
554       w1[1] = 0;
555       w1[2] = 0;
556       w1[3] = 0;
557       w2[0] = 0;
558       w2[1] = 0;
559       w2[2] = 0;
560       w2[3] = 0;
561       w3[0] = 0;
562       w3[1] = 0;
563       w3[2] = (64 + edata2_len) * 8;
564       w3[3] = 0;
565
566       md5_transform (w0, w1, w2, w3, ipad);
567     }
568   }
569
570   w0[0] = ipad[0];
571   w0[1] = ipad[1];
572   w0[2] = ipad[2];
573   w0[3] = ipad[3];
574   w1[0] = 0x80;
575   w1[1] = 0;
576   w1[2] = 0;
577   w1[3] = 0;
578   w2[0] = 0;
579   w2[1] = 0;
580   w2[2] = 0;
581   w2[3] = 0;
582   w3[0] = 0;
583   w3[1] = 0;
584   w3[2] = (64 + 16) * 8;
585   w3[3] = 0;
586
587   md5_transform (w0, w1, w2, w3, opad);
588
589   if (checksum[0] != opad[0]) return 0;
590   if (checksum[1] != opad[1]) return 0;
591   if (checksum[2] != opad[2]) return 0;
592   if (checksum[3] != opad[3]) return 0;
593
594   return 1;
595 }
596
597 void kerb_prepare (const u32 w0[4], const u32 w1[4], const u32 pw_len, const u32 checksum[4], u32 digest[4], u32 K2[4])
598 {
599   /**
600    * pads
601    */
602
603   u32 w0_t[4];
604   u32 w1_t[4];
605   u32 w2_t[4];
606   u32 w3_t[4];
607
608   w0_t[0] = w0[0];
609   w0_t[1] = w0[1];
610   w0_t[2] = w0[2];
611   w0_t[3] = w0[3];
612   w1_t[0] = w1[0];
613   w1_t[1] = w1[1];
614   w1_t[2] = w1[2];
615   w1_t[3] = w1[3];
616   w2_t[0] = 0;
617   w2_t[1] = 0;
618   w2_t[2] = 0;
619   w2_t[3] = 0;
620   w3_t[0] = 0;
621   w3_t[1] = 0;
622   w3_t[2] = 0;
623   w3_t[3] = 0;
624
625   // K=MD4(Little_indian(UNICODE(pwd))
626
627   append_0x80_2x4 (w0_t, w1_t, pw_len);
628
629   make_unicode (w1_t, w2_t, w3_t);
630   make_unicode (w0_t, w0_t, w1_t);
631
632   w3_t[2] = pw_len * 8 * 2;
633   w3_t[3] = 0;
634
635   digest[0] = MD4M_A;
636   digest[1] = MD4M_B;
637   digest[2] = MD4M_C;
638   digest[3] = MD4M_D;
639
640   md4_transform (w0_t, w1_t, w2_t, w3_t, digest);
641
642   // K1=MD5_HMAC(K,1); with 2 encoded as little indian on 4 bytes (02000000 in hexa);
643
644   w0_t[0] = digest[0];
645   w0_t[1] = digest[1];
646   w0_t[2] = digest[2];
647   w0_t[3] = digest[3];
648   w1_t[0] = 0;
649   w1_t[1] = 0;
650   w1_t[2] = 0;
651   w1_t[3] = 0;
652   w2_t[0] = 0;
653   w2_t[1] = 0;
654   w2_t[2] = 0;
655   w2_t[3] = 0;
656   w3_t[0] = 0;
657   w3_t[1] = 0;
658   w3_t[2] = 0;
659   w3_t[3] = 0;
660
661   u32 ipad[4];
662   u32 opad[4];
663
664   hmac_md5_pad (w0_t, w1_t, w2_t, w3_t, ipad, opad);
665
666   w0_t[0] = 2;
667   w0_t[1] = 0x80;
668   w0_t[2] = 0;
669   w0_t[3] = 0;
670   w1_t[0] = 0;
671   w1_t[1] = 0;
672   w1_t[2] = 0;
673   w1_t[3] = 0;
674   w2_t[0] = 0;
675   w2_t[1] = 0;
676   w2_t[2] = 0;
677   w2_t[3] = 0;
678   w3_t[0] = 0;
679   w3_t[1] = 0;
680   w3_t[2] = (64 + 4) * 8;
681   w3_t[3] = 0;
682
683   hmac_md5_run (w0_t, w1_t, w2_t, w3_t, ipad, opad, digest);
684
685   // K2 = K1;
686
687   K2[0] = digest[0];
688   K2[1] = digest[1];
689   K2[2] = digest[2];
690   K2[3] = digest[3];
691
692   // K3=MD5_HMAC(K1,checksum);
693
694   w0_t[0] = digest[0];
695   w0_t[1] = digest[1];
696   w0_t[2] = digest[2];
697   w0_t[3] = digest[3];
698   w1_t[0] = 0;
699   w1_t[1] = 0;
700   w1_t[2] = 0;
701   w1_t[3] = 0;
702   w2_t[0] = 0;
703   w2_t[1] = 0;
704   w2_t[2] = 0;
705   w2_t[3] = 0;
706   w3_t[0] = 0;
707   w3_t[1] = 0;
708   w3_t[2] = 0;
709   w3_t[3] = 0;
710
711   hmac_md5_pad (w0_t, w1_t, w2_t, w3_t, ipad, opad);
712
713   w0_t[0] = checksum[0];
714   w0_t[1] = checksum[1];
715   w0_t[2] = checksum[2];
716   w0_t[3] = checksum[3];
717   w1_t[0] = 0x80;
718   w1_t[1] = 0;
719   w1_t[2] = 0;
720   w1_t[3] = 0;
721   w2_t[0] = 0;
722   w2_t[1] = 0;
723   w2_t[2] = 0;
724   w2_t[3] = 0;
725   w3_t[0] = 0;
726   w3_t[1] = 0;
727   w3_t[2] = (64 + 16) * 8;
728   w3_t[3] = 0;
729
730   hmac_md5_run (w0_t, w1_t, w2_t, w3_t, ipad, opad, digest);
731 }
732
733 __kernel void m13100_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global krb5tgs_t *krb5tgs_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
734 {
735   /**
736    * modifier
737    */
738
739   const u32 lid = get_local_id (0);
740
741   /**
742    * base
743    */
744
745   const u32 gid = get_global_id (0);
746
747   if (gid >= gid_max) return;
748
749   u32 pw_buf0[4];
750   u32 pw_buf1[4];
751
752   pw_buf0[0] = pws[gid].i[0];
753   pw_buf0[1] = pws[gid].i[1];
754   pw_buf0[2] = pws[gid].i[2];
755   pw_buf0[3] = pws[gid].i[3];
756   pw_buf1[0] = pws[gid].i[4];
757   pw_buf1[1] = pws[gid].i[5];
758   pw_buf1[2] = pws[gid].i[6];
759   pw_buf1[3] = pws[gid].i[7];
760
761   const u32 pw_l_len = pws[gid].pw_len;
762
763   /**
764    * shared
765    */
766
767   __local RC4_KEY rc4_keys[64];
768
769   /**
770    * salt
771    */
772
773   u32 checksum[4];
774
775   checksum[0] = krb5tgs_bufs[salt_pos].checksum[0];
776   checksum[1] = krb5tgs_bufs[salt_pos].checksum[1];
777   checksum[2] = krb5tgs_bufs[salt_pos].checksum[2];
778   checksum[3] = krb5tgs_bufs[salt_pos].checksum[3];
779
780   /**
781    * loop
782    */
783
784   for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
785   {
786     const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
787
788     const u32x pw_len = pw_l_len + pw_r_len;
789
790     /**
791      * concat password candidate
792      */
793
794     u32x wordl0[4] = { 0 };
795     u32x wordl1[4] = { 0 };
796     u32x wordl2[4] = { 0 };
797     u32x wordl3[4] = { 0 };
798
799     wordl0[0] = pw_buf0[0];
800     wordl0[1] = pw_buf0[1];
801     wordl0[2] = pw_buf0[2];
802     wordl0[3] = pw_buf0[3];
803     wordl1[0] = pw_buf1[0];
804     wordl1[1] = pw_buf1[1];
805     wordl1[2] = pw_buf1[2];
806     wordl1[3] = pw_buf1[3];
807
808     u32x wordr0[4] = { 0 };
809     u32x wordr1[4] = { 0 };
810     u32x wordr2[4] = { 0 };
811     u32x wordr3[4] = { 0 };
812
813     wordr0[0] = ix_create_combt (combs_buf, il_pos, 0);
814     wordr0[1] = ix_create_combt (combs_buf, il_pos, 1);
815     wordr0[2] = ix_create_combt (combs_buf, il_pos, 2);
816     wordr0[3] = ix_create_combt (combs_buf, il_pos, 3);
817     wordr1[0] = ix_create_combt (combs_buf, il_pos, 4);
818     wordr1[1] = ix_create_combt (combs_buf, il_pos, 5);
819     wordr1[2] = ix_create_combt (combs_buf, il_pos, 6);
820     wordr1[3] = ix_create_combt (combs_buf, il_pos, 7);
821
822     if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
823     {
824       switch_buffer_by_offset_le_VV (wordr0, wordr1, wordr2, wordr3, pw_l_len);
825     }
826     else
827     {
828       switch_buffer_by_offset_le_VV (wordl0, wordl1, wordl2, wordl3, pw_r_len);
829     }
830
831     u32x w0[4];
832     u32x w1[4];
833
834     w0[0] = wordl0[0] | wordr0[0];
835     w0[1] = wordl0[1] | wordr0[1];
836     w0[2] = wordl0[2] | wordr0[2];
837     w0[3] = wordl0[3] | wordr0[3];
838     w1[0] = wordl1[0] | wordr1[0];
839     w1[1] = wordl1[1] | wordr1[1];
840     w1[2] = wordl1[2] | wordr1[2];
841     w1[3] = wordl1[3] | wordr1[3];
842
843     /**
844      * kerberos
845      */
846
847     u32 digest[4];
848
849     u32 K2[4];
850
851     kerb_prepare (w0, w1, pw_len, checksum, digest, K2);
852
853     u32 tmp[4];
854
855     tmp[0] = digest[0];
856     tmp[1] = digest[1];
857     tmp[2] = digest[2];
858     tmp[3] = digest[3];
859
860     if (decrypt_and_check (&rc4_keys[lid], tmp, krb5tgs_bufs[salt_pos].edata2, krb5tgs_bufs[salt_pos].edata2_len, K2, checksum) == 1)
861     {
862       mark_hash (plains_buf, d_return_buf, salt_pos, 0, digests_offset + 0, gid, il_pos);
863     }
864   }
865 }
866
867 __kernel void m13100_m08 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global krb5tgs_t *krb5tgs_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
868 {
869 }
870
871 __kernel void m13100_m16 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global krb5tgs_t *krb5tgs_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
872 {
873 }
874
875 __kernel void m13100_s04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global krb5tgs_t *krb5tgs_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
876 {
877   /**
878    * modifier
879    */
880
881   const u32 lid = get_local_id (0);
882
883   /**
884    * base
885    */
886
887   const u32 gid = get_global_id (0);
888
889   if (gid >= gid_max) return;
890
891   u32 pw_buf0[4];
892   u32 pw_buf1[4];
893
894   pw_buf0[0] = pws[gid].i[0];
895   pw_buf0[1] = pws[gid].i[1];
896   pw_buf0[2] = pws[gid].i[2];
897   pw_buf0[3] = pws[gid].i[3];
898   pw_buf1[0] = pws[gid].i[4];
899   pw_buf1[1] = pws[gid].i[5];
900   pw_buf1[2] = pws[gid].i[6];
901   pw_buf1[3] = pws[gid].i[7];
902
903   const u32 pw_l_len = pws[gid].pw_len;
904
905   /**
906    * shared
907    */
908
909   __local RC4_KEY rc4_keys[64];
910
911   /**
912    * salt
913    */
914
915   u32 checksum[4];
916
917   checksum[0] = krb5tgs_bufs[salt_pos].checksum[0];
918   checksum[1] = krb5tgs_bufs[salt_pos].checksum[1];
919   checksum[2] = krb5tgs_bufs[salt_pos].checksum[2];
920   checksum[3] = krb5tgs_bufs[salt_pos].checksum[3];
921
922   /**
923    * loop
924    */
925
926   for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
927   {
928     const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
929
930     const u32x pw_len = pw_l_len + pw_r_len;
931
932     /**
933      * concat password candidate
934      */
935
936     u32x wordl0[4] = { 0 };
937     u32x wordl1[4] = { 0 };
938     u32x wordl2[4] = { 0 };
939     u32x wordl3[4] = { 0 };
940
941     wordl0[0] = pw_buf0[0];
942     wordl0[1] = pw_buf0[1];
943     wordl0[2] = pw_buf0[2];
944     wordl0[3] = pw_buf0[3];
945     wordl1[0] = pw_buf1[0];
946     wordl1[1] = pw_buf1[1];
947     wordl1[2] = pw_buf1[2];
948     wordl1[3] = pw_buf1[3];
949
950     u32x wordr0[4] = { 0 };
951     u32x wordr1[4] = { 0 };
952     u32x wordr2[4] = { 0 };
953     u32x wordr3[4] = { 0 };
954
955     wordr0[0] = ix_create_combt (combs_buf, il_pos, 0);
956     wordr0[1] = ix_create_combt (combs_buf, il_pos, 1);
957     wordr0[2] = ix_create_combt (combs_buf, il_pos, 2);
958     wordr0[3] = ix_create_combt (combs_buf, il_pos, 3);
959     wordr1[0] = ix_create_combt (combs_buf, il_pos, 4);
960     wordr1[1] = ix_create_combt (combs_buf, il_pos, 5);
961     wordr1[2] = ix_create_combt (combs_buf, il_pos, 6);
962     wordr1[3] = ix_create_combt (combs_buf, il_pos, 7);
963
964     if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
965     {
966       switch_buffer_by_offset_le_VV (wordr0, wordr1, wordr2, wordr3, pw_l_len);
967     }
968     else
969     {
970       switch_buffer_by_offset_le_VV (wordl0, wordl1, wordl2, wordl3, pw_r_len);
971     }
972
973     u32x w0[4];
974     u32x w1[4];
975
976     w0[0] = wordl0[0] | wordr0[0];
977     w0[1] = wordl0[1] | wordr0[1];
978     w0[2] = wordl0[2] | wordr0[2];
979     w0[3] = wordl0[3] | wordr0[3];
980     w1[0] = wordl1[0] | wordr1[0];
981     w1[1] = wordl1[1] | wordr1[1];
982     w1[2] = wordl1[2] | wordr1[2];
983     w1[3] = wordl1[3] | wordr1[3];
984
985     /**
986      * kerberos
987      */
988
989     u32 digest[4];
990
991     u32 K2[4];
992
993     kerb_prepare (w0, w1, pw_len, checksum, digest, K2);
994
995     u32 tmp[4];
996
997     tmp[0] = digest[0];
998     tmp[1] = digest[1];
999     tmp[2] = digest[2];
1000     tmp[3] = digest[3];
1001
1002     if (decrypt_and_check (&rc4_keys[lid], tmp, krb5tgs_bufs[salt_pos].edata2, krb5tgs_bufs[salt_pos].edata2_len, K2, checksum) == 1)
1003     {
1004       mark_hash (plains_buf, d_return_buf, salt_pos, 0, digests_offset + 0, gid, il_pos);
1005     }
1006   }
1007 }
1008
1009 __kernel void m13100_s08 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global krb5tgs_t *krb5tgs_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
1010 {
1011 }
1012
1013 __kernel void m13100_s16 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global krb5tgs_t *krb5tgs_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
1014 {
1015 }