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