2 * Author......: Jens Steube <jens.steube@gmail.com>
8 #include "include/constants.h"
9 #include "include/kernel_vendor.h"
16 #include "include/kernel_functions.c"
18 #include "OpenCL/types_ocl.c"
19 #include "OpenCL/common.c"
21 #define COMPARE_S "OpenCL/check_single_comp4.c"
22 #define COMPARE_M "OpenCL/check_multi_comp4.c"
24 #define uint_to_hex_lower8(i) l_bin2asc[(i)]
26 __constant u32 k_sha256[64] =
28 SHA256C00, SHA256C01, SHA256C02, SHA256C03,
29 SHA256C04, SHA256C05, SHA256C06, SHA256C07,
30 SHA256C08, SHA256C09, SHA256C0a, SHA256C0b,
31 SHA256C0c, SHA256C0d, SHA256C0e, SHA256C0f,
32 SHA256C10, SHA256C11, SHA256C12, SHA256C13,
33 SHA256C14, SHA256C15, SHA256C16, SHA256C17,
34 SHA256C18, SHA256C19, SHA256C1a, SHA256C1b,
35 SHA256C1c, SHA256C1d, SHA256C1e, SHA256C1f,
36 SHA256C20, SHA256C21, SHA256C22, SHA256C23,
37 SHA256C24, SHA256C25, SHA256C26, SHA256C27,
38 SHA256C28, SHA256C29, SHA256C2a, SHA256C2b,
39 SHA256C2c, SHA256C2d, SHA256C2e, SHA256C2f,
40 SHA256C30, SHA256C31, SHA256C32, SHA256C33,
41 SHA256C34, SHA256C35, SHA256C36, SHA256C37,
42 SHA256C38, SHA256C39, SHA256C3a, SHA256C3b,
43 SHA256C3c, SHA256C3d, SHA256C3e, SHA256C3f,
46 void md4_transform (const u32 w0[4], const u32 w1[4], const u32 w2[4], const u32 w3[4], u32 digest[4])
53 MD4_STEP (MD4_Fo, a, b, c, d, w0[0], MD4C00, MD4S00);
54 MD4_STEP (MD4_Fo, d, a, b, c, w0[1], MD4C00, MD4S01);
55 MD4_STEP (MD4_Fo, c, d, a, b, w0[2], MD4C00, MD4S02);
56 MD4_STEP (MD4_Fo, b, c, d, a, w0[3], MD4C00, MD4S03);
57 MD4_STEP (MD4_Fo, a, b, c, d, w1[0], MD4C00, MD4S00);
58 MD4_STEP (MD4_Fo, d, a, b, c, w1[1], MD4C00, MD4S01);
59 MD4_STEP (MD4_Fo, c, d, a, b, w1[2], MD4C00, MD4S02);
60 MD4_STEP (MD4_Fo, b, c, d, a, w1[3], MD4C00, MD4S03);
61 MD4_STEP (MD4_Fo, a, b, c, d, w2[0], MD4C00, MD4S00);
62 MD4_STEP (MD4_Fo, d, a, b, c, w2[1], MD4C00, MD4S01);
63 MD4_STEP (MD4_Fo, c, d, a, b, w2[2], MD4C00, MD4S02);
64 MD4_STEP (MD4_Fo, b, c, d, a, w2[3], MD4C00, MD4S03);
65 MD4_STEP (MD4_Fo, a, b, c, d, w3[0], MD4C00, MD4S00);
66 MD4_STEP (MD4_Fo, d, a, b, c, w3[1], MD4C00, MD4S01);
67 MD4_STEP (MD4_Fo, c, d, a, b, w3[2], MD4C00, MD4S02);
68 MD4_STEP (MD4_Fo, b, c, d, a, w3[3], MD4C00, MD4S03);
70 MD4_STEP (MD4_Go, a, b, c, d, w0[0], MD4C01, MD4S10);
71 MD4_STEP (MD4_Go, d, a, b, c, w1[0], MD4C01, MD4S11);
72 MD4_STEP (MD4_Go, c, d, a, b, w2[0], MD4C01, MD4S12);
73 MD4_STEP (MD4_Go, b, c, d, a, w3[0], MD4C01, MD4S13);
74 MD4_STEP (MD4_Go, a, b, c, d, w0[1], MD4C01, MD4S10);
75 MD4_STEP (MD4_Go, d, a, b, c, w1[1], MD4C01, MD4S11);
76 MD4_STEP (MD4_Go, c, d, a, b, w2[1], MD4C01, MD4S12);
77 MD4_STEP (MD4_Go, b, c, d, a, w3[1], MD4C01, MD4S13);
78 MD4_STEP (MD4_Go, a, b, c, d, w0[2], MD4C01, MD4S10);
79 MD4_STEP (MD4_Go, d, a, b, c, w1[2], MD4C01, MD4S11);
80 MD4_STEP (MD4_Go, c, d, a, b, w2[2], MD4C01, MD4S12);
81 MD4_STEP (MD4_Go, b, c, d, a, w3[2], MD4C01, MD4S13);
82 MD4_STEP (MD4_Go, a, b, c, d, w0[3], MD4C01, MD4S10);
83 MD4_STEP (MD4_Go, d, a, b, c, w1[3], MD4C01, MD4S11);
84 MD4_STEP (MD4_Go, c, d, a, b, w2[3], MD4C01, MD4S12);
85 MD4_STEP (MD4_Go, b, c, d, a, w3[3], MD4C01, MD4S13);
87 MD4_STEP (MD4_H , a, b, c, d, w0[0], MD4C02, MD4S20);
88 MD4_STEP (MD4_H , d, a, b, c, w2[0], MD4C02, MD4S21);
89 MD4_STEP (MD4_H , c, d, a, b, w1[0], MD4C02, MD4S22);
90 MD4_STEP (MD4_H , b, c, d, a, w3[0], MD4C02, MD4S23);
91 MD4_STEP (MD4_H , a, b, c, d, w0[2], MD4C02, MD4S20);
92 MD4_STEP (MD4_H , d, a, b, c, w2[2], MD4C02, MD4S21);
93 MD4_STEP (MD4_H , c, d, a, b, w1[2], MD4C02, MD4S22);
94 MD4_STEP (MD4_H , b, c, d, a, w3[2], MD4C02, MD4S23);
95 MD4_STEP (MD4_H , a, b, c, d, w0[1], MD4C02, MD4S20);
96 MD4_STEP (MD4_H , d, a, b, c, w2[1], MD4C02, MD4S21);
97 MD4_STEP (MD4_H , c, d, a, b, w1[1], MD4C02, MD4S22);
98 MD4_STEP (MD4_H , b, c, d, a, w3[1], MD4C02, MD4S23);
99 MD4_STEP (MD4_H , a, b, c, d, w0[3], MD4C02, MD4S20);
100 MD4_STEP (MD4_H , d, a, b, c, w2[3], MD4C02, MD4S21);
101 MD4_STEP (MD4_H , c, d, a, b, w1[3], MD4C02, MD4S22);
102 MD4_STEP (MD4_H , b, c, d, a, w3[3], MD4C02, MD4S23);
110 void sha256_transform (const u32 w0[4], const u32 w1[4], const u32 w2[4], const u32 w3[4], u32 digest[8])
138 #define ROUND_EXPAND() \
140 w0_t = SHA256_EXPAND (we_t, w9_t, w1_t, w0_t); \
141 w1_t = SHA256_EXPAND (wf_t, wa_t, w2_t, w1_t); \
142 w2_t = SHA256_EXPAND (w0_t, wb_t, w3_t, w2_t); \
143 w3_t = SHA256_EXPAND (w1_t, wc_t, w4_t, w3_t); \
144 w4_t = SHA256_EXPAND (w2_t, wd_t, w5_t, w4_t); \
145 w5_t = SHA256_EXPAND (w3_t, we_t, w6_t, w5_t); \
146 w6_t = SHA256_EXPAND (w4_t, wf_t, w7_t, w6_t); \
147 w7_t = SHA256_EXPAND (w5_t, w0_t, w8_t, w7_t); \
148 w8_t = SHA256_EXPAND (w6_t, w1_t, w9_t, w8_t); \
149 w9_t = SHA256_EXPAND (w7_t, w2_t, wa_t, w9_t); \
150 wa_t = SHA256_EXPAND (w8_t, w3_t, wb_t, wa_t); \
151 wb_t = SHA256_EXPAND (w9_t, w4_t, wc_t, wb_t); \
152 wc_t = SHA256_EXPAND (wa_t, w5_t, wd_t, wc_t); \
153 wd_t = SHA256_EXPAND (wb_t, w6_t, we_t, wd_t); \
154 we_t = SHA256_EXPAND (wc_t, w7_t, wf_t, we_t); \
155 wf_t = SHA256_EXPAND (wd_t, w8_t, w0_t, wf_t); \
158 #define ROUND_STEP(i) \
160 SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, k_sha256[i + 0]); \
161 SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, k_sha256[i + 1]); \
162 SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, k_sha256[i + 2]); \
163 SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, k_sha256[i + 3]); \
164 SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, k_sha256[i + 4]); \
165 SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, k_sha256[i + 5]); \
166 SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, k_sha256[i + 6]); \
167 SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, k_sha256[i + 7]); \
168 SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, k_sha256[i + 8]); \
169 SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, k_sha256[i + 9]); \
170 SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, k_sha256[i + 10]); \
171 SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, k_sha256[i + 11]); \
172 SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, k_sha256[i + 12]); \
173 SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, k_sha256[i + 13]); \
174 SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, k_sha256[i + 14]); \
175 SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, k_sha256[i + 15]); \
183 for (int i = 16; i < 64; i += 16)
185 ROUND_EXPAND (); ROUND_STEP (i);
198 void hmac_sha256_pad (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], u32 ipad[8], u32 opad[8])
200 w0[0] = w0[0] ^ 0x36363636;
201 w0[1] = w0[1] ^ 0x36363636;
202 w0[2] = w0[2] ^ 0x36363636;
203 w0[3] = w0[3] ^ 0x36363636;
204 w1[0] = w1[0] ^ 0x36363636;
205 w1[1] = w1[1] ^ 0x36363636;
206 w1[2] = w1[2] ^ 0x36363636;
207 w1[3] = w1[3] ^ 0x36363636;
208 w2[0] = w2[0] ^ 0x36363636;
209 w2[1] = w2[1] ^ 0x36363636;
210 w2[2] = w2[2] ^ 0x36363636;
211 w2[3] = w2[3] ^ 0x36363636;
212 w3[0] = w3[0] ^ 0x36363636;
213 w3[1] = w3[1] ^ 0x36363636;
214 w3[2] = w3[2] ^ 0x36363636;
215 w3[3] = w3[3] ^ 0x36363636;
226 sha256_transform (w0, w1, w2, w3, ipad);
228 w0[0] = w0[0] ^ 0x6a6a6a6a;
229 w0[1] = w0[1] ^ 0x6a6a6a6a;
230 w0[2] = w0[2] ^ 0x6a6a6a6a;
231 w0[3] = w0[3] ^ 0x6a6a6a6a;
232 w1[0] = w1[0] ^ 0x6a6a6a6a;
233 w1[1] = w1[1] ^ 0x6a6a6a6a;
234 w1[2] = w1[2] ^ 0x6a6a6a6a;
235 w1[3] = w1[3] ^ 0x6a6a6a6a;
236 w2[0] = w2[0] ^ 0x6a6a6a6a;
237 w2[1] = w2[1] ^ 0x6a6a6a6a;
238 w2[2] = w2[2] ^ 0x6a6a6a6a;
239 w2[3] = w2[3] ^ 0x6a6a6a6a;
240 w3[0] = w3[0] ^ 0x6a6a6a6a;
241 w3[1] = w3[1] ^ 0x6a6a6a6a;
242 w3[2] = w3[2] ^ 0x6a6a6a6a;
243 w3[3] = w3[3] ^ 0x6a6a6a6a;
254 sha256_transform (w0, w1, w2, w3, opad);
257 void hmac_sha256_run (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], u32 ipad[8], u32 opad[8], u32 digest[8])
268 sha256_transform (w0, w1, w2, w3, digest);
285 w3[3] = (64 + 32) * 8;
296 sha256_transform (w0, w1, w2, w3, digest);
299 __kernel void m12800_init (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global pbkdf2_sha256_tmp_t *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 pbkdf2_sha256_t *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 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
305 const u32 gid = get_global_id (0);
306 const u32 lid = get_local_id (0);
307 const u32 lsz = get_local_size (0);
313 __local u32 l_bin2asc[256];
315 for (u32 i = lid; i < 256; i += lsz)
317 const u32 i0 = (i >> 0) & 15;
318 const u32 i1 = (i >> 4) & 15;
320 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'A' - 10 + i0) << 8
321 | ((i1 < 10) ? '0' + i1 : 'A' - 10 + i1) << 0;
324 barrier (CLK_LOCAL_MEM_FENCE);
326 if (gid >= gid_max) return;
334 w0[0] = pws[gid].i[0];
335 w0[1] = pws[gid].i[1];
336 w0[2] = pws[gid].i[2];
337 w0[3] = pws[gid].i[3];
341 w1[0] = pws[gid].i[4];
342 w1[1] = pws[gid].i[5];
360 const u32 pw_len = pws[gid].pw_len;
366 u32 salt_len = salt_bufs[salt_pos].salt_len;
370 salt_buf0[0] = swap32 (salt_bufs[salt_pos].salt_buf[0]);
371 salt_buf0[1] = swap32 (salt_bufs[salt_pos].salt_buf[1]);
372 salt_buf0[2] = swap32 (salt_bufs[salt_pos].salt_buf[2]);
373 salt_buf0[3] = swap32 (salt_bufs[salt_pos].salt_buf[3]);
394 salt_buf3[3] = (64 + salt_len + 4) * 8;
400 append_0x80_2x4 (w0, w1, pw_len);
402 make_unicode (w1, w2, w3);
403 make_unicode (w0, w0, w1);
405 w3[2] = pw_len * 2 * 8;
409 digest_md4[0] = MD4M_A;
410 digest_md4[1] = MD4M_B;
411 digest_md4[2] = MD4M_C;
412 digest_md4[3] = MD4M_D;
414 md4_transform (w0, w1, w2, w3, digest_md4);
416 w0[0] = uint_to_hex_lower8 ((digest_md4[0] >> 0) & 255) << 0
417 | uint_to_hex_lower8 ((digest_md4[0] >> 8) & 255) << 16;
418 w0[1] = uint_to_hex_lower8 ((digest_md4[0] >> 16) & 255) << 0
419 | uint_to_hex_lower8 ((digest_md4[0] >> 24) & 255) << 16;
420 w0[2] = uint_to_hex_lower8 ((digest_md4[1] >> 0) & 255) << 0
421 | uint_to_hex_lower8 ((digest_md4[1] >> 8) & 255) << 16;
422 w0[3] = uint_to_hex_lower8 ((digest_md4[1] >> 16) & 255) << 0
423 | uint_to_hex_lower8 ((digest_md4[1] >> 24) & 255) << 16;
424 w1[0] = uint_to_hex_lower8 ((digest_md4[2] >> 0) & 255) << 0
425 | uint_to_hex_lower8 ((digest_md4[2] >> 8) & 255) << 16;
426 w1[1] = uint_to_hex_lower8 ((digest_md4[2] >> 16) & 255) << 0
427 | uint_to_hex_lower8 ((digest_md4[2] >> 24) & 255) << 16;
428 w1[2] = uint_to_hex_lower8 ((digest_md4[3] >> 0) & 255) << 0
429 | uint_to_hex_lower8 ((digest_md4[3] >> 8) & 255) << 16;
430 w1[3] = uint_to_hex_lower8 ((digest_md4[3] >> 16) & 255) << 0
431 | uint_to_hex_lower8 ((digest_md4[3] >> 24) & 255) << 16;
433 make_unicode (w1, w2, w3);
434 make_unicode (w0, w0, w1);
436 w0[0] = swap32 (w0[0]);
437 w0[1] = swap32 (w0[1]);
438 w0[2] = swap32 (w0[2]);
439 w0[3] = swap32 (w0[3]);
440 w1[0] = swap32 (w1[0]);
441 w1[1] = swap32 (w1[1]);
442 w1[2] = swap32 (w1[2]);
443 w1[3] = swap32 (w1[3]);
444 w2[0] = swap32 (w2[0]);
445 w2[1] = swap32 (w2[1]);
446 w2[2] = swap32 (w2[2]);
447 w2[3] = swap32 (w2[3]);
448 w3[0] = swap32 (w3[0]);
449 w3[1] = swap32 (w3[1]);
450 w3[2] = swap32 (w3[2]);
451 w3[3] = swap32 (w3[3]);
456 hmac_sha256_pad (w0, w1, w2, w3, ipad, opad);
458 tmps[gid].ipad[0] = ipad[0];
459 tmps[gid].ipad[1] = ipad[1];
460 tmps[gid].ipad[2] = ipad[2];
461 tmps[gid].ipad[3] = ipad[3];
462 tmps[gid].ipad[4] = ipad[4];
463 tmps[gid].ipad[5] = ipad[5];
464 tmps[gid].ipad[6] = ipad[6];
465 tmps[gid].ipad[7] = ipad[7];
467 tmps[gid].opad[0] = opad[0];
468 tmps[gid].opad[1] = opad[1];
469 tmps[gid].opad[2] = opad[2];
470 tmps[gid].opad[3] = opad[3];
471 tmps[gid].opad[4] = opad[4];
472 tmps[gid].opad[5] = opad[5];
473 tmps[gid].opad[6] = opad[6];
474 tmps[gid].opad[7] = opad[7];
476 for (u32 i = 0, j = 1; i < 8; i += 8, j += 1)
480 hmac_sha256_run (salt_buf0, salt_buf1, salt_buf2, salt_buf3, ipad, opad, dgst);
482 tmps[gid].dgst[i + 0] = dgst[0];
483 tmps[gid].dgst[i + 1] = dgst[1];
484 tmps[gid].dgst[i + 2] = dgst[2];
485 tmps[gid].dgst[i + 3] = dgst[3];
486 tmps[gid].dgst[i + 4] = dgst[4];
487 tmps[gid].dgst[i + 5] = dgst[5];
488 tmps[gid].dgst[i + 6] = dgst[6];
489 tmps[gid].dgst[i + 7] = dgst[7];
491 tmps[gid].out[i + 0] = dgst[0];
492 tmps[gid].out[i + 1] = dgst[1];
493 tmps[gid].out[i + 2] = dgst[2];
494 tmps[gid].out[i + 3] = dgst[3];
495 tmps[gid].out[i + 4] = dgst[4];
496 tmps[gid].out[i + 5] = dgst[5];
497 tmps[gid].out[i + 6] = dgst[6];
498 tmps[gid].out[i + 7] = dgst[7];
502 __kernel void m12800_loop (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global pbkdf2_sha256_tmp_t *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 pbkdf2_sha256_t *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 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
504 const u32 gid = get_global_id (0);
506 if (gid >= gid_max) return;
510 ipad[0] = tmps[gid].ipad[0];
511 ipad[1] = tmps[gid].ipad[1];
512 ipad[2] = tmps[gid].ipad[2];
513 ipad[3] = tmps[gid].ipad[3];
514 ipad[4] = tmps[gid].ipad[4];
515 ipad[5] = tmps[gid].ipad[5];
516 ipad[6] = tmps[gid].ipad[6];
517 ipad[7] = tmps[gid].ipad[7];
521 opad[0] = tmps[gid].opad[0];
522 opad[1] = tmps[gid].opad[1];
523 opad[2] = tmps[gid].opad[2];
524 opad[3] = tmps[gid].opad[3];
525 opad[4] = tmps[gid].opad[4];
526 opad[5] = tmps[gid].opad[5];
527 opad[6] = tmps[gid].opad[6];
528 opad[7] = tmps[gid].opad[7];
530 for (u32 i = 0; i < 8; i += 8)
534 dgst[0] = tmps[gid].dgst[i + 0];
535 dgst[1] = tmps[gid].dgst[i + 1];
536 dgst[2] = tmps[gid].dgst[i + 2];
537 dgst[3] = tmps[gid].dgst[i + 3];
538 dgst[4] = tmps[gid].dgst[i + 4];
539 dgst[5] = tmps[gid].dgst[i + 5];
540 dgst[6] = tmps[gid].dgst[i + 6];
541 dgst[7] = tmps[gid].dgst[i + 7];
545 out[0] = tmps[gid].out[i + 0];
546 out[1] = tmps[gid].out[i + 1];
547 out[2] = tmps[gid].out[i + 2];
548 out[3] = tmps[gid].out[i + 3];
549 out[4] = tmps[gid].out[i + 4];
550 out[5] = tmps[gid].out[i + 5];
551 out[6] = tmps[gid].out[i + 6];
552 out[7] = tmps[gid].out[i + 7];
554 for (u32 j = 0; j < loop_cnt; j++)
576 w3[3] = (64 + 32) * 8;
578 hmac_sha256_run (w0, w1, w2, w3, ipad, opad, dgst);
590 tmps[gid].dgst[i + 0] = dgst[0];
591 tmps[gid].dgst[i + 1] = dgst[1];
592 tmps[gid].dgst[i + 2] = dgst[2];
593 tmps[gid].dgst[i + 3] = dgst[3];
594 tmps[gid].dgst[i + 4] = dgst[4];
595 tmps[gid].dgst[i + 5] = dgst[5];
596 tmps[gid].dgst[i + 6] = dgst[6];
597 tmps[gid].dgst[i + 7] = dgst[7];
599 tmps[gid].out[i + 0] = out[0];
600 tmps[gid].out[i + 1] = out[1];
601 tmps[gid].out[i + 2] = out[2];
602 tmps[gid].out[i + 3] = out[3];
603 tmps[gid].out[i + 4] = out[4];
604 tmps[gid].out[i + 5] = out[5];
605 tmps[gid].out[i + 6] = out[6];
606 tmps[gid].out[i + 7] = out[7];
610 __kernel void m12800_comp (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global pbkdf2_sha256_tmp_t *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 pbkdf2_sha256_t *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 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
616 const u32 gid = get_global_id (0);
618 if (gid >= gid_max) return;
620 const u32 lid = get_local_id (0);
622 const u32 r0 = tmps[gid].out[DGST_R0];
623 const u32 r1 = tmps[gid].out[DGST_R1];
624 const u32 r2 = tmps[gid].out[DGST_R2];
625 const u32 r3 = tmps[gid].out[DGST_R3];