2 * Author......: Jens Steube <jens.steube@gmail.com>
8 #include "include/constants.h"
9 #include "include/kernel_vendor.h"
28 #include "include/kernel_functions.c"
29 #include "types_amd.c"
30 #include "common_amd.c"
33 #define VECT_COMPARE_S "check_single_vect1_comp4.c"
34 #define VECT_COMPARE_M "check_multi_vect1_comp4.c"
38 #define VECT_COMPARE_S "check_single_vect2_comp4.c"
39 #define VECT_COMPARE_M "check_multi_vect2_comp4.c"
43 #define VECT_COMPARE_S "check_single_vect4_comp4.c"
44 #define VECT_COMPARE_M "check_multi_vect4_comp4.c"
47 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m11000_m04 (__global pw_t *pws, __global gpu_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global 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)
53 const u32 lid = get_local_id (0);
59 const u32 gid = get_global_id (0);
61 if (gid >= gid_max) return;
65 wordl0[0] = pws[gid].i[ 0];
66 wordl0[1] = pws[gid].i[ 1];
67 wordl0[2] = pws[gid].i[ 2];
68 wordl0[3] = pws[gid].i[ 3];
72 wordl1[0] = pws[gid].i[ 4];
73 wordl1[1] = pws[gid].i[ 5];
74 wordl1[2] = pws[gid].i[ 6];
75 wordl1[3] = pws[gid].i[ 7];
91 const u32 pw_l_len = pws[gid].pw_len;
93 if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
95 switch_buffer_by_offset (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
104 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
105 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
106 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
107 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
111 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
112 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
113 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
114 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
118 salt_buf2[0] = salt_bufs[salt_pos].salt_buf[ 8];
119 salt_buf2[1] = salt_bufs[salt_pos].salt_buf[ 9];
120 salt_buf2[2] = salt_bufs[salt_pos].salt_buf[10];
121 salt_buf2[3] = salt_bufs[salt_pos].salt_buf[11];
125 salt_buf3[0] = salt_bufs[salt_pos].salt_buf[12];
126 salt_buf3[1] = salt_bufs[salt_pos].salt_buf[13];
128 const u32 salt_len = salt_bufs[salt_pos].salt_len;
134 for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
136 const u32 pw_r_len = combs_buf[il_pos].pw_len;
138 const u32 pw_len = pw_l_len + pw_r_len;
145 wordr0[0] = combs_buf[il_pos].i[0];
146 wordr0[1] = combs_buf[il_pos].i[1];
147 wordr0[2] = combs_buf[il_pos].i[2];
148 wordr0[3] = combs_buf[il_pos].i[3];
149 wordr1[0] = combs_buf[il_pos].i[4];
150 wordr1[1] = combs_buf[il_pos].i[5];
151 wordr1[2] = combs_buf[il_pos].i[6];
152 wordr1[3] = combs_buf[il_pos].i[7];
162 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
164 switch_buffer_by_offset (wordr0, wordr1, wordr2, wordr3, pw_l_len);
172 w0[0] = wordl0[0] | wordr0[0];
173 w0[1] = wordl0[1] | wordr0[1];
174 w0[2] = wordl0[2] | wordr0[2];
175 w0[3] = wordl0[3] | wordr0[3];
176 w1[0] = wordl1[0] | wordr1[0];
177 w1[1] = wordl1[1] | wordr1[1];
178 w1[2] = wordl1[2] | wordr1[2];
179 w1[3] = wordl1[3] | wordr1[3];
180 w2[0] = wordl2[0] | wordr2[0];
181 w2[1] = wordl2[1] | wordr2[1];
182 w2[2] = wordl2[2] | wordr2[2];
183 w2[3] = wordl2[3] | wordr2[3];
184 w3[0] = wordl3[0] | wordr3[0];
185 w3[1] = wordl3[1] | wordr3[1];
186 w3[2] = wordl3[2] | wordr3[2];
187 w3[3] = wordl3[3] | wordr3[3];
189 append_0x80_4 (w0, w1, w2, w3, pw_len);
191 const u32 pw_salt_len = pw_len + salt_len;
197 // first step fixed 56 bytes of salt
204 w0_t[0] = salt_buf0[0];
205 w0_t[1] = salt_buf0[1];
206 w0_t[2] = salt_buf0[2];
207 w0_t[3] = salt_buf0[3];
208 w1_t[0] = salt_buf1[0];
209 w1_t[1] = salt_buf1[1];
210 w1_t[2] = salt_buf1[2];
211 w1_t[3] = salt_buf1[3];
212 w2_t[0] = salt_buf2[0];
213 w2_t[1] = salt_buf2[1];
214 w2_t[2] = salt_buf2[2];
215 w2_t[3] = salt_buf2[3];
216 w3_t[0] = salt_buf3[0];
217 w3_t[1] = salt_buf3[1];
219 // after 56 byte salt, we have beginning of the password
235 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
236 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
237 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
238 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
239 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
240 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
241 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
242 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
243 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
244 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
245 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
246 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
247 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
248 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
249 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
250 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
252 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
253 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
254 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
255 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
256 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
257 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
258 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
259 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
260 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
261 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
262 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
263 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
264 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
265 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
266 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
267 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
269 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
270 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
271 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
272 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
273 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
274 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
275 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
276 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
277 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
278 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
279 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
280 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
281 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
282 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
283 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
284 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
286 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
287 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
288 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
289 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
290 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
291 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
292 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
293 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
294 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
295 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
296 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
297 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
298 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
299 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
300 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
301 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
329 w3_t[2] = pw_salt_len * 8;
332 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
333 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
334 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
335 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
336 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
337 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
338 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
339 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
340 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
341 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
342 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
343 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
344 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
345 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
346 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
347 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
349 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
350 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
351 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
352 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
353 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
354 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
355 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
356 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
357 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
358 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
359 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
360 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
361 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
362 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
363 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
364 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
366 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
367 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
368 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
369 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
370 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
371 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
372 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
373 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
374 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
375 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
376 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
377 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
378 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
379 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
380 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
381 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
383 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
384 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
385 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
386 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
387 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
388 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
389 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
390 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
391 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
392 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
393 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
394 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
395 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
396 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
397 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
398 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
410 #include VECT_COMPARE_M
414 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m11000_m08 (__global pw_t *pws, __global gpu_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global 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)
418 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m11000_m16 (__global pw_t *pws, __global gpu_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global 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)
422 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m11000_s04 (__global pw_t *pws, __global gpu_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global 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)
428 const u32 lid = get_local_id (0);
434 const u32 gid = get_global_id (0);
436 if (gid >= gid_max) return;
440 wordl0[0] = pws[gid].i[ 0];
441 wordl0[1] = pws[gid].i[ 1];
442 wordl0[2] = pws[gid].i[ 2];
443 wordl0[3] = pws[gid].i[ 3];
447 wordl1[0] = pws[gid].i[ 4];
448 wordl1[1] = pws[gid].i[ 5];
449 wordl1[2] = pws[gid].i[ 6];
450 wordl1[3] = pws[gid].i[ 7];
466 const u32 pw_l_len = pws[gid].pw_len;
468 if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
470 switch_buffer_by_offset (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
479 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
480 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
481 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
482 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
486 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
487 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
488 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
489 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
493 salt_buf2[0] = salt_bufs[salt_pos].salt_buf[ 8];
494 salt_buf2[1] = salt_bufs[salt_pos].salt_buf[ 9];
495 salt_buf2[2] = salt_bufs[salt_pos].salt_buf[10];
496 salt_buf2[3] = salt_bufs[salt_pos].salt_buf[11];
500 salt_buf3[0] = salt_bufs[salt_pos].salt_buf[12];
501 salt_buf3[1] = salt_bufs[salt_pos].salt_buf[13];
503 const u32 salt_len = salt_bufs[salt_pos].salt_len;
509 const u32 search[4] =
511 digests_buf[digests_offset].digest_buf[DGST_R0],
512 digests_buf[digests_offset].digest_buf[DGST_R1],
513 digests_buf[digests_offset].digest_buf[DGST_R2],
514 digests_buf[digests_offset].digest_buf[DGST_R3]
521 for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
523 const u32 pw_r_len = combs_buf[il_pos].pw_len;
525 const u32 pw_len = pw_l_len + pw_r_len;
532 wordr0[0] = combs_buf[il_pos].i[0];
533 wordr0[1] = combs_buf[il_pos].i[1];
534 wordr0[2] = combs_buf[il_pos].i[2];
535 wordr0[3] = combs_buf[il_pos].i[3];
536 wordr1[0] = combs_buf[il_pos].i[4];
537 wordr1[1] = combs_buf[il_pos].i[5];
538 wordr1[2] = combs_buf[il_pos].i[6];
539 wordr1[3] = combs_buf[il_pos].i[7];
549 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
551 switch_buffer_by_offset (wordr0, wordr1, wordr2, wordr3, pw_l_len);
559 w0[0] = wordl0[0] | wordr0[0];
560 w0[1] = wordl0[1] | wordr0[1];
561 w0[2] = wordl0[2] | wordr0[2];
562 w0[3] = wordl0[3] | wordr0[3];
563 w1[0] = wordl1[0] | wordr1[0];
564 w1[1] = wordl1[1] | wordr1[1];
565 w1[2] = wordl1[2] | wordr1[2];
566 w1[3] = wordl1[3] | wordr1[3];
567 w2[0] = wordl2[0] | wordr2[0];
568 w2[1] = wordl2[1] | wordr2[1];
569 w2[2] = wordl2[2] | wordr2[2];
570 w2[3] = wordl2[3] | wordr2[3];
571 w3[0] = wordl3[0] | wordr3[0];
572 w3[1] = wordl3[1] | wordr3[1];
573 w3[2] = wordl3[2] | wordr3[2];
574 w3[3] = wordl3[3] | wordr3[3];
576 append_0x80_4 (w0, w1, w2, w3, pw_len);
578 const u32 pw_salt_len = pw_len + salt_len;
584 // first step fixed 56 bytes of salt
591 w0_t[0] = salt_buf0[0];
592 w0_t[1] = salt_buf0[1];
593 w0_t[2] = salt_buf0[2];
594 w0_t[3] = salt_buf0[3];
595 w1_t[0] = salt_buf1[0];
596 w1_t[1] = salt_buf1[1];
597 w1_t[2] = salt_buf1[2];
598 w1_t[3] = salt_buf1[3];
599 w2_t[0] = salt_buf2[0];
600 w2_t[1] = salt_buf2[1];
601 w2_t[2] = salt_buf2[2];
602 w2_t[3] = salt_buf2[3];
603 w3_t[0] = salt_buf3[0];
604 w3_t[1] = salt_buf3[1];
606 // after 56 byte salt, we have beginning of the password
622 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
623 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
624 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
625 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
626 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
627 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
628 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
629 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
630 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
631 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
632 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
633 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
634 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
635 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
636 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
637 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
639 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
640 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
641 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
642 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
643 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
644 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
645 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
646 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
647 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
648 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
649 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
650 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
651 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
652 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
653 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
654 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
656 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
657 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
658 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
659 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
660 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
661 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
662 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
663 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
664 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
665 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
666 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
667 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
668 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
669 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
670 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
671 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
673 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
674 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
675 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
676 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
677 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
678 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
679 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
680 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
681 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
682 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
683 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
684 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
685 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
686 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
687 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
688 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
716 w3_t[2] = pw_salt_len * 8;
719 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
720 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
721 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
722 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
723 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
724 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
725 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
726 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
727 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
728 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
729 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
730 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
731 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
732 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
733 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
734 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
736 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
737 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
738 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
739 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
740 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
741 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
742 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
743 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
744 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
745 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
746 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
747 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
748 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
749 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
750 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
751 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
753 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
754 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
755 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
756 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
757 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
758 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
759 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
760 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
761 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
762 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
763 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
764 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
765 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
766 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
767 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
768 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
770 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
771 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
772 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
773 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
774 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
775 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
776 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
777 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
778 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
779 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
780 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
781 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
782 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
783 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
784 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
785 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
797 #include VECT_COMPARE_S
801 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m11000_s08 (__global pw_t *pws, __global gpu_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global 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)
805 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m11000_s16 (__global pw_t *pws, __global gpu_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global 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)