2 * Author......: Jens Steube <jens.steube@gmail.com>
8 #include "include/constants.h"
9 #include "include/kernel_vendor.h"
28 #include "include/kernel_functions.c"
30 #include "types_amd.c"
31 #include "common_amd.c"
34 #define VECT_COMPARE_M "check_multi_vect1_comp4.c"
38 #define uint_to_hex_lower8(i) l_bin2asc[(i)]
41 __constant u32 k_sha256[64] =
43 SHA256C00, SHA256C01, SHA256C02, SHA256C03,
44 SHA256C04, SHA256C05, SHA256C06, SHA256C07,
45 SHA256C08, SHA256C09, SHA256C0a, SHA256C0b,
46 SHA256C0c, SHA256C0d, SHA256C0e, SHA256C0f,
47 SHA256C10, SHA256C11, SHA256C12, SHA256C13,
48 SHA256C14, SHA256C15, SHA256C16, SHA256C17,
49 SHA256C18, SHA256C19, SHA256C1a, SHA256C1b,
50 SHA256C1c, SHA256C1d, SHA256C1e, SHA256C1f,
51 SHA256C20, SHA256C21, SHA256C22, SHA256C23,
52 SHA256C24, SHA256C25, SHA256C26, SHA256C27,
53 SHA256C28, SHA256C29, SHA256C2a, SHA256C2b,
54 SHA256C2c, SHA256C2d, SHA256C2e, SHA256C2f,
55 SHA256C30, SHA256C31, SHA256C32, SHA256C33,
56 SHA256C34, SHA256C35, SHA256C36, SHA256C37,
57 SHA256C38, SHA256C39, SHA256C3a, SHA256C3b,
58 SHA256C3c, SHA256C3d, SHA256C3e, SHA256C3f,
61 static void md4_transform (const u32x w0[4], const u32x w1[4], const u32x w2[4], const u32x w3[4], u32x digest[4])
68 MD4_STEP (MD4_Fo, a, b, c, d, w0[0], MD4C00, MD4S00);
69 MD4_STEP (MD4_Fo, d, a, b, c, w0[1], MD4C00, MD4S01);
70 MD4_STEP (MD4_Fo, c, d, a, b, w0[2], MD4C00, MD4S02);
71 MD4_STEP (MD4_Fo, b, c, d, a, w0[3], MD4C00, MD4S03);
72 MD4_STEP (MD4_Fo, a, b, c, d, w1[0], MD4C00, MD4S00);
73 MD4_STEP (MD4_Fo, d, a, b, c, w1[1], MD4C00, MD4S01);
74 MD4_STEP (MD4_Fo, c, d, a, b, w1[2], MD4C00, MD4S02);
75 MD4_STEP (MD4_Fo, b, c, d, a, w1[3], MD4C00, MD4S03);
76 MD4_STEP (MD4_Fo, a, b, c, d, w2[0], MD4C00, MD4S00);
77 MD4_STEP (MD4_Fo, d, a, b, c, w2[1], MD4C00, MD4S01);
78 MD4_STEP (MD4_Fo, c, d, a, b, w2[2], MD4C00, MD4S02);
79 MD4_STEP (MD4_Fo, b, c, d, a, w2[3], MD4C00, MD4S03);
80 MD4_STEP (MD4_Fo, a, b, c, d, w3[0], MD4C00, MD4S00);
81 MD4_STEP (MD4_Fo, d, a, b, c, w3[1], MD4C00, MD4S01);
82 MD4_STEP (MD4_Fo, c, d, a, b, w3[2], MD4C00, MD4S02);
83 MD4_STEP (MD4_Fo, b, c, d, a, w3[3], MD4C00, MD4S03);
85 MD4_STEP (MD4_Go, a, b, c, d, w0[0], MD4C01, MD4S10);
86 MD4_STEP (MD4_Go, d, a, b, c, w1[0], MD4C01, MD4S11);
87 MD4_STEP (MD4_Go, c, d, a, b, w2[0], MD4C01, MD4S12);
88 MD4_STEP (MD4_Go, b, c, d, a, w3[0], MD4C01, MD4S13);
89 MD4_STEP (MD4_Go, a, b, c, d, w0[1], MD4C01, MD4S10);
90 MD4_STEP (MD4_Go, d, a, b, c, w1[1], MD4C01, MD4S11);
91 MD4_STEP (MD4_Go, c, d, a, b, w2[1], MD4C01, MD4S12);
92 MD4_STEP (MD4_Go, b, c, d, a, w3[1], MD4C01, MD4S13);
93 MD4_STEP (MD4_Go, a, b, c, d, w0[2], MD4C01, MD4S10);
94 MD4_STEP (MD4_Go, d, a, b, c, w1[2], MD4C01, MD4S11);
95 MD4_STEP (MD4_Go, c, d, a, b, w2[2], MD4C01, MD4S12);
96 MD4_STEP (MD4_Go, b, c, d, a, w3[2], MD4C01, MD4S13);
97 MD4_STEP (MD4_Go, a, b, c, d, w0[3], MD4C01, MD4S10);
98 MD4_STEP (MD4_Go, d, a, b, c, w1[3], MD4C01, MD4S11);
99 MD4_STEP (MD4_Go, c, d, a, b, w2[3], MD4C01, MD4S12);
100 MD4_STEP (MD4_Go, b, c, d, a, w3[3], MD4C01, MD4S13);
102 MD4_STEP (MD4_H , a, b, c, d, w0[0], MD4C02, MD4S20);
103 MD4_STEP (MD4_H , d, a, b, c, w2[0], MD4C02, MD4S21);
104 MD4_STEP (MD4_H , c, d, a, b, w1[0], MD4C02, MD4S22);
105 MD4_STEP (MD4_H , b, c, d, a, w3[0], MD4C02, MD4S23);
106 MD4_STEP (MD4_H , a, b, c, d, w0[2], MD4C02, MD4S20);
107 MD4_STEP (MD4_H , d, a, b, c, w2[2], MD4C02, MD4S21);
108 MD4_STEP (MD4_H , c, d, a, b, w1[2], MD4C02, MD4S22);
109 MD4_STEP (MD4_H , b, c, d, a, w3[2], MD4C02, MD4S23);
110 MD4_STEP (MD4_H , a, b, c, d, w0[1], MD4C02, MD4S20);
111 MD4_STEP (MD4_H , d, a, b, c, w2[1], MD4C02, MD4S21);
112 MD4_STEP (MD4_H , c, d, a, b, w1[1], MD4C02, MD4S22);
113 MD4_STEP (MD4_H , b, c, d, a, w3[1], MD4C02, MD4S23);
114 MD4_STEP (MD4_H , a, b, c, d, w0[3], MD4C02, MD4S20);
115 MD4_STEP (MD4_H , d, a, b, c, w2[3], MD4C02, MD4S21);
116 MD4_STEP (MD4_H , c, d, a, b, w1[3], MD4C02, MD4S22);
117 MD4_STEP (MD4_H , b, c, d, a, w3[3], MD4C02, MD4S23);
125 static void sha256_transform (const u32x w0[4], const u32x w1[4], const u32x w2[4], const u32x w3[4], u32x digest[8])
153 #define ROUND_EXPAND() \
155 w0_t = SHA256_EXPAND (we_t, w9_t, w1_t, w0_t); \
156 w1_t = SHA256_EXPAND (wf_t, wa_t, w2_t, w1_t); \
157 w2_t = SHA256_EXPAND (w0_t, wb_t, w3_t, w2_t); \
158 w3_t = SHA256_EXPAND (w1_t, wc_t, w4_t, w3_t); \
159 w4_t = SHA256_EXPAND (w2_t, wd_t, w5_t, w4_t); \
160 w5_t = SHA256_EXPAND (w3_t, we_t, w6_t, w5_t); \
161 w6_t = SHA256_EXPAND (w4_t, wf_t, w7_t, w6_t); \
162 w7_t = SHA256_EXPAND (w5_t, w0_t, w8_t, w7_t); \
163 w8_t = SHA256_EXPAND (w6_t, w1_t, w9_t, w8_t); \
164 w9_t = SHA256_EXPAND (w7_t, w2_t, wa_t, w9_t); \
165 wa_t = SHA256_EXPAND (w8_t, w3_t, wb_t, wa_t); \
166 wb_t = SHA256_EXPAND (w9_t, w4_t, wc_t, wb_t); \
167 wc_t = SHA256_EXPAND (wa_t, w5_t, wd_t, wc_t); \
168 wd_t = SHA256_EXPAND (wb_t, w6_t, we_t, wd_t); \
169 we_t = SHA256_EXPAND (wc_t, w7_t, wf_t, we_t); \
170 wf_t = SHA256_EXPAND (wd_t, w8_t, w0_t, wf_t); \
173 #define ROUND_STEP(i) \
175 SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, k_sha256[i + 0]); \
176 SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, k_sha256[i + 1]); \
177 SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, k_sha256[i + 2]); \
178 SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, k_sha256[i + 3]); \
179 SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, k_sha256[i + 4]); \
180 SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, k_sha256[i + 5]); \
181 SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, k_sha256[i + 6]); \
182 SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, k_sha256[i + 7]); \
183 SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, k_sha256[i + 8]); \
184 SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, k_sha256[i + 9]); \
185 SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, k_sha256[i + 10]); \
186 SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, k_sha256[i + 11]); \
187 SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, k_sha256[i + 12]); \
188 SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, k_sha256[i + 13]); \
189 SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, k_sha256[i + 14]); \
190 SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, k_sha256[i + 15]); \
196 for (int i = 16; i < 64; i += 16)
198 ROUND_EXPAND (); ROUND_STEP (i);
211 static void hmac_sha256_pad (u32x w0[4], u32x w1[4], u32x w2[4], u32x w3[4], u32x ipad[8], u32x opad[8])
213 w0[0] = w0[0] ^ 0x36363636;
214 w0[1] = w0[1] ^ 0x36363636;
215 w0[2] = w0[2] ^ 0x36363636;
216 w0[3] = w0[3] ^ 0x36363636;
217 w1[0] = w1[0] ^ 0x36363636;
218 w1[1] = w1[1] ^ 0x36363636;
219 w1[2] = w1[2] ^ 0x36363636;
220 w1[3] = w1[3] ^ 0x36363636;
221 w2[0] = w2[0] ^ 0x36363636;
222 w2[1] = w2[1] ^ 0x36363636;
223 w2[2] = w2[2] ^ 0x36363636;
224 w2[3] = w2[3] ^ 0x36363636;
225 w3[0] = w3[0] ^ 0x36363636;
226 w3[1] = w3[1] ^ 0x36363636;
227 w3[2] = w3[2] ^ 0x36363636;
228 w3[3] = w3[3] ^ 0x36363636;
239 sha256_transform (w0, w1, w2, w3, ipad);
241 w0[0] = w0[0] ^ 0x6a6a6a6a;
242 w0[1] = w0[1] ^ 0x6a6a6a6a;
243 w0[2] = w0[2] ^ 0x6a6a6a6a;
244 w0[3] = w0[3] ^ 0x6a6a6a6a;
245 w1[0] = w1[0] ^ 0x6a6a6a6a;
246 w1[1] = w1[1] ^ 0x6a6a6a6a;
247 w1[2] = w1[2] ^ 0x6a6a6a6a;
248 w1[3] = w1[3] ^ 0x6a6a6a6a;
249 w2[0] = w2[0] ^ 0x6a6a6a6a;
250 w2[1] = w2[1] ^ 0x6a6a6a6a;
251 w2[2] = w2[2] ^ 0x6a6a6a6a;
252 w2[3] = w2[3] ^ 0x6a6a6a6a;
253 w3[0] = w3[0] ^ 0x6a6a6a6a;
254 w3[1] = w3[1] ^ 0x6a6a6a6a;
255 w3[2] = w3[2] ^ 0x6a6a6a6a;
256 w3[3] = w3[3] ^ 0x6a6a6a6a;
267 sha256_transform (w0, w1, w2, w3, opad);
270 static 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])
281 sha256_transform (w0, w1, w2, w3, digest);
298 w3[3] = (64 + 32) * 8;
309 sha256_transform (w0, w1, w2, w3, digest);
312 __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)
318 const u32 gid = get_global_id (0);
319 const u32 lid = get_local_id (0);
325 __local u32 l_bin2asc[256];
327 const u32 lid4 = lid * 4;
329 const u32 lid40 = lid4 + 0;
330 const u32 lid41 = lid4 + 1;
331 const u32 lid42 = lid4 + 2;
332 const u32 lid43 = lid4 + 3;
334 const u32 v400 = (lid40 >> 0) & 15;
335 const u32 v401 = (lid40 >> 4) & 15;
336 const u32 v410 = (lid41 >> 0) & 15;
337 const u32 v411 = (lid41 >> 4) & 15;
338 const u32 v420 = (lid42 >> 0) & 15;
339 const u32 v421 = (lid42 >> 4) & 15;
340 const u32 v430 = (lid43 >> 0) & 15;
341 const u32 v431 = (lid43 >> 4) & 15;
343 l_bin2asc[lid40] = ((v400 < 10) ? '0' + v400 : 'A' - 10 + v400) << 8
344 | ((v401 < 10) ? '0' + v401 : 'A' - 10 + v401) << 0;
345 l_bin2asc[lid41] = ((v410 < 10) ? '0' + v410 : 'A' - 10 + v410) << 8
346 | ((v411 < 10) ? '0' + v411 : 'A' - 10 + v411) << 0;
347 l_bin2asc[lid42] = ((v420 < 10) ? '0' + v420 : 'A' - 10 + v420) << 8
348 | ((v421 < 10) ? '0' + v421 : 'A' - 10 + v421) << 0;
349 l_bin2asc[lid43] = ((v430 < 10) ? '0' + v430 : 'A' - 10 + v430) << 8
350 | ((v431 < 10) ? '0' + v431 : 'A' - 10 + v431) << 0;
352 barrier (CLK_LOCAL_MEM_FENCE);
354 if (gid >= gid_max) return;
362 w0[0] = pws[gid].i[0];
363 w0[1] = pws[gid].i[1];
364 w0[2] = pws[gid].i[2];
365 w0[3] = pws[gid].i[3];
369 w1[0] = pws[gid].i[4];
370 w1[1] = pws[gid].i[5];
388 const u32 pw_len = pws[gid].pw_len;
394 u32 salt_len = salt_bufs[salt_pos].salt_len;
398 salt_buf0[0] = swap_workaround (salt_bufs[salt_pos].salt_buf[0]);
399 salt_buf0[1] = swap_workaround (salt_bufs[salt_pos].salt_buf[1]);
400 salt_buf0[2] = swap_workaround (salt_bufs[salt_pos].salt_buf[2]);
401 salt_buf0[3] = swap_workaround (salt_bufs[salt_pos].salt_buf[3]);
422 salt_buf3[3] = (64 + salt_len + 4) * 8;
428 append_0x80_2 (w0, w1, pw_len);
430 make_unicode (w1, w2, w3);
431 make_unicode (w0, w0, w1);
433 w3[2] = pw_len * 2 * 8;
437 digest_md4[0] = MD4M_A;
438 digest_md4[1] = MD4M_B;
439 digest_md4[2] = MD4M_C;
440 digest_md4[3] = MD4M_D;
442 md4_transform (w0, w1, w2, w3, digest_md4);
444 w0[0] = uint_to_hex_lower8 ((digest_md4[0] >> 0) & 255) << 0
445 | uint_to_hex_lower8 ((digest_md4[0] >> 8) & 255) << 16;
446 w0[1] = uint_to_hex_lower8 ((digest_md4[0] >> 16) & 255) << 0
447 | uint_to_hex_lower8 ((digest_md4[0] >> 24) & 255) << 16;
448 w0[2] = uint_to_hex_lower8 ((digest_md4[1] >> 0) & 255) << 0
449 | uint_to_hex_lower8 ((digest_md4[1] >> 8) & 255) << 16;
450 w0[3] = uint_to_hex_lower8 ((digest_md4[1] >> 16) & 255) << 0
451 | uint_to_hex_lower8 ((digest_md4[1] >> 24) & 255) << 16;
452 w1[0] = uint_to_hex_lower8 ((digest_md4[2] >> 0) & 255) << 0
453 | uint_to_hex_lower8 ((digest_md4[2] >> 8) & 255) << 16;
454 w1[1] = uint_to_hex_lower8 ((digest_md4[2] >> 16) & 255) << 0
455 | uint_to_hex_lower8 ((digest_md4[2] >> 24) & 255) << 16;
456 w1[2] = uint_to_hex_lower8 ((digest_md4[3] >> 0) & 255) << 0
457 | uint_to_hex_lower8 ((digest_md4[3] >> 8) & 255) << 16;
458 w1[3] = uint_to_hex_lower8 ((digest_md4[3] >> 16) & 255) << 0
459 | uint_to_hex_lower8 ((digest_md4[3] >> 24) & 255) << 16;
461 make_unicode (w1, w2, w3);
462 make_unicode (w0, w0, w1);
464 w0[0] = swap_workaround (w0[0]);
465 w0[1] = swap_workaround (w0[1]);
466 w0[2] = swap_workaround (w0[2]);
467 w0[3] = swap_workaround (w0[3]);
468 w1[0] = swap_workaround (w1[0]);
469 w1[1] = swap_workaround (w1[1]);
470 w1[2] = swap_workaround (w1[2]);
471 w1[3] = swap_workaround (w1[3]);
472 w2[0] = swap_workaround (w2[0]);
473 w2[1] = swap_workaround (w2[1]);
474 w2[2] = swap_workaround (w2[2]);
475 w2[3] = swap_workaround (w2[3]);
476 w3[0] = swap_workaround (w3[0]);
477 w3[1] = swap_workaround (w3[1]);
478 w3[2] = swap_workaround (w3[2]);
479 w3[3] = swap_workaround (w3[3]);
484 hmac_sha256_pad (w0, w1, w2, w3, ipad, opad);
486 tmps[gid].ipad[0] = ipad[0];
487 tmps[gid].ipad[1] = ipad[1];
488 tmps[gid].ipad[2] = ipad[2];
489 tmps[gid].ipad[3] = ipad[3];
490 tmps[gid].ipad[4] = ipad[4];
491 tmps[gid].ipad[5] = ipad[5];
492 tmps[gid].ipad[6] = ipad[6];
493 tmps[gid].ipad[7] = ipad[7];
495 tmps[gid].opad[0] = opad[0];
496 tmps[gid].opad[1] = opad[1];
497 tmps[gid].opad[2] = opad[2];
498 tmps[gid].opad[3] = opad[3];
499 tmps[gid].opad[4] = opad[4];
500 tmps[gid].opad[5] = opad[5];
501 tmps[gid].opad[6] = opad[6];
502 tmps[gid].opad[7] = opad[7];
504 for (u32 i = 0, j = 1; i < 8; i += 8, j += 1)
508 hmac_sha256_run (salt_buf0, salt_buf1, salt_buf2, salt_buf3, ipad, opad, dgst);
510 tmps[gid].dgst[i + 0] = dgst[0];
511 tmps[gid].dgst[i + 1] = dgst[1];
512 tmps[gid].dgst[i + 2] = dgst[2];
513 tmps[gid].dgst[i + 3] = dgst[3];
514 tmps[gid].dgst[i + 4] = dgst[4];
515 tmps[gid].dgst[i + 5] = dgst[5];
516 tmps[gid].dgst[i + 6] = dgst[6];
517 tmps[gid].dgst[i + 7] = dgst[7];
519 tmps[gid].out[i + 0] = dgst[0];
520 tmps[gid].out[i + 1] = dgst[1];
521 tmps[gid].out[i + 2] = dgst[2];
522 tmps[gid].out[i + 3] = dgst[3];
523 tmps[gid].out[i + 4] = dgst[4];
524 tmps[gid].out[i + 5] = dgst[5];
525 tmps[gid].out[i + 6] = dgst[6];
526 tmps[gid].out[i + 7] = dgst[7];
530 __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)
532 const u32 gid = get_global_id (0);
534 if (gid >= gid_max) return;
538 ipad[0] = tmps[gid].ipad[0];
539 ipad[1] = tmps[gid].ipad[1];
540 ipad[2] = tmps[gid].ipad[2];
541 ipad[3] = tmps[gid].ipad[3];
542 ipad[4] = tmps[gid].ipad[4];
543 ipad[5] = tmps[gid].ipad[5];
544 ipad[6] = tmps[gid].ipad[6];
545 ipad[7] = tmps[gid].ipad[7];
549 opad[0] = tmps[gid].opad[0];
550 opad[1] = tmps[gid].opad[1];
551 opad[2] = tmps[gid].opad[2];
552 opad[3] = tmps[gid].opad[3];
553 opad[4] = tmps[gid].opad[4];
554 opad[5] = tmps[gid].opad[5];
555 opad[6] = tmps[gid].opad[6];
556 opad[7] = tmps[gid].opad[7];
558 for (u32 i = 0; i < 8; i += 8)
562 dgst[0] = tmps[gid].dgst[i + 0];
563 dgst[1] = tmps[gid].dgst[i + 1];
564 dgst[2] = tmps[gid].dgst[i + 2];
565 dgst[3] = tmps[gid].dgst[i + 3];
566 dgst[4] = tmps[gid].dgst[i + 4];
567 dgst[5] = tmps[gid].dgst[i + 5];
568 dgst[6] = tmps[gid].dgst[i + 6];
569 dgst[7] = tmps[gid].dgst[i + 7];
573 out[0] = tmps[gid].out[i + 0];
574 out[1] = tmps[gid].out[i + 1];
575 out[2] = tmps[gid].out[i + 2];
576 out[3] = tmps[gid].out[i + 3];
577 out[4] = tmps[gid].out[i + 4];
578 out[5] = tmps[gid].out[i + 5];
579 out[6] = tmps[gid].out[i + 6];
580 out[7] = tmps[gid].out[i + 7];
582 for (u32 j = 0; j < loop_cnt; j++)
604 w3[3] = (64 + 32) * 8;
606 hmac_sha256_run (w0, w1, w2, w3, ipad, opad, dgst);
618 tmps[gid].dgst[i + 0] = dgst[0];
619 tmps[gid].dgst[i + 1] = dgst[1];
620 tmps[gid].dgst[i + 2] = dgst[2];
621 tmps[gid].dgst[i + 3] = dgst[3];
622 tmps[gid].dgst[i + 4] = dgst[4];
623 tmps[gid].dgst[i + 5] = dgst[5];
624 tmps[gid].dgst[i + 6] = dgst[6];
625 tmps[gid].dgst[i + 7] = dgst[7];
627 tmps[gid].out[i + 0] = out[0];
628 tmps[gid].out[i + 1] = out[1];
629 tmps[gid].out[i + 2] = out[2];
630 tmps[gid].out[i + 3] = out[3];
631 tmps[gid].out[i + 4] = out[4];
632 tmps[gid].out[i + 5] = out[5];
633 tmps[gid].out[i + 6] = out[6];
634 tmps[gid].out[i + 7] = out[7];
638 __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)
644 const u32 gid = get_global_id (0);
646 if (gid >= gid_max) return;
648 const u32 lid = get_local_id (0);
650 const u32x r0 = tmps[gid].out[DGST_R0];
651 const u32x r1 = tmps[gid].out[DGST_R1];
652 const u32x r2 = tmps[gid].out[DGST_R2];
653 const u32x r3 = tmps[gid].out[DGST_R3];
657 #include VECT_COMPARE_M