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