2 * Author......: Jens Steube <jens.steube@gmail.com>
10 #include "include/constants.h"
11 #include "include/kernel_vendor.h"
18 #include "include/kernel_functions.c"
19 #include "OpenCL/types_ocl.c"
20 #include "OpenCL/common.c"
21 #include "include/rp_kernel.h"
22 #include "OpenCL/rp.c"
23 #include "OpenCL/simd.c"
25 __kernel void m11000_m04 (__global pw_t *pws, __global kernel_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 il_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 < il_cnt; il_pos += VECT_SIZE)
101 const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1);
103 append_0x80_2x4_VV (w0, w1, out_len);
105 const u32x pw_salt_len = salt_len + out_len;
111 // first step fixed 56 bytes of salt
118 w0_t[0] = salt_buf0[0];
119 w0_t[1] = salt_buf0[1];
120 w0_t[2] = salt_buf0[2];
121 w0_t[3] = salt_buf0[3];
122 w1_t[0] = salt_buf1[0];
123 w1_t[1] = salt_buf1[1];
124 w1_t[2] = salt_buf1[2];
125 w1_t[3] = salt_buf1[3];
126 w2_t[0] = salt_buf2[0];
127 w2_t[1] = salt_buf2[1];
128 w2_t[2] = salt_buf2[2];
129 w2_t[3] = salt_buf2[3];
130 w3_t[0] = salt_buf3[0];
131 w3_t[1] = salt_buf3[1];
133 // after 56 byte salt, we have beginning of the password
149 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
150 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
151 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
152 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
153 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
154 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
155 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
156 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
157 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
158 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
159 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
160 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
161 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
162 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
163 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
164 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
166 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
167 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
168 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
169 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
170 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
171 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
172 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
173 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
174 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
175 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
176 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
177 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
178 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
179 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
180 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
181 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
183 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
184 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
185 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
186 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
187 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
188 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
189 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
190 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
191 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
192 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
193 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
194 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
195 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
196 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
197 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
198 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
200 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
201 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
202 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
203 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
204 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
205 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
206 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
207 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
208 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
209 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
210 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
211 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
212 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
213 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
214 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
215 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
243 w3_t[2] = pw_salt_len * 8;
246 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
247 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
248 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
249 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
250 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
251 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
252 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
253 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
254 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
255 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
256 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
257 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
258 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
259 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
260 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
261 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
263 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
264 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
265 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
266 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
267 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
268 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
269 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
270 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
271 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
272 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
273 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
274 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
275 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
276 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
277 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
278 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
280 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
281 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
282 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
283 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
284 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
285 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
286 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
287 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
288 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
289 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
290 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
291 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
292 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
293 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
294 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
295 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
297 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
298 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
299 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
300 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
301 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
302 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
303 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
304 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
305 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
306 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
307 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
308 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
309 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
310 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
311 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
312 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
319 COMPARE_M_SIMD (a, d, c, b);
323 __kernel void m11000_m08 (__global pw_t *pws, __global kernel_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 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
327 __kernel void m11000_m16 (__global pw_t *pws, __global kernel_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 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
331 __kernel void m11000_s04 (__global pw_t *pws, __global kernel_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 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
337 const u32 lid = get_local_id (0);
343 const u32 gid = get_global_id (0);
345 if (gid >= gid_max) return;
349 pw_buf0[0] = pws[gid].i[ 0];
350 pw_buf0[1] = pws[gid].i[ 1];
351 pw_buf0[2] = pws[gid].i[ 2];
352 pw_buf0[3] = pws[gid].i[ 3];
356 pw_buf1[0] = pws[gid].i[ 4];
357 pw_buf1[1] = pws[gid].i[ 5];
358 pw_buf1[2] = pws[gid].i[ 6];
359 pw_buf1[3] = pws[gid].i[ 7];
361 const u32 pw_len = pws[gid].pw_len;
370 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
371 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
372 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
373 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
377 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
378 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
379 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
380 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
384 salt_buf2[0] = salt_bufs[salt_pos].salt_buf[ 8];
385 salt_buf2[1] = salt_bufs[salt_pos].salt_buf[ 9];
386 salt_buf2[2] = salt_bufs[salt_pos].salt_buf[10];
387 salt_buf2[3] = salt_bufs[salt_pos].salt_buf[11];
391 salt_buf3[0] = salt_bufs[salt_pos].salt_buf[12];
392 salt_buf3[1] = salt_bufs[salt_pos].salt_buf[13];
394 const u32 salt_len = salt_bufs[salt_pos].salt_len;
400 const u32 search[4] =
402 digests_buf[digests_offset].digest_buf[DGST_R0],
403 digests_buf[digests_offset].digest_buf[DGST_R1],
404 digests_buf[digests_offset].digest_buf[DGST_R2],
405 digests_buf[digests_offset].digest_buf[DGST_R3]
412 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
419 const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1);
421 append_0x80_2x4_VV (w0, w1, out_len);
423 const u32x pw_salt_len = salt_len + out_len;
429 // first step fixed 56 bytes of salt
436 w0_t[0] = salt_buf0[0];
437 w0_t[1] = salt_buf0[1];
438 w0_t[2] = salt_buf0[2];
439 w0_t[3] = salt_buf0[3];
440 w1_t[0] = salt_buf1[0];
441 w1_t[1] = salt_buf1[1];
442 w1_t[2] = salt_buf1[2];
443 w1_t[3] = salt_buf1[3];
444 w2_t[0] = salt_buf2[0];
445 w2_t[1] = salt_buf2[1];
446 w2_t[2] = salt_buf2[2];
447 w2_t[3] = salt_buf2[3];
448 w3_t[0] = salt_buf3[0];
449 w3_t[1] = salt_buf3[1];
451 // after 56 byte salt, we have beginning of the password
467 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
468 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
469 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
470 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
471 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
472 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
473 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
474 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
475 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
476 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
477 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
478 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
479 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
480 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
481 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
482 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
484 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
485 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
486 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
487 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
488 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
489 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
490 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
491 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
492 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
493 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
494 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
495 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
496 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
497 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
498 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
499 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
501 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
502 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
503 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
504 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
505 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
506 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
507 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
508 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
509 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
510 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
511 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
512 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
513 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
514 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
515 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
516 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
518 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
519 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
520 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
521 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
522 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
523 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
524 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
525 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
526 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
527 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
528 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
529 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
530 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
531 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
532 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
533 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
561 w3_t[2] = pw_salt_len * 8;
564 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
565 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
566 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
567 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
568 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
569 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
570 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
571 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
572 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
573 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
574 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
575 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
576 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
577 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
578 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
579 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
581 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
582 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
583 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
584 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
585 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
586 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
587 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
588 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
589 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
590 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
591 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
592 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
593 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
594 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
595 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
596 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
598 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
599 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
600 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
601 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
602 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
603 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
604 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
605 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
606 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
607 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
608 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
609 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
610 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
611 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
612 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
613 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
615 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
616 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
617 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
618 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
619 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
620 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
621 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
622 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
623 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
624 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
625 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
626 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
627 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
628 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
629 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
630 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
637 COMPARE_S_SIMD (a, d, c, b);
641 __kernel void m11000_s08 (__global pw_t *pws, __global kernel_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 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
645 __kernel void m11000_s16 (__global pw_t *pws, __global kernel_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 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)