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