Fix m 60 a 0 by making modified variable non-const
[hashcat.git] / OpenCL / m10410_a3.cl
1 /**
2  * Authors.....: Jens Steube <jens.steube@gmail.com>
3  *               Gabriele Gristina <matrix@hashcat.net>
4  *
5  * License.....: MIT
6  */
7
8 #define _MD5_
9
10 //too much register pressure
11 //#define NEW_SIMD_CODE
12
13 #include "inc_vendor.cl"
14 #include "inc_hash_constants.h"
15 #include "inc_hash_functions.cl"
16 #include "inc_types.cl"
17 #include "inc_common.cl"
18 #include "inc_simd.cl"
19
20 __constant u32 padding[8] =
21 {
22   0x5e4ebf28,
23   0x418a754e,
24   0x564e0064,
25   0x0801faff,
26   0xb6002e2e,
27   0x803e68d0,
28   0xfea90c2f,
29   0x7a695364
30 };
31
32 typedef struct
33 {
34   u8 S[256];
35
36   u32 wtf_its_faster;
37
38 } RC4_KEY;
39
40 void swap (__local RC4_KEY *rc4_key, const u8 i, const u8 j)
41 {
42   u8 tmp;
43
44   tmp           = rc4_key->S[i];
45   rc4_key->S[i] = rc4_key->S[j];
46   rc4_key->S[j] = tmp;
47 }
48
49 void rc4_init_16 (__local RC4_KEY *rc4_key, const u32 data[4])
50 {
51   u32 v = 0x03020100;
52   u32 a = 0x04040404;
53
54   __local u32 *ptr = (__local u32 *) rc4_key->S;
55
56   #ifdef _unroll
57   #pragma unroll
58   #endif
59   for (u32 i = 0; i < 64; i++)
60   {
61     ptr[i] = v; v += a;
62   }
63
64   const u32 d0 = data[0] >>  0;
65   const u32 d1 = data[0] >>  8;
66   const u32 d2 = data[0] >> 16;
67   const u32 d3 = data[0] >> 24;
68   const u32 d4 = data[1] >>  0;
69
70   u32 j = 0;
71
72   #ifdef _unroll
73   #pragma unroll
74   #endif
75   for (u32 i = 0; i < 255; i += 5)
76   {
77     j += rc4_key->S[i + 0] + d0; swap (rc4_key, i + 0, j);
78     j += rc4_key->S[i + 1] + d1; swap (rc4_key, i + 1, j);
79     j += rc4_key->S[i + 2] + d2; swap (rc4_key, i + 2, j);
80     j += rc4_key->S[i + 3] + d3; swap (rc4_key, i + 3, j);
81     j += rc4_key->S[i + 4] + d4; swap (rc4_key, i + 4, j);
82   }
83
84   j += rc4_key->S[255] + d0; swap (rc4_key, 255, j);
85 }
86
87 u8 rc4_next_16 (__local RC4_KEY *rc4_key, u8 i, u8 j, __constant u32 *in, u32 out[4])
88 {
89   #ifdef _unroll
90   #pragma unroll
91   #endif
92   for (u32 k = 0; k < 4; k++)
93   {
94     u32 xor4 = 0;
95
96     u8 idx;
97
98     i += 1;
99     j += rc4_key->S[i];
100
101     swap (rc4_key, i, j);
102
103     idx = rc4_key->S[i] + rc4_key->S[j];
104
105     xor4 |= rc4_key->S[idx] <<  0;
106
107     i += 1;
108     j += rc4_key->S[i];
109
110     swap (rc4_key, i, j);
111
112     idx = rc4_key->S[i] + rc4_key->S[j];
113
114     xor4 |= rc4_key->S[idx] <<  8;
115
116     i += 1;
117     j += rc4_key->S[i];
118
119     swap (rc4_key, i, j);
120
121     idx = rc4_key->S[i] + rc4_key->S[j];
122
123     xor4 |= rc4_key->S[idx] << 16;
124
125     i += 1;
126     j += rc4_key->S[i];
127
128     swap (rc4_key, i, j);
129
130     idx = rc4_key->S[i] + rc4_key->S[j];
131
132     xor4 |= rc4_key->S[idx] << 24;
133
134     out[k] = in[k] ^ xor4;
135   }
136
137   return j;
138 }
139
140 void m10410m (__local RC4_KEY *rc4_keys, 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 pdf_t *pdf_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset)
141 {
142   /**
143    * modifier
144    */
145
146   const u32 gid = get_global_id (0);
147   const u32 lid = get_local_id (0);
148
149   /**
150    * shared
151    */
152
153   __local RC4_KEY *rc4_key = &rc4_keys[lid];
154
155   /**
156    * loop
157    */
158
159   u32 w0l = w0[0];
160
161   for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
162   {
163     const u32 w0r = ix_create_bft (bfs_buf, il_pos);
164
165     const u32 w0lr = w0l | w0r;
166
167     w0[0] = w0lr;
168
169     /**
170      * pdf
171      */
172
173     rc4_init_16 (rc4_key, w0);
174
175     u32 out[4];
176
177     rc4_next_16 (rc4_key, 0, 0, padding, out);
178
179     COMPARE_M_SIMD (out[0], out[1], out[2], out[3]);
180   }
181 }
182
183 void m10410s (__local RC4_KEY *rc4_keys, 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 pdf_t *pdf_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset)
184 {
185   /**
186    * modifier
187    */
188
189   const u32 gid = get_global_id (0);
190   const u32 lid = get_local_id (0);
191
192   /**
193    * shared
194    */
195
196   __local RC4_KEY *rc4_key = &rc4_keys[lid];
197
198   /**
199    * digest
200    */
201
202   const u32 search[4] =
203   {
204     digests_buf[digests_offset].digest_buf[DGST_R0],
205     digests_buf[digests_offset].digest_buf[DGST_R1],
206     digests_buf[digests_offset].digest_buf[DGST_R2],
207     digests_buf[digests_offset].digest_buf[DGST_R3]
208   };
209
210   /**
211    * loop
212    */
213
214   u32 w0l = w0[0];
215
216   for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
217   {
218     const u32 w0r = ix_create_bft (bfs_buf, il_pos);
219
220     const u32 w0lr = w0l | w0r;
221
222     w0[0] = w0lr;
223
224     /**
225      * pdf
226      */
227
228     rc4_init_16 (rc4_key, w0);
229
230     u32 out[4];
231
232     rc4_next_16 (rc4_key, 0, 0, padding, out);
233
234     COMPARE_S_SIMD (out[0], out[1], out[2], out[3]);
235   }
236 }
237
238 __kernel void m10410_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 pdf_t *pdf_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
239 {
240   /**
241    * base
242    */
243
244   const u32 gid = get_global_id (0);
245
246   if (gid >= gid_max) return;
247
248   u32 w0[4];
249
250   w0[0] = pws[gid].i[ 0];
251   w0[1] = pws[gid].i[ 1];
252   w0[2] = pws[gid].i[ 2];
253   w0[3] = pws[gid].i[ 3];
254
255   u32 w1[4];
256
257   w1[0] = 0;
258   w1[1] = 0;
259   w1[2] = 0;
260   w1[3] = 0;
261
262   u32 w2[4];
263
264   w2[0] = 0;
265   w2[1] = 0;
266   w2[2] = 0;
267   w2[3] = 0;
268
269   u32 w3[4];
270
271   w3[0] = 0;
272   w3[1] = 0;
273   w3[2] = 0;
274   w3[3] = 0;
275
276   const u32 pw_len = pws[gid].pw_len;
277
278   /**
279    * main
280    */
281
282   __local RC4_KEY rc4_keys[64];
283
284   m10410m (rc4_keys, 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, pdf_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset);
285 }
286
287 __kernel void m10410_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 pdf_t *pdf_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
288 {
289   /**
290    * base
291    */
292
293   const u32 gid = get_global_id (0);
294
295   if (gid >= gid_max) return;
296
297   u32 w0[4];
298
299   w0[0] = pws[gid].i[ 0];
300   w0[1] = pws[gid].i[ 1];
301   w0[2] = pws[gid].i[ 2];
302   w0[3] = pws[gid].i[ 3];
303
304   u32 w1[4];
305
306   w1[0] = pws[gid].i[ 4];
307   w1[1] = pws[gid].i[ 5];
308   w1[2] = pws[gid].i[ 6];
309   w1[3] = pws[gid].i[ 7];
310
311   u32 w2[4];
312
313   w2[0] = 0;
314   w2[1] = 0;
315   w2[2] = 0;
316   w2[3] = 0;
317
318   u32 w3[4];
319
320   w3[0] = 0;
321   w3[1] = 0;
322   w3[2] = 0;
323   w3[3] = 0;
324
325   const u32 pw_len = pws[gid].pw_len;
326
327   /**
328    * main
329    */
330
331   __local RC4_KEY rc4_keys[64];
332
333   m10410m (rc4_keys, 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, pdf_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset);
334 }
335
336 __kernel void m10410_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 pdf_t *pdf_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
337 {
338   /**
339    * base
340    */
341
342   const u32 gid = get_global_id (0);
343
344   if (gid >= gid_max) return;
345
346   u32 w0[4];
347
348   w0[0] = pws[gid].i[ 0];
349   w0[1] = pws[gid].i[ 1];
350   w0[2] = pws[gid].i[ 2];
351   w0[3] = pws[gid].i[ 3];
352
353   u32 w1[4];
354
355   w1[0] = pws[gid].i[ 4];
356   w1[1] = pws[gid].i[ 5];
357   w1[2] = pws[gid].i[ 6];
358   w1[3] = pws[gid].i[ 7];
359
360   u32 w2[4];
361
362   w2[0] = pws[gid].i[ 8];
363   w2[1] = pws[gid].i[ 9];
364   w2[2] = pws[gid].i[10];
365   w2[3] = pws[gid].i[11];
366
367   u32 w3[4];
368
369   w3[0] = pws[gid].i[12];
370   w3[1] = pws[gid].i[13];
371   w3[2] = 0;
372   w3[3] = 0;
373
374   const u32 pw_len = pws[gid].pw_len;
375
376   /**
377    * main
378    */
379
380   __local RC4_KEY rc4_keys[64];
381
382   m10410m (rc4_keys, 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, pdf_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset);
383 }
384
385 __kernel void m10410_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 pdf_t *pdf_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
386 {
387   /**
388    * base
389    */
390
391   const u32 gid = get_global_id (0);
392
393   if (gid >= gid_max) return;
394
395   u32 w0[4];
396
397   w0[0] = pws[gid].i[ 0];
398   w0[1] = pws[gid].i[ 1];
399   w0[2] = pws[gid].i[ 2];
400   w0[3] = pws[gid].i[ 3];
401
402   u32 w1[4];
403
404   w1[0] = 0;
405   w1[1] = 0;
406   w1[2] = 0;
407   w1[3] = 0;
408
409   u32 w2[4];
410
411   w2[0] = 0;
412   w2[1] = 0;
413   w2[2] = 0;
414   w2[3] = 0;
415
416   u32 w3[4];
417
418   w3[0] = 0;
419   w3[1] = 0;
420   w3[2] = 0;
421   w3[3] = 0;
422
423   const u32 pw_len = pws[gid].pw_len;
424
425   /**
426    * main
427    */
428
429   __local RC4_KEY rc4_keys[64];
430
431   m10410s (rc4_keys, 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, pdf_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset);
432 }
433
434 __kernel void m10410_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 pdf_t *pdf_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
435 {
436   /**
437    * base
438    */
439
440   const u32 gid = get_global_id (0);
441
442   if (gid >= gid_max) return;
443
444   u32 w0[4];
445
446   w0[0] = pws[gid].i[ 0];
447   w0[1] = pws[gid].i[ 1];
448   w0[2] = pws[gid].i[ 2];
449   w0[3] = pws[gid].i[ 3];
450
451   u32 w1[4];
452
453   w1[0] = pws[gid].i[ 4];
454   w1[1] = pws[gid].i[ 5];
455   w1[2] = pws[gid].i[ 6];
456   w1[3] = pws[gid].i[ 7];
457
458   u32 w2[4];
459
460   w2[0] = 0;
461   w2[1] = 0;
462   w2[2] = 0;
463   w2[3] = 0;
464
465   u32 w3[4];
466
467   w3[0] = 0;
468   w3[1] = 0;
469   w3[2] = 0;
470   w3[3] = 0;
471
472   const u32 pw_len = pws[gid].pw_len;
473
474   /**
475    * main
476    */
477
478   __local RC4_KEY rc4_keys[64];
479
480   m10410s (rc4_keys, 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, pdf_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset);
481 }
482
483 __kernel void m10410_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 pdf_t *pdf_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
484 {
485   /**
486    * base
487    */
488
489   const u32 gid = get_global_id (0);
490
491   if (gid >= gid_max) return;
492
493   u32 w0[4];
494
495   w0[0] = pws[gid].i[ 0];
496   w0[1] = pws[gid].i[ 1];
497   w0[2] = pws[gid].i[ 2];
498   w0[3] = pws[gid].i[ 3];
499
500   u32 w1[4];
501
502   w1[0] = pws[gid].i[ 4];
503   w1[1] = pws[gid].i[ 5];
504   w1[2] = pws[gid].i[ 6];
505   w1[3] = pws[gid].i[ 7];
506
507   u32 w2[4];
508
509   w2[0] = pws[gid].i[ 8];
510   w2[1] = pws[gid].i[ 9];
511   w2[2] = pws[gid].i[10];
512   w2[3] = pws[gid].i[11];
513
514   u32 w3[4];
515
516   w3[0] = pws[gid].i[12];
517   w3[1] = pws[gid].i[13];
518   w3[2] = 0;
519   w3[3] = 0;
520
521   const u32 pw_len = pws[gid].pw_len;
522
523   /**
524    * main
525    */
526
527   __local RC4_KEY rc4_keys[64];
528
529   m10410s (rc4_keys, 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, pdf_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset);
530 }