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"
27 #include "include/rp_gpu.h"
31 #define VECT_COMPARE_S "check_single_vect1_comp4.c"
32 #define VECT_COMPARE_M "check_multi_vect1_comp4.c"
36 #define VECT_COMPARE_S "check_single_vect2_comp4.c"
37 #define VECT_COMPARE_M "check_multi_vect2_comp4.c"
41 #define VECT_COMPARE_S "check_single_vect4_comp4.c"
42 #define VECT_COMPARE_M "check_multi_vect4_comp4.c"
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 __device__ __constant__ gpu_rule_t c_rules[1024];
63 extern "C" __global__ void __launch_bounds__ (256, 1) m11100_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 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
69 const u32 lid = threadIdx.x;
75 const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
79 pw_buf0[0] = pws[gid].i[ 0];
80 pw_buf0[1] = pws[gid].i[ 1];
81 pw_buf0[2] = pws[gid].i[ 2];
82 pw_buf0[3] = pws[gid].i[ 3];
86 pw_buf1[0] = pws[gid].i[ 4];
87 pw_buf1[1] = pws[gid].i[ 5];
88 pw_buf1[2] = pws[gid].i[ 6];
89 pw_buf1[3] = pws[gid].i[ 7];
91 const u32 pw_len = pws[gid].pw_len;
99 challenge = salt_bufs[salt_pos].salt_buf[0];
107 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 1]; // not a bug
108 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 2];
109 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 3];
110 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 4];
114 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 5];
115 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 6];
116 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 7];
117 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 8];
119 const u32 salt_len = salt_bufs[salt_pos].salt_len - 4;
125 l_bin2asc[lid] = c_bin2asc[(lid >> 0) & 15] << 8
126 | c_bin2asc[(lid >> 4) & 15] << 0;
130 if (gid >= gid_max) return;
136 for (u32 il_pos = 0; il_pos < rules_cnt; il_pos++)
166 const u32 out_len = apply_rules (c_rules[il_pos].cmds, w0, w1, pw_len);
170 w0_t[0] = salt_buf0[0];
171 w0_t[1] = salt_buf0[1];
172 w0_t[2] = salt_buf0[2];
173 w0_t[3] = salt_buf0[3];
177 w1_t[0] = salt_buf1[0];
178 w1_t[1] = salt_buf1[1];
179 w1_t[2] = salt_buf1[2];
180 w1_t[3] = salt_buf1[3];
200 switch_buffer_by_offset (w0_t, w1_t, w2_t, w3_t, pw_len);
202 const u32 pw_salt_len = out_len + salt_len;
221 w3_t[2] = pw_salt_len * 8;
233 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
234 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
235 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
236 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
237 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
238 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
239 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
240 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
241 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
242 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
243 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
244 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
245 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
246 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
247 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
248 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
250 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
251 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
252 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
253 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
254 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
255 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
256 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
257 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
258 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
259 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
260 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
261 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
262 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
263 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
264 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
265 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
267 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
268 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
269 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
270 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
271 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
272 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
273 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
274 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
275 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
276 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
277 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
278 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
279 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
280 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
281 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
282 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
284 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
285 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
286 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
287 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
288 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
289 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
290 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
291 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
292 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
293 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
294 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
295 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
296 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
297 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
298 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
299 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
306 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
307 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
308 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
309 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
310 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
311 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
312 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
313 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
314 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
315 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
316 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
317 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
318 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
319 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
320 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
321 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
323 // add the 4 byte challenge here
326 w2_t[1] = 0x00000080;
332 w3_t[2] = (32 + 4) * 8;
336 * md5 ($hash.$challenge)
344 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
345 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
346 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
347 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
348 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
349 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
350 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
351 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
352 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
353 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
354 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
355 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
356 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
357 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
358 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
359 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
361 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
362 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
363 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
364 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
365 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
366 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
367 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
368 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
369 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
370 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
371 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
372 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
373 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
374 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
375 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
376 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
378 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
379 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
380 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
381 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
382 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
383 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
384 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
385 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
386 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
387 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
388 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
389 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
390 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
391 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
392 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
393 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
395 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
396 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
397 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
398 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
399 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
400 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
401 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
402 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
403 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
404 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
405 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
406 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
407 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
408 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
409 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
410 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
417 #include VECT_COMPARE_M
421 extern "C" __global__ void __launch_bounds__ (256, 1) m11100_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)
425 extern "C" __global__ void __launch_bounds__ (256, 1) m11100_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)
429 extern "C" __global__ void __launch_bounds__ (256, 1) m11100_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 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
435 const u32 lid = threadIdx.x;
441 const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
445 pw_buf0[0] = pws[gid].i[ 0];
446 pw_buf0[1] = pws[gid].i[ 1];
447 pw_buf0[2] = pws[gid].i[ 2];
448 pw_buf0[3] = pws[gid].i[ 3];
452 pw_buf1[0] = pws[gid].i[ 4];
453 pw_buf1[1] = pws[gid].i[ 5];
454 pw_buf1[2] = pws[gid].i[ 6];
455 pw_buf1[3] = pws[gid].i[ 7];
457 const u32 pw_len = pws[gid].pw_len;
465 challenge = salt_bufs[salt_pos].salt_buf[0];
473 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 1]; // not a bug
474 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 2];
475 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 3];
476 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 4];
480 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 5];
481 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 6];
482 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 7];
483 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 8];
485 const u32 salt_len = salt_bufs[salt_pos].salt_len - 4;
491 const u32 search[4] =
493 digests_buf[digests_offset].digest_buf[DGST_R0],
494 digests_buf[digests_offset].digest_buf[DGST_R1],
495 digests_buf[digests_offset].digest_buf[DGST_R2],
496 digests_buf[digests_offset].digest_buf[DGST_R3]
503 l_bin2asc[lid] = c_bin2asc[(lid >> 0) & 15] << 8
504 | c_bin2asc[(lid >> 4) & 15] << 0;
508 if (gid >= gid_max) return;
514 for (u32 il_pos = 0; il_pos < rules_cnt; il_pos++)
544 const u32 out_len = apply_rules (c_rules[il_pos].cmds, w0, w1, pw_len);
548 w0_t[0] = salt_buf0[0];
549 w0_t[1] = salt_buf0[1];
550 w0_t[2] = salt_buf0[2];
551 w0_t[3] = salt_buf0[3];
555 w1_t[0] = salt_buf1[0];
556 w1_t[1] = salt_buf1[1];
557 w1_t[2] = salt_buf1[2];
558 w1_t[3] = salt_buf1[3];
578 switch_buffer_by_offset (w0_t, w1_t, w2_t, w3_t, pw_len);
580 const u32 pw_salt_len = out_len + salt_len;
599 w3_t[2] = pw_salt_len * 8;
611 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
612 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
613 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
614 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
615 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
616 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
617 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
618 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
619 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
620 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
621 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
622 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
623 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
624 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
625 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
626 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
628 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
629 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
630 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
631 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
632 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
633 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
634 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
635 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
636 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
637 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
638 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
639 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
640 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
641 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
642 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
643 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
645 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
646 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
647 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
648 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
649 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
650 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
651 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
652 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
653 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
654 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
655 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
656 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
657 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
658 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
659 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
660 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
662 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
663 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
664 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
665 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
666 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
667 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
668 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
669 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
670 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
671 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
672 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
673 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
674 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
675 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
676 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
677 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
684 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
685 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
686 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
687 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
688 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
689 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
690 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
691 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
692 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
693 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
694 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
695 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
696 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
697 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
698 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
699 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
701 // add the 4 byte challenge here
704 w2_t[1] = 0x00000080;
710 w3_t[2] = (32 + 4) * 8;
714 * md5 ($hash.$challenge)
722 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
723 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
724 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
725 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
726 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
727 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
728 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
729 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
730 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
731 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
732 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
733 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
734 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
735 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
736 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
737 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
739 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
740 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
741 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
742 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
743 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
744 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
745 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
746 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
747 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
748 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
749 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
750 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
751 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
752 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
753 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
754 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
756 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
757 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
758 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
759 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
760 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
761 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
762 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
763 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
764 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
765 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
766 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
767 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
768 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
769 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
770 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
771 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
773 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
774 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
775 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
776 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
777 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
778 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
779 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
780 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
781 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
782 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
783 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
784 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
785 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
786 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
787 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
788 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
795 #include VECT_COMPARE_S
799 extern "C" __global__ void __launch_bounds__ (256, 1) m11100_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)
803 extern "C" __global__ void __launch_bounds__ (256, 1) m11100_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)