Fix m 60 a 0 by making modified variable non-const
[hashcat.git] / OpenCL / m05100_a3.cl
1 /**
2  * Author......: Jens Steube <jens.steube@gmail.com>
3  * License.....: MIT
4  */
5
6 #define _MD5H_
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 m05100m (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    * loop
28    */
29
30   const u32 w0l = w0[0];
31
32   for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
33   {
34     const u32x w0r = ix_create_bft (bfs_buf, il_pos);
35
36     const u32x w0lr = w0l | w0r;
37
38     u32x t0[4];
39     u32x t1[4];
40     u32x t2[4];
41     u32x t3[4];
42
43     t0[0] = w0lr;
44     t0[1] = w0[1];
45     t0[2] = w0[2];
46     t0[3] = w0[3];
47     t1[0] = w1[0];
48     t1[1] = w1[1];
49     t1[2] = w1[2];
50     t1[3] = w1[3];
51     t2[0] = w2[0];
52     t2[1] = w2[1];
53     t2[2] = w2[2];
54     t2[3] = w2[3];
55     t3[0] = w3[0];
56     t3[1] = w3[1];
57     t3[2] = pw_len * 8;
58     t3[3] = 0;
59
60     /**
61      * md5
62      */
63
64     u32x a = MD5M_A;
65     u32x b = MD5M_B;
66     u32x c = MD5M_C;
67     u32x d = MD5M_D;
68
69     MD5_STEP (MD5_Fo, a, b, c, d, t0[0], MD5C00, MD5S00);
70     MD5_STEP (MD5_Fo, d, a, b, c, t0[1], MD5C01, MD5S01);
71     MD5_STEP (MD5_Fo, c, d, a, b, t0[2], MD5C02, MD5S02);
72     MD5_STEP (MD5_Fo, b, c, d, a, t0[3], MD5C03, MD5S03);
73     MD5_STEP (MD5_Fo, a, b, c, d, t1[0], MD5C04, MD5S00);
74     MD5_STEP (MD5_Fo, d, a, b, c, t1[1], MD5C05, MD5S01);
75     MD5_STEP (MD5_Fo, c, d, a, b, t1[2], MD5C06, MD5S02);
76     MD5_STEP (MD5_Fo, b, c, d, a, t1[3], MD5C07, MD5S03);
77     MD5_STEP (MD5_Fo, a, b, c, d, t2[0], MD5C08, MD5S00);
78     MD5_STEP (MD5_Fo, d, a, b, c, t2[1], MD5C09, MD5S01);
79     MD5_STEP (MD5_Fo, c, d, a, b, t2[2], MD5C0a, MD5S02);
80     MD5_STEP (MD5_Fo, b, c, d, a, t2[3], MD5C0b, MD5S03);
81     MD5_STEP (MD5_Fo, a, b, c, d, t3[0], MD5C0c, MD5S00);
82     MD5_STEP (MD5_Fo, d, a, b, c, t3[1], MD5C0d, MD5S01);
83     MD5_STEP (MD5_Fo, c, d, a, b, t3[2], MD5C0e, MD5S02);
84     MD5_STEP (MD5_Fo, b, c, d, a, t3[3], MD5C0f, MD5S03);
85
86     MD5_STEP (MD5_Go, a, b, c, d, t0[1], MD5C10, MD5S10);
87     MD5_STEP (MD5_Go, d, a, b, c, t1[2], MD5C11, MD5S11);
88     MD5_STEP (MD5_Go, c, d, a, b, t2[3], MD5C12, MD5S12);
89     MD5_STEP (MD5_Go, b, c, d, a, t0[0], MD5C13, MD5S13);
90     MD5_STEP (MD5_Go, a, b, c, d, t1[1], MD5C14, MD5S10);
91     MD5_STEP (MD5_Go, d, a, b, c, t2[2], MD5C15, MD5S11);
92     MD5_STEP (MD5_Go, c, d, a, b, t3[3], MD5C16, MD5S12);
93     MD5_STEP (MD5_Go, b, c, d, a, t1[0], MD5C17, MD5S13);
94     MD5_STEP (MD5_Go, a, b, c, d, t2[1], MD5C18, MD5S10);
95     MD5_STEP (MD5_Go, d, a, b, c, t3[2], MD5C19, MD5S11);
96     MD5_STEP (MD5_Go, c, d, a, b, t0[3], MD5C1a, MD5S12);
97     MD5_STEP (MD5_Go, b, c, d, a, t2[0], MD5C1b, MD5S13);
98     MD5_STEP (MD5_Go, a, b, c, d, t3[1], MD5C1c, MD5S10);
99     MD5_STEP (MD5_Go, d, a, b, c, t0[2], MD5C1d, MD5S11);
100     MD5_STEP (MD5_Go, c, d, a, b, t1[3], MD5C1e, MD5S12);
101     MD5_STEP (MD5_Go, b, c, d, a, t3[0], MD5C1f, MD5S13);
102
103     MD5_STEP (MD5_H , a, b, c, d, t1[1], MD5C20, MD5S20);
104     MD5_STEP (MD5_H , d, a, b, c, t2[0], MD5C21, MD5S21);
105     MD5_STEP (MD5_H , c, d, a, b, t2[3], MD5C22, MD5S22);
106     MD5_STEP (MD5_H , b, c, d, a, t3[2], MD5C23, MD5S23);
107     MD5_STEP (MD5_H , a, b, c, d, t0[1], MD5C24, MD5S20);
108     MD5_STEP (MD5_H , d, a, b, c, t1[0], MD5C25, MD5S21);
109     MD5_STEP (MD5_H , c, d, a, b, t1[3], MD5C26, MD5S22);
110     MD5_STEP (MD5_H , b, c, d, a, t2[2], MD5C27, MD5S23);
111     MD5_STEP (MD5_H , a, b, c, d, t3[1], MD5C28, MD5S20);
112     MD5_STEP (MD5_H , d, a, b, c, t0[0], MD5C29, MD5S21);
113     MD5_STEP (MD5_H , c, d, a, b, t0[3], MD5C2a, MD5S22);
114     MD5_STEP (MD5_H , b, c, d, a, t1[2], MD5C2b, MD5S23);
115     MD5_STEP (MD5_H , a, b, c, d, t2[1], MD5C2c, MD5S20);
116     MD5_STEP (MD5_H , d, a, b, c, t3[0], MD5C2d, MD5S21);
117     MD5_STEP (MD5_H , c, d, a, b, t3[3], MD5C2e, MD5S22);
118     MD5_STEP (MD5_H , b, c, d, a, t0[2], MD5C2f, MD5S23);
119
120     MD5_STEP (MD5_I , a, b, c, d, t0[0], MD5C30, MD5S30);
121     MD5_STEP (MD5_I , d, a, b, c, t1[3], MD5C31, MD5S31);
122     MD5_STEP (MD5_I , c, d, a, b, t3[2], MD5C32, MD5S32);
123     MD5_STEP (MD5_I , b, c, d, a, t1[1], MD5C33, MD5S33);
124     MD5_STEP (MD5_I , a, b, c, d, t3[0], MD5C34, MD5S30);
125     MD5_STEP (MD5_I , d, a, b, c, t0[3], MD5C35, MD5S31);
126     MD5_STEP (MD5_I , c, d, a, b, t2[2], MD5C36, MD5S32);
127     MD5_STEP (MD5_I , b, c, d, a, t0[1], MD5C37, MD5S33);
128     MD5_STEP (MD5_I , a, b, c, d, t2[0], MD5C38, MD5S30);
129     MD5_STEP (MD5_I , d, a, b, c, t3[3], MD5C39, MD5S31);
130     MD5_STEP (MD5_I , c, d, a, b, t1[2], MD5C3a, MD5S32);
131     MD5_STEP (MD5_I , b, c, d, a, t3[1], MD5C3b, MD5S33);
132     MD5_STEP (MD5_I , a, b, c, d, t1[0], MD5C3c, MD5S30);
133     MD5_STEP (MD5_I , d, a, b, c, t2[3], MD5C3d, MD5S31);
134     MD5_STEP (MD5_I , c, d, a, b, t0[2], MD5C3e, MD5S32);
135     MD5_STEP (MD5_I , b, c, d, a, t2[1], MD5C3f, MD5S33);
136
137     a += MD5M_A;
138     b += MD5M_B;
139     c += MD5M_C;
140     d += MD5M_D;
141
142     u32x z = 0;
143
144     COMPARE_M_SIMD (a, b, z, z);
145     COMPARE_M_SIMD (b, c, z, z);
146     COMPARE_M_SIMD (c, d, z, z);
147   }
148 }
149
150 void m05100s (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)
151 {
152   /**
153    * modifier
154    */
155
156   const u32 gid = get_global_id (0);
157   const u32 lid = get_local_id (0);
158
159   /**
160    * digest
161    */
162
163   const u32 search[4] =
164   {
165     digests_buf[digests_offset].digest_buf[DGST_R0],
166     digests_buf[digests_offset].digest_buf[DGST_R1],
167     0,
168     0
169   };
170
171   /**
172    * loop
173    */
174
175   const u32 w0l = w0[0];
176
177   for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
178   {
179     const u32x w0r = ix_create_bft (bfs_buf, il_pos);
180
181     const u32x w0lr = w0l | w0r;
182
183     u32x t0[4];
184     u32x t1[4];
185     u32x t2[4];
186     u32x t3[4];
187
188     t0[0] = w0lr;
189     t0[1] = w0[1];
190     t0[2] = w0[2];
191     t0[3] = w0[3];
192     t1[0] = w1[0];
193     t1[1] = w1[1];
194     t1[2] = w1[2];
195     t1[3] = w1[3];
196     t2[0] = w2[0];
197     t2[1] = w2[1];
198     t2[2] = w2[2];
199     t2[3] = w2[3];
200     t3[0] = w3[0];
201     t3[1] = w3[1];
202     t3[2] = pw_len * 8;
203     t3[3] = 0;
204
205     /**
206      * md5
207      */
208
209     u32x a = MD5M_A;
210     u32x b = MD5M_B;
211     u32x c = MD5M_C;
212     u32x d = MD5M_D;
213
214     MD5_STEP (MD5_Fo, a, b, c, d, t0[0], MD5C00, MD5S00);
215     MD5_STEP (MD5_Fo, d, a, b, c, t0[1], MD5C01, MD5S01);
216     MD5_STEP (MD5_Fo, c, d, a, b, t0[2], MD5C02, MD5S02);
217     MD5_STEP (MD5_Fo, b, c, d, a, t0[3], MD5C03, MD5S03);
218     MD5_STEP (MD5_Fo, a, b, c, d, t1[0], MD5C04, MD5S00);
219     MD5_STEP (MD5_Fo, d, a, b, c, t1[1], MD5C05, MD5S01);
220     MD5_STEP (MD5_Fo, c, d, a, b, t1[2], MD5C06, MD5S02);
221     MD5_STEP (MD5_Fo, b, c, d, a, t1[3], MD5C07, MD5S03);
222     MD5_STEP (MD5_Fo, a, b, c, d, t2[0], MD5C08, MD5S00);
223     MD5_STEP (MD5_Fo, d, a, b, c, t2[1], MD5C09, MD5S01);
224     MD5_STEP (MD5_Fo, c, d, a, b, t2[2], MD5C0a, MD5S02);
225     MD5_STEP (MD5_Fo, b, c, d, a, t2[3], MD5C0b, MD5S03);
226     MD5_STEP (MD5_Fo, a, b, c, d, t3[0], MD5C0c, MD5S00);
227     MD5_STEP (MD5_Fo, d, a, b, c, t3[1], MD5C0d, MD5S01);
228     MD5_STEP (MD5_Fo, c, d, a, b, t3[2], MD5C0e, MD5S02);
229     MD5_STEP (MD5_Fo, b, c, d, a, t3[3], MD5C0f, MD5S03);
230
231     MD5_STEP (MD5_Go, a, b, c, d, t0[1], MD5C10, MD5S10);
232     MD5_STEP (MD5_Go, d, a, b, c, t1[2], MD5C11, MD5S11);
233     MD5_STEP (MD5_Go, c, d, a, b, t2[3], MD5C12, MD5S12);
234     MD5_STEP (MD5_Go, b, c, d, a, t0[0], MD5C13, MD5S13);
235     MD5_STEP (MD5_Go, a, b, c, d, t1[1], MD5C14, MD5S10);
236     MD5_STEP (MD5_Go, d, a, b, c, t2[2], MD5C15, MD5S11);
237     MD5_STEP (MD5_Go, c, d, a, b, t3[3], MD5C16, MD5S12);
238     MD5_STEP (MD5_Go, b, c, d, a, t1[0], MD5C17, MD5S13);
239     MD5_STEP (MD5_Go, a, b, c, d, t2[1], MD5C18, MD5S10);
240     MD5_STEP (MD5_Go, d, a, b, c, t3[2], MD5C19, MD5S11);
241     MD5_STEP (MD5_Go, c, d, a, b, t0[3], MD5C1a, MD5S12);
242     MD5_STEP (MD5_Go, b, c, d, a, t2[0], MD5C1b, MD5S13);
243     MD5_STEP (MD5_Go, a, b, c, d, t3[1], MD5C1c, MD5S10);
244     MD5_STEP (MD5_Go, d, a, b, c, t0[2], MD5C1d, MD5S11);
245     MD5_STEP (MD5_Go, c, d, a, b, t1[3], MD5C1e, MD5S12);
246     MD5_STEP (MD5_Go, b, c, d, a, t3[0], MD5C1f, MD5S13);
247
248     MD5_STEP (MD5_H , a, b, c, d, t1[1], MD5C20, MD5S20);
249     MD5_STEP (MD5_H , d, a, b, c, t2[0], MD5C21, MD5S21);
250     MD5_STEP (MD5_H , c, d, a, b, t2[3], MD5C22, MD5S22);
251     MD5_STEP (MD5_H , b, c, d, a, t3[2], MD5C23, MD5S23);
252     MD5_STEP (MD5_H , a, b, c, d, t0[1], MD5C24, MD5S20);
253     MD5_STEP (MD5_H , d, a, b, c, t1[0], MD5C25, MD5S21);
254     MD5_STEP (MD5_H , c, d, a, b, t1[3], MD5C26, MD5S22);
255     MD5_STEP (MD5_H , b, c, d, a, t2[2], MD5C27, MD5S23);
256     MD5_STEP (MD5_H , a, b, c, d, t3[1], MD5C28, MD5S20);
257     MD5_STEP (MD5_H , d, a, b, c, t0[0], MD5C29, MD5S21);
258     MD5_STEP (MD5_H , c, d, a, b, t0[3], MD5C2a, MD5S22);
259     MD5_STEP (MD5_H , b, c, d, a, t1[2], MD5C2b, MD5S23);
260     MD5_STEP (MD5_H , a, b, c, d, t2[1], MD5C2c, MD5S20);
261     MD5_STEP (MD5_H , d, a, b, c, t3[0], MD5C2d, MD5S21);
262     MD5_STEP (MD5_H , c, d, a, b, t3[3], MD5C2e, MD5S22);
263     MD5_STEP (MD5_H , b, c, d, a, t0[2], MD5C2f, MD5S23);
264
265     MD5_STEP (MD5_I , a, b, c, d, t0[0], MD5C30, MD5S30);
266     MD5_STEP (MD5_I , d, a, b, c, t1[3], MD5C31, MD5S31);
267     MD5_STEP (MD5_I , c, d, a, b, t3[2], MD5C32, MD5S32);
268     MD5_STEP (MD5_I , b, c, d, a, t1[1], MD5C33, MD5S33);
269     MD5_STEP (MD5_I , a, b, c, d, t3[0], MD5C34, MD5S30);
270     MD5_STEP (MD5_I , d, a, b, c, t0[3], MD5C35, MD5S31);
271     MD5_STEP (MD5_I , c, d, a, b, t2[2], MD5C36, MD5S32);
272     MD5_STEP (MD5_I , b, c, d, a, t0[1], MD5C37, MD5S33);
273     MD5_STEP (MD5_I , a, b, c, d, t2[0], MD5C38, MD5S30);
274     MD5_STEP (MD5_I , d, a, b, c, t3[3], MD5C39, MD5S31);
275     MD5_STEP (MD5_I , c, d, a, b, t1[2], MD5C3a, MD5S32);
276     MD5_STEP (MD5_I , b, c, d, a, t3[1], MD5C3b, MD5S33);
277     MD5_STEP (MD5_I , a, b, c, d, t1[0], MD5C3c, MD5S30);
278     MD5_STEP (MD5_I , d, a, b, c, t2[3], MD5C3d, MD5S31);
279     MD5_STEP (MD5_I , c, d, a, b, t0[2], MD5C3e, MD5S32);
280     MD5_STEP (MD5_I , b, c, d, a, t2[1], MD5C3f, MD5S33);
281
282     a += MD5M_A;
283     b += MD5M_B;
284     c += MD5M_C;
285     d += MD5M_D;
286
287     u32x z = 0;
288
289     COMPARE_S_SIMD (a, b, z, z);
290     COMPARE_S_SIMD (b, c, z, z);
291     COMPARE_S_SIMD (c, d, z, z);
292   }
293 }
294
295 __kernel void m05100_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)
296 {
297   /**
298    * base
299    */
300
301   const u32 gid = get_global_id (0);
302
303   if (gid >= gid_max) return;
304
305   u32 w0[4];
306
307   w0[0] = pws[gid].i[ 0];
308   w0[1] = pws[gid].i[ 1];
309   w0[2] = pws[gid].i[ 2];
310   w0[3] = pws[gid].i[ 3];
311
312   u32 w1[4];
313
314   w1[0] = 0;
315   w1[1] = 0;
316   w1[2] = 0;
317   w1[3] = 0;
318
319   u32 w2[4];
320
321   w2[0] = 0;
322   w2[1] = 0;
323   w2[2] = 0;
324   w2[3] = 0;
325
326   u32 w3[4];
327
328   w3[0] = 0;
329   w3[1] = 0;
330   w3[2] = 0;
331   w3[3] = 0;
332
333   const u32 pw_len = pws[gid].pw_len;
334
335   /**
336    * main
337    */
338
339   m05100m (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);
340 }
341
342 __kernel void m05100_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)
343 {
344   /**
345    * base
346    */
347
348   const u32 gid = get_global_id (0);
349
350   if (gid >= gid_max) return;
351
352   u32 w0[4];
353
354   w0[0] = pws[gid].i[ 0];
355   w0[1] = pws[gid].i[ 1];
356   w0[2] = pws[gid].i[ 2];
357   w0[3] = pws[gid].i[ 3];
358
359   u32 w1[4];
360
361   w1[0] = pws[gid].i[ 4];
362   w1[1] = pws[gid].i[ 5];
363   w1[2] = pws[gid].i[ 6];
364   w1[3] = pws[gid].i[ 7];
365
366   u32 w2[4];
367
368   w2[0] = 0;
369   w2[1] = 0;
370   w2[2] = 0;
371   w2[3] = 0;
372
373   u32 w3[4];
374
375   w3[0] = 0;
376   w3[1] = 0;
377   w3[2] = 0;
378   w3[3] = 0;
379
380   const u32 pw_len = pws[gid].pw_len;
381
382   /**
383    * main
384    */
385
386   m05100m (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);
387 }
388
389 __kernel void m05100_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)
390 {
391   /**
392    * base
393    */
394
395   const u32 gid = get_global_id (0);
396
397   if (gid >= gid_max) return;
398
399   u32 w0[4];
400
401   w0[0] = pws[gid].i[ 0];
402   w0[1] = pws[gid].i[ 1];
403   w0[2] = pws[gid].i[ 2];
404   w0[3] = pws[gid].i[ 3];
405
406   u32 w1[4];
407
408   w1[0] = pws[gid].i[ 4];
409   w1[1] = pws[gid].i[ 5];
410   w1[2] = pws[gid].i[ 6];
411   w1[3] = pws[gid].i[ 7];
412
413   u32 w2[4];
414
415   w2[0] = pws[gid].i[ 8];
416   w2[1] = pws[gid].i[ 9];
417   w2[2] = pws[gid].i[10];
418   w2[3] = pws[gid].i[11];
419
420   u32 w3[4];
421
422   w3[0] = pws[gid].i[12];
423   w3[1] = pws[gid].i[13];
424   w3[2] = 0;
425   w3[3] = 0;
426
427   const u32 pw_len = pws[gid].pw_len;
428
429   /**
430    * main
431    */
432
433   m05100m (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);
434 }
435
436 __kernel void m05100_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)
437 {
438   /**
439    * base
440    */
441
442   const u32 gid = get_global_id (0);
443
444   if (gid >= gid_max) return;
445
446   u32 w0[4];
447
448   w0[0] = pws[gid].i[ 0];
449   w0[1] = pws[gid].i[ 1];
450   w0[2] = pws[gid].i[ 2];
451   w0[3] = pws[gid].i[ 3];
452
453   u32 w1[4];
454
455   w1[0] = 0;
456   w1[1] = 0;
457   w1[2] = 0;
458   w1[3] = 0;
459
460   u32 w2[4];
461
462   w2[0] = 0;
463   w2[1] = 0;
464   w2[2] = 0;
465   w2[3] = 0;
466
467   u32 w3[4];
468
469   w3[0] = 0;
470   w3[1] = 0;
471   w3[2] = 0;
472   w3[3] = 0;
473
474   const u32 pw_len = pws[gid].pw_len;
475
476   /**
477    * main
478    */
479
480   m05100s (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);
481 }
482
483 __kernel void m05100_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)
484 {
485   /**
486    * base
487    */
488
489   const u32 gid = get_global_id (0);
490
491   if (gid >= gid_max) return;
492
493   u32 w0[4];
494
495   w0[0] = pws[gid].i[ 0];
496   w0[1] = pws[gid].i[ 1];
497   w0[2] = pws[gid].i[ 2];
498   w0[3] = pws[gid].i[ 3];
499
500   u32 w1[4];
501
502   w1[0] = pws[gid].i[ 4];
503   w1[1] = pws[gid].i[ 5];
504   w1[2] = pws[gid].i[ 6];
505   w1[3] = pws[gid].i[ 7];
506
507   u32 w2[4];
508
509   w2[0] = 0;
510   w2[1] = 0;
511   w2[2] = 0;
512   w2[3] = 0;
513
514   u32 w3[4];
515
516   w3[0] = 0;
517   w3[1] = 0;
518   w3[2] = 0;
519   w3[3] = 0;
520
521   const u32 pw_len = pws[gid].pw_len;
522
523   /**
524    * main
525    */
526
527   m05100s (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);
528 }
529
530 __kernel void m05100_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)
531 {
532   /**
533    * base
534    */
535
536   const u32 gid = get_global_id (0);
537
538   if (gid >= gid_max) return;
539
540   u32 w0[4];
541
542   w0[0] = pws[gid].i[ 0];
543   w0[1] = pws[gid].i[ 1];
544   w0[2] = pws[gid].i[ 2];
545   w0[3] = pws[gid].i[ 3];
546
547   u32 w1[4];
548
549   w1[0] = pws[gid].i[ 4];
550   w1[1] = pws[gid].i[ 5];
551   w1[2] = pws[gid].i[ 6];
552   w1[3] = pws[gid].i[ 7];
553
554   u32 w2[4];
555
556   w2[0] = pws[gid].i[ 8];
557   w2[1] = pws[gid].i[ 9];
558   w2[2] = pws[gid].i[10];
559   w2[3] = pws[gid].i[11];
560
561   u32 w3[4];
562
563   w3[0] = pws[gid].i[12];
564   w3[1] = pws[gid].i[13];
565   w3[2] = 0;
566   w3[3] = 0;
567
568   const u32 pw_len = pws[gid].pw_len;
569
570   /**
571    * main
572    */
573
574   m05100s (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);
575 }