7aa9226bbe09f2daa20a63d94d3b1ebbc2534f0b
[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_hash_constants.h"
11 #include "inc_vendor.cl"
12
13 #define DGST_R0 0
14 #define DGST_R1 1
15 #define DGST_R2 2
16 #define DGST_R3 3
17
18 #include "inc_hash_functions.cl"
19 #include "inc_types.cl"
20 #include "inc_common.cl"
21 #include "inc_simd.cl"
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 z = 0;
149
150     COMPARE_M_SIMD (a, b, z, z);
151     COMPARE_M_SIMD (b, c, z, z);
152     COMPARE_M_SIMD (c, d, z, z);
153   }
154 }
155
156 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)
157 {
158   /**
159    * modifier
160    */
161
162   const u32 gid = get_global_id (0);
163   const u32 lid = get_local_id (0);
164
165   /**
166    * digest
167    */
168
169   const u32 search[4] =
170   {
171     digests_buf[digests_offset].digest_buf[DGST_R0],
172     digests_buf[digests_offset].digest_buf[DGST_R1],
173     0,
174     0
175   };
176
177   /**
178    * loop
179    */
180
181   const u32 w0l = w0[0];
182
183   for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
184   {
185     const u32x w0r = ix_create_bft (bfs_buf, il_pos);
186
187     const u32x w0lr = w0l | w0r;
188
189     u32x t0[4];
190     u32x t1[4];
191     u32x t2[4];
192     u32x t3[4];
193
194     t0[0] = w0lr;
195     t0[1] = w0[1];
196     t0[2] = w0[2];
197     t0[3] = w0[3];
198     t1[0] = w1[0];
199     t1[1] = w1[1];
200     t1[2] = w1[2];
201     t1[3] = w1[3];
202     t2[0] = w2[0];
203     t2[1] = w2[1];
204     t2[2] = w2[2];
205     t2[3] = w2[3];
206     t3[0] = w3[0];
207     t3[1] = w3[1];
208     t3[2] = pw_len * 8;
209     t3[3] = 0;
210
211     /**
212      * md5
213      */
214
215     u32x a = MD5M_A;
216     u32x b = MD5M_B;
217     u32x c = MD5M_C;
218     u32x d = MD5M_D;
219
220     MD5_STEP (MD5_Fo, a, b, c, d, t0[0], MD5C00, MD5S00);
221     MD5_STEP (MD5_Fo, d, a, b, c, t0[1], MD5C01, MD5S01);
222     MD5_STEP (MD5_Fo, c, d, a, b, t0[2], MD5C02, MD5S02);
223     MD5_STEP (MD5_Fo, b, c, d, a, t0[3], MD5C03, MD5S03);
224     MD5_STEP (MD5_Fo, a, b, c, d, t1[0], MD5C04, MD5S00);
225     MD5_STEP (MD5_Fo, d, a, b, c, t1[1], MD5C05, MD5S01);
226     MD5_STEP (MD5_Fo, c, d, a, b, t1[2], MD5C06, MD5S02);
227     MD5_STEP (MD5_Fo, b, c, d, a, t1[3], MD5C07, MD5S03);
228     MD5_STEP (MD5_Fo, a, b, c, d, t2[0], MD5C08, MD5S00);
229     MD5_STEP (MD5_Fo, d, a, b, c, t2[1], MD5C09, MD5S01);
230     MD5_STEP (MD5_Fo, c, d, a, b, t2[2], MD5C0a, MD5S02);
231     MD5_STEP (MD5_Fo, b, c, d, a, t2[3], MD5C0b, MD5S03);
232     MD5_STEP (MD5_Fo, a, b, c, d, t3[0], MD5C0c, MD5S00);
233     MD5_STEP (MD5_Fo, d, a, b, c, t3[1], MD5C0d, MD5S01);
234     MD5_STEP (MD5_Fo, c, d, a, b, t3[2], MD5C0e, MD5S02);
235     MD5_STEP (MD5_Fo, b, c, d, a, t3[3], MD5C0f, MD5S03);
236
237     MD5_STEP (MD5_Go, a, b, c, d, t0[1], MD5C10, MD5S10);
238     MD5_STEP (MD5_Go, d, a, b, c, t1[2], MD5C11, MD5S11);
239     MD5_STEP (MD5_Go, c, d, a, b, t2[3], MD5C12, MD5S12);
240     MD5_STEP (MD5_Go, b, c, d, a, t0[0], MD5C13, MD5S13);
241     MD5_STEP (MD5_Go, a, b, c, d, t1[1], MD5C14, MD5S10);
242     MD5_STEP (MD5_Go, d, a, b, c, t2[2], MD5C15, MD5S11);
243     MD5_STEP (MD5_Go, c, d, a, b, t3[3], MD5C16, MD5S12);
244     MD5_STEP (MD5_Go, b, c, d, a, t1[0], MD5C17, MD5S13);
245     MD5_STEP (MD5_Go, a, b, c, d, t2[1], MD5C18, MD5S10);
246     MD5_STEP (MD5_Go, d, a, b, c, t3[2], MD5C19, MD5S11);
247     MD5_STEP (MD5_Go, c, d, a, b, t0[3], MD5C1a, MD5S12);
248     MD5_STEP (MD5_Go, b, c, d, a, t2[0], MD5C1b, MD5S13);
249     MD5_STEP (MD5_Go, a, b, c, d, t3[1], MD5C1c, MD5S10);
250     MD5_STEP (MD5_Go, d, a, b, c, t0[2], MD5C1d, MD5S11);
251     MD5_STEP (MD5_Go, c, d, a, b, t1[3], MD5C1e, MD5S12);
252     MD5_STEP (MD5_Go, b, c, d, a, t3[0], MD5C1f, MD5S13);
253
254     MD5_STEP (MD5_H , a, b, c, d, t1[1], MD5C20, MD5S20);
255     MD5_STEP (MD5_H , d, a, b, c, t2[0], MD5C21, MD5S21);
256     MD5_STEP (MD5_H , c, d, a, b, t2[3], MD5C22, MD5S22);
257     MD5_STEP (MD5_H , b, c, d, a, t3[2], MD5C23, MD5S23);
258     MD5_STEP (MD5_H , a, b, c, d, t0[1], MD5C24, MD5S20);
259     MD5_STEP (MD5_H , d, a, b, c, t1[0], MD5C25, MD5S21);
260     MD5_STEP (MD5_H , c, d, a, b, t1[3], MD5C26, MD5S22);
261     MD5_STEP (MD5_H , b, c, d, a, t2[2], MD5C27, MD5S23);
262     MD5_STEP (MD5_H , a, b, c, d, t3[1], MD5C28, MD5S20);
263     MD5_STEP (MD5_H , d, a, b, c, t0[0], MD5C29, MD5S21);
264     MD5_STEP (MD5_H , c, d, a, b, t0[3], MD5C2a, MD5S22);
265     MD5_STEP (MD5_H , b, c, d, a, t1[2], MD5C2b, MD5S23);
266     MD5_STEP (MD5_H , a, b, c, d, t2[1], MD5C2c, MD5S20);
267     MD5_STEP (MD5_H , d, a, b, c, t3[0], MD5C2d, MD5S21);
268     MD5_STEP (MD5_H , c, d, a, b, t3[3], MD5C2e, MD5S22);
269     MD5_STEP (MD5_H , b, c, d, a, t0[2], MD5C2f, MD5S23);
270
271     MD5_STEP (MD5_I , a, b, c, d, t0[0], MD5C30, MD5S30);
272     MD5_STEP (MD5_I , d, a, b, c, t1[3], MD5C31, MD5S31);
273     MD5_STEP (MD5_I , c, d, a, b, t3[2], MD5C32, MD5S32);
274     MD5_STEP (MD5_I , b, c, d, a, t1[1], MD5C33, MD5S33);
275     MD5_STEP (MD5_I , a, b, c, d, t3[0], MD5C34, MD5S30);
276     MD5_STEP (MD5_I , d, a, b, c, t0[3], MD5C35, MD5S31);
277     MD5_STEP (MD5_I , c, d, a, b, t2[2], MD5C36, MD5S32);
278     MD5_STEP (MD5_I , b, c, d, a, t0[1], MD5C37, MD5S33);
279     MD5_STEP (MD5_I , a, b, c, d, t2[0], MD5C38, MD5S30);
280     MD5_STEP (MD5_I , d, a, b, c, t3[3], MD5C39, MD5S31);
281     MD5_STEP (MD5_I , c, d, a, b, t1[2], MD5C3a, MD5S32);
282     MD5_STEP (MD5_I , b, c, d, a, t3[1], MD5C3b, MD5S33);
283     MD5_STEP (MD5_I , a, b, c, d, t1[0], MD5C3c, MD5S30);
284     MD5_STEP (MD5_I , d, a, b, c, t2[3], MD5C3d, MD5S31);
285     MD5_STEP (MD5_I , c, d, a, b, t0[2], MD5C3e, MD5S32);
286     MD5_STEP (MD5_I , b, c, d, a, t2[1], MD5C3f, MD5S33);
287
288     a += MD5M_A;
289     b += MD5M_B;
290     c += MD5M_C;
291     d += MD5M_D;
292
293     u32x z = 0;
294
295     COMPARE_S_SIMD (a, b, z, z);
296     COMPARE_S_SIMD (b, c, z, z);
297     COMPARE_S_SIMD (c, d, z, z);
298   }
299 }
300
301 __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)
302 {
303   /**
304    * base
305    */
306
307   const u32 gid = get_global_id (0);
308
309   if (gid >= gid_max) return;
310
311   u32 w0[4];
312
313   w0[0] = pws[gid].i[ 0];
314   w0[1] = pws[gid].i[ 1];
315   w0[2] = pws[gid].i[ 2];
316   w0[3] = pws[gid].i[ 3];
317
318   u32 w1[4];
319
320   w1[0] = 0;
321   w1[1] = 0;
322   w1[2] = 0;
323   w1[3] = 0;
324
325   u32 w2[4];
326
327   w2[0] = 0;
328   w2[1] = 0;
329   w2[2] = 0;
330   w2[3] = 0;
331
332   u32 w3[4];
333
334   w3[0] = 0;
335   w3[1] = 0;
336   w3[2] = 0;
337   w3[3] = 0;
338
339   const u32 pw_len = pws[gid].pw_len;
340
341   /**
342    * main
343    */
344
345   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);
346 }
347
348 __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)
349 {
350   /**
351    * base
352    */
353
354   const u32 gid = get_global_id (0);
355
356   if (gid >= gid_max) return;
357
358   u32 w0[4];
359
360   w0[0] = pws[gid].i[ 0];
361   w0[1] = pws[gid].i[ 1];
362   w0[2] = pws[gid].i[ 2];
363   w0[3] = pws[gid].i[ 3];
364
365   u32 w1[4];
366
367   w1[0] = pws[gid].i[ 4];
368   w1[1] = pws[gid].i[ 5];
369   w1[2] = pws[gid].i[ 6];
370   w1[3] = pws[gid].i[ 7];
371
372   u32 w2[4];
373
374   w2[0] = 0;
375   w2[1] = 0;
376   w2[2] = 0;
377   w2[3] = 0;
378
379   u32 w3[4];
380
381   w3[0] = 0;
382   w3[1] = 0;
383   w3[2] = 0;
384   w3[3] = 0;
385
386   const u32 pw_len = pws[gid].pw_len;
387
388   /**
389    * main
390    */
391
392   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);
393 }
394
395 __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)
396 {
397   /**
398    * base
399    */
400
401   const u32 gid = get_global_id (0);
402
403   if (gid >= gid_max) return;
404
405   u32 w0[4];
406
407   w0[0] = pws[gid].i[ 0];
408   w0[1] = pws[gid].i[ 1];
409   w0[2] = pws[gid].i[ 2];
410   w0[3] = pws[gid].i[ 3];
411
412   u32 w1[4];
413
414   w1[0] = pws[gid].i[ 4];
415   w1[1] = pws[gid].i[ 5];
416   w1[2] = pws[gid].i[ 6];
417   w1[3] = pws[gid].i[ 7];
418
419   u32 w2[4];
420
421   w2[0] = pws[gid].i[ 8];
422   w2[1] = pws[gid].i[ 9];
423   w2[2] = pws[gid].i[10];
424   w2[3] = pws[gid].i[11];
425
426   u32 w3[4];
427
428   w3[0] = pws[gid].i[12];
429   w3[1] = pws[gid].i[13];
430   w3[2] = 0;
431   w3[3] = 0;
432
433   const u32 pw_len = pws[gid].pw_len;
434
435   /**
436    * main
437    */
438
439   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);
440 }
441
442 __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)
443 {
444   /**
445    * base
446    */
447
448   const u32 gid = get_global_id (0);
449
450   if (gid >= gid_max) return;
451
452   u32 w0[4];
453
454   w0[0] = pws[gid].i[ 0];
455   w0[1] = pws[gid].i[ 1];
456   w0[2] = pws[gid].i[ 2];
457   w0[3] = pws[gid].i[ 3];
458
459   u32 w1[4];
460
461   w1[0] = 0;
462   w1[1] = 0;
463   w1[2] = 0;
464   w1[3] = 0;
465
466   u32 w2[4];
467
468   w2[0] = 0;
469   w2[1] = 0;
470   w2[2] = 0;
471   w2[3] = 0;
472
473   u32 w3[4];
474
475   w3[0] = 0;
476   w3[1] = 0;
477   w3[2] = 0;
478   w3[3] = 0;
479
480   const u32 pw_len = pws[gid].pw_len;
481
482   /**
483    * main
484    */
485
486   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);
487 }
488
489 __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)
490 {
491   /**
492    * base
493    */
494
495   const u32 gid = get_global_id (0);
496
497   if (gid >= gid_max) return;
498
499   u32 w0[4];
500
501   w0[0] = pws[gid].i[ 0];
502   w0[1] = pws[gid].i[ 1];
503   w0[2] = pws[gid].i[ 2];
504   w0[3] = pws[gid].i[ 3];
505
506   u32 w1[4];
507
508   w1[0] = pws[gid].i[ 4];
509   w1[1] = pws[gid].i[ 5];
510   w1[2] = pws[gid].i[ 6];
511   w1[3] = pws[gid].i[ 7];
512
513   u32 w2[4];
514
515   w2[0] = 0;
516   w2[1] = 0;
517   w2[2] = 0;
518   w2[3] = 0;
519
520   u32 w3[4];
521
522   w3[0] = 0;
523   w3[1] = 0;
524   w3[2] = 0;
525   w3[3] = 0;
526
527   const u32 pw_len = pws[gid].pw_len;
528
529   /**
530    * main
531    */
532
533   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);
534 }
535
536 __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)
537 {
538   /**
539    * base
540    */
541
542   const u32 gid = get_global_id (0);
543
544   if (gid >= gid_max) return;
545
546   u32 w0[4];
547
548   w0[0] = pws[gid].i[ 0];
549   w0[1] = pws[gid].i[ 1];
550   w0[2] = pws[gid].i[ 2];
551   w0[3] = pws[gid].i[ 3];
552
553   u32 w1[4];
554
555   w1[0] = pws[gid].i[ 4];
556   w1[1] = pws[gid].i[ 5];
557   w1[2] = pws[gid].i[ 6];
558   w1[3] = pws[gid].i[ 7];
559
560   u32 w2[4];
561
562   w2[0] = pws[gid].i[ 8];
563   w2[1] = pws[gid].i[ 9];
564   w2[2] = pws[gid].i[10];
565   w2[3] = pws[gid].i[11];
566
567   u32 w3[4];
568
569   w3[0] = pws[gid].i[12];
570   w3[1] = pws[gid].i[13];
571   w3[2] = 0;
572   w3[3] = 0;
573
574   const u32 pw_len = pws[gid].pw_len;
575
576   /**
577    * main
578    */
579
580   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);
581 }