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];
48 #define uint_to_hex_lower8(i) l_bin2asc[(i)]
52 #define uint_to_hex_lower8(i) u32x (l_bin2asc[(i).x], l_bin2asc[(i).y])
56 #define uint_to_hex_lower8(i) u32x (l_bin2asc[(i).x], l_bin2asc[(i).y], l_bin2asc[(i).z], l_bin2asc[(i).w])
59 __device__ __constant__ char c_bin2asc[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
61 __device__ __shared__ short l_bin2asc[256];
63 extern "C" __global__ void __launch_bounds__ (256, 1) m04310_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;
97 const u32 salt_len = salt_bufs[salt_pos].salt_len;
101 s[0] = salt_bufs[salt_pos].salt_buf[0];
102 s[1] = salt_bufs[salt_pos].salt_buf[1];
103 s[2] = salt_bufs[salt_pos].salt_buf[2];
104 s[3] = salt_bufs[salt_pos].salt_buf[3];
105 s[4] = salt_bufs[salt_pos].salt_buf[4];
106 s[5] = salt_bufs[salt_pos].salt_buf[5];
107 s[6] = (32 + salt_len) * 8;
114 l_bin2asc[lid] = c_bin2asc[(lid >> 0) & 15] << 8
115 | c_bin2asc[(lid >> 4) & 15] << 0;
119 if (gid >= gid_max) return;
125 for (u32 il_pos = 0; il_pos < rules_cnt; il_pos++)
155 const u32 out_len = apply_rules (c_rules[il_pos].cmds, w0, w1, pw_len);
157 append_0x80_2 (w0, w1, out_len);
166 MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
167 MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
168 MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
169 MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
170 MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
171 MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
172 MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
173 MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
174 MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
175 MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
176 MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
177 MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
178 MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
179 MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
180 MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
181 MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
183 MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
184 MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
185 MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
186 MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
187 MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
188 MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
189 MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
190 MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
191 MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
192 MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
193 MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
194 MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
195 MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
196 MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
197 MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
198 MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
200 MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
201 MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
202 MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
203 MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
204 MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
205 MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
206 MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
207 MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
208 MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
209 MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
210 MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
211 MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
212 MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
213 MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
214 MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
215 MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
217 MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
218 MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
219 MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
220 MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
221 MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
222 MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
223 MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
224 MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
225 MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
226 MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
227 MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
228 MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
229 MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
230 MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
231 MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
232 MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
239 const u32x w0_t = uint_to_hex_lower8 ((a >> 0) & 255) << 0
240 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
241 const u32x w1_t = uint_to_hex_lower8 ((a >> 16) & 255) << 0
242 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
243 const u32x w2_t = uint_to_hex_lower8 ((b >> 0) & 255) << 0
244 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
245 const u32x w3_t = uint_to_hex_lower8 ((b >> 16) & 255) << 0
246 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
247 const u32x w4_t = uint_to_hex_lower8 ((c >> 0) & 255) << 0
248 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
249 const u32x w5_t = uint_to_hex_lower8 ((c >> 16) & 255) << 0
250 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
251 const u32x w6_t = uint_to_hex_lower8 ((d >> 0) & 255) << 0
252 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
253 const u32x w7_t = uint_to_hex_lower8 ((d >> 16) & 255) << 0
254 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
256 const u32 w8_t = s[0];
257 const u32 w9_t = s[1];
258 const u32 wa_t = s[2];
259 const u32 wb_t = s[3];
260 const u32 wc_t = s[4];
261 const u32 wd_t = s[5];
262 const u32 we_t = s[6];
263 const u32 wf_t = s[7];
270 MD5_STEP (MD5_Fo, a, b, c, d, w0_t, MD5C00, MD5S00);
271 MD5_STEP (MD5_Fo, d, a, b, c, w1_t, MD5C01, MD5S01);
272 MD5_STEP (MD5_Fo, c, d, a, b, w2_t, MD5C02, MD5S02);
273 MD5_STEP (MD5_Fo, b, c, d, a, w3_t, MD5C03, MD5S03);
274 MD5_STEP (MD5_Fo, a, b, c, d, w4_t, MD5C04, MD5S00);
275 MD5_STEP (MD5_Fo, d, a, b, c, w5_t, MD5C05, MD5S01);
276 MD5_STEP (MD5_Fo, c, d, a, b, w6_t, MD5C06, MD5S02);
277 MD5_STEP (MD5_Fo, b, c, d, a, w7_t, MD5C07, MD5S03);
278 MD5_STEP (MD5_Fo, a, b, c, d, w8_t, MD5C08, MD5S00);
279 MD5_STEP (MD5_Fo, d, a, b, c, w9_t, MD5C09, MD5S01);
280 MD5_STEP (MD5_Fo, c, d, a, b, wa_t, MD5C0a, MD5S02);
281 MD5_STEP (MD5_Fo, b, c, d, a, wb_t, MD5C0b, MD5S03);
282 MD5_STEP (MD5_Fo, a, b, c, d, wc_t, MD5C0c, MD5S00);
283 MD5_STEP (MD5_Fo, d, a, b, c, wd_t, MD5C0d, MD5S01);
284 MD5_STEP (MD5_Fo, c, d, a, b, we_t, MD5C0e, MD5S02);
285 MD5_STEP (MD5_Fo, b, c, d, a, wf_t, MD5C0f, MD5S03);
287 MD5_STEP (MD5_Go, a, b, c, d, w1_t, MD5C10, MD5S10);
288 MD5_STEP (MD5_Go, d, a, b, c, w6_t, MD5C11, MD5S11);
289 MD5_STEP (MD5_Go, c, d, a, b, wb_t, MD5C12, MD5S12);
290 MD5_STEP (MD5_Go, b, c, d, a, w0_t, MD5C13, MD5S13);
291 MD5_STEP (MD5_Go, a, b, c, d, w5_t, MD5C14, MD5S10);
292 MD5_STEP (MD5_Go, d, a, b, c, wa_t, MD5C15, MD5S11);
293 MD5_STEP (MD5_Go, c, d, a, b, wf_t, MD5C16, MD5S12);
294 MD5_STEP (MD5_Go, b, c, d, a, w4_t, MD5C17, MD5S13);
295 MD5_STEP (MD5_Go, a, b, c, d, w9_t, MD5C18, MD5S10);
296 MD5_STEP (MD5_Go, d, a, b, c, we_t, MD5C19, MD5S11);
297 MD5_STEP (MD5_Go, c, d, a, b, w3_t, MD5C1a, MD5S12);
298 MD5_STEP (MD5_Go, b, c, d, a, w8_t, MD5C1b, MD5S13);
299 MD5_STEP (MD5_Go, a, b, c, d, wd_t, MD5C1c, MD5S10);
300 MD5_STEP (MD5_Go, d, a, b, c, w2_t, MD5C1d, MD5S11);
301 MD5_STEP (MD5_Go, c, d, a, b, w7_t, MD5C1e, MD5S12);
302 MD5_STEP (MD5_Go, b, c, d, a, wc_t, MD5C1f, MD5S13);
304 MD5_STEP (MD5_H , a, b, c, d, w5_t, MD5C20, MD5S20);
305 MD5_STEP (MD5_H , d, a, b, c, w8_t, MD5C21, MD5S21);
306 MD5_STEP (MD5_H , c, d, a, b, wb_t, MD5C22, MD5S22);
307 MD5_STEP (MD5_H , b, c, d, a, we_t, MD5C23, MD5S23);
308 MD5_STEP (MD5_H , a, b, c, d, w1_t, MD5C24, MD5S20);
309 MD5_STEP (MD5_H , d, a, b, c, w4_t, MD5C25, MD5S21);
310 MD5_STEP (MD5_H , c, d, a, b, w7_t, MD5C26, MD5S22);
311 MD5_STEP (MD5_H , b, c, d, a, wa_t, MD5C27, MD5S23);
312 MD5_STEP (MD5_H , a, b, c, d, wd_t, MD5C28, MD5S20);
313 MD5_STEP (MD5_H , d, a, b, c, w0_t, MD5C29, MD5S21);
314 MD5_STEP (MD5_H , c, d, a, b, w3_t, MD5C2a, MD5S22);
315 MD5_STEP (MD5_H , b, c, d, a, w6_t, MD5C2b, MD5S23);
316 MD5_STEP (MD5_H , a, b, c, d, w9_t, MD5C2c, MD5S20);
317 MD5_STEP (MD5_H , d, a, b, c, wc_t, MD5C2d, MD5S21);
318 MD5_STEP (MD5_H , c, d, a, b, wf_t, MD5C2e, MD5S22);
319 MD5_STEP (MD5_H , b, c, d, a, w2_t, MD5C2f, MD5S23);
321 MD5_STEP (MD5_I , a, b, c, d, w0_t, MD5C30, MD5S30);
322 MD5_STEP (MD5_I , d, a, b, c, w7_t, MD5C31, MD5S31);
323 MD5_STEP (MD5_I , c, d, a, b, we_t, MD5C32, MD5S32);
324 MD5_STEP (MD5_I , b, c, d, a, w5_t, MD5C33, MD5S33);
325 MD5_STEP (MD5_I , a, b, c, d, wc_t, MD5C34, MD5S30);
326 MD5_STEP (MD5_I , d, a, b, c, w3_t, MD5C35, MD5S31);
327 MD5_STEP (MD5_I , c, d, a, b, wa_t, MD5C36, MD5S32);
328 MD5_STEP (MD5_I , b, c, d, a, w1_t, MD5C37, MD5S33);
329 MD5_STEP (MD5_I , a, b, c, d, w8_t, MD5C38, MD5S30);
330 MD5_STEP (MD5_I , d, a, b, c, wf_t, MD5C39, MD5S31);
331 MD5_STEP (MD5_I , c, d, a, b, w6_t, MD5C3a, MD5S32);
332 MD5_STEP (MD5_I , b, c, d, a, wd_t, MD5C3b, MD5S33);
333 MD5_STEP (MD5_I , a, b, c, d, w4_t, MD5C3c, MD5S30);
334 MD5_STEP (MD5_I , d, a, b, c, wb_t, MD5C3d, MD5S31);
335 MD5_STEP (MD5_I , c, d, a, b, w2_t, MD5C3e, MD5S32);
336 MD5_STEP (MD5_I , b, c, d, a, w9_t, MD5C3f, MD5S33);
343 #include VECT_COMPARE_M
347 extern "C" __global__ void __launch_bounds__ (256, 1) m04310_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)
351 extern "C" __global__ void __launch_bounds__ (256, 1) m04310_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)
355 extern "C" __global__ void __launch_bounds__ (256, 1) m04310_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)
361 const u32 lid = threadIdx.x;
367 const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
371 pw_buf0[0] = pws[gid].i[ 0];
372 pw_buf0[1] = pws[gid].i[ 1];
373 pw_buf0[2] = pws[gid].i[ 2];
374 pw_buf0[3] = pws[gid].i[ 3];
378 pw_buf1[0] = pws[gid].i[ 4];
379 pw_buf1[1] = pws[gid].i[ 5];
380 pw_buf1[2] = pws[gid].i[ 6];
381 pw_buf1[3] = pws[gid].i[ 7];
383 const u32 pw_len = pws[gid].pw_len;
389 const u32 salt_len = salt_bufs[salt_pos].salt_len;
393 s[0] = salt_bufs[salt_pos].salt_buf[0];
394 s[1] = salt_bufs[salt_pos].salt_buf[1];
395 s[2] = salt_bufs[salt_pos].salt_buf[2];
396 s[3] = salt_bufs[salt_pos].salt_buf[3];
397 s[4] = salt_bufs[salt_pos].salt_buf[4];
398 s[5] = salt_bufs[salt_pos].salt_buf[5];
399 s[6] = (32 + salt_len) * 8;
406 const u32 search[4] =
408 digests_buf[digests_offset].digest_buf[DGST_R0],
409 digests_buf[digests_offset].digest_buf[DGST_R1],
410 digests_buf[digests_offset].digest_buf[DGST_R2],
411 digests_buf[digests_offset].digest_buf[DGST_R3]
418 l_bin2asc[lid] = c_bin2asc[(lid >> 0) & 15] << 8
419 | c_bin2asc[(lid >> 4) & 15] << 0;
423 if (gid >= gid_max) return;
429 for (u32 il_pos = 0; il_pos < rules_cnt; il_pos++)
459 const u32 out_len = apply_rules (c_rules[il_pos].cmds, w0, w1, pw_len);
461 append_0x80_2 (w0, w1, out_len);
470 MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
471 MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
472 MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
473 MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
474 MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
475 MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
476 MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
477 MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
478 MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
479 MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
480 MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
481 MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
482 MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
483 MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
484 MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
485 MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
487 MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
488 MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
489 MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
490 MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
491 MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
492 MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
493 MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
494 MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
495 MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
496 MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
497 MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
498 MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
499 MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
500 MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
501 MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
502 MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
504 MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
505 MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
506 MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
507 MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
508 MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
509 MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
510 MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
511 MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
512 MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
513 MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
514 MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
515 MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
516 MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
517 MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
518 MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
519 MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
521 MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
522 MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
523 MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
524 MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
525 MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
526 MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
527 MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
528 MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
529 MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
530 MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
531 MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
532 MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
533 MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
534 MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
535 MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
536 MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
543 const u32x w0_t = uint_to_hex_lower8 ((a >> 0) & 255) << 0
544 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
545 const u32x w1_t = uint_to_hex_lower8 ((a >> 16) & 255) << 0
546 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
547 const u32x w2_t = uint_to_hex_lower8 ((b >> 0) & 255) << 0
548 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
549 const u32x w3_t = uint_to_hex_lower8 ((b >> 16) & 255) << 0
550 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
551 const u32x w4_t = uint_to_hex_lower8 ((c >> 0) & 255) << 0
552 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
553 const u32x w5_t = uint_to_hex_lower8 ((c >> 16) & 255) << 0
554 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
555 const u32x w6_t = uint_to_hex_lower8 ((d >> 0) & 255) << 0
556 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
557 const u32x w7_t = uint_to_hex_lower8 ((d >> 16) & 255) << 0
558 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
560 const u32 w8_t = s[0];
561 const u32 w9_t = s[1];
562 const u32 wa_t = s[2];
563 const u32 wb_t = s[3];
564 const u32 wc_t = s[4];
565 const u32 wd_t = s[5];
566 const u32 we_t = s[6];
567 const u32 wf_t = s[7];
574 MD5_STEP (MD5_Fo, a, b, c, d, w0_t, MD5C00, MD5S00);
575 MD5_STEP (MD5_Fo, d, a, b, c, w1_t, MD5C01, MD5S01);
576 MD5_STEP (MD5_Fo, c, d, a, b, w2_t, MD5C02, MD5S02);
577 MD5_STEP (MD5_Fo, b, c, d, a, w3_t, MD5C03, MD5S03);
578 MD5_STEP (MD5_Fo, a, b, c, d, w4_t, MD5C04, MD5S00);
579 MD5_STEP (MD5_Fo, d, a, b, c, w5_t, MD5C05, MD5S01);
580 MD5_STEP (MD5_Fo, c, d, a, b, w6_t, MD5C06, MD5S02);
581 MD5_STEP (MD5_Fo, b, c, d, a, w7_t, MD5C07, MD5S03);
582 MD5_STEP (MD5_Fo, a, b, c, d, w8_t, MD5C08, MD5S00);
583 MD5_STEP (MD5_Fo, d, a, b, c, w9_t, MD5C09, MD5S01);
584 MD5_STEP (MD5_Fo, c, d, a, b, wa_t, MD5C0a, MD5S02);
585 MD5_STEP (MD5_Fo, b, c, d, a, wb_t, MD5C0b, MD5S03);
586 MD5_STEP (MD5_Fo, a, b, c, d, wc_t, MD5C0c, MD5S00);
587 MD5_STEP (MD5_Fo, d, a, b, c, wd_t, MD5C0d, MD5S01);
588 MD5_STEP (MD5_Fo, c, d, a, b, we_t, MD5C0e, MD5S02);
589 MD5_STEP (MD5_Fo, b, c, d, a, wf_t, MD5C0f, MD5S03);
591 MD5_STEP (MD5_Go, a, b, c, d, w1_t, MD5C10, MD5S10);
592 MD5_STEP (MD5_Go, d, a, b, c, w6_t, MD5C11, MD5S11);
593 MD5_STEP (MD5_Go, c, d, a, b, wb_t, MD5C12, MD5S12);
594 MD5_STEP (MD5_Go, b, c, d, a, w0_t, MD5C13, MD5S13);
595 MD5_STEP (MD5_Go, a, b, c, d, w5_t, MD5C14, MD5S10);
596 MD5_STEP (MD5_Go, d, a, b, c, wa_t, MD5C15, MD5S11);
597 MD5_STEP (MD5_Go, c, d, a, b, wf_t, MD5C16, MD5S12);
598 MD5_STEP (MD5_Go, b, c, d, a, w4_t, MD5C17, MD5S13);
599 MD5_STEP (MD5_Go, a, b, c, d, w9_t, MD5C18, MD5S10);
600 MD5_STEP (MD5_Go, d, a, b, c, we_t, MD5C19, MD5S11);
601 MD5_STEP (MD5_Go, c, d, a, b, w3_t, MD5C1a, MD5S12);
602 MD5_STEP (MD5_Go, b, c, d, a, w8_t, MD5C1b, MD5S13);
603 MD5_STEP (MD5_Go, a, b, c, d, wd_t, MD5C1c, MD5S10);
604 MD5_STEP (MD5_Go, d, a, b, c, w2_t, MD5C1d, MD5S11);
605 MD5_STEP (MD5_Go, c, d, a, b, w7_t, MD5C1e, MD5S12);
606 MD5_STEP (MD5_Go, b, c, d, a, wc_t, MD5C1f, MD5S13);
608 MD5_STEP (MD5_H , a, b, c, d, w5_t, MD5C20, MD5S20);
609 MD5_STEP (MD5_H , d, a, b, c, w8_t, MD5C21, MD5S21);
610 MD5_STEP (MD5_H , c, d, a, b, wb_t, MD5C22, MD5S22);
611 MD5_STEP (MD5_H , b, c, d, a, we_t, MD5C23, MD5S23);
612 MD5_STEP (MD5_H , a, b, c, d, w1_t, MD5C24, MD5S20);
613 MD5_STEP (MD5_H , d, a, b, c, w4_t, MD5C25, MD5S21);
614 MD5_STEP (MD5_H , c, d, a, b, w7_t, MD5C26, MD5S22);
615 MD5_STEP (MD5_H , b, c, d, a, wa_t, MD5C27, MD5S23);
616 MD5_STEP (MD5_H , a, b, c, d, wd_t, MD5C28, MD5S20);
617 MD5_STEP (MD5_H , d, a, b, c, w0_t, MD5C29, MD5S21);
618 MD5_STEP (MD5_H , c, d, a, b, w3_t, MD5C2a, MD5S22);
619 MD5_STEP (MD5_H , b, c, d, a, w6_t, MD5C2b, MD5S23);
620 MD5_STEP (MD5_H , a, b, c, d, w9_t, MD5C2c, MD5S20);
621 MD5_STEP (MD5_H , d, a, b, c, wc_t, MD5C2d, MD5S21);
622 MD5_STEP (MD5_H , c, d, a, b, wf_t, MD5C2e, MD5S22);
623 MD5_STEP (MD5_H , b, c, d, a, w2_t, MD5C2f, MD5S23);
625 MD5_STEP (MD5_I , a, b, c, d, w0_t, MD5C30, MD5S30);
626 MD5_STEP (MD5_I , d, a, b, c, w7_t, MD5C31, MD5S31);
627 MD5_STEP (MD5_I , c, d, a, b, we_t, MD5C32, MD5S32);
628 MD5_STEP (MD5_I , b, c, d, a, w5_t, MD5C33, MD5S33);
629 MD5_STEP (MD5_I , a, b, c, d, wc_t, MD5C34, MD5S30);
630 MD5_STEP (MD5_I , d, a, b, c, w3_t, MD5C35, MD5S31);
631 MD5_STEP (MD5_I , c, d, a, b, wa_t, MD5C36, MD5S32);
632 MD5_STEP (MD5_I , b, c, d, a, w1_t, MD5C37, MD5S33);
633 MD5_STEP (MD5_I , a, b, c, d, w8_t, MD5C38, MD5S30);
634 MD5_STEP (MD5_I , d, a, b, c, wf_t, MD5C39, MD5S31);
635 MD5_STEP (MD5_I , c, d, a, b, w6_t, MD5C3a, MD5S32);
636 MD5_STEP (MD5_I , b, c, d, a, wd_t, MD5C3b, MD5S33);
637 MD5_STEP (MD5_I , a, b, c, d, w4_t, MD5C3c, MD5S30);
638 MD5_STEP (MD5_I , d, a, b, c, wb_t, MD5C3d, MD5S31);
639 MD5_STEP (MD5_I , c, d, a, b, w2_t, MD5C3e, MD5S32);
640 MD5_STEP (MD5_I , b, c, d, a, w9_t, MD5C3f, MD5S33);
647 #include VECT_COMPARE_S
651 extern "C" __global__ void __launch_bounds__ (256, 1) m04310_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)
655 extern "C" __global__ void __launch_bounds__ (256, 1) m04310_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)