2 * Author......: Jens Steube <jens.steube@gmail.com>
8 #include "include/constants.h"
9 #include "include/kernel_vendor.h"
24 #include "include/kernel_functions.c"
26 #include "common_nv.c"
27 #include "include/rp_gpu.h"
31 #define VECT_COMPARE_S "check_single_vect1_comp4.c"
32 #define VECT_COMPARE_M "check_multi_vect1_comp4.c"
36 #define VECT_COMPARE_S "check_single_vect2_comp4.c"
37 #define VECT_COMPARE_M "check_multi_vect2_comp4.c"
41 #define VECT_COMPARE_S "check_single_vect4_comp4.c"
42 #define VECT_COMPARE_M "check_multi_vect4_comp4.c"
53 __device__ static void swap (RC4_KEY *rc4_key, const u8 i, const u8 j)
58 rc4_key->S[i] = rc4_key->S[j];
62 __device__ static void rc4_init_16 (RC4_KEY *rc4_key, const u32 data[4])
67 u32 *ptr = (u32 *) rc4_key->S;
70 for (u32 i = 0; i < 64; i++)
77 for (u32 i = 0; i < 16; i++)
85 j += rc4_key->S[idx] + (v >> 0); swap (rc4_key, idx, j); idx++;
86 j += rc4_key->S[idx] + (v >> 8); swap (rc4_key, idx, j); idx++;
87 j += rc4_key->S[idx] + (v >> 16); swap (rc4_key, idx, j); idx++;
88 j += rc4_key->S[idx] + (v >> 24); swap (rc4_key, idx, j); idx++;
92 j += rc4_key->S[idx] + (v >> 0); swap (rc4_key, idx, j); idx++;
93 j += rc4_key->S[idx] + (v >> 8); swap (rc4_key, idx, j); idx++;
94 j += rc4_key->S[idx] + (v >> 16); swap (rc4_key, idx, j); idx++;
95 j += rc4_key->S[idx] + (v >> 24); swap (rc4_key, idx, j); idx++;
99 j += rc4_key->S[idx] + (v >> 0); swap (rc4_key, idx, j); idx++;
100 j += rc4_key->S[idx] + (v >> 8); swap (rc4_key, idx, j); idx++;
101 j += rc4_key->S[idx] + (v >> 16); swap (rc4_key, idx, j); idx++;
102 j += rc4_key->S[idx] + (v >> 24); swap (rc4_key, idx, j); idx++;
106 j += rc4_key->S[idx] + (v >> 0); swap (rc4_key, idx, j); idx++;
107 j += rc4_key->S[idx] + (v >> 8); swap (rc4_key, idx, j); idx++;
108 j += rc4_key->S[idx] + (v >> 16); swap (rc4_key, idx, j); idx++;
109 j += rc4_key->S[idx] + (v >> 24); swap (rc4_key, idx, j); idx++;
113 __device__ static u8 rc4_next_16 (RC4_KEY *rc4_key, u8 i, u8 j, const u32 in[4], u32 out[4])
115 for (u32 k = 0; k < 4; k++)
124 swap (rc4_key, i, j);
126 idx = rc4_key->S[i] + rc4_key->S[j];
128 xor4 |= rc4_key->S[idx] << 0;
133 swap (rc4_key, i, j);
135 idx = rc4_key->S[i] + rc4_key->S[j];
137 xor4 |= rc4_key->S[idx] << 8;
142 swap (rc4_key, i, j);
144 idx = rc4_key->S[i] + rc4_key->S[j];
146 xor4 |= rc4_key->S[idx] << 16;
151 swap (rc4_key, i, j);
153 idx = rc4_key->S[i] + rc4_key->S[j];
155 xor4 |= rc4_key->S[idx] << 24;
157 out[k] = in[k] ^ xor4;
163 __device__ static void md5_transform (const u32x w0[4], const u32x w1[4], const u32x w2[4], const u32x w3[4], u32x digest[4])
187 MD5_STEP (MD5_Fo, a, b, c, d, w0_t, MD5C00, MD5S00);
188 MD5_STEP (MD5_Fo, d, a, b, c, w1_t, MD5C01, MD5S01);
189 MD5_STEP (MD5_Fo, c, d, a, b, w2_t, MD5C02, MD5S02);
190 MD5_STEP (MD5_Fo, b, c, d, a, w3_t, MD5C03, MD5S03);
191 MD5_STEP (MD5_Fo, a, b, c, d, w4_t, MD5C04, MD5S00);
192 MD5_STEP (MD5_Fo, d, a, b, c, w5_t, MD5C05, MD5S01);
193 MD5_STEP (MD5_Fo, c, d, a, b, w6_t, MD5C06, MD5S02);
194 MD5_STEP (MD5_Fo, b, c, d, a, w7_t, MD5C07, MD5S03);
195 MD5_STEP (MD5_Fo, a, b, c, d, w8_t, MD5C08, MD5S00);
196 MD5_STEP (MD5_Fo, d, a, b, c, w9_t, MD5C09, MD5S01);
197 MD5_STEP (MD5_Fo, c, d, a, b, wa_t, MD5C0a, MD5S02);
198 MD5_STEP (MD5_Fo, b, c, d, a, wb_t, MD5C0b, MD5S03);
199 MD5_STEP (MD5_Fo, a, b, c, d, wc_t, MD5C0c, MD5S00);
200 MD5_STEP (MD5_Fo, d, a, b, c, wd_t, MD5C0d, MD5S01);
201 MD5_STEP (MD5_Fo, c, d, a, b, we_t, MD5C0e, MD5S02);
202 MD5_STEP (MD5_Fo, b, c, d, a, wf_t, MD5C0f, MD5S03);
204 MD5_STEP (MD5_Go, a, b, c, d, w1_t, MD5C10, MD5S10);
205 MD5_STEP (MD5_Go, d, a, b, c, w6_t, MD5C11, MD5S11);
206 MD5_STEP (MD5_Go, c, d, a, b, wb_t, MD5C12, MD5S12);
207 MD5_STEP (MD5_Go, b, c, d, a, w0_t, MD5C13, MD5S13);
208 MD5_STEP (MD5_Go, a, b, c, d, w5_t, MD5C14, MD5S10);
209 MD5_STEP (MD5_Go, d, a, b, c, wa_t, MD5C15, MD5S11);
210 MD5_STEP (MD5_Go, c, d, a, b, wf_t, MD5C16, MD5S12);
211 MD5_STEP (MD5_Go, b, c, d, a, w4_t, MD5C17, MD5S13);
212 MD5_STEP (MD5_Go, a, b, c, d, w9_t, MD5C18, MD5S10);
213 MD5_STEP (MD5_Go, d, a, b, c, we_t, MD5C19, MD5S11);
214 MD5_STEP (MD5_Go, c, d, a, b, w3_t, MD5C1a, MD5S12);
215 MD5_STEP (MD5_Go, b, c, d, a, w8_t, MD5C1b, MD5S13);
216 MD5_STEP (MD5_Go, a, b, c, d, wd_t, MD5C1c, MD5S10);
217 MD5_STEP (MD5_Go, d, a, b, c, w2_t, MD5C1d, MD5S11);
218 MD5_STEP (MD5_Go, c, d, a, b, w7_t, MD5C1e, MD5S12);
219 MD5_STEP (MD5_Go, b, c, d, a, wc_t, MD5C1f, MD5S13);
221 MD5_STEP (MD5_H , a, b, c, d, w5_t, MD5C20, MD5S20);
222 MD5_STEP (MD5_H , d, a, b, c, w8_t, MD5C21, MD5S21);
223 MD5_STEP (MD5_H , c, d, a, b, wb_t, MD5C22, MD5S22);
224 MD5_STEP (MD5_H , b, c, d, a, we_t, MD5C23, MD5S23);
225 MD5_STEP (MD5_H , a, b, c, d, w1_t, MD5C24, MD5S20);
226 MD5_STEP (MD5_H , d, a, b, c, w4_t, MD5C25, MD5S21);
227 MD5_STEP (MD5_H , c, d, a, b, w7_t, MD5C26, MD5S22);
228 MD5_STEP (MD5_H , b, c, d, a, wa_t, MD5C27, MD5S23);
229 MD5_STEP (MD5_H , a, b, c, d, wd_t, MD5C28, MD5S20);
230 MD5_STEP (MD5_H , d, a, b, c, w0_t, MD5C29, MD5S21);
231 MD5_STEP (MD5_H , c, d, a, b, w3_t, MD5C2a, MD5S22);
232 MD5_STEP (MD5_H , b, c, d, a, w6_t, MD5C2b, MD5S23);
233 MD5_STEP (MD5_H , a, b, c, d, w9_t, MD5C2c, MD5S20);
234 MD5_STEP (MD5_H , d, a, b, c, wc_t, MD5C2d, MD5S21);
235 MD5_STEP (MD5_H , c, d, a, b, wf_t, MD5C2e, MD5S22);
236 MD5_STEP (MD5_H , b, c, d, a, w2_t, MD5C2f, MD5S23);
238 MD5_STEP (MD5_I , a, b, c, d, w0_t, MD5C30, MD5S30);
239 MD5_STEP (MD5_I , d, a, b, c, w7_t, MD5C31, MD5S31);
240 MD5_STEP (MD5_I , c, d, a, b, we_t, MD5C32, MD5S32);
241 MD5_STEP (MD5_I , b, c, d, a, w5_t, MD5C33, MD5S33);
242 MD5_STEP (MD5_I , a, b, c, d, wc_t, MD5C34, MD5S30);
243 MD5_STEP (MD5_I , d, a, b, c, w3_t, MD5C35, MD5S31);
244 MD5_STEP (MD5_I , c, d, a, b, wa_t, MD5C36, MD5S32);
245 MD5_STEP (MD5_I , b, c, d, a, w1_t, MD5C37, MD5S33);
246 MD5_STEP (MD5_I , a, b, c, d, w8_t, MD5C38, MD5S30);
247 MD5_STEP (MD5_I , d, a, b, c, wf_t, MD5C39, MD5S31);
248 MD5_STEP (MD5_I , c, d, a, b, w6_t, MD5C3a, MD5S32);
249 MD5_STEP (MD5_I , b, c, d, a, wd_t, MD5C3b, MD5S33);
250 MD5_STEP (MD5_I , a, b, c, d, w4_t, MD5C3c, MD5S30);
251 MD5_STEP (MD5_I , d, a, b, c, wb_t, MD5C3d, MD5S31);
252 MD5_STEP (MD5_I , c, d, a, b, w2_t, MD5C3e, MD5S32);
253 MD5_STEP (MD5_I , b, c, d, a, w9_t, MD5C3f, MD5S33);
261 __device__ static void gen336 (u32x digest_pre[4], u32 salt_buf[4], u32x digest[4])
268 digest_t0[0] = digest_pre[0];
269 digest_t0[1] = digest_pre[1] & 0xff;
271 digest_t1[0] = digest_pre[0] << 8;
272 digest_t1[1] = digest_pre[0] >> 24 | digest_pre[1] << 8;
274 digest_t2[0] = digest_pre[0] << 16;
275 digest_t2[1] = digest_pre[0] >> 16 | digest_pre[1] << 16;
277 digest_t3[0] = digest_pre[0] << 24;
278 digest_t3[1] = digest_pre[0] >> 8 | digest_pre[1] << 24;
285 salt_buf_t0[0] = salt_buf[0];
286 salt_buf_t0[1] = salt_buf[1];
287 salt_buf_t0[2] = salt_buf[2];
288 salt_buf_t0[3] = salt_buf[3];
290 salt_buf_t1[0] = salt_buf[0] << 8;
291 salt_buf_t1[1] = salt_buf[0] >> 24 | salt_buf[1] << 8;
292 salt_buf_t1[2] = salt_buf[1] >> 24 | salt_buf[2] << 8;
293 salt_buf_t1[3] = salt_buf[2] >> 24 | salt_buf[3] << 8;
294 salt_buf_t1[4] = salt_buf[3] >> 24;
296 salt_buf_t2[0] = salt_buf[0] << 16;
297 salt_buf_t2[1] = salt_buf[0] >> 16 | salt_buf[1] << 16;
298 salt_buf_t2[2] = salt_buf[1] >> 16 | salt_buf[2] << 16;
299 salt_buf_t2[3] = salt_buf[2] >> 16 | salt_buf[3] << 16;
300 salt_buf_t2[4] = salt_buf[3] >> 16;
302 salt_buf_t3[0] = salt_buf[0] << 24;
303 salt_buf_t3[1] = salt_buf[0] >> 8 | salt_buf[1] << 24;
304 salt_buf_t3[2] = salt_buf[1] >> 8 | salt_buf[2] << 24;
305 salt_buf_t3[3] = salt_buf[2] >> 8 | salt_buf[3] << 24;
306 salt_buf_t3[4] = salt_buf[3] >> 8;
313 // generate the 16 * 21 buffer
333 w0_t[0] = digest_t0[0];
334 w0_t[1] = digest_t0[1];
337 w0_t[1] |= salt_buf_t1[0];
338 w0_t[2] = salt_buf_t1[1];
339 w0_t[3] = salt_buf_t1[2];
340 w1_t[0] = salt_buf_t1[3];
341 w1_t[1] = salt_buf_t1[4];
344 w1_t[1] |= digest_t1[0];
345 w1_t[2] = digest_t1[1];
348 w1_t[2] |= salt_buf_t2[0];
349 w1_t[3] = salt_buf_t2[1];
350 w2_t[0] = salt_buf_t2[2];
351 w2_t[1] = salt_buf_t2[3];
352 w2_t[2] = salt_buf_t2[4];
355 w2_t[2] |= digest_t2[0];
356 w2_t[3] = digest_t2[1];
359 w2_t[3] |= salt_buf_t3[0];
360 w3_t[0] = salt_buf_t3[1];
361 w3_t[1] = salt_buf_t3[2];
362 w3_t[2] = salt_buf_t3[3];
363 w3_t[3] = salt_buf_t3[4];
367 w3_t[3] |= digest_t3[0];
369 md5_transform (w0_t, w1_t, w2_t, w3_t, digest);
389 w0_t[0] = digest_t3[1];
392 w0_t[1] = salt_buf_t0[0];
393 w0_t[2] = salt_buf_t0[1];
394 w0_t[3] = salt_buf_t0[2];
395 w1_t[0] = salt_buf_t0[3];
398 w1_t[1] = digest_t0[0];
399 w1_t[2] = digest_t0[1];
402 w1_t[2] |= salt_buf_t1[0];
403 w1_t[3] = salt_buf_t1[1];
404 w2_t[0] = salt_buf_t1[2];
405 w2_t[1] = salt_buf_t1[3];
406 w2_t[2] = salt_buf_t1[4];
409 w2_t[2] |= digest_t1[0];
410 w2_t[3] = digest_t1[1];
413 w2_t[3] |= salt_buf_t2[0];
414 w3_t[0] = salt_buf_t2[1];
415 w3_t[1] = salt_buf_t2[2];
416 w3_t[2] = salt_buf_t2[3];
417 w3_t[3] = salt_buf_t2[4];
420 w3_t[3] |= digest_t2[0];
422 md5_transform (w0_t, w1_t, w2_t, w3_t, digest);
442 w0_t[0] = digest_t2[1];
445 w0_t[0] |= salt_buf_t3[0];
446 w0_t[1] = salt_buf_t3[1];
447 w0_t[2] = salt_buf_t3[2];
448 w0_t[3] = salt_buf_t3[3];
449 w1_t[0] = salt_buf_t3[4];
452 w1_t[0] |= digest_t3[0];
453 w1_t[1] = digest_t3[1];
456 w1_t[2] = salt_buf_t0[0];
457 w1_t[3] = salt_buf_t0[1];
458 w2_t[0] = salt_buf_t0[2];
459 w2_t[1] = salt_buf_t0[3];
462 w2_t[2] = digest_t0[0];
463 w2_t[3] = digest_t0[1];
466 w2_t[3] |= salt_buf_t1[0];
467 w3_t[0] = salt_buf_t1[1];
468 w3_t[1] = salt_buf_t1[2];
469 w3_t[2] = salt_buf_t1[3];
470 w3_t[3] = salt_buf_t1[4];
473 w3_t[3] |= digest_t1[0];
475 md5_transform (w0_t, w1_t, w2_t, w3_t, digest);
495 w0_t[0] = digest_t1[1];
498 w0_t[0] |= salt_buf_t2[0];
499 w0_t[1] = salt_buf_t2[1];
500 w0_t[2] = salt_buf_t2[2];
501 w0_t[3] = salt_buf_t2[3];
502 w1_t[0] = salt_buf_t2[4];
505 w1_t[0] |= digest_t2[0];
506 w1_t[1] = digest_t2[1];
509 w1_t[1] |= salt_buf_t3[0];
510 w1_t[2] = salt_buf_t3[1];
511 w1_t[3] = salt_buf_t3[2];
512 w2_t[0] = salt_buf_t3[3];
513 w2_t[1] = salt_buf_t3[4];
516 w2_t[1] |= digest_t3[0];
517 w2_t[2] = digest_t3[1];
520 w2_t[3] = salt_buf_t0[0];
521 w3_t[0] = salt_buf_t0[1];
522 w3_t[1] = salt_buf_t0[2];
523 w3_t[2] = salt_buf_t0[3];
526 w3_t[3] = digest_t0[0];
528 md5_transform (w0_t, w1_t, w2_t, w3_t, digest);
548 w0_t[0] = digest_t0[1];
551 w0_t[0] |= salt_buf_t1[0];
552 w0_t[1] = salt_buf_t1[1];
553 w0_t[2] = salt_buf_t1[2];
554 w0_t[3] = salt_buf_t1[3];
555 w1_t[0] = salt_buf_t1[4];
558 w1_t[0] |= digest_t1[0];
559 w1_t[1] = digest_t1[1];
562 w1_t[1] |= salt_buf_t2[0];
563 w1_t[2] = salt_buf_t2[1];
564 w1_t[3] = salt_buf_t2[2];
565 w2_t[0] = salt_buf_t2[3];
566 w2_t[1] = salt_buf_t2[4];
569 w2_t[1] |= digest_t2[0];
570 w2_t[2] = digest_t2[1];
573 w2_t[2] |= salt_buf_t3[0];
574 w2_t[3] = salt_buf_t3[1];
575 w3_t[0] = salt_buf_t3[2];
576 w3_t[1] = salt_buf_t3[3];
577 w3_t[2] = salt_buf_t3[4];
580 w3_t[2] |= digest_t3[0];
581 w3_t[3] = digest_t3[1];
583 md5_transform (w0_t, w1_t, w2_t, w3_t, digest);
585 w0_t[0] = salt_buf_t0[0];
586 w0_t[1] = salt_buf_t0[1];
587 w0_t[2] = salt_buf_t0[2];
588 w0_t[3] = salt_buf_t0[3];
599 w3_t[2] = 21 * 16 * 8;
602 md5_transform (w0_t, w1_t, w2_t, w3_t, digest);
605 __device__ __constant__ gpu_rule_t c_rules[1024];
607 extern "C" __global__ void __launch_bounds__ (64, 1) m09700_m04 (const pw_t *pws, const gpu_rule_t *rules_buf, const comb_t *combs_buf, const bf_t *bfs_buf, const void *tmps, void *hooks, const u32 *bitmaps_buf_s1_a, const u32 *bitmaps_buf_s1_b, const u32 *bitmaps_buf_s1_c, const u32 *bitmaps_buf_s1_d, const u32 *bitmaps_buf_s2_a, const u32 *bitmaps_buf_s2_b, const u32 *bitmaps_buf_s2_c, const u32 *bitmaps_buf_s2_d, plain_t *plains_buf, const digest_t *digests_buf, u32 *hashes_shown, const salt_t *salt_bufs, const oldoffice01_t *oldoffice01_bufs, u32 *d_return_buf, 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)
613 const u32 lid = threadIdx.x;
615 __shared__ RC4_KEY rc4_keys[64];
617 RC4_KEY *rc4_key = &rc4_keys[lid];
623 const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
625 if (gid >= gid_max) return;
629 pw_buf0[0] = pws[gid].i[ 0];
630 pw_buf0[1] = pws[gid].i[ 1];
631 pw_buf0[2] = pws[gid].i[ 2];
632 pw_buf0[3] = pws[gid].i[ 3];
636 pw_buf1[0] = pws[gid].i[ 4];
637 pw_buf1[1] = pws[gid].i[ 5];
638 pw_buf1[2] = pws[gid].i[ 6];
639 pw_buf1[3] = pws[gid].i[ 7];
641 const u32 pw_len = pws[gid].pw_len;
649 salt_buf[0] = salt_bufs[salt_pos].salt_buf[0];
650 salt_buf[1] = salt_bufs[salt_pos].salt_buf[1];
651 salt_buf[2] = salt_bufs[salt_pos].salt_buf[2];
652 salt_buf[3] = salt_bufs[salt_pos].salt_buf[3];
658 const u32 version = oldoffice01_bufs[salt_pos].version;
660 u32 encryptedVerifier[4];
662 encryptedVerifier[0] = oldoffice01_bufs[salt_pos].encryptedVerifier[0];
663 encryptedVerifier[1] = oldoffice01_bufs[salt_pos].encryptedVerifier[1];
664 encryptedVerifier[2] = oldoffice01_bufs[salt_pos].encryptedVerifier[2];
665 encryptedVerifier[3] = oldoffice01_bufs[salt_pos].encryptedVerifier[3];
671 for (u32 il_pos = 0; il_pos < rules_cnt; il_pos++)
701 const u32 out_len = apply_rules (c_rules[il_pos].cmds, w0, w1, pw_len);
703 append_0x80_2 (w0, w1, out_len);
710 make_unicode (w0, w0_t, w1_t);
711 make_unicode (w1, w2_t, w3_t);
713 w3_t[2] = out_len * 8 * 2;
717 digest_pre[0] = MD5M_A;
718 digest_pre[1] = MD5M_B;
719 digest_pre[2] = MD5M_C;
720 digest_pre[3] = MD5M_D;
722 md5_transform (w0_t, w1_t, w2_t, w3_t, digest_pre);
724 digest_pre[0] &= 0xffffffff;
725 digest_pre[1] &= 0x000000ff;
726 digest_pre[2] &= 0x00000000;
727 digest_pre[3] &= 0x00000000;
736 gen336 (digest_pre, salt_buf, digest);
738 // now the 40 bit input for the MD5 which then will generate the RC4 key, so it's precomputable!
741 w0_t[1] = digest[1] & 0xff;
762 md5_transform (w0_t, w1_t, w2_t, w3_t, digest);
773 rc4_init_16 (rc4_key, key);
777 u8 j = rc4_next_16 (rc4_key, 0, 0, encryptedVerifier, out);
801 md5_transform (w0_t, w1_t, w2_t, w3_t, digest);
803 rc4_next_16 (rc4_key, 16, j, digest, out);
805 const u32x r0 = out[0];
806 const u32x r1 = out[1];
807 const u32x r2 = out[2];
808 const u32x r3 = out[3];
810 #include VECT_COMPARE_M
814 extern "C" __global__ void __launch_bounds__ (64, 1) m09700_m08 (const pw_t *pws, const gpu_rule_t *rules_buf, const comb_t *combs_buf, const bf_t *bfs_buf, const void *tmps, void *hooks, const u32 *bitmaps_buf_s1_a, const u32 *bitmaps_buf_s1_b, const u32 *bitmaps_buf_s1_c, const u32 *bitmaps_buf_s1_d, const u32 *bitmaps_buf_s2_a, const u32 *bitmaps_buf_s2_b, const u32 *bitmaps_buf_s2_c, const u32 *bitmaps_buf_s2_d, plain_t *plains_buf, const digest_t *digests_buf, u32 *hashes_shown, const salt_t *salt_bufs, const oldoffice01_t *oldoffice01_bufs, u32 *d_return_buf, 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)
818 extern "C" __global__ void __launch_bounds__ (64, 1) m09700_m16 (const pw_t *pws, const gpu_rule_t *rules_buf, const comb_t *combs_buf, const bf_t *bfs_buf, const void *tmps, void *hooks, const u32 *bitmaps_buf_s1_a, const u32 *bitmaps_buf_s1_b, const u32 *bitmaps_buf_s1_c, const u32 *bitmaps_buf_s1_d, const u32 *bitmaps_buf_s2_a, const u32 *bitmaps_buf_s2_b, const u32 *bitmaps_buf_s2_c, const u32 *bitmaps_buf_s2_d, plain_t *plains_buf, const digest_t *digests_buf, u32 *hashes_shown, const salt_t *salt_bufs, const oldoffice01_t *oldoffice01_bufs, u32 *d_return_buf, 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)
822 extern "C" __global__ void __launch_bounds__ (64, 1) m09700_s04 (const pw_t *pws, const gpu_rule_t *rules_buf, const comb_t *combs_buf, const bf_t *bfs_buf, const void *tmps, void *hooks, const u32 *bitmaps_buf_s1_a, const u32 *bitmaps_buf_s1_b, const u32 *bitmaps_buf_s1_c, const u32 *bitmaps_buf_s1_d, const u32 *bitmaps_buf_s2_a, const u32 *bitmaps_buf_s2_b, const u32 *bitmaps_buf_s2_c, const u32 *bitmaps_buf_s2_d, plain_t *plains_buf, const digest_t *digests_buf, u32 *hashes_shown, const salt_t *salt_bufs, const oldoffice01_t *oldoffice01_bufs, u32 *d_return_buf, 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)
828 const u32 lid = threadIdx.x;
830 __shared__ RC4_KEY rc4_keys[64];
832 RC4_KEY *rc4_key = &rc4_keys[lid];
838 const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
840 if (gid >= gid_max) return;
844 pw_buf0[0] = pws[gid].i[ 0];
845 pw_buf0[1] = pws[gid].i[ 1];
846 pw_buf0[2] = pws[gid].i[ 2];
847 pw_buf0[3] = pws[gid].i[ 3];
851 pw_buf1[0] = pws[gid].i[ 4];
852 pw_buf1[1] = pws[gid].i[ 5];
853 pw_buf1[2] = pws[gid].i[ 6];
854 pw_buf1[3] = pws[gid].i[ 7];
856 const u32 pw_len = pws[gid].pw_len;
862 const u32 search[4] =
864 digests_buf[digests_offset].digest_buf[DGST_R0],
865 digests_buf[digests_offset].digest_buf[DGST_R1],
866 digests_buf[digests_offset].digest_buf[DGST_R2],
867 digests_buf[digests_offset].digest_buf[DGST_R3]
876 salt_buf[0] = salt_bufs[salt_pos].salt_buf[0];
877 salt_buf[1] = salt_bufs[salt_pos].salt_buf[1];
878 salt_buf[2] = salt_bufs[salt_pos].salt_buf[2];
879 salt_buf[3] = salt_bufs[salt_pos].salt_buf[3];
885 const u32 version = oldoffice01_bufs[salt_pos].version;
887 u32 encryptedVerifier[4];
889 encryptedVerifier[0] = oldoffice01_bufs[salt_pos].encryptedVerifier[0];
890 encryptedVerifier[1] = oldoffice01_bufs[salt_pos].encryptedVerifier[1];
891 encryptedVerifier[2] = oldoffice01_bufs[salt_pos].encryptedVerifier[2];
892 encryptedVerifier[3] = oldoffice01_bufs[salt_pos].encryptedVerifier[3];
898 for (u32 il_pos = 0; il_pos < rules_cnt; il_pos++)
928 const u32 out_len = apply_rules (c_rules[il_pos].cmds, w0, w1, pw_len);
930 append_0x80_2 (w0, w1, out_len);
937 make_unicode (w0, w0_t, w1_t);
938 make_unicode (w1, w2_t, w3_t);
940 w3_t[2] = out_len * 8 * 2;
944 digest_pre[0] = MD5M_A;
945 digest_pre[1] = MD5M_B;
946 digest_pre[2] = MD5M_C;
947 digest_pre[3] = MD5M_D;
949 md5_transform (w0_t, w1_t, w2_t, w3_t, digest_pre);
951 digest_pre[0] &= 0xffffffff;
952 digest_pre[1] &= 0x000000ff;
953 digest_pre[2] &= 0x00000000;
954 digest_pre[3] &= 0x00000000;
963 gen336 (digest_pre, salt_buf, digest);
965 // now the 40 bit input for the MD5 which then will generate the RC4 key, so it's precomputable!
968 w0_t[1] = digest[1] & 0xff;
989 md5_transform (w0_t, w1_t, w2_t, w3_t, digest);
1000 rc4_init_16 (rc4_key, key);
1004 u8 j = rc4_next_16 (rc4_key, 0, 0, encryptedVerifier, out);
1028 md5_transform (w0_t, w1_t, w2_t, w3_t, digest);
1030 rc4_next_16 (rc4_key, 16, j, digest, out);
1032 const u32x r0 = out[0];
1033 const u32x r1 = out[1];
1034 const u32x r2 = out[2];
1035 const u32x r3 = out[3];
1037 #include VECT_COMPARE_S
1041 extern "C" __global__ void __launch_bounds__ (64, 1) m09700_s08 (const pw_t *pws, const gpu_rule_t *rules_buf, const comb_t *combs_buf, const bf_t *bfs_buf, const void *tmps, void *hooks, const u32 *bitmaps_buf_s1_a, const u32 *bitmaps_buf_s1_b, const u32 *bitmaps_buf_s1_c, const u32 *bitmaps_buf_s1_d, const u32 *bitmaps_buf_s2_a, const u32 *bitmaps_buf_s2_b, const u32 *bitmaps_buf_s2_c, const u32 *bitmaps_buf_s2_d, plain_t *plains_buf, const digest_t *digests_buf, u32 *hashes_shown, const salt_t *salt_bufs, const oldoffice01_t *oldoffice01_bufs, u32 *d_return_buf, 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)
1045 extern "C" __global__ void __launch_bounds__ (64, 1) m09700_s16 (const pw_t *pws, const gpu_rule_t *rules_buf, const comb_t *combs_buf, const bf_t *bfs_buf, const void *tmps, void *hooks, const u32 *bitmaps_buf_s1_a, const u32 *bitmaps_buf_s1_b, const u32 *bitmaps_buf_s1_c, const u32 *bitmaps_buf_s1_d, const u32 *bitmaps_buf_s2_a, const u32 *bitmaps_buf_s2_b, const u32 *bitmaps_buf_s2_c, const u32 *bitmaps_buf_s2_d, plain_t *plains_buf, const digest_t *digests_buf, u32 *hashes_shown, const salt_t *salt_bufs, const oldoffice01_t *oldoffice01_bufs, u32 *d_return_buf, 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)