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