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