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