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"
29 #define VECT_COMPARE_S "check_single_vect1_comp4.c"
30 #define VECT_COMPARE_M "check_multi_vect1_comp4.c"
34 #define VECT_COMPARE_S "check_single_vect2_comp4.c"
35 #define VECT_COMPARE_M "check_multi_vect2_comp4.c"
39 #define VECT_COMPARE_S "check_single_vect4_comp4.c"
40 #define VECT_COMPARE_M "check_multi_vect4_comp4.c"
43 __device__ __constant__ comb_t c_combs[1024];
45 extern "C" __global__ void __launch_bounds__ (256, 1) m04900_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 void *esalt_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 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
51 const u32 lid = threadIdx.x;
57 const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
59 if (gid >= gid_max) return;
63 wordl0[0] = pws[gid].i[ 0];
64 wordl0[1] = pws[gid].i[ 1];
65 wordl0[2] = pws[gid].i[ 2];
66 wordl0[3] = pws[gid].i[ 3];
70 wordl1[0] = pws[gid].i[ 4];
71 wordl1[1] = pws[gid].i[ 5];
72 wordl1[2] = pws[gid].i[ 6];
73 wordl1[3] = pws[gid].i[ 7];
89 const u32 pw_l_len = pws[gid].pw_len;
91 if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
93 switch_buffer_by_offset (wordl0, wordl1, wordl2, wordl3, c_combs[0].pw_len);
102 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
103 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
104 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
105 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
109 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
110 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
111 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
112 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
128 const u32 salt_len = salt_bufs[salt_pos].salt_len;
134 for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
136 const u32 pw_r_len = c_combs[il_pos].pw_len;
138 const u32 pw_len = pw_l_len + pw_r_len;
142 wordr0[0] = c_combs[il_pos].i[0];
143 wordr0[1] = c_combs[il_pos].i[1];
144 wordr0[2] = c_combs[il_pos].i[2];
145 wordr0[3] = c_combs[il_pos].i[3];
149 wordr1[0] = c_combs[il_pos].i[4];
150 wordr1[1] = c_combs[il_pos].i[5];
151 wordr1[2] = c_combs[il_pos].i[6];
152 wordr1[3] = c_combs[il_pos].i[7];
168 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
170 switch_buffer_by_offset (wordr0, wordr1, wordr2, wordr3, pw_l_len);
175 w0_t[0] = wordl0[0] | wordr0[0];
176 w0_t[1] = wordl0[1] | wordr0[1];
177 w0_t[2] = wordl0[2] | wordr0[2];
178 w0_t[3] = wordl0[3] | wordr0[3];
182 w1_t[0] = wordl1[0] | wordr1[0];
183 w1_t[1] = wordl1[1] | wordr1[1];
184 w1_t[2] = wordl1[2] | wordr1[2];
185 w1_t[3] = wordl1[3] | wordr1[3];
189 w2_t[0] = wordl2[0] | wordr2[0];
190 w2_t[1] = wordl2[1] | wordr2[1];
191 w2_t[2] = wordl2[2] | wordr2[2];
192 w2_t[3] = wordl2[3] | wordr2[3];
196 w3_t[0] = wordl3[0] | wordr3[0];
197 w3_t[1] = wordl3[1] | wordr3[1];
205 switch_buffer_by_offset (w0_t, w1_t, w2_t, w3_t, salt_len);
207 w0_t[0] |= salt_buf0[0];
208 w0_t[1] |= salt_buf0[1];
209 w0_t[2] |= salt_buf0[2];
210 w0_t[3] |= salt_buf0[3];
211 w1_t[0] |= salt_buf1[0];
212 w1_t[1] |= salt_buf1[1];
213 w1_t[2] |= salt_buf1[2];
214 w1_t[3] |= salt_buf1[3];
215 w2_t[0] |= salt_buf2[0];
216 w2_t[1] |= salt_buf2[1];
217 w2_t[2] |= salt_buf2[2];
218 w2_t[3] |= salt_buf2[3];
219 w3_t[0] |= salt_buf3[0];
220 w3_t[1] |= salt_buf3[1];
221 w3_t[2] |= salt_buf3[2];
222 w3_t[3] |= salt_buf3[3];
230 s0[0] = salt_buf0[0];
231 s0[1] = salt_buf0[1];
232 s0[2] = salt_buf0[2];
233 s0[3] = salt_buf0[3];
237 s1[0] = salt_buf1[0];
238 s1[1] = salt_buf1[1];
239 s1[2] = salt_buf1[2];
240 s1[3] = salt_buf1[3];
256 switch_buffer_by_offset (s0, s1, s2, s3, salt_len + pw_len);
275 const u32 pw_salt_len = salt_len + pw_len + salt_len;
277 append_0x80_4 (w0_t, w1_t, w2_t, w3_t, pw_salt_len);
279 u32x w0 = swap_workaround (w0_t[0]);
280 u32x w1 = swap_workaround (w0_t[1]);
281 u32x w2 = swap_workaround (w0_t[2]);
282 u32x w3 = swap_workaround (w0_t[3]);
283 u32x w4 = swap_workaround (w1_t[0]);
284 u32x w5 = swap_workaround (w1_t[1]);
285 u32x w6 = swap_workaround (w1_t[2]);
286 u32x w7 = swap_workaround (w1_t[3]);
287 u32x w8 = swap_workaround (w2_t[0]);
288 u32x w9 = swap_workaround (w2_t[1]);
289 u32x wa = swap_workaround (w2_t[2]);
290 u32x wb = swap_workaround (w2_t[3]);
291 u32x wc = swap_workaround (w3_t[0]);
292 u32x wd = swap_workaround (w3_t[1]);
294 u32x wf = pw_salt_len * 8;
309 SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0);
310 SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1);
311 SHA1_STEP (SHA1_F0o, d, e, a, b, c, w2);
312 SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3);
313 SHA1_STEP (SHA1_F0o, b, c, d, e, a, w4);
314 SHA1_STEP (SHA1_F0o, a, b, c, d, e, w5);
315 SHA1_STEP (SHA1_F0o, e, a, b, c, d, w6);
316 SHA1_STEP (SHA1_F0o, d, e, a, b, c, w7);
317 SHA1_STEP (SHA1_F0o, c, d, e, a, b, w8);
318 SHA1_STEP (SHA1_F0o, b, c, d, e, a, w9);
319 SHA1_STEP (SHA1_F0o, a, b, c, d, e, wa);
320 SHA1_STEP (SHA1_F0o, e, a, b, c, d, wb);
321 SHA1_STEP (SHA1_F0o, d, e, a, b, c, wc);
322 SHA1_STEP (SHA1_F0o, c, d, e, a, b, wd);
323 SHA1_STEP (SHA1_F0o, b, c, d, e, a, we);
324 SHA1_STEP (SHA1_F0o, a, b, c, d, e, wf);
325 w0 = rotl32 ((wd ^ w8 ^ w2 ^ w0), 1u); SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0);
326 w1 = rotl32 ((we ^ w9 ^ w3 ^ w1), 1u); SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1);
327 w2 = rotl32 ((wf ^ wa ^ w4 ^ w2), 1u); SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2);
328 w3 = rotl32 ((w0 ^ wb ^ w5 ^ w3), 1u); SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3);
333 w4 = rotl32 ((w1 ^ wc ^ w6 ^ w4), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w4);
334 w5 = rotl32 ((w2 ^ wd ^ w7 ^ w5), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w5);
335 w6 = rotl32 ((w3 ^ we ^ w8 ^ w6), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w6);
336 w7 = rotl32 ((w4 ^ wf ^ w9 ^ w7), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w7);
337 w8 = rotl32 ((w5 ^ w0 ^ wa ^ w8), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w8);
338 w9 = rotl32 ((w6 ^ w1 ^ wb ^ w9), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w9);
339 wa = rotl32 ((w7 ^ w2 ^ wc ^ wa), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wa);
340 wb = rotl32 ((w8 ^ w3 ^ wd ^ wb), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wb);
341 wc = rotl32 ((w9 ^ w4 ^ we ^ wc), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wc);
342 wd = rotl32 ((wa ^ w5 ^ wf ^ wd), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wd);
343 we = rotl32 ((wb ^ w6 ^ w0 ^ we), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, we);
344 wf = rotl32 ((wc ^ w7 ^ w1 ^ wf), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wf);
345 w0 = rotl32 ((wd ^ w8 ^ w2 ^ w0), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0);
346 w1 = rotl32 ((we ^ w9 ^ w3 ^ w1), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1);
347 w2 = rotl32 ((wf ^ wa ^ w4 ^ w2), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2);
348 w3 = rotl32 ((w0 ^ wb ^ w5 ^ w3), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3);
349 w4 = rotl32 ((w1 ^ wc ^ w6 ^ w4), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w4);
350 w5 = rotl32 ((w2 ^ wd ^ w7 ^ w5), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w5);
351 w6 = rotl32 ((w3 ^ we ^ w8 ^ w6), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w6);
352 w7 = rotl32 ((w4 ^ wf ^ w9 ^ w7), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w7);
357 w8 = rotl32 ((w5 ^ w0 ^ wa ^ w8), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w8);
358 w9 = rotl32 ((w6 ^ w1 ^ wb ^ w9), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w9);
359 wa = rotl32 ((w7 ^ w2 ^ wc ^ wa), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wa);
360 wb = rotl32 ((w8 ^ w3 ^ wd ^ wb), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wb);
361 wc = rotl32 ((w9 ^ w4 ^ we ^ wc), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wc);
362 wd = rotl32 ((wa ^ w5 ^ wf ^ wd), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, wd);
363 we = rotl32 ((wb ^ w6 ^ w0 ^ we), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, we);
364 wf = rotl32 ((wc ^ w7 ^ w1 ^ wf), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wf);
365 w0 = rotl32 ((wd ^ w8 ^ w2 ^ w0), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w0);
366 w1 = rotl32 ((we ^ w9 ^ w3 ^ w1), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w1);
367 w2 = rotl32 ((wf ^ wa ^ w4 ^ w2), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w2);
368 w3 = rotl32 ((w0 ^ wb ^ w5 ^ w3), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w3);
369 w4 = rotl32 ((w1 ^ wc ^ w6 ^ w4), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w4);
370 w5 = rotl32 ((w2 ^ wd ^ w7 ^ w5), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w5);
371 w6 = rotl32 ((w3 ^ we ^ w8 ^ w6), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w6);
372 w7 = rotl32 ((w4 ^ wf ^ w9 ^ w7), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w7);
373 w8 = rotl32 ((w5 ^ w0 ^ wa ^ w8), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w8);
374 w9 = rotl32 ((w6 ^ w1 ^ wb ^ w9), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w9);
375 wa = rotl32 ((w7 ^ w2 ^ wc ^ wa), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wa);
376 wb = rotl32 ((w8 ^ w3 ^ wd ^ wb), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wb);
381 wc = rotl32 ((w9 ^ w4 ^ we ^ wc), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wc);
382 wd = rotl32 ((wa ^ w5 ^ wf ^ wd), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wd);
383 we = rotl32 ((wb ^ w6 ^ w0 ^ we), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, we);
384 wf = rotl32 ((wc ^ w7 ^ w1 ^ wf), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wf);
385 w0 = rotl32 ((wd ^ w8 ^ w2 ^ w0), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0);
386 w1 = rotl32 ((we ^ w9 ^ w3 ^ w1), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1);
387 w2 = rotl32 ((wf ^ wa ^ w4 ^ w2), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w2);
388 w3 = rotl32 ((w0 ^ wb ^ w5 ^ w3), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3);
389 w4 = rotl32 ((w1 ^ wc ^ w6 ^ w4), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w4);
390 w5 = rotl32 ((w2 ^ wd ^ w7 ^ w5), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w5);
391 w6 = rotl32 ((w3 ^ we ^ w8 ^ w6), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w6);
392 w7 = rotl32 ((w4 ^ wf ^ w9 ^ w7), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w7);
393 w8 = rotl32 ((w5 ^ w0 ^ wa ^ w8), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w8);
394 w9 = rotl32 ((w6 ^ w1 ^ wb ^ w9), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w9);
395 wa = rotl32 ((w7 ^ w2 ^ wc ^ wa), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wa);
396 wb = rotl32 ((w8 ^ w3 ^ wd ^ wb), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wb);
397 wc = rotl32 ((w9 ^ w4 ^ we ^ wc), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wc);
398 wd = rotl32 ((wa ^ w5 ^ wf ^ wd), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd);
399 we = rotl32 ((wb ^ w6 ^ w0 ^ we), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we);
400 wf = rotl32 ((wc ^ w7 ^ w1 ^ wf), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf);
407 #include VECT_COMPARE_M
411 extern "C" __global__ void __launch_bounds__ (256, 1) m04900_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 void *esalt_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)
415 extern "C" __global__ void __launch_bounds__ (256, 1) m04900_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 void *esalt_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)
419 extern "C" __global__ void __launch_bounds__ (256, 1) m04900_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 void *esalt_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 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
425 const u32 lid = threadIdx.x;
431 const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
433 if (gid >= gid_max) return;
437 wordl0[0] = pws[gid].i[ 0];
438 wordl0[1] = pws[gid].i[ 1];
439 wordl0[2] = pws[gid].i[ 2];
440 wordl0[3] = pws[gid].i[ 3];
444 wordl1[0] = pws[gid].i[ 4];
445 wordl1[1] = pws[gid].i[ 5];
446 wordl1[2] = pws[gid].i[ 6];
447 wordl1[3] = pws[gid].i[ 7];
463 const u32 pw_l_len = pws[gid].pw_len;
465 if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
467 switch_buffer_by_offset (wordl0, wordl1, wordl2, wordl3, c_combs[0].pw_len);
476 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
477 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
478 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
479 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
483 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
484 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
485 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
486 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
502 const u32 salt_len = salt_bufs[salt_pos].salt_len;
508 const u32 search[4] =
510 digests_buf[digests_offset].digest_buf[DGST_R0],
511 digests_buf[digests_offset].digest_buf[DGST_R1],
512 digests_buf[digests_offset].digest_buf[DGST_R2],
513 digests_buf[digests_offset].digest_buf[DGST_R3]
520 const u32 e_rev = rotl32 (search[1], 2u);
526 for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
528 const u32 pw_r_len = c_combs[il_pos].pw_len;
530 const u32 pw_len = pw_l_len + pw_r_len;
534 wordr0[0] = c_combs[il_pos].i[0];
535 wordr0[1] = c_combs[il_pos].i[1];
536 wordr0[2] = c_combs[il_pos].i[2];
537 wordr0[3] = c_combs[il_pos].i[3];
541 wordr1[0] = c_combs[il_pos].i[4];
542 wordr1[1] = c_combs[il_pos].i[5];
543 wordr1[2] = c_combs[il_pos].i[6];
544 wordr1[3] = c_combs[il_pos].i[7];
560 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
562 switch_buffer_by_offset (wordr0, wordr1, wordr2, wordr3, pw_l_len);
567 w0_t[0] = wordl0[0] | wordr0[0];
568 w0_t[1] = wordl0[1] | wordr0[1];
569 w0_t[2] = wordl0[2] | wordr0[2];
570 w0_t[3] = wordl0[3] | wordr0[3];
574 w1_t[0] = wordl1[0] | wordr1[0];
575 w1_t[1] = wordl1[1] | wordr1[1];
576 w1_t[2] = wordl1[2] | wordr1[2];
577 w1_t[3] = wordl1[3] | wordr1[3];
581 w2_t[0] = wordl2[0] | wordr2[0];
582 w2_t[1] = wordl2[1] | wordr2[1];
583 w2_t[2] = wordl2[2] | wordr2[2];
584 w2_t[3] = wordl2[3] | wordr2[3];
588 w3_t[0] = wordl3[0] | wordr3[0];
589 w3_t[1] = wordl3[1] | wordr3[1];
597 switch_buffer_by_offset (w0_t, w1_t, w2_t, w3_t, salt_len);
599 w0_t[0] |= salt_buf0[0];
600 w0_t[1] |= salt_buf0[1];
601 w0_t[2] |= salt_buf0[2];
602 w0_t[3] |= salt_buf0[3];
603 w1_t[0] |= salt_buf1[0];
604 w1_t[1] |= salt_buf1[1];
605 w1_t[2] |= salt_buf1[2];
606 w1_t[3] |= salt_buf1[3];
607 w2_t[0] |= salt_buf2[0];
608 w2_t[1] |= salt_buf2[1];
609 w2_t[2] |= salt_buf2[2];
610 w2_t[3] |= salt_buf2[3];
611 w3_t[0] |= salt_buf3[0];
612 w3_t[1] |= salt_buf3[1];
613 w3_t[2] |= salt_buf3[2];
614 w3_t[3] |= salt_buf3[3];
622 s0[0] = salt_buf0[0];
623 s0[1] = salt_buf0[1];
624 s0[2] = salt_buf0[2];
625 s0[3] = salt_buf0[3];
629 s1[0] = salt_buf1[0];
630 s1[1] = salt_buf1[1];
631 s1[2] = salt_buf1[2];
632 s1[3] = salt_buf1[3];
648 switch_buffer_by_offset (s0, s1, s2, s3, salt_len + pw_len);
667 const u32 pw_salt_len = salt_len + pw_len + salt_len;
669 append_0x80_4 (w0_t, w1_t, w2_t, w3_t, pw_salt_len);
671 u32x w0 = swap_workaround (w0_t[0]);
672 u32x w1 = swap_workaround (w0_t[1]);
673 u32x w2 = swap_workaround (w0_t[2]);
674 u32x w3 = swap_workaround (w0_t[3]);
675 u32x w4 = swap_workaround (w1_t[0]);
676 u32x w5 = swap_workaround (w1_t[1]);
677 u32x w6 = swap_workaround (w1_t[2]);
678 u32x w7 = swap_workaround (w1_t[3]);
679 u32x w8 = swap_workaround (w2_t[0]);
680 u32x w9 = swap_workaround (w2_t[1]);
681 u32x wa = swap_workaround (w2_t[2]);
682 u32x wb = swap_workaround (w2_t[3]);
683 u32x wc = swap_workaround (w3_t[0]);
684 u32x wd = swap_workaround (w3_t[1]);
686 u32x wf = pw_salt_len * 8;
701 SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0);
702 SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1);
703 SHA1_STEP (SHA1_F0o, d, e, a, b, c, w2);
704 SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3);
705 SHA1_STEP (SHA1_F0o, b, c, d, e, a, w4);
706 SHA1_STEP (SHA1_F0o, a, b, c, d, e, w5);
707 SHA1_STEP (SHA1_F0o, e, a, b, c, d, w6);
708 SHA1_STEP (SHA1_F0o, d, e, a, b, c, w7);
709 SHA1_STEP (SHA1_F0o, c, d, e, a, b, w8);
710 SHA1_STEP (SHA1_F0o, b, c, d, e, a, w9);
711 SHA1_STEP (SHA1_F0o, a, b, c, d, e, wa);
712 SHA1_STEP (SHA1_F0o, e, a, b, c, d, wb);
713 SHA1_STEP (SHA1_F0o, d, e, a, b, c, wc);
714 SHA1_STEP (SHA1_F0o, c, d, e, a, b, wd);
715 SHA1_STEP (SHA1_F0o, b, c, d, e, a, we);
716 SHA1_STEP (SHA1_F0o, a, b, c, d, e, wf);
717 w0 = rotl32 ((wd ^ w8 ^ w2 ^ w0), 1u); SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0);
718 w1 = rotl32 ((we ^ w9 ^ w3 ^ w1), 1u); SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1);
719 w2 = rotl32 ((wf ^ wa ^ w4 ^ w2), 1u); SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2);
720 w3 = rotl32 ((w0 ^ wb ^ w5 ^ w3), 1u); SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3);
725 w4 = rotl32 ((w1 ^ wc ^ w6 ^ w4), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w4);
726 w5 = rotl32 ((w2 ^ wd ^ w7 ^ w5), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w5);
727 w6 = rotl32 ((w3 ^ we ^ w8 ^ w6), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w6);
728 w7 = rotl32 ((w4 ^ wf ^ w9 ^ w7), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w7);
729 w8 = rotl32 ((w5 ^ w0 ^ wa ^ w8), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w8);
730 w9 = rotl32 ((w6 ^ w1 ^ wb ^ w9), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w9);
731 wa = rotl32 ((w7 ^ w2 ^ wc ^ wa), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wa);
732 wb = rotl32 ((w8 ^ w3 ^ wd ^ wb), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wb);
733 wc = rotl32 ((w9 ^ w4 ^ we ^ wc), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wc);
734 wd = rotl32 ((wa ^ w5 ^ wf ^ wd), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wd);
735 we = rotl32 ((wb ^ w6 ^ w0 ^ we), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, we);
736 wf = rotl32 ((wc ^ w7 ^ w1 ^ wf), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wf);
737 w0 = rotl32 ((wd ^ w8 ^ w2 ^ w0), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0);
738 w1 = rotl32 ((we ^ w9 ^ w3 ^ w1), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1);
739 w2 = rotl32 ((wf ^ wa ^ w4 ^ w2), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2);
740 w3 = rotl32 ((w0 ^ wb ^ w5 ^ w3), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3);
741 w4 = rotl32 ((w1 ^ wc ^ w6 ^ w4), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w4);
742 w5 = rotl32 ((w2 ^ wd ^ w7 ^ w5), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w5);
743 w6 = rotl32 ((w3 ^ we ^ w8 ^ w6), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w6);
744 w7 = rotl32 ((w4 ^ wf ^ w9 ^ w7), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w7);
749 w8 = rotl32 ((w5 ^ w0 ^ wa ^ w8), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w8);
750 w9 = rotl32 ((w6 ^ w1 ^ wb ^ w9), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w9);
751 wa = rotl32 ((w7 ^ w2 ^ wc ^ wa), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wa);
752 wb = rotl32 ((w8 ^ w3 ^ wd ^ wb), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wb);
753 wc = rotl32 ((w9 ^ w4 ^ we ^ wc), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wc);
754 wd = rotl32 ((wa ^ w5 ^ wf ^ wd), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, wd);
755 we = rotl32 ((wb ^ w6 ^ w0 ^ we), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, we);
756 wf = rotl32 ((wc ^ w7 ^ w1 ^ wf), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wf);
757 w0 = rotl32 ((wd ^ w8 ^ w2 ^ w0), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w0);
758 w1 = rotl32 ((we ^ w9 ^ w3 ^ w1), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w1);
759 w2 = rotl32 ((wf ^ wa ^ w4 ^ w2), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w2);
760 w3 = rotl32 ((w0 ^ wb ^ w5 ^ w3), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w3);
761 w4 = rotl32 ((w1 ^ wc ^ w6 ^ w4), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w4);
762 w5 = rotl32 ((w2 ^ wd ^ w7 ^ w5), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w5);
763 w6 = rotl32 ((w3 ^ we ^ w8 ^ w6), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w6);
764 w7 = rotl32 ((w4 ^ wf ^ w9 ^ w7), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w7);
765 w8 = rotl32 ((w5 ^ w0 ^ wa ^ w8), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w8);
766 w9 = rotl32 ((w6 ^ w1 ^ wb ^ w9), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w9);
767 wa = rotl32 ((w7 ^ w2 ^ wc ^ wa), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wa);
768 wb = rotl32 ((w8 ^ w3 ^ wd ^ wb), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wb);
773 wc = rotl32 ((w9 ^ w4 ^ we ^ wc), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wc);
774 wd = rotl32 ((wa ^ w5 ^ wf ^ wd), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wd);
775 we = rotl32 ((wb ^ w6 ^ w0 ^ we), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, we);
776 wf = rotl32 ((wc ^ w7 ^ w1 ^ wf), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wf);
777 w0 = rotl32 ((wd ^ w8 ^ w2 ^ w0), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0);
778 w1 = rotl32 ((we ^ w9 ^ w3 ^ w1), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1);
779 w2 = rotl32 ((wf ^ wa ^ w4 ^ w2), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w2);
780 w3 = rotl32 ((w0 ^ wb ^ w5 ^ w3), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3);
781 w4 = rotl32 ((w1 ^ wc ^ w6 ^ w4), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w4);
782 w5 = rotl32 ((w2 ^ wd ^ w7 ^ w5), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w5);
783 w6 = rotl32 ((w3 ^ we ^ w8 ^ w6), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w6);
784 w7 = rotl32 ((w4 ^ wf ^ w9 ^ w7), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w7);
785 w8 = rotl32 ((w5 ^ w0 ^ wa ^ w8), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w8);
786 w9 = rotl32 ((w6 ^ w1 ^ wb ^ w9), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w9);
787 wa = rotl32 ((w7 ^ w2 ^ wc ^ wa), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wa);
788 wb = rotl32 ((w8 ^ w3 ^ wd ^ wb), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wb);
790 if (e != e_rev) continue;
792 wc = rotl32 ((w9 ^ w4 ^ we ^ wc), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wc);
793 wd = rotl32 ((wa ^ w5 ^ wf ^ wd), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd);
794 we = rotl32 ((wb ^ w6 ^ w0 ^ we), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we);
795 wf = rotl32 ((wc ^ w7 ^ w1 ^ wf), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf);
802 #include VECT_COMPARE_S
806 extern "C" __global__ void __launch_bounds__ (256, 1) m04900_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 void *esalt_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)
810 extern "C" __global__ void __launch_bounds__ (256, 1) m04900_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 void *esalt_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)