2 * Author......: Jens Steube <jens.steube@gmail.com>
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 void md5_transform (const u32x w0[4], const u32x w1[4], const u32x w2[4], const u32x w3[4], u32x digest[4])
41 MD5_STEP (MD5_Fo, a, b, c, d, w0_t, MD5C00, MD5S00);
42 MD5_STEP (MD5_Fo, d, a, b, c, w1_t, MD5C01, MD5S01);
43 MD5_STEP (MD5_Fo, c, d, a, b, w2_t, MD5C02, MD5S02);
44 MD5_STEP (MD5_Fo, b, c, d, a, w3_t, MD5C03, MD5S03);
45 MD5_STEP (MD5_Fo, a, b, c, d, w4_t, MD5C04, MD5S00);
46 MD5_STEP (MD5_Fo, d, a, b, c, w5_t, MD5C05, MD5S01);
47 MD5_STEP (MD5_Fo, c, d, a, b, w6_t, MD5C06, MD5S02);
48 MD5_STEP (MD5_Fo, b, c, d, a, w7_t, MD5C07, MD5S03);
49 MD5_STEP (MD5_Fo, a, b, c, d, w8_t, MD5C08, MD5S00);
50 MD5_STEP (MD5_Fo, d, a, b, c, w9_t, MD5C09, MD5S01);
51 MD5_STEP (MD5_Fo, c, d, a, b, wa_t, MD5C0a, MD5S02);
52 MD5_STEP (MD5_Fo, b, c, d, a, wb_t, MD5C0b, MD5S03);
53 MD5_STEP (MD5_Fo, a, b, c, d, wc_t, MD5C0c, MD5S00);
54 MD5_STEP (MD5_Fo, d, a, b, c, wd_t, MD5C0d, MD5S01);
55 MD5_STEP (MD5_Fo, c, d, a, b, we_t, MD5C0e, MD5S02);
56 MD5_STEP (MD5_Fo, b, c, d, a, wf_t, MD5C0f, MD5S03);
58 MD5_STEP (MD5_Go, a, b, c, d, w1_t, MD5C10, MD5S10);
59 MD5_STEP (MD5_Go, d, a, b, c, w6_t, MD5C11, MD5S11);
60 MD5_STEP (MD5_Go, c, d, a, b, wb_t, MD5C12, MD5S12);
61 MD5_STEP (MD5_Go, b, c, d, a, w0_t, MD5C13, MD5S13);
62 MD5_STEP (MD5_Go, a, b, c, d, w5_t, MD5C14, MD5S10);
63 MD5_STEP (MD5_Go, d, a, b, c, wa_t, MD5C15, MD5S11);
64 MD5_STEP (MD5_Go, c, d, a, b, wf_t, MD5C16, MD5S12);
65 MD5_STEP (MD5_Go, b, c, d, a, w4_t, MD5C17, MD5S13);
66 MD5_STEP (MD5_Go, a, b, c, d, w9_t, MD5C18, MD5S10);
67 MD5_STEP (MD5_Go, d, a, b, c, we_t, MD5C19, MD5S11);
68 MD5_STEP (MD5_Go, c, d, a, b, w3_t, MD5C1a, MD5S12);
69 MD5_STEP (MD5_Go, b, c, d, a, w8_t, MD5C1b, MD5S13);
70 MD5_STEP (MD5_Go, a, b, c, d, wd_t, MD5C1c, MD5S10);
71 MD5_STEP (MD5_Go, d, a, b, c, w2_t, MD5C1d, MD5S11);
72 MD5_STEP (MD5_Go, c, d, a, b, w7_t, MD5C1e, MD5S12);
73 MD5_STEP (MD5_Go, b, c, d, a, wc_t, MD5C1f, MD5S13);
75 MD5_STEP (MD5_H , a, b, c, d, w5_t, MD5C20, MD5S20);
76 MD5_STEP (MD5_H , d, a, b, c, w8_t, MD5C21, MD5S21);
77 MD5_STEP (MD5_H , c, d, a, b, wb_t, MD5C22, MD5S22);
78 MD5_STEP (MD5_H , b, c, d, a, we_t, MD5C23, MD5S23);
79 MD5_STEP (MD5_H , a, b, c, d, w1_t, MD5C24, MD5S20);
80 MD5_STEP (MD5_H , d, a, b, c, w4_t, MD5C25, MD5S21);
81 MD5_STEP (MD5_H , c, d, a, b, w7_t, MD5C26, MD5S22);
82 MD5_STEP (MD5_H , b, c, d, a, wa_t, MD5C27, MD5S23);
83 MD5_STEP (MD5_H , a, b, c, d, wd_t, MD5C28, MD5S20);
84 MD5_STEP (MD5_H , d, a, b, c, w0_t, MD5C29, MD5S21);
85 MD5_STEP (MD5_H , c, d, a, b, w3_t, MD5C2a, MD5S22);
86 MD5_STEP (MD5_H , b, c, d, a, w6_t, MD5C2b, MD5S23);
87 MD5_STEP (MD5_H , a, b, c, d, w9_t, MD5C2c, MD5S20);
88 MD5_STEP (MD5_H , d, a, b, c, wc_t, MD5C2d, MD5S21);
89 MD5_STEP (MD5_H , c, d, a, b, wf_t, MD5C2e, MD5S22);
90 MD5_STEP (MD5_H , b, c, d, a, w2_t, MD5C2f, MD5S23);
92 MD5_STEP (MD5_I , a, b, c, d, w0_t, MD5C30, MD5S30);
93 MD5_STEP (MD5_I , d, a, b, c, w7_t, MD5C31, MD5S31);
94 MD5_STEP (MD5_I , c, d, a, b, we_t, MD5C32, MD5S32);
95 MD5_STEP (MD5_I , b, c, d, a, w5_t, MD5C33, MD5S33);
96 MD5_STEP (MD5_I , a, b, c, d, wc_t, MD5C34, MD5S30);
97 MD5_STEP (MD5_I , d, a, b, c, w3_t, MD5C35, MD5S31);
98 MD5_STEP (MD5_I , c, d, a, b, wa_t, MD5C36, MD5S32);
99 MD5_STEP (MD5_I , b, c, d, a, w1_t, MD5C37, MD5S33);
100 MD5_STEP (MD5_I , a, b, c, d, w8_t, MD5C38, MD5S30);
101 MD5_STEP (MD5_I , d, a, b, c, wf_t, MD5C39, MD5S31);
102 MD5_STEP (MD5_I , c, d, a, b, w6_t, MD5C3a, MD5S32);
103 MD5_STEP (MD5_I , b, c, d, a, wd_t, MD5C3b, MD5S33);
104 MD5_STEP (MD5_I , a, b, c, d, w4_t, MD5C3c, MD5S30);
105 MD5_STEP (MD5_I , d, a, b, c, wb_t, MD5C3d, MD5S31);
106 MD5_STEP (MD5_I , c, d, a, b, w2_t, MD5C3e, MD5S32);
107 MD5_STEP (MD5_I , b, c, d, a, w9_t, MD5C3f, MD5S33);
115 void gen336 (u32x digest_pre[4], u32 salt_buf[4], u32x digest[4])
122 digest_t0[0] = digest_pre[0];
123 digest_t0[1] = digest_pre[1] & 0xff;
125 digest_t1[0] = digest_pre[0] << 8;
126 digest_t1[1] = digest_pre[0] >> 24 | digest_pre[1] << 8;
128 digest_t2[0] = digest_pre[0] << 16;
129 digest_t2[1] = digest_pre[0] >> 16 | digest_pre[1] << 16;
131 digest_t3[0] = digest_pre[0] << 24;
132 digest_t3[1] = digest_pre[0] >> 8 | digest_pre[1] << 24;
139 salt_buf_t0[0] = salt_buf[0];
140 salt_buf_t0[1] = salt_buf[1];
141 salt_buf_t0[2] = salt_buf[2];
142 salt_buf_t0[3] = salt_buf[3];
144 salt_buf_t1[0] = salt_buf[0] << 8;
145 salt_buf_t1[1] = salt_buf[0] >> 24 | salt_buf[1] << 8;
146 salt_buf_t1[2] = salt_buf[1] >> 24 | salt_buf[2] << 8;
147 salt_buf_t1[3] = salt_buf[2] >> 24 | salt_buf[3] << 8;
148 salt_buf_t1[4] = salt_buf[3] >> 24;
150 salt_buf_t2[0] = salt_buf[0] << 16;
151 salt_buf_t2[1] = salt_buf[0] >> 16 | salt_buf[1] << 16;
152 salt_buf_t2[2] = salt_buf[1] >> 16 | salt_buf[2] << 16;
153 salt_buf_t2[3] = salt_buf[2] >> 16 | salt_buf[3] << 16;
154 salt_buf_t2[4] = salt_buf[3] >> 16;
156 salt_buf_t3[0] = salt_buf[0] << 24;
157 salt_buf_t3[1] = salt_buf[0] >> 8 | salt_buf[1] << 24;
158 salt_buf_t3[2] = salt_buf[1] >> 8 | salt_buf[2] << 24;
159 salt_buf_t3[3] = salt_buf[2] >> 8 | salt_buf[3] << 24;
160 salt_buf_t3[4] = salt_buf[3] >> 8;
167 // generate the 16 * 21 buffer
187 w0_t[0] = digest_t0[0];
188 w0_t[1] = digest_t0[1];
191 w0_t[1] |= salt_buf_t1[0];
192 w0_t[2] = salt_buf_t1[1];
193 w0_t[3] = salt_buf_t1[2];
194 w1_t[0] = salt_buf_t1[3];
195 w1_t[1] = salt_buf_t1[4];
198 w1_t[1] |= digest_t1[0];
199 w1_t[2] = digest_t1[1];
202 w1_t[2] |= salt_buf_t2[0];
203 w1_t[3] = salt_buf_t2[1];
204 w2_t[0] = salt_buf_t2[2];
205 w2_t[1] = salt_buf_t2[3];
206 w2_t[2] = salt_buf_t2[4];
209 w2_t[2] |= digest_t2[0];
210 w2_t[3] = digest_t2[1];
213 w2_t[3] |= salt_buf_t3[0];
214 w3_t[0] = salt_buf_t3[1];
215 w3_t[1] = salt_buf_t3[2];
216 w3_t[2] = salt_buf_t3[3];
217 w3_t[3] = salt_buf_t3[4];
221 w3_t[3] |= digest_t3[0];
223 md5_transform (w0_t, w1_t, w2_t, w3_t, digest);
243 w0_t[0] = digest_t3[1];
246 w0_t[1] = salt_buf_t0[0];
247 w0_t[2] = salt_buf_t0[1];
248 w0_t[3] = salt_buf_t0[2];
249 w1_t[0] = salt_buf_t0[3];
252 w1_t[1] = digest_t0[0];
253 w1_t[2] = digest_t0[1];
256 w1_t[2] |= salt_buf_t1[0];
257 w1_t[3] = salt_buf_t1[1];
258 w2_t[0] = salt_buf_t1[2];
259 w2_t[1] = salt_buf_t1[3];
260 w2_t[2] = salt_buf_t1[4];
263 w2_t[2] |= digest_t1[0];
264 w2_t[3] = digest_t1[1];
267 w2_t[3] |= salt_buf_t2[0];
268 w3_t[0] = salt_buf_t2[1];
269 w3_t[1] = salt_buf_t2[2];
270 w3_t[2] = salt_buf_t2[3];
271 w3_t[3] = salt_buf_t2[4];
274 w3_t[3] |= digest_t2[0];
276 md5_transform (w0_t, w1_t, w2_t, w3_t, digest);
296 w0_t[0] = digest_t2[1];
299 w0_t[0] |= salt_buf_t3[0];
300 w0_t[1] = salt_buf_t3[1];
301 w0_t[2] = salt_buf_t3[2];
302 w0_t[3] = salt_buf_t3[3];
303 w1_t[0] = salt_buf_t3[4];
306 w1_t[0] |= digest_t3[0];
307 w1_t[1] = digest_t3[1];
310 w1_t[2] = salt_buf_t0[0];
311 w1_t[3] = salt_buf_t0[1];
312 w2_t[0] = salt_buf_t0[2];
313 w2_t[1] = salt_buf_t0[3];
316 w2_t[2] = digest_t0[0];
317 w2_t[3] = digest_t0[1];
320 w2_t[3] |= salt_buf_t1[0];
321 w3_t[0] = salt_buf_t1[1];
322 w3_t[1] = salt_buf_t1[2];
323 w3_t[2] = salt_buf_t1[3];
324 w3_t[3] = salt_buf_t1[4];
327 w3_t[3] |= digest_t1[0];
329 md5_transform (w0_t, w1_t, w2_t, w3_t, digest);
349 w0_t[0] = digest_t1[1];
352 w0_t[0] |= salt_buf_t2[0];
353 w0_t[1] = salt_buf_t2[1];
354 w0_t[2] = salt_buf_t2[2];
355 w0_t[3] = salt_buf_t2[3];
356 w1_t[0] = salt_buf_t2[4];
359 w1_t[0] |= digest_t2[0];
360 w1_t[1] = digest_t2[1];
363 w1_t[1] |= salt_buf_t3[0];
364 w1_t[2] = salt_buf_t3[1];
365 w1_t[3] = salt_buf_t3[2];
366 w2_t[0] = salt_buf_t3[3];
367 w2_t[1] = salt_buf_t3[4];
370 w2_t[1] |= digest_t3[0];
371 w2_t[2] = digest_t3[1];
374 w2_t[3] = salt_buf_t0[0];
375 w3_t[0] = salt_buf_t0[1];
376 w3_t[1] = salt_buf_t0[2];
377 w3_t[2] = salt_buf_t0[3];
380 w3_t[3] = digest_t0[0];
382 md5_transform (w0_t, w1_t, w2_t, w3_t, digest);
402 w0_t[0] = digest_t0[1];
405 w0_t[0] |= salt_buf_t1[0];
406 w0_t[1] = salt_buf_t1[1];
407 w0_t[2] = salt_buf_t1[2];
408 w0_t[3] = salt_buf_t1[3];
409 w1_t[0] = salt_buf_t1[4];
412 w1_t[0] |= digest_t1[0];
413 w1_t[1] = digest_t1[1];
416 w1_t[1] |= salt_buf_t2[0];
417 w1_t[2] = salt_buf_t2[1];
418 w1_t[3] = salt_buf_t2[2];
419 w2_t[0] = salt_buf_t2[3];
420 w2_t[1] = salt_buf_t2[4];
423 w2_t[1] |= digest_t2[0];
424 w2_t[2] = digest_t2[1];
427 w2_t[2] |= salt_buf_t3[0];
428 w2_t[3] = salt_buf_t3[1];
429 w3_t[0] = salt_buf_t3[2];
430 w3_t[1] = salt_buf_t3[3];
431 w3_t[2] = salt_buf_t3[4];
434 w3_t[2] |= digest_t3[0];
435 w3_t[3] = digest_t3[1];
437 md5_transform (w0_t, w1_t, w2_t, w3_t, digest);
439 w0_t[0] = salt_buf_t0[0];
440 w0_t[1] = salt_buf_t0[1];
441 w0_t[2] = salt_buf_t0[2];
442 w0_t[3] = salt_buf_t0[3];
453 w3_t[2] = 21 * 16 * 8;
456 md5_transform (w0_t, w1_t, w2_t, w3_t, digest);
459 __kernel void m09720_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *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 oldoffice01_t *oldoffice01_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)
465 const u32 lid = get_local_id (0);
471 const u32 gid = get_global_id (0);
473 if (gid >= gid_max) return;
478 pw_buf0[0] = pws[gid].i[0];
479 pw_buf0[1] = pws[gid].i[1];
480 pw_buf0[2] = pws[gid].i[2];
481 pw_buf0[3] = pws[gid].i[3];
482 pw_buf1[0] = pws[gid].i[4];
483 pw_buf1[1] = pws[gid].i[5];
484 pw_buf1[2] = pws[gid].i[6];
485 pw_buf1[3] = pws[gid].i[7];
487 const u32 pw_l_len = pws[gid].pw_len;
495 salt_buf[0] = salt_bufs[salt_pos].salt_buf[0];
496 salt_buf[1] = salt_bufs[salt_pos].salt_buf[1];
497 salt_buf[2] = salt_bufs[salt_pos].salt_buf[2];
498 salt_buf[3] = salt_bufs[salt_pos].salt_buf[3];
504 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
506 const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
508 const u32x pw_len = pw_l_len + pw_r_len;
511 * concat password candidate
514 u32x wordl0[4] = { 0 };
515 u32x wordl1[4] = { 0 };
516 u32x wordl2[4] = { 0 };
517 u32x wordl3[4] = { 0 };
519 wordl0[0] = pw_buf0[0];
520 wordl0[1] = pw_buf0[1];
521 wordl0[2] = pw_buf0[2];
522 wordl0[3] = pw_buf0[3];
523 wordl1[0] = pw_buf1[0];
524 wordl1[1] = pw_buf1[1];
525 wordl1[2] = pw_buf1[2];
526 wordl1[3] = pw_buf1[3];
528 u32x wordr0[4] = { 0 };
529 u32x wordr1[4] = { 0 };
530 u32x wordr2[4] = { 0 };
531 u32x wordr3[4] = { 0 };
533 wordr0[0] = ix_create_combt (combs_buf, il_pos, 0);
534 wordr0[1] = ix_create_combt (combs_buf, il_pos, 1);
535 wordr0[2] = ix_create_combt (combs_buf, il_pos, 2);
536 wordr0[3] = ix_create_combt (combs_buf, il_pos, 3);
537 wordr1[0] = ix_create_combt (combs_buf, il_pos, 4);
538 wordr1[1] = ix_create_combt (combs_buf, il_pos, 5);
539 wordr1[2] = ix_create_combt (combs_buf, il_pos, 6);
540 wordr1[3] = ix_create_combt (combs_buf, il_pos, 7);
542 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
544 switch_buffer_by_offset_le_VV (wordr0, wordr1, wordr2, wordr3, pw_l_len);
548 switch_buffer_by_offset_le_VV (wordl0, wordl1, wordl2, wordl3, pw_r_len);
556 w0[0] = wordl0[0] | wordr0[0];
557 w0[1] = wordl0[1] | wordr0[1];
558 w0[2] = wordl0[2] | wordr0[2];
559 w0[3] = wordl0[3] | wordr0[3];
560 w1[0] = wordl1[0] | wordr1[0];
561 w1[1] = wordl1[1] | wordr1[1];
562 w1[2] = wordl1[2] | wordr1[2];
563 w1[3] = wordl1[3] | wordr1[3];
569 make_unicode (w1, w2, w3);
570 make_unicode (w0, w0, w1);
572 w3[2] = pw_len * 8 * 2;
577 digest_pre[0] = MD5M_A;
578 digest_pre[1] = MD5M_B;
579 digest_pre[2] = MD5M_C;
580 digest_pre[3] = MD5M_D;
582 md5_transform (w0, w1, w2, w3, digest_pre);
584 digest_pre[0] &= 0xffffffff;
585 digest_pre[1] &= 0x000000ff;
586 digest_pre[2] &= 0x00000000;
587 digest_pre[3] &= 0x00000000;
596 gen336 (digest_pre, salt_buf, digest);
599 u32x b = digest[1] & 0xff;
603 COMPARE_M_SIMD (a, b, c, d);
607 __kernel void m09720_m08 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *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 oldoffice01_t *oldoffice01_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)
611 __kernel void m09720_m16 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *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 oldoffice01_t *oldoffice01_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)
615 __kernel void m09720_s04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *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 oldoffice01_t *oldoffice01_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)
621 const u32 lid = get_local_id (0);
627 const u32 gid = get_global_id (0);
629 if (gid >= gid_max) return;
634 pw_buf0[0] = pws[gid].i[0];
635 pw_buf0[1] = pws[gid].i[1];
636 pw_buf0[2] = pws[gid].i[2];
637 pw_buf0[3] = pws[gid].i[3];
638 pw_buf1[0] = pws[gid].i[4];
639 pw_buf1[1] = pws[gid].i[5];
640 pw_buf1[2] = pws[gid].i[6];
641 pw_buf1[3] = pws[gid].i[7];
643 const u32 pw_l_len = pws[gid].pw_len;
651 salt_buf[0] = salt_bufs[salt_pos].salt_buf[0];
652 salt_buf[1] = salt_bufs[salt_pos].salt_buf[1];
653 salt_buf[2] = salt_bufs[salt_pos].salt_buf[2];
654 salt_buf[3] = salt_bufs[salt_pos].salt_buf[3];
660 const u32 search[4] =
662 digests_buf[digests_offset].digest_buf[DGST_R0],
663 digests_buf[digests_offset].digest_buf[DGST_R1],
664 digests_buf[digests_offset].digest_buf[DGST_R2],
665 digests_buf[digests_offset].digest_buf[DGST_R3]
672 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
674 const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
676 const u32x pw_len = pw_l_len + pw_r_len;
679 * concat password candidate
682 u32x wordl0[4] = { 0 };
683 u32x wordl1[4] = { 0 };
684 u32x wordl2[4] = { 0 };
685 u32x wordl3[4] = { 0 };
687 wordl0[0] = pw_buf0[0];
688 wordl0[1] = pw_buf0[1];
689 wordl0[2] = pw_buf0[2];
690 wordl0[3] = pw_buf0[3];
691 wordl1[0] = pw_buf1[0];
692 wordl1[1] = pw_buf1[1];
693 wordl1[2] = pw_buf1[2];
694 wordl1[3] = pw_buf1[3];
696 u32x wordr0[4] = { 0 };
697 u32x wordr1[4] = { 0 };
698 u32x wordr2[4] = { 0 };
699 u32x wordr3[4] = { 0 };
701 wordr0[0] = ix_create_combt (combs_buf, il_pos, 0);
702 wordr0[1] = ix_create_combt (combs_buf, il_pos, 1);
703 wordr0[2] = ix_create_combt (combs_buf, il_pos, 2);
704 wordr0[3] = ix_create_combt (combs_buf, il_pos, 3);
705 wordr1[0] = ix_create_combt (combs_buf, il_pos, 4);
706 wordr1[1] = ix_create_combt (combs_buf, il_pos, 5);
707 wordr1[2] = ix_create_combt (combs_buf, il_pos, 6);
708 wordr1[3] = ix_create_combt (combs_buf, il_pos, 7);
710 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
712 switch_buffer_by_offset_le_VV (wordr0, wordr1, wordr2, wordr3, pw_l_len);
716 switch_buffer_by_offset_le_VV (wordl0, wordl1, wordl2, wordl3, pw_r_len);
724 w0[0] = wordl0[0] | wordr0[0];
725 w0[1] = wordl0[1] | wordr0[1];
726 w0[2] = wordl0[2] | wordr0[2];
727 w0[3] = wordl0[3] | wordr0[3];
728 w1[0] = wordl1[0] | wordr1[0];
729 w1[1] = wordl1[1] | wordr1[1];
730 w1[2] = wordl1[2] | wordr1[2];
731 w1[3] = wordl1[3] | wordr1[3];
737 make_unicode (w1, w2, w3);
738 make_unicode (w0, w0, w1);
740 w3[2] = pw_len * 8 * 2;
745 digest_pre[0] = MD5M_A;
746 digest_pre[1] = MD5M_B;
747 digest_pre[2] = MD5M_C;
748 digest_pre[3] = MD5M_D;
750 md5_transform (w0, w1, w2, w3, digest_pre);
752 digest_pre[0] &= 0xffffffff;
753 digest_pre[1] &= 0x000000ff;
754 digest_pre[2] &= 0x00000000;
755 digest_pre[3] &= 0x00000000;
764 gen336 (digest_pre, salt_buf, digest);
767 u32x b = digest[1] & 0xff;
771 COMPARE_S_SIMD (a, b, c, d);
775 __kernel void m09720_s08 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *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 oldoffice01_t *oldoffice01_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)
779 __kernel void m09720_s16 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *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 oldoffice01_t *oldoffice01_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)