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