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