Initial commit
[hashcat.git] / amd / m08000_a3.cl
1 /**
2  * Author......: Jens Steube <jens.steube@gmail.com>
3  * License.....: MIT
4  */
5
6 #define _SHA256_
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_SIZE2
18 #endif
19
20 #ifdef  VLIW5
21 #define VECT_SIZE2
22 #endif
23
24 #define DGST_R0 3
25 #define DGST_R1 7
26 #define DGST_R2 2
27 #define DGST_R3 6
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 u32 k_sha256[64] =
49 {
50   SHA256C00, SHA256C01, SHA256C02, SHA256C03,
51   SHA256C04, SHA256C05, SHA256C06, SHA256C07,
52   SHA256C08, SHA256C09, SHA256C0a, SHA256C0b,
53   SHA256C0c, SHA256C0d, SHA256C0e, SHA256C0f,
54   SHA256C10, SHA256C11, SHA256C12, SHA256C13,
55   SHA256C14, SHA256C15, SHA256C16, SHA256C17,
56   SHA256C18, SHA256C19, SHA256C1a, SHA256C1b,
57   SHA256C1c, SHA256C1d, SHA256C1e, SHA256C1f,
58   SHA256C20, SHA256C21, SHA256C22, SHA256C23,
59   SHA256C24, SHA256C25, SHA256C26, SHA256C27,
60   SHA256C28, SHA256C29, SHA256C2a, SHA256C2b,
61   SHA256C2c, SHA256C2d, SHA256C2e, SHA256C2f,
62   SHA256C30, SHA256C31, SHA256C32, SHA256C33,
63   SHA256C34, SHA256C35, SHA256C36, SHA256C37,
64   SHA256C38, SHA256C39, SHA256C3a, SHA256C3b,
65   SHA256C3c, SHA256C3d, SHA256C3e, SHA256C3f,
66 };
67
68 static void sha256_transform (u32x digest[8], const u32x w[16])
69 {
70   u32x a = digest[0];
71   u32x b = digest[1];
72   u32x c = digest[2];
73   u32x d = digest[3];
74   u32x e = digest[4];
75   u32x f = digest[5];
76   u32x g = digest[6];
77   u32x h = digest[7];
78
79   u32x w0_t = w[ 0];
80   u32x w1_t = w[ 1];
81   u32x w2_t = w[ 2];
82   u32x w3_t = w[ 3];
83   u32x w4_t = w[ 4];
84   u32x w5_t = w[ 5];
85   u32x w6_t = w[ 6];
86   u32x w7_t = w[ 7];
87   u32x w8_t = w[ 8];
88   u32x w9_t = w[ 9];
89   u32x wa_t = w[10];
90   u32x wb_t = w[11];
91   u32x wc_t = w[12];
92   u32x wd_t = w[13];
93   u32x we_t = w[14];
94   u32x wf_t = w[15];
95
96   #define ROUND_EXPAND()                            \
97   {                                                 \
98     w0_t = SHA256_EXPAND (we_t, w9_t, w1_t, w0_t);  \
99     w1_t = SHA256_EXPAND (wf_t, wa_t, w2_t, w1_t);  \
100     w2_t = SHA256_EXPAND (w0_t, wb_t, w3_t, w2_t);  \
101     w3_t = SHA256_EXPAND (w1_t, wc_t, w4_t, w3_t);  \
102     w4_t = SHA256_EXPAND (w2_t, wd_t, w5_t, w4_t);  \
103     w5_t = SHA256_EXPAND (w3_t, we_t, w6_t, w5_t);  \
104     w6_t = SHA256_EXPAND (w4_t, wf_t, w7_t, w6_t);  \
105     w7_t = SHA256_EXPAND (w5_t, w0_t, w8_t, w7_t);  \
106     w8_t = SHA256_EXPAND (w6_t, w1_t, w9_t, w8_t);  \
107     w9_t = SHA256_EXPAND (w7_t, w2_t, wa_t, w9_t);  \
108     wa_t = SHA256_EXPAND (w8_t, w3_t, wb_t, wa_t);  \
109     wb_t = SHA256_EXPAND (w9_t, w4_t, wc_t, wb_t);  \
110     wc_t = SHA256_EXPAND (wa_t, w5_t, wd_t, wc_t);  \
111     wd_t = SHA256_EXPAND (wb_t, w6_t, we_t, wd_t);  \
112     we_t = SHA256_EXPAND (wc_t, w7_t, wf_t, we_t);  \
113     wf_t = SHA256_EXPAND (wd_t, w8_t, w0_t, wf_t);  \
114   }
115
116   #define ROUND_STEP(i)                                                                   \
117   {                                                                                       \
118     SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, k_sha256[i +  0]); \
119     SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, k_sha256[i +  1]); \
120     SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, k_sha256[i +  2]); \
121     SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, k_sha256[i +  3]); \
122     SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, k_sha256[i +  4]); \
123     SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, k_sha256[i +  5]); \
124     SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, k_sha256[i +  6]); \
125     SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, k_sha256[i +  7]); \
126     SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, k_sha256[i +  8]); \
127     SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, k_sha256[i +  9]); \
128     SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, k_sha256[i + 10]); \
129     SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, k_sha256[i + 11]); \
130     SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, k_sha256[i + 12]); \
131     SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, k_sha256[i + 13]); \
132     SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, k_sha256[i + 14]); \
133     SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, k_sha256[i + 15]); \
134   }
135
136   ROUND_STEP (0);
137
138   #pragma unroll
139   for (int i = 16; i < 64; i += 16)
140   {
141     ROUND_EXPAND (); ROUND_STEP (i);
142   }
143
144   digest[0] += a;
145   digest[1] += b;
146   digest[2] += c;
147   digest[3] += d;
148   digest[4] += e;
149   digest[5] += f;
150   digest[6] += g;
151   digest[7] += h;
152 }
153
154 static void m08000m (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)
155 {
156   /**
157    * modifier
158    */
159
160   const u32 gid = get_global_id (0);
161   const u32 lid = get_local_id (0);
162
163   /**
164    * salt
165    */
166
167   const u32 salt_buf0 = swap_workaround (salt_bufs[salt_pos].salt_buf[ 0]);
168   const u32 salt_buf1 = swap_workaround (salt_bufs[salt_pos].salt_buf[ 1]);
169   const u32 salt_buf2 = swap_workaround (salt_bufs[salt_pos].salt_buf[ 2]); // 0x80
170
171   /**
172    * loop
173    */
174
175   const u32 bf_loops = ceil ((float) bfs_cnt / VECT_DIV);
176
177   u32x w0l = w[0];
178
179   for (u32 il_pos = 0; il_pos < bf_loops; il_pos++)
180   {
181     const u32x w0r = words_buf_r[il_pos];
182
183     const u32x w0 = w0l | w0r;
184
185     u32x w_t[16];
186
187     w_t[ 0] = w0    >> 8;
188     w_t[ 1] = w[ 1] >> 8;
189     w_t[ 2] = w[ 2] >> 8;
190     w_t[ 3] = w[ 3] >> 8;
191     w_t[ 4] = w[ 4] >> 8;
192     w_t[ 5] = w[ 5] >> 8;
193     w_t[ 6] = w[ 6] >> 8;
194     w_t[ 7] = w[ 7] >> 8;
195     w_t[ 8] = w[ 8] >> 8;
196     w_t[ 9] = w[ 9] >> 8;
197     w_t[10] = w[10] >> 8;
198     w_t[11] = w[11] >> 8;
199     w_t[12] = w[12] >> 8;
200     w_t[13] = w[13] >> 8;
201     w_t[14] = w[14] >> 8;
202     w_t[15] = w[15] >> 8;
203
204     u32x digest[8];
205
206     digest[0] = SHA256M_A;
207     digest[1] = SHA256M_B;
208     digest[2] = SHA256M_C;
209     digest[3] = SHA256M_D;
210     digest[4] = SHA256M_E;
211     digest[5] = SHA256M_F;
212     digest[6] = SHA256M_G;
213     digest[7] = SHA256M_H;
214
215     sha256_transform (digest, w_t); //   0 - 64
216
217     w_t[ 0] = 0;
218     w_t[ 1] = 0;
219     w_t[ 2] = 0;
220     w_t[ 3] = 0;
221     w_t[ 4] = 0;
222     w_t[ 5] = 0;
223     w_t[ 6] = 0;
224     w_t[ 7] = 0;
225     w_t[ 8] = 0;
226     w_t[ 9] = 0;
227     w_t[10] = 0;
228     w_t[11] = 0;
229     w_t[12] = 0;
230     w_t[13] = 0;
231     w_t[14] = 0;
232     w_t[15] = 0;
233
234     sha256_transform (digest, w_t); //  64 - 128
235     sha256_transform (digest, w_t); // 128 - 192
236     sha256_transform (digest, w_t); // 192 - 256
237     sha256_transform (digest, w_t); // 256 - 320
238     sha256_transform (digest, w_t); // 320 - 384
239     sha256_transform (digest, w_t); // 384 - 448
240
241     w_t[15] =               0 | salt_buf0 >> 16;
242
243     sha256_transform (digest, w_t); // 448 - 512
244
245     w_t[ 0] = salt_buf0 << 16 | salt_buf1 >> 16;
246     w_t[ 1] = salt_buf1 << 16 | salt_buf2 >> 16;
247     w_t[ 2] = salt_buf2 << 16 | 0;
248     w_t[15] = (510 + 8) * 8;
249
250     sha256_transform (digest, w_t); // 512 - 576
251
252     const u32x r0 = digest[3];
253     const u32x r1 = digest[7];
254     const u32x r2 = digest[2];
255     const u32x r3 = digest[6];
256
257     #include VECT_COMPARE_M
258   }
259 }
260
261 static void m08000s (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)
262 {
263   /**
264    * modifier
265    */
266
267   const u32 gid = get_global_id (0);
268   const u32 lid = get_local_id (0);
269
270   /**
271    * digest
272    */
273
274   const u32 search[4] =
275   {
276     digests_buf[digests_offset].digest_buf[DGST_R0],
277     digests_buf[digests_offset].digest_buf[DGST_R1],
278     digests_buf[digests_offset].digest_buf[DGST_R2],
279     digests_buf[digests_offset].digest_buf[DGST_R3]
280   };
281
282   /**
283    * salt
284    */
285
286   const u32 salt_buf0 = swap_workaround (salt_bufs[salt_pos].salt_buf[ 0]);
287   const u32 salt_buf1 = swap_workaround (salt_bufs[salt_pos].salt_buf[ 1]);
288   const u32 salt_buf2 = swap_workaround (salt_bufs[salt_pos].salt_buf[ 2]); // 0x80
289
290   /**
291    * loop
292    */
293
294   const u32 bf_loops = ceil ((float) bfs_cnt / VECT_DIV);
295
296   u32x w0l = w[0];
297
298   for (u32 il_pos = 0; il_pos < bf_loops; il_pos++)
299   {
300     const u32x w0r = words_buf_r[il_pos];
301
302     const u32x w0 = w0l | w0r;
303
304     u32x w_t[16];
305
306     w_t[ 0] = w0    >> 8;
307     w_t[ 1] = w[ 1] >> 8;
308     w_t[ 2] = w[ 2] >> 8;
309     w_t[ 3] = w[ 3] >> 8;
310     w_t[ 4] = w[ 4] >> 8;
311     w_t[ 5] = w[ 5] >> 8;
312     w_t[ 6] = w[ 6] >> 8;
313     w_t[ 7] = w[ 7] >> 8;
314     w_t[ 8] = w[ 8] >> 8;
315     w_t[ 9] = w[ 9] >> 8;
316     w_t[10] = w[10] >> 8;
317     w_t[11] = w[11] >> 8;
318     w_t[12] = w[12] >> 8;
319     w_t[13] = w[13] >> 8;
320     w_t[14] = w[14] >> 8;
321     w_t[15] = w[15] >> 8;
322
323     u32x digest[8];
324
325     digest[0] = SHA256M_A;
326     digest[1] = SHA256M_B;
327     digest[2] = SHA256M_C;
328     digest[3] = SHA256M_D;
329     digest[4] = SHA256M_E;
330     digest[5] = SHA256M_F;
331     digest[6] = SHA256M_G;
332     digest[7] = SHA256M_H;
333
334     sha256_transform (digest, w_t); //   0 - 64
335
336     w_t[ 0] = 0;
337     w_t[ 1] = 0;
338     w_t[ 2] = 0;
339     w_t[ 3] = 0;
340     w_t[ 4] = 0;
341     w_t[ 5] = 0;
342     w_t[ 6] = 0;
343     w_t[ 7] = 0;
344     w_t[ 8] = 0;
345     w_t[ 9] = 0;
346     w_t[10] = 0;
347     w_t[11] = 0;
348     w_t[12] = 0;
349     w_t[13] = 0;
350     w_t[14] = 0;
351     w_t[15] = 0;
352
353     sha256_transform (digest, w_t); //  64 - 128
354     sha256_transform (digest, w_t); // 128 - 192
355     sha256_transform (digest, w_t); // 192 - 256
356     sha256_transform (digest, w_t); // 256 - 320
357     sha256_transform (digest, w_t); // 320 - 384
358     sha256_transform (digest, w_t); // 384 - 448
359
360     w_t[15] =               0 | salt_buf0 >> 16;
361
362     sha256_transform (digest, w_t); // 448 - 512
363
364     w_t[ 0] = salt_buf0 << 16 | salt_buf1 >> 16;
365     w_t[ 1] = salt_buf1 << 16 | salt_buf2 >> 16;
366     w_t[ 2] = salt_buf2 << 16 | 0;
367     w_t[15] = (510 + 8) * 8;
368
369     sha256_transform (digest, w_t); // 512 - 576
370
371     const u32x r0 = digest[3];
372     const u32x r1 = digest[7];
373     const u32x r2 = digest[2];
374     const u32x r3 = digest[6];
375
376     #include VECT_COMPARE_S
377   }
378 }
379
380 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m08000_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)
381 {
382   /**
383    * base
384    */
385
386   const u32 gid = get_global_id (0);
387
388   if (gid >= gid_max) return;
389
390   u32 w[16];
391
392   w[ 0] = pws[gid].i[ 0];
393   w[ 1] = pws[gid].i[ 1];
394   w[ 2] = pws[gid].i[ 2];
395   w[ 3] = pws[gid].i[ 3];
396   w[ 4] = 0;
397   w[ 5] = 0;
398   w[ 6] = 0;
399   w[ 7] = 0;
400   w[ 8] = 0;
401   w[ 9] = 0;
402   w[10] = 0;
403   w[11] = 0;
404   w[12] = 0;
405   w[13] = 0;
406   w[14] = 0;
407   w[15] = 0;
408
409   const u32 pw_len = pws[gid].pw_len;
410
411   /**
412    * main
413    */
414
415   m08000m (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);
416 }
417
418 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m08000_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)
419 {
420   /**
421    * base
422    */
423
424   const u32 gid = get_global_id (0);
425
426   if (gid >= gid_max) return;
427
428   u32 w[16];
429
430   w[ 0] = pws[gid].i[ 0];
431   w[ 1] = pws[gid].i[ 1];
432   w[ 2] = pws[gid].i[ 2];
433   w[ 3] = pws[gid].i[ 3];
434   w[ 4] = pws[gid].i[ 4];
435   w[ 5] = pws[gid].i[ 5];
436   w[ 6] = pws[gid].i[ 6];
437   w[ 7] = pws[gid].i[ 7];
438   w[ 8] = 0;
439   w[ 9] = 0;
440   w[10] = 0;
441   w[11] = 0;
442   w[12] = 0;
443   w[13] = 0;
444   w[14] = 0;
445   w[15] = 0;
446
447   const u32 pw_len = pws[gid].pw_len;
448
449   /**
450    * main
451    */
452
453   m08000m (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);
454 }
455
456 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m08000_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)
457 {
458   /**
459    * base
460    */
461
462   const u32 gid = get_global_id (0);
463
464   if (gid >= gid_max) return;
465
466   u32 w[16];
467
468   w[ 0] = pws[gid].i[ 0];
469   w[ 1] = pws[gid].i[ 1];
470   w[ 2] = pws[gid].i[ 2];
471   w[ 3] = pws[gid].i[ 3];
472   w[ 4] = pws[gid].i[ 4];
473   w[ 5] = pws[gid].i[ 5];
474   w[ 6] = pws[gid].i[ 6];
475   w[ 7] = pws[gid].i[ 7];
476   w[ 8] = pws[gid].i[ 8];
477   w[ 9] = pws[gid].i[ 9];
478   w[10] = pws[gid].i[10];
479   w[11] = pws[gid].i[11];
480   w[12] = pws[gid].i[12];
481   w[13] = pws[gid].i[13];
482   w[14] = pws[gid].i[14];
483   w[15] = pws[gid].i[15];
484
485   const u32 pw_len = pws[gid].pw_len;
486
487   /**
488    * main
489    */
490
491   m08000m (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);
492 }
493
494 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m08000_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)
495 {
496   /**
497    * base
498    */
499
500   const u32 gid = get_global_id (0);
501
502   if (gid >= gid_max) return;
503
504   u32 w[16];
505
506   w[ 0] = pws[gid].i[ 0];
507   w[ 1] = pws[gid].i[ 1];
508   w[ 2] = pws[gid].i[ 2];
509   w[ 3] = pws[gid].i[ 3];
510   w[ 4] = 0;
511   w[ 5] = 0;
512   w[ 6] = 0;
513   w[ 7] = 0;
514   w[ 8] = 0;
515   w[ 9] = 0;
516   w[10] = 0;
517   w[11] = 0;
518   w[12] = 0;
519   w[13] = 0;
520   w[14] = 0;
521   w[15] = 0;
522
523   const u32 pw_len = pws[gid].pw_len;
524
525   /**
526    * main
527    */
528
529   m08000s (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);
530 }
531
532 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m08000_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)
533 {
534   /**
535    * base
536    */
537
538   const u32 gid = get_global_id (0);
539
540   if (gid >= gid_max) return;
541
542   u32 w[16];
543
544   w[ 0] = pws[gid].i[ 0];
545   w[ 1] = pws[gid].i[ 1];
546   w[ 2] = pws[gid].i[ 2];
547   w[ 3] = pws[gid].i[ 3];
548   w[ 4] = pws[gid].i[ 4];
549   w[ 5] = pws[gid].i[ 5];
550   w[ 6] = pws[gid].i[ 6];
551   w[ 7] = pws[gid].i[ 7];
552   w[ 8] = 0;
553   w[ 9] = 0;
554   w[10] = 0;
555   w[11] = 0;
556   w[12] = 0;
557   w[13] = 0;
558   w[14] = 0;
559   w[15] = 0;
560
561   const u32 pw_len = pws[gid].pw_len;
562
563   /**
564    * main
565    */
566
567   m08000s (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);
568 }
569
570 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m08000_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)
571 {
572   /**
573    * base
574    */
575
576   const u32 gid = get_global_id (0);
577
578   if (gid >= gid_max) return;
579
580   u32 w[16];
581
582   w[ 0] = pws[gid].i[ 0];
583   w[ 1] = pws[gid].i[ 1];
584   w[ 2] = pws[gid].i[ 2];
585   w[ 3] = pws[gid].i[ 3];
586   w[ 4] = pws[gid].i[ 4];
587   w[ 5] = pws[gid].i[ 5];
588   w[ 6] = pws[gid].i[ 6];
589   w[ 7] = pws[gid].i[ 7];
590   w[ 8] = pws[gid].i[ 8];
591   w[ 9] = pws[gid].i[ 9];
592   w[10] = pws[gid].i[10];
593   w[11] = pws[gid].i[11];
594   w[12] = pws[gid].i[12];
595   w[13] = pws[gid].i[13];
596   w[14] = pws[gid].i[14];
597   w[15] = pws[gid].i[15];
598
599   const u32 pw_len = pws[gid].pw_len;
600
601   /**
602    * main
603    */
604
605   m08000s (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);
606 }