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