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