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