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