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