2 * Author......: Jens Steube <jens.steube@gmail.com>
8 #include "inc_vendor.cl"
9 #include "inc_hash_constants.h"
10 #include "inc_hash_functions.cl"
12 #include "inc_types.cl"
13 #include "inc_common.cl"
15 #define COMPARE_S "inc_comp_single.cl"
16 #define COMPARE_M "inc_comp_multi.cl"
18 #define uint_to_hex_lower8(i) l_bin2asc[(i)]
20 __constant u32 k_sha256[64] =
22 SHA256C00, SHA256C01, SHA256C02, SHA256C03,
23 SHA256C04, SHA256C05, SHA256C06, SHA256C07,
24 SHA256C08, SHA256C09, SHA256C0a, SHA256C0b,
25 SHA256C0c, SHA256C0d, SHA256C0e, SHA256C0f,
26 SHA256C10, SHA256C11, SHA256C12, SHA256C13,
27 SHA256C14, SHA256C15, SHA256C16, SHA256C17,
28 SHA256C18, SHA256C19, SHA256C1a, SHA256C1b,
29 SHA256C1c, SHA256C1d, SHA256C1e, SHA256C1f,
30 SHA256C20, SHA256C21, SHA256C22, SHA256C23,
31 SHA256C24, SHA256C25, SHA256C26, SHA256C27,
32 SHA256C28, SHA256C29, SHA256C2a, SHA256C2b,
33 SHA256C2c, SHA256C2d, SHA256C2e, SHA256C2f,
34 SHA256C30, SHA256C31, SHA256C32, SHA256C33,
35 SHA256C34, SHA256C35, SHA256C36, SHA256C37,
36 SHA256C38, SHA256C39, SHA256C3a, SHA256C3b,
37 SHA256C3c, SHA256C3d, SHA256C3e, SHA256C3f,
40 void md4_transform (const u32 w0[4], const u32 w1[4], const u32 w2[4], const u32 w3[4], u32 digest[4])
47 MD4_STEP (MD4_Fo, a, b, c, d, w0[0], MD4C00, MD4S00);
48 MD4_STEP (MD4_Fo, d, a, b, c, w0[1], MD4C00, MD4S01);
49 MD4_STEP (MD4_Fo, c, d, a, b, w0[2], MD4C00, MD4S02);
50 MD4_STEP (MD4_Fo, b, c, d, a, w0[3], MD4C00, MD4S03);
51 MD4_STEP (MD4_Fo, a, b, c, d, w1[0], MD4C00, MD4S00);
52 MD4_STEP (MD4_Fo, d, a, b, c, w1[1], MD4C00, MD4S01);
53 MD4_STEP (MD4_Fo, c, d, a, b, w1[2], MD4C00, MD4S02);
54 MD4_STEP (MD4_Fo, b, c, d, a, w1[3], MD4C00, MD4S03);
55 MD4_STEP (MD4_Fo, a, b, c, d, w2[0], MD4C00, MD4S00);
56 MD4_STEP (MD4_Fo, d, a, b, c, w2[1], MD4C00, MD4S01);
57 MD4_STEP (MD4_Fo, c, d, a, b, w2[2], MD4C00, MD4S02);
58 MD4_STEP (MD4_Fo, b, c, d, a, w2[3], MD4C00, MD4S03);
59 MD4_STEP (MD4_Fo, a, b, c, d, w3[0], MD4C00, MD4S00);
60 MD4_STEP (MD4_Fo, d, a, b, c, w3[1], MD4C00, MD4S01);
61 MD4_STEP (MD4_Fo, c, d, a, b, w3[2], MD4C00, MD4S02);
62 MD4_STEP (MD4_Fo, b, c, d, a, w3[3], MD4C00, MD4S03);
64 MD4_STEP (MD4_Go, a, b, c, d, w0[0], MD4C01, MD4S10);
65 MD4_STEP (MD4_Go, d, a, b, c, w1[0], MD4C01, MD4S11);
66 MD4_STEP (MD4_Go, c, d, a, b, w2[0], MD4C01, MD4S12);
67 MD4_STEP (MD4_Go, b, c, d, a, w3[0], MD4C01, MD4S13);
68 MD4_STEP (MD4_Go, a, b, c, d, w0[1], MD4C01, MD4S10);
69 MD4_STEP (MD4_Go, d, a, b, c, w1[1], MD4C01, MD4S11);
70 MD4_STEP (MD4_Go, c, d, a, b, w2[1], MD4C01, MD4S12);
71 MD4_STEP (MD4_Go, b, c, d, a, w3[1], MD4C01, MD4S13);
72 MD4_STEP (MD4_Go, a, b, c, d, w0[2], MD4C01, MD4S10);
73 MD4_STEP (MD4_Go, d, a, b, c, w1[2], MD4C01, MD4S11);
74 MD4_STEP (MD4_Go, c, d, a, b, w2[2], MD4C01, MD4S12);
75 MD4_STEP (MD4_Go, b, c, d, a, w3[2], MD4C01, MD4S13);
76 MD4_STEP (MD4_Go, a, b, c, d, w0[3], MD4C01, MD4S10);
77 MD4_STEP (MD4_Go, d, a, b, c, w1[3], MD4C01, MD4S11);
78 MD4_STEP (MD4_Go, c, d, a, b, w2[3], MD4C01, MD4S12);
79 MD4_STEP (MD4_Go, b, c, d, a, w3[3], MD4C01, MD4S13);
81 MD4_STEP (MD4_H , a, b, c, d, w0[0], MD4C02, MD4S20);
82 MD4_STEP (MD4_H , d, a, b, c, w2[0], MD4C02, MD4S21);
83 MD4_STEP (MD4_H , c, d, a, b, w1[0], MD4C02, MD4S22);
84 MD4_STEP (MD4_H , b, c, d, a, w3[0], MD4C02, MD4S23);
85 MD4_STEP (MD4_H , a, b, c, d, w0[2], MD4C02, MD4S20);
86 MD4_STEP (MD4_H , d, a, b, c, w2[2], MD4C02, MD4S21);
87 MD4_STEP (MD4_H , c, d, a, b, w1[2], MD4C02, MD4S22);
88 MD4_STEP (MD4_H , b, c, d, a, w3[2], MD4C02, MD4S23);
89 MD4_STEP (MD4_H , a, b, c, d, w0[1], MD4C02, MD4S20);
90 MD4_STEP (MD4_H , d, a, b, c, w2[1], MD4C02, MD4S21);
91 MD4_STEP (MD4_H , c, d, a, b, w1[1], MD4C02, MD4S22);
92 MD4_STEP (MD4_H , b, c, d, a, w3[1], MD4C02, MD4S23);
93 MD4_STEP (MD4_H , a, b, c, d, w0[3], MD4C02, MD4S20);
94 MD4_STEP (MD4_H , d, a, b, c, w2[3], MD4C02, MD4S21);
95 MD4_STEP (MD4_H , c, d, a, b, w1[3], MD4C02, MD4S22);
96 MD4_STEP (MD4_H , b, c, d, a, w3[3], MD4C02, MD4S23);
104 void sha256_transform (const u32 w0[4], const u32 w1[4], const u32 w2[4], const u32 w3[4], u32 digest[8])
132 #define ROUND_EXPAND() \
134 w0_t = SHA256_EXPAND (we_t, w9_t, w1_t, w0_t); \
135 w1_t = SHA256_EXPAND (wf_t, wa_t, w2_t, w1_t); \
136 w2_t = SHA256_EXPAND (w0_t, wb_t, w3_t, w2_t); \
137 w3_t = SHA256_EXPAND (w1_t, wc_t, w4_t, w3_t); \
138 w4_t = SHA256_EXPAND (w2_t, wd_t, w5_t, w4_t); \
139 w5_t = SHA256_EXPAND (w3_t, we_t, w6_t, w5_t); \
140 w6_t = SHA256_EXPAND (w4_t, wf_t, w7_t, w6_t); \
141 w7_t = SHA256_EXPAND (w5_t, w0_t, w8_t, w7_t); \
142 w8_t = SHA256_EXPAND (w6_t, w1_t, w9_t, w8_t); \
143 w9_t = SHA256_EXPAND (w7_t, w2_t, wa_t, w9_t); \
144 wa_t = SHA256_EXPAND (w8_t, w3_t, wb_t, wa_t); \
145 wb_t = SHA256_EXPAND (w9_t, w4_t, wc_t, wb_t); \
146 wc_t = SHA256_EXPAND (wa_t, w5_t, wd_t, wc_t); \
147 wd_t = SHA256_EXPAND (wb_t, w6_t, we_t, wd_t); \
148 we_t = SHA256_EXPAND (wc_t, w7_t, wf_t, we_t); \
149 wf_t = SHA256_EXPAND (wd_t, w8_t, w0_t, wf_t); \
152 #define ROUND_STEP(i) \
154 SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, k_sha256[i + 0]); \
155 SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, k_sha256[i + 1]); \
156 SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, k_sha256[i + 2]); \
157 SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, k_sha256[i + 3]); \
158 SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, k_sha256[i + 4]); \
159 SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, k_sha256[i + 5]); \
160 SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, k_sha256[i + 6]); \
161 SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, k_sha256[i + 7]); \
162 SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, k_sha256[i + 8]); \
163 SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, k_sha256[i + 9]); \
164 SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, k_sha256[i + 10]); \
165 SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, k_sha256[i + 11]); \
166 SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, k_sha256[i + 12]); \
167 SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, k_sha256[i + 13]); \
168 SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, k_sha256[i + 14]); \
169 SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, k_sha256[i + 15]); \
177 for (int i = 16; i < 64; i += 16)
179 ROUND_EXPAND (); ROUND_STEP (i);
192 void hmac_sha256_pad (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], u32 ipad[8], u32 opad[8])
194 w0[0] = w0[0] ^ 0x36363636;
195 w0[1] = w0[1] ^ 0x36363636;
196 w0[2] = w0[2] ^ 0x36363636;
197 w0[3] = w0[3] ^ 0x36363636;
198 w1[0] = w1[0] ^ 0x36363636;
199 w1[1] = w1[1] ^ 0x36363636;
200 w1[2] = w1[2] ^ 0x36363636;
201 w1[3] = w1[3] ^ 0x36363636;
202 w2[0] = w2[0] ^ 0x36363636;
203 w2[1] = w2[1] ^ 0x36363636;
204 w2[2] = w2[2] ^ 0x36363636;
205 w2[3] = w2[3] ^ 0x36363636;
206 w3[0] = w3[0] ^ 0x36363636;
207 w3[1] = w3[1] ^ 0x36363636;
208 w3[2] = w3[2] ^ 0x36363636;
209 w3[3] = w3[3] ^ 0x36363636;
220 sha256_transform (w0, w1, w2, w3, ipad);
222 w0[0] = w0[0] ^ 0x6a6a6a6a;
223 w0[1] = w0[1] ^ 0x6a6a6a6a;
224 w0[2] = w0[2] ^ 0x6a6a6a6a;
225 w0[3] = w0[3] ^ 0x6a6a6a6a;
226 w1[0] = w1[0] ^ 0x6a6a6a6a;
227 w1[1] = w1[1] ^ 0x6a6a6a6a;
228 w1[2] = w1[2] ^ 0x6a6a6a6a;
229 w1[3] = w1[3] ^ 0x6a6a6a6a;
230 w2[0] = w2[0] ^ 0x6a6a6a6a;
231 w2[1] = w2[1] ^ 0x6a6a6a6a;
232 w2[2] = w2[2] ^ 0x6a6a6a6a;
233 w2[3] = w2[3] ^ 0x6a6a6a6a;
234 w3[0] = w3[0] ^ 0x6a6a6a6a;
235 w3[1] = w3[1] ^ 0x6a6a6a6a;
236 w3[2] = w3[2] ^ 0x6a6a6a6a;
237 w3[3] = w3[3] ^ 0x6a6a6a6a;
248 sha256_transform (w0, w1, w2, w3, opad);
251 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])
262 sha256_transform (w0, w1, w2, w3, digest);
279 w3[3] = (64 + 32) * 8;
290 sha256_transform (w0, w1, w2, w3, digest);
293 __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_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)
299 const u32 gid = get_global_id (0);
300 const u32 lid = get_local_id (0);
301 const u32 lsz = get_local_size (0);
307 __local u32 l_bin2asc[256];
309 for (u32 i = lid; i < 256; i += lsz)
311 const u32 i0 = (i >> 0) & 15;
312 const u32 i1 = (i >> 4) & 15;
314 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'A' - 10 + i0) << 8
315 | ((i1 < 10) ? '0' + i1 : 'A' - 10 + i1) << 0;
318 barrier (CLK_LOCAL_MEM_FENCE);
320 if (gid >= gid_max) return;
328 w0[0] = pws[gid].i[0];
329 w0[1] = pws[gid].i[1];
330 w0[2] = pws[gid].i[2];
331 w0[3] = pws[gid].i[3];
335 w1[0] = pws[gid].i[4];
336 w1[1] = pws[gid].i[5];
354 const u32 pw_len = pws[gid].pw_len;
360 u32 salt_len = salt_bufs[salt_pos].salt_len;
364 salt_buf0[0] = swap32 (salt_bufs[salt_pos].salt_buf[0]);
365 salt_buf0[1] = swap32 (salt_bufs[salt_pos].salt_buf[1]);
366 salt_buf0[2] = swap32 (salt_bufs[salt_pos].salt_buf[2]);
367 salt_buf0[3] = swap32 (salt_bufs[salt_pos].salt_buf[3]);
388 salt_buf3[3] = (64 + salt_len + 4) * 8;
394 append_0x80_2x4 (w0, w1, pw_len);
396 make_unicode (w1, w2, w3);
397 make_unicode (w0, w0, w1);
399 w3[2] = pw_len * 2 * 8;
403 digest_md4[0] = MD4M_A;
404 digest_md4[1] = MD4M_B;
405 digest_md4[2] = MD4M_C;
406 digest_md4[3] = MD4M_D;
408 md4_transform (w0, w1, w2, w3, digest_md4);
410 w0[0] = uint_to_hex_lower8 ((digest_md4[0] >> 0) & 255) << 0
411 | uint_to_hex_lower8 ((digest_md4[0] >> 8) & 255) << 16;
412 w0[1] = uint_to_hex_lower8 ((digest_md4[0] >> 16) & 255) << 0
413 | uint_to_hex_lower8 ((digest_md4[0] >> 24) & 255) << 16;
414 w0[2] = uint_to_hex_lower8 ((digest_md4[1] >> 0) & 255) << 0
415 | uint_to_hex_lower8 ((digest_md4[1] >> 8) & 255) << 16;
416 w0[3] = uint_to_hex_lower8 ((digest_md4[1] >> 16) & 255) << 0
417 | uint_to_hex_lower8 ((digest_md4[1] >> 24) & 255) << 16;
418 w1[0] = uint_to_hex_lower8 ((digest_md4[2] >> 0) & 255) << 0
419 | uint_to_hex_lower8 ((digest_md4[2] >> 8) & 255) << 16;
420 w1[1] = uint_to_hex_lower8 ((digest_md4[2] >> 16) & 255) << 0
421 | uint_to_hex_lower8 ((digest_md4[2] >> 24) & 255) << 16;
422 w1[2] = uint_to_hex_lower8 ((digest_md4[3] >> 0) & 255) << 0
423 | uint_to_hex_lower8 ((digest_md4[3] >> 8) & 255) << 16;
424 w1[3] = uint_to_hex_lower8 ((digest_md4[3] >> 16) & 255) << 0
425 | uint_to_hex_lower8 ((digest_md4[3] >> 24) & 255) << 16;
427 make_unicode (w1, w2, w3);
428 make_unicode (w0, w0, w1);
430 w0[0] = swap32 (w0[0]);
431 w0[1] = swap32 (w0[1]);
432 w0[2] = swap32 (w0[2]);
433 w0[3] = swap32 (w0[3]);
434 w1[0] = swap32 (w1[0]);
435 w1[1] = swap32 (w1[1]);
436 w1[2] = swap32 (w1[2]);
437 w1[3] = swap32 (w1[3]);
438 w2[0] = swap32 (w2[0]);
439 w2[1] = swap32 (w2[1]);
440 w2[2] = swap32 (w2[2]);
441 w2[3] = swap32 (w2[3]);
442 w3[0] = swap32 (w3[0]);
443 w3[1] = swap32 (w3[1]);
444 w3[2] = swap32 (w3[2]);
445 w3[3] = swap32 (w3[3]);
450 hmac_sha256_pad (w0, w1, w2, w3, ipad, opad);
452 tmps[gid].ipad[0] = ipad[0];
453 tmps[gid].ipad[1] = ipad[1];
454 tmps[gid].ipad[2] = ipad[2];
455 tmps[gid].ipad[3] = ipad[3];
456 tmps[gid].ipad[4] = ipad[4];
457 tmps[gid].ipad[5] = ipad[5];
458 tmps[gid].ipad[6] = ipad[6];
459 tmps[gid].ipad[7] = ipad[7];
461 tmps[gid].opad[0] = opad[0];
462 tmps[gid].opad[1] = opad[1];
463 tmps[gid].opad[2] = opad[2];
464 tmps[gid].opad[3] = opad[3];
465 tmps[gid].opad[4] = opad[4];
466 tmps[gid].opad[5] = opad[5];
467 tmps[gid].opad[6] = opad[6];
468 tmps[gid].opad[7] = opad[7];
470 for (u32 i = 0, j = 1; i < 8; i += 8, j += 1)
474 hmac_sha256_run (salt_buf0, salt_buf1, salt_buf2, salt_buf3, ipad, opad, dgst);
476 tmps[gid].dgst[i + 0] = dgst[0];
477 tmps[gid].dgst[i + 1] = dgst[1];
478 tmps[gid].dgst[i + 2] = dgst[2];
479 tmps[gid].dgst[i + 3] = dgst[3];
480 tmps[gid].dgst[i + 4] = dgst[4];
481 tmps[gid].dgst[i + 5] = dgst[5];
482 tmps[gid].dgst[i + 6] = dgst[6];
483 tmps[gid].dgst[i + 7] = dgst[7];
485 tmps[gid].out[i + 0] = dgst[0];
486 tmps[gid].out[i + 1] = dgst[1];
487 tmps[gid].out[i + 2] = dgst[2];
488 tmps[gid].out[i + 3] = dgst[3];
489 tmps[gid].out[i + 4] = dgst[4];
490 tmps[gid].out[i + 5] = dgst[5];
491 tmps[gid].out[i + 6] = dgst[6];
492 tmps[gid].out[i + 7] = dgst[7];
496 __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_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)
498 const u32 gid = get_global_id (0);
500 if (gid >= gid_max) return;
504 ipad[0] = tmps[gid].ipad[0];
505 ipad[1] = tmps[gid].ipad[1];
506 ipad[2] = tmps[gid].ipad[2];
507 ipad[3] = tmps[gid].ipad[3];
508 ipad[4] = tmps[gid].ipad[4];
509 ipad[5] = tmps[gid].ipad[5];
510 ipad[6] = tmps[gid].ipad[6];
511 ipad[7] = tmps[gid].ipad[7];
515 opad[0] = tmps[gid].opad[0];
516 opad[1] = tmps[gid].opad[1];
517 opad[2] = tmps[gid].opad[2];
518 opad[3] = tmps[gid].opad[3];
519 opad[4] = tmps[gid].opad[4];
520 opad[5] = tmps[gid].opad[5];
521 opad[6] = tmps[gid].opad[6];
522 opad[7] = tmps[gid].opad[7];
524 for (u32 i = 0; i < 8; i += 8)
528 dgst[0] = tmps[gid].dgst[i + 0];
529 dgst[1] = tmps[gid].dgst[i + 1];
530 dgst[2] = tmps[gid].dgst[i + 2];
531 dgst[3] = tmps[gid].dgst[i + 3];
532 dgst[4] = tmps[gid].dgst[i + 4];
533 dgst[5] = tmps[gid].dgst[i + 5];
534 dgst[6] = tmps[gid].dgst[i + 6];
535 dgst[7] = tmps[gid].dgst[i + 7];
539 out[0] = tmps[gid].out[i + 0];
540 out[1] = tmps[gid].out[i + 1];
541 out[2] = tmps[gid].out[i + 2];
542 out[3] = tmps[gid].out[i + 3];
543 out[4] = tmps[gid].out[i + 4];
544 out[5] = tmps[gid].out[i + 5];
545 out[6] = tmps[gid].out[i + 6];
546 out[7] = tmps[gid].out[i + 7];
548 for (u32 j = 0; j < loop_cnt; j++)
570 w3[3] = (64 + 32) * 8;
572 hmac_sha256_run (w0, w1, w2, w3, ipad, opad, dgst);
584 tmps[gid].dgst[i + 0] = dgst[0];
585 tmps[gid].dgst[i + 1] = dgst[1];
586 tmps[gid].dgst[i + 2] = dgst[2];
587 tmps[gid].dgst[i + 3] = dgst[3];
588 tmps[gid].dgst[i + 4] = dgst[4];
589 tmps[gid].dgst[i + 5] = dgst[5];
590 tmps[gid].dgst[i + 6] = dgst[6];
591 tmps[gid].dgst[i + 7] = dgst[7];
593 tmps[gid].out[i + 0] = out[0];
594 tmps[gid].out[i + 1] = out[1];
595 tmps[gid].out[i + 2] = out[2];
596 tmps[gid].out[i + 3] = out[3];
597 tmps[gid].out[i + 4] = out[4];
598 tmps[gid].out[i + 5] = out[5];
599 tmps[gid].out[i + 6] = out[6];
600 tmps[gid].out[i + 7] = out[7];
604 __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_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)
610 const u32 gid = get_global_id (0);
612 if (gid >= gid_max) return;
614 const u32 lid = get_local_id (0);
616 const u32 r0 = tmps[gid].out[DGST_R0];
617 const u32 r1 = tmps[gid].out[DGST_R1];
618 const u32 r2 = tmps[gid].out[DGST_R2];
619 const u32 r3 = tmps[gid].out[DGST_R3];