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"
43 #define VECT_COMPARE_S "check_single_vect4_comp4.c"
44 #define VECT_COMPARE_M "check_multi_vect4_comp4.c"
47 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m01100_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 void *esalt_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 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
53 const u32 lid = get_local_id (0);
59 const u32 gid = get_global_id (0);
61 if (gid >= gid_max) return;
65 wordl0[0] = pws[gid].i[ 0];
66 wordl0[1] = pws[gid].i[ 1];
67 wordl0[2] = pws[gid].i[ 2];
68 wordl0[3] = pws[gid].i[ 3];
72 wordl1[0] = pws[gid].i[ 4];
73 wordl1[1] = pws[gid].i[ 5];
74 wordl1[2] = pws[gid].i[ 6];
75 wordl1[3] = pws[gid].i[ 7];
91 const u32 pw_l_len = pws[gid].pw_len;
93 if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
95 append_0x80_2 (wordl0, wordl1, pw_l_len);
97 switch_buffer_by_offset (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
106 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
107 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
108 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
109 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
113 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
114 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
115 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
116 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
120 salt_buf2[0] = salt_bufs[salt_pos].salt_buf[ 8];
121 salt_buf2[1] = salt_bufs[salt_pos].salt_buf[ 9];
125 const u32 salt_len = salt_bufs[salt_pos].salt_len;
131 for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
133 const u32 pw_r_len = combs_buf[il_pos].pw_len;
135 const u32 pw_len = pw_l_len + pw_r_len;
139 wordr0[0] = combs_buf[il_pos].i[0];
140 wordr0[1] = combs_buf[il_pos].i[1];
141 wordr0[2] = combs_buf[il_pos].i[2];
142 wordr0[3] = combs_buf[il_pos].i[3];
146 wordr1[0] = combs_buf[il_pos].i[4];
147 wordr1[1] = combs_buf[il_pos].i[5];
148 wordr1[2] = combs_buf[il_pos].i[6];
149 wordr1[3] = combs_buf[il_pos].i[7];
165 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
167 switch_buffer_by_offset (wordr0, wordr1, wordr2, wordr3, pw_l_len);
172 w0[0] = wordl0[0] | wordr0[0];
173 w0[1] = wordl0[1] | wordr0[1];
174 w0[2] = wordl0[2] | wordr0[2];
175 w0[3] = wordl0[3] | wordr0[3];
179 w1[0] = wordl1[0] | wordr1[0];
180 w1[1] = wordl1[1] | wordr1[1];
181 w1[2] = wordl1[2] | wordr1[2];
182 w1[3] = wordl1[3] | wordr1[3];
203 make_unicode (w0, w0_t, w1_t);
204 make_unicode (w1, w2_t, w3_t);
206 w3_t[2] = pw_len * 8 * 2;
213 MD4_STEP (MD4_Fo, a, b, c, d, w0_t[0], MD4C00, MD4S00);
214 MD4_STEP (MD4_Fo, d, a, b, c, w0_t[1], MD4C00, MD4S01);
215 MD4_STEP (MD4_Fo, c, d, a, b, w0_t[2], MD4C00, MD4S02);
216 MD4_STEP (MD4_Fo, b, c, d, a, w0_t[3], MD4C00, MD4S03);
217 MD4_STEP (MD4_Fo, a, b, c, d, w1_t[0], MD4C00, MD4S00);
218 MD4_STEP (MD4_Fo, d, a, b, c, w1_t[1], MD4C00, MD4S01);
219 MD4_STEP (MD4_Fo, c, d, a, b, w1_t[2], MD4C00, MD4S02);
220 MD4_STEP (MD4_Fo, b, c, d, a, w1_t[3], MD4C00, MD4S03);
221 MD4_STEP (MD4_Fo, a, b, c, d, w2_t[0], MD4C00, MD4S00);
222 MD4_STEP (MD4_Fo, d, a, b, c, w2_t[1], MD4C00, MD4S01);
223 MD4_STEP (MD4_Fo, c, d, a, b, w2_t[2], MD4C00, MD4S02);
224 MD4_STEP (MD4_Fo, b, c, d, a, w2_t[3], MD4C00, MD4S03);
225 MD4_STEP (MD4_Fo, a, b, c, d, w3_t[0], MD4C00, MD4S00);
226 MD4_STEP (MD4_Fo, d, a, b, c, w3_t[1], MD4C00, MD4S01);
227 MD4_STEP (MD4_Fo, c, d, a, b, w3_t[2], MD4C00, MD4S02);
228 MD4_STEP (MD4_Fo, b, c, d, a, w3_t[3], MD4C00, MD4S03);
230 MD4_STEP (MD4_Go, a, b, c, d, w0_t[0], MD4C01, MD4S10);
231 MD4_STEP (MD4_Go, d, a, b, c, w1_t[0], MD4C01, MD4S11);
232 MD4_STEP (MD4_Go, c, d, a, b, w2_t[0], MD4C01, MD4S12);
233 MD4_STEP (MD4_Go, b, c, d, a, w3_t[0], MD4C01, MD4S13);
234 MD4_STEP (MD4_Go, a, b, c, d, w0_t[1], MD4C01, MD4S10);
235 MD4_STEP (MD4_Go, d, a, b, c, w1_t[1], MD4C01, MD4S11);
236 MD4_STEP (MD4_Go, c, d, a, b, w2_t[1], MD4C01, MD4S12);
237 MD4_STEP (MD4_Go, b, c, d, a, w3_t[1], MD4C01, MD4S13);
238 MD4_STEP (MD4_Go, a, b, c, d, w0_t[2], MD4C01, MD4S10);
239 MD4_STEP (MD4_Go, d, a, b, c, w1_t[2], MD4C01, MD4S11);
240 MD4_STEP (MD4_Go, c, d, a, b, w2_t[2], MD4C01, MD4S12);
241 MD4_STEP (MD4_Go, b, c, d, a, w3_t[2], MD4C01, MD4S13);
242 MD4_STEP (MD4_Go, a, b, c, d, w0_t[3], MD4C01, MD4S10);
243 MD4_STEP (MD4_Go, d, a, b, c, w1_t[3], MD4C01, MD4S11);
244 MD4_STEP (MD4_Go, c, d, a, b, w2_t[3], MD4C01, MD4S12);
245 MD4_STEP (MD4_Go, b, c, d, a, w3_t[3], MD4C01, MD4S13);
247 MD4_STEP (MD4_H , a, b, c, d, w0_t[0], MD4C02, MD4S20);
248 MD4_STEP (MD4_H , d, a, b, c, w2_t[0], MD4C02, MD4S21);
249 MD4_STEP (MD4_H , c, d, a, b, w1_t[0], MD4C02, MD4S22);
250 MD4_STEP (MD4_H , b, c, d, a, w3_t[0], MD4C02, MD4S23);
251 MD4_STEP (MD4_H , a, b, c, d, w0_t[2], MD4C02, MD4S20);
252 MD4_STEP (MD4_H , d, a, b, c, w2_t[2], MD4C02, MD4S21);
253 MD4_STEP (MD4_H , c, d, a, b, w1_t[2], MD4C02, MD4S22);
254 MD4_STEP (MD4_H , b, c, d, a, w3_t[2], MD4C02, MD4S23);
255 MD4_STEP (MD4_H , a, b, c, d, w0_t[1], MD4C02, MD4S20);
256 MD4_STEP (MD4_H , d, a, b, c, w2_t[1], MD4C02, MD4S21);
257 MD4_STEP (MD4_H , c, d, a, b, w1_t[1], MD4C02, MD4S22);
258 MD4_STEP (MD4_H , b, c, d, a, w3_t[1], MD4C02, MD4S23);
259 MD4_STEP (MD4_H , a, b, c, d, w0_t[3], MD4C02, MD4S20);
260 MD4_STEP (MD4_H , d, a, b, c, w2_t[3], MD4C02, MD4S21);
261 MD4_STEP (MD4_H , c, d, a, b, w1_t[3], MD4C02, MD4S22);
262 MD4_STEP (MD4_H , b, c, d, a, w3_t[3], MD4C02, MD4S23);
273 w1_t[0] = salt_buf0[0];
274 w1_t[1] = salt_buf0[1];
275 w1_t[2] = salt_buf0[2];
276 w1_t[3] = salt_buf0[3];
277 w2_t[0] = salt_buf1[0];
278 w2_t[1] = salt_buf1[1];
279 w2_t[2] = salt_buf1[2];
280 w2_t[3] = salt_buf1[3];
281 w3_t[0] = salt_buf2[0];
282 w3_t[1] = salt_buf2[1];
283 w3_t[2] = (16 + salt_len) * 8;
291 MD4_STEP (MD4_Fo, a, b, c, d, w0_t[0], MD4C00, MD4S00);
292 MD4_STEP (MD4_Fo, d, a, b, c, w0_t[1], MD4C00, MD4S01);
293 MD4_STEP (MD4_Fo, c, d, a, b, w0_t[2], MD4C00, MD4S02);
294 MD4_STEP (MD4_Fo, b, c, d, a, w0_t[3], MD4C00, MD4S03);
295 MD4_STEP (MD4_Fo, a, b, c, d, w1_t[0], MD4C00, MD4S00);
296 MD4_STEP (MD4_Fo, d, a, b, c, w1_t[1], MD4C00, MD4S01);
297 MD4_STEP (MD4_Fo, c, d, a, b, w1_t[2], MD4C00, MD4S02);
298 MD4_STEP (MD4_Fo, b, c, d, a, w1_t[3], MD4C00, MD4S03);
299 MD4_STEP (MD4_Fo, a, b, c, d, w2_t[0], MD4C00, MD4S00);
300 MD4_STEP (MD4_Fo, d, a, b, c, w2_t[1], MD4C00, MD4S01);
301 MD4_STEP (MD4_Fo, c, d, a, b, w2_t[2], MD4C00, MD4S02);
302 MD4_STEP (MD4_Fo, b, c, d, a, w2_t[3], MD4C00, MD4S03);
303 MD4_STEP (MD4_Fo, a, b, c, d, w3_t[0], MD4C00, MD4S00);
304 MD4_STEP (MD4_Fo, d, a, b, c, w3_t[1], MD4C00, MD4S01);
305 MD4_STEP (MD4_Fo, c, d, a, b, w3_t[2], MD4C00, MD4S02);
306 MD4_STEP (MD4_Fo, b, c, d, a, w3_t[3], MD4C00, MD4S03);
308 MD4_STEP (MD4_Go, a, b, c, d, w0_t[0], MD4C01, MD4S10);
309 MD4_STEP (MD4_Go, d, a, b, c, w1_t[0], MD4C01, MD4S11);
310 MD4_STEP (MD4_Go, c, d, a, b, w2_t[0], MD4C01, MD4S12);
311 MD4_STEP (MD4_Go, b, c, d, a, w3_t[0], MD4C01, MD4S13);
312 MD4_STEP (MD4_Go, a, b, c, d, w0_t[1], MD4C01, MD4S10);
313 MD4_STEP (MD4_Go, d, a, b, c, w1_t[1], MD4C01, MD4S11);
314 MD4_STEP (MD4_Go, c, d, a, b, w2_t[1], MD4C01, MD4S12);
315 MD4_STEP (MD4_Go, b, c, d, a, w3_t[1], MD4C01, MD4S13);
316 MD4_STEP (MD4_Go, a, b, c, d, w0_t[2], MD4C01, MD4S10);
317 MD4_STEP (MD4_Go, d, a, b, c, w1_t[2], MD4C01, MD4S11);
318 MD4_STEP (MD4_Go, c, d, a, b, w2_t[2], MD4C01, MD4S12);
319 MD4_STEP (MD4_Go, b, c, d, a, w3_t[2], MD4C01, MD4S13);
320 MD4_STEP (MD4_Go, a, b, c, d, w0_t[3], MD4C01, MD4S10);
321 MD4_STEP (MD4_Go, d, a, b, c, w1_t[3], MD4C01, MD4S11);
322 MD4_STEP (MD4_Go, c, d, a, b, w2_t[3], MD4C01, MD4S12);
323 MD4_STEP (MD4_Go, b, c, d, a, w3_t[3], MD4C01, MD4S13);
325 MD4_STEP (MD4_H , a, b, c, d, w0_t[0], MD4C02, MD4S20);
326 MD4_STEP (MD4_H , d, a, b, c, w2_t[0], MD4C02, MD4S21);
327 MD4_STEP (MD4_H , c, d, a, b, w1_t[0], MD4C02, MD4S22);
328 MD4_STEP (MD4_H , b, c, d, a, w3_t[0], MD4C02, MD4S23);
329 MD4_STEP (MD4_H , a, b, c, d, w0_t[2], MD4C02, MD4S20);
330 MD4_STEP (MD4_H , d, a, b, c, w2_t[2], MD4C02, MD4S21);
331 MD4_STEP (MD4_H , c, d, a, b, w1_t[2], MD4C02, MD4S22);
332 MD4_STEP (MD4_H , b, c, d, a, w3_t[2], MD4C02, MD4S23);
333 MD4_STEP (MD4_H , a, b, c, d, w0_t[1], MD4C02, MD4S20);
334 MD4_STEP (MD4_H , d, a, b, c, w2_t[1], MD4C02, MD4S21);
335 MD4_STEP (MD4_H , c, d, a, b, w1_t[1], MD4C02, MD4S22);
336 MD4_STEP (MD4_H , b, c, d, a, w3_t[1], MD4C02, MD4S23);
337 MD4_STEP (MD4_H , a, b, c, d, w0_t[3], MD4C02, MD4S20);
338 MD4_STEP (MD4_H , d, a, b, c, w2_t[3], MD4C02, MD4S21);
339 MD4_STEP (MD4_H , c, d, a, b, w1_t[3], MD4C02, MD4S22);
340 MD4_STEP (MD4_H , b, c, d, a, w3_t[3], MD4C02, MD4S23);
347 #include VECT_COMPARE_M
351 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m01100_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 void *esalt_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 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
355 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m01100_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 void *esalt_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 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
359 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m01100_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 void *esalt_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 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
365 const u32 lid = get_local_id (0);
371 const u32 gid = get_global_id (0);
373 if (gid >= gid_max) return;
377 wordl0[0] = pws[gid].i[ 0];
378 wordl0[1] = pws[gid].i[ 1];
379 wordl0[2] = pws[gid].i[ 2];
380 wordl0[3] = pws[gid].i[ 3];
384 wordl1[0] = pws[gid].i[ 4];
385 wordl1[1] = pws[gid].i[ 5];
386 wordl1[2] = pws[gid].i[ 6];
387 wordl1[3] = pws[gid].i[ 7];
403 const u32 pw_l_len = pws[gid].pw_len;
405 if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
407 append_0x80_2 (wordl0, wordl1, pw_l_len);
409 switch_buffer_by_offset (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
416 const u32 search[4] =
418 digests_buf[digests_offset].digest_buf[DGST_R0],
419 digests_buf[digests_offset].digest_buf[DGST_R1],
420 digests_buf[digests_offset].digest_buf[DGST_R2],
421 digests_buf[digests_offset].digest_buf[DGST_R3]
430 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
431 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
432 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
433 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
437 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
438 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
439 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
440 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
444 salt_buf2[0] = salt_bufs[salt_pos].salt_buf[ 8];
445 salt_buf2[1] = salt_bufs[salt_pos].salt_buf[ 9];
449 const u32 salt_len = salt_bufs[salt_pos].salt_len;
455 for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
457 const u32 pw_r_len = combs_buf[il_pos].pw_len;
459 const u32 pw_len = pw_l_len + pw_r_len;
463 wordr0[0] = combs_buf[il_pos].i[0];
464 wordr0[1] = combs_buf[il_pos].i[1];
465 wordr0[2] = combs_buf[il_pos].i[2];
466 wordr0[3] = combs_buf[il_pos].i[3];
470 wordr1[0] = combs_buf[il_pos].i[4];
471 wordr1[1] = combs_buf[il_pos].i[5];
472 wordr1[2] = combs_buf[il_pos].i[6];
473 wordr1[3] = combs_buf[il_pos].i[7];
489 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
491 switch_buffer_by_offset (wordr0, wordr1, wordr2, wordr3, pw_l_len);
496 w0[0] = wordl0[0] | wordr0[0];
497 w0[1] = wordl0[1] | wordr0[1];
498 w0[2] = wordl0[2] | wordr0[2];
499 w0[3] = wordl0[3] | wordr0[3];
503 w1[0] = wordl1[0] | wordr1[0];
504 w1[1] = wordl1[1] | wordr1[1];
505 w1[2] = wordl1[2] | wordr1[2];
506 w1[3] = wordl1[3] | wordr1[3];
527 make_unicode (w0, w0_t, w1_t);
528 make_unicode (w1, w2_t, w3_t);
530 w3_t[2] = pw_len * 8 * 2;
537 MD4_STEP (MD4_Fo, a, b, c, d, w0_t[0], MD4C00, MD4S00);
538 MD4_STEP (MD4_Fo, d, a, b, c, w0_t[1], MD4C00, MD4S01);
539 MD4_STEP (MD4_Fo, c, d, a, b, w0_t[2], MD4C00, MD4S02);
540 MD4_STEP (MD4_Fo, b, c, d, a, w0_t[3], MD4C00, MD4S03);
541 MD4_STEP (MD4_Fo, a, b, c, d, w1_t[0], MD4C00, MD4S00);
542 MD4_STEP (MD4_Fo, d, a, b, c, w1_t[1], MD4C00, MD4S01);
543 MD4_STEP (MD4_Fo, c, d, a, b, w1_t[2], MD4C00, MD4S02);
544 MD4_STEP (MD4_Fo, b, c, d, a, w1_t[3], MD4C00, MD4S03);
545 MD4_STEP (MD4_Fo, a, b, c, d, w2_t[0], MD4C00, MD4S00);
546 MD4_STEP (MD4_Fo, d, a, b, c, w2_t[1], MD4C00, MD4S01);
547 MD4_STEP (MD4_Fo, c, d, a, b, w2_t[2], MD4C00, MD4S02);
548 MD4_STEP (MD4_Fo, b, c, d, a, w2_t[3], MD4C00, MD4S03);
549 MD4_STEP (MD4_Fo, a, b, c, d, w3_t[0], MD4C00, MD4S00);
550 MD4_STEP (MD4_Fo, d, a, b, c, w3_t[1], MD4C00, MD4S01);
551 MD4_STEP (MD4_Fo, c, d, a, b, w3_t[2], MD4C00, MD4S02);
552 MD4_STEP (MD4_Fo, b, c, d, a, w3_t[3], MD4C00, MD4S03);
554 MD4_STEP (MD4_Go, a, b, c, d, w0_t[0], MD4C01, MD4S10);
555 MD4_STEP (MD4_Go, d, a, b, c, w1_t[0], MD4C01, MD4S11);
556 MD4_STEP (MD4_Go, c, d, a, b, w2_t[0], MD4C01, MD4S12);
557 MD4_STEP (MD4_Go, b, c, d, a, w3_t[0], MD4C01, MD4S13);
558 MD4_STEP (MD4_Go, a, b, c, d, w0_t[1], MD4C01, MD4S10);
559 MD4_STEP (MD4_Go, d, a, b, c, w1_t[1], MD4C01, MD4S11);
560 MD4_STEP (MD4_Go, c, d, a, b, w2_t[1], MD4C01, MD4S12);
561 MD4_STEP (MD4_Go, b, c, d, a, w3_t[1], MD4C01, MD4S13);
562 MD4_STEP (MD4_Go, a, b, c, d, w0_t[2], MD4C01, MD4S10);
563 MD4_STEP (MD4_Go, d, a, b, c, w1_t[2], MD4C01, MD4S11);
564 MD4_STEP (MD4_Go, c, d, a, b, w2_t[2], MD4C01, MD4S12);
565 MD4_STEP (MD4_Go, b, c, d, a, w3_t[2], MD4C01, MD4S13);
566 MD4_STEP (MD4_Go, a, b, c, d, w0_t[3], MD4C01, MD4S10);
567 MD4_STEP (MD4_Go, d, a, b, c, w1_t[3], MD4C01, MD4S11);
568 MD4_STEP (MD4_Go, c, d, a, b, w2_t[3], MD4C01, MD4S12);
569 MD4_STEP (MD4_Go, b, c, d, a, w3_t[3], MD4C01, MD4S13);
571 MD4_STEP (MD4_H , a, b, c, d, w0_t[0], MD4C02, MD4S20);
572 MD4_STEP (MD4_H , d, a, b, c, w2_t[0], MD4C02, MD4S21);
573 MD4_STEP (MD4_H , c, d, a, b, w1_t[0], MD4C02, MD4S22);
574 MD4_STEP (MD4_H , b, c, d, a, w3_t[0], MD4C02, MD4S23);
575 MD4_STEP (MD4_H , a, b, c, d, w0_t[2], MD4C02, MD4S20);
576 MD4_STEP (MD4_H , d, a, b, c, w2_t[2], MD4C02, MD4S21);
577 MD4_STEP (MD4_H , c, d, a, b, w1_t[2], MD4C02, MD4S22);
578 MD4_STEP (MD4_H , b, c, d, a, w3_t[2], MD4C02, MD4S23);
579 MD4_STEP (MD4_H , a, b, c, d, w0_t[1], MD4C02, MD4S20);
580 MD4_STEP (MD4_H , d, a, b, c, w2_t[1], MD4C02, MD4S21);
581 MD4_STEP (MD4_H , c, d, a, b, w1_t[1], MD4C02, MD4S22);
582 MD4_STEP (MD4_H , b, c, d, a, w3_t[1], MD4C02, MD4S23);
583 MD4_STEP (MD4_H , a, b, c, d, w0_t[3], MD4C02, MD4S20);
584 MD4_STEP (MD4_H , d, a, b, c, w2_t[3], MD4C02, MD4S21);
585 MD4_STEP (MD4_H , c, d, a, b, w1_t[3], MD4C02, MD4S22);
586 MD4_STEP (MD4_H , b, c, d, a, w3_t[3], MD4C02, MD4S23);
597 w1_t[0] = salt_buf0[0];
598 w1_t[1] = salt_buf0[1];
599 w1_t[2] = salt_buf0[2];
600 w1_t[3] = salt_buf0[3];
601 w2_t[0] = salt_buf1[0];
602 w2_t[1] = salt_buf1[1];
603 w2_t[2] = salt_buf1[2];
604 w2_t[3] = salt_buf1[3];
605 w3_t[0] = salt_buf2[0];
606 w3_t[1] = salt_buf2[1];
607 w3_t[2] = (16 + salt_len) * 8;
615 MD4_STEP (MD4_Fo, a, b, c, d, w0_t[0], MD4C00, MD4S00);
616 MD4_STEP (MD4_Fo, d, a, b, c, w0_t[1], MD4C00, MD4S01);
617 MD4_STEP (MD4_Fo, c, d, a, b, w0_t[2], MD4C00, MD4S02);
618 MD4_STEP (MD4_Fo, b, c, d, a, w0_t[3], MD4C00, MD4S03);
619 MD4_STEP (MD4_Fo, a, b, c, d, w1_t[0], MD4C00, MD4S00);
620 MD4_STEP (MD4_Fo, d, a, b, c, w1_t[1], MD4C00, MD4S01);
621 MD4_STEP (MD4_Fo, c, d, a, b, w1_t[2], MD4C00, MD4S02);
622 MD4_STEP (MD4_Fo, b, c, d, a, w1_t[3], MD4C00, MD4S03);
623 MD4_STEP (MD4_Fo, a, b, c, d, w2_t[0], MD4C00, MD4S00);
624 MD4_STEP (MD4_Fo, d, a, b, c, w2_t[1], MD4C00, MD4S01);
625 MD4_STEP (MD4_Fo, c, d, a, b, w2_t[2], MD4C00, MD4S02);
626 MD4_STEP (MD4_Fo, b, c, d, a, w2_t[3], MD4C00, MD4S03);
627 MD4_STEP (MD4_Fo, a, b, c, d, w3_t[0], MD4C00, MD4S00);
628 MD4_STEP (MD4_Fo, d, a, b, c, w3_t[1], MD4C00, MD4S01);
629 MD4_STEP (MD4_Fo, c, d, a, b, w3_t[2], MD4C00, MD4S02);
630 MD4_STEP (MD4_Fo, b, c, d, a, w3_t[3], MD4C00, MD4S03);
632 MD4_STEP (MD4_Go, a, b, c, d, w0_t[0], MD4C01, MD4S10);
633 MD4_STEP (MD4_Go, d, a, b, c, w1_t[0], MD4C01, MD4S11);
634 MD4_STEP (MD4_Go, c, d, a, b, w2_t[0], MD4C01, MD4S12);
635 MD4_STEP (MD4_Go, b, c, d, a, w3_t[0], MD4C01, MD4S13);
636 MD4_STEP (MD4_Go, a, b, c, d, w0_t[1], MD4C01, MD4S10);
637 MD4_STEP (MD4_Go, d, a, b, c, w1_t[1], MD4C01, MD4S11);
638 MD4_STEP (MD4_Go, c, d, a, b, w2_t[1], MD4C01, MD4S12);
639 MD4_STEP (MD4_Go, b, c, d, a, w3_t[1], MD4C01, MD4S13);
640 MD4_STEP (MD4_Go, a, b, c, d, w0_t[2], MD4C01, MD4S10);
641 MD4_STEP (MD4_Go, d, a, b, c, w1_t[2], MD4C01, MD4S11);
642 MD4_STEP (MD4_Go, c, d, a, b, w2_t[2], MD4C01, MD4S12);
643 MD4_STEP (MD4_Go, b, c, d, a, w3_t[2], MD4C01, MD4S13);
644 MD4_STEP (MD4_Go, a, b, c, d, w0_t[3], MD4C01, MD4S10);
645 MD4_STEP (MD4_Go, d, a, b, c, w1_t[3], MD4C01, MD4S11);
646 MD4_STEP (MD4_Go, c, d, a, b, w2_t[3], MD4C01, MD4S12);
647 MD4_STEP (MD4_Go, b, c, d, a, w3_t[3], MD4C01, MD4S13);
649 MD4_STEP (MD4_H , a, b, c, d, w0_t[0], MD4C02, MD4S20);
650 MD4_STEP (MD4_H , d, a, b, c, w2_t[0], MD4C02, MD4S21);
651 MD4_STEP (MD4_H , c, d, a, b, w1_t[0], MD4C02, MD4S22);
652 MD4_STEP (MD4_H , b, c, d, a, w3_t[0], MD4C02, MD4S23);
653 MD4_STEP (MD4_H , a, b, c, d, w0_t[2], MD4C02, MD4S20);
654 MD4_STEP (MD4_H , d, a, b, c, w2_t[2], MD4C02, MD4S21);
655 MD4_STEP (MD4_H , c, d, a, b, w1_t[2], MD4C02, MD4S22);
656 MD4_STEP (MD4_H , b, c, d, a, w3_t[2], MD4C02, MD4S23);
657 MD4_STEP (MD4_H , a, b, c, d, w0_t[1], MD4C02, MD4S20);
658 MD4_STEP (MD4_H , d, a, b, c, w2_t[1], MD4C02, MD4S21);
659 MD4_STEP (MD4_H , c, d, a, b, w1_t[1], MD4C02, MD4S22);
660 MD4_STEP (MD4_H , b, c, d, a, w3_t[1], MD4C02, MD4S23);
661 MD4_STEP (MD4_H , a, b, c, d, w0_t[3], MD4C02, MD4S20);
663 bool q_cond = allx (search[0] != a);
665 if (q_cond) continue;
667 MD4_STEP (MD4_H , d, a, b, c, w2_t[3], MD4C02, MD4S21);
668 MD4_STEP (MD4_H , c, d, a, b, w1_t[3], MD4C02, MD4S22);
669 MD4_STEP (MD4_H , b, c, d, a, w3_t[3], MD4C02, MD4S23);
676 #include VECT_COMPARE_S
680 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m01100_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 void *esalt_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 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
684 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m01100_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 void *esalt_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 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)