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