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"
40 __device__ static void md4_transform (const u32x w0[4], const u32x w1[4], const u32x w2[4], const u32x w3[4], u32x digest[4])
64 MD4_STEP (MD4_Fo, a, b, c, d, w0_t, MD4C00, MD4S00);
65 MD4_STEP (MD4_Fo, d, a, b, c, w1_t, MD4C00, MD4S01);
66 MD4_STEP (MD4_Fo, c, d, a, b, w2_t, MD4C00, MD4S02);
67 MD4_STEP (MD4_Fo, b, c, d, a, w3_t, MD4C00, MD4S03);
68 MD4_STEP (MD4_Fo, a, b, c, d, w4_t, MD4C00, MD4S00);
69 MD4_STEP (MD4_Fo, d, a, b, c, w5_t, MD4C00, MD4S01);
70 MD4_STEP (MD4_Fo, c, d, a, b, w6_t, MD4C00, MD4S02);
71 MD4_STEP (MD4_Fo, b, c, d, a, w7_t, MD4C00, MD4S03);
72 MD4_STEP (MD4_Fo, a, b, c, d, w8_t, MD4C00, MD4S00);
73 MD4_STEP (MD4_Fo, d, a, b, c, w9_t, MD4C00, MD4S01);
74 MD4_STEP (MD4_Fo, c, d, a, b, wa_t, MD4C00, MD4S02);
75 MD4_STEP (MD4_Fo, b, c, d, a, wb_t, MD4C00, MD4S03);
76 MD4_STEP (MD4_Fo, a, b, c, d, wc_t, MD4C00, MD4S00);
77 MD4_STEP (MD4_Fo, d, a, b, c, wd_t, MD4C00, MD4S01);
78 MD4_STEP (MD4_Fo, c, d, a, b, we_t, MD4C00, MD4S02);
79 MD4_STEP (MD4_Fo, b, c, d, a, wf_t, MD4C00, MD4S03);
81 MD4_STEP (MD4_Go, a, b, c, d, w0_t, MD4C01, MD4S10);
82 MD4_STEP (MD4_Go, d, a, b, c, w4_t, MD4C01, MD4S11);
83 MD4_STEP (MD4_Go, c, d, a, b, w8_t, MD4C01, MD4S12);
84 MD4_STEP (MD4_Go, b, c, d, a, wc_t, MD4C01, MD4S13);
85 MD4_STEP (MD4_Go, a, b, c, d, w1_t, MD4C01, MD4S10);
86 MD4_STEP (MD4_Go, d, a, b, c, w5_t, MD4C01, MD4S11);
87 MD4_STEP (MD4_Go, c, d, a, b, w9_t, MD4C01, MD4S12);
88 MD4_STEP (MD4_Go, b, c, d, a, wd_t, MD4C01, MD4S13);
89 MD4_STEP (MD4_Go, a, b, c, d, w2_t, MD4C01, MD4S10);
90 MD4_STEP (MD4_Go, d, a, b, c, w6_t, MD4C01, MD4S11);
91 MD4_STEP (MD4_Go, c, d, a, b, wa_t, MD4C01, MD4S12);
92 MD4_STEP (MD4_Go, b, c, d, a, we_t, MD4C01, MD4S13);
93 MD4_STEP (MD4_Go, a, b, c, d, w3_t, MD4C01, MD4S10);
94 MD4_STEP (MD4_Go, d, a, b, c, w7_t, MD4C01, MD4S11);
95 MD4_STEP (MD4_Go, c, d, a, b, wb_t, MD4C01, MD4S12);
96 MD4_STEP (MD4_Go, b, c, d, a, wf_t, MD4C01, MD4S13);
98 MD4_STEP (MD4_H , a, b, c, d, w0_t, MD4C02, MD4S20);
99 MD4_STEP (MD4_H , d, a, b, c, w8_t, MD4C02, MD4S21);
100 MD4_STEP (MD4_H , c, d, a, b, w4_t, MD4C02, MD4S22);
101 MD4_STEP (MD4_H , b, c, d, a, wc_t, MD4C02, MD4S23);
102 MD4_STEP (MD4_H , a, b, c, d, w2_t, MD4C02, MD4S20);
103 MD4_STEP (MD4_H , d, a, b, c, wa_t, MD4C02, MD4S21);
104 MD4_STEP (MD4_H , c, d, a, b, w6_t, MD4C02, MD4S22);
105 MD4_STEP (MD4_H , b, c, d, a, we_t, MD4C02, MD4S23);
106 MD4_STEP (MD4_H , a, b, c, d, w1_t, MD4C02, MD4S20);
107 MD4_STEP (MD4_H , d, a, b, c, w9_t, MD4C02, MD4S21);
108 MD4_STEP (MD4_H , c, d, a, b, w5_t, MD4C02, MD4S22);
109 MD4_STEP (MD4_H , b, c, d, a, wd_t, MD4C02, MD4S23);
110 MD4_STEP (MD4_H , a, b, c, d, w3_t, MD4C02, MD4S20);
111 MD4_STEP (MD4_H , d, a, b, c, wb_t, MD4C02, MD4S21);
112 MD4_STEP (MD4_H , c, d, a, b, w7_t, MD4C02, MD4S22);
113 MD4_STEP (MD4_H , b, c, d, a, wf_t, MD4C02, MD4S23);
121 __device__ static void md5_transform (const u32x w0[4], const u32x w1[4], const u32x w2[4], const u32x w3[4], u32x digest[4])
145 MD5_STEP (MD5_Fo, a, b, c, d, w0_t, MD5C00, MD5S00);
146 MD5_STEP (MD5_Fo, d, a, b, c, w1_t, MD5C01, MD5S01);
147 MD5_STEP (MD5_Fo, c, d, a, b, w2_t, MD5C02, MD5S02);
148 MD5_STEP (MD5_Fo, b, c, d, a, w3_t, MD5C03, MD5S03);
149 MD5_STEP (MD5_Fo, a, b, c, d, w4_t, MD5C04, MD5S00);
150 MD5_STEP (MD5_Fo, d, a, b, c, w5_t, MD5C05, MD5S01);
151 MD5_STEP (MD5_Fo, c, d, a, b, w6_t, MD5C06, MD5S02);
152 MD5_STEP (MD5_Fo, b, c, d, a, w7_t, MD5C07, MD5S03);
153 MD5_STEP (MD5_Fo, a, b, c, d, w8_t, MD5C08, MD5S00);
154 MD5_STEP (MD5_Fo, d, a, b, c, w9_t, MD5C09, MD5S01);
155 MD5_STEP (MD5_Fo, c, d, a, b, wa_t, MD5C0a, MD5S02);
156 MD5_STEP (MD5_Fo, b, c, d, a, wb_t, MD5C0b, MD5S03);
157 MD5_STEP (MD5_Fo, a, b, c, d, wc_t, MD5C0c, MD5S00);
158 MD5_STEP (MD5_Fo, d, a, b, c, wd_t, MD5C0d, MD5S01);
159 MD5_STEP (MD5_Fo, c, d, a, b, we_t, MD5C0e, MD5S02);
160 MD5_STEP (MD5_Fo, b, c, d, a, wf_t, MD5C0f, MD5S03);
162 MD5_STEP (MD5_Go, a, b, c, d, w1_t, MD5C10, MD5S10);
163 MD5_STEP (MD5_Go, d, a, b, c, w6_t, MD5C11, MD5S11);
164 MD5_STEP (MD5_Go, c, d, a, b, wb_t, MD5C12, MD5S12);
165 MD5_STEP (MD5_Go, b, c, d, a, w0_t, MD5C13, MD5S13);
166 MD5_STEP (MD5_Go, a, b, c, d, w5_t, MD5C14, MD5S10);
167 MD5_STEP (MD5_Go, d, a, b, c, wa_t, MD5C15, MD5S11);
168 MD5_STEP (MD5_Go, c, d, a, b, wf_t, MD5C16, MD5S12);
169 MD5_STEP (MD5_Go, b, c, d, a, w4_t, MD5C17, MD5S13);
170 MD5_STEP (MD5_Go, a, b, c, d, w9_t, MD5C18, MD5S10);
171 MD5_STEP (MD5_Go, d, a, b, c, we_t, MD5C19, MD5S11);
172 MD5_STEP (MD5_Go, c, d, a, b, w3_t, MD5C1a, MD5S12);
173 MD5_STEP (MD5_Go, b, c, d, a, w8_t, MD5C1b, MD5S13);
174 MD5_STEP (MD5_Go, a, b, c, d, wd_t, MD5C1c, MD5S10);
175 MD5_STEP (MD5_Go, d, a, b, c, w2_t, MD5C1d, MD5S11);
176 MD5_STEP (MD5_Go, c, d, a, b, w7_t, MD5C1e, MD5S12);
177 MD5_STEP (MD5_Go, b, c, d, a, wc_t, MD5C1f, MD5S13);
179 MD5_STEP (MD5_H , a, b, c, d, w5_t, MD5C20, MD5S20);
180 MD5_STEP (MD5_H , d, a, b, c, w8_t, MD5C21, MD5S21);
181 MD5_STEP (MD5_H , c, d, a, b, wb_t, MD5C22, MD5S22);
182 MD5_STEP (MD5_H , b, c, d, a, we_t, MD5C23, MD5S23);
183 MD5_STEP (MD5_H , a, b, c, d, w1_t, MD5C24, MD5S20);
184 MD5_STEP (MD5_H , d, a, b, c, w4_t, MD5C25, MD5S21);
185 MD5_STEP (MD5_H , c, d, a, b, w7_t, MD5C26, MD5S22);
186 MD5_STEP (MD5_H , b, c, d, a, wa_t, MD5C27, MD5S23);
187 MD5_STEP (MD5_H , a, b, c, d, wd_t, MD5C28, MD5S20);
188 MD5_STEP (MD5_H , d, a, b, c, w0_t, MD5C29, MD5S21);
189 MD5_STEP (MD5_H , c, d, a, b, w3_t, MD5C2a, MD5S22);
190 MD5_STEP (MD5_H , b, c, d, a, w6_t, MD5C2b, MD5S23);
191 MD5_STEP (MD5_H , a, b, c, d, w9_t, MD5C2c, MD5S20);
192 MD5_STEP (MD5_H , d, a, b, c, wc_t, MD5C2d, MD5S21);
193 MD5_STEP (MD5_H , c, d, a, b, wf_t, MD5C2e, MD5S22);
194 MD5_STEP (MD5_H , b, c, d, a, w2_t, MD5C2f, MD5S23);
196 MD5_STEP (MD5_I , a, b, c, d, w0_t, MD5C30, MD5S30);
197 MD5_STEP (MD5_I , d, a, b, c, w7_t, MD5C31, MD5S31);
198 MD5_STEP (MD5_I , c, d, a, b, we_t, MD5C32, MD5S32);
199 MD5_STEP (MD5_I , b, c, d, a, w5_t, MD5C33, MD5S33);
200 MD5_STEP (MD5_I , a, b, c, d, wc_t, MD5C34, MD5S30);
201 MD5_STEP (MD5_I , d, a, b, c, w3_t, MD5C35, MD5S31);
202 MD5_STEP (MD5_I , c, d, a, b, wa_t, MD5C36, MD5S32);
203 MD5_STEP (MD5_I , b, c, d, a, w1_t, MD5C37, MD5S33);
204 MD5_STEP (MD5_I , a, b, c, d, w8_t, MD5C38, MD5S30);
205 MD5_STEP (MD5_I , d, a, b, c, wf_t, MD5C39, MD5S31);
206 MD5_STEP (MD5_I , c, d, a, b, w6_t, MD5C3a, MD5S32);
207 MD5_STEP (MD5_I , b, c, d, a, wd_t, MD5C3b, MD5S33);
208 MD5_STEP (MD5_I , a, b, c, d, w4_t, MD5C3c, MD5S30);
209 MD5_STEP (MD5_I , d, a, b, c, wb_t, MD5C3d, MD5S31);
210 MD5_STEP (MD5_I , c, d, a, b, w2_t, MD5C3e, MD5S32);
211 MD5_STEP (MD5_I , b, c, d, a, w9_t, MD5C3f, MD5S33);
219 __device__ static void hmac_md5_pad (u32x w0[4], u32x w1[4], u32x w2[4], u32x w3[4], u32x ipad[4], u32x opad[4])
221 w0[0] = w0[0] ^ 0x36363636;
222 w0[1] = w0[1] ^ 0x36363636;
223 w0[2] = w0[2] ^ 0x36363636;
224 w0[3] = w0[3] ^ 0x36363636;
225 w1[0] = w1[0] ^ 0x36363636;
226 w1[1] = w1[1] ^ 0x36363636;
227 w1[2] = w1[2] ^ 0x36363636;
228 w1[3] = w1[3] ^ 0x36363636;
229 w2[0] = w2[0] ^ 0x36363636;
230 w2[1] = w2[1] ^ 0x36363636;
231 w2[2] = w2[2] ^ 0x36363636;
232 w2[3] = w2[3] ^ 0x36363636;
233 w3[0] = w3[0] ^ 0x36363636;
234 w3[1] = w3[1] ^ 0x36363636;
235 w3[2] = w3[2] ^ 0x36363636;
236 w3[3] = w3[3] ^ 0x36363636;
243 md5_transform (w0, w1, w2, w3, ipad);
245 w0[0] = w0[0] ^ 0x6a6a6a6a;
246 w0[1] = w0[1] ^ 0x6a6a6a6a;
247 w0[2] = w0[2] ^ 0x6a6a6a6a;
248 w0[3] = w0[3] ^ 0x6a6a6a6a;
249 w1[0] = w1[0] ^ 0x6a6a6a6a;
250 w1[1] = w1[1] ^ 0x6a6a6a6a;
251 w1[2] = w1[2] ^ 0x6a6a6a6a;
252 w1[3] = w1[3] ^ 0x6a6a6a6a;
253 w2[0] = w2[0] ^ 0x6a6a6a6a;
254 w2[1] = w2[1] ^ 0x6a6a6a6a;
255 w2[2] = w2[2] ^ 0x6a6a6a6a;
256 w2[3] = w2[3] ^ 0x6a6a6a6a;
257 w3[0] = w3[0] ^ 0x6a6a6a6a;
258 w3[1] = w3[1] ^ 0x6a6a6a6a;
259 w3[2] = w3[2] ^ 0x6a6a6a6a;
260 w3[3] = w3[3] ^ 0x6a6a6a6a;
267 md5_transform (w0, w1, w2, w3, opad);
270 __device__ static void hmac_md5_run (u32x w0[4], u32x w1[4], u32x w2[4], u32x w3[4], u32x ipad[4], u32x opad[4], u32x digest[4])
277 md5_transform (w0, w1, w2, w3, digest);
293 w3[2] = (64 + 16) * 8;
301 md5_transform (w0, w1, w2, w3, digest);
304 __device__ __constant__ gpu_rule_t c_rules[1024];
306 extern "C" __global__ void __launch_bounds__ (256, 1) m05600_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 netntlm_t *netntlm_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)
312 const u32 lid = threadIdx.x;
318 const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
322 pw_buf0[0] = pws[gid].i[ 0];
323 pw_buf0[1] = pws[gid].i[ 1];
324 pw_buf0[2] = pws[gid].i[ 2];
325 pw_buf0[3] = pws[gid].i[ 3];
329 pw_buf1[0] = pws[gid].i[ 4];
330 pw_buf1[1] = pws[gid].i[ 5];
331 pw_buf1[2] = pws[gid].i[ 6];
332 pw_buf1[3] = pws[gid].i[ 7];
334 const u32 pw_len = pws[gid].pw_len;
340 __shared__ u32 s_userdomain_buf[64];
341 __shared__ u32 s_chall_buf[256];
343 const u32 userdomain_len = netntlm_bufs[salt_pos].user_len
344 + netntlm_bufs[salt_pos].domain_len;
346 const u32 chall_len = netntlm_bufs[salt_pos].srvchall_len
347 + netntlm_bufs[salt_pos].clichall_len;
351 s_userdomain_buf[lid] = netntlm_bufs[salt_pos].userdomain_buf[lid];
354 s_chall_buf[lid] = netntlm_bufs[salt_pos].chall_buf[lid];
358 if (gid >= gid_max) return;
364 for (u32 il_pos = 0; il_pos < rules_cnt; il_pos++)
394 const u32 out_len = apply_rules (c_rules[il_pos].cmds, w0, w1, pw_len);
396 append_0x80_2 (w0, w1, out_len);
403 make_unicode (w0, w0_t, w1_t);
404 make_unicode (w1, w2_t, w3_t);
406 w3_t[2] = out_len * 8 * 2;
415 md4_transform (w0_t, w1_t, w2_t, w3_t, digest);
442 hmac_md5_pad (w0_t, w1_t, w2_t, w3_t, ipad, opad);
447 for (left = userdomain_len, off = 0; left >= 56; left -= 64, off += 16)
449 w0_t[0] = s_userdomain_buf[off + 0];
450 w0_t[1] = s_userdomain_buf[off + 1];
451 w0_t[2] = s_userdomain_buf[off + 2];
452 w0_t[3] = s_userdomain_buf[off + 3];
453 w1_t[0] = s_userdomain_buf[off + 4];
454 w1_t[1] = s_userdomain_buf[off + 5];
455 w1_t[2] = s_userdomain_buf[off + 6];
456 w1_t[3] = s_userdomain_buf[off + 7];
457 w2_t[0] = s_userdomain_buf[off + 8];
458 w2_t[1] = s_userdomain_buf[off + 9];
459 w2_t[2] = s_userdomain_buf[off + 10];
460 w2_t[3] = s_userdomain_buf[off + 11];
461 w3_t[0] = s_userdomain_buf[off + 12];
462 w3_t[1] = s_userdomain_buf[off + 13];
463 w3_t[2] = s_userdomain_buf[off + 14];
464 w3_t[3] = s_userdomain_buf[off + 15];
466 md5_transform (w0_t, w1_t, w2_t, w3_t, ipad);
469 w0_t[0] = s_userdomain_buf[off + 0];
470 w0_t[1] = s_userdomain_buf[off + 1];
471 w0_t[2] = s_userdomain_buf[off + 2];
472 w0_t[3] = s_userdomain_buf[off + 3];
473 w1_t[0] = s_userdomain_buf[off + 4];
474 w1_t[1] = s_userdomain_buf[off + 5];
475 w1_t[2] = s_userdomain_buf[off + 6];
476 w1_t[3] = s_userdomain_buf[off + 7];
477 w2_t[0] = s_userdomain_buf[off + 8];
478 w2_t[1] = s_userdomain_buf[off + 9];
479 w2_t[2] = s_userdomain_buf[off + 10];
480 w2_t[3] = s_userdomain_buf[off + 11];
481 w3_t[0] = s_userdomain_buf[off + 12];
482 w3_t[1] = s_userdomain_buf[off + 13];
483 w3_t[2] = (64 + userdomain_len) * 8;
486 hmac_md5_run (w0_t, w1_t, w2_t, w3_t, ipad, opad, digest);
510 hmac_md5_pad (w0_t, w1_t, w2_t, w3_t, ipad, opad);
512 for (left = chall_len, off = 0; left >= 56; left -= 64, off += 16)
514 w0_t[0] = s_chall_buf[off + 0];
515 w0_t[1] = s_chall_buf[off + 1];
516 w0_t[2] = s_chall_buf[off + 2];
517 w0_t[3] = s_chall_buf[off + 3];
518 w1_t[0] = s_chall_buf[off + 4];
519 w1_t[1] = s_chall_buf[off + 5];
520 w1_t[2] = s_chall_buf[off + 6];
521 w1_t[3] = s_chall_buf[off + 7];
522 w2_t[0] = s_chall_buf[off + 8];
523 w2_t[1] = s_chall_buf[off + 9];
524 w2_t[2] = s_chall_buf[off + 10];
525 w2_t[3] = s_chall_buf[off + 11];
526 w3_t[0] = s_chall_buf[off + 12];
527 w3_t[1] = s_chall_buf[off + 13];
528 w3_t[2] = s_chall_buf[off + 14];
529 w3_t[3] = s_chall_buf[off + 15];
531 md5_transform (w0_t, w1_t, w2_t, w3_t, ipad);
534 w0_t[0] = s_chall_buf[off + 0];
535 w0_t[1] = s_chall_buf[off + 1];
536 w0_t[2] = s_chall_buf[off + 2];
537 w0_t[3] = s_chall_buf[off + 3];
538 w1_t[0] = s_chall_buf[off + 4];
539 w1_t[1] = s_chall_buf[off + 5];
540 w1_t[2] = s_chall_buf[off + 6];
541 w1_t[3] = s_chall_buf[off + 7];
542 w2_t[0] = s_chall_buf[off + 8];
543 w2_t[1] = s_chall_buf[off + 9];
544 w2_t[2] = s_chall_buf[off + 10];
545 w2_t[3] = s_chall_buf[off + 11];
546 w3_t[0] = s_chall_buf[off + 12];
547 w3_t[1] = s_chall_buf[off + 13];
548 w3_t[2] = (64 + chall_len) * 8;
551 hmac_md5_run (w0_t, w1_t, w2_t, w3_t, ipad, opad, digest);
553 const u32x r0 = digest[0];
554 const u32x r1 = digest[3];
555 const u32x r2 = digest[2];
556 const u32x r3 = digest[1];
558 #include VECT_COMPARE_M
562 extern "C" __global__ void __launch_bounds__ (256, 1) m05600_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 netntlm_t *netntlm_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)
566 extern "C" __global__ void __launch_bounds__ (256, 1) m05600_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 netntlm_t *netntlm_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)
570 extern "C" __global__ void __launch_bounds__ (256, 1) m05600_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 netntlm_t *netntlm_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)
576 const u32 lid = threadIdx.x;
582 const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
586 pw_buf0[0] = pws[gid].i[ 0];
587 pw_buf0[1] = pws[gid].i[ 1];
588 pw_buf0[2] = pws[gid].i[ 2];
589 pw_buf0[3] = pws[gid].i[ 3];
593 pw_buf1[0] = pws[gid].i[ 4];
594 pw_buf1[1] = pws[gid].i[ 5];
595 pw_buf1[2] = pws[gid].i[ 6];
596 pw_buf1[3] = pws[gid].i[ 7];
598 const u32 pw_len = pws[gid].pw_len;
604 __shared__ u32 s_userdomain_buf[64];
605 __shared__ u32 s_chall_buf[256];
607 const u32 userdomain_len = netntlm_bufs[salt_pos].user_len
608 + netntlm_bufs[salt_pos].domain_len;
610 const u32 chall_len = netntlm_bufs[salt_pos].srvchall_len
611 + netntlm_bufs[salt_pos].clichall_len;
615 s_userdomain_buf[lid] = netntlm_bufs[salt_pos].userdomain_buf[lid];
618 s_chall_buf[lid] = netntlm_bufs[salt_pos].chall_buf[lid];
622 if (gid >= gid_max) return;
628 const u32 search[4] =
630 digests_buf[digests_offset].digest_buf[DGST_R0],
631 digests_buf[digests_offset].digest_buf[DGST_R1],
632 digests_buf[digests_offset].digest_buf[DGST_R2],
633 digests_buf[digests_offset].digest_buf[DGST_R3]
640 for (u32 il_pos = 0; il_pos < rules_cnt; il_pos++)
670 const u32 out_len = apply_rules (c_rules[il_pos].cmds, w0, w1, pw_len);
672 append_0x80_2 (w0, w1, out_len);
679 make_unicode (w0, w0_t, w1_t);
680 make_unicode (w1, w2_t, w3_t);
682 w3_t[2] = out_len * 8 * 2;
691 md4_transform (w0_t, w1_t, w2_t, w3_t, digest);
718 hmac_md5_pad (w0_t, w1_t, w2_t, w3_t, ipad, opad);
723 for (left = userdomain_len, off = 0; left >= 56; left -= 64, off += 16)
725 w0_t[0] = s_userdomain_buf[off + 0];
726 w0_t[1] = s_userdomain_buf[off + 1];
727 w0_t[2] = s_userdomain_buf[off + 2];
728 w0_t[3] = s_userdomain_buf[off + 3];
729 w1_t[0] = s_userdomain_buf[off + 4];
730 w1_t[1] = s_userdomain_buf[off + 5];
731 w1_t[2] = s_userdomain_buf[off + 6];
732 w1_t[3] = s_userdomain_buf[off + 7];
733 w2_t[0] = s_userdomain_buf[off + 8];
734 w2_t[1] = s_userdomain_buf[off + 9];
735 w2_t[2] = s_userdomain_buf[off + 10];
736 w2_t[3] = s_userdomain_buf[off + 11];
737 w3_t[0] = s_userdomain_buf[off + 12];
738 w3_t[1] = s_userdomain_buf[off + 13];
739 w3_t[2] = s_userdomain_buf[off + 14];
740 w3_t[3] = s_userdomain_buf[off + 15];
742 md5_transform (w0_t, w1_t, w2_t, w3_t, ipad);
745 w0_t[0] = s_userdomain_buf[off + 0];
746 w0_t[1] = s_userdomain_buf[off + 1];
747 w0_t[2] = s_userdomain_buf[off + 2];
748 w0_t[3] = s_userdomain_buf[off + 3];
749 w1_t[0] = s_userdomain_buf[off + 4];
750 w1_t[1] = s_userdomain_buf[off + 5];
751 w1_t[2] = s_userdomain_buf[off + 6];
752 w1_t[3] = s_userdomain_buf[off + 7];
753 w2_t[0] = s_userdomain_buf[off + 8];
754 w2_t[1] = s_userdomain_buf[off + 9];
755 w2_t[2] = s_userdomain_buf[off + 10];
756 w2_t[3] = s_userdomain_buf[off + 11];
757 w3_t[0] = s_userdomain_buf[off + 12];
758 w3_t[1] = s_userdomain_buf[off + 13];
759 w3_t[2] = (64 + userdomain_len) * 8;
762 hmac_md5_run (w0_t, w1_t, w2_t, w3_t, ipad, opad, digest);
786 hmac_md5_pad (w0_t, w1_t, w2_t, w3_t, ipad, opad);
788 for (left = chall_len, off = 0; left >= 56; left -= 64, off += 16)
790 w0_t[0] = s_chall_buf[off + 0];
791 w0_t[1] = s_chall_buf[off + 1];
792 w0_t[2] = s_chall_buf[off + 2];
793 w0_t[3] = s_chall_buf[off + 3];
794 w1_t[0] = s_chall_buf[off + 4];
795 w1_t[1] = s_chall_buf[off + 5];
796 w1_t[2] = s_chall_buf[off + 6];
797 w1_t[3] = s_chall_buf[off + 7];
798 w2_t[0] = s_chall_buf[off + 8];
799 w2_t[1] = s_chall_buf[off + 9];
800 w2_t[2] = s_chall_buf[off + 10];
801 w2_t[3] = s_chall_buf[off + 11];
802 w3_t[0] = s_chall_buf[off + 12];
803 w3_t[1] = s_chall_buf[off + 13];
804 w3_t[2] = s_chall_buf[off + 14];
805 w3_t[3] = s_chall_buf[off + 15];
807 md5_transform (w0_t, w1_t, w2_t, w3_t, ipad);
810 w0_t[0] = s_chall_buf[off + 0];
811 w0_t[1] = s_chall_buf[off + 1];
812 w0_t[2] = s_chall_buf[off + 2];
813 w0_t[3] = s_chall_buf[off + 3];
814 w1_t[0] = s_chall_buf[off + 4];
815 w1_t[1] = s_chall_buf[off + 5];
816 w1_t[2] = s_chall_buf[off + 6];
817 w1_t[3] = s_chall_buf[off + 7];
818 w2_t[0] = s_chall_buf[off + 8];
819 w2_t[1] = s_chall_buf[off + 9];
820 w2_t[2] = s_chall_buf[off + 10];
821 w2_t[3] = s_chall_buf[off + 11];
822 w3_t[0] = s_chall_buf[off + 12];
823 w3_t[1] = s_chall_buf[off + 13];
824 w3_t[2] = (64 + chall_len) * 8;
827 hmac_md5_run (w0_t, w1_t, w2_t, w3_t, ipad, opad, digest);
829 const u32x r0 = digest[0];
830 const u32x r1 = digest[3];
831 const u32x r2 = digest[2];
832 const u32x r3 = digest[1];
834 #include VECT_COMPARE_S
838 extern "C" __global__ void __launch_bounds__ (256, 1) m05600_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 netntlm_t *netntlm_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)
842 extern "C" __global__ void __launch_bounds__ (256, 1) m05600_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 netntlm_t *netntlm_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)