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 "types_ocl.c"
21 #define COMPARE_S "check_single_comp4.c"
22 #define COMPARE_M "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 __attribute__((reqd_work_group_size (64, 1, 1))) m12800_init (__global pw_t *pws, __global gpu_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 rules_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);
310 __local u32 l_bin2asc[256];
312 const u32 lid4 = lid * 4;
314 const u32 lid40 = lid4 + 0;
315 const u32 lid41 = lid4 + 1;
316 const u32 lid42 = lid4 + 2;
317 const u32 lid43 = lid4 + 3;
319 const u32 v400 = (lid40 >> 0) & 15;
320 const u32 v401 = (lid40 >> 4) & 15;
321 const u32 v410 = (lid41 >> 0) & 15;
322 const u32 v411 = (lid41 >> 4) & 15;
323 const u32 v420 = (lid42 >> 0) & 15;
324 const u32 v421 = (lid42 >> 4) & 15;
325 const u32 v430 = (lid43 >> 0) & 15;
326 const u32 v431 = (lid43 >> 4) & 15;
328 l_bin2asc[lid40] = ((v400 < 10) ? '0' + v400 : 'A' - 10 + v400) << 8
329 | ((v401 < 10) ? '0' + v401 : 'A' - 10 + v401) << 0;
330 l_bin2asc[lid41] = ((v410 < 10) ? '0' + v410 : 'A' - 10 + v410) << 8
331 | ((v411 < 10) ? '0' + v411 : 'A' - 10 + v411) << 0;
332 l_bin2asc[lid42] = ((v420 < 10) ? '0' + v420 : 'A' - 10 + v420) << 8
333 | ((v421 < 10) ? '0' + v421 : 'A' - 10 + v421) << 0;
334 l_bin2asc[lid43] = ((v430 < 10) ? '0' + v430 : 'A' - 10 + v430) << 8
335 | ((v431 < 10) ? '0' + v431 : 'A' - 10 + v431) << 0;
337 barrier (CLK_LOCAL_MEM_FENCE);
339 if (gid >= gid_max) return;
347 w0[0] = pws[gid].i[0];
348 w0[1] = pws[gid].i[1];
349 w0[2] = pws[gid].i[2];
350 w0[3] = pws[gid].i[3];
354 w1[0] = pws[gid].i[4];
355 w1[1] = pws[gid].i[5];
373 const u32 pw_len = pws[gid].pw_len;
379 u32 salt_len = salt_bufs[salt_pos].salt_len;
383 salt_buf0[0] = swap32 (salt_bufs[salt_pos].salt_buf[0]);
384 salt_buf0[1] = swap32 (salt_bufs[salt_pos].salt_buf[1]);
385 salt_buf0[2] = swap32 (salt_bufs[salt_pos].salt_buf[2]);
386 salt_buf0[3] = swap32 (salt_bufs[salt_pos].salt_buf[3]);
407 salt_buf3[3] = (64 + salt_len + 4) * 8;
413 append_0x80_2x4 (w0, w1, pw_len);
415 make_unicode (w1, w2, w3);
416 make_unicode (w0, w0, w1);
418 w3[2] = pw_len * 2 * 8;
422 digest_md4[0] = MD4M_A;
423 digest_md4[1] = MD4M_B;
424 digest_md4[2] = MD4M_C;
425 digest_md4[3] = MD4M_D;
427 md4_transform (w0, w1, w2, w3, digest_md4);
429 w0[0] = uint_to_hex_lower8 ((digest_md4[0] >> 0) & 255) << 0
430 | uint_to_hex_lower8 ((digest_md4[0] >> 8) & 255) << 16;
431 w0[1] = uint_to_hex_lower8 ((digest_md4[0] >> 16) & 255) << 0
432 | uint_to_hex_lower8 ((digest_md4[0] >> 24) & 255) << 16;
433 w0[2] = uint_to_hex_lower8 ((digest_md4[1] >> 0) & 255) << 0
434 | uint_to_hex_lower8 ((digest_md4[1] >> 8) & 255) << 16;
435 w0[3] = uint_to_hex_lower8 ((digest_md4[1] >> 16) & 255) << 0
436 | uint_to_hex_lower8 ((digest_md4[1] >> 24) & 255) << 16;
437 w1[0] = uint_to_hex_lower8 ((digest_md4[2] >> 0) & 255) << 0
438 | uint_to_hex_lower8 ((digest_md4[2] >> 8) & 255) << 16;
439 w1[1] = uint_to_hex_lower8 ((digest_md4[2] >> 16) & 255) << 0
440 | uint_to_hex_lower8 ((digest_md4[2] >> 24) & 255) << 16;
441 w1[2] = uint_to_hex_lower8 ((digest_md4[3] >> 0) & 255) << 0
442 | uint_to_hex_lower8 ((digest_md4[3] >> 8) & 255) << 16;
443 w1[3] = uint_to_hex_lower8 ((digest_md4[3] >> 16) & 255) << 0
444 | uint_to_hex_lower8 ((digest_md4[3] >> 24) & 255) << 16;
446 make_unicode (w1, w2, w3);
447 make_unicode (w0, w0, w1);
449 w0[0] = swap32 (w0[0]);
450 w0[1] = swap32 (w0[1]);
451 w0[2] = swap32 (w0[2]);
452 w0[3] = swap32 (w0[3]);
453 w1[0] = swap32 (w1[0]);
454 w1[1] = swap32 (w1[1]);
455 w1[2] = swap32 (w1[2]);
456 w1[3] = swap32 (w1[3]);
457 w2[0] = swap32 (w2[0]);
458 w2[1] = swap32 (w2[1]);
459 w2[2] = swap32 (w2[2]);
460 w2[3] = swap32 (w2[3]);
461 w3[0] = swap32 (w3[0]);
462 w3[1] = swap32 (w3[1]);
463 w3[2] = swap32 (w3[2]);
464 w3[3] = swap32 (w3[3]);
469 hmac_sha256_pad (w0, w1, w2, w3, ipad, opad);
471 tmps[gid].ipad[0] = ipad[0];
472 tmps[gid].ipad[1] = ipad[1];
473 tmps[gid].ipad[2] = ipad[2];
474 tmps[gid].ipad[3] = ipad[3];
475 tmps[gid].ipad[4] = ipad[4];
476 tmps[gid].ipad[5] = ipad[5];
477 tmps[gid].ipad[6] = ipad[6];
478 tmps[gid].ipad[7] = ipad[7];
480 tmps[gid].opad[0] = opad[0];
481 tmps[gid].opad[1] = opad[1];
482 tmps[gid].opad[2] = opad[2];
483 tmps[gid].opad[3] = opad[3];
484 tmps[gid].opad[4] = opad[4];
485 tmps[gid].opad[5] = opad[5];
486 tmps[gid].opad[6] = opad[6];
487 tmps[gid].opad[7] = opad[7];
489 for (u32 i = 0, j = 1; i < 8; i += 8, j += 1)
493 hmac_sha256_run (salt_buf0, salt_buf1, salt_buf2, salt_buf3, ipad, opad, dgst);
495 tmps[gid].dgst[i + 0] = dgst[0];
496 tmps[gid].dgst[i + 1] = dgst[1];
497 tmps[gid].dgst[i + 2] = dgst[2];
498 tmps[gid].dgst[i + 3] = dgst[3];
499 tmps[gid].dgst[i + 4] = dgst[4];
500 tmps[gid].dgst[i + 5] = dgst[5];
501 tmps[gid].dgst[i + 6] = dgst[6];
502 tmps[gid].dgst[i + 7] = dgst[7];
504 tmps[gid].out[i + 0] = dgst[0];
505 tmps[gid].out[i + 1] = dgst[1];
506 tmps[gid].out[i + 2] = dgst[2];
507 tmps[gid].out[i + 3] = dgst[3];
508 tmps[gid].out[i + 4] = dgst[4];
509 tmps[gid].out[i + 5] = dgst[5];
510 tmps[gid].out[i + 6] = dgst[6];
511 tmps[gid].out[i + 7] = dgst[7];
515 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m12800_loop (__global pw_t *pws, __global gpu_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 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
517 const u32 gid = get_global_id (0);
519 if (gid >= gid_max) return;
523 ipad[0] = tmps[gid].ipad[0];
524 ipad[1] = tmps[gid].ipad[1];
525 ipad[2] = tmps[gid].ipad[2];
526 ipad[3] = tmps[gid].ipad[3];
527 ipad[4] = tmps[gid].ipad[4];
528 ipad[5] = tmps[gid].ipad[5];
529 ipad[6] = tmps[gid].ipad[6];
530 ipad[7] = tmps[gid].ipad[7];
534 opad[0] = tmps[gid].opad[0];
535 opad[1] = tmps[gid].opad[1];
536 opad[2] = tmps[gid].opad[2];
537 opad[3] = tmps[gid].opad[3];
538 opad[4] = tmps[gid].opad[4];
539 opad[5] = tmps[gid].opad[5];
540 opad[6] = tmps[gid].opad[6];
541 opad[7] = tmps[gid].opad[7];
543 for (u32 i = 0; i < 8; i += 8)
547 dgst[0] = tmps[gid].dgst[i + 0];
548 dgst[1] = tmps[gid].dgst[i + 1];
549 dgst[2] = tmps[gid].dgst[i + 2];
550 dgst[3] = tmps[gid].dgst[i + 3];
551 dgst[4] = tmps[gid].dgst[i + 4];
552 dgst[5] = tmps[gid].dgst[i + 5];
553 dgst[6] = tmps[gid].dgst[i + 6];
554 dgst[7] = tmps[gid].dgst[i + 7];
558 out[0] = tmps[gid].out[i + 0];
559 out[1] = tmps[gid].out[i + 1];
560 out[2] = tmps[gid].out[i + 2];
561 out[3] = tmps[gid].out[i + 3];
562 out[4] = tmps[gid].out[i + 4];
563 out[5] = tmps[gid].out[i + 5];
564 out[6] = tmps[gid].out[i + 6];
565 out[7] = tmps[gid].out[i + 7];
567 for (u32 j = 0; j < loop_cnt; j++)
589 w3[3] = (64 + 32) * 8;
591 hmac_sha256_run (w0, w1, w2, w3, ipad, opad, dgst);
603 tmps[gid].dgst[i + 0] = dgst[0];
604 tmps[gid].dgst[i + 1] = dgst[1];
605 tmps[gid].dgst[i + 2] = dgst[2];
606 tmps[gid].dgst[i + 3] = dgst[3];
607 tmps[gid].dgst[i + 4] = dgst[4];
608 tmps[gid].dgst[i + 5] = dgst[5];
609 tmps[gid].dgst[i + 6] = dgst[6];
610 tmps[gid].dgst[i + 7] = dgst[7];
612 tmps[gid].out[i + 0] = out[0];
613 tmps[gid].out[i + 1] = out[1];
614 tmps[gid].out[i + 2] = out[2];
615 tmps[gid].out[i + 3] = out[3];
616 tmps[gid].out[i + 4] = out[4];
617 tmps[gid].out[i + 5] = out[5];
618 tmps[gid].out[i + 6] = out[6];
619 tmps[gid].out[i + 7] = out[7];
623 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m12800_comp (__global pw_t *pws, __global gpu_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 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
629 const u32 gid = get_global_id (0);
631 if (gid >= gid_max) return;
633 const u32 lid = get_local_id (0);
635 const u32 r0 = tmps[gid].out[DGST_R0];
636 const u32 r1 = tmps[gid].out[DGST_R1];
637 const u32 r2 = tmps[gid].out[DGST_R2];
638 const u32 r3 = tmps[gid].out[DGST_R3];