721bfc557681534a766f4a13cee0fdcc700cc748
[hashcat.git] / OpenCL / m10500.cl
1 /**
2  * Author......: Jens Steube <jens.steube@gmail.com>
3  * License.....: MIT
4  */
5
6 #define _MD5_
7
8 #include "inc_hash_constants.h"
9 #include "inc_vendor.cl"
10
11 #define DGST_R0 0
12 #define DGST_R1 1
13 #define DGST_R2 2
14 #define DGST_R3 3
15
16 #include "inc_hash_functions.cl"
17 #include "inc_types.cl"
18 #include "inc_common.cl"
19
20 #define COMPARE_S "inc_comp_single.cl"
21 #define COMPARE_M "inc_comp_multi.cl"
22
23 __constant u32 padding[8] =
24 {
25   0x5e4ebf28,
26   0x418a754e,
27   0x564e0064,
28   0x0801faff,
29   0xb6002e2e,
30   0x803e68d0,
31   0xfea90c2f,
32   0x7a695364
33 };
34
35 typedef struct
36 {
37   u8 S[256];
38
39   u32 wtf_its_faster;
40
41 } RC4_KEY;
42
43 void swap (__local RC4_KEY *rc4_key, const u8 i, const u8 j)
44 {
45   u8 tmp;
46
47   tmp           = rc4_key->S[i];
48   rc4_key->S[i] = rc4_key->S[j];
49   rc4_key->S[j] = tmp;
50 }
51
52 void rc4_init_16 (__local RC4_KEY *rc4_key, const u32 data[4])
53 {
54   u32 v = 0x03020100;
55   u32 a = 0x04040404;
56
57   __local u32 *ptr = (__local u32 *) rc4_key->S;
58
59   #ifdef _unroll
60   #pragma unroll
61   #endif
62   for (u32 i = 0; i < 64; i++)
63   {
64     *ptr++ = v; v += a;
65   }
66
67   u32 j = 0;
68
69   #ifdef _unroll
70   #pragma unroll
71   #endif
72   for (u32 i = 0; i < 16; i++)
73   {
74     u32 idx = i * 16;
75
76     u32 v;
77
78     v = data[0];
79
80     j += rc4_key->S[idx] + (v >>  0); swap (rc4_key, idx, j); idx++;
81     j += rc4_key->S[idx] + (v >>  8); swap (rc4_key, idx, j); idx++;
82     j += rc4_key->S[idx] + (v >> 16); swap (rc4_key, idx, j); idx++;
83     j += rc4_key->S[idx] + (v >> 24); swap (rc4_key, idx, j); idx++;
84
85     v = data[1];
86
87     j += rc4_key->S[idx] + (v >>  0); swap (rc4_key, idx, j); idx++;
88     j += rc4_key->S[idx] + (v >>  8); swap (rc4_key, idx, j); idx++;
89     j += rc4_key->S[idx] + (v >> 16); swap (rc4_key, idx, j); idx++;
90     j += rc4_key->S[idx] + (v >> 24); swap (rc4_key, idx, j); idx++;
91
92     v = data[2];
93
94     j += rc4_key->S[idx] + (v >>  0); swap (rc4_key, idx, j); idx++;
95     j += rc4_key->S[idx] + (v >>  8); swap (rc4_key, idx, j); idx++;
96     j += rc4_key->S[idx] + (v >> 16); swap (rc4_key, idx, j); idx++;
97     j += rc4_key->S[idx] + (v >> 24); swap (rc4_key, idx, j); idx++;
98
99     v = data[3];
100
101     j += rc4_key->S[idx] + (v >>  0); swap (rc4_key, idx, j); idx++;
102     j += rc4_key->S[idx] + (v >>  8); swap (rc4_key, idx, j); idx++;
103     j += rc4_key->S[idx] + (v >> 16); swap (rc4_key, idx, j); idx++;
104     j += rc4_key->S[idx] + (v >> 24); swap (rc4_key, idx, j); idx++;
105   }
106 }
107
108 u8 rc4_next_16 (__local RC4_KEY *rc4_key, u8 i, u8 j, const u32 in[4], u32 out[4])
109 {
110   #ifdef _unroll
111   #pragma unroll
112   #endif
113   for (u32 k = 0; k < 4; k++)
114   {
115     u32 xor4 = 0;
116
117     u8 idx;
118
119     i += 1;
120     j += rc4_key->S[i];
121
122     swap (rc4_key, i, j);
123
124     idx = rc4_key->S[i] + rc4_key->S[j];
125
126     xor4 |= rc4_key->S[idx] <<  0;
127
128     i += 1;
129     j += rc4_key->S[i];
130
131     swap (rc4_key, i, j);
132
133     idx = rc4_key->S[i] + rc4_key->S[j];
134
135     xor4 |= rc4_key->S[idx] <<  8;
136
137     i += 1;
138     j += rc4_key->S[i];
139
140     swap (rc4_key, i, j);
141
142     idx = rc4_key->S[i] + rc4_key->S[j];
143
144     xor4 |= rc4_key->S[idx] << 16;
145
146     i += 1;
147     j += rc4_key->S[i];
148
149     swap (rc4_key, i, j);
150
151     idx = rc4_key->S[i] + rc4_key->S[j];
152
153     xor4 |= rc4_key->S[idx] << 24;
154
155     out[k] = in[k] ^ xor4;
156   }
157
158   return j;
159 }
160
161 void md5_transform (const u32 w0[4], const u32 w1[4], const u32 w2[4], const u32 w3[4], u32 digest[4])
162 {
163   u32 a = digest[0];
164   u32 b = digest[1];
165   u32 c = digest[2];
166   u32 d = digest[3];
167
168   u32 w0_t = w0[0];
169   u32 w1_t = w0[1];
170   u32 w2_t = w0[2];
171   u32 w3_t = w0[3];
172   u32 w4_t = w1[0];
173   u32 w5_t = w1[1];
174   u32 w6_t = w1[2];
175   u32 w7_t = w1[3];
176   u32 w8_t = w2[0];
177   u32 w9_t = w2[1];
178   u32 wa_t = w2[2];
179   u32 wb_t = w2[3];
180   u32 wc_t = w3[0];
181   u32 wd_t = w3[1];
182   u32 we_t = w3[2];
183   u32 wf_t = w3[3];
184
185   MD5_STEP (MD5_Fo, a, b, c, d, w0_t, MD5C00, MD5S00);
186   MD5_STEP (MD5_Fo, d, a, b, c, w1_t, MD5C01, MD5S01);
187   MD5_STEP (MD5_Fo, c, d, a, b, w2_t, MD5C02, MD5S02);
188   MD5_STEP (MD5_Fo, b, c, d, a, w3_t, MD5C03, MD5S03);
189   MD5_STEP (MD5_Fo, a, b, c, d, w4_t, MD5C04, MD5S00);
190   MD5_STEP (MD5_Fo, d, a, b, c, w5_t, MD5C05, MD5S01);
191   MD5_STEP (MD5_Fo, c, d, a, b, w6_t, MD5C06, MD5S02);
192   MD5_STEP (MD5_Fo, b, c, d, a, w7_t, MD5C07, MD5S03);
193   MD5_STEP (MD5_Fo, a, b, c, d, w8_t, MD5C08, MD5S00);
194   MD5_STEP (MD5_Fo, d, a, b, c, w9_t, MD5C09, MD5S01);
195   MD5_STEP (MD5_Fo, c, d, a, b, wa_t, MD5C0a, MD5S02);
196   MD5_STEP (MD5_Fo, b, c, d, a, wb_t, MD5C0b, MD5S03);
197   MD5_STEP (MD5_Fo, a, b, c, d, wc_t, MD5C0c, MD5S00);
198   MD5_STEP (MD5_Fo, d, a, b, c, wd_t, MD5C0d, MD5S01);
199   MD5_STEP (MD5_Fo, c, d, a, b, we_t, MD5C0e, MD5S02);
200   MD5_STEP (MD5_Fo, b, c, d, a, wf_t, MD5C0f, MD5S03);
201
202   MD5_STEP (MD5_Go, a, b, c, d, w1_t, MD5C10, MD5S10);
203   MD5_STEP (MD5_Go, d, a, b, c, w6_t, MD5C11, MD5S11);
204   MD5_STEP (MD5_Go, c, d, a, b, wb_t, MD5C12, MD5S12);
205   MD5_STEP (MD5_Go, b, c, d, a, w0_t, MD5C13, MD5S13);
206   MD5_STEP (MD5_Go, a, b, c, d, w5_t, MD5C14, MD5S10);
207   MD5_STEP (MD5_Go, d, a, b, c, wa_t, MD5C15, MD5S11);
208   MD5_STEP (MD5_Go, c, d, a, b, wf_t, MD5C16, MD5S12);
209   MD5_STEP (MD5_Go, b, c, d, a, w4_t, MD5C17, MD5S13);
210   MD5_STEP (MD5_Go, a, b, c, d, w9_t, MD5C18, MD5S10);
211   MD5_STEP (MD5_Go, d, a, b, c, we_t, MD5C19, MD5S11);
212   MD5_STEP (MD5_Go, c, d, a, b, w3_t, MD5C1a, MD5S12);
213   MD5_STEP (MD5_Go, b, c, d, a, w8_t, MD5C1b, MD5S13);
214   MD5_STEP (MD5_Go, a, b, c, d, wd_t, MD5C1c, MD5S10);
215   MD5_STEP (MD5_Go, d, a, b, c, w2_t, MD5C1d, MD5S11);
216   MD5_STEP (MD5_Go, c, d, a, b, w7_t, MD5C1e, MD5S12);
217   MD5_STEP (MD5_Go, b, c, d, a, wc_t, MD5C1f, MD5S13);
218
219   MD5_STEP (MD5_H , a, b, c, d, w5_t, MD5C20, MD5S20);
220   MD5_STEP (MD5_H , d, a, b, c, w8_t, MD5C21, MD5S21);
221   MD5_STEP (MD5_H , c, d, a, b, wb_t, MD5C22, MD5S22);
222   MD5_STEP (MD5_H , b, c, d, a, we_t, MD5C23, MD5S23);
223   MD5_STEP (MD5_H , a, b, c, d, w1_t, MD5C24, MD5S20);
224   MD5_STEP (MD5_H , d, a, b, c, w4_t, MD5C25, MD5S21);
225   MD5_STEP (MD5_H , c, d, a, b, w7_t, MD5C26, MD5S22);
226   MD5_STEP (MD5_H , b, c, d, a, wa_t, MD5C27, MD5S23);
227   MD5_STEP (MD5_H , a, b, c, d, wd_t, MD5C28, MD5S20);
228   MD5_STEP (MD5_H , d, a, b, c, w0_t, MD5C29, MD5S21);
229   MD5_STEP (MD5_H , c, d, a, b, w3_t, MD5C2a, MD5S22);
230   MD5_STEP (MD5_H , b, c, d, a, w6_t, MD5C2b, MD5S23);
231   MD5_STEP (MD5_H , a, b, c, d, w9_t, MD5C2c, MD5S20);
232   MD5_STEP (MD5_H , d, a, b, c, wc_t, MD5C2d, MD5S21);
233   MD5_STEP (MD5_H , c, d, a, b, wf_t, MD5C2e, MD5S22);
234   MD5_STEP (MD5_H , b, c, d, a, w2_t, MD5C2f, MD5S23);
235
236   MD5_STEP (MD5_I , a, b, c, d, w0_t, MD5C30, MD5S30);
237   MD5_STEP (MD5_I , d, a, b, c, w7_t, MD5C31, MD5S31);
238   MD5_STEP (MD5_I , c, d, a, b, we_t, MD5C32, MD5S32);
239   MD5_STEP (MD5_I , b, c, d, a, w5_t, MD5C33, MD5S33);
240   MD5_STEP (MD5_I , a, b, c, d, wc_t, MD5C34, MD5S30);
241   MD5_STEP (MD5_I , d, a, b, c, w3_t, MD5C35, MD5S31);
242   MD5_STEP (MD5_I , c, d, a, b, wa_t, MD5C36, MD5S32);
243   MD5_STEP (MD5_I , b, c, d, a, w1_t, MD5C37, MD5S33);
244   MD5_STEP (MD5_I , a, b, c, d, w8_t, MD5C38, MD5S30);
245   MD5_STEP (MD5_I , d, a, b, c, wf_t, MD5C39, MD5S31);
246   MD5_STEP (MD5_I , c, d, a, b, w6_t, MD5C3a, MD5S32);
247   MD5_STEP (MD5_I , b, c, d, a, wd_t, MD5C3b, MD5S33);
248   MD5_STEP (MD5_I , a, b, c, d, w4_t, MD5C3c, MD5S30);
249   MD5_STEP (MD5_I , d, a, b, c, wb_t, MD5C3d, MD5S31);
250   MD5_STEP (MD5_I , c, d, a, b, w2_t, MD5C3e, MD5S32);
251   MD5_STEP (MD5_I , b, c, d, a, w9_t, MD5C3f, MD5S33);
252
253   digest[0] += a;
254   digest[1] += b;
255   digest[2] += c;
256   digest[3] += d;
257 }
258
259 __kernel void m10500_init (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global pdf14_tmp_t *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 pdf_t *pdf_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)
260 {
261   /**
262    * base
263    */
264
265   const u32 gid = get_global_id (0);
266   //const u32 lid = get_local_id (0);
267
268   if (gid >= gid_max) return;
269
270   u32 w0[4];
271
272   w0[0] = pws[gid].i[ 0];
273   w0[1] = pws[gid].i[ 1];
274   w0[2] = pws[gid].i[ 2];
275   w0[3] = pws[gid].i[ 3];
276
277   u32 w1[4];
278
279   w1[0] = pws[gid].i[ 4];
280   w1[1] = pws[gid].i[ 5];
281   w1[2] = pws[gid].i[ 6];
282   w1[3] = pws[gid].i[ 7];
283
284   u32 w2[4];
285
286   w2[0] = pws[gid].i[ 8];
287   w2[1] = pws[gid].i[ 9];
288   w2[2] = 0;
289   w2[3] = 0;
290
291   const u32 pw_len = pws[gid].pw_len;
292
293   /**
294    * shared
295    */
296
297   //__local RC4_KEY rc4_keys[64];
298   //__local RC4_KEY *rc4_key = &rc4_keys[lid];
299
300   /**
301    * U_buf
302    */
303
304   u32 o_buf[8];
305
306   o_buf[0] = pdf_bufs[salt_pos].o_buf[0];
307   o_buf[1] = pdf_bufs[salt_pos].o_buf[1];
308   o_buf[2] = pdf_bufs[salt_pos].o_buf[2];
309   o_buf[3] = pdf_bufs[salt_pos].o_buf[3];
310   o_buf[4] = pdf_bufs[salt_pos].o_buf[4];
311   o_buf[5] = pdf_bufs[salt_pos].o_buf[5];
312   o_buf[6] = pdf_bufs[salt_pos].o_buf[6];
313   o_buf[7] = pdf_bufs[salt_pos].o_buf[7];
314
315   u32 P = pdf_bufs[salt_pos].P;
316
317   u32 id_buf[12];
318
319   id_buf[ 0] = pdf_bufs[salt_pos].id_buf[0];
320   id_buf[ 1] = pdf_bufs[salt_pos].id_buf[1];
321   id_buf[ 2] = pdf_bufs[salt_pos].id_buf[2];
322   id_buf[ 3] = pdf_bufs[salt_pos].id_buf[3];
323
324   id_buf[ 4] = pdf_bufs[salt_pos].id_buf[4];
325   id_buf[ 5] = pdf_bufs[salt_pos].id_buf[5];
326   id_buf[ 6] = pdf_bufs[salt_pos].id_buf[6];
327   id_buf[ 7] = pdf_bufs[salt_pos].id_buf[7];
328
329   id_buf[ 8] = 0;
330   id_buf[ 9] = 0;
331   id_buf[10] = 0;
332   id_buf[11] = 0;
333
334   u32 id_len  = pdf_bufs[salt_pos].id_len;
335   u32 id_len4 = id_len / 4;
336
337   u32 rc4data[2];
338
339   rc4data[0] = pdf_bufs[salt_pos].rc4data[0];
340   rc4data[1] = pdf_bufs[salt_pos].rc4data[1];
341
342   u32 final_length = 68 + id_len;
343
344   u32 w11 = 0x80;
345   u32 w12 = 0;
346
347   if (pdf_bufs[salt_pos].enc_md != 1)
348   {
349     w11 = 0xffffffff;
350     w12 = 0x80;
351
352     final_length += 4;
353   }
354
355   id_buf[id_len4 + 0] = w11;
356   id_buf[id_len4 + 1] = w12;
357
358   /**
359    * main init
360    */
361
362   u32 w0_t[4];
363   u32 w1_t[4];
364   u32 w2_t[4];
365   u32 w3_t[4];
366
367   // max length supported by pdf11 is 32
368
369   w0_t[0] = padding[0];
370   w0_t[1] = padding[1];
371   w0_t[2] = padding[2];
372   w0_t[3] = padding[3];
373   w1_t[0] = padding[4];
374   w1_t[1] = padding[5];
375   w1_t[2] = padding[6];
376   w1_t[3] = padding[7];
377   w2_t[0] = 0;
378   w2_t[1] = 0;
379   w2_t[2] = 0;
380   w2_t[3] = 0;
381   w3_t[0] = 0;
382   w3_t[1] = 0;
383   w3_t[2] = 0;
384   w3_t[3] = 0;
385
386   switch_buffer_by_offset_le (w0_t, w1_t, w2_t, w3_t, pw_len);
387
388   // add password
389   // truncate at 32 is wanted, not a bug!
390   // add o_buf
391
392   w0_t[0] |= w0[0];
393   w0_t[1] |= w0[1];
394   w0_t[2] |= w0[2];
395   w0_t[3] |= w0[3];
396   w1_t[0] |= w1[0];
397   w1_t[1] |= w1[1];
398   w1_t[2] |= w1[2];
399   w1_t[3] |= w1[3];
400   w2_t[0]  = o_buf[0];
401   w2_t[1]  = o_buf[1];
402   w2_t[2]  = o_buf[2];
403   w2_t[3]  = o_buf[3];
404   w3_t[0]  = o_buf[4];
405   w3_t[1]  = o_buf[5];
406   w3_t[2]  = o_buf[6];
407   w3_t[3]  = o_buf[7];
408
409   u32 digest[4];
410
411   digest[0] = MD5M_A;
412   digest[1] = MD5M_B;
413   digest[2] = MD5M_C;
414   digest[3] = MD5M_D;
415
416   md5_transform (w0_t, w1_t, w2_t, w3_t, digest);
417
418   w0_t[0] = P;
419   w0_t[1] = id_buf[ 0];
420   w0_t[2] = id_buf[ 1];
421   w0_t[3] = id_buf[ 2];
422   w1_t[0] = id_buf[ 3];
423   w1_t[1] = id_buf[ 4];
424   w1_t[2] = id_buf[ 5];
425   w1_t[3] = id_buf[ 6];
426   w2_t[0] = id_buf[ 7];
427   w2_t[1] = id_buf[ 8];
428   w2_t[2] = id_buf[ 9];
429   w2_t[3] = id_buf[10];
430   w3_t[0] = id_buf[11];
431   w3_t[1] = 0;
432   w3_t[2] = final_length * 8;
433   w3_t[3] = 0;
434
435   md5_transform (w0_t, w1_t, w2_t, w3_t, digest);
436
437   tmps[gid].digest[0] = digest[0];
438   tmps[gid].digest[1] = digest[1];
439   tmps[gid].digest[2] = digest[2];
440   tmps[gid].digest[3] = digest[3];
441
442   tmps[gid].out[0] = rc4data[0];
443   tmps[gid].out[1] = rc4data[1];
444   tmps[gid].out[2] = 0;
445   tmps[gid].out[3] = 0;
446 }
447
448 __kernel void m10500_loop (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global pdf14_tmp_t *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 pdf_t *pdf_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)
449 {
450   /**
451    * base
452    */
453
454   const u32 gid = get_global_id (0);
455   const u32 lid = get_local_id (0);
456
457   if (gid >= gid_max) return;
458
459   /**
460    * shared
461    */
462
463   __local RC4_KEY rc4_keys[64];
464
465   __local RC4_KEY *rc4_key = &rc4_keys[lid];
466
467   /**
468    * loop
469    */
470
471   u32 digest[4];
472
473   digest[0] = tmps[gid].digest[0];
474   digest[1] = tmps[gid].digest[1];
475   digest[2] = tmps[gid].digest[2];
476   digest[3] = tmps[gid].digest[3];
477
478   u32 out[4];
479
480   out[0] = tmps[gid].out[0];
481   out[1] = tmps[gid].out[1];
482   out[2] = tmps[gid].out[2];
483   out[3] = tmps[gid].out[3];
484
485   for (u32 i = 0, j = loop_pos; i < loop_cnt; i++, j++)
486   {
487     if (j < 50)
488     {
489       u32 w0_t[4];
490       u32 w1_t[4];
491       u32 w2_t[4];
492       u32 w3_t[4];
493
494       w0_t[0] = digest[0];
495       w0_t[1] = digest[1];
496       w0_t[2] = digest[2];
497       w0_t[3] = digest[3];
498       w1_t[0] = 0x80;
499       w1_t[1] = 0;
500       w1_t[2] = 0;
501       w1_t[3] = 0;
502       w2_t[0] = 0;
503       w2_t[1] = 0;
504       w2_t[2] = 0;
505       w2_t[3] = 0;
506       w3_t[0] = 0;
507       w3_t[1] = 0;
508       w3_t[2] = 16 * 8;
509       w3_t[3] = 0;
510
511       digest[0] = MD5M_A;
512       digest[1] = MD5M_B;
513       digest[2] = MD5M_C;
514       digest[3] = MD5M_D;
515
516       md5_transform (w0_t, w1_t, w2_t, w3_t, digest);
517     }
518     else
519     {
520       const u32 x = j - 50;
521
522       const u32 xv = x <<  0
523                     | x <<  8
524                     | x << 16
525                     | x << 24;
526
527       u32 tmp[4];
528
529       tmp[0] = digest[0] ^ xv;
530       tmp[1] = digest[1] ^ xv;
531       tmp[2] = digest[2] ^ xv;
532       tmp[3] = digest[3] ^ xv;
533
534       rc4_init_16 (rc4_key, tmp);
535
536       rc4_next_16 (rc4_key, 0, 0, out, out);
537     }
538   }
539
540   tmps[gid].digest[0] = digest[0];
541   tmps[gid].digest[1] = digest[1];
542   tmps[gid].digest[2] = digest[2];
543   tmps[gid].digest[3] = digest[3];
544
545   tmps[gid].out[0] = out[0];
546   tmps[gid].out[1] = out[1];
547   tmps[gid].out[2] = out[2];
548   tmps[gid].out[3] = out[3];
549 }
550
551 __kernel void m10500_comp (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global pdf14_tmp_t *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 pdf_t *pdf_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)
552 {
553   /**
554    * modifier
555    */
556
557   const u32 gid = get_global_id (0);
558
559   if (gid >= gid_max) return;
560
561   const u32 lid = get_local_id (0);
562
563   /**
564    * digest
565    */
566
567   const u32 r0 = tmps[gid].out[0];
568   const u32 r1 = tmps[gid].out[1];
569   const u32 r2 = 0;
570   const u32 r3 = 0;
571
572   #define il_pos 0
573
574   #include COMPARE_M
575 }