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"
31 #include "include/rp_gpu.h"
35 #define VECT_COMPARE_S "check_single_vect1_comp4.c"
36 #define VECT_COMPARE_M "check_multi_vect1_comp4.c"
40 #define VECT_COMPARE_S "check_single_vect2_comp4.c"
41 #define VECT_COMPARE_M "check_multi_vect2_comp4.c"
45 #define VECT_COMPARE_S "check_single_vect4_comp4.c"
46 #define VECT_COMPARE_M "check_multi_vect4_comp4.c"
49 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m04900_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 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
55 const u32 lid = get_local_id (0);
61 const u32 gid = get_global_id (0);
63 if (gid >= gid_max) return;
67 pw_buf0[0] = pws[gid].i[ 0];
68 pw_buf0[1] = pws[gid].i[ 1];
69 pw_buf0[2] = pws[gid].i[ 2];
70 pw_buf0[3] = pws[gid].i[ 3];
74 pw_buf1[0] = pws[gid].i[ 4];
75 pw_buf1[1] = pws[gid].i[ 5];
76 pw_buf1[2] = pws[gid].i[ 6];
77 pw_buf1[3] = pws[gid].i[ 7];
79 const u32 pw_len = pws[gid].pw_len;
87 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
88 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
89 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
90 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
94 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
95 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
96 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
97 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
113 const u32 salt_len = salt_bufs[salt_pos].salt_len;
119 for (u32 il_pos = 0; il_pos < rules_cnt; il_pos++)
123 w0_t[0] = pw_buf0[0];
124 w0_t[1] = pw_buf0[1];
125 w0_t[2] = pw_buf0[2];
126 w0_t[3] = pw_buf0[3];
130 w1_t[0] = pw_buf1[0];
131 w1_t[1] = pw_buf1[1];
132 w1_t[2] = pw_buf1[2];
133 w1_t[3] = pw_buf1[3];
149 const u32 out_len = apply_rules (rules_buf[il_pos].cmds, w0_t, w1_t, pw_len);
155 switch_buffer_by_offset (w0_t, w1_t, w2_t, w3_t, salt_len);
157 w0_t[0] |= salt_buf0[0];
158 w0_t[1] |= salt_buf0[1];
159 w0_t[2] |= salt_buf0[2];
160 w0_t[3] |= salt_buf0[3];
161 w1_t[0] |= salt_buf1[0];
162 w1_t[1] |= salt_buf1[1];
163 w1_t[2] |= salt_buf1[2];
164 w1_t[3] |= salt_buf1[3];
165 w2_t[0] |= salt_buf2[0];
166 w2_t[1] |= salt_buf2[1];
167 w2_t[2] |= salt_buf2[2];
168 w2_t[3] |= salt_buf2[3];
169 w3_t[0] |= salt_buf3[0];
170 w3_t[1] |= salt_buf3[1];
171 w3_t[2] |= salt_buf3[2];
172 w3_t[3] |= salt_buf3[3];
180 s0[0] = salt_buf0[0];
181 s0[1] = salt_buf0[1];
182 s0[2] = salt_buf0[2];
183 s0[3] = salt_buf0[3];
187 s1[0] = salt_buf1[0];
188 s1[1] = salt_buf1[1];
189 s1[2] = salt_buf1[2];
190 s1[3] = salt_buf1[3];
206 switch_buffer_by_offset (s0, s1, s2, s3, salt_len + out_len);
225 const u32 pw_salt_len = salt_len + out_len + salt_len;
227 append_0x80_4 (w0_t, w1_t, w2_t, w3_t, pw_salt_len);
229 u32x w0 = swap_workaround (w0_t[0]);
230 u32x w1 = swap_workaround (w0_t[1]);
231 u32x w2 = swap_workaround (w0_t[2]);
232 u32x w3 = swap_workaround (w0_t[3]);
233 u32x w4 = swap_workaround (w1_t[0]);
234 u32x w5 = swap_workaround (w1_t[1]);
235 u32x w6 = swap_workaround (w1_t[2]);
236 u32x w7 = swap_workaround (w1_t[3]);
237 u32x w8 = swap_workaround (w2_t[0]);
238 u32x w9 = swap_workaround (w2_t[1]);
239 u32x wa = swap_workaround (w2_t[2]);
240 u32x wb = swap_workaround (w2_t[3]);
241 u32x wc = swap_workaround (w3_t[0]);
242 u32x wd = swap_workaround (w3_t[1]);
244 u32x wf = pw_salt_len * 8;
259 SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0);
260 SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1);
261 SHA1_STEP (SHA1_F0o, d, e, a, b, c, w2);
262 SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3);
263 SHA1_STEP (SHA1_F0o, b, c, d, e, a, w4);
264 SHA1_STEP (SHA1_F0o, a, b, c, d, e, w5);
265 SHA1_STEP (SHA1_F0o, e, a, b, c, d, w6);
266 SHA1_STEP (SHA1_F0o, d, e, a, b, c, w7);
267 SHA1_STEP (SHA1_F0o, c, d, e, a, b, w8);
268 SHA1_STEP (SHA1_F0o, b, c, d, e, a, w9);
269 SHA1_STEP (SHA1_F0o, a, b, c, d, e, wa);
270 SHA1_STEP (SHA1_F0o, e, a, b, c, d, wb);
271 SHA1_STEP (SHA1_F0o, d, e, a, b, c, wc);
272 SHA1_STEP (SHA1_F0o, c, d, e, a, b, wd);
273 SHA1_STEP (SHA1_F0o, b, c, d, e, a, we);
274 SHA1_STEP (SHA1_F0o, a, b, c, d, e, wf);
275 w0 = rotl32 ((wd ^ w8 ^ w2 ^ w0), 1u); SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0);
276 w1 = rotl32 ((we ^ w9 ^ w3 ^ w1), 1u); SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1);
277 w2 = rotl32 ((wf ^ wa ^ w4 ^ w2), 1u); SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2);
278 w3 = rotl32 ((w0 ^ wb ^ w5 ^ w3), 1u); SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3);
283 w4 = rotl32 ((w1 ^ wc ^ w6 ^ w4), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w4);
284 w5 = rotl32 ((w2 ^ wd ^ w7 ^ w5), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w5);
285 w6 = rotl32 ((w3 ^ we ^ w8 ^ w6), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w6);
286 w7 = rotl32 ((w4 ^ wf ^ w9 ^ w7), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w7);
287 w8 = rotl32 ((w5 ^ w0 ^ wa ^ w8), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w8);
288 w9 = rotl32 ((w6 ^ w1 ^ wb ^ w9), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w9);
289 wa = rotl32 ((w7 ^ w2 ^ wc ^ wa), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wa);
290 wb = rotl32 ((w8 ^ w3 ^ wd ^ wb), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wb);
291 wc = rotl32 ((w9 ^ w4 ^ we ^ wc), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wc);
292 wd = rotl32 ((wa ^ w5 ^ wf ^ wd), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wd);
293 we = rotl32 ((wb ^ w6 ^ w0 ^ we), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, we);
294 wf = rotl32 ((wc ^ w7 ^ w1 ^ wf), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wf);
295 w0 = rotl32 ((wd ^ w8 ^ w2 ^ w0), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0);
296 w1 = rotl32 ((we ^ w9 ^ w3 ^ w1), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1);
297 w2 = rotl32 ((wf ^ wa ^ w4 ^ w2), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2);
298 w3 = rotl32 ((w0 ^ wb ^ w5 ^ w3), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3);
299 w4 = rotl32 ((w1 ^ wc ^ w6 ^ w4), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w4);
300 w5 = rotl32 ((w2 ^ wd ^ w7 ^ w5), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w5);
301 w6 = rotl32 ((w3 ^ we ^ w8 ^ w6), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w6);
302 w7 = rotl32 ((w4 ^ wf ^ w9 ^ w7), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w7);
307 w8 = rotl32 ((w5 ^ w0 ^ wa ^ w8), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w8);
308 w9 = rotl32 ((w6 ^ w1 ^ wb ^ w9), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w9);
309 wa = rotl32 ((w7 ^ w2 ^ wc ^ wa), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wa);
310 wb = rotl32 ((w8 ^ w3 ^ wd ^ wb), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wb);
311 wc = rotl32 ((w9 ^ w4 ^ we ^ wc), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wc);
312 wd = rotl32 ((wa ^ w5 ^ wf ^ wd), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, wd);
313 we = rotl32 ((wb ^ w6 ^ w0 ^ we), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, we);
314 wf = rotl32 ((wc ^ w7 ^ w1 ^ wf), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wf);
315 w0 = rotl32 ((wd ^ w8 ^ w2 ^ w0), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w0);
316 w1 = rotl32 ((we ^ w9 ^ w3 ^ w1), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w1);
317 w2 = rotl32 ((wf ^ wa ^ w4 ^ w2), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w2);
318 w3 = rotl32 ((w0 ^ wb ^ w5 ^ w3), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w3);
319 w4 = rotl32 ((w1 ^ wc ^ w6 ^ w4), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w4);
320 w5 = rotl32 ((w2 ^ wd ^ w7 ^ w5), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w5);
321 w6 = rotl32 ((w3 ^ we ^ w8 ^ w6), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w6);
322 w7 = rotl32 ((w4 ^ wf ^ w9 ^ w7), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w7);
323 w8 = rotl32 ((w5 ^ w0 ^ wa ^ w8), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w8);
324 w9 = rotl32 ((w6 ^ w1 ^ wb ^ w9), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w9);
325 wa = rotl32 ((w7 ^ w2 ^ wc ^ wa), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wa);
326 wb = rotl32 ((w8 ^ w3 ^ wd ^ wb), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wb);
331 wc = rotl32 ((w9 ^ w4 ^ we ^ wc), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wc);
332 wd = rotl32 ((wa ^ w5 ^ wf ^ wd), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wd);
333 we = rotl32 ((wb ^ w6 ^ w0 ^ we), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, we);
334 wf = rotl32 ((wc ^ w7 ^ w1 ^ wf), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wf);
335 w0 = rotl32 ((wd ^ w8 ^ w2 ^ w0), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0);
336 w1 = rotl32 ((we ^ w9 ^ w3 ^ w1), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1);
337 w2 = rotl32 ((wf ^ wa ^ w4 ^ w2), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w2);
338 w3 = rotl32 ((w0 ^ wb ^ w5 ^ w3), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3);
339 w4 = rotl32 ((w1 ^ wc ^ w6 ^ w4), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w4);
340 w5 = rotl32 ((w2 ^ wd ^ w7 ^ w5), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w5);
341 w6 = rotl32 ((w3 ^ we ^ w8 ^ w6), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w6);
342 w7 = rotl32 ((w4 ^ wf ^ w9 ^ w7), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w7);
343 w8 = rotl32 ((w5 ^ w0 ^ wa ^ w8), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w8);
344 w9 = rotl32 ((w6 ^ w1 ^ wb ^ w9), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w9);
345 wa = rotl32 ((w7 ^ w2 ^ wc ^ wa), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wa);
346 wb = rotl32 ((w8 ^ w3 ^ wd ^ wb), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wb);
347 wc = rotl32 ((w9 ^ w4 ^ we ^ wc), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wc);
348 wd = rotl32 ((wa ^ w5 ^ wf ^ wd), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd);
349 we = rotl32 ((wb ^ w6 ^ w0 ^ we), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we);
350 wf = rotl32 ((wc ^ w7 ^ w1 ^ wf), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf);
357 #include VECT_COMPARE_M
361 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m04900_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)
365 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m04900_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)
369 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m04900_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 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
375 const u32 lid = get_local_id (0);
381 const u32 gid = get_global_id (0);
383 if (gid >= gid_max) return;
387 pw_buf0[0] = pws[gid].i[ 0];
388 pw_buf0[1] = pws[gid].i[ 1];
389 pw_buf0[2] = pws[gid].i[ 2];
390 pw_buf0[3] = pws[gid].i[ 3];
394 pw_buf1[0] = pws[gid].i[ 4];
395 pw_buf1[1] = pws[gid].i[ 5];
396 pw_buf1[2] = pws[gid].i[ 6];
397 pw_buf1[3] = pws[gid].i[ 7];
399 const u32 pw_len = pws[gid].pw_len;
407 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
408 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
409 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
410 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
414 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
415 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
416 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
417 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
433 const u32 salt_len = salt_bufs[salt_pos].salt_len;
439 const u32 search[4] =
441 digests_buf[digests_offset].digest_buf[DGST_R0],
442 digests_buf[digests_offset].digest_buf[DGST_R1],
443 digests_buf[digests_offset].digest_buf[DGST_R2],
444 digests_buf[digests_offset].digest_buf[DGST_R3]
451 const u32 e_rev = rotl32 (search[1], 2u);
457 for (u32 il_pos = 0; il_pos < rules_cnt; il_pos++)
461 w0_t[0] = pw_buf0[0];
462 w0_t[1] = pw_buf0[1];
463 w0_t[2] = pw_buf0[2];
464 w0_t[3] = pw_buf0[3];
468 w1_t[0] = pw_buf1[0];
469 w1_t[1] = pw_buf1[1];
470 w1_t[2] = pw_buf1[2];
471 w1_t[3] = pw_buf1[3];
487 const u32 out_len = apply_rules (rules_buf[il_pos].cmds, w0_t, w1_t, pw_len);
493 switch_buffer_by_offset (w0_t, w1_t, w2_t, w3_t, salt_len);
495 w0_t[0] |= salt_buf0[0];
496 w0_t[1] |= salt_buf0[1];
497 w0_t[2] |= salt_buf0[2];
498 w0_t[3] |= salt_buf0[3];
499 w1_t[0] |= salt_buf1[0];
500 w1_t[1] |= salt_buf1[1];
501 w1_t[2] |= salt_buf1[2];
502 w1_t[3] |= salt_buf1[3];
503 w2_t[0] |= salt_buf2[0];
504 w2_t[1] |= salt_buf2[1];
505 w2_t[2] |= salt_buf2[2];
506 w2_t[3] |= salt_buf2[3];
507 w3_t[0] |= salt_buf3[0];
508 w3_t[1] |= salt_buf3[1];
509 w3_t[2] |= salt_buf3[2];
510 w3_t[3] |= salt_buf3[3];
518 s0[0] = salt_buf0[0];
519 s0[1] = salt_buf0[1];
520 s0[2] = salt_buf0[2];
521 s0[3] = salt_buf0[3];
525 s1[0] = salt_buf1[0];
526 s1[1] = salt_buf1[1];
527 s1[2] = salt_buf1[2];
528 s1[3] = salt_buf1[3];
544 switch_buffer_by_offset (s0, s1, s2, s3, salt_len + out_len);
563 const u32 pw_salt_len = salt_len + out_len + salt_len;
565 append_0x80_4 (w0_t, w1_t, w2_t, w3_t, pw_salt_len);
567 u32x w0 = swap_workaround (w0_t[0]);
568 u32x w1 = swap_workaround (w0_t[1]);
569 u32x w2 = swap_workaround (w0_t[2]);
570 u32x w3 = swap_workaround (w0_t[3]);
571 u32x w4 = swap_workaround (w1_t[0]);
572 u32x w5 = swap_workaround (w1_t[1]);
573 u32x w6 = swap_workaround (w1_t[2]);
574 u32x w7 = swap_workaround (w1_t[3]);
575 u32x w8 = swap_workaround (w2_t[0]);
576 u32x w9 = swap_workaround (w2_t[1]);
577 u32x wa = swap_workaround (w2_t[2]);
578 u32x wb = swap_workaround (w2_t[3]);
579 u32x wc = swap_workaround (w3_t[0]);
580 u32x wd = swap_workaround (w3_t[1]);
582 u32x wf = pw_salt_len * 8;
597 SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0);
598 SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1);
599 SHA1_STEP (SHA1_F0o, d, e, a, b, c, w2);
600 SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3);
601 SHA1_STEP (SHA1_F0o, b, c, d, e, a, w4);
602 SHA1_STEP (SHA1_F0o, a, b, c, d, e, w5);
603 SHA1_STEP (SHA1_F0o, e, a, b, c, d, w6);
604 SHA1_STEP (SHA1_F0o, d, e, a, b, c, w7);
605 SHA1_STEP (SHA1_F0o, c, d, e, a, b, w8);
606 SHA1_STEP (SHA1_F0o, b, c, d, e, a, w9);
607 SHA1_STEP (SHA1_F0o, a, b, c, d, e, wa);
608 SHA1_STEP (SHA1_F0o, e, a, b, c, d, wb);
609 SHA1_STEP (SHA1_F0o, d, e, a, b, c, wc);
610 SHA1_STEP (SHA1_F0o, c, d, e, a, b, wd);
611 SHA1_STEP (SHA1_F0o, b, c, d, e, a, we);
612 SHA1_STEP (SHA1_F0o, a, b, c, d, e, wf);
613 w0 = rotl32 ((wd ^ w8 ^ w2 ^ w0), 1u); SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0);
614 w1 = rotl32 ((we ^ w9 ^ w3 ^ w1), 1u); SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1);
615 w2 = rotl32 ((wf ^ wa ^ w4 ^ w2), 1u); SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2);
616 w3 = rotl32 ((w0 ^ wb ^ w5 ^ w3), 1u); SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3);
621 w4 = rotl32 ((w1 ^ wc ^ w6 ^ w4), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w4);
622 w5 = rotl32 ((w2 ^ wd ^ w7 ^ w5), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w5);
623 w6 = rotl32 ((w3 ^ we ^ w8 ^ w6), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w6);
624 w7 = rotl32 ((w4 ^ wf ^ w9 ^ w7), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w7);
625 w8 = rotl32 ((w5 ^ w0 ^ wa ^ w8), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w8);
626 w9 = rotl32 ((w6 ^ w1 ^ wb ^ w9), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w9);
627 wa = rotl32 ((w7 ^ w2 ^ wc ^ wa), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wa);
628 wb = rotl32 ((w8 ^ w3 ^ wd ^ wb), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wb);
629 wc = rotl32 ((w9 ^ w4 ^ we ^ wc), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wc);
630 wd = rotl32 ((wa ^ w5 ^ wf ^ wd), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wd);
631 we = rotl32 ((wb ^ w6 ^ w0 ^ we), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, we);
632 wf = rotl32 ((wc ^ w7 ^ w1 ^ wf), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wf);
633 w0 = rotl32 ((wd ^ w8 ^ w2 ^ w0), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0);
634 w1 = rotl32 ((we ^ w9 ^ w3 ^ w1), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1);
635 w2 = rotl32 ((wf ^ wa ^ w4 ^ w2), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2);
636 w3 = rotl32 ((w0 ^ wb ^ w5 ^ w3), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3);
637 w4 = rotl32 ((w1 ^ wc ^ w6 ^ w4), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w4);
638 w5 = rotl32 ((w2 ^ wd ^ w7 ^ w5), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w5);
639 w6 = rotl32 ((w3 ^ we ^ w8 ^ w6), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w6);
640 w7 = rotl32 ((w4 ^ wf ^ w9 ^ w7), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w7);
645 w8 = rotl32 ((w5 ^ w0 ^ wa ^ w8), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w8);
646 w9 = rotl32 ((w6 ^ w1 ^ wb ^ w9), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w9);
647 wa = rotl32 ((w7 ^ w2 ^ wc ^ wa), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wa);
648 wb = rotl32 ((w8 ^ w3 ^ wd ^ wb), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wb);
649 wc = rotl32 ((w9 ^ w4 ^ we ^ wc), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wc);
650 wd = rotl32 ((wa ^ w5 ^ wf ^ wd), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, wd);
651 we = rotl32 ((wb ^ w6 ^ w0 ^ we), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, we);
652 wf = rotl32 ((wc ^ w7 ^ w1 ^ wf), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wf);
653 w0 = rotl32 ((wd ^ w8 ^ w2 ^ w0), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w0);
654 w1 = rotl32 ((we ^ w9 ^ w3 ^ w1), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w1);
655 w2 = rotl32 ((wf ^ wa ^ w4 ^ w2), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w2);
656 w3 = rotl32 ((w0 ^ wb ^ w5 ^ w3), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w3);
657 w4 = rotl32 ((w1 ^ wc ^ w6 ^ w4), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w4);
658 w5 = rotl32 ((w2 ^ wd ^ w7 ^ w5), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w5);
659 w6 = rotl32 ((w3 ^ we ^ w8 ^ w6), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w6);
660 w7 = rotl32 ((w4 ^ wf ^ w9 ^ w7), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w7);
661 w8 = rotl32 ((w5 ^ w0 ^ wa ^ w8), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w8);
662 w9 = rotl32 ((w6 ^ w1 ^ wb ^ w9), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w9);
663 wa = rotl32 ((w7 ^ w2 ^ wc ^ wa), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wa);
664 wb = rotl32 ((w8 ^ w3 ^ wd ^ wb), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wb);
669 wc = rotl32 ((w9 ^ w4 ^ we ^ wc), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wc);
670 wd = rotl32 ((wa ^ w5 ^ wf ^ wd), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wd);
671 we = rotl32 ((wb ^ w6 ^ w0 ^ we), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, we);
672 wf = rotl32 ((wc ^ w7 ^ w1 ^ wf), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wf);
673 w0 = rotl32 ((wd ^ w8 ^ w2 ^ w0), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0);
674 w1 = rotl32 ((we ^ w9 ^ w3 ^ w1), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1);
675 w2 = rotl32 ((wf ^ wa ^ w4 ^ w2), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w2);
676 w3 = rotl32 ((w0 ^ wb ^ w5 ^ w3), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3);
677 w4 = rotl32 ((w1 ^ wc ^ w6 ^ w4), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w4);
678 w5 = rotl32 ((w2 ^ wd ^ w7 ^ w5), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w5);
679 w6 = rotl32 ((w3 ^ we ^ w8 ^ w6), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w6);
680 w7 = rotl32 ((w4 ^ wf ^ w9 ^ w7), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w7);
681 w8 = rotl32 ((w5 ^ w0 ^ wa ^ w8), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w8);
682 w9 = rotl32 ((w6 ^ w1 ^ wb ^ w9), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w9);
683 wa = rotl32 ((w7 ^ w2 ^ wc ^ wa), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wa);
684 wb = rotl32 ((w8 ^ w3 ^ wd ^ wb), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wb);
686 if (allx (e != e_rev)) continue;
688 wc = rotl32 ((w9 ^ w4 ^ we ^ wc), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wc);
689 wd = rotl32 ((wa ^ w5 ^ wf ^ wd), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd);
690 we = rotl32 ((wb ^ w6 ^ w0 ^ we), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we);
691 wf = rotl32 ((wc ^ w7 ^ w1 ^ wf), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf);
698 #include VECT_COMPARE_S
702 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m04900_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)
706 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m04900_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)