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