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 static 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 static 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]); \
181 for (int i = 16; i < 64; i += 16)
183 ROUND_EXPAND (); ROUND_STEP (i);
196 static void hmac_sha256_pad (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], u32 ipad[8], u32 opad[8])
198 w0[0] = w0[0] ^ 0x36363636;
199 w0[1] = w0[1] ^ 0x36363636;
200 w0[2] = w0[2] ^ 0x36363636;
201 w0[3] = w0[3] ^ 0x36363636;
202 w1[0] = w1[0] ^ 0x36363636;
203 w1[1] = w1[1] ^ 0x36363636;
204 w1[2] = w1[2] ^ 0x36363636;
205 w1[3] = w1[3] ^ 0x36363636;
206 w2[0] = w2[0] ^ 0x36363636;
207 w2[1] = w2[1] ^ 0x36363636;
208 w2[2] = w2[2] ^ 0x36363636;
209 w2[3] = w2[3] ^ 0x36363636;
210 w3[0] = w3[0] ^ 0x36363636;
211 w3[1] = w3[1] ^ 0x36363636;
212 w3[2] = w3[2] ^ 0x36363636;
213 w3[3] = w3[3] ^ 0x36363636;
224 sha256_transform (w0, w1, w2, w3, ipad);
226 w0[0] = w0[0] ^ 0x6a6a6a6a;
227 w0[1] = w0[1] ^ 0x6a6a6a6a;
228 w0[2] = w0[2] ^ 0x6a6a6a6a;
229 w0[3] = w0[3] ^ 0x6a6a6a6a;
230 w1[0] = w1[0] ^ 0x6a6a6a6a;
231 w1[1] = w1[1] ^ 0x6a6a6a6a;
232 w1[2] = w1[2] ^ 0x6a6a6a6a;
233 w1[3] = w1[3] ^ 0x6a6a6a6a;
234 w2[0] = w2[0] ^ 0x6a6a6a6a;
235 w2[1] = w2[1] ^ 0x6a6a6a6a;
236 w2[2] = w2[2] ^ 0x6a6a6a6a;
237 w2[3] = w2[3] ^ 0x6a6a6a6a;
238 w3[0] = w3[0] ^ 0x6a6a6a6a;
239 w3[1] = w3[1] ^ 0x6a6a6a6a;
240 w3[2] = w3[2] ^ 0x6a6a6a6a;
241 w3[3] = w3[3] ^ 0x6a6a6a6a;
252 sha256_transform (w0, w1, w2, w3, opad);
255 static 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])
266 sha256_transform (w0, w1, w2, w3, digest);
283 w3[3] = (64 + 32) * 8;
294 sha256_transform (w0, w1, w2, w3, digest);
297 __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)
303 const u32 gid = get_global_id (0);
304 const u32 lid = get_local_id (0);
305 const u32 lsz = get_local_size (0);
311 __local u32 l_bin2asc[256];
313 for (u32 i = lid; i < 256; i += lsz)
315 const u32 i0 = (i >> 0) & 15;
316 const u32 i1 = (i >> 4) & 15;
318 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'A' - 10 + i0) << 8
319 | ((i1 < 10) ? '0' + i1 : 'A' - 10 + i1) << 0;
322 barrier (CLK_LOCAL_MEM_FENCE);
324 if (gid >= gid_max) return;
332 w0[0] = pws[gid].i[0];
333 w0[1] = pws[gid].i[1];
334 w0[2] = pws[gid].i[2];
335 w0[3] = pws[gid].i[3];
339 w1[0] = pws[gid].i[4];
340 w1[1] = pws[gid].i[5];
358 const u32 pw_len = pws[gid].pw_len;
364 u32 salt_len = salt_bufs[salt_pos].salt_len;
368 salt_buf0[0] = swap32 (salt_bufs[salt_pos].salt_buf[0]);
369 salt_buf0[1] = swap32 (salt_bufs[salt_pos].salt_buf[1]);
370 salt_buf0[2] = swap32 (salt_bufs[salt_pos].salt_buf[2]);
371 salt_buf0[3] = swap32 (salt_bufs[salt_pos].salt_buf[3]);
392 salt_buf3[3] = (64 + salt_len + 4) * 8;
398 append_0x80_2x4 (w0, w1, pw_len);
400 make_unicode (w1, w2, w3);
401 make_unicode (w0, w0, w1);
403 w3[2] = pw_len * 2 * 8;
407 digest_md4[0] = MD4M_A;
408 digest_md4[1] = MD4M_B;
409 digest_md4[2] = MD4M_C;
410 digest_md4[3] = MD4M_D;
412 md4_transform (w0, w1, w2, w3, digest_md4);
414 w0[0] = uint_to_hex_lower8 ((digest_md4[0] >> 0) & 255) << 0
415 | uint_to_hex_lower8 ((digest_md4[0] >> 8) & 255) << 16;
416 w0[1] = uint_to_hex_lower8 ((digest_md4[0] >> 16) & 255) << 0
417 | uint_to_hex_lower8 ((digest_md4[0] >> 24) & 255) << 16;
418 w0[2] = uint_to_hex_lower8 ((digest_md4[1] >> 0) & 255) << 0
419 | uint_to_hex_lower8 ((digest_md4[1] >> 8) & 255) << 16;
420 w0[3] = uint_to_hex_lower8 ((digest_md4[1] >> 16) & 255) << 0
421 | uint_to_hex_lower8 ((digest_md4[1] >> 24) & 255) << 16;
422 w1[0] = uint_to_hex_lower8 ((digest_md4[2] >> 0) & 255) << 0
423 | uint_to_hex_lower8 ((digest_md4[2] >> 8) & 255) << 16;
424 w1[1] = uint_to_hex_lower8 ((digest_md4[2] >> 16) & 255) << 0
425 | uint_to_hex_lower8 ((digest_md4[2] >> 24) & 255) << 16;
426 w1[2] = uint_to_hex_lower8 ((digest_md4[3] >> 0) & 255) << 0
427 | uint_to_hex_lower8 ((digest_md4[3] >> 8) & 255) << 16;
428 w1[3] = uint_to_hex_lower8 ((digest_md4[3] >> 16) & 255) << 0
429 | uint_to_hex_lower8 ((digest_md4[3] >> 24) & 255) << 16;
431 make_unicode (w1, w2, w3);
432 make_unicode (w0, w0, w1);
434 w0[0] = swap32 (w0[0]);
435 w0[1] = swap32 (w0[1]);
436 w0[2] = swap32 (w0[2]);
437 w0[3] = swap32 (w0[3]);
438 w1[0] = swap32 (w1[0]);
439 w1[1] = swap32 (w1[1]);
440 w1[2] = swap32 (w1[2]);
441 w1[3] = swap32 (w1[3]);
442 w2[0] = swap32 (w2[0]);
443 w2[1] = swap32 (w2[1]);
444 w2[2] = swap32 (w2[2]);
445 w2[3] = swap32 (w2[3]);
446 w3[0] = swap32 (w3[0]);
447 w3[1] = swap32 (w3[1]);
448 w3[2] = swap32 (w3[2]);
449 w3[3] = swap32 (w3[3]);
454 hmac_sha256_pad (w0, w1, w2, w3, ipad, opad);
456 tmps[gid].ipad[0] = ipad[0];
457 tmps[gid].ipad[1] = ipad[1];
458 tmps[gid].ipad[2] = ipad[2];
459 tmps[gid].ipad[3] = ipad[3];
460 tmps[gid].ipad[4] = ipad[4];
461 tmps[gid].ipad[5] = ipad[5];
462 tmps[gid].ipad[6] = ipad[6];
463 tmps[gid].ipad[7] = ipad[7];
465 tmps[gid].opad[0] = opad[0];
466 tmps[gid].opad[1] = opad[1];
467 tmps[gid].opad[2] = opad[2];
468 tmps[gid].opad[3] = opad[3];
469 tmps[gid].opad[4] = opad[4];
470 tmps[gid].opad[5] = opad[5];
471 tmps[gid].opad[6] = opad[6];
472 tmps[gid].opad[7] = opad[7];
474 for (u32 i = 0, j = 1; i < 8; i += 8, j += 1)
478 hmac_sha256_run (salt_buf0, salt_buf1, salt_buf2, salt_buf3, ipad, opad, dgst);
480 tmps[gid].dgst[i + 0] = dgst[0];
481 tmps[gid].dgst[i + 1] = dgst[1];
482 tmps[gid].dgst[i + 2] = dgst[2];
483 tmps[gid].dgst[i + 3] = dgst[3];
484 tmps[gid].dgst[i + 4] = dgst[4];
485 tmps[gid].dgst[i + 5] = dgst[5];
486 tmps[gid].dgst[i + 6] = dgst[6];
487 tmps[gid].dgst[i + 7] = dgst[7];
489 tmps[gid].out[i + 0] = dgst[0];
490 tmps[gid].out[i + 1] = dgst[1];
491 tmps[gid].out[i + 2] = dgst[2];
492 tmps[gid].out[i + 3] = dgst[3];
493 tmps[gid].out[i + 4] = dgst[4];
494 tmps[gid].out[i + 5] = dgst[5];
495 tmps[gid].out[i + 6] = dgst[6];
496 tmps[gid].out[i + 7] = dgst[7];
500 __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)
502 const u32 gid = get_global_id (0);
504 if (gid >= gid_max) return;
508 ipad[0] = tmps[gid].ipad[0];
509 ipad[1] = tmps[gid].ipad[1];
510 ipad[2] = tmps[gid].ipad[2];
511 ipad[3] = tmps[gid].ipad[3];
512 ipad[4] = tmps[gid].ipad[4];
513 ipad[5] = tmps[gid].ipad[5];
514 ipad[6] = tmps[gid].ipad[6];
515 ipad[7] = tmps[gid].ipad[7];
519 opad[0] = tmps[gid].opad[0];
520 opad[1] = tmps[gid].opad[1];
521 opad[2] = tmps[gid].opad[2];
522 opad[3] = tmps[gid].opad[3];
523 opad[4] = tmps[gid].opad[4];
524 opad[5] = tmps[gid].opad[5];
525 opad[6] = tmps[gid].opad[6];
526 opad[7] = tmps[gid].opad[7];
528 for (u32 i = 0; i < 8; i += 8)
532 dgst[0] = tmps[gid].dgst[i + 0];
533 dgst[1] = tmps[gid].dgst[i + 1];
534 dgst[2] = tmps[gid].dgst[i + 2];
535 dgst[3] = tmps[gid].dgst[i + 3];
536 dgst[4] = tmps[gid].dgst[i + 4];
537 dgst[5] = tmps[gid].dgst[i + 5];
538 dgst[6] = tmps[gid].dgst[i + 6];
539 dgst[7] = tmps[gid].dgst[i + 7];
543 out[0] = tmps[gid].out[i + 0];
544 out[1] = tmps[gid].out[i + 1];
545 out[2] = tmps[gid].out[i + 2];
546 out[3] = tmps[gid].out[i + 3];
547 out[4] = tmps[gid].out[i + 4];
548 out[5] = tmps[gid].out[i + 5];
549 out[6] = tmps[gid].out[i + 6];
550 out[7] = tmps[gid].out[i + 7];
552 for (u32 j = 0; j < loop_cnt; j++)
574 w3[3] = (64 + 32) * 8;
576 hmac_sha256_run (w0, w1, w2, w3, ipad, opad, dgst);
588 tmps[gid].dgst[i + 0] = dgst[0];
589 tmps[gid].dgst[i + 1] = dgst[1];
590 tmps[gid].dgst[i + 2] = dgst[2];
591 tmps[gid].dgst[i + 3] = dgst[3];
592 tmps[gid].dgst[i + 4] = dgst[4];
593 tmps[gid].dgst[i + 5] = dgst[5];
594 tmps[gid].dgst[i + 6] = dgst[6];
595 tmps[gid].dgst[i + 7] = dgst[7];
597 tmps[gid].out[i + 0] = out[0];
598 tmps[gid].out[i + 1] = out[1];
599 tmps[gid].out[i + 2] = out[2];
600 tmps[gid].out[i + 3] = out[3];
601 tmps[gid].out[i + 4] = out[4];
602 tmps[gid].out[i + 5] = out[5];
603 tmps[gid].out[i + 6] = out[6];
604 tmps[gid].out[i + 7] = out[7];
608 __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)
614 const u32 gid = get_global_id (0);
616 if (gid >= gid_max) return;
618 const u32 lid = get_local_id (0);
620 const u32 r0 = tmps[gid].out[DGST_R0];
621 const u32 r1 = tmps[gid].out[DGST_R1];
622 const u32 r2 = tmps[gid].out[DGST_R2];
623 const u32 r3 = tmps[gid].out[DGST_R3];