2 * Author......: Jens Steube <jens.steube@gmail.com>
8 #include "include/constants.h"
9 #include "include/kernel_vendor.h"
16 #include "include/kernel_functions.c"
17 #include "types_ocl.c"
19 #include "include/rp_gpu.h"
22 #define COMPARE_S "check_single_comp4.c"
23 #define COMPARE_M "check_multi_comp4.c"
25 __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 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
31 const u32 lid = get_local_id (0);
37 const u32 gid = get_global_id (0);
39 if (gid >= gid_max) return;
43 pw_buf0[0] = pws[gid].i[ 0];
44 pw_buf0[1] = pws[gid].i[ 1];
45 pw_buf0[2] = pws[gid].i[ 2];
46 pw_buf0[3] = pws[gid].i[ 3];
50 pw_buf1[0] = pws[gid].i[ 4];
51 pw_buf1[1] = pws[gid].i[ 5];
52 pw_buf1[2] = pws[gid].i[ 6];
53 pw_buf1[3] = pws[gid].i[ 7];
55 const u32 pw_len = pws[gid].pw_len;
64 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
65 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
66 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
67 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
71 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
72 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
73 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
74 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
78 salt_buf2[0] = salt_bufs[salt_pos].salt_buf[ 8];
79 salt_buf2[1] = salt_bufs[salt_pos].salt_buf[ 9];
80 salt_buf2[2] = salt_bufs[salt_pos].salt_buf[10];
81 salt_buf2[3] = salt_bufs[salt_pos].salt_buf[11];
85 salt_buf3[0] = salt_bufs[salt_pos].salt_buf[12];
86 salt_buf3[1] = salt_bufs[salt_pos].salt_buf[13];
88 const u32 salt_len = salt_bufs[salt_pos].salt_len;
94 for (u32 il_pos = 0; il_pos < rules_cnt; il_pos++)
118 const u32 out_len = apply_rules (rules_buf[il_pos].cmds, w0, w1, pw_len);
120 const u32 pw_salt_len = pw_len + salt_len;
122 append_0x80_4 (w0, w1, w2, w3, out_len);
128 // first step fixed 56 bytes of salt
135 w0_t[0] = salt_buf0[0];
136 w0_t[1] = salt_buf0[1];
137 w0_t[2] = salt_buf0[2];
138 w0_t[3] = salt_buf0[3];
139 w1_t[0] = salt_buf1[0];
140 w1_t[1] = salt_buf1[1];
141 w1_t[2] = salt_buf1[2];
142 w1_t[3] = salt_buf1[3];
143 w2_t[0] = salt_buf2[0];
144 w2_t[1] = salt_buf2[1];
145 w2_t[2] = salt_buf2[2];
146 w2_t[3] = salt_buf2[3];
147 w3_t[0] = salt_buf3[0];
148 w3_t[1] = salt_buf3[1];
150 // after 56 byte salt, we have beginning of the password
166 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
167 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
168 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
169 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
170 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
171 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
172 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
173 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
174 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
175 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
176 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
177 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
178 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
179 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
180 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
181 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
183 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
184 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
185 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
186 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
187 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
188 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
189 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
190 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
191 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
192 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
193 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
194 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
195 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
196 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
197 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
198 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
200 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
201 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
202 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
203 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
204 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
205 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
206 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
207 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
208 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
209 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
210 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
211 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
212 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
213 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
214 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
215 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
217 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
218 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
219 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
220 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
221 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
222 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
223 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
224 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
225 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
226 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
227 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
228 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
229 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
230 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
231 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
232 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
260 w3_t[2] = pw_salt_len * 8;
263 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
264 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
265 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
266 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
267 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
268 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
269 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
270 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
271 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
272 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
273 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
274 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
275 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
276 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
277 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
278 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
280 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
281 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
282 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
283 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
284 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
285 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
286 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
287 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
288 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
289 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
290 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
291 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
292 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
293 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
294 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
295 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
297 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
298 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
299 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
300 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
301 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
302 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
303 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
304 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
305 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
306 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
307 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
308 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
309 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
310 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
311 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
312 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
314 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
315 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
316 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
317 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
318 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
319 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
320 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
321 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
322 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
323 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
324 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
325 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
326 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
327 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
328 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
329 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
345 __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 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
349 __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 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
353 __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 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
359 const u32 lid = get_local_id (0);
365 const u32 gid = get_global_id (0);
367 if (gid >= gid_max) return;
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;
392 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
393 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
394 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
395 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
399 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
400 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
401 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
402 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
406 salt_buf2[0] = salt_bufs[salt_pos].salt_buf[ 8];
407 salt_buf2[1] = salt_bufs[salt_pos].salt_buf[ 9];
408 salt_buf2[2] = salt_bufs[salt_pos].salt_buf[10];
409 salt_buf2[3] = salt_bufs[salt_pos].salt_buf[11];
413 salt_buf3[0] = salt_bufs[salt_pos].salt_buf[12];
414 salt_buf3[1] = salt_bufs[salt_pos].salt_buf[13];
416 const u32 salt_len = salt_bufs[salt_pos].salt_len;
422 const u32 search[4] =
424 digests_buf[digests_offset].digest_buf[DGST_R0],
425 digests_buf[digests_offset].digest_buf[DGST_R1],
426 digests_buf[digests_offset].digest_buf[DGST_R2],
427 digests_buf[digests_offset].digest_buf[DGST_R3]
434 for (u32 il_pos = 0; il_pos < rules_cnt; il_pos++)
458 const u32 out_len = apply_rules (rules_buf[il_pos].cmds, w0, w1, pw_len);
460 const u32 pw_salt_len = pw_len + salt_len;
462 append_0x80_4 (w0, w1, w2, w3, out_len);
468 // first step fixed 56 bytes of salt
475 w0_t[0] = salt_buf0[0];
476 w0_t[1] = salt_buf0[1];
477 w0_t[2] = salt_buf0[2];
478 w0_t[3] = salt_buf0[3];
479 w1_t[0] = salt_buf1[0];
480 w1_t[1] = salt_buf1[1];
481 w1_t[2] = salt_buf1[2];
482 w1_t[3] = salt_buf1[3];
483 w2_t[0] = salt_buf2[0];
484 w2_t[1] = salt_buf2[1];
485 w2_t[2] = salt_buf2[2];
486 w2_t[3] = salt_buf2[3];
487 w3_t[0] = salt_buf3[0];
488 w3_t[1] = salt_buf3[1];
490 // after 56 byte salt, we have beginning of the password
506 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
507 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
508 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
509 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
510 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
511 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
512 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
513 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
514 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
515 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
516 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
517 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
518 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
519 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
520 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
521 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
523 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
524 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
525 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
526 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
527 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
528 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
529 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
530 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
531 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
532 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
533 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
534 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
535 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
536 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
537 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
538 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
540 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
541 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
542 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
543 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
544 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
545 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
546 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
547 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
548 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
549 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
550 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
551 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
552 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
553 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
554 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
555 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
557 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
558 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
559 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
560 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
561 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
562 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
563 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
564 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
565 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
566 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
567 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
568 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
569 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
570 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
571 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
572 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
600 w3_t[2] = pw_salt_len * 8;
603 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
604 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
605 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
606 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
607 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
608 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
609 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
610 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
611 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
612 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
613 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
614 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
615 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
616 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
617 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
618 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
620 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
621 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
622 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
623 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
624 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
625 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
626 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
627 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
628 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
629 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
630 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
631 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
632 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
633 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
634 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
635 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
637 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
638 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
639 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
640 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
641 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
642 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
643 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
644 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
645 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
646 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
647 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
648 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
649 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
650 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
651 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
652 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
654 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
655 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
656 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
657 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
658 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
659 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
660 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
661 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
662 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
663 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
664 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
665 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
666 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
667 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
668 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
669 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
685 __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 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
689 __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 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)