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