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