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"
48 #define uint_to_hex_lower8(i) l_bin2asc[(i)]
52 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1])
56 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3])
59 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m04400_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)
65 const u32 lid = get_local_id (0);
71 const u32 gid = get_global_id (0);
75 wordl0[0] = pws[gid].i[ 0];
76 wordl0[1] = pws[gid].i[ 1];
77 wordl0[2] = pws[gid].i[ 2];
78 wordl0[3] = pws[gid].i[ 3];
82 wordl1[0] = pws[gid].i[ 4];
83 wordl1[1] = pws[gid].i[ 5];
84 wordl1[2] = pws[gid].i[ 6];
85 wordl1[3] = pws[gid].i[ 7];
101 const u32 pw_l_len = pws[gid].pw_len;
103 if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
105 append_0x80_2 (wordl0, wordl1, pw_l_len);
107 switch_buffer_by_offset (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
114 __local u32 l_bin2asc[256];
116 const u32 lid4 = lid * 4;
118 const u32 lid40 = lid4 + 0;
119 const u32 lid41 = lid4 + 1;
120 const u32 lid42 = lid4 + 2;
121 const u32 lid43 = lid4 + 3;
123 const u32 v400 = (lid40 >> 0) & 15;
124 const u32 v401 = (lid40 >> 4) & 15;
125 const u32 v410 = (lid41 >> 0) & 15;
126 const u32 v411 = (lid41 >> 4) & 15;
127 const u32 v420 = (lid42 >> 0) & 15;
128 const u32 v421 = (lid42 >> 4) & 15;
129 const u32 v430 = (lid43 >> 0) & 15;
130 const u32 v431 = (lid43 >> 4) & 15;
132 l_bin2asc[lid40] = ((v400 < 10) ? '0' + v400 : 'a' - 10 + v400) << 8
133 | ((v401 < 10) ? '0' + v401 : 'a' - 10 + v401) << 0;
134 l_bin2asc[lid41] = ((v410 < 10) ? '0' + v410 : 'a' - 10 + v410) << 8
135 | ((v411 < 10) ? '0' + v411 : 'a' - 10 + v411) << 0;
136 l_bin2asc[lid42] = ((v420 < 10) ? '0' + v420 : 'a' - 10 + v420) << 8
137 | ((v421 < 10) ? '0' + v421 : 'a' - 10 + v421) << 0;
138 l_bin2asc[lid43] = ((v430 < 10) ? '0' + v430 : 'a' - 10 + v430) << 8
139 | ((v431 < 10) ? '0' + v431 : 'a' - 10 + v431) << 0;
141 barrier (CLK_LOCAL_MEM_FENCE);
143 if (gid >= gid_max) return;
149 for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
151 const u32 pw_r_len = combs_buf[il_pos].pw_len;
153 const u32 pw_len = pw_l_len + pw_r_len;
157 wordr0[0] = combs_buf[il_pos].i[0];
158 wordr0[1] = combs_buf[il_pos].i[1];
159 wordr0[2] = combs_buf[il_pos].i[2];
160 wordr0[3] = combs_buf[il_pos].i[3];
164 wordr1[0] = combs_buf[il_pos].i[4];
165 wordr1[1] = combs_buf[il_pos].i[5];
166 wordr1[2] = combs_buf[il_pos].i[6];
167 wordr1[3] = combs_buf[il_pos].i[7];
183 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
185 append_0x80_2 (wordr0, wordr1, pw_r_len);
187 switch_buffer_by_offset (wordr0, wordr1, wordr2, wordr3, pw_l_len);
192 w0[0] = wordl0[0] | wordr0[0];
193 w0[1] = wordl0[1] | wordr0[1];
194 w0[2] = wordl0[2] | wordr0[2];
195 w0[3] = wordl0[3] | wordr0[3];
199 w1[0] = wordl1[0] | wordr1[0];
200 w1[1] = wordl1[1] | wordr1[1];
201 w1[2] = wordl1[2] | wordr1[2];
202 w1[3] = wordl1[3] | wordr1[3];
206 w2[0] = wordl2[0] | wordr2[0];
207 w2[1] = wordl2[1] | wordr2[1];
208 w2[2] = wordl2[2] | wordr2[2];
209 w2[3] = wordl2[3] | wordr2[3];
213 w3[0] = wordl3[0] | wordr3[0];
214 w3[1] = wordl3[1] | wordr3[1];
222 u32x w0_t = swap_workaround (w0[0]);
223 u32x w1_t = swap_workaround (w0[1]);
224 u32x w2_t = swap_workaround (w0[2]);
225 u32x w3_t = swap_workaround (w0[3]);
226 u32x w4_t = swap_workaround (w1[0]);
227 u32x w5_t = swap_workaround (w1[1]);
228 u32x w6_t = swap_workaround (w1[2]);
229 u32x w7_t = swap_workaround (w1[3]);
230 u32x w8_t = swap_workaround (w2[0]);
231 u32x w9_t = swap_workaround (w2[1]);
232 u32x wa_t = swap_workaround (w2[2]);
233 u32x wb_t = swap_workaround (w2[3]);
234 u32x wc_t = swap_workaround (w3[0]);
235 u32x wd_t = swap_workaround (w3[1]);
237 u32x wf_t = pw_len * 8;
248 SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0_t);
249 SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1_t);
250 SHA1_STEP (SHA1_F0o, d, e, a, b, c, w2_t);
251 SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3_t);
252 SHA1_STEP (SHA1_F0o, b, c, d, e, a, w4_t);
253 SHA1_STEP (SHA1_F0o, a, b, c, d, e, w5_t);
254 SHA1_STEP (SHA1_F0o, e, a, b, c, d, w6_t);
255 SHA1_STEP (SHA1_F0o, d, e, a, b, c, w7_t);
256 SHA1_STEP (SHA1_F0o, c, d, e, a, b, w8_t);
257 SHA1_STEP (SHA1_F0o, b, c, d, e, a, w9_t);
258 SHA1_STEP (SHA1_F0o, a, b, c, d, e, wa_t);
259 SHA1_STEP (SHA1_F0o, e, a, b, c, d, wb_t);
260 SHA1_STEP (SHA1_F0o, d, e, a, b, c, wc_t);
261 SHA1_STEP (SHA1_F0o, c, d, e, a, b, wd_t);
262 SHA1_STEP (SHA1_F0o, b, c, d, e, a, we_t);
263 SHA1_STEP (SHA1_F0o, a, b, c, d, e, wf_t);
264 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t);
265 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1_t);
266 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2_t);
267 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3_t);
272 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w4_t);
273 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w5_t);
274 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w6_t);
275 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w7_t);
276 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w8_t);
277 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w9_t);
278 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wa_t);
279 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wb_t);
280 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wc_t);
281 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wd_t);
282 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, we_t);
283 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wf_t);
284 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0_t);
285 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t);
286 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t);
287 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3_t);
288 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w4_t);
289 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w5_t);
290 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w6_t);
291 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w7_t);
296 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w8_t);
297 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w9_t);
298 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wa_t);
299 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wb_t);
300 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wc_t);
301 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, wd_t);
302 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, we_t);
303 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wf_t);
304 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w0_t);
305 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w1_t);
306 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w2_t);
307 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w3_t);
308 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w4_t);
309 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w5_t);
310 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w6_t);
311 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w7_t);
312 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w8_t);
313 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w9_t);
314 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wa_t);
315 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wb_t);
320 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wc_t);
321 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wd_t);
322 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, we_t);
323 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wf_t);
324 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0_t);
325 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1_t);
326 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w2_t);
327 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t);
328 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w4_t);
329 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w5_t);
330 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w6_t);
331 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w7_t);
332 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w8_t);
333 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w9_t);
334 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wa_t);
335 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wb_t);
336 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wc_t);
337 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd_t);
338 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we_t);
339 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf_t);
351 w0_t = uint_to_hex_lower8 ((a >> 24) & 255) << 0
352 | uint_to_hex_lower8 ((a >> 16) & 255) << 16;
353 w1_t = uint_to_hex_lower8 ((a >> 8) & 255) << 0
354 | uint_to_hex_lower8 ((a >> 0) & 255) << 16;
355 w2_t = uint_to_hex_lower8 ((b >> 24) & 255) << 0
356 | uint_to_hex_lower8 ((b >> 16) & 255) << 16;
357 w3_t = uint_to_hex_lower8 ((b >> 8) & 255) << 0
358 | uint_to_hex_lower8 ((b >> 0) & 255) << 16;
359 w4_t = uint_to_hex_lower8 ((c >> 24) & 255) << 0
360 | uint_to_hex_lower8 ((c >> 16) & 255) << 16;
361 w5_t = uint_to_hex_lower8 ((c >> 8) & 255) << 0
362 | uint_to_hex_lower8 ((c >> 0) & 255) << 16;
363 w6_t = uint_to_hex_lower8 ((d >> 24) & 255) << 0
364 | uint_to_hex_lower8 ((d >> 16) & 255) << 16;
365 w7_t = uint_to_hex_lower8 ((d >> 8) & 255) << 0
366 | uint_to_hex_lower8 ((d >> 0) & 255) << 16;
367 w8_t = uint_to_hex_lower8 ((e >> 24) & 255) << 0
368 | uint_to_hex_lower8 ((e >> 16) & 255) << 16;
369 w9_t = uint_to_hex_lower8 ((e >> 8) & 255) << 0
370 | uint_to_hex_lower8 ((e >> 0) & 255) << 16;
384 MD5_STEP (MD5_Fo, a, b, c, d, w0_t, MD5C00, MD5S00);
385 MD5_STEP (MD5_Fo, d, a, b, c, w1_t, MD5C01, MD5S01);
386 MD5_STEP (MD5_Fo, c, d, a, b, w2_t, MD5C02, MD5S02);
387 MD5_STEP (MD5_Fo, b, c, d, a, w3_t, MD5C03, MD5S03);
388 MD5_STEP (MD5_Fo, a, b, c, d, w4_t, MD5C04, MD5S00);
389 MD5_STEP (MD5_Fo, d, a, b, c, w5_t, MD5C05, MD5S01);
390 MD5_STEP (MD5_Fo, c, d, a, b, w6_t, MD5C06, MD5S02);
391 MD5_STEP (MD5_Fo, b, c, d, a, w7_t, MD5C07, MD5S03);
392 MD5_STEP (MD5_Fo, a, b, c, d, w8_t, MD5C08, MD5S00);
393 MD5_STEP (MD5_Fo, d, a, b, c, w9_t, MD5C09, MD5S01);
394 MD5_STEP (MD5_Fo, c, d, a, b, wa_t, MD5C0a, MD5S02);
395 MD5_STEP (MD5_Fo, b, c, d, a, wb_t, MD5C0b, MD5S03);
396 MD5_STEP (MD5_Fo, a, b, c, d, wc_t, MD5C0c, MD5S00);
397 MD5_STEP (MD5_Fo, d, a, b, c, wd_t, MD5C0d, MD5S01);
398 MD5_STEP (MD5_Fo, c, d, a, b, we_t, MD5C0e, MD5S02);
399 MD5_STEP (MD5_Fo, b, c, d, a, wf_t, MD5C0f, MD5S03);
401 MD5_STEP (MD5_Go, a, b, c, d, w1_t, MD5C10, MD5S10);
402 MD5_STEP (MD5_Go, d, a, b, c, w6_t, MD5C11, MD5S11);
403 MD5_STEP (MD5_Go, c, d, a, b, wb_t, MD5C12, MD5S12);
404 MD5_STEP (MD5_Go, b, c, d, a, w0_t, MD5C13, MD5S13);
405 MD5_STEP (MD5_Go, a, b, c, d, w5_t, MD5C14, MD5S10);
406 MD5_STEP (MD5_Go, d, a, b, c, wa_t, MD5C15, MD5S11);
407 MD5_STEP (MD5_Go, c, d, a, b, wf_t, MD5C16, MD5S12);
408 MD5_STEP (MD5_Go, b, c, d, a, w4_t, MD5C17, MD5S13);
409 MD5_STEP (MD5_Go, a, b, c, d, w9_t, MD5C18, MD5S10);
410 MD5_STEP (MD5_Go, d, a, b, c, we_t, MD5C19, MD5S11);
411 MD5_STEP (MD5_Go, c, d, a, b, w3_t, MD5C1a, MD5S12);
412 MD5_STEP (MD5_Go, b, c, d, a, w8_t, MD5C1b, MD5S13);
413 MD5_STEP (MD5_Go, a, b, c, d, wd_t, MD5C1c, MD5S10);
414 MD5_STEP (MD5_Go, d, a, b, c, w2_t, MD5C1d, MD5S11);
415 MD5_STEP (MD5_Go, c, d, a, b, w7_t, MD5C1e, MD5S12);
416 MD5_STEP (MD5_Go, b, c, d, a, wc_t, MD5C1f, MD5S13);
418 MD5_STEP (MD5_H , a, b, c, d, w5_t, MD5C20, MD5S20);
419 MD5_STEP (MD5_H , d, a, b, c, w8_t, MD5C21, MD5S21);
420 MD5_STEP (MD5_H , c, d, a, b, wb_t, MD5C22, MD5S22);
421 MD5_STEP (MD5_H , b, c, d, a, we_t, MD5C23, MD5S23);
422 MD5_STEP (MD5_H , a, b, c, d, w1_t, MD5C24, MD5S20);
423 MD5_STEP (MD5_H , d, a, b, c, w4_t, MD5C25, MD5S21);
424 MD5_STEP (MD5_H , c, d, a, b, w7_t, MD5C26, MD5S22);
425 MD5_STEP (MD5_H , b, c, d, a, wa_t, MD5C27, MD5S23);
426 MD5_STEP (MD5_H , a, b, c, d, wd_t, MD5C28, MD5S20);
427 MD5_STEP (MD5_H , d, a, b, c, w0_t, MD5C29, MD5S21);
428 MD5_STEP (MD5_H , c, d, a, b, w3_t, MD5C2a, MD5S22);
429 MD5_STEP (MD5_H , b, c, d, a, w6_t, MD5C2b, MD5S23);
430 MD5_STEP (MD5_H , a, b, c, d, w9_t, MD5C2c, MD5S20);
431 MD5_STEP (MD5_H , d, a, b, c, wc_t, MD5C2d, MD5S21);
432 MD5_STEP (MD5_H , c, d, a, b, wf_t, MD5C2e, MD5S22);
433 MD5_STEP (MD5_H , b, c, d, a, w2_t, MD5C2f, MD5S23);
435 MD5_STEP (MD5_I , a, b, c, d, w0_t, MD5C30, MD5S30);
436 MD5_STEP (MD5_I , d, a, b, c, w7_t, MD5C31, MD5S31);
437 MD5_STEP (MD5_I , c, d, a, b, we_t, MD5C32, MD5S32);
438 MD5_STEP (MD5_I , b, c, d, a, w5_t, MD5C33, MD5S33);
439 MD5_STEP (MD5_I , a, b, c, d, wc_t, MD5C34, MD5S30);
440 MD5_STEP (MD5_I , d, a, b, c, w3_t, MD5C35, MD5S31);
441 MD5_STEP (MD5_I , c, d, a, b, wa_t, MD5C36, MD5S32);
442 MD5_STEP (MD5_I , b, c, d, a, w1_t, MD5C37, MD5S33);
443 MD5_STEP (MD5_I , a, b, c, d, w8_t, MD5C38, MD5S30);
444 MD5_STEP (MD5_I , d, a, b, c, wf_t, MD5C39, MD5S31);
445 MD5_STEP (MD5_I , c, d, a, b, w6_t, MD5C3a, MD5S32);
446 MD5_STEP (MD5_I , b, c, d, a, wd_t, MD5C3b, MD5S33);
447 MD5_STEP (MD5_I , a, b, c, d, w4_t, MD5C3c, MD5S30);
448 MD5_STEP (MD5_I , d, a, b, c, wb_t, MD5C3d, MD5S31);
449 MD5_STEP (MD5_I , c, d, a, b, w2_t, MD5C3e, MD5S32);
450 MD5_STEP (MD5_I , b, c, d, a, w9_t, MD5C3f, MD5S33);
457 #include VECT_COMPARE_M
461 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m04400_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)
465 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m04400_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)
469 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m04400_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)
475 const u32 lid = get_local_id (0);
481 const u32 gid = get_global_id (0);
485 wordl0[0] = pws[gid].i[ 0];
486 wordl0[1] = pws[gid].i[ 1];
487 wordl0[2] = pws[gid].i[ 2];
488 wordl0[3] = pws[gid].i[ 3];
492 wordl1[0] = pws[gid].i[ 4];
493 wordl1[1] = pws[gid].i[ 5];
494 wordl1[2] = pws[gid].i[ 6];
495 wordl1[3] = pws[gid].i[ 7];
511 const u32 pw_l_len = pws[gid].pw_len;
513 if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
515 append_0x80_2 (wordl0, wordl1, pw_l_len);
517 switch_buffer_by_offset (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
524 __local u32 l_bin2asc[256];
526 const u32 lid4 = lid * 4;
528 const u32 lid40 = lid4 + 0;
529 const u32 lid41 = lid4 + 1;
530 const u32 lid42 = lid4 + 2;
531 const u32 lid43 = lid4 + 3;
533 const u32 v400 = (lid40 >> 0) & 15;
534 const u32 v401 = (lid40 >> 4) & 15;
535 const u32 v410 = (lid41 >> 0) & 15;
536 const u32 v411 = (lid41 >> 4) & 15;
537 const u32 v420 = (lid42 >> 0) & 15;
538 const u32 v421 = (lid42 >> 4) & 15;
539 const u32 v430 = (lid43 >> 0) & 15;
540 const u32 v431 = (lid43 >> 4) & 15;
542 l_bin2asc[lid40] = ((v400 < 10) ? '0' + v400 : 'a' - 10 + v400) << 8
543 | ((v401 < 10) ? '0' + v401 : 'a' - 10 + v401) << 0;
544 l_bin2asc[lid41] = ((v410 < 10) ? '0' + v410 : 'a' - 10 + v410) << 8
545 | ((v411 < 10) ? '0' + v411 : 'a' - 10 + v411) << 0;
546 l_bin2asc[lid42] = ((v420 < 10) ? '0' + v420 : 'a' - 10 + v420) << 8
547 | ((v421 < 10) ? '0' + v421 : 'a' - 10 + v421) << 0;
548 l_bin2asc[lid43] = ((v430 < 10) ? '0' + v430 : 'a' - 10 + v430) << 8
549 | ((v431 < 10) ? '0' + v431 : 'a' - 10 + v431) << 0;
551 barrier (CLK_LOCAL_MEM_FENCE);
553 if (gid >= gid_max) return;
559 const u32 search[4] =
561 digests_buf[digests_offset].digest_buf[DGST_R0],
562 digests_buf[digests_offset].digest_buf[DGST_R1],
563 digests_buf[digests_offset].digest_buf[DGST_R2],
564 digests_buf[digests_offset].digest_buf[DGST_R3]
571 for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
573 const u32 pw_r_len = combs_buf[il_pos].pw_len;
575 const u32 pw_len = pw_l_len + pw_r_len;
579 wordr0[0] = combs_buf[il_pos].i[0];
580 wordr0[1] = combs_buf[il_pos].i[1];
581 wordr0[2] = combs_buf[il_pos].i[2];
582 wordr0[3] = combs_buf[il_pos].i[3];
586 wordr1[0] = combs_buf[il_pos].i[4];
587 wordr1[1] = combs_buf[il_pos].i[5];
588 wordr1[2] = combs_buf[il_pos].i[6];
589 wordr1[3] = combs_buf[il_pos].i[7];
605 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
607 append_0x80_2 (wordr0, wordr1, pw_r_len);
609 switch_buffer_by_offset (wordr0, wordr1, wordr2, wordr3, pw_l_len);
614 w0[0] = wordl0[0] | wordr0[0];
615 w0[1] = wordl0[1] | wordr0[1];
616 w0[2] = wordl0[2] | wordr0[2];
617 w0[3] = wordl0[3] | wordr0[3];
621 w1[0] = wordl1[0] | wordr1[0];
622 w1[1] = wordl1[1] | wordr1[1];
623 w1[2] = wordl1[2] | wordr1[2];
624 w1[3] = wordl1[3] | wordr1[3];
628 w2[0] = wordl2[0] | wordr2[0];
629 w2[1] = wordl2[1] | wordr2[1];
630 w2[2] = wordl2[2] | wordr2[2];
631 w2[3] = wordl2[3] | wordr2[3];
635 w3[0] = wordl3[0] | wordr3[0];
636 w3[1] = wordl3[1] | wordr3[1];
644 u32x w0_t = swap_workaround (w0[0]);
645 u32x w1_t = swap_workaround (w0[1]);
646 u32x w2_t = swap_workaround (w0[2]);
647 u32x w3_t = swap_workaround (w0[3]);
648 u32x w4_t = swap_workaround (w1[0]);
649 u32x w5_t = swap_workaround (w1[1]);
650 u32x w6_t = swap_workaround (w1[2]);
651 u32x w7_t = swap_workaround (w1[3]);
652 u32x w8_t = swap_workaround (w2[0]);
653 u32x w9_t = swap_workaround (w2[1]);
654 u32x wa_t = swap_workaround (w2[2]);
655 u32x wb_t = swap_workaround (w2[3]);
656 u32x wc_t = swap_workaround (w3[0]);
657 u32x wd_t = swap_workaround (w3[1]);
659 u32x wf_t = pw_len * 8;
670 SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0_t);
671 SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1_t);
672 SHA1_STEP (SHA1_F0o, d, e, a, b, c, w2_t);
673 SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3_t);
674 SHA1_STEP (SHA1_F0o, b, c, d, e, a, w4_t);
675 SHA1_STEP (SHA1_F0o, a, b, c, d, e, w5_t);
676 SHA1_STEP (SHA1_F0o, e, a, b, c, d, w6_t);
677 SHA1_STEP (SHA1_F0o, d, e, a, b, c, w7_t);
678 SHA1_STEP (SHA1_F0o, c, d, e, a, b, w8_t);
679 SHA1_STEP (SHA1_F0o, b, c, d, e, a, w9_t);
680 SHA1_STEP (SHA1_F0o, a, b, c, d, e, wa_t);
681 SHA1_STEP (SHA1_F0o, e, a, b, c, d, wb_t);
682 SHA1_STEP (SHA1_F0o, d, e, a, b, c, wc_t);
683 SHA1_STEP (SHA1_F0o, c, d, e, a, b, wd_t);
684 SHA1_STEP (SHA1_F0o, b, c, d, e, a, we_t);
685 SHA1_STEP (SHA1_F0o, a, b, c, d, e, wf_t);
686 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t);
687 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1_t);
688 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2_t);
689 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3_t);
694 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w4_t);
695 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w5_t);
696 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w6_t);
697 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w7_t);
698 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w8_t);
699 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w9_t);
700 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wa_t);
701 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wb_t);
702 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wc_t);
703 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wd_t);
704 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, we_t);
705 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wf_t);
706 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0_t);
707 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t);
708 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t);
709 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3_t);
710 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w4_t);
711 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w5_t);
712 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w6_t);
713 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w7_t);
718 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w8_t);
719 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w9_t);
720 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wa_t);
721 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wb_t);
722 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wc_t);
723 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, wd_t);
724 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, we_t);
725 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wf_t);
726 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w0_t);
727 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w1_t);
728 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w2_t);
729 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w3_t);
730 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w4_t);
731 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w5_t);
732 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w6_t);
733 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w7_t);
734 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w8_t);
735 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w9_t);
736 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wa_t);
737 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wb_t);
742 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wc_t);
743 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wd_t);
744 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, we_t);
745 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wf_t);
746 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0_t);
747 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1_t);
748 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w2_t);
749 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t);
750 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w4_t);
751 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w5_t);
752 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w6_t);
753 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w7_t);
754 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w8_t);
755 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w9_t);
756 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wa_t);
757 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wb_t);
758 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wc_t);
759 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd_t);
760 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we_t);
761 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf_t);
773 w0_t = uint_to_hex_lower8 ((a >> 24) & 255) << 0
774 | uint_to_hex_lower8 ((a >> 16) & 255) << 16;
775 w1_t = uint_to_hex_lower8 ((a >> 8) & 255) << 0
776 | uint_to_hex_lower8 ((a >> 0) & 255) << 16;
777 w2_t = uint_to_hex_lower8 ((b >> 24) & 255) << 0
778 | uint_to_hex_lower8 ((b >> 16) & 255) << 16;
779 w3_t = uint_to_hex_lower8 ((b >> 8) & 255) << 0
780 | uint_to_hex_lower8 ((b >> 0) & 255) << 16;
781 w4_t = uint_to_hex_lower8 ((c >> 24) & 255) << 0
782 | uint_to_hex_lower8 ((c >> 16) & 255) << 16;
783 w5_t = uint_to_hex_lower8 ((c >> 8) & 255) << 0
784 | uint_to_hex_lower8 ((c >> 0) & 255) << 16;
785 w6_t = uint_to_hex_lower8 ((d >> 24) & 255) << 0
786 | uint_to_hex_lower8 ((d >> 16) & 255) << 16;
787 w7_t = uint_to_hex_lower8 ((d >> 8) & 255) << 0
788 | uint_to_hex_lower8 ((d >> 0) & 255) << 16;
789 w8_t = uint_to_hex_lower8 ((e >> 24) & 255) << 0
790 | uint_to_hex_lower8 ((e >> 16) & 255) << 16;
791 w9_t = uint_to_hex_lower8 ((e >> 8) & 255) << 0
792 | uint_to_hex_lower8 ((e >> 0) & 255) << 16;
806 MD5_STEP (MD5_Fo, a, b, c, d, w0_t, MD5C00, MD5S00);
807 MD5_STEP (MD5_Fo, d, a, b, c, w1_t, MD5C01, MD5S01);
808 MD5_STEP (MD5_Fo, c, d, a, b, w2_t, MD5C02, MD5S02);
809 MD5_STEP (MD5_Fo, b, c, d, a, w3_t, MD5C03, MD5S03);
810 MD5_STEP (MD5_Fo, a, b, c, d, w4_t, MD5C04, MD5S00);
811 MD5_STEP (MD5_Fo, d, a, b, c, w5_t, MD5C05, MD5S01);
812 MD5_STEP (MD5_Fo, c, d, a, b, w6_t, MD5C06, MD5S02);
813 MD5_STEP (MD5_Fo, b, c, d, a, w7_t, MD5C07, MD5S03);
814 MD5_STEP (MD5_Fo, a, b, c, d, w8_t, MD5C08, MD5S00);
815 MD5_STEP (MD5_Fo, d, a, b, c, w9_t, MD5C09, MD5S01);
816 MD5_STEP (MD5_Fo, c, d, a, b, wa_t, MD5C0a, MD5S02);
817 MD5_STEP (MD5_Fo, b, c, d, a, wb_t, MD5C0b, MD5S03);
818 MD5_STEP (MD5_Fo, a, b, c, d, wc_t, MD5C0c, MD5S00);
819 MD5_STEP (MD5_Fo, d, a, b, c, wd_t, MD5C0d, MD5S01);
820 MD5_STEP (MD5_Fo, c, d, a, b, we_t, MD5C0e, MD5S02);
821 MD5_STEP (MD5_Fo, b, c, d, a, wf_t, MD5C0f, MD5S03);
823 MD5_STEP (MD5_Go, a, b, c, d, w1_t, MD5C10, MD5S10);
824 MD5_STEP (MD5_Go, d, a, b, c, w6_t, MD5C11, MD5S11);
825 MD5_STEP (MD5_Go, c, d, a, b, wb_t, MD5C12, MD5S12);
826 MD5_STEP (MD5_Go, b, c, d, a, w0_t, MD5C13, MD5S13);
827 MD5_STEP (MD5_Go, a, b, c, d, w5_t, MD5C14, MD5S10);
828 MD5_STEP (MD5_Go, d, a, b, c, wa_t, MD5C15, MD5S11);
829 MD5_STEP (MD5_Go, c, d, a, b, wf_t, MD5C16, MD5S12);
830 MD5_STEP (MD5_Go, b, c, d, a, w4_t, MD5C17, MD5S13);
831 MD5_STEP (MD5_Go, a, b, c, d, w9_t, MD5C18, MD5S10);
832 MD5_STEP (MD5_Go, d, a, b, c, we_t, MD5C19, MD5S11);
833 MD5_STEP (MD5_Go, c, d, a, b, w3_t, MD5C1a, MD5S12);
834 MD5_STEP (MD5_Go, b, c, d, a, w8_t, MD5C1b, MD5S13);
835 MD5_STEP (MD5_Go, a, b, c, d, wd_t, MD5C1c, MD5S10);
836 MD5_STEP (MD5_Go, d, a, b, c, w2_t, MD5C1d, MD5S11);
837 MD5_STEP (MD5_Go, c, d, a, b, w7_t, MD5C1e, MD5S12);
838 MD5_STEP (MD5_Go, b, c, d, a, wc_t, MD5C1f, MD5S13);
840 MD5_STEP (MD5_H , a, b, c, d, w5_t, MD5C20, MD5S20);
841 MD5_STEP (MD5_H , d, a, b, c, w8_t, MD5C21, MD5S21);
842 MD5_STEP (MD5_H , c, d, a, b, wb_t, MD5C22, MD5S22);
843 MD5_STEP (MD5_H , b, c, d, a, we_t, MD5C23, MD5S23);
844 MD5_STEP (MD5_H , a, b, c, d, w1_t, MD5C24, MD5S20);
845 MD5_STEP (MD5_H , d, a, b, c, w4_t, MD5C25, MD5S21);
846 MD5_STEP (MD5_H , c, d, a, b, w7_t, MD5C26, MD5S22);
847 MD5_STEP (MD5_H , b, c, d, a, wa_t, MD5C27, MD5S23);
848 MD5_STEP (MD5_H , a, b, c, d, wd_t, MD5C28, MD5S20);
849 MD5_STEP (MD5_H , d, a, b, c, w0_t, MD5C29, MD5S21);
850 MD5_STEP (MD5_H , c, d, a, b, w3_t, MD5C2a, MD5S22);
851 MD5_STEP (MD5_H , b, c, d, a, w6_t, MD5C2b, MD5S23);
852 MD5_STEP (MD5_H , a, b, c, d, w9_t, MD5C2c, MD5S20);
853 MD5_STEP (MD5_H , d, a, b, c, wc_t, MD5C2d, MD5S21);
854 MD5_STEP (MD5_H , c, d, a, b, wf_t, MD5C2e, MD5S22);
855 MD5_STEP (MD5_H , b, c, d, a, w2_t, MD5C2f, MD5S23);
857 MD5_STEP (MD5_I , a, b, c, d, w0_t, MD5C30, MD5S30);
858 MD5_STEP (MD5_I , d, a, b, c, w7_t, MD5C31, MD5S31);
859 MD5_STEP (MD5_I , c, d, a, b, we_t, MD5C32, MD5S32);
860 MD5_STEP (MD5_I , b, c, d, a, w5_t, MD5C33, MD5S33);
861 MD5_STEP (MD5_I , a, b, c, d, wc_t, MD5C34, MD5S30);
862 MD5_STEP (MD5_I , d, a, b, c, w3_t, MD5C35, MD5S31);
863 MD5_STEP (MD5_I , c, d, a, b, wa_t, MD5C36, MD5S32);
864 MD5_STEP (MD5_I , b, c, d, a, w1_t, MD5C37, MD5S33);
865 MD5_STEP (MD5_I , a, b, c, d, w8_t, MD5C38, MD5S30);
866 MD5_STEP (MD5_I , d, a, b, c, wf_t, MD5C39, MD5S31);
867 MD5_STEP (MD5_I , c, d, a, b, w6_t, MD5C3a, MD5S32);
868 MD5_STEP (MD5_I , b, c, d, a, wd_t, MD5C3b, MD5S33);
869 MD5_STEP (MD5_I , a, b, c, d, w4_t, MD5C3c, MD5S30);
870 MD5_STEP (MD5_I , d, a, b, c, wb_t, MD5C3d, MD5S31);
871 MD5_STEP (MD5_I , c, d, a, b, w2_t, MD5C3e, MD5S32);
872 MD5_STEP (MD5_I , b, c, d, a, w9_t, MD5C3f, MD5S33);
879 #include VECT_COMPARE_S
883 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m04400_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)
887 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m04400_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)