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