Fixed two major problems
[hashcat.git] / OpenCL / m02410_a1.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 3
13 #define DGST_R2 2
14 #define DGST_R3 1
15
16 #include "include/kernel_functions.c"
17 #include "OpenCL/types_ocl.c"
18 #include "OpenCL/common.c"
19
20 #define COMPARE_S "OpenCL/check_single_comp4.c"
21 #define COMPARE_M "OpenCL/check_multi_comp4.c"
22
23 __kernel void m02410_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 void *esalt_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)
24 {
25   /**
26    * modifier
27    */
28
29   const u32 lid = get_local_id (0);
30
31   /**
32    * base
33    */
34
35   const u32 gid = get_global_id (0);
36
37   if (gid >= gid_max) return;
38
39   u32 wordl0[4];
40
41   wordl0[0] = pws[gid].i[ 0];
42   wordl0[1] = pws[gid].i[ 1];
43   wordl0[2] = pws[gid].i[ 2];
44   wordl0[3] = pws[gid].i[ 3];
45
46   u32 wordl1[4];
47
48   wordl1[0] = pws[gid].i[ 4];
49   wordl1[1] = pws[gid].i[ 5];
50   wordl1[2] = pws[gid].i[ 6];
51   wordl1[3] = pws[gid].i[ 7];
52
53   u32 wordl2[4];
54
55   wordl2[0] = 0;
56   wordl2[1] = 0;
57   wordl2[2] = 0;
58   wordl2[3] = 0;
59
60   u32 wordl3[4];
61
62   wordl3[0] = 0;
63   wordl3[1] = 0;
64   wordl3[2] = 0;
65   wordl3[3] = 0;
66
67   const u32 pw_l_len = pws[gid].pw_len;
68
69   if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
70   {
71     switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
72   }
73
74   /**
75    * salt
76    */
77
78   u32 salt_buf0[4];
79
80   salt_buf0[0] = salt_bufs[salt_pos].salt_buf[0];
81   salt_buf0[1] = 0;
82   salt_buf0[2] = 0;
83   salt_buf0[3] = 0;
84
85   const u32 salt_len = (salt_bufs[salt_pos].salt_len < 4) ? salt_bufs[salt_pos].salt_len : 4;
86
87   /**
88    * loop
89    */
90
91   for (u32 il_pos = 0; il_pos < il_cnt; il_pos++)
92   {
93     const u32 pw_r_len = combs_buf[il_pos].pw_len;
94
95     const u32 pw_len = pw_l_len + pw_r_len;
96
97     u32 wordr0[4];
98
99     wordr0[0] = combs_buf[il_pos].i[0];
100     wordr0[1] = combs_buf[il_pos].i[1];
101     wordr0[2] = combs_buf[il_pos].i[2];
102     wordr0[3] = combs_buf[il_pos].i[3];
103
104     u32 wordr1[4];
105
106     wordr1[0] = combs_buf[il_pos].i[4];
107     wordr1[1] = combs_buf[il_pos].i[5];
108     wordr1[2] = combs_buf[il_pos].i[6];
109     wordr1[3] = combs_buf[il_pos].i[7];
110
111     u32 wordr2[4];
112
113     wordr2[0] = 0;
114     wordr2[1] = 0;
115     wordr2[2] = 0;
116     wordr2[3] = 0;
117
118     u32 wordr3[4];
119
120     wordr3[0] = 0;
121     wordr3[1] = 0;
122     wordr3[2] = 0;
123     wordr3[3] = 0;
124
125     if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
126     {
127       switch_buffer_by_offset_le (wordr0, wordr1, wordr2, wordr3, pw_l_len);
128     }
129
130     /**
131      * append salt
132      */
133
134     u32 s0[4];
135
136     s0[0] = salt_buf0[0];
137     s0[1] = salt_buf0[1];
138     s0[2] = salt_buf0[2];
139     s0[3] = salt_buf0[3];
140
141     u32 s1[4];
142
143     s1[0] = 0;
144     s1[1] = 0;
145     s1[2] = 0;
146     s1[3] = 0;
147
148     u32 s2[4];
149
150     s2[0] = 0;
151     s2[1] = 0;
152     s2[2] = 0;
153     s2[3] = 0;
154
155     u32 s3[4];
156
157     s3[0] = 0;
158     s3[1] = 0;
159     s3[2] = 0;
160     s3[3] = 0;
161
162     switch_buffer_by_offset_le (s0, s1, s2, s3, pw_len);
163
164     const u32 pw_salt_len = pw_len + salt_len;
165
166     u32 w0[4];
167
168     w0[0] = wordl0[0] | wordr0[0] | s0[0];
169     w0[1] = wordl0[1] | wordr0[1] | s0[1];
170     w0[2] = wordl0[2] | wordr0[2] | s0[2];
171     w0[3] = wordl0[3] | wordr0[3] | s0[3];
172
173     u32 w1[4];
174
175     w1[0] = wordl1[0] | wordr1[0];
176     w1[1] = wordl1[1] | wordr1[1];
177     w1[2] = wordl1[2] | wordr1[2];
178     w1[3] = wordl1[3] | wordr1[3];
179
180     u32 w2[4];
181
182     w2[0] = wordl2[0] | wordr2[0];
183     w2[1] = wordl2[1] | wordr2[1];
184     w2[2] = wordl2[2] | wordr2[2];
185     w2[3] = wordl2[3] | wordr2[3];
186
187     u32 w3[4];
188
189     w3[0] = wordl3[0] | wordr3[0];
190     w3[1] = wordl3[1] | wordr3[1];
191     w3[2] = 0;
192     w3[3] = 0;
193
194     truncate_block (w0, pw_salt_len);
195
196     w1[0] = 0x80;
197     w3[2] = 16 * 8;
198
199     u32 a = MD5M_A;
200     u32 b = MD5M_B;
201     u32 c = MD5M_C;
202     u32 d = MD5M_D;
203
204     MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
205     MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
206     MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
207     MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
208     MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
209     MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
210     MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
211     MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
212     MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
213     MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
214     MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
215     MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
216     MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
217     MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
218     MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
219     MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
220
221     MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
222     MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
223     MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
224     MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
225     MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
226     MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
227     MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
228     MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
229     MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
230     MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
231     MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
232     MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
233     MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
234     MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
235     MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
236     MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
237
238     MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
239     MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
240     MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
241     MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
242     MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
243     MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
244     MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
245     MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
246     MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
247     MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
248     MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
249     MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
250     MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
251     MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
252     MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
253     MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
254
255     MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
256     MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
257     MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
258     MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
259     MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
260     MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
261     MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
262     MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
263     MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
264     MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
265     MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
266     MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
267     MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
268     MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
269     MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
270     MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
271
272     a &= 0x00ffffff;
273     d &= 0x00ffffff;
274     c &= 0x00ffffff;
275     b &= 0x00ffffff;
276
277     const u32 r0 = a;
278     const u32 r1 = d;
279     const u32 r2 = c;
280     const u32 r3 = b;
281
282     #include COMPARE_M
283   }
284 }
285
286 __kernel void m02410_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 void *esalt_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)
287 {
288 }
289
290 __kernel void m02410_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 void *esalt_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)
291 {
292 }
293
294 __kernel void m02410_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 void *esalt_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)
295 {
296   /**
297    * modifier
298    */
299
300   const u32 lid = get_local_id (0);
301
302   /**
303    * base
304    */
305
306   const u32 gid = get_global_id (0);
307
308   if (gid >= gid_max) return;
309
310   u32 wordl0[4];
311
312   wordl0[0] = pws[gid].i[ 0];
313   wordl0[1] = pws[gid].i[ 1];
314   wordl0[2] = pws[gid].i[ 2];
315   wordl0[3] = pws[gid].i[ 3];
316
317   u32 wordl1[4];
318
319   wordl1[0] = pws[gid].i[ 4];
320   wordl1[1] = pws[gid].i[ 5];
321   wordl1[2] = pws[gid].i[ 6];
322   wordl1[3] = pws[gid].i[ 7];
323
324   u32 wordl2[4];
325
326   wordl2[0] = 0;
327   wordl2[1] = 0;
328   wordl2[2] = 0;
329   wordl2[3] = 0;
330
331   u32 wordl3[4];
332
333   wordl3[0] = 0;
334   wordl3[1] = 0;
335   wordl3[2] = 0;
336   wordl3[3] = 0;
337
338   const u32 pw_l_len = pws[gid].pw_len;
339
340   if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
341   {
342     switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
343   }
344
345   /**
346    * salt
347    */
348
349   u32 salt_buf0[4];
350
351   salt_buf0[0] = salt_bufs[salt_pos].salt_buf[0];
352   salt_buf0[1] = 0;
353   salt_buf0[2] = 0;
354   salt_buf0[3] = 0;
355
356   const u32 salt_len = (salt_bufs[salt_pos].salt_len < 4) ? salt_bufs[salt_pos].salt_len : 4;
357
358   /**
359    * digest
360    */
361
362   const u32 search[4] =
363   {
364     digests_buf[digests_offset].digest_buf[DGST_R0],
365     digests_buf[digests_offset].digest_buf[DGST_R1],
366     digests_buf[digests_offset].digest_buf[DGST_R2],
367     digests_buf[digests_offset].digest_buf[DGST_R3]
368   };
369
370   /**
371    * loop
372    */
373
374   for (u32 il_pos = 0; il_pos < il_cnt; il_pos++)
375   {
376     const u32 pw_r_len = combs_buf[il_pos].pw_len;
377
378     const u32 pw_len = pw_l_len + pw_r_len;
379
380     u32 wordr0[4];
381
382     wordr0[0] = combs_buf[il_pos].i[0];
383     wordr0[1] = combs_buf[il_pos].i[1];
384     wordr0[2] = combs_buf[il_pos].i[2];
385     wordr0[3] = combs_buf[il_pos].i[3];
386
387     u32 wordr1[4];
388
389     wordr1[0] = combs_buf[il_pos].i[4];
390     wordr1[1] = combs_buf[il_pos].i[5];
391     wordr1[2] = combs_buf[il_pos].i[6];
392     wordr1[3] = combs_buf[il_pos].i[7];
393
394     u32 wordr2[4];
395
396     wordr2[0] = 0;
397     wordr2[1] = 0;
398     wordr2[2] = 0;
399     wordr2[3] = 0;
400
401     u32 wordr3[4];
402
403     wordr3[0] = 0;
404     wordr3[1] = 0;
405     wordr3[2] = 0;
406     wordr3[3] = 0;
407
408     if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
409     {
410       switch_buffer_by_offset_le (wordr0, wordr1, wordr2, wordr3, pw_l_len);
411     }
412
413     /**
414      * append salt
415      */
416
417     u32 s0[4];
418
419     s0[0] = salt_buf0[0];
420     s0[1] = salt_buf0[1];
421     s0[2] = salt_buf0[2];
422     s0[3] = salt_buf0[3];
423
424     u32 s1[4];
425
426     s1[0] = 0;
427     s1[1] = 0;
428     s1[2] = 0;
429     s1[3] = 0;
430
431     u32 s2[4];
432
433     s2[0] = 0;
434     s2[1] = 0;
435     s2[2] = 0;
436     s2[3] = 0;
437
438     u32 s3[4];
439
440     s3[0] = 0;
441     s3[1] = 0;
442     s3[2] = 0;
443     s3[3] = 0;
444
445     switch_buffer_by_offset_le (s0, s1, s2, s3, pw_len);
446
447     const u32 pw_salt_len = pw_len + salt_len;
448
449     u32 w0[4];
450
451     w0[0] = wordl0[0] | wordr0[0] | s0[0];
452     w0[1] = wordl0[1] | wordr0[1] | s0[1];
453     w0[2] = wordl0[2] | wordr0[2] | s0[2];
454     w0[3] = wordl0[3] | wordr0[3] | s0[3];
455
456     u32 w1[4];
457
458     w1[0] = wordl1[0] | wordr1[0];
459     w1[1] = wordl1[1] | wordr1[1];
460     w1[2] = wordl1[2] | wordr1[2];
461     w1[3] = wordl1[3] | wordr1[3];
462
463     u32 w2[4];
464
465     w2[0] = wordl2[0] | wordr2[0];
466     w2[1] = wordl2[1] | wordr2[1];
467     w2[2] = wordl2[2] | wordr2[2];
468     w2[3] = wordl2[3] | wordr2[3];
469
470     u32 w3[4];
471
472     w3[0] = wordl3[0] | wordr3[0];
473     w3[1] = wordl3[1] | wordr3[1];
474     w3[2] = 0;
475     w3[3] = 0;
476
477     truncate_block (w0, pw_salt_len);
478
479     w1[0] = 0x80;
480     w3[2] = 16 * 8;
481
482     u32 a = MD5M_A;
483     u32 b = MD5M_B;
484     u32 c = MD5M_C;
485     u32 d = MD5M_D;
486
487     MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
488     MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
489     MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
490     MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
491     MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
492     MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
493     MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
494     MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
495     MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
496     MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
497     MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
498     MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
499     MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
500     MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
501     MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
502     MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
503
504     MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
505     MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
506     MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
507     MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
508     MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
509     MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
510     MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
511     MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
512     MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
513     MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
514     MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
515     MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
516     MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
517     MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
518     MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
519     MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
520
521     MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
522     MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
523     MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
524     MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
525     MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
526     MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
527     MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
528     MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
529     MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
530     MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
531     MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
532     MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
533     MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
534     MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
535     MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
536     MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
537
538     MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
539     MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
540     MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
541     MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
542     MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
543     MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
544     MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
545     MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
546     MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
547     MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
548     MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
549     MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
550     MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
551
552     bool q_cond = allx ((a & 0x00ffffff) != search[0]);
553
554     if (q_cond) continue;
555
556     MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
557     MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
558     MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
559
560     a &= 0x00ffffff;
561     d &= 0x00ffffff;
562     c &= 0x00ffffff;
563     b &= 0x00ffffff;
564
565     const u32 r0 = a;
566     const u32 r1 = d;
567     const u32 r2 = c;
568     const u32 r3 = b;
569
570     #include COMPARE_S
571   }
572 }
573
574 __kernel void m02410_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 void *esalt_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)
575 {
576 }
577
578 __kernel void m02410_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 void *esalt_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)
579 {
580 }