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