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