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"
45 __device__ __constant__ gpu_rule_t c_rules[1024];
47 extern "C" __global__ void __launch_bounds__ (256, 1) m11000_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)
53 const u32 lid = threadIdx.x;
59 const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
61 if (gid >= gid_max) return;
65 pw_buf0[0] = pws[gid].i[ 0];
66 pw_buf0[1] = pws[gid].i[ 1];
67 pw_buf0[2] = pws[gid].i[ 2];
68 pw_buf0[3] = pws[gid].i[ 3];
72 pw_buf1[0] = pws[gid].i[ 4];
73 pw_buf1[1] = pws[gid].i[ 5];
74 pw_buf1[2] = pws[gid].i[ 6];
75 pw_buf1[3] = pws[gid].i[ 7];
77 const u32 pw_len = pws[gid].pw_len;
86 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
87 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
88 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
89 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
93 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
94 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
95 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
96 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
100 salt_buf2[0] = salt_bufs[salt_pos].salt_buf[ 8];
101 salt_buf2[1] = salt_bufs[salt_pos].salt_buf[ 9];
102 salt_buf2[2] = salt_bufs[salt_pos].salt_buf[10];
103 salt_buf2[3] = salt_bufs[salt_pos].salt_buf[11];
107 salt_buf3[0] = salt_bufs[salt_pos].salt_buf[12];
108 salt_buf3[1] = salt_bufs[salt_pos].salt_buf[13];
110 const u32 salt_len = salt_bufs[salt_pos].salt_len;
116 for (u32 il_pos = 0; il_pos < rules_cnt; il_pos++)
140 const u32 out_len = apply_rules (c_rules[il_pos].cmds, w0, w1, pw_len);
142 const u32 pw_salt_len = pw_len + salt_len;
144 append_0x80_4 (w0, w1, w2, w3, out_len);
150 // first step fixed 56 bytes of salt
157 w0_t[0] = salt_buf0[0];
158 w0_t[1] = salt_buf0[1];
159 w0_t[2] = salt_buf0[2];
160 w0_t[3] = salt_buf0[3];
161 w1_t[0] = salt_buf1[0];
162 w1_t[1] = salt_buf1[1];
163 w1_t[2] = salt_buf1[2];
164 w1_t[3] = salt_buf1[3];
165 w2_t[0] = salt_buf2[0];
166 w2_t[1] = salt_buf2[1];
167 w2_t[2] = salt_buf2[2];
168 w2_t[3] = salt_buf2[3];
169 w3_t[0] = salt_buf3[0];
170 w3_t[1] = salt_buf3[1];
172 // after 56 byte salt, we have beginning of the password
188 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
189 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
190 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
191 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
192 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
193 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
194 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
195 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
196 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
197 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
198 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
199 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
200 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
201 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
202 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
203 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
205 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
206 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
207 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
208 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
209 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
210 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
211 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
212 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
213 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
214 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
215 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
216 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
217 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
218 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
219 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
220 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
222 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
223 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
224 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
225 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
226 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
227 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
228 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
229 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
230 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
231 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
232 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
233 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
234 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
235 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
236 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
237 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
239 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
240 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
241 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
242 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
243 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
244 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
245 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
246 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
247 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
248 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
249 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
250 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
251 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
252 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
253 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
254 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
282 w3_t[2] = pw_salt_len * 8;
285 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
286 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
287 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
288 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
289 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
290 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
291 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
292 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
293 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
294 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
295 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
296 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
297 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
298 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
299 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
300 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
302 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
303 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
304 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
305 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
306 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
307 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
308 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
309 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
310 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
311 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
312 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
313 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
314 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
315 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
316 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
317 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
319 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
320 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
321 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
322 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
323 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
324 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
325 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
326 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
327 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
328 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
329 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
330 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
331 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
332 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
333 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
334 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
336 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
337 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
338 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
339 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
340 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
341 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
342 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
343 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
344 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
345 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
346 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
347 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
348 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
349 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
350 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
351 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
363 #include VECT_COMPARE_M
367 extern "C" __global__ void __launch_bounds__ (256, 1) m11000_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)
371 extern "C" __global__ void __launch_bounds__ (256, 1) m11000_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)
375 extern "C" __global__ void __launch_bounds__ (256, 1) m11000_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)
381 const u32 lid = threadIdx.x;
387 const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
389 if (gid >= gid_max) return;
393 pw_buf0[0] = pws[gid].i[ 0];
394 pw_buf0[1] = pws[gid].i[ 1];
395 pw_buf0[2] = pws[gid].i[ 2];
396 pw_buf0[3] = pws[gid].i[ 3];
400 pw_buf1[0] = pws[gid].i[ 4];
401 pw_buf1[1] = pws[gid].i[ 5];
402 pw_buf1[2] = pws[gid].i[ 6];
403 pw_buf1[3] = pws[gid].i[ 7];
405 const u32 pw_len = pws[gid].pw_len;
414 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
415 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
416 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
417 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
421 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
422 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
423 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
424 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
428 salt_buf2[0] = salt_bufs[salt_pos].salt_buf[ 8];
429 salt_buf2[1] = salt_bufs[salt_pos].salt_buf[ 9];
430 salt_buf2[2] = salt_bufs[salt_pos].salt_buf[10];
431 salt_buf2[3] = salt_bufs[salt_pos].salt_buf[11];
435 salt_buf3[0] = salt_bufs[salt_pos].salt_buf[12];
436 salt_buf3[1] = salt_bufs[salt_pos].salt_buf[13];
438 const u32 salt_len = salt_bufs[salt_pos].salt_len;
444 const u32 search[4] =
446 digests_buf[digests_offset].digest_buf[DGST_R0],
447 digests_buf[digests_offset].digest_buf[DGST_R1],
448 digests_buf[digests_offset].digest_buf[DGST_R2],
449 digests_buf[digests_offset].digest_buf[DGST_R3]
456 for (u32 il_pos = 0; il_pos < rules_cnt; il_pos++)
480 const u32 out_len = apply_rules (c_rules[il_pos].cmds, w0, w1, pw_len);
482 const u32 pw_salt_len = pw_len + salt_len;
484 append_0x80_4 (w0, w1, w2, w3, out_len);
490 // first step fixed 56 bytes of salt
497 w0_t[0] = salt_buf0[0];
498 w0_t[1] = salt_buf0[1];
499 w0_t[2] = salt_buf0[2];
500 w0_t[3] = salt_buf0[3];
501 w1_t[0] = salt_buf1[0];
502 w1_t[1] = salt_buf1[1];
503 w1_t[2] = salt_buf1[2];
504 w1_t[3] = salt_buf1[3];
505 w2_t[0] = salt_buf2[0];
506 w2_t[1] = salt_buf2[1];
507 w2_t[2] = salt_buf2[2];
508 w2_t[3] = salt_buf2[3];
509 w3_t[0] = salt_buf3[0];
510 w3_t[1] = salt_buf3[1];
512 // after 56 byte salt, we have beginning of the password
528 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
529 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
530 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
531 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
532 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
533 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
534 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
535 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
536 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
537 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
538 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
539 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
540 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
541 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
542 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
543 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
545 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
546 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
547 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
548 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
549 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
550 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
551 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
552 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
553 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
554 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
555 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
556 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
557 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
558 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
559 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
560 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
562 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
563 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
564 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
565 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
566 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
567 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
568 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
569 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
570 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
571 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
572 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
573 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
574 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
575 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
576 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
577 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
579 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
580 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
581 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
582 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
583 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
584 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
585 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
586 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
587 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
588 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
589 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
590 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
591 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
592 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
593 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
594 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
622 w3_t[2] = pw_salt_len * 8;
625 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
626 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
627 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
628 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
629 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
630 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
631 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
632 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
633 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
634 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
635 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
636 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
637 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
638 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
639 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
640 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
642 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
643 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
644 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
645 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
646 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
647 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
648 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
649 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
650 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
651 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
652 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
653 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
654 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
655 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
656 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
657 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
659 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
660 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
661 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
662 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
663 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
664 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
665 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
666 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
667 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
668 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
669 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
670 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
671 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
672 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
673 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
674 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
676 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
677 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
678 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
679 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
680 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
681 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
682 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
683 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
684 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
685 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
686 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
687 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
688 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
689 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
690 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
691 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
703 #include VECT_COMPARE_S
707 extern "C" __global__ void __launch_bounds__ (256, 1) m11000_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)
711 extern "C" __global__ void __launch_bounds__ (256, 1) m11000_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)