2 * Author......: Jens Steube <jens.steube@gmail.com>
10 #include "inc_hash_constants.h"
11 #include "inc_vendor.cl"
18 #include "inc_hash_functions.cl"
19 #include "inc_types.cl"
20 #include "inc_common.cl"
21 #include "inc_simd.cl"
23 void md5_transform (const u32x w0[4], const u32x w1[4], const u32x w2[4], const u32x w3[4], u32x digest[4])
47 MD5_STEP (MD5_Fo, a, b, c, d, w0_t, MD5C00, MD5S00);
48 MD5_STEP (MD5_Fo, d, a, b, c, w1_t, MD5C01, MD5S01);
49 MD5_STEP (MD5_Fo, c, d, a, b, w2_t, MD5C02, MD5S02);
50 MD5_STEP (MD5_Fo, b, c, d, a, w3_t, MD5C03, MD5S03);
51 MD5_STEP (MD5_Fo, a, b, c, d, w4_t, MD5C04, MD5S00);
52 MD5_STEP (MD5_Fo, d, a, b, c, w5_t, MD5C05, MD5S01);
53 MD5_STEP (MD5_Fo, c, d, a, b, w6_t, MD5C06, MD5S02);
54 MD5_STEP (MD5_Fo, b, c, d, a, w7_t, MD5C07, MD5S03);
55 MD5_STEP (MD5_Fo, a, b, c, d, w8_t, MD5C08, MD5S00);
56 MD5_STEP (MD5_Fo, d, a, b, c, w9_t, MD5C09, MD5S01);
57 MD5_STEP (MD5_Fo, c, d, a, b, wa_t, MD5C0a, MD5S02);
58 MD5_STEP (MD5_Fo, b, c, d, a, wb_t, MD5C0b, MD5S03);
59 MD5_STEP (MD5_Fo, a, b, c, d, wc_t, MD5C0c, MD5S00);
60 MD5_STEP (MD5_Fo, d, a, b, c, wd_t, MD5C0d, MD5S01);
61 MD5_STEP (MD5_Fo, c, d, a, b, we_t, MD5C0e, MD5S02);
62 MD5_STEP (MD5_Fo, b, c, d, a, wf_t, MD5C0f, MD5S03);
64 MD5_STEP (MD5_Go, a, b, c, d, w1_t, MD5C10, MD5S10);
65 MD5_STEP (MD5_Go, d, a, b, c, w6_t, MD5C11, MD5S11);
66 MD5_STEP (MD5_Go, c, d, a, b, wb_t, MD5C12, MD5S12);
67 MD5_STEP (MD5_Go, b, c, d, a, w0_t, MD5C13, MD5S13);
68 MD5_STEP (MD5_Go, a, b, c, d, w5_t, MD5C14, MD5S10);
69 MD5_STEP (MD5_Go, d, a, b, c, wa_t, MD5C15, MD5S11);
70 MD5_STEP (MD5_Go, c, d, a, b, wf_t, MD5C16, MD5S12);
71 MD5_STEP (MD5_Go, b, c, d, a, w4_t, MD5C17, MD5S13);
72 MD5_STEP (MD5_Go, a, b, c, d, w9_t, MD5C18, MD5S10);
73 MD5_STEP (MD5_Go, d, a, b, c, we_t, MD5C19, MD5S11);
74 MD5_STEP (MD5_Go, c, d, a, b, w3_t, MD5C1a, MD5S12);
75 MD5_STEP (MD5_Go, b, c, d, a, w8_t, MD5C1b, MD5S13);
76 MD5_STEP (MD5_Go, a, b, c, d, wd_t, MD5C1c, MD5S10);
77 MD5_STEP (MD5_Go, d, a, b, c, w2_t, MD5C1d, MD5S11);
78 MD5_STEP (MD5_Go, c, d, a, b, w7_t, MD5C1e, MD5S12);
79 MD5_STEP (MD5_Go, b, c, d, a, wc_t, MD5C1f, MD5S13);
81 MD5_STEP (MD5_H , a, b, c, d, w5_t, MD5C20, MD5S20);
82 MD5_STEP (MD5_H , d, a, b, c, w8_t, MD5C21, MD5S21);
83 MD5_STEP (MD5_H , c, d, a, b, wb_t, MD5C22, MD5S22);
84 MD5_STEP (MD5_H , b, c, d, a, we_t, MD5C23, MD5S23);
85 MD5_STEP (MD5_H , a, b, c, d, w1_t, MD5C24, MD5S20);
86 MD5_STEP (MD5_H , d, a, b, c, w4_t, MD5C25, MD5S21);
87 MD5_STEP (MD5_H , c, d, a, b, w7_t, MD5C26, MD5S22);
88 MD5_STEP (MD5_H , b, c, d, a, wa_t, MD5C27, MD5S23);
89 MD5_STEP (MD5_H , a, b, c, d, wd_t, MD5C28, MD5S20);
90 MD5_STEP (MD5_H , d, a, b, c, w0_t, MD5C29, MD5S21);
91 MD5_STEP (MD5_H , c, d, a, b, w3_t, MD5C2a, MD5S22);
92 MD5_STEP (MD5_H , b, c, d, a, w6_t, MD5C2b, MD5S23);
93 MD5_STEP (MD5_H , a, b, c, d, w9_t, MD5C2c, MD5S20);
94 MD5_STEP (MD5_H , d, a, b, c, wc_t, MD5C2d, MD5S21);
95 MD5_STEP (MD5_H , c, d, a, b, wf_t, MD5C2e, MD5S22);
96 MD5_STEP (MD5_H , b, c, d, a, w2_t, MD5C2f, MD5S23);
98 MD5_STEP (MD5_I , a, b, c, d, w0_t, MD5C30, MD5S30);
99 MD5_STEP (MD5_I , d, a, b, c, w7_t, MD5C31, MD5S31);
100 MD5_STEP (MD5_I , c, d, a, b, we_t, MD5C32, MD5S32);
101 MD5_STEP (MD5_I , b, c, d, a, w5_t, MD5C33, MD5S33);
102 MD5_STEP (MD5_I , a, b, c, d, wc_t, MD5C34, MD5S30);
103 MD5_STEP (MD5_I , d, a, b, c, w3_t, MD5C35, MD5S31);
104 MD5_STEP (MD5_I , c, d, a, b, wa_t, MD5C36, MD5S32);
105 MD5_STEP (MD5_I , b, c, d, a, w1_t, MD5C37, MD5S33);
106 MD5_STEP (MD5_I , a, b, c, d, w8_t, MD5C38, MD5S30);
107 MD5_STEP (MD5_I , d, a, b, c, wf_t, MD5C39, MD5S31);
108 MD5_STEP (MD5_I , c, d, a, b, w6_t, MD5C3a, MD5S32);
109 MD5_STEP (MD5_I , b, c, d, a, wd_t, MD5C3b, MD5S33);
110 MD5_STEP (MD5_I , a, b, c, d, w4_t, MD5C3c, MD5S30);
111 MD5_STEP (MD5_I , d, a, b, c, wb_t, MD5C3d, MD5S31);
112 MD5_STEP (MD5_I , c, d, a, b, w2_t, MD5C3e, MD5S32);
113 MD5_STEP (MD5_I , b, c, d, a, w9_t, MD5C3f, MD5S33);
121 void gen336 (u32x digest_pre[4], u32 salt_buf[4], u32x digest[4])
128 digest_t0[0] = digest_pre[0];
129 digest_t0[1] = digest_pre[1] & 0xff;
131 digest_t1[0] = digest_pre[0] << 8;
132 digest_t1[1] = digest_pre[0] >> 24 | digest_pre[1] << 8;
134 digest_t2[0] = digest_pre[0] << 16;
135 digest_t2[1] = digest_pre[0] >> 16 | digest_pre[1] << 16;
137 digest_t3[0] = digest_pre[0] << 24;
138 digest_t3[1] = digest_pre[0] >> 8 | digest_pre[1] << 24;
145 salt_buf_t0[0] = salt_buf[0];
146 salt_buf_t0[1] = salt_buf[1];
147 salt_buf_t0[2] = salt_buf[2];
148 salt_buf_t0[3] = salt_buf[3];
150 salt_buf_t1[0] = salt_buf[0] << 8;
151 salt_buf_t1[1] = salt_buf[0] >> 24 | salt_buf[1] << 8;
152 salt_buf_t1[2] = salt_buf[1] >> 24 | salt_buf[2] << 8;
153 salt_buf_t1[3] = salt_buf[2] >> 24 | salt_buf[3] << 8;
154 salt_buf_t1[4] = salt_buf[3] >> 24;
156 salt_buf_t2[0] = salt_buf[0] << 16;
157 salt_buf_t2[1] = salt_buf[0] >> 16 | salt_buf[1] << 16;
158 salt_buf_t2[2] = salt_buf[1] >> 16 | salt_buf[2] << 16;
159 salt_buf_t2[3] = salt_buf[2] >> 16 | salt_buf[3] << 16;
160 salt_buf_t2[4] = salt_buf[3] >> 16;
162 salt_buf_t3[0] = salt_buf[0] << 24;
163 salt_buf_t3[1] = salt_buf[0] >> 8 | salt_buf[1] << 24;
164 salt_buf_t3[2] = salt_buf[1] >> 8 | salt_buf[2] << 24;
165 salt_buf_t3[3] = salt_buf[2] >> 8 | salt_buf[3] << 24;
166 salt_buf_t3[4] = salt_buf[3] >> 8;
173 // generate the 16 * 21 buffer
193 w0_t[0] = digest_t0[0];
194 w0_t[1] = digest_t0[1];
197 w0_t[1] |= salt_buf_t1[0];
198 w0_t[2] = salt_buf_t1[1];
199 w0_t[3] = salt_buf_t1[2];
200 w1_t[0] = salt_buf_t1[3];
201 w1_t[1] = salt_buf_t1[4];
204 w1_t[1] |= digest_t1[0];
205 w1_t[2] = digest_t1[1];
208 w1_t[2] |= salt_buf_t2[0];
209 w1_t[3] = salt_buf_t2[1];
210 w2_t[0] = salt_buf_t2[2];
211 w2_t[1] = salt_buf_t2[3];
212 w2_t[2] = salt_buf_t2[4];
215 w2_t[2] |= digest_t2[0];
216 w2_t[3] = digest_t2[1];
219 w2_t[3] |= salt_buf_t3[0];
220 w3_t[0] = salt_buf_t3[1];
221 w3_t[1] = salt_buf_t3[2];
222 w3_t[2] = salt_buf_t3[3];
223 w3_t[3] = salt_buf_t3[4];
227 w3_t[3] |= digest_t3[0];
229 md5_transform (w0_t, w1_t, w2_t, w3_t, digest);
249 w0_t[0] = digest_t3[1];
252 w0_t[1] = salt_buf_t0[0];
253 w0_t[2] = salt_buf_t0[1];
254 w0_t[3] = salt_buf_t0[2];
255 w1_t[0] = salt_buf_t0[3];
258 w1_t[1] = digest_t0[0];
259 w1_t[2] = digest_t0[1];
262 w1_t[2] |= salt_buf_t1[0];
263 w1_t[3] = salt_buf_t1[1];
264 w2_t[0] = salt_buf_t1[2];
265 w2_t[1] = salt_buf_t1[3];
266 w2_t[2] = salt_buf_t1[4];
269 w2_t[2] |= digest_t1[0];
270 w2_t[3] = digest_t1[1];
273 w2_t[3] |= salt_buf_t2[0];
274 w3_t[0] = salt_buf_t2[1];
275 w3_t[1] = salt_buf_t2[2];
276 w3_t[2] = salt_buf_t2[3];
277 w3_t[3] = salt_buf_t2[4];
280 w3_t[3] |= digest_t2[0];
282 md5_transform (w0_t, w1_t, w2_t, w3_t, digest);
302 w0_t[0] = digest_t2[1];
305 w0_t[0] |= salt_buf_t3[0];
306 w0_t[1] = salt_buf_t3[1];
307 w0_t[2] = salt_buf_t3[2];
308 w0_t[3] = salt_buf_t3[3];
309 w1_t[0] = salt_buf_t3[4];
312 w1_t[0] |= digest_t3[0];
313 w1_t[1] = digest_t3[1];
316 w1_t[2] = salt_buf_t0[0];
317 w1_t[3] = salt_buf_t0[1];
318 w2_t[0] = salt_buf_t0[2];
319 w2_t[1] = salt_buf_t0[3];
322 w2_t[2] = digest_t0[0];
323 w2_t[3] = digest_t0[1];
326 w2_t[3] |= salt_buf_t1[0];
327 w3_t[0] = salt_buf_t1[1];
328 w3_t[1] = salt_buf_t1[2];
329 w3_t[2] = salt_buf_t1[3];
330 w3_t[3] = salt_buf_t1[4];
333 w3_t[3] |= digest_t1[0];
335 md5_transform (w0_t, w1_t, w2_t, w3_t, digest);
355 w0_t[0] = digest_t1[1];
358 w0_t[0] |= salt_buf_t2[0];
359 w0_t[1] = salt_buf_t2[1];
360 w0_t[2] = salt_buf_t2[2];
361 w0_t[3] = salt_buf_t2[3];
362 w1_t[0] = salt_buf_t2[4];
365 w1_t[0] |= digest_t2[0];
366 w1_t[1] = digest_t2[1];
369 w1_t[1] |= salt_buf_t3[0];
370 w1_t[2] = salt_buf_t3[1];
371 w1_t[3] = salt_buf_t3[2];
372 w2_t[0] = salt_buf_t3[3];
373 w2_t[1] = salt_buf_t3[4];
376 w2_t[1] |= digest_t3[0];
377 w2_t[2] = digest_t3[1];
380 w2_t[3] = salt_buf_t0[0];
381 w3_t[0] = salt_buf_t0[1];
382 w3_t[1] = salt_buf_t0[2];
383 w3_t[2] = salt_buf_t0[3];
386 w3_t[3] = digest_t0[0];
388 md5_transform (w0_t, w1_t, w2_t, w3_t, digest);
408 w0_t[0] = digest_t0[1];
411 w0_t[0] |= salt_buf_t1[0];
412 w0_t[1] = salt_buf_t1[1];
413 w0_t[2] = salt_buf_t1[2];
414 w0_t[3] = salt_buf_t1[3];
415 w1_t[0] = salt_buf_t1[4];
418 w1_t[0] |= digest_t1[0];
419 w1_t[1] = digest_t1[1];
422 w1_t[1] |= salt_buf_t2[0];
423 w1_t[2] = salt_buf_t2[1];
424 w1_t[3] = salt_buf_t2[2];
425 w2_t[0] = salt_buf_t2[3];
426 w2_t[1] = salt_buf_t2[4];
429 w2_t[1] |= digest_t2[0];
430 w2_t[2] = digest_t2[1];
433 w2_t[2] |= salt_buf_t3[0];
434 w2_t[3] = salt_buf_t3[1];
435 w3_t[0] = salt_buf_t3[2];
436 w3_t[1] = salt_buf_t3[3];
437 w3_t[2] = salt_buf_t3[4];
440 w3_t[2] |= digest_t3[0];
441 w3_t[3] = digest_t3[1];
443 md5_transform (w0_t, w1_t, w2_t, w3_t, digest);
445 w0_t[0] = salt_buf_t0[0];
446 w0_t[1] = salt_buf_t0[1];
447 w0_t[2] = salt_buf_t0[2];
448 w0_t[3] = salt_buf_t0[3];
459 w3_t[2] = 21 * 16 * 8;
462 md5_transform (w0_t, w1_t, w2_t, w3_t, digest);
465 __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_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 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
471 const u32 lid = get_local_id (0);
477 const u32 gid = get_global_id (0);
479 if (gid >= gid_max) return;
484 pw_buf0[0] = pws[gid].i[0];
485 pw_buf0[1] = pws[gid].i[1];
486 pw_buf0[2] = pws[gid].i[2];
487 pw_buf0[3] = pws[gid].i[3];
488 pw_buf1[0] = pws[gid].i[4];
489 pw_buf1[1] = pws[gid].i[5];
490 pw_buf1[2] = pws[gid].i[6];
491 pw_buf1[3] = pws[gid].i[7];
493 const u32 pw_l_len = pws[gid].pw_len;
501 salt_buf[0] = salt_bufs[salt_pos].salt_buf[0];
502 salt_buf[1] = salt_bufs[salt_pos].salt_buf[1];
503 salt_buf[2] = salt_bufs[salt_pos].salt_buf[2];
504 salt_buf[3] = salt_bufs[salt_pos].salt_buf[3];
510 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
512 const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
514 const u32x pw_len = pw_l_len + pw_r_len;
517 * concat password candidate
520 u32x wordl0[4] = { 0 };
521 u32x wordl1[4] = { 0 };
522 u32x wordl2[4] = { 0 };
523 u32x wordl3[4] = { 0 };
525 wordl0[0] = pw_buf0[0];
526 wordl0[1] = pw_buf0[1];
527 wordl0[2] = pw_buf0[2];
528 wordl0[3] = pw_buf0[3];
529 wordl1[0] = pw_buf1[0];
530 wordl1[1] = pw_buf1[1];
531 wordl1[2] = pw_buf1[2];
532 wordl1[3] = pw_buf1[3];
534 u32x wordr0[4] = { 0 };
535 u32x wordr1[4] = { 0 };
536 u32x wordr2[4] = { 0 };
537 u32x wordr3[4] = { 0 };
539 wordr0[0] = ix_create_combt (combs_buf, il_pos, 0);
540 wordr0[1] = ix_create_combt (combs_buf, il_pos, 1);
541 wordr0[2] = ix_create_combt (combs_buf, il_pos, 2);
542 wordr0[3] = ix_create_combt (combs_buf, il_pos, 3);
543 wordr1[0] = ix_create_combt (combs_buf, il_pos, 4);
544 wordr1[1] = ix_create_combt (combs_buf, il_pos, 5);
545 wordr1[2] = ix_create_combt (combs_buf, il_pos, 6);
546 wordr1[3] = ix_create_combt (combs_buf, il_pos, 7);
548 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
550 switch_buffer_by_offset_le_VV (wordr0, wordr1, wordr2, wordr3, pw_l_len);
554 switch_buffer_by_offset_le_VV (wordl0, wordl1, wordl2, wordl3, pw_r_len);
562 w0[0] = wordl0[0] | wordr0[0];
563 w0[1] = wordl0[1] | wordr0[1];
564 w0[2] = wordl0[2] | wordr0[2];
565 w0[3] = wordl0[3] | wordr0[3];
566 w1[0] = wordl1[0] | wordr1[0];
567 w1[1] = wordl1[1] | wordr1[1];
568 w1[2] = wordl1[2] | wordr1[2];
569 w1[3] = wordl1[3] | wordr1[3];
575 make_unicode (w1, w2, w3);
576 make_unicode (w0, w0, w1);
578 w3[2] = pw_len * 8 * 2;
583 digest_pre[0] = MD5M_A;
584 digest_pre[1] = MD5M_B;
585 digest_pre[2] = MD5M_C;
586 digest_pre[3] = MD5M_D;
588 md5_transform (w0, w1, w2, w3, digest_pre);
590 digest_pre[0] &= 0xffffffff;
591 digest_pre[1] &= 0x000000ff;
592 digest_pre[2] &= 0x00000000;
593 digest_pre[3] &= 0x00000000;
602 gen336 (digest_pre, salt_buf, digest);
605 u32x b = digest[1] & 0xff;
609 COMPARE_M_SIMD (a, b, c, d);
613 __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_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 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
617 __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_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 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
621 __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_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 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
627 const u32 lid = get_local_id (0);
633 const u32 gid = get_global_id (0);
635 if (gid >= gid_max) return;
640 pw_buf0[0] = pws[gid].i[0];
641 pw_buf0[1] = pws[gid].i[1];
642 pw_buf0[2] = pws[gid].i[2];
643 pw_buf0[3] = pws[gid].i[3];
644 pw_buf1[0] = pws[gid].i[4];
645 pw_buf1[1] = pws[gid].i[5];
646 pw_buf1[2] = pws[gid].i[6];
647 pw_buf1[3] = pws[gid].i[7];
649 const u32 pw_l_len = pws[gid].pw_len;
657 salt_buf[0] = salt_bufs[salt_pos].salt_buf[0];
658 salt_buf[1] = salt_bufs[salt_pos].salt_buf[1];
659 salt_buf[2] = salt_bufs[salt_pos].salt_buf[2];
660 salt_buf[3] = salt_bufs[salt_pos].salt_buf[3];
666 const u32 search[4] =
668 digests_buf[digests_offset].digest_buf[DGST_R0],
669 digests_buf[digests_offset].digest_buf[DGST_R1],
670 digests_buf[digests_offset].digest_buf[DGST_R2],
671 digests_buf[digests_offset].digest_buf[DGST_R3]
678 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
680 const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
682 const u32x pw_len = pw_l_len + pw_r_len;
685 * concat password candidate
688 u32x wordl0[4] = { 0 };
689 u32x wordl1[4] = { 0 };
690 u32x wordl2[4] = { 0 };
691 u32x wordl3[4] = { 0 };
693 wordl0[0] = pw_buf0[0];
694 wordl0[1] = pw_buf0[1];
695 wordl0[2] = pw_buf0[2];
696 wordl0[3] = pw_buf0[3];
697 wordl1[0] = pw_buf1[0];
698 wordl1[1] = pw_buf1[1];
699 wordl1[2] = pw_buf1[2];
700 wordl1[3] = pw_buf1[3];
702 u32x wordr0[4] = { 0 };
703 u32x wordr1[4] = { 0 };
704 u32x wordr2[4] = { 0 };
705 u32x wordr3[4] = { 0 };
707 wordr0[0] = ix_create_combt (combs_buf, il_pos, 0);
708 wordr0[1] = ix_create_combt (combs_buf, il_pos, 1);
709 wordr0[2] = ix_create_combt (combs_buf, il_pos, 2);
710 wordr0[3] = ix_create_combt (combs_buf, il_pos, 3);
711 wordr1[0] = ix_create_combt (combs_buf, il_pos, 4);
712 wordr1[1] = ix_create_combt (combs_buf, il_pos, 5);
713 wordr1[2] = ix_create_combt (combs_buf, il_pos, 6);
714 wordr1[3] = ix_create_combt (combs_buf, il_pos, 7);
716 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
718 switch_buffer_by_offset_le_VV (wordr0, wordr1, wordr2, wordr3, pw_l_len);
722 switch_buffer_by_offset_le_VV (wordl0, wordl1, wordl2, wordl3, pw_r_len);
730 w0[0] = wordl0[0] | wordr0[0];
731 w0[1] = wordl0[1] | wordr0[1];
732 w0[2] = wordl0[2] | wordr0[2];
733 w0[3] = wordl0[3] | wordr0[3];
734 w1[0] = wordl1[0] | wordr1[0];
735 w1[1] = wordl1[1] | wordr1[1];
736 w1[2] = wordl1[2] | wordr1[2];
737 w1[3] = wordl1[3] | wordr1[3];
743 make_unicode (w1, w2, w3);
744 make_unicode (w0, w0, w1);
746 w3[2] = pw_len * 8 * 2;
751 digest_pre[0] = MD5M_A;
752 digest_pre[1] = MD5M_B;
753 digest_pre[2] = MD5M_C;
754 digest_pre[3] = MD5M_D;
756 md5_transform (w0, w1, w2, w3, digest_pre);
758 digest_pre[0] &= 0xffffffff;
759 digest_pre[1] &= 0x000000ff;
760 digest_pre[2] &= 0x00000000;
761 digest_pre[3] &= 0x00000000;
770 gen336 (digest_pre, salt_buf, digest);
773 u32x b = digest[1] & 0xff;
777 COMPARE_S_SIMD (a, b, c, d);
781 __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_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 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
785 __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_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 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)