Initial commit
[hashcat.git] / amd / m01710_a3.cl
1 /**
2  * Author......: Jens Steube <jens.steube@gmail.com>
3  * License.....: MIT
4  */
5
6 #define _SHA512_
7 #define _SCALAR_
8
9 #include "include/constants.h"
10 #include "include/kernel_vendor.h"
11
12 #ifdef  VLIW1
13 #define VECT_SIZE1
14 #endif
15
16 #ifdef  VLIW4
17 #define VECT_SIZE1
18 #endif
19
20 #ifdef  VLIW5
21 #define VECT_SIZE1
22 #endif
23
24 #define DGST_R0 14
25 #define DGST_R1 15
26 #define DGST_R2 6
27 #define DGST_R3 7
28
29 #include "include/kernel_functions.c"
30 #include "types_amd.c"
31 #include "common_amd.c"
32
33 #ifdef  VECT_SIZE1
34 #define VECT_COMPARE_S "check_single_vect1_comp4_warp.c"
35 #define VECT_COMPARE_M "check_multi_vect1_comp4_warp.c"
36 #endif
37
38 #ifdef  VECT_SIZE2
39 #define VECT_COMPARE_S "check_single_vect2_comp4_warp.c"
40 #define VECT_COMPARE_M "check_multi_vect2_comp4_warp.c"
41 #endif
42
43 #ifdef  VECT_SIZE4
44 #define VECT_COMPARE_S "check_single_vect4_comp4_warp.c"
45 #define VECT_COMPARE_M "check_multi_vect4_comp4_warp.c"
46 #endif
47
48 __constant u64 k_sha512[80] =
49 {
50   SHA512C00, SHA512C01, SHA512C02, SHA512C03,
51   SHA512C04, SHA512C05, SHA512C06, SHA512C07,
52   SHA512C08, SHA512C09, SHA512C0a, SHA512C0b,
53   SHA512C0c, SHA512C0d, SHA512C0e, SHA512C0f,
54   SHA512C10, SHA512C11, SHA512C12, SHA512C13,
55   SHA512C14, SHA512C15, SHA512C16, SHA512C17,
56   SHA512C18, SHA512C19, SHA512C1a, SHA512C1b,
57   SHA512C1c, SHA512C1d, SHA512C1e, SHA512C1f,
58   SHA512C20, SHA512C21, SHA512C22, SHA512C23,
59   SHA512C24, SHA512C25, SHA512C26, SHA512C27,
60   SHA512C28, SHA512C29, SHA512C2a, SHA512C2b,
61   SHA512C2c, SHA512C2d, SHA512C2e, SHA512C2f,
62   SHA512C30, SHA512C31, SHA512C32, SHA512C33,
63   SHA512C34, SHA512C35, SHA512C36, SHA512C37,
64   SHA512C38, SHA512C39, SHA512C3a, SHA512C3b,
65   SHA512C3c, SHA512C3d, SHA512C3e, SHA512C3f,
66   SHA512C40, SHA512C41, SHA512C42, SHA512C43,
67   SHA512C44, SHA512C45, SHA512C46, SHA512C47,
68   SHA512C48, SHA512C49, SHA512C4a, SHA512C4b,
69   SHA512C4c, SHA512C4d, SHA512C4e, SHA512C4f,
70 };
71
72 static void sha512_transform (const u32x w0[4], const u32x w1[4], const u32x w2[4], const u32x w3[4], u64x digest[8])
73 {
74   u64x w0_t = hl32_to_64 (w0[0], w0[1]);
75   u64x w1_t = hl32_to_64 (w0[2], w0[3]);
76   u64x w2_t = hl32_to_64 (w1[0], w1[1]);
77   u64x w3_t = hl32_to_64 (w1[2], w1[3]);
78   u64x w4_t = hl32_to_64 (w2[0], w2[1]);
79   u64x w5_t = hl32_to_64 (w2[2], w2[3]);
80   u64x w6_t = hl32_to_64 (w3[0], w3[1]);
81   u64x w7_t = 0;
82   u64x w8_t = 0;
83   u64x w9_t = 0;
84   u64x wa_t = 0;
85   u64x wb_t = 0;
86   u64x wc_t = 0;
87   u64x wd_t = 0;
88   u64x we_t = 0;
89   u64x wf_t = hl32_to_64 (w3[2], w3[3]);
90
91   u64x a = digest[0];
92   u64x b = digest[1];
93   u64x c = digest[2];
94   u64x d = digest[3];
95   u64x e = digest[4];
96   u64x f = digest[5];
97   u64x g = digest[6];
98   u64x h = digest[7];
99
100   #define ROUND_EXPAND()                            \
101   {                                                 \
102     w0_t = SHA512_EXPAND (we_t, w9_t, w1_t, w0_t);  \
103     w1_t = SHA512_EXPAND (wf_t, wa_t, w2_t, w1_t);  \
104     w2_t = SHA512_EXPAND (w0_t, wb_t, w3_t, w2_t);  \
105     w3_t = SHA512_EXPAND (w1_t, wc_t, w4_t, w3_t);  \
106     w4_t = SHA512_EXPAND (w2_t, wd_t, w5_t, w4_t);  \
107     w5_t = SHA512_EXPAND (w3_t, we_t, w6_t, w5_t);  \
108     w6_t = SHA512_EXPAND (w4_t, wf_t, w7_t, w6_t);  \
109     w7_t = SHA512_EXPAND (w5_t, w0_t, w8_t, w7_t);  \
110     w8_t = SHA512_EXPAND (w6_t, w1_t, w9_t, w8_t);  \
111     w9_t = SHA512_EXPAND (w7_t, w2_t, wa_t, w9_t);  \
112     wa_t = SHA512_EXPAND (w8_t, w3_t, wb_t, wa_t);  \
113     wb_t = SHA512_EXPAND (w9_t, w4_t, wc_t, wb_t);  \
114     wc_t = SHA512_EXPAND (wa_t, w5_t, wd_t, wc_t);  \
115     wd_t = SHA512_EXPAND (wb_t, w6_t, we_t, wd_t);  \
116     we_t = SHA512_EXPAND (wc_t, w7_t, wf_t, we_t);  \
117     wf_t = SHA512_EXPAND (wd_t, w8_t, w0_t, wf_t);  \
118   }
119
120   #define ROUND_STEP(i)                                                                   \
121   {                                                                                       \
122     SHA512_STEP (SHA512_F0o, SHA512_F1o, a, b, c, d, e, f, g, h, w0_t, k_sha512[i +  0]); \
123     SHA512_STEP (SHA512_F0o, SHA512_F1o, h, a, b, c, d, e, f, g, w1_t, k_sha512[i +  1]); \
124     SHA512_STEP (SHA512_F0o, SHA512_F1o, g, h, a, b, c, d, e, f, w2_t, k_sha512[i +  2]); \
125     SHA512_STEP (SHA512_F0o, SHA512_F1o, f, g, h, a, b, c, d, e, w3_t, k_sha512[i +  3]); \
126     SHA512_STEP (SHA512_F0o, SHA512_F1o, e, f, g, h, a, b, c, d, w4_t, k_sha512[i +  4]); \
127     SHA512_STEP (SHA512_F0o, SHA512_F1o, d, e, f, g, h, a, b, c, w5_t, k_sha512[i +  5]); \
128     SHA512_STEP (SHA512_F0o, SHA512_F1o, c, d, e, f, g, h, a, b, w6_t, k_sha512[i +  6]); \
129     SHA512_STEP (SHA512_F0o, SHA512_F1o, b, c, d, e, f, g, h, a, w7_t, k_sha512[i +  7]); \
130     SHA512_STEP (SHA512_F0o, SHA512_F1o, a, b, c, d, e, f, g, h, w8_t, k_sha512[i +  8]); \
131     SHA512_STEP (SHA512_F0o, SHA512_F1o, h, a, b, c, d, e, f, g, w9_t, k_sha512[i +  9]); \
132     SHA512_STEP (SHA512_F0o, SHA512_F1o, g, h, a, b, c, d, e, f, wa_t, k_sha512[i + 10]); \
133     SHA512_STEP (SHA512_F0o, SHA512_F1o, f, g, h, a, b, c, d, e, wb_t, k_sha512[i + 11]); \
134     SHA512_STEP (SHA512_F0o, SHA512_F1o, e, f, g, h, a, b, c, d, wc_t, k_sha512[i + 12]); \
135     SHA512_STEP (SHA512_F0o, SHA512_F1o, d, e, f, g, h, a, b, c, wd_t, k_sha512[i + 13]); \
136     SHA512_STEP (SHA512_F0o, SHA512_F1o, c, d, e, f, g, h, a, b, we_t, k_sha512[i + 14]); \
137     SHA512_STEP (SHA512_F0o, SHA512_F1o, b, c, d, e, f, g, h, a, wf_t, k_sha512[i + 15]); \
138   }
139
140   ROUND_STEP (0);
141
142   #pragma unroll
143   for (int i = 16; i < 80; i += 16)
144   {
145     ROUND_EXPAND (); ROUND_STEP (i);
146   }
147
148   /* rev
149   digest[0] += a;
150   digest[1] += b;
151   digest[2] += c;
152   digest[3] += d;
153   digest[4] += e;
154   digest[5] += f;
155   digest[6] += g;
156   digest[7] += h;
157   */
158
159   digest[0] = a;
160   digest[1] = b;
161   digest[2] = c;
162   digest[3] = d;
163   digest[4] = e;
164   digest[5] = f;
165   digest[6] = g;
166   digest[7] = h;
167 }
168
169 static void m01710m (u32 w[16], const u32 pw_len, __global pw_t *pws, __global gpu_rule_t *rules_buf, __global comb_t *combs_buf, __global u32x * words_buf_r, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 bfs_cnt, const u32 digests_cnt, const u32 digests_offset)
170 {
171   /**
172    * modifier
173    */
174
175   const u32 gid = get_global_id (0);
176   const u32 lid = get_local_id (0);
177
178   /**
179    * salt
180    */
181
182   u32 salt_buf0[4];
183
184   salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
185   salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
186   salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
187   salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
188
189   u32 salt_buf1[4];
190
191   salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
192   salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
193   salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
194   salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
195
196   u32 salt_buf2[4];
197
198   salt_buf2[0] = salt_bufs[salt_pos].salt_buf[ 8];
199   salt_buf2[1] = 0;
200   salt_buf2[2] = 0;
201   salt_buf2[3] = 0;
202
203   u32 salt_buf3[4];
204
205   salt_buf3[0] = 0;
206   salt_buf3[1] = 0;
207   salt_buf3[2] = 0;
208   salt_buf3[3] = 0;
209
210   switch_buffer_by_offset (salt_buf0, salt_buf1, salt_buf2, salt_buf3, pw_len);
211
212   w[ 0] |= swap_workaround (salt_buf0[0]);
213   w[ 1] |= swap_workaround (salt_buf0[1]);
214   w[ 2] |= swap_workaround (salt_buf0[2]);
215   w[ 3] |= swap_workaround (salt_buf0[3]);
216   w[ 4] |= swap_workaround (salt_buf1[0]);
217   w[ 5] |= swap_workaround (salt_buf1[1]);
218   w[ 6] |= swap_workaround (salt_buf1[2]);
219   w[ 7] |= swap_workaround (salt_buf1[3]);
220   w[ 8] |= swap_workaround (salt_buf2[0]);
221   w[ 9] |= swap_workaround (salt_buf2[1]);
222   w[10] |= swap_workaround (salt_buf2[2]);
223   w[11] |= swap_workaround (salt_buf2[3]);
224   w[12] |= swap_workaround (salt_buf3[0]);
225   w[13] |= swap_workaround (salt_buf3[1]);
226   w[14] |= swap_workaround (salt_buf3[2]);
227   w[15] |= swap_workaround (salt_buf3[3]);
228
229   const u32 salt_len = salt_bufs[salt_pos].salt_len;
230
231   const u32 pw_salt_len = pw_len + salt_len;
232
233   w[15] = pw_salt_len * 8;
234
235  /**
236    * loop
237    */
238
239   const u32 bf_loops = ceil ((float) bfs_cnt / VECT_DIV);
240
241   u32x w0l = w[0];
242
243   for (u32 il_pos = 0; il_pos < bf_loops; il_pos++)
244   {
245     const u32x w0r = words_buf_r[il_pos];
246
247     const u32x w0 = w0l | w0r;
248
249     u32x w0_t[4];
250     u32x w1_t[4];
251     u32x w2_t[4];
252     u32x w3_t[4];
253
254     w0_t[0] = w0;
255     w0_t[1] = w[ 1];
256     w0_t[2] = w[ 2];
257     w0_t[3] = w[ 3];
258     w1_t[0] = w[ 4];
259     w1_t[1] = w[ 5];
260     w1_t[2] = w[ 6];
261     w1_t[3] = w[ 7];
262     w2_t[0] = w[ 8];
263     w2_t[1] = w[ 9];
264     w2_t[2] = w[10];
265     w2_t[3] = w[11];
266     w3_t[0] = w[12];
267     w3_t[1] = w[13];
268     w3_t[2] = w[14];
269     w3_t[3] = w[15];
270
271     u64x digest[8];
272
273     digest[0] = SHA512M_A;
274     digest[1] = SHA512M_B;
275     digest[2] = SHA512M_C;
276     digest[3] = SHA512M_D;
277     digest[4] = SHA512M_E;
278     digest[5] = SHA512M_F;
279     digest[6] = SHA512M_G;
280     digest[7] = SHA512M_H;
281
282     sha512_transform (w0_t, w1_t, w2_t, w3_t, digest);
283
284
285     const u32x r0 = l32_from_64 (digest[7]);
286     const u32x r1 = h32_from_64 (digest[7]);
287     const u32x r2 = l32_from_64 (digest[3]);
288     const u32x r3 = h32_from_64 (digest[3]);
289
290     #include VECT_COMPARE_M
291   }
292 }
293
294 static void m01710s (u32 w[16], const u32 pw_len, __global pw_t *pws, __global gpu_rule_t *rules_buf, __global comb_t *combs_buf, __global u32x * words_buf_r, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 bfs_cnt, const u32 digests_cnt, const u32 digests_offset)
295 {
296   /**
297    * modifier
298    */
299
300   const u32 gid = get_global_id (0);
301   const u32 lid = get_local_id (0);
302
303   /**
304    * digest
305    */
306
307   const u32 search[4] =
308   {
309     digests_buf[digests_offset].digest_buf[DGST_R0],
310     digests_buf[digests_offset].digest_buf[DGST_R1],
311     digests_buf[digests_offset].digest_buf[DGST_R2],
312     digests_buf[digests_offset].digest_buf[DGST_R3]
313   };
314
315   /**
316    * loop
317    */
318
319   const u32 bf_loops = ceil ((float) bfs_cnt / VECT_DIV);
320
321   u32x w0l = w[0];
322
323   for (u32 il_pos = 0; il_pos < bf_loops; il_pos++)
324   {
325     const u32x w0r = words_buf_r[il_pos];
326
327     const u32x w0 = w0l | w0r;
328
329     u32x w0_t[4];
330     u32x w1_t[4];
331     u32x w2_t[4];
332     u32x w3_t[4];
333
334     w0_t[0] = w0;
335     w0_t[1] = w[ 1];
336     w0_t[2] = w[ 2];
337     w0_t[3] = w[ 3];
338     w1_t[0] = w[ 4];
339     w1_t[1] = w[ 5];
340     w1_t[2] = w[ 6];
341     w1_t[3] = w[ 7];
342     w2_t[0] = w[ 8];
343     w2_t[1] = w[ 9];
344     w2_t[2] = w[10];
345     w2_t[3] = w[11];
346     w3_t[0] = w[12];
347     w3_t[1] = w[13];
348     w3_t[2] = w[14];
349     w3_t[3] = w[15];
350
351     u64x digest[8];
352
353     digest[0] = SHA512M_A;
354     digest[1] = SHA512M_B;
355     digest[2] = SHA512M_C;
356     digest[3] = SHA512M_D;
357     digest[4] = SHA512M_E;
358     digest[5] = SHA512M_F;
359     digest[6] = SHA512M_G;
360     digest[7] = SHA512M_H;
361
362     sha512_transform (w0_t, w1_t, w2_t, w3_t, digest);
363
364
365     const u32x r0 = l32_from_64 (digest[7]);
366     const u32x r1 = h32_from_64 (digest[7]);
367     const u32x r2 = l32_from_64 (digest[3]);
368     const u32x r3 = h32_from_64 (digest[3]);
369
370     #include VECT_COMPARE_S
371   }
372 }
373
374 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m01710_m04 (__global pw_t *pws, __global gpu_rule_t *rules_buf, __global comb_t *combs_buf, __global u32x * words_buf_r, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
375 {
376   /**
377    * base
378    */
379
380   const u32 gid = get_global_id (0);
381
382   if (gid >= gid_max) return;
383
384   u32 w[16];
385
386   w[ 0] = pws[gid].i[ 0];
387   w[ 1] = pws[gid].i[ 1];
388   w[ 2] = pws[gid].i[ 2];
389   w[ 3] = pws[gid].i[ 3];
390   w[ 4] = 0;
391   w[ 5] = 0;
392   w[ 6] = 0;
393   w[ 7] = 0;
394   w[ 8] = 0;
395   w[ 9] = 0;
396   w[10] = 0;
397   w[11] = 0;
398   w[12] = 0;
399   w[13] = 0;
400   w[14] = 0;
401   w[15] = pws[gid].i[15];
402
403   const u32 pw_len = pws[gid].pw_len;
404
405   /**
406    * main
407    */
408
409   m01710m (w, pw_len, pws, rules_buf, combs_buf, words_buf_r, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, bfs_cnt, digests_cnt, digests_offset);
410 }
411
412 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m01710_m08 (__global pw_t *pws, __global gpu_rule_t *rules_buf, __global comb_t *combs_buf, __global u32x * words_buf_r, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
413 {
414   /**
415    * base
416    */
417
418   const u32 gid = get_global_id (0);
419
420   if (gid >= gid_max) return;
421
422   u32 w[16];
423
424   w[ 0] = pws[gid].i[ 0];
425   w[ 1] = pws[gid].i[ 1];
426   w[ 2] = pws[gid].i[ 2];
427   w[ 3] = pws[gid].i[ 3];
428   w[ 4] = pws[gid].i[ 4];
429   w[ 5] = pws[gid].i[ 5];
430   w[ 6] = pws[gid].i[ 6];
431   w[ 7] = pws[gid].i[ 7];
432   w[ 8] = 0;
433   w[ 9] = 0;
434   w[10] = 0;
435   w[11] = 0;
436   w[12] = 0;
437   w[13] = 0;
438   w[14] = 0;
439   w[15] = pws[gid].i[15];
440
441   const u32 pw_len = pws[gid].pw_len;
442
443   /**
444    * main
445    */
446
447   m01710m (w, pw_len, pws, rules_buf, combs_buf, words_buf_r, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, bfs_cnt, digests_cnt, digests_offset);
448 }
449
450 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m01710_m16 (__global pw_t *pws, __global gpu_rule_t *rules_buf, __global comb_t *combs_buf, __global u32x * words_buf_r, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
451 {
452   /**
453    * base
454    */
455
456   const u32 gid = get_global_id (0);
457
458   if (gid >= gid_max) return;
459
460   u32 w[16];
461
462   w[ 0] = pws[gid].i[ 0];
463   w[ 1] = pws[gid].i[ 1];
464   w[ 2] = pws[gid].i[ 2];
465   w[ 3] = pws[gid].i[ 3];
466   w[ 4] = pws[gid].i[ 4];
467   w[ 5] = pws[gid].i[ 5];
468   w[ 6] = pws[gid].i[ 6];
469   w[ 7] = pws[gid].i[ 7];
470   w[ 8] = pws[gid].i[ 8];
471   w[ 9] = pws[gid].i[ 9];
472   w[10] = pws[gid].i[10];
473   w[11] = pws[gid].i[11];
474   w[12] = pws[gid].i[12];
475   w[13] = pws[gid].i[13];
476   w[14] = pws[gid].i[14];
477   w[15] = pws[gid].i[15];
478
479   const u32 pw_len = pws[gid].pw_len;
480
481   /**
482    * main
483    */
484
485   m01710m (w, pw_len, pws, rules_buf, combs_buf, words_buf_r, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, bfs_cnt, digests_cnt, digests_offset);
486 }
487
488 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m01710_s04 (__global pw_t *pws, __global gpu_rule_t *rules_buf, __global comb_t *combs_buf, __global u32x * words_buf_r, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
489 {
490   /**
491    * base
492    */
493
494   const u32 gid = get_global_id (0);
495
496   if (gid >= gid_max) return;
497
498   u32 w[16];
499
500   w[ 0] = pws[gid].i[ 0];
501   w[ 1] = pws[gid].i[ 1];
502   w[ 2] = pws[gid].i[ 2];
503   w[ 3] = pws[gid].i[ 3];
504   w[ 4] = 0;
505   w[ 5] = 0;
506   w[ 6] = 0;
507   w[ 7] = 0;
508   w[ 8] = 0;
509   w[ 9] = 0;
510   w[10] = 0;
511   w[11] = 0;
512   w[12] = 0;
513   w[13] = 0;
514   w[14] = 0;
515   w[15] = pws[gid].i[15];
516
517   const u32 pw_len = pws[gid].pw_len;
518
519   /**
520    * main
521    */
522
523   m01710s (w, pw_len, pws, rules_buf, combs_buf, words_buf_r, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, bfs_cnt, digests_cnt, digests_offset);
524 }
525
526 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m01710_s08 (__global pw_t *pws, __global gpu_rule_t *rules_buf, __global comb_t *combs_buf, __global u32x * words_buf_r, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
527 {
528   /**
529    * base
530    */
531
532   const u32 gid = get_global_id (0);
533
534   if (gid >= gid_max) return;
535
536   u32 w[16];
537
538   w[ 0] = pws[gid].i[ 0];
539   w[ 1] = pws[gid].i[ 1];
540   w[ 2] = pws[gid].i[ 2];
541   w[ 3] = pws[gid].i[ 3];
542   w[ 4] = pws[gid].i[ 4];
543   w[ 5] = pws[gid].i[ 5];
544   w[ 6] = pws[gid].i[ 6];
545   w[ 7] = pws[gid].i[ 7];
546   w[ 8] = 0;
547   w[ 9] = 0;
548   w[10] = 0;
549   w[11] = 0;
550   w[12] = 0;
551   w[13] = 0;
552   w[14] = 0;
553   w[15] = pws[gid].i[15];
554
555   const u32 pw_len = pws[gid].pw_len;
556
557   /**
558    * main
559    */
560
561   m01710s (w, pw_len, pws, rules_buf, combs_buf, words_buf_r, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, bfs_cnt, digests_cnt, digests_offset);
562 }
563
564 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m01710_s16 (__global pw_t *pws, __global gpu_rule_t *rules_buf, __global comb_t *combs_buf, __global u32x * words_buf_r, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
565 {
566   /**
567    * base
568    */
569
570   const u32 gid = get_global_id (0);
571
572   if (gid >= gid_max) return;
573
574   u32 w[16];
575
576   w[ 0] = pws[gid].i[ 0];
577   w[ 1] = pws[gid].i[ 1];
578   w[ 2] = pws[gid].i[ 2];
579   w[ 3] = pws[gid].i[ 3];
580   w[ 4] = pws[gid].i[ 4];
581   w[ 5] = pws[gid].i[ 5];
582   w[ 6] = pws[gid].i[ 6];
583   w[ 7] = pws[gid].i[ 7];
584   w[ 8] = pws[gid].i[ 8];
585   w[ 9] = pws[gid].i[ 9];
586   w[10] = pws[gid].i[10];
587   w[11] = pws[gid].i[11];
588   w[12] = pws[gid].i[12];
589   w[13] = pws[gid].i[13];
590   w[14] = pws[gid].i[14];
591   w[15] = pws[gid].i[15];
592
593   const u32 pw_len = pws[gid].pw_len;
594
595   /**
596    * main
597    */
598
599   m01710s (w, pw_len, pws, rules_buf, combs_buf, words_buf_r, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, bfs_cnt, digests_cnt, digests_offset);
600 }