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