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