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