Revert "Zero pws_buf before reuse"
[hashcat.git] / OpenCL / m03710_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 "OpenCL/types_ocl.c"
18 #include "OpenCL/common.c"
19
20 #define COMPARE_S "OpenCL/check_single_comp4.c"
21 #define COMPARE_M "OpenCL/check_multi_comp4.c"
22
23 #define uint_to_hex_lower8(i) l_bin2asc[(i)]
24
25 __kernel void m03710_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 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 gid = get_global_id (0);
32   const u32 lid = get_local_id (0);
33   const u32 lsz = get_local_size (0);
34
35   /**
36    * bin2asc table
37    */
38
39   __local u32 l_bin2asc[256];
40
41   for (u32 i = lid; i < 256; i += lsz)
42   {
43     const u32 i0 = (i >> 0) & 15;
44     const u32 i1 = (i >> 4) & 15;
45
46     l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
47                  | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
48   }
49
50   barrier (CLK_LOCAL_MEM_FENCE);
51
52   if (gid >= gid_max) return;
53
54   /**
55    * base
56    */
57
58   u32 wordl0[4];
59
60   wordl0[0] = pws[gid].i[ 0];
61   wordl0[1] = pws[gid].i[ 1];
62   wordl0[2] = pws[gid].i[ 2];
63   wordl0[3] = pws[gid].i[ 3];
64
65   u32 wordl1[4];
66
67   wordl1[0] = pws[gid].i[ 4];
68   wordl1[1] = pws[gid].i[ 5];
69   wordl1[2] = pws[gid].i[ 6];
70   wordl1[3] = pws[gid].i[ 7];
71
72   u32 wordl2[4];
73
74   wordl2[0] = 0;
75   wordl2[1] = 0;
76   wordl2[2] = 0;
77   wordl2[3] = 0;
78
79   u32 wordl3[4];
80
81   wordl3[0] = 0;
82   wordl3[1] = 0;
83   wordl3[2] = 0;
84   wordl3[3] = 0;
85
86   const u32 pw_l_len = pws[gid].pw_len;
87
88   if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
89   {
90     append_0x80_2x4 (wordl0, wordl1, pw_l_len);
91
92     switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
93   }
94
95   /**
96    * salt
97    */
98
99   u32 salt_buf0[4];
100
101   salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
102   salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
103   salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
104   salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
105
106   u32 salt_buf1[4];
107
108   salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
109   salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
110   salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
111   salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
112
113   u32 salt_buf2[4];
114
115   salt_buf2[0] = 0;
116   salt_buf2[1] = 0;
117   salt_buf2[2] = 0;
118   salt_buf2[3] = 0;
119
120   u32 salt_buf3[4];
121
122   salt_buf3[0] = 0;
123   salt_buf3[1] = 0;
124   salt_buf3[2] = 0;
125   salt_buf3[3] = 0;
126
127   const u32 salt_len = salt_bufs[salt_pos].salt_len;
128
129   const u32 pw_salt_len = 32 + salt_len;
130
131   /**
132    * loop
133    */
134
135   for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
136   {
137     const u32 pw_r_len = combs_buf[il_pos].pw_len;
138
139     const u32 pw_len = pw_l_len + pw_r_len;
140
141     u32 wordr0[4];
142
143     wordr0[0] = combs_buf[il_pos].i[0];
144     wordr0[1] = combs_buf[il_pos].i[1];
145     wordr0[2] = combs_buf[il_pos].i[2];
146     wordr0[3] = combs_buf[il_pos].i[3];
147
148     u32 wordr1[4];
149
150     wordr1[0] = combs_buf[il_pos].i[4];
151     wordr1[1] = combs_buf[il_pos].i[5];
152     wordr1[2] = combs_buf[il_pos].i[6];
153     wordr1[3] = combs_buf[il_pos].i[7];
154
155     u32 wordr2[4];
156
157     wordr2[0] = 0;
158     wordr2[1] = 0;
159     wordr2[2] = 0;
160     wordr2[3] = 0;
161
162     u32 wordr3[4];
163
164     wordr3[0] = 0;
165     wordr3[1] = 0;
166     wordr3[2] = 0;
167     wordr3[3] = 0;
168
169     if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
170     {
171       switch_buffer_by_offset_le (wordr0, wordr1, wordr2, wordr3, pw_l_len);
172     }
173
174     u32 w0[4];
175
176     w0[0] = wordl0[0] | wordr0[0];
177     w0[1] = wordl0[1] | wordr0[1];
178     w0[2] = wordl0[2] | wordr0[2];
179     w0[3] = wordl0[3] | wordr0[3];
180
181     u32 w1[4];
182
183     w1[0] = wordl1[0] | wordr1[0];
184     w1[1] = wordl1[1] | wordr1[1];
185     w1[2] = wordl1[2] | wordr1[2];
186     w1[3] = wordl1[3] | wordr1[3];
187
188     u32 w2[4];
189
190     w2[0] = wordl2[0] | wordr2[0];
191     w2[1] = wordl2[1] | wordr2[1];
192     w2[2] = wordl2[2] | wordr2[2];
193     w2[3] = wordl2[3] | wordr2[3];
194
195     u32 w3[4];
196
197     w3[0] = wordl3[0] | wordr3[0];
198     w3[1] = wordl3[1] | wordr3[1];
199     w3[2] = pw_len * 8;
200     w3[3] = 0;
201
202     u32 a = MD5M_A;
203     u32 b = MD5M_B;
204     u32 c = MD5M_C;
205     u32 d = MD5M_D;
206
207     MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
208     MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
209     MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
210     MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
211     MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
212     MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
213     MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
214     MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
215     MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
216     MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
217     MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
218     MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
219     MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
220     MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
221     MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
222     MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
223
224     MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
225     MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
226     MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
227     MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
228     MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
229     MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
230     MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
231     MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
232     MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
233     MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
234     MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
235     MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
236     MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
237     MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
238     MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
239     MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
240
241     MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
242     MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
243     MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
244     MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
245     MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
246     MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
247     MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
248     MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
249     MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
250     MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
251     MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
252     MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
253     MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
254     MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
255     MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
256     MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
257
258     MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
259     MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
260     MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
261     MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
262     MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
263     MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
264     MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
265     MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
266     MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
267     MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
268     MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
269     MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
270     MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
271     MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
272     MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
273     MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
274
275     a += MD5M_A;
276     b += MD5M_B;
277     c += MD5M_C;
278     d += MD5M_D;
279
280     u32 w0_t[4];
281     u32 w1_t[4];
282     u32 w2_t[4];
283     u32 w3_t[4];
284
285     w0_t[0] = uint_to_hex_lower8 ((a >>  0) & 255) <<  0
286             | uint_to_hex_lower8 ((a >>  8) & 255) << 16;
287     w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) <<  0
288             | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
289     w0_t[2] = uint_to_hex_lower8 ((b >>  0) & 255) <<  0
290             | uint_to_hex_lower8 ((b >>  8) & 255) << 16;
291     w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) <<  0
292             | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
293     w1_t[0] = uint_to_hex_lower8 ((c >>  0) & 255) <<  0
294             | uint_to_hex_lower8 ((c >>  8) & 255) << 16;
295     w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) <<  0
296             | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
297     w1_t[2] = uint_to_hex_lower8 ((d >>  0) & 255) <<  0
298             | uint_to_hex_lower8 ((d >>  8) & 255) << 16;
299     w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) <<  0
300             | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
301
302     w2_t[0] = 0x00000080;
303     w2_t[1] = 0;
304     w2_t[2] = 0;
305     w2_t[3] = 0;
306
307     w3_t[0] = 0;
308     w3_t[1] = 0;
309     w3_t[2] = 0;
310     w3_t[3] = 0;
311
312     /**
313      * prepend salt
314      */
315
316     switch_buffer_by_offset_le (w0_t, w1_t, w2_t, w3_t, salt_len);
317
318     w3_t[2] = pw_salt_len * 8;
319
320     w0_t[0] |= salt_buf0[0];
321     w0_t[1] |= salt_buf0[1];
322     w0_t[2] |= salt_buf0[2];
323     w0_t[3] |= salt_buf0[3];
324     w1_t[0] |= salt_buf1[0];
325     w1_t[1] |= salt_buf1[1];
326     w1_t[2] |= salt_buf1[2];
327     w1_t[3] |= salt_buf1[3];
328     w2_t[0] |= salt_buf2[0];
329     w2_t[1] |= salt_buf2[1];
330     w2_t[2] |= salt_buf2[2];
331     w2_t[3] |= salt_buf2[3];
332     w3_t[0] |= salt_buf3[0];
333     w3_t[1] |= salt_buf3[1];
334     w3_t[2] |= salt_buf3[2];
335     w3_t[3] |= salt_buf3[3];
336
337     /**
338      * md5
339      */
340
341     a = MD5M_A;
342     b = MD5M_B;
343     c = MD5M_C;
344     d = MD5M_D;
345
346     MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
347     MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
348     MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
349     MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
350     MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
351     MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
352     MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
353     MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
354     MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
355     MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
356     MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
357     MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
358     MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
359     MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
360     MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
361     MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
362
363     MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
364     MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
365     MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
366     MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
367     MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
368     MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
369     MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
370     MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
371     MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
372     MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
373     MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
374     MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
375     MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
376     MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
377     MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
378     MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
379
380     MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
381     MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
382     MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
383     MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
384     MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
385     MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
386     MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
387     MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
388     MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
389     MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
390     MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
391     MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
392     MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
393     MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
394     MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
395     MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
396
397     MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
398     MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
399     MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
400     MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
401     MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
402     MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
403     MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
404     MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
405     MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
406     MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
407     MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
408     MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
409     MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
410     MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
411     MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
412     MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
413
414     const u32 r0 = a;
415     const u32 r1 = d;
416     const u32 r2 = c;
417     const u32 r3 = b;
418
419     #include COMPARE_M
420   }
421 }
422
423 __kernel void m03710_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 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
424 {
425 }
426
427 __kernel void m03710_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 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
428 {
429 }
430
431 __kernel void m03710_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 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
432 {
433   /**
434    * modifier
435    */
436
437   const u32 gid = get_global_id (0);
438   const u32 lid = get_local_id (0);
439   const u32 lsz = get_local_size (0);
440
441   /**
442    * bin2asc table
443    */
444
445   __local u32 l_bin2asc[256];
446
447   for (u32 i = lid; i < 256; i += lsz)
448   {
449     const u32 i0 = (i >> 0) & 15;
450     const u32 i1 = (i >> 4) & 15;
451
452     l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
453                  | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
454   }
455
456   barrier (CLK_LOCAL_MEM_FENCE);
457
458   if (gid >= gid_max) return;
459
460   /**
461    * base
462    */
463
464   u32 wordl0[4];
465
466   wordl0[0] = pws[gid].i[ 0];
467   wordl0[1] = pws[gid].i[ 1];
468   wordl0[2] = pws[gid].i[ 2];
469   wordl0[3] = pws[gid].i[ 3];
470
471   u32 wordl1[4];
472
473   wordl1[0] = pws[gid].i[ 4];
474   wordl1[1] = pws[gid].i[ 5];
475   wordl1[2] = pws[gid].i[ 6];
476   wordl1[3] = pws[gid].i[ 7];
477
478   u32 wordl2[4];
479
480   wordl2[0] = 0;
481   wordl2[1] = 0;
482   wordl2[2] = 0;
483   wordl2[3] = 0;
484
485   u32 wordl3[4];
486
487   wordl3[0] = 0;
488   wordl3[1] = 0;
489   wordl3[2] = 0;
490   wordl3[3] = 0;
491
492   const u32 pw_l_len = pws[gid].pw_len;
493
494   if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
495   {
496     append_0x80_2x4 (wordl0, wordl1, pw_l_len);
497
498     switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
499   }
500
501   /**
502    * salt
503    */
504
505   u32 salt_buf0[4];
506
507   salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
508   salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
509   salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
510   salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
511
512   u32 salt_buf1[4];
513
514   salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
515   salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
516   salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
517   salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
518
519   u32 salt_buf2[4];
520
521   salt_buf2[0] = 0;
522   salt_buf2[1] = 0;
523   salt_buf2[2] = 0;
524   salt_buf2[3] = 0;
525
526   u32 salt_buf3[4];
527
528   salt_buf3[0] = 0;
529   salt_buf3[1] = 0;
530   salt_buf3[2] = 0;
531   salt_buf3[3] = 0;
532
533   const u32 salt_len = salt_bufs[salt_pos].salt_len;
534
535   const u32 pw_salt_len = 32 + salt_len;
536
537   /**
538    * digest
539    */
540
541   const u32 search[4] =
542   {
543     digests_buf[digests_offset].digest_buf[DGST_R0],
544     digests_buf[digests_offset].digest_buf[DGST_R1],
545     digests_buf[digests_offset].digest_buf[DGST_R2],
546     digests_buf[digests_offset].digest_buf[DGST_R3]
547   };
548
549   /**
550    * loop
551    */
552
553   for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
554   {
555     const u32 pw_r_len = combs_buf[il_pos].pw_len;
556
557     const u32 pw_len = pw_l_len + pw_r_len;
558
559     u32 wordr0[4];
560
561     wordr0[0] = combs_buf[il_pos].i[0];
562     wordr0[1] = combs_buf[il_pos].i[1];
563     wordr0[2] = combs_buf[il_pos].i[2];
564     wordr0[3] = combs_buf[il_pos].i[3];
565
566     u32 wordr1[4];
567
568     wordr1[0] = combs_buf[il_pos].i[4];
569     wordr1[1] = combs_buf[il_pos].i[5];
570     wordr1[2] = combs_buf[il_pos].i[6];
571     wordr1[3] = combs_buf[il_pos].i[7];
572
573     u32 wordr2[4];
574
575     wordr2[0] = 0;
576     wordr2[1] = 0;
577     wordr2[2] = 0;
578     wordr2[3] = 0;
579
580     u32 wordr3[4];
581
582     wordr3[0] = 0;
583     wordr3[1] = 0;
584     wordr3[2] = 0;
585     wordr3[3] = 0;
586
587     if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
588     {
589       switch_buffer_by_offset_le (wordr0, wordr1, wordr2, wordr3, pw_l_len);
590     }
591
592     u32 w0[4];
593
594     w0[0] = wordl0[0] | wordr0[0];
595     w0[1] = wordl0[1] | wordr0[1];
596     w0[2] = wordl0[2] | wordr0[2];
597     w0[3] = wordl0[3] | wordr0[3];
598
599     u32 w1[4];
600
601     w1[0] = wordl1[0] | wordr1[0];
602     w1[1] = wordl1[1] | wordr1[1];
603     w1[2] = wordl1[2] | wordr1[2];
604     w1[3] = wordl1[3] | wordr1[3];
605
606     u32 w2[4];
607
608     w2[0] = wordl2[0] | wordr2[0];
609     w2[1] = wordl2[1] | wordr2[1];
610     w2[2] = wordl2[2] | wordr2[2];
611     w2[3] = wordl2[3] | wordr2[3];
612
613     u32 w3[4];
614
615     w3[0] = wordl3[0] | wordr3[0];
616     w3[1] = wordl3[1] | wordr3[1];
617     w3[2] = pw_len * 8;
618     w3[3] = 0;
619
620     u32 a = MD5M_A;
621     u32 b = MD5M_B;
622     u32 c = MD5M_C;
623     u32 d = MD5M_D;
624
625     MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
626     MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
627     MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
628     MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
629     MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
630     MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
631     MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
632     MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
633     MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
634     MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
635     MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
636     MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
637     MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
638     MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
639     MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
640     MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
641
642     MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
643     MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
644     MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
645     MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
646     MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
647     MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
648     MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
649     MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
650     MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
651     MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
652     MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
653     MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
654     MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
655     MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
656     MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
657     MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
658
659     MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
660     MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
661     MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
662     MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
663     MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
664     MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
665     MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
666     MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
667     MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
668     MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
669     MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
670     MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
671     MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
672     MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
673     MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
674     MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
675
676     MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
677     MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
678     MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
679     MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
680     MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
681     MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
682     MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
683     MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
684     MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
685     MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
686     MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
687     MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
688     MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
689     MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
690     MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
691     MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
692
693     a += MD5M_A;
694     b += MD5M_B;
695     c += MD5M_C;
696     d += MD5M_D;
697
698     u32 w0_t[4];
699     u32 w1_t[4];
700     u32 w2_t[4];
701     u32 w3_t[4];
702
703     w0_t[0] = uint_to_hex_lower8 ((a >>  0) & 255) <<  0
704             | uint_to_hex_lower8 ((a >>  8) & 255) << 16;
705     w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) <<  0
706             | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
707     w0_t[2] = uint_to_hex_lower8 ((b >>  0) & 255) <<  0
708             | uint_to_hex_lower8 ((b >>  8) & 255) << 16;
709     w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) <<  0
710             | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
711     w1_t[0] = uint_to_hex_lower8 ((c >>  0) & 255) <<  0
712             | uint_to_hex_lower8 ((c >>  8) & 255) << 16;
713     w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) <<  0
714             | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
715     w1_t[2] = uint_to_hex_lower8 ((d >>  0) & 255) <<  0
716             | uint_to_hex_lower8 ((d >>  8) & 255) << 16;
717     w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) <<  0
718             | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
719
720     w2_t[0] = 0x00000080;
721     w2_t[1] = 0;
722     w2_t[2] = 0;
723     w2_t[3] = 0;
724
725     w3_t[0] = 0;
726     w3_t[1] = 0;
727     w3_t[2] = 0;
728     w3_t[3] = 0;
729
730     /**
731      * prepend salt
732      */
733
734     switch_buffer_by_offset_le (w0_t, w1_t, w2_t, w3_t, salt_len);
735
736     w3_t[2] = pw_salt_len * 8;
737
738     w0_t[0] |= salt_buf0[0];
739     w0_t[1] |= salt_buf0[1];
740     w0_t[2] |= salt_buf0[2];
741     w0_t[3] |= salt_buf0[3];
742     w1_t[0] |= salt_buf1[0];
743     w1_t[1] |= salt_buf1[1];
744     w1_t[2] |= salt_buf1[2];
745     w1_t[3] |= salt_buf1[3];
746     w2_t[0] |= salt_buf2[0];
747     w2_t[1] |= salt_buf2[1];
748     w2_t[2] |= salt_buf2[2];
749     w2_t[3] |= salt_buf2[3];
750     w3_t[0] |= salt_buf3[0];
751     w3_t[1] |= salt_buf3[1];
752     w3_t[2] |= salt_buf3[2];
753     w3_t[3] |= salt_buf3[3];
754
755     /**
756      * md5
757      */
758
759     a = MD5M_A;
760     b = MD5M_B;
761     c = MD5M_C;
762     d = MD5M_D;
763
764     MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
765     MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
766     MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
767     MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
768     MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
769     MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
770     MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
771     MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
772     MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
773     MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
774     MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
775     MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
776     MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
777     MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
778     MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
779     MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
780
781     MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
782     MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
783     MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
784     MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
785     MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
786     MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
787     MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
788     MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
789     MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
790     MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
791     MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
792     MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
793     MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
794     MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
795     MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
796     MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
797
798     MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
799     MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
800     MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
801     MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
802     MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
803     MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
804     MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
805     MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
806     MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
807     MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
808     MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
809     MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
810     MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
811     MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
812     MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
813     MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
814
815     MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
816     MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
817     MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
818     MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
819     MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
820     MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
821     MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
822     MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
823     MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
824     MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
825     MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
826     MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
827     MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
828     MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
829     MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
830     MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
831
832     const u32 r0 = a;
833     const u32 r1 = d;
834     const u32 r2 = c;
835     const u32 r3 = b;
836
837     #include COMPARE_S
838   }
839 }
840
841 __kernel void m03710_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 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
842 {
843 }
844
845 __kernel void m03710_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 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
846 {
847 }