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))) m02810_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);
116 s[0] = salt_bufs[salt_pos].salt_buf_pc[0];
117 s[1] = salt_bufs[salt_pos].salt_buf_pc[1];
118 s[2] = salt_bufs[salt_pos].salt_buf_pc[2];
119 s[3] = salt_bufs[salt_pos].salt_buf_pc[3];
120 s[4] = salt_bufs[salt_pos].salt_buf_pc[4];
121 s[5] = salt_bufs[salt_pos].salt_buf_pc[5];
122 s[6] = salt_bufs[salt_pos].salt_buf_pc[6];
123 s[7] = salt_bufs[salt_pos].salt_buf_pc[7];
125 const u32 r_00 = 0x80;
126 const u32 r_14 = 64 * 8;
132 __local u32 l_bin2asc[256];
134 const u32 lid4 = lid * 4;
136 const u32 lid40 = lid4 + 0;
137 const u32 lid41 = lid4 + 1;
138 const u32 lid42 = lid4 + 2;
139 const u32 lid43 = lid4 + 3;
141 const u32 v400 = (lid40 >> 0) & 15;
142 const u32 v401 = (lid40 >> 4) & 15;
143 const u32 v410 = (lid41 >> 0) & 15;
144 const u32 v411 = (lid41 >> 4) & 15;
145 const u32 v420 = (lid42 >> 0) & 15;
146 const u32 v421 = (lid42 >> 4) & 15;
147 const u32 v430 = (lid43 >> 0) & 15;
148 const u32 v431 = (lid43 >> 4) & 15;
150 l_bin2asc[lid40] = ((v400 < 10) ? '0' + v400 : 'a' - 10 + v400) << 8
151 | ((v401 < 10) ? '0' + v401 : 'a' - 10 + v401) << 0;
152 l_bin2asc[lid41] = ((v410 < 10) ? '0' + v410 : 'a' - 10 + v410) << 8
153 | ((v411 < 10) ? '0' + v411 : 'a' - 10 + v411) << 0;
154 l_bin2asc[lid42] = ((v420 < 10) ? '0' + v420 : 'a' - 10 + v420) << 8
155 | ((v421 < 10) ? '0' + v421 : 'a' - 10 + v421) << 0;
156 l_bin2asc[lid43] = ((v430 < 10) ? '0' + v430 : 'a' - 10 + v430) << 8
157 | ((v431 < 10) ? '0' + v431 : 'a' - 10 + v431) << 0;
159 barrier (CLK_LOCAL_MEM_FENCE);
161 if (gid >= gid_max) return;
167 for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
169 const u32 pw_r_len = combs_buf[il_pos].pw_len;
171 const u32 pw_len = pw_l_len + pw_r_len;
175 wordr0[0] = combs_buf[il_pos].i[0];
176 wordr0[1] = combs_buf[il_pos].i[1];
177 wordr0[2] = combs_buf[il_pos].i[2];
178 wordr0[3] = combs_buf[il_pos].i[3];
182 wordr1[0] = combs_buf[il_pos].i[4];
183 wordr1[1] = combs_buf[il_pos].i[5];
184 wordr1[2] = combs_buf[il_pos].i[6];
185 wordr1[3] = combs_buf[il_pos].i[7];
201 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
203 switch_buffer_by_offset (wordr0, wordr1, wordr2, wordr3, pw_l_len);
208 w0[0] = wordl0[0] | wordr0[0];
209 w0[1] = wordl0[1] | wordr0[1];
210 w0[2] = wordl0[2] | wordr0[2];
211 w0[3] = wordl0[3] | wordr0[3];
215 w1[0] = wordl1[0] | wordr1[0];
216 w1[1] = wordl1[1] | wordr1[1];
217 w1[2] = wordl1[2] | wordr1[2];
218 w1[3] = wordl1[3] | wordr1[3];
222 w2[0] = wordl2[0] | wordr2[0];
223 w2[1] = wordl2[1] | wordr2[1];
224 w2[2] = wordl2[2] | wordr2[2];
225 w2[3] = wordl2[3] | wordr2[3];
229 w3[0] = wordl3[0] | wordr3[0];
230 w3[1] = wordl3[1] | wordr3[1];
239 MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
240 MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
241 MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
242 MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
243 MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
244 MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
245 MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
246 MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
247 MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
248 MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
249 MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
250 MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
251 MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
252 MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
253 MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
254 MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
256 MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
257 MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
258 MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
259 MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
260 MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
261 MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
262 MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
263 MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
264 MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
265 MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
266 MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
267 MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
268 MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
269 MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
270 MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
271 MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
273 MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
274 MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
275 MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
276 MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
277 MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
278 MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
279 MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
280 MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
281 MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
282 MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
283 MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
284 MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
285 MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
286 MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
287 MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
288 MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
290 MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
291 MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
292 MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
293 MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
294 MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
295 MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
296 MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
297 MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
298 MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
299 MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
300 MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
301 MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
302 MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
303 MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
304 MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
305 MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
312 const u32 w0_t = s[0];
313 const u32 w1_t = s[1];
314 const u32 w2_t = s[2];
315 const u32 w3_t = s[3];
316 const u32 w4_t = s[4];
317 const u32 w5_t = s[5];
318 const u32 w6_t = s[6];
319 const u32 w7_t = s[7];
321 const u32x w8_t = uint_to_hex_lower8 ((a >> 0) & 255) << 0
322 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
323 const u32x w9_t = uint_to_hex_lower8 ((a >> 16) & 255) << 0
324 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
325 const u32x wa_t = uint_to_hex_lower8 ((b >> 0) & 255) << 0
326 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
327 const u32x wb_t = uint_to_hex_lower8 ((b >> 16) & 255) << 0
328 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
329 const u32x wc_t = uint_to_hex_lower8 ((c >> 0) & 255) << 0
330 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
331 const u32x wd_t = uint_to_hex_lower8 ((c >> 16) & 255) << 0
332 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
333 const u32x we_t = uint_to_hex_lower8 ((d >> 0) & 255) << 0
334 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
335 const u32x wf_t = uint_to_hex_lower8 ((d >> 16) & 255) << 0
336 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
343 MD5_STEP (MD5_Fo, a, b, c, d, w0_t, MD5C00, MD5S00);
344 MD5_STEP (MD5_Fo, d, a, b, c, w1_t, MD5C01, MD5S01);
345 MD5_STEP (MD5_Fo, c, d, a, b, w2_t, MD5C02, MD5S02);
346 MD5_STEP (MD5_Fo, b, c, d, a, w3_t, MD5C03, MD5S03);
347 MD5_STEP (MD5_Fo, a, b, c, d, w4_t, MD5C04, MD5S00);
348 MD5_STEP (MD5_Fo, d, a, b, c, w5_t, MD5C05, MD5S01);
349 MD5_STEP (MD5_Fo, c, d, a, b, w6_t, MD5C06, MD5S02);
350 MD5_STEP (MD5_Fo, b, c, d, a, w7_t, MD5C07, MD5S03);
351 MD5_STEP (MD5_Fo, a, b, c, d, w8_t, MD5C08, MD5S00);
352 MD5_STEP (MD5_Fo, d, a, b, c, w9_t, MD5C09, MD5S01);
353 MD5_STEP (MD5_Fo, c, d, a, b, wa_t, MD5C0a, MD5S02);
354 MD5_STEP (MD5_Fo, b, c, d, a, wb_t, MD5C0b, MD5S03);
355 MD5_STEP (MD5_Fo, a, b, c, d, wc_t, MD5C0c, MD5S00);
356 MD5_STEP (MD5_Fo, d, a, b, c, wd_t, MD5C0d, MD5S01);
357 MD5_STEP (MD5_Fo, c, d, a, b, we_t, MD5C0e, MD5S02);
358 MD5_STEP (MD5_Fo, b, c, d, a, wf_t, MD5C0f, MD5S03);
360 MD5_STEP (MD5_Go, a, b, c, d, w1_t, MD5C10, MD5S10);
361 MD5_STEP (MD5_Go, d, a, b, c, w6_t, MD5C11, MD5S11);
362 MD5_STEP (MD5_Go, c, d, a, b, wb_t, MD5C12, MD5S12);
363 MD5_STEP (MD5_Go, b, c, d, a, w0_t, MD5C13, MD5S13);
364 MD5_STEP (MD5_Go, a, b, c, d, w5_t, MD5C14, MD5S10);
365 MD5_STEP (MD5_Go, d, a, b, c, wa_t, MD5C15, MD5S11);
366 MD5_STEP (MD5_Go, c, d, a, b, wf_t, MD5C16, MD5S12);
367 MD5_STEP (MD5_Go, b, c, d, a, w4_t, MD5C17, MD5S13);
368 MD5_STEP (MD5_Go, a, b, c, d, w9_t, MD5C18, MD5S10);
369 MD5_STEP (MD5_Go, d, a, b, c, we_t, MD5C19, MD5S11);
370 MD5_STEP (MD5_Go, c, d, a, b, w3_t, MD5C1a, MD5S12);
371 MD5_STEP (MD5_Go, b, c, d, a, w8_t, MD5C1b, MD5S13);
372 MD5_STEP (MD5_Go, a, b, c, d, wd_t, MD5C1c, MD5S10);
373 MD5_STEP (MD5_Go, d, a, b, c, w2_t, MD5C1d, MD5S11);
374 MD5_STEP (MD5_Go, c, d, a, b, w7_t, MD5C1e, MD5S12);
375 MD5_STEP (MD5_Go, b, c, d, a, wc_t, MD5C1f, MD5S13);
377 MD5_STEP (MD5_H , a, b, c, d, w5_t, MD5C20, MD5S20);
378 MD5_STEP (MD5_H , d, a, b, c, w8_t, MD5C21, MD5S21);
379 MD5_STEP (MD5_H , c, d, a, b, wb_t, MD5C22, MD5S22);
380 MD5_STEP (MD5_H , b, c, d, a, we_t, MD5C23, MD5S23);
381 MD5_STEP (MD5_H , a, b, c, d, w1_t, MD5C24, MD5S20);
382 MD5_STEP (MD5_H , d, a, b, c, w4_t, MD5C25, MD5S21);
383 MD5_STEP (MD5_H , c, d, a, b, w7_t, MD5C26, MD5S22);
384 MD5_STEP (MD5_H , b, c, d, a, wa_t, MD5C27, MD5S23);
385 MD5_STEP (MD5_H , a, b, c, d, wd_t, MD5C28, MD5S20);
386 MD5_STEP (MD5_H , d, a, b, c, w0_t, MD5C29, MD5S21);
387 MD5_STEP (MD5_H , c, d, a, b, w3_t, MD5C2a, MD5S22);
388 MD5_STEP (MD5_H , b, c, d, a, w6_t, MD5C2b, MD5S23);
389 MD5_STEP (MD5_H , a, b, c, d, w9_t, MD5C2c, MD5S20);
390 MD5_STEP (MD5_H , d, a, b, c, wc_t, MD5C2d, MD5S21);
391 MD5_STEP (MD5_H , c, d, a, b, wf_t, MD5C2e, MD5S22);
392 MD5_STEP (MD5_H , b, c, d, a, w2_t, MD5C2f, MD5S23);
394 MD5_STEP (MD5_I , a, b, c, d, w0_t, MD5C30, MD5S30);
395 MD5_STEP (MD5_I , d, a, b, c, w7_t, MD5C31, MD5S31);
396 MD5_STEP (MD5_I , c, d, a, b, we_t, MD5C32, MD5S32);
397 MD5_STEP (MD5_I , b, c, d, a, w5_t, MD5C33, MD5S33);
398 MD5_STEP (MD5_I , a, b, c, d, wc_t, MD5C34, MD5S30);
399 MD5_STEP (MD5_I , d, a, b, c, w3_t, MD5C35, MD5S31);
400 MD5_STEP (MD5_I , c, d, a, b, wa_t, MD5C36, MD5S32);
401 MD5_STEP (MD5_I , b, c, d, a, w1_t, MD5C37, MD5S33);
402 MD5_STEP (MD5_I , a, b, c, d, w8_t, MD5C38, MD5S30);
403 MD5_STEP (MD5_I , d, a, b, c, wf_t, MD5C39, MD5S31);
404 MD5_STEP (MD5_I , c, d, a, b, w6_t, MD5C3a, MD5S32);
405 MD5_STEP (MD5_I , b, c, d, a, wd_t, MD5C3b, MD5S33);
406 MD5_STEP (MD5_I , a, b, c, d, w4_t, MD5C3c, MD5S30);
407 MD5_STEP (MD5_I , d, a, b, c, wb_t, MD5C3d, MD5S31);
408 MD5_STEP (MD5_I , c, d, a, b, w2_t, MD5C3e, MD5S32);
409 MD5_STEP (MD5_I , b, c, d, a, w9_t, MD5C3f, MD5S33);
411 const u32x r_a = a + MD5M_A;
412 const u32x r_b = b + MD5M_B;
413 const u32x r_c = c + MD5M_C;
414 const u32x r_d = d + MD5M_D;
421 MD5_STEP (MD5_Fo, a, b, c, d, r_00, MD5C00, MD5S00);
422 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C01, MD5S01);
423 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C02, MD5S02);
424 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C03, MD5S03);
425 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C04, MD5S00);
426 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C05, MD5S01);
427 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C06, MD5S02);
428 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C07, MD5S03);
429 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C08, MD5S00);
430 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C09, MD5S01);
431 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C0a, MD5S02);
432 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0b, MD5S03);
433 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C0c, MD5S00);
434 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C0d, MD5S01);
435 MD5_STEP (MD5_Fo, c, d, a, b, r_14, MD5C0e, MD5S02);
436 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0f, MD5S03);
438 MD5_STEP0(MD5_Go, a, b, c, d, MD5C10, MD5S10);
439 MD5_STEP0(MD5_Go, d, a, b, c, MD5C11, MD5S11);
440 MD5_STEP0(MD5_Go, c, d, a, b, MD5C12, MD5S12);
441 MD5_STEP (MD5_Go, b, c, d, a, r_00, MD5C13, MD5S13);
442 MD5_STEP0(MD5_Go, a, b, c, d, MD5C14, MD5S10);
443 MD5_STEP0(MD5_Go, d, a, b, c, MD5C15, MD5S11);
444 MD5_STEP0(MD5_Go, c, d, a, b, MD5C16, MD5S12);
445 MD5_STEP0(MD5_Go, b, c, d, a, MD5C17, MD5S13);
446 MD5_STEP0(MD5_Go, a, b, c, d, MD5C18, MD5S10);
447 MD5_STEP (MD5_Go, d, a, b, c, r_14, MD5C19, MD5S11);
448 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1a, MD5S12);
449 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1b, MD5S13);
450 MD5_STEP0(MD5_Go, a, b, c, d, MD5C1c, MD5S10);
451 MD5_STEP0(MD5_Go, d, a, b, c, MD5C1d, MD5S11);
452 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1e, MD5S12);
453 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1f, MD5S13);
455 MD5_STEP0(MD5_H , a, b, c, d, MD5C20, MD5S20);
456 MD5_STEP0(MD5_H , d, a, b, c, MD5C21, MD5S21);
457 MD5_STEP0(MD5_H , c, d, a, b, MD5C22, MD5S22);
458 MD5_STEP (MD5_H , b, c, d, a, r_14, MD5C23, MD5S23);
459 MD5_STEP0(MD5_H , a, b, c, d, MD5C24, MD5S20);
460 MD5_STEP0(MD5_H , d, a, b, c, MD5C25, MD5S21);
461 MD5_STEP0(MD5_H , c, d, a, b, MD5C26, MD5S22);
462 MD5_STEP0(MD5_H , b, c, d, a, MD5C27, MD5S23);
463 MD5_STEP0(MD5_H , a, b, c, d, MD5C28, MD5S20);
464 MD5_STEP (MD5_H , d, a, b, c, r_00, MD5C29, MD5S21);
465 MD5_STEP0(MD5_H , c, d, a, b, MD5C2a, MD5S22);
466 MD5_STEP0(MD5_H , b, c, d, a, MD5C2b, MD5S23);
467 MD5_STEP0(MD5_H , a, b, c, d, MD5C2c, MD5S20);
468 MD5_STEP0(MD5_H , d, a, b, c, MD5C2d, MD5S21);
469 MD5_STEP0(MD5_H , c, d, a, b, MD5C2e, MD5S22);
470 MD5_STEP0(MD5_H , b, c, d, a, MD5C2f, MD5S23);
472 MD5_STEP (MD5_I , a, b, c, d, r_00, MD5C30, MD5S30);
473 MD5_STEP0(MD5_I , d, a, b, c, MD5C31, MD5S31);
474 MD5_STEP (MD5_I , c, d, a, b, r_14, MD5C32, MD5S32);
475 MD5_STEP0(MD5_I , b, c, d, a, MD5C33, MD5S33);
476 MD5_STEP0(MD5_I , a, b, c, d, MD5C34, MD5S30);
477 MD5_STEP0(MD5_I , d, a, b, c, MD5C35, MD5S31);
478 MD5_STEP0(MD5_I , c, d, a, b, MD5C36, MD5S32);
479 MD5_STEP0(MD5_I , b, c, d, a, MD5C37, MD5S33);
480 MD5_STEP0(MD5_I , a, b, c, d, MD5C38, MD5S30);
481 MD5_STEP0(MD5_I , d, a, b, c, MD5C39, MD5S31);
482 MD5_STEP0(MD5_I , c, d, a, b, MD5C3a, MD5S32);
483 MD5_STEP0(MD5_I , b, c, d, a, MD5C3b, MD5S33);
484 MD5_STEP0(MD5_I , a, b, c, d, MD5C3c, MD5S30);
485 MD5_STEP0(MD5_I , d, a, b, c, MD5C3d, MD5S31);
486 MD5_STEP0(MD5_I , c, d, a, b, MD5C3e, MD5S32);
487 MD5_STEP0(MD5_I , b, c, d, a, MD5C3f, MD5S33);
499 #include VECT_COMPARE_M
503 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m02810_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)
507 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m02810_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)
511 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m02810_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)
517 const u32 lid = get_local_id (0);
523 const u32 gid = get_global_id (0);
527 wordl0[0] = pws[gid].i[ 0];
528 wordl0[1] = pws[gid].i[ 1];
529 wordl0[2] = pws[gid].i[ 2];
530 wordl0[3] = pws[gid].i[ 3];
534 wordl1[0] = pws[gid].i[ 4];
535 wordl1[1] = pws[gid].i[ 5];
536 wordl1[2] = pws[gid].i[ 6];
537 wordl1[3] = pws[gid].i[ 7];
553 const u32 pw_l_len = pws[gid].pw_len;
555 if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
557 append_0x80_2 (wordl0, wordl1, pw_l_len);
559 switch_buffer_by_offset (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
568 s[0] = salt_bufs[salt_pos].salt_buf_pc[0];
569 s[1] = salt_bufs[salt_pos].salt_buf_pc[1];
570 s[2] = salt_bufs[salt_pos].salt_buf_pc[2];
571 s[3] = salt_bufs[salt_pos].salt_buf_pc[3];
572 s[4] = salt_bufs[salt_pos].salt_buf_pc[4];
573 s[5] = salt_bufs[salt_pos].salt_buf_pc[5];
574 s[6] = salt_bufs[salt_pos].salt_buf_pc[6];
575 s[7] = salt_bufs[salt_pos].salt_buf_pc[7];
577 const u32 r_00 = 0x80;
578 const u32 r_14 = 64 * 8;
584 const u32 search[4] =
586 digests_buf[digests_offset].digest_buf[DGST_R0],
587 digests_buf[digests_offset].digest_buf[DGST_R1],
588 digests_buf[digests_offset].digest_buf[DGST_R2],
589 digests_buf[digests_offset].digest_buf[DGST_R3]
596 __local u32 l_bin2asc[256];
598 const u32 lid4 = lid * 4;
600 const u32 lid40 = lid4 + 0;
601 const u32 lid41 = lid4 + 1;
602 const u32 lid42 = lid4 + 2;
603 const u32 lid43 = lid4 + 3;
605 const u32 v400 = (lid40 >> 0) & 15;
606 const u32 v401 = (lid40 >> 4) & 15;
607 const u32 v410 = (lid41 >> 0) & 15;
608 const u32 v411 = (lid41 >> 4) & 15;
609 const u32 v420 = (lid42 >> 0) & 15;
610 const u32 v421 = (lid42 >> 4) & 15;
611 const u32 v430 = (lid43 >> 0) & 15;
612 const u32 v431 = (lid43 >> 4) & 15;
614 l_bin2asc[lid40] = ((v400 < 10) ? '0' + v400 : 'a' - 10 + v400) << 8
615 | ((v401 < 10) ? '0' + v401 : 'a' - 10 + v401) << 0;
616 l_bin2asc[lid41] = ((v410 < 10) ? '0' + v410 : 'a' - 10 + v410) << 8
617 | ((v411 < 10) ? '0' + v411 : 'a' - 10 + v411) << 0;
618 l_bin2asc[lid42] = ((v420 < 10) ? '0' + v420 : 'a' - 10 + v420) << 8
619 | ((v421 < 10) ? '0' + v421 : 'a' - 10 + v421) << 0;
620 l_bin2asc[lid43] = ((v430 < 10) ? '0' + v430 : 'a' - 10 + v430) << 8
621 | ((v431 < 10) ? '0' + v431 : 'a' - 10 + v431) << 0;
623 barrier (CLK_LOCAL_MEM_FENCE);
625 if (gid >= gid_max) return;
631 for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
633 const u32 pw_r_len = combs_buf[il_pos].pw_len;
635 const u32 pw_len = pw_l_len + pw_r_len;
639 wordr0[0] = combs_buf[il_pos].i[0];
640 wordr0[1] = combs_buf[il_pos].i[1];
641 wordr0[2] = combs_buf[il_pos].i[2];
642 wordr0[3] = combs_buf[il_pos].i[3];
646 wordr1[0] = combs_buf[il_pos].i[4];
647 wordr1[1] = combs_buf[il_pos].i[5];
648 wordr1[2] = combs_buf[il_pos].i[6];
649 wordr1[3] = combs_buf[il_pos].i[7];
665 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
667 switch_buffer_by_offset (wordr0, wordr1, wordr2, wordr3, pw_l_len);
672 w0[0] = wordl0[0] | wordr0[0];
673 w0[1] = wordl0[1] | wordr0[1];
674 w0[2] = wordl0[2] | wordr0[2];
675 w0[3] = wordl0[3] | wordr0[3];
679 w1[0] = wordl1[0] | wordr1[0];
680 w1[1] = wordl1[1] | wordr1[1];
681 w1[2] = wordl1[2] | wordr1[2];
682 w1[3] = wordl1[3] | wordr1[3];
686 w2[0] = wordl2[0] | wordr2[0];
687 w2[1] = wordl2[1] | wordr2[1];
688 w2[2] = wordl2[2] | wordr2[2];
689 w2[3] = wordl2[3] | wordr2[3];
693 w3[0] = wordl3[0] | wordr3[0];
694 w3[1] = wordl3[1] | wordr3[1];
703 MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
704 MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
705 MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
706 MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
707 MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
708 MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
709 MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
710 MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
711 MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
712 MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
713 MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
714 MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
715 MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
716 MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
717 MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
718 MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
720 MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
721 MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
722 MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
723 MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
724 MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
725 MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
726 MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
727 MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
728 MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
729 MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
730 MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
731 MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
732 MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
733 MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
734 MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
735 MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
737 MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
738 MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
739 MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
740 MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
741 MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
742 MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
743 MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
744 MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
745 MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
746 MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
747 MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
748 MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
749 MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
750 MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
751 MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
752 MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
754 MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
755 MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
756 MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
757 MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
758 MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
759 MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
760 MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
761 MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
762 MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
763 MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
764 MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
765 MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
766 MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
767 MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
768 MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
769 MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
776 const u32 w0_t = s[0];
777 const u32 w1_t = s[1];
778 const u32 w2_t = s[2];
779 const u32 w3_t = s[3];
780 const u32 w4_t = s[4];
781 const u32 w5_t = s[5];
782 const u32 w6_t = s[6];
783 const u32 w7_t = s[7];
785 const u32x w8_t = uint_to_hex_lower8 ((a >> 0) & 255) << 0
786 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
787 const u32x w9_t = uint_to_hex_lower8 ((a >> 16) & 255) << 0
788 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
789 const u32x wa_t = uint_to_hex_lower8 ((b >> 0) & 255) << 0
790 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
791 const u32x wb_t = uint_to_hex_lower8 ((b >> 16) & 255) << 0
792 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
793 const u32x wc_t = uint_to_hex_lower8 ((c >> 0) & 255) << 0
794 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
795 const u32x wd_t = uint_to_hex_lower8 ((c >> 16) & 255) << 0
796 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
797 const u32x we_t = uint_to_hex_lower8 ((d >> 0) & 255) << 0
798 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
799 const u32x wf_t = uint_to_hex_lower8 ((d >> 16) & 255) << 0
800 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
807 MD5_STEP (MD5_Fo, a, b, c, d, w0_t, MD5C00, MD5S00);
808 MD5_STEP (MD5_Fo, d, a, b, c, w1_t, MD5C01, MD5S01);
809 MD5_STEP (MD5_Fo, c, d, a, b, w2_t, MD5C02, MD5S02);
810 MD5_STEP (MD5_Fo, b, c, d, a, w3_t, MD5C03, MD5S03);
811 MD5_STEP (MD5_Fo, a, b, c, d, w4_t, MD5C04, MD5S00);
812 MD5_STEP (MD5_Fo, d, a, b, c, w5_t, MD5C05, MD5S01);
813 MD5_STEP (MD5_Fo, c, d, a, b, w6_t, MD5C06, MD5S02);
814 MD5_STEP (MD5_Fo, b, c, d, a, w7_t, MD5C07, MD5S03);
815 MD5_STEP (MD5_Fo, a, b, c, d, w8_t, MD5C08, MD5S00);
816 MD5_STEP (MD5_Fo, d, a, b, c, w9_t, MD5C09, MD5S01);
817 MD5_STEP (MD5_Fo, c, d, a, b, wa_t, MD5C0a, MD5S02);
818 MD5_STEP (MD5_Fo, b, c, d, a, wb_t, MD5C0b, MD5S03);
819 MD5_STEP (MD5_Fo, a, b, c, d, wc_t, MD5C0c, MD5S00);
820 MD5_STEP (MD5_Fo, d, a, b, c, wd_t, MD5C0d, MD5S01);
821 MD5_STEP (MD5_Fo, c, d, a, b, we_t, MD5C0e, MD5S02);
822 MD5_STEP (MD5_Fo, b, c, d, a, wf_t, MD5C0f, MD5S03);
824 MD5_STEP (MD5_Go, a, b, c, d, w1_t, MD5C10, MD5S10);
825 MD5_STEP (MD5_Go, d, a, b, c, w6_t, MD5C11, MD5S11);
826 MD5_STEP (MD5_Go, c, d, a, b, wb_t, MD5C12, MD5S12);
827 MD5_STEP (MD5_Go, b, c, d, a, w0_t, MD5C13, MD5S13);
828 MD5_STEP (MD5_Go, a, b, c, d, w5_t, MD5C14, MD5S10);
829 MD5_STEP (MD5_Go, d, a, b, c, wa_t, MD5C15, MD5S11);
830 MD5_STEP (MD5_Go, c, d, a, b, wf_t, MD5C16, MD5S12);
831 MD5_STEP (MD5_Go, b, c, d, a, w4_t, MD5C17, MD5S13);
832 MD5_STEP (MD5_Go, a, b, c, d, w9_t, MD5C18, MD5S10);
833 MD5_STEP (MD5_Go, d, a, b, c, we_t, MD5C19, MD5S11);
834 MD5_STEP (MD5_Go, c, d, a, b, w3_t, MD5C1a, MD5S12);
835 MD5_STEP (MD5_Go, b, c, d, a, w8_t, MD5C1b, MD5S13);
836 MD5_STEP (MD5_Go, a, b, c, d, wd_t, MD5C1c, MD5S10);
837 MD5_STEP (MD5_Go, d, a, b, c, w2_t, MD5C1d, MD5S11);
838 MD5_STEP (MD5_Go, c, d, a, b, w7_t, MD5C1e, MD5S12);
839 MD5_STEP (MD5_Go, b, c, d, a, wc_t, MD5C1f, MD5S13);
841 MD5_STEP (MD5_H , a, b, c, d, w5_t, MD5C20, MD5S20);
842 MD5_STEP (MD5_H , d, a, b, c, w8_t, MD5C21, MD5S21);
843 MD5_STEP (MD5_H , c, d, a, b, wb_t, MD5C22, MD5S22);
844 MD5_STEP (MD5_H , b, c, d, a, we_t, MD5C23, MD5S23);
845 MD5_STEP (MD5_H , a, b, c, d, w1_t, MD5C24, MD5S20);
846 MD5_STEP (MD5_H , d, a, b, c, w4_t, MD5C25, MD5S21);
847 MD5_STEP (MD5_H , c, d, a, b, w7_t, MD5C26, MD5S22);
848 MD5_STEP (MD5_H , b, c, d, a, wa_t, MD5C27, MD5S23);
849 MD5_STEP (MD5_H , a, b, c, d, wd_t, MD5C28, MD5S20);
850 MD5_STEP (MD5_H , d, a, b, c, w0_t, MD5C29, MD5S21);
851 MD5_STEP (MD5_H , c, d, a, b, w3_t, MD5C2a, MD5S22);
852 MD5_STEP (MD5_H , b, c, d, a, w6_t, MD5C2b, MD5S23);
853 MD5_STEP (MD5_H , a, b, c, d, w9_t, MD5C2c, MD5S20);
854 MD5_STEP (MD5_H , d, a, b, c, wc_t, MD5C2d, MD5S21);
855 MD5_STEP (MD5_H , c, d, a, b, wf_t, MD5C2e, MD5S22);
856 MD5_STEP (MD5_H , b, c, d, a, w2_t, MD5C2f, MD5S23);
858 MD5_STEP (MD5_I , a, b, c, d, w0_t, MD5C30, MD5S30);
859 MD5_STEP (MD5_I , d, a, b, c, w7_t, MD5C31, MD5S31);
860 MD5_STEP (MD5_I , c, d, a, b, we_t, MD5C32, MD5S32);
861 MD5_STEP (MD5_I , b, c, d, a, w5_t, MD5C33, MD5S33);
862 MD5_STEP (MD5_I , a, b, c, d, wc_t, MD5C34, MD5S30);
863 MD5_STEP (MD5_I , d, a, b, c, w3_t, MD5C35, MD5S31);
864 MD5_STEP (MD5_I , c, d, a, b, wa_t, MD5C36, MD5S32);
865 MD5_STEP (MD5_I , b, c, d, a, w1_t, MD5C37, MD5S33);
866 MD5_STEP (MD5_I , a, b, c, d, w8_t, MD5C38, MD5S30);
867 MD5_STEP (MD5_I , d, a, b, c, wf_t, MD5C39, MD5S31);
868 MD5_STEP (MD5_I , c, d, a, b, w6_t, MD5C3a, MD5S32);
869 MD5_STEP (MD5_I , b, c, d, a, wd_t, MD5C3b, MD5S33);
870 MD5_STEP (MD5_I , a, b, c, d, w4_t, MD5C3c, MD5S30);
871 MD5_STEP (MD5_I , d, a, b, c, wb_t, MD5C3d, MD5S31);
872 MD5_STEP (MD5_I , c, d, a, b, w2_t, MD5C3e, MD5S32);
873 MD5_STEP (MD5_I , b, c, d, a, w9_t, MD5C3f, MD5S33);
875 const u32x r_a = a + MD5M_A;
876 const u32x r_b = b + MD5M_B;
877 const u32x r_c = c + MD5M_C;
878 const u32x r_d = d + MD5M_D;
885 MD5_STEP (MD5_Fo, a, b, c, d, r_00, MD5C00, MD5S00);
886 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C01, MD5S01);
887 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C02, MD5S02);
888 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C03, MD5S03);
889 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C04, MD5S00);
890 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C05, MD5S01);
891 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C06, MD5S02);
892 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C07, MD5S03);
893 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C08, MD5S00);
894 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C09, MD5S01);
895 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C0a, MD5S02);
896 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0b, MD5S03);
897 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C0c, MD5S00);
898 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C0d, MD5S01);
899 MD5_STEP (MD5_Fo, c, d, a, b, r_14, MD5C0e, MD5S02);
900 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0f, MD5S03);
902 MD5_STEP0(MD5_Go, a, b, c, d, MD5C10, MD5S10);
903 MD5_STEP0(MD5_Go, d, a, b, c, MD5C11, MD5S11);
904 MD5_STEP0(MD5_Go, c, d, a, b, MD5C12, MD5S12);
905 MD5_STEP (MD5_Go, b, c, d, a, r_00, MD5C13, MD5S13);
906 MD5_STEP0(MD5_Go, a, b, c, d, MD5C14, MD5S10);
907 MD5_STEP0(MD5_Go, d, a, b, c, MD5C15, MD5S11);
908 MD5_STEP0(MD5_Go, c, d, a, b, MD5C16, MD5S12);
909 MD5_STEP0(MD5_Go, b, c, d, a, MD5C17, MD5S13);
910 MD5_STEP0(MD5_Go, a, b, c, d, MD5C18, MD5S10);
911 MD5_STEP (MD5_Go, d, a, b, c, r_14, MD5C19, MD5S11);
912 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1a, MD5S12);
913 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1b, MD5S13);
914 MD5_STEP0(MD5_Go, a, b, c, d, MD5C1c, MD5S10);
915 MD5_STEP0(MD5_Go, d, a, b, c, MD5C1d, MD5S11);
916 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1e, MD5S12);
917 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1f, MD5S13);
919 MD5_STEP0(MD5_H , a, b, c, d, MD5C20, MD5S20);
920 MD5_STEP0(MD5_H , d, a, b, c, MD5C21, MD5S21);
921 MD5_STEP0(MD5_H , c, d, a, b, MD5C22, MD5S22);
922 MD5_STEP (MD5_H , b, c, d, a, r_14, MD5C23, MD5S23);
923 MD5_STEP0(MD5_H , a, b, c, d, MD5C24, MD5S20);
924 MD5_STEP0(MD5_H , d, a, b, c, MD5C25, MD5S21);
925 MD5_STEP0(MD5_H , c, d, a, b, MD5C26, MD5S22);
926 MD5_STEP0(MD5_H , b, c, d, a, MD5C27, MD5S23);
927 MD5_STEP0(MD5_H , a, b, c, d, MD5C28, MD5S20);
928 MD5_STEP (MD5_H , d, a, b, c, r_00, MD5C29, MD5S21);
929 MD5_STEP0(MD5_H , c, d, a, b, MD5C2a, MD5S22);
930 MD5_STEP0(MD5_H , b, c, d, a, MD5C2b, MD5S23);
931 MD5_STEP0(MD5_H , a, b, c, d, MD5C2c, MD5S20);
932 MD5_STEP0(MD5_H , d, a, b, c, MD5C2d, MD5S21);
933 MD5_STEP0(MD5_H , c, d, a, b, MD5C2e, MD5S22);
934 MD5_STEP0(MD5_H , b, c, d, a, MD5C2f, MD5S23);
936 MD5_STEP (MD5_I , a, b, c, d, r_00, MD5C30, MD5S30);
937 MD5_STEP0(MD5_I , d, a, b, c, MD5C31, MD5S31);
938 MD5_STEP (MD5_I , c, d, a, b, r_14, MD5C32, MD5S32);
939 MD5_STEP0(MD5_I , b, c, d, a, MD5C33, MD5S33);
940 MD5_STEP0(MD5_I , a, b, c, d, MD5C34, MD5S30);
941 MD5_STEP0(MD5_I , d, a, b, c, MD5C35, MD5S31);
942 MD5_STEP0(MD5_I , c, d, a, b, MD5C36, MD5S32);
943 MD5_STEP0(MD5_I , b, c, d, a, MD5C37, MD5S33);
944 MD5_STEP0(MD5_I , a, b, c, d, MD5C38, MD5S30);
945 MD5_STEP0(MD5_I , d, a, b, c, MD5C39, MD5S31);
946 MD5_STEP0(MD5_I , c, d, a, b, MD5C3a, MD5S32);
947 MD5_STEP0(MD5_I , b, c, d, a, MD5C3b, MD5S33);
948 MD5_STEP0(MD5_I , a, b, c, d, MD5C3c, MD5S30);
950 if (allx ((a + r_a) != search[0])) continue;
952 MD5_STEP0(MD5_I , d, a, b, c, MD5C3d, MD5S31);
953 MD5_STEP0(MD5_I , c, d, a, b, MD5C3e, MD5S32);
954 MD5_STEP0(MD5_I , b, c, d, a, MD5C3f, MD5S33);
966 #include VECT_COMPARE_S
970 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m02810_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)
974 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m02810_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)