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