2 * Author......: Jens Steube <jens.steube@gmail.com>
8 #include "include/constants.h"
9 #include "include/kernel_vendor.h"
24 #include "include/kernel_functions.c"
26 #include "common_nv.c"
29 #define VECT_COMPARE_S "check_single_vect1_comp4.c"
30 #define VECT_COMPARE_M "check_multi_vect1_comp4.c"
34 #define VECT_COMPARE_S "check_single_vect2_comp4.c"
35 #define VECT_COMPARE_M "check_multi_vect2_comp4.c"
39 #define VECT_COMPARE_S "check_single_vect4_comp4.c"
40 #define VECT_COMPARE_M "check_multi_vect4_comp4.c"
43 __device__ __constant__ comb_t c_combs[1024];
46 #define uint_to_hex_lower8(i) l_bin2asc[(i)]
50 #define uint_to_hex_lower8(i) u32x (l_bin2asc[(i).x], l_bin2asc[(i).y])
54 #define uint_to_hex_lower8(i) u32x (l_bin2asc[(i).x], l_bin2asc[(i).y], l_bin2asc[(i).z], l_bin2asc[(i).w])
57 __device__ __constant__ char c_bin2asc[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
59 __device__ __shared__ short l_bin2asc[256];
61 extern "C" __global__ void __launch_bounds__ (256, 1) m02610_m04 (const pw_t *pws, const gpu_rule_t *rules_buf, const comb_t *combs_buf, const bf_t *bfs_buf, const void *tmps, void *hooks, const u32 *bitmaps_buf_s1_a, const u32 *bitmaps_buf_s1_b, const u32 *bitmaps_buf_s1_c, const u32 *bitmaps_buf_s1_d, const u32 *bitmaps_buf_s2_a, const u32 *bitmaps_buf_s2_b, const u32 *bitmaps_buf_s2_c, const u32 *bitmaps_buf_s2_d, plain_t *plains_buf, const digest_t *digests_buf, u32 *hashes_shown, const salt_t *salt_bufs, const void *esalt_bufs, u32 *d_return_buf, u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
67 const u32 lid = threadIdx.x;
73 const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
77 wordl0[0] = pws[gid].i[ 0];
78 wordl0[1] = pws[gid].i[ 1];
79 wordl0[2] = pws[gid].i[ 2];
80 wordl0[3] = pws[gid].i[ 3];
84 wordl1[0] = pws[gid].i[ 4];
85 wordl1[1] = pws[gid].i[ 5];
86 wordl1[2] = pws[gid].i[ 6];
87 wordl1[3] = pws[gid].i[ 7];
103 const u32 pw_l_len = pws[gid].pw_len;
105 if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
107 append_0x80_2 (wordl0, wordl1, pw_l_len);
109 switch_buffer_by_offset (wordl0, wordl1, wordl2, wordl3, c_combs[0].pw_len);
116 const u32 salt_len = salt_bufs[salt_pos].salt_len;
120 s[0] = salt_bufs[salt_pos].salt_buf[0];
121 s[1] = salt_bufs[salt_pos].salt_buf[1];
122 s[2] = salt_bufs[salt_pos].salt_buf[2];
123 s[3] = salt_bufs[salt_pos].salt_buf[3];
124 s[4] = salt_bufs[salt_pos].salt_buf[4];
125 s[5] = salt_bufs[salt_pos].salt_buf[5];
126 s[6] = (32 + salt_len) * 8;
133 l_bin2asc[lid] = c_bin2asc[(lid >> 0) & 15] << 8
134 | c_bin2asc[(lid >> 4) & 15] << 0;
138 if (gid >= gid_max) return;
144 for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
146 const u32 pw_r_len = c_combs[il_pos].pw_len;
148 const u32 pw_len = pw_l_len + pw_r_len;
152 wordr0[0] = c_combs[il_pos].i[0];
153 wordr0[1] = c_combs[il_pos].i[1];
154 wordr0[2] = c_combs[il_pos].i[2];
155 wordr0[3] = c_combs[il_pos].i[3];
159 wordr1[0] = c_combs[il_pos].i[4];
160 wordr1[1] = c_combs[il_pos].i[5];
161 wordr1[2] = c_combs[il_pos].i[6];
162 wordr1[3] = c_combs[il_pos].i[7];
178 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
180 switch_buffer_by_offset (wordr0, wordr1, wordr2, wordr3, pw_l_len);
185 w0[0] = wordl0[0] | wordr0[0];
186 w0[1] = wordl0[1] | wordr0[1];
187 w0[2] = wordl0[2] | wordr0[2];
188 w0[3] = wordl0[3] | wordr0[3];
192 w1[0] = wordl1[0] | wordr1[0];
193 w1[1] = wordl1[1] | wordr1[1];
194 w1[2] = wordl1[2] | wordr1[2];
195 w1[3] = wordl1[3] | wordr1[3];
199 w2[0] = wordl2[0] | wordr2[0];
200 w2[1] = wordl2[1] | wordr2[1];
201 w2[2] = wordl2[2] | wordr2[2];
202 w2[3] = wordl2[3] | wordr2[3];
206 w3[0] = wordl3[0] | wordr3[0];
207 w3[1] = wordl3[1] | wordr3[1];
216 MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
217 MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
218 MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
219 MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
220 MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
221 MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
222 MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
223 MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
224 MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
225 MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
226 MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
227 MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
228 MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
229 MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
230 MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
231 MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
233 MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
234 MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
235 MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
236 MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
237 MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
238 MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
239 MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
240 MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
241 MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
242 MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
243 MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
244 MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
245 MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
246 MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
247 MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
248 MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
250 MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
251 MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
252 MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
253 MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
254 MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
255 MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
256 MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
257 MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
258 MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
259 MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
260 MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
261 MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
262 MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
263 MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
264 MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
265 MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
267 MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
268 MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
269 MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
270 MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
271 MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
272 MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
273 MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
274 MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
275 MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
276 MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
277 MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
278 MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
279 MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
280 MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
281 MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
282 MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
289 const u32x w0_t = uint_to_hex_lower8 ((a >> 0) & 255) << 0
290 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
291 const u32x w1_t = uint_to_hex_lower8 ((a >> 16) & 255) << 0
292 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
293 const u32x w2_t = uint_to_hex_lower8 ((b >> 0) & 255) << 0
294 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
295 const u32x w3_t = uint_to_hex_lower8 ((b >> 16) & 255) << 0
296 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
297 const u32x w4_t = uint_to_hex_lower8 ((c >> 0) & 255) << 0
298 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
299 const u32x w5_t = uint_to_hex_lower8 ((c >> 16) & 255) << 0
300 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
301 const u32x w6_t = uint_to_hex_lower8 ((d >> 0) & 255) << 0
302 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
303 const u32x w7_t = uint_to_hex_lower8 ((d >> 16) & 255) << 0
304 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
306 const u32 w8_t = s[0];
307 const u32 w9_t = s[1];
308 const u32 wa_t = s[2];
309 const u32 wb_t = s[3];
310 const u32 wc_t = s[4];
311 const u32 wd_t = s[5];
312 const u32 we_t = s[6];
313 const u32 wf_t = s[7];
320 MD5_STEP (MD5_Fo, a, b, c, d, w0_t, MD5C00, MD5S00);
321 MD5_STEP (MD5_Fo, d, a, b, c, w1_t, MD5C01, MD5S01);
322 MD5_STEP (MD5_Fo, c, d, a, b, w2_t, MD5C02, MD5S02);
323 MD5_STEP (MD5_Fo, b, c, d, a, w3_t, MD5C03, MD5S03);
324 MD5_STEP (MD5_Fo, a, b, c, d, w4_t, MD5C04, MD5S00);
325 MD5_STEP (MD5_Fo, d, a, b, c, w5_t, MD5C05, MD5S01);
326 MD5_STEP (MD5_Fo, c, d, a, b, w6_t, MD5C06, MD5S02);
327 MD5_STEP (MD5_Fo, b, c, d, a, w7_t, MD5C07, MD5S03);
328 MD5_STEP (MD5_Fo, a, b, c, d, w8_t, MD5C08, MD5S00);
329 MD5_STEP (MD5_Fo, d, a, b, c, w9_t, MD5C09, MD5S01);
330 MD5_STEP (MD5_Fo, c, d, a, b, wa_t, MD5C0a, MD5S02);
331 MD5_STEP (MD5_Fo, b, c, d, a, wb_t, MD5C0b, MD5S03);
332 MD5_STEP (MD5_Fo, a, b, c, d, wc_t, MD5C0c, MD5S00);
333 MD5_STEP (MD5_Fo, d, a, b, c, wd_t, MD5C0d, MD5S01);
334 MD5_STEP (MD5_Fo, c, d, a, b, we_t, MD5C0e, MD5S02);
335 MD5_STEP (MD5_Fo, b, c, d, a, wf_t, MD5C0f, MD5S03);
337 MD5_STEP (MD5_Go, a, b, c, d, w1_t, MD5C10, MD5S10);
338 MD5_STEP (MD5_Go, d, a, b, c, w6_t, MD5C11, MD5S11);
339 MD5_STEP (MD5_Go, c, d, a, b, wb_t, MD5C12, MD5S12);
340 MD5_STEP (MD5_Go, b, c, d, a, w0_t, MD5C13, MD5S13);
341 MD5_STEP (MD5_Go, a, b, c, d, w5_t, MD5C14, MD5S10);
342 MD5_STEP (MD5_Go, d, a, b, c, wa_t, MD5C15, MD5S11);
343 MD5_STEP (MD5_Go, c, d, a, b, wf_t, MD5C16, MD5S12);
344 MD5_STEP (MD5_Go, b, c, d, a, w4_t, MD5C17, MD5S13);
345 MD5_STEP (MD5_Go, a, b, c, d, w9_t, MD5C18, MD5S10);
346 MD5_STEP (MD5_Go, d, a, b, c, we_t, MD5C19, MD5S11);
347 MD5_STEP (MD5_Go, c, d, a, b, w3_t, MD5C1a, MD5S12);
348 MD5_STEP (MD5_Go, b, c, d, a, w8_t, MD5C1b, MD5S13);
349 MD5_STEP (MD5_Go, a, b, c, d, wd_t, MD5C1c, MD5S10);
350 MD5_STEP (MD5_Go, d, a, b, c, w2_t, MD5C1d, MD5S11);
351 MD5_STEP (MD5_Go, c, d, a, b, w7_t, MD5C1e, MD5S12);
352 MD5_STEP (MD5_Go, b, c, d, a, wc_t, MD5C1f, MD5S13);
354 MD5_STEP (MD5_H , a, b, c, d, w5_t, MD5C20, MD5S20);
355 MD5_STEP (MD5_H , d, a, b, c, w8_t, MD5C21, MD5S21);
356 MD5_STEP (MD5_H , c, d, a, b, wb_t, MD5C22, MD5S22);
357 MD5_STEP (MD5_H , b, c, d, a, we_t, MD5C23, MD5S23);
358 MD5_STEP (MD5_H , a, b, c, d, w1_t, MD5C24, MD5S20);
359 MD5_STEP (MD5_H , d, a, b, c, w4_t, MD5C25, MD5S21);
360 MD5_STEP (MD5_H , c, d, a, b, w7_t, MD5C26, MD5S22);
361 MD5_STEP (MD5_H , b, c, d, a, wa_t, MD5C27, MD5S23);
362 MD5_STEP (MD5_H , a, b, c, d, wd_t, MD5C28, MD5S20);
363 MD5_STEP (MD5_H , d, a, b, c, w0_t, MD5C29, MD5S21);
364 MD5_STEP (MD5_H , c, d, a, b, w3_t, MD5C2a, MD5S22);
365 MD5_STEP (MD5_H , b, c, d, a, w6_t, MD5C2b, MD5S23);
366 MD5_STEP (MD5_H , a, b, c, d, w9_t, MD5C2c, MD5S20);
367 MD5_STEP (MD5_H , d, a, b, c, wc_t, MD5C2d, MD5S21);
368 MD5_STEP (MD5_H , c, d, a, b, wf_t, MD5C2e, MD5S22);
369 MD5_STEP (MD5_H , b, c, d, a, w2_t, MD5C2f, MD5S23);
371 MD5_STEP (MD5_I , a, b, c, d, w0_t, MD5C30, MD5S30);
372 MD5_STEP (MD5_I , d, a, b, c, w7_t, MD5C31, MD5S31);
373 MD5_STEP (MD5_I , c, d, a, b, we_t, MD5C32, MD5S32);
374 MD5_STEP (MD5_I , b, c, d, a, w5_t, MD5C33, MD5S33);
375 MD5_STEP (MD5_I , a, b, c, d, wc_t, MD5C34, MD5S30);
376 MD5_STEP (MD5_I , d, a, b, c, w3_t, MD5C35, MD5S31);
377 MD5_STEP (MD5_I , c, d, a, b, wa_t, MD5C36, MD5S32);
378 MD5_STEP (MD5_I , b, c, d, a, w1_t, MD5C37, MD5S33);
379 MD5_STEP (MD5_I , a, b, c, d, w8_t, MD5C38, MD5S30);
380 MD5_STEP (MD5_I , d, a, b, c, wf_t, MD5C39, MD5S31);
381 MD5_STEP (MD5_I , c, d, a, b, w6_t, MD5C3a, MD5S32);
382 MD5_STEP (MD5_I , b, c, d, a, wd_t, MD5C3b, MD5S33);
383 MD5_STEP (MD5_I , a, b, c, d, w4_t, MD5C3c, MD5S30);
384 MD5_STEP (MD5_I , d, a, b, c, wb_t, MD5C3d, MD5S31);
385 MD5_STEP (MD5_I , c, d, a, b, w2_t, MD5C3e, MD5S32);
386 MD5_STEP (MD5_I , b, c, d, a, w9_t, MD5C3f, MD5S33);
393 #include VECT_COMPARE_M
397 extern "C" __global__ void __launch_bounds__ (256, 1) m02610_m08 (const pw_t *pws, const gpu_rule_t *rules_buf, const comb_t *combs_buf, const bf_t *bfs_buf, const void *tmps, void *hooks, const u32 *bitmaps_buf_s1_a, const u32 *bitmaps_buf_s1_b, const u32 *bitmaps_buf_s1_c, const u32 *bitmaps_buf_s1_d, const u32 *bitmaps_buf_s2_a, const u32 *bitmaps_buf_s2_b, const u32 *bitmaps_buf_s2_c, const u32 *bitmaps_buf_s2_d, plain_t *plains_buf, const digest_t *digests_buf, u32 *hashes_shown, const salt_t *salt_bufs, const void *esalt_bufs, u32 *d_return_buf, u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
401 extern "C" __global__ void __launch_bounds__ (256, 1) m02610_m16 (const pw_t *pws, const gpu_rule_t *rules_buf, const comb_t *combs_buf, const bf_t *bfs_buf, const void *tmps, void *hooks, const u32 *bitmaps_buf_s1_a, const u32 *bitmaps_buf_s1_b, const u32 *bitmaps_buf_s1_c, const u32 *bitmaps_buf_s1_d, const u32 *bitmaps_buf_s2_a, const u32 *bitmaps_buf_s2_b, const u32 *bitmaps_buf_s2_c, const u32 *bitmaps_buf_s2_d, plain_t *plains_buf, const digest_t *digests_buf, u32 *hashes_shown, const salt_t *salt_bufs, const void *esalt_bufs, u32 *d_return_buf, u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
405 extern "C" __global__ void __launch_bounds__ (256, 1) m02610_s04 (const pw_t *pws, const gpu_rule_t *rules_buf, const comb_t *combs_buf, const bf_t *bfs_buf, const void *tmps, void *hooks, const u32 *bitmaps_buf_s1_a, const u32 *bitmaps_buf_s1_b, const u32 *bitmaps_buf_s1_c, const u32 *bitmaps_buf_s1_d, const u32 *bitmaps_buf_s2_a, const u32 *bitmaps_buf_s2_b, const u32 *bitmaps_buf_s2_c, const u32 *bitmaps_buf_s2_d, plain_t *plains_buf, const digest_t *digests_buf, u32 *hashes_shown, const salt_t *salt_bufs, const void *esalt_bufs, u32 *d_return_buf, u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
411 const u32 lid = threadIdx.x;
417 const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
421 wordl0[0] = pws[gid].i[ 0];
422 wordl0[1] = pws[gid].i[ 1];
423 wordl0[2] = pws[gid].i[ 2];
424 wordl0[3] = pws[gid].i[ 3];
428 wordl1[0] = pws[gid].i[ 4];
429 wordl1[1] = pws[gid].i[ 5];
430 wordl1[2] = pws[gid].i[ 6];
431 wordl1[3] = pws[gid].i[ 7];
447 const u32 pw_l_len = pws[gid].pw_len;
449 if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
451 append_0x80_2 (wordl0, wordl1, pw_l_len);
453 switch_buffer_by_offset (wordl0, wordl1, wordl2, wordl3, c_combs[0].pw_len);
460 const u32 search[4] =
462 digests_buf[digests_offset].digest_buf[DGST_R0],
463 digests_buf[digests_offset].digest_buf[DGST_R1],
464 digests_buf[digests_offset].digest_buf[DGST_R2],
465 digests_buf[digests_offset].digest_buf[DGST_R3]
472 const u32 salt_len = salt_bufs[salt_pos].salt_len;
476 s[0] = salt_bufs[salt_pos].salt_buf[0];
477 s[1] = salt_bufs[salt_pos].salt_buf[1];
478 s[2] = salt_bufs[salt_pos].salt_buf[2];
479 s[3] = salt_bufs[salt_pos].salt_buf[3];
480 s[4] = salt_bufs[salt_pos].salt_buf[4];
481 s[5] = salt_bufs[salt_pos].salt_buf[5];
482 s[6] = (32 + salt_len) * 8;
489 l_bin2asc[lid] = c_bin2asc[(lid >> 0) & 15] << 8
490 | c_bin2asc[(lid >> 4) & 15] << 0;
494 if (gid >= gid_max) return;
500 for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
502 const u32 pw_r_len = c_combs[il_pos].pw_len;
504 const u32 pw_len = pw_l_len + pw_r_len;
508 wordr0[0] = c_combs[il_pos].i[0];
509 wordr0[1] = c_combs[il_pos].i[1];
510 wordr0[2] = c_combs[il_pos].i[2];
511 wordr0[3] = c_combs[il_pos].i[3];
515 wordr1[0] = c_combs[il_pos].i[4];
516 wordr1[1] = c_combs[il_pos].i[5];
517 wordr1[2] = c_combs[il_pos].i[6];
518 wordr1[3] = c_combs[il_pos].i[7];
534 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
536 switch_buffer_by_offset (wordr0, wordr1, wordr2, wordr3, pw_l_len);
541 w0[0] = wordl0[0] | wordr0[0];
542 w0[1] = wordl0[1] | wordr0[1];
543 w0[2] = wordl0[2] | wordr0[2];
544 w0[3] = wordl0[3] | wordr0[3];
548 w1[0] = wordl1[0] | wordr1[0];
549 w1[1] = wordl1[1] | wordr1[1];
550 w1[2] = wordl1[2] | wordr1[2];
551 w1[3] = wordl1[3] | wordr1[3];
555 w2[0] = wordl2[0] | wordr2[0];
556 w2[1] = wordl2[1] | wordr2[1];
557 w2[2] = wordl2[2] | wordr2[2];
558 w2[3] = wordl2[3] | wordr2[3];
562 w3[0] = wordl3[0] | wordr3[0];
563 w3[1] = wordl3[1] | wordr3[1];
572 MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
573 MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
574 MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
575 MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
576 MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
577 MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
578 MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
579 MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
580 MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
581 MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
582 MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
583 MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
584 MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
585 MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
586 MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
587 MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
589 MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
590 MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
591 MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
592 MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
593 MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
594 MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
595 MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
596 MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
597 MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
598 MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
599 MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
600 MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
601 MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
602 MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
603 MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
604 MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
606 MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
607 MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
608 MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
609 MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
610 MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
611 MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
612 MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
613 MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
614 MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
615 MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
616 MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
617 MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
618 MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
619 MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
620 MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
621 MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
623 MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
624 MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
625 MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
626 MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
627 MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
628 MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
629 MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
630 MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
631 MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
632 MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
633 MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
634 MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
635 MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
636 MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
637 MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
638 MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
645 const u32x w0_t = uint_to_hex_lower8 ((a >> 0) & 255) << 0
646 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
647 const u32x w1_t = uint_to_hex_lower8 ((a >> 16) & 255) << 0
648 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
649 const u32x w2_t = uint_to_hex_lower8 ((b >> 0) & 255) << 0
650 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
651 const u32x w3_t = uint_to_hex_lower8 ((b >> 16) & 255) << 0
652 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
653 const u32x w4_t = uint_to_hex_lower8 ((c >> 0) & 255) << 0
654 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
655 const u32x w5_t = uint_to_hex_lower8 ((c >> 16) & 255) << 0
656 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
657 const u32x w6_t = uint_to_hex_lower8 ((d >> 0) & 255) << 0
658 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
659 const u32x w7_t = uint_to_hex_lower8 ((d >> 16) & 255) << 0
660 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
662 const u32 w8_t = s[0];
663 const u32 w9_t = s[1];
664 const u32 wa_t = s[2];
665 const u32 wb_t = s[3];
666 const u32 wc_t = s[4];
667 const u32 wd_t = s[5];
668 const u32 we_t = s[6];
669 const u32 wf_t = s[7];
676 MD5_STEP (MD5_Fo, a, b, c, d, w0_t, MD5C00, MD5S00);
677 MD5_STEP (MD5_Fo, d, a, b, c, w1_t, MD5C01, MD5S01);
678 MD5_STEP (MD5_Fo, c, d, a, b, w2_t, MD5C02, MD5S02);
679 MD5_STEP (MD5_Fo, b, c, d, a, w3_t, MD5C03, MD5S03);
680 MD5_STEP (MD5_Fo, a, b, c, d, w4_t, MD5C04, MD5S00);
681 MD5_STEP (MD5_Fo, d, a, b, c, w5_t, MD5C05, MD5S01);
682 MD5_STEP (MD5_Fo, c, d, a, b, w6_t, MD5C06, MD5S02);
683 MD5_STEP (MD5_Fo, b, c, d, a, w7_t, MD5C07, MD5S03);
684 MD5_STEP (MD5_Fo, a, b, c, d, w8_t, MD5C08, MD5S00);
685 MD5_STEP (MD5_Fo, d, a, b, c, w9_t, MD5C09, MD5S01);
686 MD5_STEP (MD5_Fo, c, d, a, b, wa_t, MD5C0a, MD5S02);
687 MD5_STEP (MD5_Fo, b, c, d, a, wb_t, MD5C0b, MD5S03);
688 MD5_STEP (MD5_Fo, a, b, c, d, wc_t, MD5C0c, MD5S00);
689 MD5_STEP (MD5_Fo, d, a, b, c, wd_t, MD5C0d, MD5S01);
690 MD5_STEP (MD5_Fo, c, d, a, b, we_t, MD5C0e, MD5S02);
691 MD5_STEP (MD5_Fo, b, c, d, a, wf_t, MD5C0f, MD5S03);
693 MD5_STEP (MD5_Go, a, b, c, d, w1_t, MD5C10, MD5S10);
694 MD5_STEP (MD5_Go, d, a, b, c, w6_t, MD5C11, MD5S11);
695 MD5_STEP (MD5_Go, c, d, a, b, wb_t, MD5C12, MD5S12);
696 MD5_STEP (MD5_Go, b, c, d, a, w0_t, MD5C13, MD5S13);
697 MD5_STEP (MD5_Go, a, b, c, d, w5_t, MD5C14, MD5S10);
698 MD5_STEP (MD5_Go, d, a, b, c, wa_t, MD5C15, MD5S11);
699 MD5_STEP (MD5_Go, c, d, a, b, wf_t, MD5C16, MD5S12);
700 MD5_STEP (MD5_Go, b, c, d, a, w4_t, MD5C17, MD5S13);
701 MD5_STEP (MD5_Go, a, b, c, d, w9_t, MD5C18, MD5S10);
702 MD5_STEP (MD5_Go, d, a, b, c, we_t, MD5C19, MD5S11);
703 MD5_STEP (MD5_Go, c, d, a, b, w3_t, MD5C1a, MD5S12);
704 MD5_STEP (MD5_Go, b, c, d, a, w8_t, MD5C1b, MD5S13);
705 MD5_STEP (MD5_Go, a, b, c, d, wd_t, MD5C1c, MD5S10);
706 MD5_STEP (MD5_Go, d, a, b, c, w2_t, MD5C1d, MD5S11);
707 MD5_STEP (MD5_Go, c, d, a, b, w7_t, MD5C1e, MD5S12);
708 MD5_STEP (MD5_Go, b, c, d, a, wc_t, MD5C1f, MD5S13);
710 MD5_STEP (MD5_H , a, b, c, d, w5_t, MD5C20, MD5S20);
711 MD5_STEP (MD5_H , d, a, b, c, w8_t, MD5C21, MD5S21);
712 MD5_STEP (MD5_H , c, d, a, b, wb_t, MD5C22, MD5S22);
713 MD5_STEP (MD5_H , b, c, d, a, we_t, MD5C23, MD5S23);
714 MD5_STEP (MD5_H , a, b, c, d, w1_t, MD5C24, MD5S20);
715 MD5_STEP (MD5_H , d, a, b, c, w4_t, MD5C25, MD5S21);
716 MD5_STEP (MD5_H , c, d, a, b, w7_t, MD5C26, MD5S22);
717 MD5_STEP (MD5_H , b, c, d, a, wa_t, MD5C27, MD5S23);
718 MD5_STEP (MD5_H , a, b, c, d, wd_t, MD5C28, MD5S20);
719 MD5_STEP (MD5_H , d, a, b, c, w0_t, MD5C29, MD5S21);
720 MD5_STEP (MD5_H , c, d, a, b, w3_t, MD5C2a, MD5S22);
721 MD5_STEP (MD5_H , b, c, d, a, w6_t, MD5C2b, MD5S23);
722 MD5_STEP (MD5_H , a, b, c, d, w9_t, MD5C2c, MD5S20);
723 MD5_STEP (MD5_H , d, a, b, c, wc_t, MD5C2d, MD5S21);
724 MD5_STEP (MD5_H , c, d, a, b, wf_t, MD5C2e, MD5S22);
725 MD5_STEP (MD5_H , b, c, d, a, w2_t, MD5C2f, MD5S23);
727 MD5_STEP (MD5_I , a, b, c, d, w0_t, MD5C30, MD5S30);
728 MD5_STEP (MD5_I , d, a, b, c, w7_t, MD5C31, MD5S31);
729 MD5_STEP (MD5_I , c, d, a, b, we_t, MD5C32, MD5S32);
730 MD5_STEP (MD5_I , b, c, d, a, w5_t, MD5C33, MD5S33);
731 MD5_STEP (MD5_I , a, b, c, d, wc_t, MD5C34, MD5S30);
732 MD5_STEP (MD5_I , d, a, b, c, w3_t, MD5C35, MD5S31);
733 MD5_STEP (MD5_I , c, d, a, b, wa_t, MD5C36, MD5S32);
734 MD5_STEP (MD5_I , b, c, d, a, w1_t, MD5C37, MD5S33);
735 MD5_STEP (MD5_I , a, b, c, d, w8_t, MD5C38, MD5S30);
736 MD5_STEP (MD5_I , d, a, b, c, wf_t, MD5C39, MD5S31);
737 MD5_STEP (MD5_I , c, d, a, b, w6_t, MD5C3a, MD5S32);
738 MD5_STEP (MD5_I , b, c, d, a, wd_t, MD5C3b, MD5S33);
739 MD5_STEP (MD5_I , a, b, c, d, w4_t, MD5C3c, MD5S30);
740 MD5_STEP (MD5_I , d, a, b, c, wb_t, MD5C3d, MD5S31);
741 MD5_STEP (MD5_I , c, d, a, b, w2_t, MD5C3e, MD5S32);
742 MD5_STEP (MD5_I , b, c, d, a, w9_t, MD5C3f, MD5S33);
749 #include VECT_COMPARE_S
753 extern "C" __global__ void __launch_bounds__ (256, 1) m02610_s08 (const pw_t *pws, const gpu_rule_t *rules_buf, const comb_t *combs_buf, const bf_t *bfs_buf, const void *tmps, void *hooks, const u32 *bitmaps_buf_s1_a, const u32 *bitmaps_buf_s1_b, const u32 *bitmaps_buf_s1_c, const u32 *bitmaps_buf_s1_d, const u32 *bitmaps_buf_s2_a, const u32 *bitmaps_buf_s2_b, const u32 *bitmaps_buf_s2_c, const u32 *bitmaps_buf_s2_d, plain_t *plains_buf, const digest_t *digests_buf, u32 *hashes_shown, const salt_t *salt_bufs, const void *esalt_bufs, u32 *d_return_buf, u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
757 extern "C" __global__ void __launch_bounds__ (256, 1) m02610_s16 (const pw_t *pws, const gpu_rule_t *rules_buf, const comb_t *combs_buf, const bf_t *bfs_buf, const void *tmps, void *hooks, const u32 *bitmaps_buf_s1_a, const u32 *bitmaps_buf_s1_b, const u32 *bitmaps_buf_s1_c, const u32 *bitmaps_buf_s1_d, const u32 *bitmaps_buf_s2_a, const u32 *bitmaps_buf_s2_b, const u32 *bitmaps_buf_s2_c, const u32 *bitmaps_buf_s2_d, plain_t *plains_buf, const digest_t *digests_buf, u32 *hashes_shown, const salt_t *salt_bufs, const void *esalt_bufs, u32 *d_return_buf, u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)