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