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