2 * Author......: Jens Steube <jens.steube@gmail.com>
6 #define _PBKDF2_SHA256_
10 #include "inc_vendor.cl"
11 #include "inc_hash_constants.h"
12 #include "inc_hash_functions.cl"
13 #include "inc_types.cl"
14 #include "inc_common.cl"
15 #include "inc_simd.cl"
17 #define COMPARE_S "inc_comp_single.cl"
18 #define COMPARE_M "inc_comp_multi.cl"
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 sha256_transform_S (const u32 w0[4], const u32 w1[4], const u32 w2[4], const u32 w3[4], u32 digest[8])
68 #define ROUND_EXPAND_S() \
70 w0_t = SHA256_EXPAND_S (we_t, w9_t, w1_t, w0_t); \
71 w1_t = SHA256_EXPAND_S (wf_t, wa_t, w2_t, w1_t); \
72 w2_t = SHA256_EXPAND_S (w0_t, wb_t, w3_t, w2_t); \
73 w3_t = SHA256_EXPAND_S (w1_t, wc_t, w4_t, w3_t); \
74 w4_t = SHA256_EXPAND_S (w2_t, wd_t, w5_t, w4_t); \
75 w5_t = SHA256_EXPAND_S (w3_t, we_t, w6_t, w5_t); \
76 w6_t = SHA256_EXPAND_S (w4_t, wf_t, w7_t, w6_t); \
77 w7_t = SHA256_EXPAND_S (w5_t, w0_t, w8_t, w7_t); \
78 w8_t = SHA256_EXPAND_S (w6_t, w1_t, w9_t, w8_t); \
79 w9_t = SHA256_EXPAND_S (w7_t, w2_t, wa_t, w9_t); \
80 wa_t = SHA256_EXPAND_S (w8_t, w3_t, wb_t, wa_t); \
81 wb_t = SHA256_EXPAND_S (w9_t, w4_t, wc_t, wb_t); \
82 wc_t = SHA256_EXPAND_S (wa_t, w5_t, wd_t, wc_t); \
83 wd_t = SHA256_EXPAND_S (wb_t, w6_t, we_t, wd_t); \
84 we_t = SHA256_EXPAND_S (wc_t, w7_t, wf_t, we_t); \
85 wf_t = SHA256_EXPAND_S (wd_t, w8_t, w0_t, wf_t); \
88 #define ROUND_STEP_S(i) \
90 SHA256_STEP_S (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, k_sha256[i + 0]); \
91 SHA256_STEP_S (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, k_sha256[i + 1]); \
92 SHA256_STEP_S (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, k_sha256[i + 2]); \
93 SHA256_STEP_S (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, k_sha256[i + 3]); \
94 SHA256_STEP_S (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, k_sha256[i + 4]); \
95 SHA256_STEP_S (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, k_sha256[i + 5]); \
96 SHA256_STEP_S (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, k_sha256[i + 6]); \
97 SHA256_STEP_S (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, k_sha256[i + 7]); \
98 SHA256_STEP_S (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, k_sha256[i + 8]); \
99 SHA256_STEP_S (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, k_sha256[i + 9]); \
100 SHA256_STEP_S (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, k_sha256[i + 10]); \
101 SHA256_STEP_S (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, k_sha256[i + 11]); \
102 SHA256_STEP_S (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, k_sha256[i + 12]); \
103 SHA256_STEP_S (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, k_sha256[i + 13]); \
104 SHA256_STEP_S (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, k_sha256[i + 14]); \
105 SHA256_STEP_S (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, k_sha256[i + 15]); \
113 for (int i = 16; i < 64; i += 16)
115 ROUND_EXPAND_S (); ROUND_STEP_S (i);
128 void hmac_sha256_pad_S (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], u32 ipad[8], u32 opad[8])
130 w0[0] = w0[0] ^ 0x36363636;
131 w0[1] = w0[1] ^ 0x36363636;
132 w0[2] = w0[2] ^ 0x36363636;
133 w0[3] = w0[3] ^ 0x36363636;
134 w1[0] = w1[0] ^ 0x36363636;
135 w1[1] = w1[1] ^ 0x36363636;
136 w1[2] = w1[2] ^ 0x36363636;
137 w1[3] = w1[3] ^ 0x36363636;
138 w2[0] = w2[0] ^ 0x36363636;
139 w2[1] = w2[1] ^ 0x36363636;
140 w2[2] = w2[2] ^ 0x36363636;
141 w2[3] = w2[3] ^ 0x36363636;
142 w3[0] = w3[0] ^ 0x36363636;
143 w3[1] = w3[1] ^ 0x36363636;
144 w3[2] = w3[2] ^ 0x36363636;
145 w3[3] = w3[3] ^ 0x36363636;
156 sha256_transform_S (w0, w1, w2, w3, ipad);
158 w0[0] = w0[0] ^ 0x6a6a6a6a;
159 w0[1] = w0[1] ^ 0x6a6a6a6a;
160 w0[2] = w0[2] ^ 0x6a6a6a6a;
161 w0[3] = w0[3] ^ 0x6a6a6a6a;
162 w1[0] = w1[0] ^ 0x6a6a6a6a;
163 w1[1] = w1[1] ^ 0x6a6a6a6a;
164 w1[2] = w1[2] ^ 0x6a6a6a6a;
165 w1[3] = w1[3] ^ 0x6a6a6a6a;
166 w2[0] = w2[0] ^ 0x6a6a6a6a;
167 w2[1] = w2[1] ^ 0x6a6a6a6a;
168 w2[2] = w2[2] ^ 0x6a6a6a6a;
169 w2[3] = w2[3] ^ 0x6a6a6a6a;
170 w3[0] = w3[0] ^ 0x6a6a6a6a;
171 w3[1] = w3[1] ^ 0x6a6a6a6a;
172 w3[2] = w3[2] ^ 0x6a6a6a6a;
173 w3[3] = w3[3] ^ 0x6a6a6a6a;
184 sha256_transform_S (w0, w1, w2, w3, opad);
187 void hmac_sha256_run_S (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], u32 ipad[8], u32 opad[8], u32 digest[8])
198 sha256_transform_S (w0, w1, w2, w3, digest);
215 w3[3] = (64 + 32) * 8;
226 sha256_transform_S (w0, w1, w2, w3, digest);
229 void sha256_transform_V (const u32x w0[4], const u32x w1[4], const u32x w2[4], const u32x w3[4], u32x digest[8])
257 #define ROUND_EXPAND() \
259 w0_t = SHA256_EXPAND (we_t, w9_t, w1_t, w0_t); \
260 w1_t = SHA256_EXPAND (wf_t, wa_t, w2_t, w1_t); \
261 w2_t = SHA256_EXPAND (w0_t, wb_t, w3_t, w2_t); \
262 w3_t = SHA256_EXPAND (w1_t, wc_t, w4_t, w3_t); \
263 w4_t = SHA256_EXPAND (w2_t, wd_t, w5_t, w4_t); \
264 w5_t = SHA256_EXPAND (w3_t, we_t, w6_t, w5_t); \
265 w6_t = SHA256_EXPAND (w4_t, wf_t, w7_t, w6_t); \
266 w7_t = SHA256_EXPAND (w5_t, w0_t, w8_t, w7_t); \
267 w8_t = SHA256_EXPAND (w6_t, w1_t, w9_t, w8_t); \
268 w9_t = SHA256_EXPAND (w7_t, w2_t, wa_t, w9_t); \
269 wa_t = SHA256_EXPAND (w8_t, w3_t, wb_t, wa_t); \
270 wb_t = SHA256_EXPAND (w9_t, w4_t, wc_t, wb_t); \
271 wc_t = SHA256_EXPAND (wa_t, w5_t, wd_t, wc_t); \
272 wd_t = SHA256_EXPAND (wb_t, w6_t, we_t, wd_t); \
273 we_t = SHA256_EXPAND (wc_t, w7_t, wf_t, we_t); \
274 wf_t = SHA256_EXPAND (wd_t, w8_t, w0_t, wf_t); \
277 #define ROUND_STEP(i) \
279 SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, k_sha256[i + 0]); \
280 SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, k_sha256[i + 1]); \
281 SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, k_sha256[i + 2]); \
282 SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, k_sha256[i + 3]); \
283 SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, k_sha256[i + 4]); \
284 SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, k_sha256[i + 5]); \
285 SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, k_sha256[i + 6]); \
286 SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, k_sha256[i + 7]); \
287 SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, k_sha256[i + 8]); \
288 SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, k_sha256[i + 9]); \
289 SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, k_sha256[i + 10]); \
290 SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, k_sha256[i + 11]); \
291 SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, k_sha256[i + 12]); \
292 SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, k_sha256[i + 13]); \
293 SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, k_sha256[i + 14]); \
294 SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, k_sha256[i + 15]); \
302 for (int i = 16; i < 64; i += 16)
304 ROUND_EXPAND (); ROUND_STEP (i);
317 void hmac_sha256_pad_V (u32x w0[4], u32x w1[4], u32x w2[4], u32x w3[4], u32x ipad[8], u32x opad[8])
319 w0[0] = w0[0] ^ 0x36363636;
320 w0[1] = w0[1] ^ 0x36363636;
321 w0[2] = w0[2] ^ 0x36363636;
322 w0[3] = w0[3] ^ 0x36363636;
323 w1[0] = w1[0] ^ 0x36363636;
324 w1[1] = w1[1] ^ 0x36363636;
325 w1[2] = w1[2] ^ 0x36363636;
326 w1[3] = w1[3] ^ 0x36363636;
327 w2[0] = w2[0] ^ 0x36363636;
328 w2[1] = w2[1] ^ 0x36363636;
329 w2[2] = w2[2] ^ 0x36363636;
330 w2[3] = w2[3] ^ 0x36363636;
331 w3[0] = w3[0] ^ 0x36363636;
332 w3[1] = w3[1] ^ 0x36363636;
333 w3[2] = w3[2] ^ 0x36363636;
334 w3[3] = w3[3] ^ 0x36363636;
345 sha256_transform_V (w0, w1, w2, w3, ipad);
347 w0[0] = w0[0] ^ 0x6a6a6a6a;
348 w0[1] = w0[1] ^ 0x6a6a6a6a;
349 w0[2] = w0[2] ^ 0x6a6a6a6a;
350 w0[3] = w0[3] ^ 0x6a6a6a6a;
351 w1[0] = w1[0] ^ 0x6a6a6a6a;
352 w1[1] = w1[1] ^ 0x6a6a6a6a;
353 w1[2] = w1[2] ^ 0x6a6a6a6a;
354 w1[3] = w1[3] ^ 0x6a6a6a6a;
355 w2[0] = w2[0] ^ 0x6a6a6a6a;
356 w2[1] = w2[1] ^ 0x6a6a6a6a;
357 w2[2] = w2[2] ^ 0x6a6a6a6a;
358 w2[3] = w2[3] ^ 0x6a6a6a6a;
359 w3[0] = w3[0] ^ 0x6a6a6a6a;
360 w3[1] = w3[1] ^ 0x6a6a6a6a;
361 w3[2] = w3[2] ^ 0x6a6a6a6a;
362 w3[3] = w3[3] ^ 0x6a6a6a6a;
373 sha256_transform_V (w0, w1, w2, w3, opad);
376 void hmac_sha256_run_V (u32x w0[4], u32x w1[4], u32x w2[4], u32x w3[4], u32x ipad[8], u32x opad[8], u32x digest[8])
387 sha256_transform_V (w0, w1, w2, w3, digest);
404 w3[3] = (64 + 32) * 8;
415 sha256_transform_V (w0, w1, w2, w3, digest);
418 __kernel void m10900_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)
424 const u32 gid = get_global_id (0);
426 if (gid >= gid_max) return;
430 w0[0] = swap32_S (pws[gid].i[ 0]);
431 w0[1] = swap32_S (pws[gid].i[ 1]);
432 w0[2] = swap32_S (pws[gid].i[ 2]);
433 w0[3] = swap32_S (pws[gid].i[ 3]);
437 w1[0] = swap32_S (pws[gid].i[ 4]);
438 w1[1] = swap32_S (pws[gid].i[ 5]);
439 w1[2] = swap32_S (pws[gid].i[ 6]);
440 w1[3] = swap32_S (pws[gid].i[ 7]);
444 w2[0] = swap32_S (pws[gid].i[ 8]);
445 w2[1] = swap32_S (pws[gid].i[ 9]);
446 w2[2] = swap32_S (pws[gid].i[10]);
447 w2[3] = swap32_S (pws[gid].i[11]);
451 w3[0] = swap32_S (pws[gid].i[12]);
452 w3[1] = swap32_S (pws[gid].i[13]);
453 w3[2] = swap32_S (pws[gid].i[14]);
454 w3[3] = swap32_S (pws[gid].i[15]);
460 const u32 salt_len = salt_bufs[salt_pos].salt_len;
467 esalt_buf0[0] = swap32_S (esalt_bufs[salt_pos].salt_buf[ 0]);
468 esalt_buf0[1] = swap32_S (esalt_bufs[salt_pos].salt_buf[ 1]);
469 esalt_buf0[2] = swap32_S (esalt_bufs[salt_pos].salt_buf[ 2]);
470 esalt_buf0[3] = swap32_S (esalt_bufs[salt_pos].salt_buf[ 3]);
471 esalt_buf1[0] = swap32_S (esalt_bufs[salt_pos].salt_buf[ 4]);
472 esalt_buf1[1] = swap32_S (esalt_bufs[salt_pos].salt_buf[ 5]);
473 esalt_buf1[2] = swap32_S (esalt_bufs[salt_pos].salt_buf[ 6]);
474 esalt_buf1[3] = swap32_S (esalt_bufs[salt_pos].salt_buf[ 7]);
475 esalt_buf2[0] = swap32_S (esalt_bufs[salt_pos].salt_buf[ 8]);
476 esalt_buf2[1] = swap32_S (esalt_bufs[salt_pos].salt_buf[ 9]);
477 esalt_buf2[2] = swap32_S (esalt_bufs[salt_pos].salt_buf[10]);
478 esalt_buf2[3] = swap32_S (esalt_bufs[salt_pos].salt_buf[11]);
479 esalt_buf3[0] = swap32_S (esalt_bufs[salt_pos].salt_buf[12]);
480 esalt_buf3[1] = swap32_S (esalt_bufs[salt_pos].salt_buf[13]);
482 esalt_buf3[3] = (64 + salt_len + 4) * 8;
487 hmac_sha256_pad_S (w0, w1, w2, w3, ipad, opad);
489 tmps[gid].ipad[0] = ipad[0];
490 tmps[gid].ipad[1] = ipad[1];
491 tmps[gid].ipad[2] = ipad[2];
492 tmps[gid].ipad[3] = ipad[3];
493 tmps[gid].ipad[4] = ipad[4];
494 tmps[gid].ipad[5] = ipad[5];
495 tmps[gid].ipad[6] = ipad[6];
496 tmps[gid].ipad[7] = ipad[7];
498 tmps[gid].opad[0] = opad[0];
499 tmps[gid].opad[1] = opad[1];
500 tmps[gid].opad[2] = opad[2];
501 tmps[gid].opad[3] = opad[3];
502 tmps[gid].opad[4] = opad[4];
503 tmps[gid].opad[5] = opad[5];
504 tmps[gid].opad[6] = opad[6];
505 tmps[gid].opad[7] = opad[7];
507 for (u32 i = 0, j = 1; i < 8; i += 8, j += 1)
511 hmac_sha256_run_S (esalt_buf0, esalt_buf1, esalt_buf2, esalt_buf3, ipad, opad, dgst);
513 tmps[gid].dgst[i + 0] = dgst[0];
514 tmps[gid].dgst[i + 1] = dgst[1];
515 tmps[gid].dgst[i + 2] = dgst[2];
516 tmps[gid].dgst[i + 3] = dgst[3];
517 tmps[gid].dgst[i + 4] = dgst[4];
518 tmps[gid].dgst[i + 5] = dgst[5];
519 tmps[gid].dgst[i + 6] = dgst[6];
520 tmps[gid].dgst[i + 7] = dgst[7];
522 tmps[gid].out[i + 0] = dgst[0];
523 tmps[gid].out[i + 1] = dgst[1];
524 tmps[gid].out[i + 2] = dgst[2];
525 tmps[gid].out[i + 3] = dgst[3];
526 tmps[gid].out[i + 4] = dgst[4];
527 tmps[gid].out[i + 5] = dgst[5];
528 tmps[gid].out[i + 6] = dgst[6];
529 tmps[gid].out[i + 7] = dgst[7];
533 __kernel void m10900_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)
535 const u32 gid = get_global_id (0);
537 if (gid >= gid_max) return;
542 ipad[0] = packv (tmps, ipad, gid, 0);
543 ipad[1] = packv (tmps, ipad, gid, 1);
544 ipad[2] = packv (tmps, ipad, gid, 2);
545 ipad[3] = packv (tmps, ipad, gid, 3);
546 ipad[4] = packv (tmps, ipad, gid, 4);
547 ipad[5] = packv (tmps, ipad, gid, 5);
548 ipad[6] = packv (tmps, ipad, gid, 6);
549 ipad[7] = packv (tmps, ipad, gid, 7);
551 opad[0] = packv (tmps, opad, gid, 0);
552 opad[1] = packv (tmps, opad, gid, 1);
553 opad[2] = packv (tmps, opad, gid, 2);
554 opad[3] = packv (tmps, opad, gid, 3);
555 opad[4] = packv (tmps, opad, gid, 4);
556 opad[5] = packv (tmps, opad, gid, 5);
557 opad[6] = packv (tmps, opad, gid, 6);
558 opad[7] = packv (tmps, opad, gid, 7);
560 for (u32 i = 0; i < 8; i += 8)
565 dgst[0] = packv (tmps, dgst, gid, 0);
566 dgst[1] = packv (tmps, dgst, gid, 1);
567 dgst[2] = packv (tmps, dgst, gid, 2);
568 dgst[3] = packv (tmps, dgst, gid, 3);
569 dgst[4] = packv (tmps, dgst, gid, 4);
570 dgst[5] = packv (tmps, dgst, gid, 5);
571 dgst[6] = packv (tmps, dgst, gid, 6);
572 dgst[7] = packv (tmps, dgst, gid, 7);
574 out[0] = packv (tmps, out, gid, 0);
575 out[1] = packv (tmps, out, gid, 1);
576 out[2] = packv (tmps, out, gid, 2);
577 out[3] = packv (tmps, out, gid, 3);
578 out[4] = packv (tmps, out, gid, 4);
579 out[5] = packv (tmps, out, gid, 5);
580 out[6] = packv (tmps, out, gid, 6);
581 out[7] = packv (tmps, out, gid, 7);
583 for (u32 j = 0; j < loop_cnt; j++)
605 w3[3] = (64 + 32) * 8;
607 hmac_sha256_run_V (w0, w1, w2, w3, ipad, opad, dgst);
619 unpackv (tmps, dgst, gid, 0, dgst[0]);
620 unpackv (tmps, dgst, gid, 1, dgst[1]);
621 unpackv (tmps, dgst, gid, 2, dgst[2]);
622 unpackv (tmps, dgst, gid, 3, dgst[3]);
623 unpackv (tmps, dgst, gid, 4, dgst[4]);
624 unpackv (tmps, dgst, gid, 5, dgst[5]);
625 unpackv (tmps, dgst, gid, 6, dgst[6]);
626 unpackv (tmps, dgst, gid, 7, dgst[7]);
628 unpackv (tmps, out, gid, 0, out[0]);
629 unpackv (tmps, out, gid, 1, out[1]);
630 unpackv (tmps, out, gid, 2, out[2]);
631 unpackv (tmps, out, gid, 3, out[3]);
632 unpackv (tmps, out, gid, 4, out[4]);
633 unpackv (tmps, out, gid, 5, out[5]);
634 unpackv (tmps, out, gid, 6, out[6]);
635 unpackv (tmps, out, gid, 7, out[7]);
639 __kernel void m10900_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)
645 const u32 gid = get_global_id (0);
647 if (gid >= gid_max) return;
649 const u32 lid = get_local_id (0);
651 const u32 r0 = tmps[gid].out[DGST_R0];
652 const u32 r1 = tmps[gid].out[DGST_R1];
653 const u32 r2 = tmps[gid].out[DGST_R2];
654 const u32 r3 = tmps[gid].out[DGST_R3];