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"
44 #define uint_to_hex_lower8(i) l_bin2asc[(i)]
48 #define uint_to_hex_lower8(i) u32x (l_bin2asc[(i).x], l_bin2asc[(i).y])
52 #define uint_to_hex_lower8(i) u32x (l_bin2asc[(i).x], l_bin2asc[(i).y], l_bin2asc[(i).z], l_bin2asc[(i).w])
55 __device__ __constant__ char c_bin2asc[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
57 __device__ __shared__ short l_bin2asc[256];
59 __device__ __constant__ comb_t c_combs[1024];
61 extern "C" __global__ void __launch_bounds__ (256, 1) m03710_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);
118 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
119 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
120 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
121 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
125 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
126 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
127 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
128 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
144 const u32 salt_len = salt_bufs[salt_pos].salt_len;
146 const u32 pw_salt_len = 32 + salt_len;
152 l_bin2asc[lid] = c_bin2asc[(lid >> 0) & 15] << 8
153 | c_bin2asc[(lid >> 4) & 15] << 0;
157 if (gid >= gid_max) return;
163 for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
165 const u32 pw_r_len = c_combs[il_pos].pw_len;
167 const u32 pw_len = pw_l_len + pw_r_len;
171 wordr0[0] = c_combs[il_pos].i[0];
172 wordr0[1] = c_combs[il_pos].i[1];
173 wordr0[2] = c_combs[il_pos].i[2];
174 wordr0[3] = c_combs[il_pos].i[3];
178 wordr1[0] = c_combs[il_pos].i[4];
179 wordr1[1] = c_combs[il_pos].i[5];
180 wordr1[2] = c_combs[il_pos].i[6];
181 wordr1[3] = c_combs[il_pos].i[7];
197 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
199 switch_buffer_by_offset (wordr0, wordr1, wordr2, wordr3, pw_l_len);
204 w0[0] = wordl0[0] | wordr0[0];
205 w0[1] = wordl0[1] | wordr0[1];
206 w0[2] = wordl0[2] | wordr0[2];
207 w0[3] = wordl0[3] | wordr0[3];
211 w1[0] = wordl1[0] | wordr1[0];
212 w1[1] = wordl1[1] | wordr1[1];
213 w1[2] = wordl1[2] | wordr1[2];
214 w1[3] = wordl1[3] | wordr1[3];
218 w2[0] = wordl2[0] | wordr2[0];
219 w2[1] = wordl2[1] | wordr2[1];
220 w2[2] = wordl2[2] | wordr2[2];
221 w2[3] = wordl2[3] | wordr2[3];
225 w3[0] = wordl3[0] | wordr3[0];
226 w3[1] = wordl3[1] | wordr3[1];
235 MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
236 MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
237 MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
238 MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
239 MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
240 MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
241 MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
242 MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
243 MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
244 MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
245 MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
246 MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
247 MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
248 MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
249 MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
250 MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
252 MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
253 MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
254 MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
255 MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
256 MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
257 MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
258 MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
259 MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
260 MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
261 MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
262 MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
263 MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
264 MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
265 MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
266 MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
267 MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
269 MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
270 MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
271 MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
272 MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
273 MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
274 MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
275 MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
276 MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
277 MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
278 MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
279 MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
280 MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
281 MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
282 MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
283 MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
284 MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
286 MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
287 MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
288 MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
289 MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
290 MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
291 MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
292 MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
293 MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
294 MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
295 MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
296 MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
297 MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
298 MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
299 MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
300 MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
301 MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
313 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
314 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
315 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
316 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
317 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
318 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
319 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
320 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
321 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
322 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
323 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
324 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
325 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
326 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
327 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
328 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
330 w2_t[0] = 0x00000080;
344 switch_buffer_by_offset (w0_t, w1_t, w2_t, w3_t, salt_len);
346 w3_t[2] = pw_salt_len * 8;
348 w0_t[0] |= salt_buf0[0];
349 w0_t[1] |= salt_buf0[1];
350 w0_t[2] |= salt_buf0[2];
351 w0_t[3] |= salt_buf0[3];
352 w1_t[0] |= salt_buf1[0];
353 w1_t[1] |= salt_buf1[1];
354 w1_t[2] |= salt_buf1[2];
355 w1_t[3] |= salt_buf1[3];
356 w2_t[0] |= salt_buf2[0];
357 w2_t[1] |= salt_buf2[1];
358 w2_t[2] |= salt_buf2[2];
359 w2_t[3] |= salt_buf2[3];
360 w3_t[0] |= salt_buf3[0];
361 w3_t[1] |= salt_buf3[1];
362 w3_t[2] |= salt_buf3[2];
363 w3_t[3] |= salt_buf3[3];
374 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
375 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
376 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
377 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
378 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
379 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
380 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
381 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
382 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
383 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
384 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
385 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
386 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
387 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
388 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
389 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
391 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
392 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
393 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
394 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
395 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
396 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
397 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
398 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
399 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
400 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
401 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
402 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
403 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
404 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
405 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
406 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
408 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
409 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
410 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
411 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
412 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
413 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
414 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
415 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
416 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
417 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
418 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
419 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
420 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
421 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
422 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
423 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
425 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
426 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
427 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
428 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
429 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
430 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
431 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
432 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
433 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
434 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
435 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
436 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
437 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
438 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
439 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
440 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
447 #include VECT_COMPARE_M
451 extern "C" __global__ void __launch_bounds__ (256, 1) m03710_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)
455 extern "C" __global__ void __launch_bounds__ (256, 1) m03710_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)
459 extern "C" __global__ void __launch_bounds__ (256, 1) m03710_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)
465 const u32 lid = threadIdx.x;
471 const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
475 wordl0[0] = pws[gid].i[ 0];
476 wordl0[1] = pws[gid].i[ 1];
477 wordl0[2] = pws[gid].i[ 2];
478 wordl0[3] = pws[gid].i[ 3];
482 wordl1[0] = pws[gid].i[ 4];
483 wordl1[1] = pws[gid].i[ 5];
484 wordl1[2] = pws[gid].i[ 6];
485 wordl1[3] = pws[gid].i[ 7];
501 const u32 pw_l_len = pws[gid].pw_len;
503 if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
505 append_0x80_2 (wordl0, wordl1, pw_l_len);
507 switch_buffer_by_offset (wordl0, wordl1, wordl2, wordl3, c_combs[0].pw_len);
516 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
517 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
518 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
519 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
523 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
524 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
525 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
526 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
542 const u32 salt_len = salt_bufs[salt_pos].salt_len;
544 const u32 pw_salt_len = 32 + salt_len;
550 const u32 search[4] =
552 digests_buf[digests_offset].digest_buf[DGST_R0],
553 digests_buf[digests_offset].digest_buf[DGST_R1],
554 digests_buf[digests_offset].digest_buf[DGST_R2],
555 digests_buf[digests_offset].digest_buf[DGST_R3]
562 l_bin2asc[lid] = c_bin2asc[(lid >> 0) & 15] << 8
563 | c_bin2asc[(lid >> 4) & 15] << 0;
567 if (gid >= gid_max) return;
573 for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
575 const u32 pw_r_len = c_combs[il_pos].pw_len;
577 const u32 pw_len = pw_l_len + pw_r_len;
581 wordr0[0] = c_combs[il_pos].i[0];
582 wordr0[1] = c_combs[il_pos].i[1];
583 wordr0[2] = c_combs[il_pos].i[2];
584 wordr0[3] = c_combs[il_pos].i[3];
588 wordr1[0] = c_combs[il_pos].i[4];
589 wordr1[1] = c_combs[il_pos].i[5];
590 wordr1[2] = c_combs[il_pos].i[6];
591 wordr1[3] = c_combs[il_pos].i[7];
607 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
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];
645 MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
646 MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
647 MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
648 MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
649 MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
650 MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
651 MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
652 MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
653 MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
654 MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
655 MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
656 MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
657 MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
658 MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
659 MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
660 MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
662 MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
663 MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
664 MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
665 MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
666 MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
667 MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
668 MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
669 MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
670 MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
671 MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
672 MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
673 MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
674 MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
675 MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
676 MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
677 MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
679 MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
680 MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
681 MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
682 MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
683 MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
684 MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
685 MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
686 MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
687 MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
688 MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
689 MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
690 MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
691 MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
692 MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
693 MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
694 MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
696 MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
697 MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
698 MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
699 MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
700 MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
701 MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
702 MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
703 MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
704 MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
705 MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
706 MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
707 MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
708 MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
709 MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
710 MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
711 MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
723 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
724 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
725 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
726 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
727 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
728 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
729 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
730 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
731 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
732 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
733 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
734 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
735 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
736 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
737 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
738 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
740 w2_t[0] = 0x00000080;
754 switch_buffer_by_offset (w0_t, w1_t, w2_t, w3_t, salt_len);
756 w3_t[2] = pw_salt_len * 8;
758 w0_t[0] |= salt_buf0[0];
759 w0_t[1] |= salt_buf0[1];
760 w0_t[2] |= salt_buf0[2];
761 w0_t[3] |= salt_buf0[3];
762 w1_t[0] |= salt_buf1[0];
763 w1_t[1] |= salt_buf1[1];
764 w1_t[2] |= salt_buf1[2];
765 w1_t[3] |= salt_buf1[3];
766 w2_t[0] |= salt_buf2[0];
767 w2_t[1] |= salt_buf2[1];
768 w2_t[2] |= salt_buf2[2];
769 w2_t[3] |= salt_buf2[3];
770 w3_t[0] |= salt_buf3[0];
771 w3_t[1] |= salt_buf3[1];
772 w3_t[2] |= salt_buf3[2];
773 w3_t[3] |= salt_buf3[3];
784 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
785 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
786 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
787 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
788 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
789 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
790 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
791 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
792 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
793 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
794 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
795 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
796 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
797 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
798 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
799 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
801 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
802 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
803 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
804 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
805 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
806 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
807 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
808 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
809 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
810 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
811 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
812 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
813 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
814 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
815 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
816 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
818 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
819 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
820 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
821 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
822 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
823 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
824 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
825 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
826 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
827 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
828 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
829 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
830 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
831 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
832 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
833 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
835 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
836 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
837 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
838 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
839 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
840 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
841 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
842 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
843 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
844 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
845 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
846 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
847 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
848 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
849 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
850 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
857 #include VECT_COMPARE_S
861 extern "C" __global__ void __launch_bounds__ (256, 1) m03710_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)
865 extern "C" __global__ void __launch_bounds__ (256, 1) m03710_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)