Fix m 60 a 0 by making modified variable non-const
[hashcat.git] / OpenCL / m01450_a0.cl
1 /**
2  * Author......: Jens Steube <jens.steube@gmail.com>
3  * License.....: MIT
4  */
5
6 #define _SHA256_
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_rp.h"
16 #include "inc_rp.cl"
17 #include "inc_simd.cl"
18
19 __constant u32 k_sha256[64] =
20 {
21   SHA256C00, SHA256C01, SHA256C02, SHA256C03,
22   SHA256C04, SHA256C05, SHA256C06, SHA256C07,
23   SHA256C08, SHA256C09, SHA256C0a, SHA256C0b,
24   SHA256C0c, SHA256C0d, SHA256C0e, SHA256C0f,
25   SHA256C10, SHA256C11, SHA256C12, SHA256C13,
26   SHA256C14, SHA256C15, SHA256C16, SHA256C17,
27   SHA256C18, SHA256C19, SHA256C1a, SHA256C1b,
28   SHA256C1c, SHA256C1d, SHA256C1e, SHA256C1f,
29   SHA256C20, SHA256C21, SHA256C22, SHA256C23,
30   SHA256C24, SHA256C25, SHA256C26, SHA256C27,
31   SHA256C28, SHA256C29, SHA256C2a, SHA256C2b,
32   SHA256C2c, SHA256C2d, SHA256C2e, SHA256C2f,
33   SHA256C30, SHA256C31, SHA256C32, SHA256C33,
34   SHA256C34, SHA256C35, SHA256C36, SHA256C37,
35   SHA256C38, SHA256C39, SHA256C3a, SHA256C3b,
36   SHA256C3c, SHA256C3d, SHA256C3e, SHA256C3f,
37 };
38
39 void sha256_transform (const u32x w0[4], const u32x w1[4], const u32x w2[4], const u32x w3[4], u32x digest[8])
40 {
41   u32x a = digest[0];
42   u32x b = digest[1];
43   u32x c = digest[2];
44   u32x d = digest[3];
45   u32x e = digest[4];
46   u32x f = digest[5];
47   u32x g = digest[6];
48   u32x h = digest[7];
49
50   u32x w0_t = w0[0];
51   u32x w1_t = w0[1];
52   u32x w2_t = w0[2];
53   u32x w3_t = w0[3];
54   u32x w4_t = w1[0];
55   u32x w5_t = w1[1];
56   u32x w6_t = w1[2];
57   u32x w7_t = w1[3];
58   u32x w8_t = w2[0];
59   u32x w9_t = w2[1];
60   u32x wa_t = w2[2];
61   u32x wb_t = w2[3];
62   u32x wc_t = w3[0];
63   u32x wd_t = w3[1];
64   u32x we_t = w3[2];
65   u32x wf_t = w3[3];
66
67   #define ROUND_EXPAND()                            \
68   {                                                 \
69     w0_t = SHA256_EXPAND (we_t, w9_t, w1_t, w0_t);  \
70     w1_t = SHA256_EXPAND (wf_t, wa_t, w2_t, w1_t);  \
71     w2_t = SHA256_EXPAND (w0_t, wb_t, w3_t, w2_t);  \
72     w3_t = SHA256_EXPAND (w1_t, wc_t, w4_t, w3_t);  \
73     w4_t = SHA256_EXPAND (w2_t, wd_t, w5_t, w4_t);  \
74     w5_t = SHA256_EXPAND (w3_t, we_t, w6_t, w5_t);  \
75     w6_t = SHA256_EXPAND (w4_t, wf_t, w7_t, w6_t);  \
76     w7_t = SHA256_EXPAND (w5_t, w0_t, w8_t, w7_t);  \
77     w8_t = SHA256_EXPAND (w6_t, w1_t, w9_t, w8_t);  \
78     w9_t = SHA256_EXPAND (w7_t, w2_t, wa_t, w9_t);  \
79     wa_t = SHA256_EXPAND (w8_t, w3_t, wb_t, wa_t);  \
80     wb_t = SHA256_EXPAND (w9_t, w4_t, wc_t, wb_t);  \
81     wc_t = SHA256_EXPAND (wa_t, w5_t, wd_t, wc_t);  \
82     wd_t = SHA256_EXPAND (wb_t, w6_t, we_t, wd_t);  \
83     we_t = SHA256_EXPAND (wc_t, w7_t, wf_t, we_t);  \
84     wf_t = SHA256_EXPAND (wd_t, w8_t, w0_t, wf_t);  \
85   }
86
87   #define ROUND_STEP(i)                                                                   \
88   {                                                                                       \
89     SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, k_sha256[i +  0]); \
90     SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, k_sha256[i +  1]); \
91     SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, k_sha256[i +  2]); \
92     SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, k_sha256[i +  3]); \
93     SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, k_sha256[i +  4]); \
94     SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, k_sha256[i +  5]); \
95     SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, k_sha256[i +  6]); \
96     SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, k_sha256[i +  7]); \
97     SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, k_sha256[i +  8]); \
98     SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, k_sha256[i +  9]); \
99     SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, k_sha256[i + 10]); \
100     SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, k_sha256[i + 11]); \
101     SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, k_sha256[i + 12]); \
102     SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, k_sha256[i + 13]); \
103     SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, k_sha256[i + 14]); \
104     SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, k_sha256[i + 15]); \
105   }
106
107   ROUND_STEP (0);
108
109   #ifdef _unroll
110   #pragma unroll
111   #endif
112   for (int i = 16; i < 64; i += 16)
113   {
114     ROUND_EXPAND (); ROUND_STEP (i);
115   }
116
117   digest[0] += a;
118   digest[1] += b;
119   digest[2] += c;
120   digest[3] += d;
121   digest[4] += e;
122   digest[5] += f;
123   digest[6] += g;
124   digest[7] += h;
125 }
126
127 void hmac_sha256_pad (u32x w0[4], u32x w1[4], u32x w2[4], u32x w3[4], u32x ipad[8], u32x opad[8])
128 {
129   w0[0] = w0[0] ^ 0x36363636;
130   w0[1] = w0[1] ^ 0x36363636;
131   w0[2] = w0[2] ^ 0x36363636;
132   w0[3] = w0[3] ^ 0x36363636;
133   w1[0] = w1[0] ^ 0x36363636;
134   w1[1] = w1[1] ^ 0x36363636;
135   w1[2] = w1[2] ^ 0x36363636;
136   w1[3] = w1[3] ^ 0x36363636;
137   w2[0] = w2[0] ^ 0x36363636;
138   w2[1] = w2[1] ^ 0x36363636;
139   w2[2] = w2[2] ^ 0x36363636;
140   w2[3] = w2[3] ^ 0x36363636;
141   w3[0] = w3[0] ^ 0x36363636;
142   w3[1] = w3[1] ^ 0x36363636;
143   w3[2] = w3[2] ^ 0x36363636;
144   w3[3] = w3[3] ^ 0x36363636;
145
146   ipad[0] = SHA256M_A;
147   ipad[1] = SHA256M_B;
148   ipad[2] = SHA256M_C;
149   ipad[3] = SHA256M_D;
150   ipad[4] = SHA256M_E;
151   ipad[5] = SHA256M_F;
152   ipad[6] = SHA256M_G;
153   ipad[7] = SHA256M_H;
154
155   sha256_transform (w0, w1, w2, w3, ipad);
156
157   w0[0] = w0[0] ^ 0x6a6a6a6a;
158   w0[1] = w0[1] ^ 0x6a6a6a6a;
159   w0[2] = w0[2] ^ 0x6a6a6a6a;
160   w0[3] = w0[3] ^ 0x6a6a6a6a;
161   w1[0] = w1[0] ^ 0x6a6a6a6a;
162   w1[1] = w1[1] ^ 0x6a6a6a6a;
163   w1[2] = w1[2] ^ 0x6a6a6a6a;
164   w1[3] = w1[3] ^ 0x6a6a6a6a;
165   w2[0] = w2[0] ^ 0x6a6a6a6a;
166   w2[1] = w2[1] ^ 0x6a6a6a6a;
167   w2[2] = w2[2] ^ 0x6a6a6a6a;
168   w2[3] = w2[3] ^ 0x6a6a6a6a;
169   w3[0] = w3[0] ^ 0x6a6a6a6a;
170   w3[1] = w3[1] ^ 0x6a6a6a6a;
171   w3[2] = w3[2] ^ 0x6a6a6a6a;
172   w3[3] = w3[3] ^ 0x6a6a6a6a;
173
174   opad[0] = SHA256M_A;
175   opad[1] = SHA256M_B;
176   opad[2] = SHA256M_C;
177   opad[3] = SHA256M_D;
178   opad[4] = SHA256M_E;
179   opad[5] = SHA256M_F;
180   opad[6] = SHA256M_G;
181   opad[7] = SHA256M_H;
182
183   sha256_transform (w0, w1, w2, w3, opad);
184 }
185
186 void hmac_sha256_run (u32x w0[4], u32x w1[4], u32x w2[4], u32x w3[4], u32x ipad[8], u32x opad[8], u32x digest[8])
187 {
188   digest[0] = ipad[0];
189   digest[1] = ipad[1];
190   digest[2] = ipad[2];
191   digest[3] = ipad[3];
192   digest[4] = ipad[4];
193   digest[5] = ipad[5];
194   digest[6] = ipad[6];
195   digest[7] = ipad[7];
196
197   sha256_transform (w0, w1, w2, w3, digest);
198
199   w0[0] = digest[0];
200   w0[1] = digest[1];
201   w0[2] = digest[2];
202   w0[3] = digest[3];
203   w1[0] = digest[4];
204   w1[1] = digest[5];
205   w1[2] = digest[6];
206   w1[3] = digest[7];
207   w2[0] = 0x80000000;
208   w2[1] = 0;
209   w2[2] = 0;
210   w2[3] = 0;
211   w3[0] = 0;
212   w3[1] = 0;
213   w3[2] = 0;
214   w3[3] = (64 + 32) * 8;
215
216   digest[0] = opad[0];
217   digest[1] = opad[1];
218   digest[2] = opad[2];
219   digest[3] = opad[3];
220   digest[4] = opad[4];
221   digest[5] = opad[5];
222   digest[6] = opad[6];
223   digest[7] = opad[7];
224
225   sha256_transform (w0, w1, w2, w3, digest);
226 }
227
228 __kernel void m01450_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)
229 {
230   /**
231    * modifier
232    */
233
234   const u32 lid = get_local_id (0);
235
236   /**
237    * base
238    */
239
240   const u32 gid = get_global_id (0);
241
242   if (gid >= gid_max) return;
243
244   u32 pw_buf0[4];
245   u32 pw_buf1[4];
246
247   pw_buf0[0] = pws[gid].i[0];
248   pw_buf0[1] = pws[gid].i[1];
249   pw_buf0[2] = pws[gid].i[2];
250   pw_buf0[3] = pws[gid].i[3];
251   pw_buf1[0] = pws[gid].i[4];
252   pw_buf1[1] = pws[gid].i[5];
253   pw_buf1[2] = pws[gid].i[6];
254   pw_buf1[3] = pws[gid].i[7];
255
256   const u32 pw_len = pws[gid].pw_len;
257
258   /**
259    * salt
260    */
261
262   u32 salt_buf0[4];
263   u32 salt_buf1[4];
264   u32 salt_buf2[4];
265   u32 salt_buf3[4];
266
267   salt_buf0[0] = swap32_S (salt_bufs[salt_pos].salt_buf[ 0]);
268   salt_buf0[1] = swap32_S (salt_bufs[salt_pos].salt_buf[ 1]);
269   salt_buf0[2] = swap32_S (salt_bufs[salt_pos].salt_buf[ 2]);
270   salt_buf0[3] = swap32_S (salt_bufs[salt_pos].salt_buf[ 3]);
271   salt_buf1[0] = swap32_S (salt_bufs[salt_pos].salt_buf[ 4]);
272   salt_buf1[1] = swap32_S (salt_bufs[salt_pos].salt_buf[ 5]);
273   salt_buf1[2] = swap32_S (salt_bufs[salt_pos].salt_buf[ 6]);
274   salt_buf1[3] = swap32_S (salt_bufs[salt_pos].salt_buf[ 7]);
275   salt_buf2[0] = swap32_S (salt_bufs[salt_pos].salt_buf[ 8]);
276   salt_buf2[1] = swap32_S (salt_bufs[salt_pos].salt_buf[ 9]);
277   salt_buf2[2] = swap32_S (salt_bufs[salt_pos].salt_buf[10]);
278   salt_buf2[3] = swap32_S (salt_bufs[salt_pos].salt_buf[11]);
279   salt_buf3[0] = swap32_S (salt_bufs[salt_pos].salt_buf[12]);
280   salt_buf3[1] = swap32_S (salt_bufs[salt_pos].salt_buf[13]);
281   salt_buf3[2] = swap32_S (salt_bufs[salt_pos].salt_buf[14]);
282   salt_buf3[3] = swap32_S (salt_bufs[salt_pos].salt_buf[15]);
283
284   const u32 salt_len = salt_bufs[salt_pos].salt_len;
285
286   /**
287    * loop
288    */
289
290   for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
291   {
292     u32x w0[4] = { 0 };
293     u32x w1[4] = { 0 };
294     u32x w2[4] = { 0 };
295     u32x w3[4] = { 0 };
296
297     apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1);
298
299     w0[0] = swap32 (w0[0]);
300     w0[1] = swap32 (w0[1]);
301     w0[2] = swap32 (w0[2]);
302     w0[3] = swap32 (w0[3]);
303     w1[0] = swap32 (w1[0]);
304     w1[1] = swap32 (w1[1]);
305     w1[2] = swap32 (w1[2]);
306     w1[3] = swap32 (w1[3]);
307
308     /**
309      * pads
310      */
311
312     u32x ipad[8];
313     u32x opad[8];
314
315     hmac_sha256_pad (w0, w1, w2, w3, ipad, opad);
316
317     w0[0] = salt_buf0[0];
318     w0[1] = salt_buf0[1];
319     w0[2] = salt_buf0[2];
320     w0[3] = salt_buf0[3];
321     w1[0] = salt_buf1[0];
322     w1[1] = salt_buf1[1];
323     w1[2] = salt_buf1[2];
324     w1[3] = salt_buf1[3];
325     w2[0] = salt_buf2[0];
326     w2[1] = salt_buf2[1];
327     w2[2] = salt_buf2[2];
328     w2[3] = salt_buf2[3];
329     w3[0] = salt_buf3[0];
330     w3[1] = salt_buf3[1];
331     w3[2] = 0;
332     w3[3] = (64 + salt_len) * 8;
333
334     u32x digest[8];
335
336     hmac_sha256_run (w0, w1, w2, w3, ipad, opad, digest);
337
338     COMPARE_M_SIMD (digest[3], digest[7], digest[2], digest[6]);
339   }
340 }
341
342 __kernel void m01450_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)
343 {
344 }
345
346 __kernel void m01450_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)
347 {
348 }
349
350 __kernel void m01450_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)
351 {
352   /**
353    * modifier
354    */
355
356   const u32 lid = get_local_id (0);
357
358   /**
359    * base
360    */
361
362   const u32 gid = get_global_id (0);
363
364   if (gid >= gid_max) return;
365
366   u32 pw_buf0[4];
367   u32 pw_buf1[4];
368
369   pw_buf0[0] = pws[gid].i[0];
370   pw_buf0[1] = pws[gid].i[1];
371   pw_buf0[2] = pws[gid].i[2];
372   pw_buf0[3] = pws[gid].i[3];
373   pw_buf1[0] = pws[gid].i[4];
374   pw_buf1[1] = pws[gid].i[5];
375   pw_buf1[2] = pws[gid].i[6];
376   pw_buf1[3] = pws[gid].i[7];
377
378   const u32 pw_len = pws[gid].pw_len;
379
380   /**
381    * salt
382    */
383
384   u32 salt_buf0[4];
385   u32 salt_buf1[4];
386   u32 salt_buf2[4];
387   u32 salt_buf3[4];
388
389   salt_buf0[0] = swap32_S (salt_bufs[salt_pos].salt_buf[ 0]);
390   salt_buf0[1] = swap32_S (salt_bufs[salt_pos].salt_buf[ 1]);
391   salt_buf0[2] = swap32_S (salt_bufs[salt_pos].salt_buf[ 2]);
392   salt_buf0[3] = swap32_S (salt_bufs[salt_pos].salt_buf[ 3]);
393   salt_buf1[0] = swap32_S (salt_bufs[salt_pos].salt_buf[ 4]);
394   salt_buf1[1] = swap32_S (salt_bufs[salt_pos].salt_buf[ 5]);
395   salt_buf1[2] = swap32_S (salt_bufs[salt_pos].salt_buf[ 6]);
396   salt_buf1[3] = swap32_S (salt_bufs[salt_pos].salt_buf[ 7]);
397   salt_buf2[0] = swap32_S (salt_bufs[salt_pos].salt_buf[ 8]);
398   salt_buf2[1] = swap32_S (salt_bufs[salt_pos].salt_buf[ 9]);
399   salt_buf2[2] = swap32_S (salt_bufs[salt_pos].salt_buf[10]);
400   salt_buf2[3] = swap32_S (salt_bufs[salt_pos].salt_buf[11]);
401   salt_buf3[0] = swap32_S (salt_bufs[salt_pos].salt_buf[12]);
402   salt_buf3[1] = swap32_S (salt_bufs[salt_pos].salt_buf[13]);
403   salt_buf3[2] = swap32_S (salt_bufs[salt_pos].salt_buf[14]);
404   salt_buf3[3] = swap32_S (salt_bufs[salt_pos].salt_buf[15]);
405
406   const u32 salt_len = salt_bufs[salt_pos].salt_len;
407
408   /**
409    * digest
410    */
411
412   const u32 search[4] =
413   {
414     digests_buf[digests_offset].digest_buf[DGST_R0],
415     digests_buf[digests_offset].digest_buf[DGST_R1],
416     digests_buf[digests_offset].digest_buf[DGST_R2],
417     digests_buf[digests_offset].digest_buf[DGST_R3]
418   };
419
420   /**
421    * loop
422    */
423
424   for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
425   {
426     u32x w0[4] = { 0 };
427     u32x w1[4] = { 0 };
428     u32x w2[4] = { 0 };
429     u32x w3[4] = { 0 };
430
431     apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1);
432
433     w0[0] = swap32 (w0[0]);
434     w0[1] = swap32 (w0[1]);
435     w0[2] = swap32 (w0[2]);
436     w0[3] = swap32 (w0[3]);
437     w1[0] = swap32 (w1[0]);
438     w1[1] = swap32 (w1[1]);
439     w1[2] = swap32 (w1[2]);
440     w1[3] = swap32 (w1[3]);
441
442     /**
443      * pads
444      */
445
446     u32x ipad[8];
447     u32x opad[8];
448
449     hmac_sha256_pad (w0, w1, w2, w3, ipad, opad);
450
451     w0[0] = salt_buf0[0];
452     w0[1] = salt_buf0[1];
453     w0[2] = salt_buf0[2];
454     w0[3] = salt_buf0[3];
455     w1[0] = salt_buf1[0];
456     w1[1] = salt_buf1[1];
457     w1[2] = salt_buf1[2];
458     w1[3] = salt_buf1[3];
459     w2[0] = salt_buf2[0];
460     w2[1] = salt_buf2[1];
461     w2[2] = salt_buf2[2];
462     w2[3] = salt_buf2[3];
463     w3[0] = salt_buf3[0];
464     w3[1] = salt_buf3[1];
465     w3[2] = 0;
466     w3[3] = (64 + salt_len) * 8;
467
468     u32x digest[8];
469
470     hmac_sha256_run (w0, w1, w2, w3, ipad, opad, digest);
471
472     COMPARE_S_SIMD (digest[3], digest[7], digest[2], digest[6]);
473   }
474 }
475
476 __kernel void m01450_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)
477 {
478 }
479
480 __kernel void m01450_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)
481 {
482 }