2 * Author......: Jens Steube <jens.steube@gmail.com>
8 #include "include/constants.h"
9 #include "include/kernel_vendor.h"
16 #include "include/kernel_functions.c"
17 #include "OpenCL/types_ocl.c"
18 #include "OpenCL/common.c"
20 #define COMPARE_S "OpenCL/check_single_comp4.c"
21 #define COMPARE_M "OpenCL/check_multi_comp4.c"
23 static void md4_transform (const u32 w0[4], const u32 w1[4], const u32 w2[4], const u32 w3[4], u32 digest[4])
47 MD4_STEP (MD4_Fo, a, b, c, d, w0_t, MD4C00, MD4S00);
48 MD4_STEP (MD4_Fo, d, a, b, c, w1_t, MD4C00, MD4S01);
49 MD4_STEP (MD4_Fo, c, d, a, b, w2_t, MD4C00, MD4S02);
50 MD4_STEP (MD4_Fo, b, c, d, a, w3_t, MD4C00, MD4S03);
51 MD4_STEP (MD4_Fo, a, b, c, d, w4_t, MD4C00, MD4S00);
52 MD4_STEP (MD4_Fo, d, a, b, c, w5_t, MD4C00, MD4S01);
53 MD4_STEP (MD4_Fo, c, d, a, b, w6_t, MD4C00, MD4S02);
54 MD4_STEP (MD4_Fo, b, c, d, a, w7_t, MD4C00, MD4S03);
55 MD4_STEP (MD4_Fo, a, b, c, d, w8_t, MD4C00, MD4S00);
56 MD4_STEP (MD4_Fo, d, a, b, c, w9_t, MD4C00, MD4S01);
57 MD4_STEP (MD4_Fo, c, d, a, b, wa_t, MD4C00, MD4S02);
58 MD4_STEP (MD4_Fo, b, c, d, a, wb_t, MD4C00, MD4S03);
59 MD4_STEP (MD4_Fo, a, b, c, d, wc_t, MD4C00, MD4S00);
60 MD4_STEP (MD4_Fo, d, a, b, c, wd_t, MD4C00, MD4S01);
61 MD4_STEP (MD4_Fo, c, d, a, b, we_t, MD4C00, MD4S02);
62 MD4_STEP (MD4_Fo, b, c, d, a, wf_t, MD4C00, MD4S03);
64 MD4_STEP (MD4_Go, a, b, c, d, w0_t, MD4C01, MD4S10);
65 MD4_STEP (MD4_Go, d, a, b, c, w4_t, MD4C01, MD4S11);
66 MD4_STEP (MD4_Go, c, d, a, b, w8_t, MD4C01, MD4S12);
67 MD4_STEP (MD4_Go, b, c, d, a, wc_t, MD4C01, MD4S13);
68 MD4_STEP (MD4_Go, a, b, c, d, w1_t, MD4C01, MD4S10);
69 MD4_STEP (MD4_Go, d, a, b, c, w5_t, MD4C01, MD4S11);
70 MD4_STEP (MD4_Go, c, d, a, b, w9_t, MD4C01, MD4S12);
71 MD4_STEP (MD4_Go, b, c, d, a, wd_t, MD4C01, MD4S13);
72 MD4_STEP (MD4_Go, a, b, c, d, w2_t, MD4C01, MD4S10);
73 MD4_STEP (MD4_Go, d, a, b, c, w6_t, MD4C01, MD4S11);
74 MD4_STEP (MD4_Go, c, d, a, b, wa_t, MD4C01, MD4S12);
75 MD4_STEP (MD4_Go, b, c, d, a, we_t, MD4C01, MD4S13);
76 MD4_STEP (MD4_Go, a, b, c, d, w3_t, MD4C01, MD4S10);
77 MD4_STEP (MD4_Go, d, a, b, c, w7_t, MD4C01, MD4S11);
78 MD4_STEP (MD4_Go, c, d, a, b, wb_t, MD4C01, MD4S12);
79 MD4_STEP (MD4_Go, b, c, d, a, wf_t, MD4C01, MD4S13);
81 MD4_STEP (MD4_H , a, b, c, d, w0_t, MD4C02, MD4S20);
82 MD4_STEP (MD4_H , d, a, b, c, w8_t, MD4C02, MD4S21);
83 MD4_STEP (MD4_H , c, d, a, b, w4_t, MD4C02, MD4S22);
84 MD4_STEP (MD4_H , b, c, d, a, wc_t, MD4C02, MD4S23);
85 MD4_STEP (MD4_H , a, b, c, d, w2_t, MD4C02, MD4S20);
86 MD4_STEP (MD4_H , d, a, b, c, wa_t, MD4C02, MD4S21);
87 MD4_STEP (MD4_H , c, d, a, b, w6_t, MD4C02, MD4S22);
88 MD4_STEP (MD4_H , b, c, d, a, we_t, MD4C02, MD4S23);
89 MD4_STEP (MD4_H , a, b, c, d, w1_t, MD4C02, MD4S20);
90 MD4_STEP (MD4_H , d, a, b, c, w9_t, MD4C02, MD4S21);
91 MD4_STEP (MD4_H , c, d, a, b, w5_t, MD4C02, MD4S22);
92 MD4_STEP (MD4_H , b, c, d, a, wd_t, MD4C02, MD4S23);
93 MD4_STEP (MD4_H , a, b, c, d, w3_t, MD4C02, MD4S20);
94 MD4_STEP (MD4_H , d, a, b, c, wb_t, MD4C02, MD4S21);
95 MD4_STEP (MD4_H , c, d, a, b, w7_t, MD4C02, MD4S22);
96 MD4_STEP (MD4_H , b, c, d, a, wf_t, MD4C02, MD4S23);
104 static void md5_transform (const u32 w0[4], const u32 w1[4], const u32 w2[4], const u32 w3[4], u32 digest[4])
128 MD5_STEP (MD5_Fo, a, b, c, d, w0_t, MD5C00, MD5S00);
129 MD5_STEP (MD5_Fo, d, a, b, c, w1_t, MD5C01, MD5S01);
130 MD5_STEP (MD5_Fo, c, d, a, b, w2_t, MD5C02, MD5S02);
131 MD5_STEP (MD5_Fo, b, c, d, a, w3_t, MD5C03, MD5S03);
132 MD5_STEP (MD5_Fo, a, b, c, d, w4_t, MD5C04, MD5S00);
133 MD5_STEP (MD5_Fo, d, a, b, c, w5_t, MD5C05, MD5S01);
134 MD5_STEP (MD5_Fo, c, d, a, b, w6_t, MD5C06, MD5S02);
135 MD5_STEP (MD5_Fo, b, c, d, a, w7_t, MD5C07, MD5S03);
136 MD5_STEP (MD5_Fo, a, b, c, d, w8_t, MD5C08, MD5S00);
137 MD5_STEP (MD5_Fo, d, a, b, c, w9_t, MD5C09, MD5S01);
138 MD5_STEP (MD5_Fo, c, d, a, b, wa_t, MD5C0a, MD5S02);
139 MD5_STEP (MD5_Fo, b, c, d, a, wb_t, MD5C0b, MD5S03);
140 MD5_STEP (MD5_Fo, a, b, c, d, wc_t, MD5C0c, MD5S00);
141 MD5_STEP (MD5_Fo, d, a, b, c, wd_t, MD5C0d, MD5S01);
142 MD5_STEP (MD5_Fo, c, d, a, b, we_t, MD5C0e, MD5S02);
143 MD5_STEP (MD5_Fo, b, c, d, a, wf_t, MD5C0f, MD5S03);
145 MD5_STEP (MD5_Go, a, b, c, d, w1_t, MD5C10, MD5S10);
146 MD5_STEP (MD5_Go, d, a, b, c, w6_t, MD5C11, MD5S11);
147 MD5_STEP (MD5_Go, c, d, a, b, wb_t, MD5C12, MD5S12);
148 MD5_STEP (MD5_Go, b, c, d, a, w0_t, MD5C13, MD5S13);
149 MD5_STEP (MD5_Go, a, b, c, d, w5_t, MD5C14, MD5S10);
150 MD5_STEP (MD5_Go, d, a, b, c, wa_t, MD5C15, MD5S11);
151 MD5_STEP (MD5_Go, c, d, a, b, wf_t, MD5C16, MD5S12);
152 MD5_STEP (MD5_Go, b, c, d, a, w4_t, MD5C17, MD5S13);
153 MD5_STEP (MD5_Go, a, b, c, d, w9_t, MD5C18, MD5S10);
154 MD5_STEP (MD5_Go, d, a, b, c, we_t, MD5C19, MD5S11);
155 MD5_STEP (MD5_Go, c, d, a, b, w3_t, MD5C1a, MD5S12);
156 MD5_STEP (MD5_Go, b, c, d, a, w8_t, MD5C1b, MD5S13);
157 MD5_STEP (MD5_Go, a, b, c, d, wd_t, MD5C1c, MD5S10);
158 MD5_STEP (MD5_Go, d, a, b, c, w2_t, MD5C1d, MD5S11);
159 MD5_STEP (MD5_Go, c, d, a, b, w7_t, MD5C1e, MD5S12);
160 MD5_STEP (MD5_Go, b, c, d, a, wc_t, MD5C1f, MD5S13);
162 MD5_STEP (MD5_H , a, b, c, d, w5_t, MD5C20, MD5S20);
163 MD5_STEP (MD5_H , d, a, b, c, w8_t, MD5C21, MD5S21);
164 MD5_STEP (MD5_H , c, d, a, b, wb_t, MD5C22, MD5S22);
165 MD5_STEP (MD5_H , b, c, d, a, we_t, MD5C23, MD5S23);
166 MD5_STEP (MD5_H , a, b, c, d, w1_t, MD5C24, MD5S20);
167 MD5_STEP (MD5_H , d, a, b, c, w4_t, MD5C25, MD5S21);
168 MD5_STEP (MD5_H , c, d, a, b, w7_t, MD5C26, MD5S22);
169 MD5_STEP (MD5_H , b, c, d, a, wa_t, MD5C27, MD5S23);
170 MD5_STEP (MD5_H , a, b, c, d, wd_t, MD5C28, MD5S20);
171 MD5_STEP (MD5_H , d, a, b, c, w0_t, MD5C29, MD5S21);
172 MD5_STEP (MD5_H , c, d, a, b, w3_t, MD5C2a, MD5S22);
173 MD5_STEP (MD5_H , b, c, d, a, w6_t, MD5C2b, MD5S23);
174 MD5_STEP (MD5_H , a, b, c, d, w9_t, MD5C2c, MD5S20);
175 MD5_STEP (MD5_H , d, a, b, c, wc_t, MD5C2d, MD5S21);
176 MD5_STEP (MD5_H , c, d, a, b, wf_t, MD5C2e, MD5S22);
177 MD5_STEP (MD5_H , b, c, d, a, w2_t, MD5C2f, MD5S23);
179 MD5_STEP (MD5_I , a, b, c, d, w0_t, MD5C30, MD5S30);
180 MD5_STEP (MD5_I , d, a, b, c, w7_t, MD5C31, MD5S31);
181 MD5_STEP (MD5_I , c, d, a, b, we_t, MD5C32, MD5S32);
182 MD5_STEP (MD5_I , b, c, d, a, w5_t, MD5C33, MD5S33);
183 MD5_STEP (MD5_I , a, b, c, d, wc_t, MD5C34, MD5S30);
184 MD5_STEP (MD5_I , d, a, b, c, w3_t, MD5C35, MD5S31);
185 MD5_STEP (MD5_I , c, d, a, b, wa_t, MD5C36, MD5S32);
186 MD5_STEP (MD5_I , b, c, d, a, w1_t, MD5C37, MD5S33);
187 MD5_STEP (MD5_I , a, b, c, d, w8_t, MD5C38, MD5S30);
188 MD5_STEP (MD5_I , d, a, b, c, wf_t, MD5C39, MD5S31);
189 MD5_STEP (MD5_I , c, d, a, b, w6_t, MD5C3a, MD5S32);
190 MD5_STEP (MD5_I , b, c, d, a, wd_t, MD5C3b, MD5S33);
191 MD5_STEP (MD5_I , a, b, c, d, w4_t, MD5C3c, MD5S30);
192 MD5_STEP (MD5_I , d, a, b, c, wb_t, MD5C3d, MD5S31);
193 MD5_STEP (MD5_I , c, d, a, b, w2_t, MD5C3e, MD5S32);
194 MD5_STEP (MD5_I , b, c, d, a, w9_t, MD5C3f, MD5S33);
202 static void hmac_md5_pad (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], u32 ipad[4], u32 opad[4])
204 w0[0] = w0[0] ^ 0x36363636;
205 w0[1] = w0[1] ^ 0x36363636;
206 w0[2] = w0[2] ^ 0x36363636;
207 w0[3] = w0[3] ^ 0x36363636;
208 w1[0] = w1[0] ^ 0x36363636;
209 w1[1] = w1[1] ^ 0x36363636;
210 w1[2] = w1[2] ^ 0x36363636;
211 w1[3] = w1[3] ^ 0x36363636;
212 w2[0] = w2[0] ^ 0x36363636;
213 w2[1] = w2[1] ^ 0x36363636;
214 w2[2] = w2[2] ^ 0x36363636;
215 w2[3] = w2[3] ^ 0x36363636;
216 w3[0] = w3[0] ^ 0x36363636;
217 w3[1] = w3[1] ^ 0x36363636;
218 w3[2] = w3[2] ^ 0x36363636;
219 w3[3] = w3[3] ^ 0x36363636;
226 md5_transform (w0, w1, w2, w3, ipad);
228 w0[0] = w0[0] ^ 0x6a6a6a6a;
229 w0[1] = w0[1] ^ 0x6a6a6a6a;
230 w0[2] = w0[2] ^ 0x6a6a6a6a;
231 w0[3] = w0[3] ^ 0x6a6a6a6a;
232 w1[0] = w1[0] ^ 0x6a6a6a6a;
233 w1[1] = w1[1] ^ 0x6a6a6a6a;
234 w1[2] = w1[2] ^ 0x6a6a6a6a;
235 w1[3] = w1[3] ^ 0x6a6a6a6a;
236 w2[0] = w2[0] ^ 0x6a6a6a6a;
237 w2[1] = w2[1] ^ 0x6a6a6a6a;
238 w2[2] = w2[2] ^ 0x6a6a6a6a;
239 w2[3] = w2[3] ^ 0x6a6a6a6a;
240 w3[0] = w3[0] ^ 0x6a6a6a6a;
241 w3[1] = w3[1] ^ 0x6a6a6a6a;
242 w3[2] = w3[2] ^ 0x6a6a6a6a;
243 w3[3] = w3[3] ^ 0x6a6a6a6a;
250 md5_transform (w0, w1, w2, w3, opad);
253 static void hmac_md5_run (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], u32 ipad[4], u32 opad[4], u32 digest[4])
260 md5_transform (w0, w1, w2, w3, digest);
276 w3[2] = (64 + 16) * 8;
284 md5_transform (w0, w1, w2, w3, digest);
287 static void m05600m (u32 w0[4], u32 w1[4], u32 w2[4], u32 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])
293 const u32 gid = get_global_id (0);
294 const u32 lid = get_local_id (0);
300 const u32 userdomain_len = netntlm_bufs[salt_pos].user_len
301 + netntlm_bufs[salt_pos].domain_len;
303 const u32 chall_len = netntlm_bufs[salt_pos].srvchall_len
304 + netntlm_bufs[salt_pos].clichall_len;
312 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos++)
314 const u32 w0r = bfs_buf[il_pos].i;
325 md4_transform (w0, w1, w2, w3, digest);
357 hmac_md5_pad (w0_t, w1_t, w2_t, w3_t, ipad, opad);
362 for (left = userdomain_len, off = 0; left >= 56; left -= 64, off += 16)
364 w0_t[0] = s_userdomain_buf[off + 0];
365 w0_t[1] = s_userdomain_buf[off + 1];
366 w0_t[2] = s_userdomain_buf[off + 2];
367 w0_t[3] = s_userdomain_buf[off + 3];
368 w1_t[0] = s_userdomain_buf[off + 4];
369 w1_t[1] = s_userdomain_buf[off + 5];
370 w1_t[2] = s_userdomain_buf[off + 6];
371 w1_t[3] = s_userdomain_buf[off + 7];
372 w2_t[0] = s_userdomain_buf[off + 8];
373 w2_t[1] = s_userdomain_buf[off + 9];
374 w2_t[2] = s_userdomain_buf[off + 10];
375 w2_t[3] = s_userdomain_buf[off + 11];
376 w3_t[0] = s_userdomain_buf[off + 12];
377 w3_t[1] = s_userdomain_buf[off + 13];
378 w3_t[2] = s_userdomain_buf[off + 14];
379 w3_t[3] = s_userdomain_buf[off + 15];
381 md5_transform (w0_t, w1_t, w2_t, w3_t, ipad);
384 w0_t[0] = s_userdomain_buf[off + 0];
385 w0_t[1] = s_userdomain_buf[off + 1];
386 w0_t[2] = s_userdomain_buf[off + 2];
387 w0_t[3] = s_userdomain_buf[off + 3];
388 w1_t[0] = s_userdomain_buf[off + 4];
389 w1_t[1] = s_userdomain_buf[off + 5];
390 w1_t[2] = s_userdomain_buf[off + 6];
391 w1_t[3] = s_userdomain_buf[off + 7];
392 w2_t[0] = s_userdomain_buf[off + 8];
393 w2_t[1] = s_userdomain_buf[off + 9];
394 w2_t[2] = s_userdomain_buf[off + 10];
395 w2_t[3] = s_userdomain_buf[off + 11];
396 w3_t[0] = s_userdomain_buf[off + 12];
397 w3_t[1] = s_userdomain_buf[off + 13];
398 w3_t[2] = (64 + userdomain_len) * 8;
401 hmac_md5_run (w0_t, w1_t, w2_t, w3_t, ipad, opad, digest);
425 hmac_md5_pad (w0_t, w1_t, w2_t, w3_t, ipad, opad);
427 for (left = chall_len, off = 0; left >= 56; left -= 64, off += 16)
429 w0_t[0] = s_chall_buf[off + 0];
430 w0_t[1] = s_chall_buf[off + 1];
431 w0_t[2] = s_chall_buf[off + 2];
432 w0_t[3] = s_chall_buf[off + 3];
433 w1_t[0] = s_chall_buf[off + 4];
434 w1_t[1] = s_chall_buf[off + 5];
435 w1_t[2] = s_chall_buf[off + 6];
436 w1_t[3] = s_chall_buf[off + 7];
437 w2_t[0] = s_chall_buf[off + 8];
438 w2_t[1] = s_chall_buf[off + 9];
439 w2_t[2] = s_chall_buf[off + 10];
440 w2_t[3] = s_chall_buf[off + 11];
441 w3_t[0] = s_chall_buf[off + 12];
442 w3_t[1] = s_chall_buf[off + 13];
443 w3_t[2] = s_chall_buf[off + 14];
444 w3_t[3] = s_chall_buf[off + 15];
446 md5_transform (w0_t, w1_t, w2_t, w3_t, ipad);
449 w0_t[0] = s_chall_buf[off + 0];
450 w0_t[1] = s_chall_buf[off + 1];
451 w0_t[2] = s_chall_buf[off + 2];
452 w0_t[3] = s_chall_buf[off + 3];
453 w1_t[0] = s_chall_buf[off + 4];
454 w1_t[1] = s_chall_buf[off + 5];
455 w1_t[2] = s_chall_buf[off + 6];
456 w1_t[3] = s_chall_buf[off + 7];
457 w2_t[0] = s_chall_buf[off + 8];
458 w2_t[1] = s_chall_buf[off + 9];
459 w2_t[2] = s_chall_buf[off + 10];
460 w2_t[3] = s_chall_buf[off + 11];
461 w3_t[0] = s_chall_buf[off + 12];
462 w3_t[1] = s_chall_buf[off + 13];
463 w3_t[2] = (64 + chall_len) * 8;
466 hmac_md5_run (w0_t, w1_t, w2_t, w3_t, ipad, opad, digest);
468 const u32 r0 = digest[0];
469 const u32 r1 = digest[3];
470 const u32 r2 = digest[2];
471 const u32 r3 = digest[1];
477 static void m05600s (u32 w0[4], u32 w1[4], u32 w2[4], u32 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])
483 const u32 gid = get_global_id (0);
484 const u32 lid = get_local_id (0);
490 const u32 search[4] =
492 digests_buf[digests_offset].digest_buf[DGST_R0],
493 digests_buf[digests_offset].digest_buf[DGST_R1],
494 digests_buf[digests_offset].digest_buf[DGST_R2],
495 digests_buf[digests_offset].digest_buf[DGST_R3]
502 const u32 userdomain_len = netntlm_bufs[salt_pos].user_len
503 + netntlm_bufs[salt_pos].domain_len;
505 const u32 chall_len = netntlm_bufs[salt_pos].srvchall_len
506 + netntlm_bufs[salt_pos].clichall_len;
514 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos++)
516 const u32 w0r = bfs_buf[il_pos].i;
527 md4_transform (w0, w1, w2, w3, digest);
559 hmac_md5_pad (w0_t, w1_t, w2_t, w3_t, ipad, opad);
564 for (left = userdomain_len, off = 0; left >= 56; left -= 64, off += 16)
566 w0_t[0] = s_userdomain_buf[off + 0];
567 w0_t[1] = s_userdomain_buf[off + 1];
568 w0_t[2] = s_userdomain_buf[off + 2];
569 w0_t[3] = s_userdomain_buf[off + 3];
570 w1_t[0] = s_userdomain_buf[off + 4];
571 w1_t[1] = s_userdomain_buf[off + 5];
572 w1_t[2] = s_userdomain_buf[off + 6];
573 w1_t[3] = s_userdomain_buf[off + 7];
574 w2_t[0] = s_userdomain_buf[off + 8];
575 w2_t[1] = s_userdomain_buf[off + 9];
576 w2_t[2] = s_userdomain_buf[off + 10];
577 w2_t[3] = s_userdomain_buf[off + 11];
578 w3_t[0] = s_userdomain_buf[off + 12];
579 w3_t[1] = s_userdomain_buf[off + 13];
580 w3_t[2] = s_userdomain_buf[off + 14];
581 w3_t[3] = s_userdomain_buf[off + 15];
583 md5_transform (w0_t, w1_t, w2_t, w3_t, ipad);
586 w0_t[0] = s_userdomain_buf[off + 0];
587 w0_t[1] = s_userdomain_buf[off + 1];
588 w0_t[2] = s_userdomain_buf[off + 2];
589 w0_t[3] = s_userdomain_buf[off + 3];
590 w1_t[0] = s_userdomain_buf[off + 4];
591 w1_t[1] = s_userdomain_buf[off + 5];
592 w1_t[2] = s_userdomain_buf[off + 6];
593 w1_t[3] = s_userdomain_buf[off + 7];
594 w2_t[0] = s_userdomain_buf[off + 8];
595 w2_t[1] = s_userdomain_buf[off + 9];
596 w2_t[2] = s_userdomain_buf[off + 10];
597 w2_t[3] = s_userdomain_buf[off + 11];
598 w3_t[0] = s_userdomain_buf[off + 12];
599 w3_t[1] = s_userdomain_buf[off + 13];
600 w3_t[2] = (64 + userdomain_len) * 8;
603 hmac_md5_run (w0_t, w1_t, w2_t, w3_t, ipad, opad, digest);
627 hmac_md5_pad (w0_t, w1_t, w2_t, w3_t, ipad, opad);
629 for (left = chall_len, off = 0; left >= 56; left -= 64, off += 16)
631 w0_t[0] = s_chall_buf[off + 0];
632 w0_t[1] = s_chall_buf[off + 1];
633 w0_t[2] = s_chall_buf[off + 2];
634 w0_t[3] = s_chall_buf[off + 3];
635 w1_t[0] = s_chall_buf[off + 4];
636 w1_t[1] = s_chall_buf[off + 5];
637 w1_t[2] = s_chall_buf[off + 6];
638 w1_t[3] = s_chall_buf[off + 7];
639 w2_t[0] = s_chall_buf[off + 8];
640 w2_t[1] = s_chall_buf[off + 9];
641 w2_t[2] = s_chall_buf[off + 10];
642 w2_t[3] = s_chall_buf[off + 11];
643 w3_t[0] = s_chall_buf[off + 12];
644 w3_t[1] = s_chall_buf[off + 13];
645 w3_t[2] = s_chall_buf[off + 14];
646 w3_t[3] = s_chall_buf[off + 15];
648 md5_transform (w0_t, w1_t, w2_t, w3_t, ipad);
651 w0_t[0] = s_chall_buf[off + 0];
652 w0_t[1] = s_chall_buf[off + 1];
653 w0_t[2] = s_chall_buf[off + 2];
654 w0_t[3] = s_chall_buf[off + 3];
655 w1_t[0] = s_chall_buf[off + 4];
656 w1_t[1] = s_chall_buf[off + 5];
657 w1_t[2] = s_chall_buf[off + 6];
658 w1_t[3] = s_chall_buf[off + 7];
659 w2_t[0] = s_chall_buf[off + 8];
660 w2_t[1] = s_chall_buf[off + 9];
661 w2_t[2] = s_chall_buf[off + 10];
662 w2_t[3] = s_chall_buf[off + 11];
663 w3_t[0] = s_chall_buf[off + 12];
664 w3_t[1] = s_chall_buf[off + 13];
665 w3_t[2] = (64 + chall_len) * 8;
668 hmac_md5_run (w0_t, w1_t, w2_t, w3_t, ipad, opad, digest);
670 const u32 r0 = digest[0];
671 const u32 r1 = digest[3];
672 const u32 r2 = digest[2];
673 const u32 r3 = digest[1];
679 __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)
685 const u32 lid = get_local_id (0);
691 const u32 gid = get_global_id (0);
695 w0[0] = pws[gid].i[ 0];
696 w0[1] = pws[gid].i[ 1];
697 w0[2] = pws[gid].i[ 2];
698 w0[3] = pws[gid].i[ 3];
718 w3[2] = pws[gid].i[14];
721 const u32 pw_len = pws[gid].pw_len;
724 * s_userdomain, s_chall
727 __local u32 s_userdomain_buf[64];
728 __local u32 s_chall_buf[256];
732 s_userdomain_buf[lid] = netntlm_bufs[salt_pos].userdomain_buf[lid];
735 const u32 lid4 = lid * 4;
737 s_chall_buf[lid4 + 0] = netntlm_bufs[salt_pos].chall_buf[lid4 + 0];
738 s_chall_buf[lid4 + 1] = netntlm_bufs[salt_pos].chall_buf[lid4 + 1];
739 s_chall_buf[lid4 + 2] = netntlm_bufs[salt_pos].chall_buf[lid4 + 2];
740 s_chall_buf[lid4 + 3] = netntlm_bufs[salt_pos].chall_buf[lid4 + 3];
742 barrier (CLK_LOCAL_MEM_FENCE);
744 if (gid >= gid_max) return;
750 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);
753 __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)
759 const u32 lid = get_local_id (0);
765 const u32 gid = get_global_id (0);
769 w0[0] = pws[gid].i[ 0];
770 w0[1] = pws[gid].i[ 1];
771 w0[2] = pws[gid].i[ 2];
772 w0[3] = pws[gid].i[ 3];
776 w1[0] = pws[gid].i[ 4];
777 w1[1] = pws[gid].i[ 5];
778 w1[2] = pws[gid].i[ 6];
779 w1[3] = pws[gid].i[ 7];
792 w3[2] = pws[gid].i[14];
795 const u32 pw_len = pws[gid].pw_len;
798 * s_userdomain, s_chall
801 __local u32 s_userdomain_buf[64];
802 __local u32 s_chall_buf[256];
806 s_userdomain_buf[lid] = netntlm_bufs[salt_pos].userdomain_buf[lid];
809 const u32 lid4 = lid * 4;
811 s_chall_buf[lid4 + 0] = netntlm_bufs[salt_pos].chall_buf[lid4 + 0];
812 s_chall_buf[lid4 + 1] = netntlm_bufs[salt_pos].chall_buf[lid4 + 1];
813 s_chall_buf[lid4 + 2] = netntlm_bufs[salt_pos].chall_buf[lid4 + 2];
814 s_chall_buf[lid4 + 3] = netntlm_bufs[salt_pos].chall_buf[lid4 + 3];
816 barrier (CLK_LOCAL_MEM_FENCE);
818 if (gid >= gid_max) return;
824 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);
827 __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)
831 __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)
837 const u32 lid = get_local_id (0);
843 const u32 gid = get_global_id (0);
847 w0[0] = pws[gid].i[ 0];
848 w0[1] = pws[gid].i[ 1];
849 w0[2] = pws[gid].i[ 2];
850 w0[3] = pws[gid].i[ 3];
870 w3[2] = pws[gid].i[14];
873 const u32 pw_len = pws[gid].pw_len;
879 __local u32 s_userdomain_buf[64];
880 __local u32 s_chall_buf[256];
884 s_userdomain_buf[lid] = netntlm_bufs[salt_pos].userdomain_buf[lid];
887 const u32 lid4 = lid * 4;
889 s_chall_buf[lid4 + 0] = netntlm_bufs[salt_pos].chall_buf[lid4 + 0];
890 s_chall_buf[lid4 + 1] = netntlm_bufs[salt_pos].chall_buf[lid4 + 1];
891 s_chall_buf[lid4 + 2] = netntlm_bufs[salt_pos].chall_buf[lid4 + 2];
892 s_chall_buf[lid4 + 3] = netntlm_bufs[salt_pos].chall_buf[lid4 + 3];
894 barrier (CLK_LOCAL_MEM_FENCE);
896 if (gid >= gid_max) return;
902 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);
905 __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)
911 const u32 lid = get_local_id (0);
917 const u32 gid = get_global_id (0);
921 w0[0] = pws[gid].i[ 0];
922 w0[1] = pws[gid].i[ 1];
923 w0[2] = pws[gid].i[ 2];
924 w0[3] = pws[gid].i[ 3];
928 w1[0] = pws[gid].i[ 4];
929 w1[1] = pws[gid].i[ 5];
930 w1[2] = pws[gid].i[ 6];
931 w1[3] = pws[gid].i[ 7];
944 w3[2] = pws[gid].i[14];
947 const u32 pw_len = pws[gid].pw_len;
953 __local u32 s_userdomain_buf[64];
954 __local u32 s_chall_buf[256];
958 s_userdomain_buf[lid] = netntlm_bufs[salt_pos].userdomain_buf[lid];
961 const u32 lid4 = lid * 4;
963 s_chall_buf[lid4 + 0] = netntlm_bufs[salt_pos].chall_buf[lid4 + 0];
964 s_chall_buf[lid4 + 1] = netntlm_bufs[salt_pos].chall_buf[lid4 + 1];
965 s_chall_buf[lid4 + 2] = netntlm_bufs[salt_pos].chall_buf[lid4 + 2];
966 s_chall_buf[lid4 + 3] = netntlm_bufs[salt_pos].chall_buf[lid4 + 3];
968 barrier (CLK_LOCAL_MEM_FENCE);
970 if (gid >= gid_max) return;
976 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);
979 __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)