Cleanup -m 50xx kernels to latest standard - NOTE: broken on SIMD, compiler bug
[hashcat.git] / OpenCL / m05000_a3.cl
1 /**
2  * Author......: Jens Steube <jens.steube@gmail.com>
3  * License.....: MIT
4  */
5
6 #define _KECCAK_
7
8 #define NEW_SIMD_CODE
9
10 #include "include/constants.h"
11 #include "include/kernel_vendor.h"
12
13 #define DGST_R0 2
14 #define DGST_R1 3
15 #define DGST_R2 4
16 #define DGST_R3 5
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 __constant u64 keccakf_rndc[24] =
24 {
25   0x0000000000000001, 0x0000000000008082, 0x800000000000808a,
26   0x8000000080008000, 0x000000000000808b, 0x0000000080000001,
27   0x8000000080008081, 0x8000000000008009, 0x000000000000008a,
28   0x0000000000000088, 0x0000000080008009, 0x000000008000000a,
29   0x000000008000808b, 0x800000000000008b, 0x8000000000008089,
30   0x8000000000008003, 0x8000000000008002, 0x8000000000000080,
31   0x000000000000800a, 0x800000008000000a, 0x8000000080008081,
32   0x8000000000008080, 0x0000000080000001, 0x8000000080008008
33 };
34
35 __constant u8 keccakf_rotc[24] =
36 {
37    1,  3,  6, 10, 15, 21, 28, 36, 45, 55,  2, 14,
38   27, 41, 56,  8, 25, 43, 62, 18, 39, 61, 20, 44
39 };
40
41 __constant u8 keccakf_piln[24] =
42 {
43   10,  7, 11, 17, 18,  3,  5, 16,  8, 21, 24,  4,
44   15, 23, 19, 13, 12,  2, 20, 14, 22,  9,  6,  1
45 };
46
47 #ifndef KECCAK_ROUNDS
48 #define KECCAK_ROUNDS 24
49 #endif
50
51 #define Theta1(s) (st[0 + s] ^ st[5 + s] ^ st[10 + s] ^ st[15 + s] ^ st[20 + s])
52
53 #define Theta2(s)               \
54 {                               \
55   st[ 0 + s] ^= t;              \
56   st[ 5 + s] ^= t;              \
57   st[10 + s] ^= t;              \
58   st[15 + s] ^= t;              \
59   st[20 + s] ^= t;              \
60 }
61
62 #define Rho_Pi(s)               \
63 {                               \
64   u32 j = keccakf_piln[s];      \
65   u32 k = keccakf_rotc[s];      \
66   bc0 = st[j];                  \
67   st[j] = rotl64 (t, k);        \
68   t = bc0;                      \
69 }
70
71 #define Chi(s)                  \
72 {                               \
73   bc0 = st[0 + s];              \
74   bc1 = st[1 + s];              \
75   bc2 = st[2 + s];              \
76   bc3 = st[3 + s];              \
77   bc4 = st[4 + s];              \
78   st[0 + s] ^= ~bc1 & bc2;      \
79   st[1 + s] ^= ~bc2 & bc3;      \
80   st[2 + s] ^= ~bc3 & bc4;      \
81   st[3 + s] ^= ~bc4 & bc0;      \
82   st[4 + s] ^= ~bc0 & bc1;      \
83 }
84
85 static void m05000m (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)
86 {
87   /**
88    * modifier
89    */
90
91   const u32 gid = get_global_id (0);
92   const u32 lid = get_local_id (0);
93
94   /**
95    * 0x80 keccak, very special
96    */
97
98   const u32 mdlen = salt_bufs[salt_pos].keccak_mdlen;
99
100   const u32 rsiz = 200 - (2 * mdlen);
101
102   const u32 add80w = (rsiz - 1) / 8;
103
104   /**
105    * loop
106    */
107
108   u32 w0l = w0[0];
109
110   for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
111   {
112     const u32x w0r = ix_create_bft (bfs_buf, il_pos);
113
114     const u32x w0lr = w0l | w0r;
115
116     u32x t0[4];
117     u32x t1[4];
118     u32x t2[4];
119     u32x t3[4];
120
121     t0[0] = w0lr;
122     t0[1] = w0[1];
123     t0[2] = w0[2];
124     t0[3] = w0[3];
125     t1[0] = w1[0];
126     t1[1] = w1[1];
127     t1[2] = w1[2];
128     t1[3] = w1[3];
129     t2[0] = w2[0];
130     t2[1] = w2[1];
131     t2[2] = w2[2];
132     t2[3] = w2[3];
133     t3[0] = w3[0];
134     t3[1] = w3[1];
135     t3[2] = w3[2];
136     t3[3] = w3[3];
137
138     /**
139      * Keccak
140      */
141
142     u64x st[25];
143
144     st[ 0] = hl32_to_64 (t0[1], t0[0]);
145     st[ 1] = hl32_to_64 (t0[3], t0[2]);
146     st[ 2] = hl32_to_64 (t1[1], t1[0]);
147     st[ 3] = hl32_to_64 (t1[3], t1[2]);
148     st[ 4] = hl32_to_64 (t2[1], t2[0]);
149     st[ 5] = hl32_to_64 (t2[3], t2[2]);
150     st[ 6] = hl32_to_64 (t3[1], t3[0]);
151     st[ 7] = hl32_to_64 (t3[3], t3[2]);
152     st[ 8] = 0;
153     st[ 9] = 0;
154     st[10] = 0;
155     st[11] = 0;
156     st[12] = 0;
157     st[13] = 0;
158     st[14] = 0;
159     st[15] = 0;
160     st[16] = 0;
161     st[17] = 0;
162     st[18] = 0;
163     st[19] = 0;
164     st[20] = 0;
165     st[21] = 0;
166     st[22] = 0;
167     st[23] = 0;
168     st[24] = 0;
169
170     st[add80w] |= 0x8000000000000000;
171
172     int round;
173
174     for (round = 0; round < KECCAK_ROUNDS; round++)
175     {
176       // Theta
177
178       u64x bc0 = Theta1 (0);
179       u64x bc1 = Theta1 (1);
180       u64x bc2 = Theta1 (2);
181       u64x bc3 = Theta1 (3);
182       u64x bc4 = Theta1 (4);
183
184       u64x t;
185
186       t = bc4 ^ rotl64 (bc1, 1); Theta2 (0);
187       t = bc0 ^ rotl64 (bc2, 1); Theta2 (1);
188       t = bc1 ^ rotl64 (bc3, 1); Theta2 (2);
189       t = bc2 ^ rotl64 (bc4, 1); Theta2 (3);
190       t = bc3 ^ rotl64 (bc0, 1); Theta2 (4);
191
192       // Rho Pi
193
194       t = st[1];
195
196       Rho_Pi (0);
197       Rho_Pi (1);
198       Rho_Pi (2);
199       Rho_Pi (3);
200       Rho_Pi (4);
201       Rho_Pi (5);
202       Rho_Pi (6);
203       Rho_Pi (7);
204       Rho_Pi (8);
205       Rho_Pi (9);
206       Rho_Pi (10);
207       Rho_Pi (11);
208       Rho_Pi (12);
209       Rho_Pi (13);
210       Rho_Pi (14);
211       Rho_Pi (15);
212       Rho_Pi (16);
213       Rho_Pi (17);
214       Rho_Pi (18);
215       Rho_Pi (19);
216       Rho_Pi (20);
217       Rho_Pi (21);
218       Rho_Pi (22);
219       Rho_Pi (23);
220
221       //  Chi
222
223       Chi (0);
224       Chi (5);
225       Chi (10);
226       Chi (15);
227       Chi (20);
228
229       //  Iota
230
231       st[0] ^= keccakf_rndc[round];
232     }
233
234     const u32x r0 = l32_from_64 (st[1]);
235     const u32x r1 = h32_from_64 (st[1]);
236     const u32x r2 = l32_from_64 (st[2]);
237     const u32x r3 = h32_from_64 (st[2]);
238
239     COMPARE_M_SIMD (r0, r1, r2, r3);
240   }
241 }
242
243 static void m05000s (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)
244 {
245   /**
246    * modifier
247    */
248
249   const u32 gid = get_global_id (0);
250   const u32 lid = get_local_id (0);
251
252   /**
253    * 0x80 keccak, very special
254    */
255
256   const u32 mdlen = salt_bufs[salt_pos].keccak_mdlen;
257
258   const u32 rsiz = 200 - (2 * mdlen);
259
260   const u32 add80w = (rsiz - 1) / 8;
261
262   /**
263    * digest
264    */
265
266   const u32 search[4] =
267   {
268     digests_buf[digests_offset].digest_buf[DGST_R0],
269     digests_buf[digests_offset].digest_buf[DGST_R1],
270     digests_buf[digests_offset].digest_buf[DGST_R2],
271     digests_buf[digests_offset].digest_buf[DGST_R3]
272   };
273
274   /**
275    * loop
276    */
277
278   u32 w0l = w0[0];
279
280   for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
281   {
282     const u32x w0r = ix_create_bft (bfs_buf, il_pos);
283
284     const u32x w0lr = w0l | w0r;
285
286     u32x t0[4];
287     u32x t1[4];
288     u32x t2[4];
289     u32x t3[4];
290
291     t0[0] = w0lr;
292     t0[1] = w0[1];
293     t0[2] = w0[2];
294     t0[3] = w0[3];
295     t1[0] = w1[0];
296     t1[1] = w1[1];
297     t1[2] = w1[2];
298     t1[3] = w1[3];
299     t2[0] = w2[0];
300     t2[1] = w2[1];
301     t2[2] = w2[2];
302     t2[3] = w2[3];
303     t3[0] = w3[0];
304     t3[1] = w3[1];
305     t3[2] = w3[2];
306     t3[3] = w3[3];
307
308     /**
309      * Keccak
310      */
311
312     u64x st[25];
313
314     st[ 0] = hl32_to_64 (t0[1], t0[0]);
315     st[ 1] = hl32_to_64 (t0[3], t0[2]);
316     st[ 2] = hl32_to_64 (t1[1], t1[0]);
317     st[ 3] = hl32_to_64 (t1[3], t1[2]);
318     st[ 4] = hl32_to_64 (t2[1], t2[0]);
319     st[ 5] = hl32_to_64 (t2[3], t2[2]);
320     st[ 6] = hl32_to_64 (t3[1], t3[0]);
321     st[ 7] = hl32_to_64 (t3[3], t3[2]);
322     st[ 8] = 0;
323     st[ 9] = 0;
324     st[10] = 0;
325     st[11] = 0;
326     st[12] = 0;
327     st[13] = 0;
328     st[14] = 0;
329     st[15] = 0;
330     st[16] = 0;
331     st[17] = 0;
332     st[18] = 0;
333     st[19] = 0;
334     st[20] = 0;
335     st[21] = 0;
336     st[22] = 0;
337     st[23] = 0;
338     st[24] = 0;
339
340     st[add80w] |= 0x8000000000000000;
341
342     int round;
343
344     for (round = 0; round < KECCAK_ROUNDS; round++)
345     {
346       // Theta
347
348       u64x bc0 = Theta1 (0);
349       u64x bc1 = Theta1 (1);
350       u64x bc2 = Theta1 (2);
351       u64x bc3 = Theta1 (3);
352       u64x bc4 = Theta1 (4);
353
354       u64x t;
355
356       t = bc4 ^ rotl64 (bc1, 1); Theta2 (0);
357       t = bc0 ^ rotl64 (bc2, 1); Theta2 (1);
358       t = bc1 ^ rotl64 (bc3, 1); Theta2 (2);
359       t = bc2 ^ rotl64 (bc4, 1); Theta2 (3);
360       t = bc3 ^ rotl64 (bc0, 1); Theta2 (4);
361
362       // Rho Pi
363
364       t = st[1];
365
366       Rho_Pi (0);
367       Rho_Pi (1);
368       Rho_Pi (2);
369       Rho_Pi (3);
370       Rho_Pi (4);
371       Rho_Pi (5);
372       Rho_Pi (6);
373       Rho_Pi (7);
374       Rho_Pi (8);
375       Rho_Pi (9);
376       Rho_Pi (10);
377       Rho_Pi (11);
378       Rho_Pi (12);
379       Rho_Pi (13);
380       Rho_Pi (14);
381       Rho_Pi (15);
382       Rho_Pi (16);
383       Rho_Pi (17);
384       Rho_Pi (18);
385       Rho_Pi (19);
386       Rho_Pi (20);
387       Rho_Pi (21);
388       Rho_Pi (22);
389       Rho_Pi (23);
390
391       //  Chi
392
393       Chi (0);
394       Chi (5);
395       Chi (10);
396       Chi (15);
397       Chi (20);
398
399       //  Iota
400
401       st[0] ^= keccakf_rndc[round];
402     }
403
404     const u32x r0 = l32_from_64 (st[1]);
405     const u32x r1 = h32_from_64 (st[1]);
406     const u32x r2 = l32_from_64 (st[2]);
407     const u32x r3 = h32_from_64 (st[2]);
408
409     COMPARE_S_SIMD (r0, r1, r2, r3);
410   }
411 }
412
413 __kernel void m05000_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)
414 {
415   /**
416    * base
417    */
418
419   const u32 gid = get_global_id (0);
420
421   if (gid >= gid_max) return;
422
423   u32 w0[4];
424
425   w0[0] = pws[gid].i[ 0];
426   w0[1] = pws[gid].i[ 1];
427   w0[2] = pws[gid].i[ 2];
428   w0[3] = pws[gid].i[ 3];
429
430   u32 w1[4];
431
432   w1[0] = 0;
433   w1[1] = 0;
434   w1[2] = 0;
435   w1[3] = 0;
436
437   u32 w2[4];
438
439   w2[0] = 0;
440   w2[1] = 0;
441   w2[2] = 0;
442   w2[3] = 0;
443
444   u32 w3[4];
445
446   w3[0] = 0;
447   w3[1] = 0;
448   w3[2] = 0;
449   w3[3] = 0;
450
451   const u32 pw_len = pws[gid].pw_len;
452
453   /**
454    * main
455    */
456
457   m05000m (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);
458 }
459
460 __kernel void m05000_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)
461 {
462   /**
463    * base
464    */
465
466   const u32 gid = get_global_id (0);
467
468   if (gid >= gid_max) return;
469
470   u32 w0[4];
471
472   w0[0] = pws[gid].i[ 0];
473   w0[1] = pws[gid].i[ 1];
474   w0[2] = pws[gid].i[ 2];
475   w0[3] = pws[gid].i[ 3];
476
477   u32 w1[4];
478
479   w1[0] = pws[gid].i[ 4];
480   w1[1] = pws[gid].i[ 5];
481   w1[2] = pws[gid].i[ 6];
482   w1[3] = pws[gid].i[ 7];
483
484   u32 w2[4];
485
486   w2[0] = 0;
487   w2[1] = 0;
488   w2[2] = 0;
489   w2[3] = 0;
490
491   u32 w3[4];
492
493   w3[0] = 0;
494   w3[1] = 0;
495   w3[2] = 0;
496   w3[3] = 0;
497
498   const u32 pw_len = pws[gid].pw_len;
499
500   /**
501    * main
502    */
503
504   m05000m (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);
505 }
506
507 __kernel void m05000_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)
508 {
509   /**
510    * base
511    */
512
513   const u32 gid = get_global_id (0);
514
515   if (gid >= gid_max) return;
516
517   u32 w0[4];
518
519   w0[0] = pws[gid].i[ 0];
520   w0[1] = pws[gid].i[ 1];
521   w0[2] = pws[gid].i[ 2];
522   w0[3] = pws[gid].i[ 3];
523
524   u32 w1[4];
525
526   w1[0] = pws[gid].i[ 4];
527   w1[1] = pws[gid].i[ 5];
528   w1[2] = pws[gid].i[ 6];
529   w1[3] = pws[gid].i[ 7];
530
531   u32 w2[4];
532
533   w2[0] = pws[gid].i[ 8];
534   w2[1] = pws[gid].i[ 9];
535   w2[2] = pws[gid].i[10];
536   w2[3] = pws[gid].i[11];
537
538   u32 w3[4];
539
540   w3[0] = pws[gid].i[12];
541   w3[1] = pws[gid].i[13];
542   w3[2] = 0;
543   w3[3] = 0;
544
545   const u32 pw_len = pws[gid].pw_len;
546
547   /**
548    * main
549    */
550
551   m05000m (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);
552 }
553
554 __kernel void m05000_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)
555 {
556   /**
557    * base
558    */
559
560   const u32 gid = get_global_id (0);
561
562   if (gid >= gid_max) return;
563
564   u32 w0[4];
565
566   w0[0] = pws[gid].i[ 0];
567   w0[1] = pws[gid].i[ 1];
568   w0[2] = pws[gid].i[ 2];
569   w0[3] = pws[gid].i[ 3];
570
571   u32 w1[4];
572
573   w1[0] = 0;
574   w1[1] = 0;
575   w1[2] = 0;
576   w1[3] = 0;
577
578   u32 w2[4];
579
580   w2[0] = 0;
581   w2[1] = 0;
582   w2[2] = 0;
583   w2[3] = 0;
584
585   u32 w3[4];
586
587   w3[0] = 0;
588   w3[1] = 0;
589   w3[2] = 0;
590   w3[3] = 0;
591
592   const u32 pw_len = pws[gid].pw_len;
593
594   /**
595    * main
596    */
597
598   m05000s (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);
599 }
600
601 __kernel void m05000_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)
602 {
603   /**
604    * base
605    */
606
607   const u32 gid = get_global_id (0);
608
609   if (gid >= gid_max) return;
610
611   u32 w0[4];
612
613   w0[0] = pws[gid].i[ 0];
614   w0[1] = pws[gid].i[ 1];
615   w0[2] = pws[gid].i[ 2];
616   w0[3] = pws[gid].i[ 3];
617
618   u32 w1[4];
619
620   w1[0] = pws[gid].i[ 4];
621   w1[1] = pws[gid].i[ 5];
622   w1[2] = pws[gid].i[ 6];
623   w1[3] = pws[gid].i[ 7];
624
625   u32 w2[4];
626
627   w2[0] = 0;
628   w2[1] = 0;
629   w2[2] = 0;
630   w2[3] = 0;
631
632   u32 w3[4];
633
634   w3[0] = 0;
635   w3[1] = 0;
636   w3[2] = 0;
637   w3[3] = 0;
638
639   const u32 pw_len = pws[gid].pw_len;
640
641   /**
642    * main
643    */
644
645   m05000s (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);
646 }
647
648 __kernel void m05000_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)
649 {
650   /**
651    * base
652    */
653
654   const u32 gid = get_global_id (0);
655
656   if (gid >= gid_max) return;
657
658   u32 w0[4];
659
660   w0[0] = pws[gid].i[ 0];
661   w0[1] = pws[gid].i[ 1];
662   w0[2] = pws[gid].i[ 2];
663   w0[3] = pws[gid].i[ 3];
664
665   u32 w1[4];
666
667   w1[0] = pws[gid].i[ 4];
668   w1[1] = pws[gid].i[ 5];
669   w1[2] = pws[gid].i[ 6];
670   w1[3] = pws[gid].i[ 7];
671
672   u32 w2[4];
673
674   w2[0] = pws[gid].i[ 8];
675   w2[1] = pws[gid].i[ 9];
676   w2[2] = pws[gid].i[10];
677   w2[3] = pws[gid].i[11];
678
679   u32 w3[4];
680
681   w3[0] = pws[gid].i[12];
682   w3[1] = pws[gid].i[13];
683   w3[2] = 0;
684   w3[3] = 0;
685
686   const u32 pw_len = pws[gid].pw_len;
687
688   /**
689    * main
690    */
691
692   m05000s (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);
693 }