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