2 * Author......: Jens Steube <jens.steube@gmail.com>
8 #include "include/constants.h"
9 #include "include/kernel_vendor.h"
28 #include "include/kernel_functions.c"
29 #include "types_amd.c"
30 #include "common_amd.c"
33 #define VECT_COMPARE_S "check_single_vect1_comp4.c"
34 #define VECT_COMPARE_M "check_multi_vect1_comp4.c"
38 #define VECT_COMPARE_S "check_single_vect2_comp4.c"
39 #define VECT_COMPARE_M "check_multi_vect2_comp4.c"
42 static void md4_transform (const u32x w0[4], const u32x w1[4], const u32x w2[4], const u32x w3[4], u32x digest[4])
66 MD4_STEP (MD4_Fo, a, b, c, d, w0_t, MD4C00, MD4S00);
67 MD4_STEP (MD4_Fo, d, a, b, c, w1_t, MD4C00, MD4S01);
68 MD4_STEP (MD4_Fo, c, d, a, b, w2_t, MD4C00, MD4S02);
69 MD4_STEP (MD4_Fo, b, c, d, a, w3_t, MD4C00, MD4S03);
70 MD4_STEP (MD4_Fo, a, b, c, d, w4_t, MD4C00, MD4S00);
71 MD4_STEP (MD4_Fo, d, a, b, c, w5_t, MD4C00, MD4S01);
72 MD4_STEP (MD4_Fo, c, d, a, b, w6_t, MD4C00, MD4S02);
73 MD4_STEP (MD4_Fo, b, c, d, a, w7_t, MD4C00, MD4S03);
74 MD4_STEP (MD4_Fo, a, b, c, d, w8_t, MD4C00, MD4S00);
75 MD4_STEP (MD4_Fo, d, a, b, c, w9_t, MD4C00, MD4S01);
76 MD4_STEP (MD4_Fo, c, d, a, b, wa_t, MD4C00, MD4S02);
77 MD4_STEP (MD4_Fo, b, c, d, a, wb_t, MD4C00, MD4S03);
78 MD4_STEP (MD4_Fo, a, b, c, d, wc_t, MD4C00, MD4S00);
79 MD4_STEP (MD4_Fo, d, a, b, c, wd_t, MD4C00, MD4S01);
80 MD4_STEP (MD4_Fo, c, d, a, b, we_t, MD4C00, MD4S02);
81 MD4_STEP (MD4_Fo, b, c, d, a, wf_t, MD4C00, MD4S03);
83 MD4_STEP (MD4_Go, a, b, c, d, w0_t, MD4C01, MD4S10);
84 MD4_STEP (MD4_Go, d, a, b, c, w4_t, MD4C01, MD4S11);
85 MD4_STEP (MD4_Go, c, d, a, b, w8_t, MD4C01, MD4S12);
86 MD4_STEP (MD4_Go, b, c, d, a, wc_t, MD4C01, MD4S13);
87 MD4_STEP (MD4_Go, a, b, c, d, w1_t, MD4C01, MD4S10);
88 MD4_STEP (MD4_Go, d, a, b, c, w5_t, MD4C01, MD4S11);
89 MD4_STEP (MD4_Go, c, d, a, b, w9_t, MD4C01, MD4S12);
90 MD4_STEP (MD4_Go, b, c, d, a, wd_t, MD4C01, MD4S13);
91 MD4_STEP (MD4_Go, a, b, c, d, w2_t, MD4C01, MD4S10);
92 MD4_STEP (MD4_Go, d, a, b, c, w6_t, MD4C01, MD4S11);
93 MD4_STEP (MD4_Go, c, d, a, b, wa_t, MD4C01, MD4S12);
94 MD4_STEP (MD4_Go, b, c, d, a, we_t, MD4C01, MD4S13);
95 MD4_STEP (MD4_Go, a, b, c, d, w3_t, MD4C01, MD4S10);
96 MD4_STEP (MD4_Go, d, a, b, c, w7_t, MD4C01, MD4S11);
97 MD4_STEP (MD4_Go, c, d, a, b, wb_t, MD4C01, MD4S12);
98 MD4_STEP (MD4_Go, b, c, d, a, wf_t, MD4C01, MD4S13);
100 MD4_STEP (MD4_H , a, b, c, d, w0_t, MD4C02, MD4S20);
101 MD4_STEP (MD4_H , d, a, b, c, w8_t, MD4C02, MD4S21);
102 MD4_STEP (MD4_H , c, d, a, b, w4_t, MD4C02, MD4S22);
103 MD4_STEP (MD4_H , b, c, d, a, wc_t, MD4C02, MD4S23);
104 MD4_STEP (MD4_H , a, b, c, d, w2_t, MD4C02, MD4S20);
105 MD4_STEP (MD4_H , d, a, b, c, wa_t, MD4C02, MD4S21);
106 MD4_STEP (MD4_H , c, d, a, b, w6_t, MD4C02, MD4S22);
107 MD4_STEP (MD4_H , b, c, d, a, we_t, MD4C02, MD4S23);
108 MD4_STEP (MD4_H , a, b, c, d, w1_t, MD4C02, MD4S20);
109 MD4_STEP (MD4_H , d, a, b, c, w9_t, MD4C02, MD4S21);
110 MD4_STEP (MD4_H , c, d, a, b, w5_t, MD4C02, MD4S22);
111 MD4_STEP (MD4_H , b, c, d, a, wd_t, MD4C02, MD4S23);
112 MD4_STEP (MD4_H , a, b, c, d, w3_t, MD4C02, MD4S20);
113 MD4_STEP (MD4_H , d, a, b, c, wb_t, MD4C02, MD4S21);
114 MD4_STEP (MD4_H , c, d, a, b, w7_t, MD4C02, MD4S22);
115 MD4_STEP (MD4_H , b, c, d, a, wf_t, MD4C02, MD4S23);
123 static void md5_transform (const u32x w0[4], const u32x w1[4], const u32x w2[4], const u32x w3[4], u32x digest[4])
147 MD5_STEP (MD5_Fo, a, b, c, d, w0_t, MD5C00, MD5S00);
148 MD5_STEP (MD5_Fo, d, a, b, c, w1_t, MD5C01, MD5S01);
149 MD5_STEP (MD5_Fo, c, d, a, b, w2_t, MD5C02, MD5S02);
150 MD5_STEP (MD5_Fo, b, c, d, a, w3_t, MD5C03, MD5S03);
151 MD5_STEP (MD5_Fo, a, b, c, d, w4_t, MD5C04, MD5S00);
152 MD5_STEP (MD5_Fo, d, a, b, c, w5_t, MD5C05, MD5S01);
153 MD5_STEP (MD5_Fo, c, d, a, b, w6_t, MD5C06, MD5S02);
154 MD5_STEP (MD5_Fo, b, c, d, a, w7_t, MD5C07, MD5S03);
155 MD5_STEP (MD5_Fo, a, b, c, d, w8_t, MD5C08, MD5S00);
156 MD5_STEP (MD5_Fo, d, a, b, c, w9_t, MD5C09, MD5S01);
157 MD5_STEP (MD5_Fo, c, d, a, b, wa_t, MD5C0a, MD5S02);
158 MD5_STEP (MD5_Fo, b, c, d, a, wb_t, MD5C0b, MD5S03);
159 MD5_STEP (MD5_Fo, a, b, c, d, wc_t, MD5C0c, MD5S00);
160 MD5_STEP (MD5_Fo, d, a, b, c, wd_t, MD5C0d, MD5S01);
161 MD5_STEP (MD5_Fo, c, d, a, b, we_t, MD5C0e, MD5S02);
162 MD5_STEP (MD5_Fo, b, c, d, a, wf_t, MD5C0f, MD5S03);
164 MD5_STEP (MD5_Go, a, b, c, d, w1_t, MD5C10, MD5S10);
165 MD5_STEP (MD5_Go, d, a, b, c, w6_t, MD5C11, MD5S11);
166 MD5_STEP (MD5_Go, c, d, a, b, wb_t, MD5C12, MD5S12);
167 MD5_STEP (MD5_Go, b, c, d, a, w0_t, MD5C13, MD5S13);
168 MD5_STEP (MD5_Go, a, b, c, d, w5_t, MD5C14, MD5S10);
169 MD5_STEP (MD5_Go, d, a, b, c, wa_t, MD5C15, MD5S11);
170 MD5_STEP (MD5_Go, c, d, a, b, wf_t, MD5C16, MD5S12);
171 MD5_STEP (MD5_Go, b, c, d, a, w4_t, MD5C17, MD5S13);
172 MD5_STEP (MD5_Go, a, b, c, d, w9_t, MD5C18, MD5S10);
173 MD5_STEP (MD5_Go, d, a, b, c, we_t, MD5C19, MD5S11);
174 MD5_STEP (MD5_Go, c, d, a, b, w3_t, MD5C1a, MD5S12);
175 MD5_STEP (MD5_Go, b, c, d, a, w8_t, MD5C1b, MD5S13);
176 MD5_STEP (MD5_Go, a, b, c, d, wd_t, MD5C1c, MD5S10);
177 MD5_STEP (MD5_Go, d, a, b, c, w2_t, MD5C1d, MD5S11);
178 MD5_STEP (MD5_Go, c, d, a, b, w7_t, MD5C1e, MD5S12);
179 MD5_STEP (MD5_Go, b, c, d, a, wc_t, MD5C1f, MD5S13);
181 MD5_STEP (MD5_H , a, b, c, d, w5_t, MD5C20, MD5S20);
182 MD5_STEP (MD5_H , d, a, b, c, w8_t, MD5C21, MD5S21);
183 MD5_STEP (MD5_H , c, d, a, b, wb_t, MD5C22, MD5S22);
184 MD5_STEP (MD5_H , b, c, d, a, we_t, MD5C23, MD5S23);
185 MD5_STEP (MD5_H , a, b, c, d, w1_t, MD5C24, MD5S20);
186 MD5_STEP (MD5_H , d, a, b, c, w4_t, MD5C25, MD5S21);
187 MD5_STEP (MD5_H , c, d, a, b, w7_t, MD5C26, MD5S22);
188 MD5_STEP (MD5_H , b, c, d, a, wa_t, MD5C27, MD5S23);
189 MD5_STEP (MD5_H , a, b, c, d, wd_t, MD5C28, MD5S20);
190 MD5_STEP (MD5_H , d, a, b, c, w0_t, MD5C29, MD5S21);
191 MD5_STEP (MD5_H , c, d, a, b, w3_t, MD5C2a, MD5S22);
192 MD5_STEP (MD5_H , b, c, d, a, w6_t, MD5C2b, MD5S23);
193 MD5_STEP (MD5_H , a, b, c, d, w9_t, MD5C2c, MD5S20);
194 MD5_STEP (MD5_H , d, a, b, c, wc_t, MD5C2d, MD5S21);
195 MD5_STEP (MD5_H , c, d, a, b, wf_t, MD5C2e, MD5S22);
196 MD5_STEP (MD5_H , b, c, d, a, w2_t, MD5C2f, MD5S23);
198 MD5_STEP (MD5_I , a, b, c, d, w0_t, MD5C30, MD5S30);
199 MD5_STEP (MD5_I , d, a, b, c, w7_t, MD5C31, MD5S31);
200 MD5_STEP (MD5_I , c, d, a, b, we_t, MD5C32, MD5S32);
201 MD5_STEP (MD5_I , b, c, d, a, w5_t, MD5C33, MD5S33);
202 MD5_STEP (MD5_I , a, b, c, d, wc_t, MD5C34, MD5S30);
203 MD5_STEP (MD5_I , d, a, b, c, w3_t, MD5C35, MD5S31);
204 MD5_STEP (MD5_I , c, d, a, b, wa_t, MD5C36, MD5S32);
205 MD5_STEP (MD5_I , b, c, d, a, w1_t, MD5C37, MD5S33);
206 MD5_STEP (MD5_I , a, b, c, d, w8_t, MD5C38, MD5S30);
207 MD5_STEP (MD5_I , d, a, b, c, wf_t, MD5C39, MD5S31);
208 MD5_STEP (MD5_I , c, d, a, b, w6_t, MD5C3a, MD5S32);
209 MD5_STEP (MD5_I , b, c, d, a, wd_t, MD5C3b, MD5S33);
210 MD5_STEP (MD5_I , a, b, c, d, w4_t, MD5C3c, MD5S30);
211 MD5_STEP (MD5_I , d, a, b, c, wb_t, MD5C3d, MD5S31);
212 MD5_STEP (MD5_I , c, d, a, b, w2_t, MD5C3e, MD5S32);
213 MD5_STEP (MD5_I , b, c, d, a, w9_t, MD5C3f, MD5S33);
221 static void hmac_md5_pad (u32x w0[4], u32x w1[4], u32x w2[4], u32x w3[4], u32x ipad[4], u32x opad[4])
223 w0[0] = w0[0] ^ 0x36363636;
224 w0[1] = w0[1] ^ 0x36363636;
225 w0[2] = w0[2] ^ 0x36363636;
226 w0[3] = w0[3] ^ 0x36363636;
227 w1[0] = w1[0] ^ 0x36363636;
228 w1[1] = w1[1] ^ 0x36363636;
229 w1[2] = w1[2] ^ 0x36363636;
230 w1[3] = w1[3] ^ 0x36363636;
231 w2[0] = w2[0] ^ 0x36363636;
232 w2[1] = w2[1] ^ 0x36363636;
233 w2[2] = w2[2] ^ 0x36363636;
234 w2[3] = w2[3] ^ 0x36363636;
235 w3[0] = w3[0] ^ 0x36363636;
236 w3[1] = w3[1] ^ 0x36363636;
237 w3[2] = w3[2] ^ 0x36363636;
238 w3[3] = w3[3] ^ 0x36363636;
245 md5_transform (w0, w1, w2, w3, ipad);
247 w0[0] = w0[0] ^ 0x6a6a6a6a;
248 w0[1] = w0[1] ^ 0x6a6a6a6a;
249 w0[2] = w0[2] ^ 0x6a6a6a6a;
250 w0[3] = w0[3] ^ 0x6a6a6a6a;
251 w1[0] = w1[0] ^ 0x6a6a6a6a;
252 w1[1] = w1[1] ^ 0x6a6a6a6a;
253 w1[2] = w1[2] ^ 0x6a6a6a6a;
254 w1[3] = w1[3] ^ 0x6a6a6a6a;
255 w2[0] = w2[0] ^ 0x6a6a6a6a;
256 w2[1] = w2[1] ^ 0x6a6a6a6a;
257 w2[2] = w2[2] ^ 0x6a6a6a6a;
258 w2[3] = w2[3] ^ 0x6a6a6a6a;
259 w3[0] = w3[0] ^ 0x6a6a6a6a;
260 w3[1] = w3[1] ^ 0x6a6a6a6a;
261 w3[2] = w3[2] ^ 0x6a6a6a6a;
262 w3[3] = w3[3] ^ 0x6a6a6a6a;
269 md5_transform (w0, w1, w2, w3, opad);
272 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])
279 md5_transform (w0, w1, w2, w3, digest);
295 w3[2] = (64 + 16) * 8;
303 md5_transform (w0, w1, w2, w3, digest);
306 static void m05600m (u32x w0[4], u32x w1[4], u32x w2[4], u32x w3[4], const u32 pw_len, __global pw_t *pws, __global gpu_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 netntlm_t *netntlm_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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, __local u32 s_userdomain_buf[64], __local u32 s_chall_buf[256])
312 const u32 gid = get_global_id (0);
313 const u32 lid = get_local_id (0);
319 const u32 userdomain_len = netntlm_bufs[salt_pos].user_len
320 + netntlm_bufs[salt_pos].domain_len;
322 const u32 chall_len = netntlm_bufs[salt_pos].srvchall_len
323 + netntlm_bufs[salt_pos].clichall_len;
331 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos++)
333 const u32 w0r = bfs_buf[il_pos].i;
344 md4_transform (w0, w1, w2, w3, digest);
376 hmac_md5_pad (w0_t, w1_t, w2_t, w3_t, ipad, opad);
381 for (left = userdomain_len, off = 0; left >= 56; left -= 64, off += 16)
383 w0_t[0] = s_userdomain_buf[off + 0];
384 w0_t[1] = s_userdomain_buf[off + 1];
385 w0_t[2] = s_userdomain_buf[off + 2];
386 w0_t[3] = s_userdomain_buf[off + 3];
387 w1_t[0] = s_userdomain_buf[off + 4];
388 w1_t[1] = s_userdomain_buf[off + 5];
389 w1_t[2] = s_userdomain_buf[off + 6];
390 w1_t[3] = s_userdomain_buf[off + 7];
391 w2_t[0] = s_userdomain_buf[off + 8];
392 w2_t[1] = s_userdomain_buf[off + 9];
393 w2_t[2] = s_userdomain_buf[off + 10];
394 w2_t[3] = s_userdomain_buf[off + 11];
395 w3_t[0] = s_userdomain_buf[off + 12];
396 w3_t[1] = s_userdomain_buf[off + 13];
397 w3_t[2] = s_userdomain_buf[off + 14];
398 w3_t[3] = s_userdomain_buf[off + 15];
400 md5_transform (w0_t, w1_t, w2_t, w3_t, ipad);
403 w0_t[0] = s_userdomain_buf[off + 0];
404 w0_t[1] = s_userdomain_buf[off + 1];
405 w0_t[2] = s_userdomain_buf[off + 2];
406 w0_t[3] = s_userdomain_buf[off + 3];
407 w1_t[0] = s_userdomain_buf[off + 4];
408 w1_t[1] = s_userdomain_buf[off + 5];
409 w1_t[2] = s_userdomain_buf[off + 6];
410 w1_t[3] = s_userdomain_buf[off + 7];
411 w2_t[0] = s_userdomain_buf[off + 8];
412 w2_t[1] = s_userdomain_buf[off + 9];
413 w2_t[2] = s_userdomain_buf[off + 10];
414 w2_t[3] = s_userdomain_buf[off + 11];
415 w3_t[0] = s_userdomain_buf[off + 12];
416 w3_t[1] = s_userdomain_buf[off + 13];
417 w3_t[2] = (64 + userdomain_len) * 8;
420 hmac_md5_run (w0_t, w1_t, w2_t, w3_t, ipad, opad, digest);
444 hmac_md5_pad (w0_t, w1_t, w2_t, w3_t, ipad, opad);
446 for (left = chall_len, off = 0; left >= 56; left -= 64, off += 16)
448 w0_t[0] = s_chall_buf[off + 0];
449 w0_t[1] = s_chall_buf[off + 1];
450 w0_t[2] = s_chall_buf[off + 2];
451 w0_t[3] = s_chall_buf[off + 3];
452 w1_t[0] = s_chall_buf[off + 4];
453 w1_t[1] = s_chall_buf[off + 5];
454 w1_t[2] = s_chall_buf[off + 6];
455 w1_t[3] = s_chall_buf[off + 7];
456 w2_t[0] = s_chall_buf[off + 8];
457 w2_t[1] = s_chall_buf[off + 9];
458 w2_t[2] = s_chall_buf[off + 10];
459 w2_t[3] = s_chall_buf[off + 11];
460 w3_t[0] = s_chall_buf[off + 12];
461 w3_t[1] = s_chall_buf[off + 13];
462 w3_t[2] = s_chall_buf[off + 14];
463 w3_t[3] = s_chall_buf[off + 15];
465 md5_transform (w0_t, w1_t, w2_t, w3_t, ipad);
468 w0_t[0] = s_chall_buf[off + 0];
469 w0_t[1] = s_chall_buf[off + 1];
470 w0_t[2] = s_chall_buf[off + 2];
471 w0_t[3] = s_chall_buf[off + 3];
472 w1_t[0] = s_chall_buf[off + 4];
473 w1_t[1] = s_chall_buf[off + 5];
474 w1_t[2] = s_chall_buf[off + 6];
475 w1_t[3] = s_chall_buf[off + 7];
476 w2_t[0] = s_chall_buf[off + 8];
477 w2_t[1] = s_chall_buf[off + 9];
478 w2_t[2] = s_chall_buf[off + 10];
479 w2_t[3] = s_chall_buf[off + 11];
480 w3_t[0] = s_chall_buf[off + 12];
481 w3_t[1] = s_chall_buf[off + 13];
482 w3_t[2] = (64 + chall_len) * 8;
485 hmac_md5_run (w0_t, w1_t, w2_t, w3_t, ipad, opad, digest);
487 const u32x r0 = digest[0];
488 const u32x r1 = digest[3];
489 const u32x r2 = digest[2];
490 const u32x r3 = digest[1];
492 #include VECT_COMPARE_M
496 static void m05600s (u32x w0[4], u32x w1[4], u32x w2[4], u32x w3[4], const u32 pw_len, __global pw_t *pws, __global gpu_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 netntlm_t *netntlm_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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, __local u32 s_userdomain_buf[64], __local u32 s_chall_buf[256])
502 const u32 gid = get_global_id (0);
503 const u32 lid = get_local_id (0);
509 const u32 search[4] =
511 digests_buf[digests_offset].digest_buf[DGST_R0],
512 digests_buf[digests_offset].digest_buf[DGST_R1],
513 digests_buf[digests_offset].digest_buf[DGST_R2],
514 digests_buf[digests_offset].digest_buf[DGST_R3]
521 const u32 userdomain_len = netntlm_bufs[salt_pos].user_len
522 + netntlm_bufs[salt_pos].domain_len;
524 const u32 chall_len = netntlm_bufs[salt_pos].srvchall_len
525 + netntlm_bufs[salt_pos].clichall_len;
533 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos++)
535 const u32 w0r = bfs_buf[il_pos].i;
546 md4_transform (w0, w1, w2, w3, digest);
578 hmac_md5_pad (w0_t, w1_t, w2_t, w3_t, ipad, opad);
583 for (left = userdomain_len, off = 0; left >= 56; left -= 64, off += 16)
585 w0_t[0] = s_userdomain_buf[off + 0];
586 w0_t[1] = s_userdomain_buf[off + 1];
587 w0_t[2] = s_userdomain_buf[off + 2];
588 w0_t[3] = s_userdomain_buf[off + 3];
589 w1_t[0] = s_userdomain_buf[off + 4];
590 w1_t[1] = s_userdomain_buf[off + 5];
591 w1_t[2] = s_userdomain_buf[off + 6];
592 w1_t[3] = s_userdomain_buf[off + 7];
593 w2_t[0] = s_userdomain_buf[off + 8];
594 w2_t[1] = s_userdomain_buf[off + 9];
595 w2_t[2] = s_userdomain_buf[off + 10];
596 w2_t[3] = s_userdomain_buf[off + 11];
597 w3_t[0] = s_userdomain_buf[off + 12];
598 w3_t[1] = s_userdomain_buf[off + 13];
599 w3_t[2] = s_userdomain_buf[off + 14];
600 w3_t[3] = s_userdomain_buf[off + 15];
602 md5_transform (w0_t, w1_t, w2_t, w3_t, ipad);
605 w0_t[0] = s_userdomain_buf[off + 0];
606 w0_t[1] = s_userdomain_buf[off + 1];
607 w0_t[2] = s_userdomain_buf[off + 2];
608 w0_t[3] = s_userdomain_buf[off + 3];
609 w1_t[0] = s_userdomain_buf[off + 4];
610 w1_t[1] = s_userdomain_buf[off + 5];
611 w1_t[2] = s_userdomain_buf[off + 6];
612 w1_t[3] = s_userdomain_buf[off + 7];
613 w2_t[0] = s_userdomain_buf[off + 8];
614 w2_t[1] = s_userdomain_buf[off + 9];
615 w2_t[2] = s_userdomain_buf[off + 10];
616 w2_t[3] = s_userdomain_buf[off + 11];
617 w3_t[0] = s_userdomain_buf[off + 12];
618 w3_t[1] = s_userdomain_buf[off + 13];
619 w3_t[2] = (64 + userdomain_len) * 8;
622 hmac_md5_run (w0_t, w1_t, w2_t, w3_t, ipad, opad, digest);
646 hmac_md5_pad (w0_t, w1_t, w2_t, w3_t, ipad, opad);
648 for (left = chall_len, off = 0; left >= 56; left -= 64, off += 16)
650 w0_t[0] = s_chall_buf[off + 0];
651 w0_t[1] = s_chall_buf[off + 1];
652 w0_t[2] = s_chall_buf[off + 2];
653 w0_t[3] = s_chall_buf[off + 3];
654 w1_t[0] = s_chall_buf[off + 4];
655 w1_t[1] = s_chall_buf[off + 5];
656 w1_t[2] = s_chall_buf[off + 6];
657 w1_t[3] = s_chall_buf[off + 7];
658 w2_t[0] = s_chall_buf[off + 8];
659 w2_t[1] = s_chall_buf[off + 9];
660 w2_t[2] = s_chall_buf[off + 10];
661 w2_t[3] = s_chall_buf[off + 11];
662 w3_t[0] = s_chall_buf[off + 12];
663 w3_t[1] = s_chall_buf[off + 13];
664 w3_t[2] = s_chall_buf[off + 14];
665 w3_t[3] = s_chall_buf[off + 15];
667 md5_transform (w0_t, w1_t, w2_t, w3_t, ipad);
670 w0_t[0] = s_chall_buf[off + 0];
671 w0_t[1] = s_chall_buf[off + 1];
672 w0_t[2] = s_chall_buf[off + 2];
673 w0_t[3] = s_chall_buf[off + 3];
674 w1_t[0] = s_chall_buf[off + 4];
675 w1_t[1] = s_chall_buf[off + 5];
676 w1_t[2] = s_chall_buf[off + 6];
677 w1_t[3] = s_chall_buf[off + 7];
678 w2_t[0] = s_chall_buf[off + 8];
679 w2_t[1] = s_chall_buf[off + 9];
680 w2_t[2] = s_chall_buf[off + 10];
681 w2_t[3] = s_chall_buf[off + 11];
682 w3_t[0] = s_chall_buf[off + 12];
683 w3_t[1] = s_chall_buf[off + 13];
684 w3_t[2] = (64 + chall_len) * 8;
687 hmac_md5_run (w0_t, w1_t, w2_t, w3_t, ipad, opad, digest);
689 const u32x r0 = digest[0];
690 const u32x r1 = digest[3];
691 const u32x r2 = digest[2];
692 const u32x r3 = digest[1];
694 #include VECT_COMPARE_S
698 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m05600_m04 (__global pw_t *pws, __global gpu_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 netntlm_t *netntlm_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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
704 const u32 lid = get_local_id (0);
710 const u32 gid = get_global_id (0);
714 w0[0] = pws[gid].i[ 0];
715 w0[1] = pws[gid].i[ 1];
716 w0[2] = pws[gid].i[ 2];
717 w0[3] = pws[gid].i[ 3];
737 w3[2] = pws[gid].i[14];
740 const u32 pw_len = pws[gid].pw_len;
743 * s_userdomain, s_chall
746 __local u32 s_userdomain_buf[64];
747 __local u32 s_chall_buf[256];
751 s_userdomain_buf[lid] = netntlm_bufs[salt_pos].userdomain_buf[lid];
754 const u32 lid4 = lid * 4;
756 s_chall_buf[lid4 + 0] = netntlm_bufs[salt_pos].chall_buf[lid4 + 0];
757 s_chall_buf[lid4 + 1] = netntlm_bufs[salt_pos].chall_buf[lid4 + 1];
758 s_chall_buf[lid4 + 2] = netntlm_bufs[salt_pos].chall_buf[lid4 + 2];
759 s_chall_buf[lid4 + 3] = netntlm_bufs[salt_pos].chall_buf[lid4 + 3];
761 barrier (CLK_LOCAL_MEM_FENCE);
763 if (gid >= gid_max) return;
769 m05600m (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, netntlm_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, bfs_cnt, digests_cnt, digests_offset, s_userdomain_buf, s_chall_buf);
772 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m05600_m08 (__global pw_t *pws, __global gpu_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 netntlm_t *netntlm_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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
778 const u32 lid = get_local_id (0);
784 const u32 gid = get_global_id (0);
788 w0[0] = pws[gid].i[ 0];
789 w0[1] = pws[gid].i[ 1];
790 w0[2] = pws[gid].i[ 2];
791 w0[3] = pws[gid].i[ 3];
795 w1[0] = pws[gid].i[ 4];
796 w1[1] = pws[gid].i[ 5];
797 w1[2] = pws[gid].i[ 6];
798 w1[3] = pws[gid].i[ 7];
811 w3[2] = pws[gid].i[14];
814 const u32 pw_len = pws[gid].pw_len;
817 * s_userdomain, s_chall
820 __local u32 s_userdomain_buf[64];
821 __local u32 s_chall_buf[256];
825 s_userdomain_buf[lid] = netntlm_bufs[salt_pos].userdomain_buf[lid];
828 const u32 lid4 = lid * 4;
830 s_chall_buf[lid4 + 0] = netntlm_bufs[salt_pos].chall_buf[lid4 + 0];
831 s_chall_buf[lid4 + 1] = netntlm_bufs[salt_pos].chall_buf[lid4 + 1];
832 s_chall_buf[lid4 + 2] = netntlm_bufs[salt_pos].chall_buf[lid4 + 2];
833 s_chall_buf[lid4 + 3] = netntlm_bufs[salt_pos].chall_buf[lid4 + 3];
835 barrier (CLK_LOCAL_MEM_FENCE);
837 if (gid >= gid_max) return;
843 m05600m (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, netntlm_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, bfs_cnt, digests_cnt, digests_offset, s_userdomain_buf, s_chall_buf);
846 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m05600_m16 (__global pw_t *pws, __global gpu_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 netntlm_t *netntlm_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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
850 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m05600_s04 (__global pw_t *pws, __global gpu_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 netntlm_t *netntlm_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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
856 const u32 lid = get_local_id (0);
862 const u32 gid = get_global_id (0);
866 w0[0] = pws[gid].i[ 0];
867 w0[1] = pws[gid].i[ 1];
868 w0[2] = pws[gid].i[ 2];
869 w0[3] = pws[gid].i[ 3];
889 w3[2] = pws[gid].i[14];
892 const u32 pw_len = pws[gid].pw_len;
898 __local u32 s_userdomain_buf[64];
899 __local u32 s_chall_buf[256];
903 s_userdomain_buf[lid] = netntlm_bufs[salt_pos].userdomain_buf[lid];
906 const u32 lid4 = lid * 4;
908 s_chall_buf[lid4 + 0] = netntlm_bufs[salt_pos].chall_buf[lid4 + 0];
909 s_chall_buf[lid4 + 1] = netntlm_bufs[salt_pos].chall_buf[lid4 + 1];
910 s_chall_buf[lid4 + 2] = netntlm_bufs[salt_pos].chall_buf[lid4 + 2];
911 s_chall_buf[lid4 + 3] = netntlm_bufs[salt_pos].chall_buf[lid4 + 3];
913 barrier (CLK_LOCAL_MEM_FENCE);
915 if (gid >= gid_max) return;
921 m05600s (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, netntlm_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, bfs_cnt, digests_cnt, digests_offset, s_userdomain_buf, s_chall_buf);
924 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m05600_s08 (__global pw_t *pws, __global gpu_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 netntlm_t *netntlm_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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
930 const u32 lid = get_local_id (0);
936 const u32 gid = get_global_id (0);
940 w0[0] = pws[gid].i[ 0];
941 w0[1] = pws[gid].i[ 1];
942 w0[2] = pws[gid].i[ 2];
943 w0[3] = pws[gid].i[ 3];
947 w1[0] = pws[gid].i[ 4];
948 w1[1] = pws[gid].i[ 5];
949 w1[2] = pws[gid].i[ 6];
950 w1[3] = pws[gid].i[ 7];
963 w3[2] = pws[gid].i[14];
966 const u32 pw_len = pws[gid].pw_len;
972 __local u32 s_userdomain_buf[64];
973 __local u32 s_chall_buf[256];
977 s_userdomain_buf[lid] = netntlm_bufs[salt_pos].userdomain_buf[lid];
980 const u32 lid4 = lid * 4;
982 s_chall_buf[lid4 + 0] = netntlm_bufs[salt_pos].chall_buf[lid4 + 0];
983 s_chall_buf[lid4 + 1] = netntlm_bufs[salt_pos].chall_buf[lid4 + 1];
984 s_chall_buf[lid4 + 2] = netntlm_bufs[salt_pos].chall_buf[lid4 + 2];
985 s_chall_buf[lid4 + 3] = netntlm_bufs[salt_pos].chall_buf[lid4 + 3];
987 barrier (CLK_LOCAL_MEM_FENCE);
989 if (gid >= gid_max) return;
995 m05600s (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, netntlm_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, bfs_cnt, digests_cnt, digests_offset, s_userdomain_buf, s_chall_buf);
998 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m05600_s16 (__global pw_t *pws, __global gpu_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 netntlm_t *netntlm_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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)