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