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