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