2 * Author......: Jens Steube <jens.steube@gmail.com>
10 #include "inc_vendor.cl"
11 #include "inc_hash_constants.h"
12 #include "inc_hash_functions.cl"
13 #include "inc_types.cl"
14 #include "inc_common.cl"
17 #include "inc_simd.cl"
19 __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_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_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)
25 const u32 lid = get_local_id (0);
31 const u32 gid = get_global_id (0);
33 if (gid >= gid_max) return;
38 pw_buf0[0] = pws[gid].i[0];
39 pw_buf0[1] = pws[gid].i[1];
40 pw_buf0[2] = pws[gid].i[2];
41 pw_buf0[3] = pws[gid].i[3];
42 pw_buf1[0] = pws[gid].i[4];
43 pw_buf1[1] = pws[gid].i[5];
44 pw_buf1[2] = pws[gid].i[6];
45 pw_buf1[3] = pws[gid].i[7];
47 const u32 pw_len = pws[gid].pw_len;
58 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
59 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
60 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
61 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
62 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
63 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
64 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
65 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
66 salt_buf2[0] = salt_bufs[salt_pos].salt_buf[ 8];
67 salt_buf2[1] = salt_bufs[salt_pos].salt_buf[ 9];
68 salt_buf2[2] = salt_bufs[salt_pos].salt_buf[10];
69 salt_buf2[3] = salt_bufs[salt_pos].salt_buf[11];
70 salt_buf3[0] = salt_bufs[salt_pos].salt_buf[12];
71 salt_buf3[1] = salt_bufs[salt_pos].salt_buf[13];
72 salt_buf3[2] = salt_bufs[salt_pos].salt_buf[14];
73 salt_buf3[3] = salt_bufs[salt_pos].salt_buf[15];
75 const u32 salt_len = salt_bufs[salt_pos].salt_len;
81 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
88 const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1);
90 append_0x80_2x4_VV (w0, w1, out_len);
92 const u32x pw_salt_len = salt_len + out_len;
98 // first step fixed 56 bytes of salt
99 // after 56 byte salt, we have beginning of the password
106 w0_t[0] = salt_buf0[0];
107 w0_t[1] = salt_buf0[1];
108 w0_t[2] = salt_buf0[2];
109 w0_t[3] = salt_buf0[3];
110 w1_t[0] = salt_buf1[0];
111 w1_t[1] = salt_buf1[1];
112 w1_t[2] = salt_buf1[2];
113 w1_t[3] = salt_buf1[3];
114 w2_t[0] = salt_buf2[0];
115 w2_t[1] = salt_buf2[1];
116 w2_t[2] = salt_buf2[2];
117 w2_t[3] = salt_buf2[3];
118 w3_t[0] = salt_buf3[0];
119 w3_t[1] = salt_buf3[1];
132 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
133 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
134 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
135 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
136 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
137 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
138 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
139 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
140 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
141 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
142 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
143 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
144 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
145 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
146 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
147 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
149 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
150 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
151 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
152 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
153 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
154 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
155 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
156 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
157 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
158 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
159 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
160 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
161 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
162 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
163 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
164 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
166 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
167 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
168 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
169 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
170 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
171 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
172 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
173 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
174 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
175 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
176 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
177 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
178 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
179 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
180 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
181 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
183 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
184 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
185 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
186 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
187 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
188 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
189 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
190 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
191 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
192 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
193 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
194 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
195 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
196 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
197 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
198 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
226 w3_t[2] = pw_salt_len * 8;
229 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
230 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
231 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
232 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
233 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
234 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
235 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
236 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
237 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
238 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
239 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
240 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
241 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
242 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
243 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
244 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
246 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
247 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
248 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
249 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
250 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
251 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
252 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
253 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
254 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
255 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
256 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
257 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
258 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
259 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
260 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
261 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
263 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
264 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
265 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
266 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
267 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
268 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
269 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
270 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
271 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
272 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
273 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
274 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
275 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
276 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
277 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
278 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
280 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
281 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
282 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
283 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
284 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
285 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
286 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
287 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
288 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
289 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
290 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
291 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
292 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
293 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
294 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
295 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
302 COMPARE_M_SIMD (a, d, c, b);
306 __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_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_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)
310 __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_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_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)
314 __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_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_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)
320 const u32 lid = get_local_id (0);
326 const u32 gid = get_global_id (0);
328 if (gid >= gid_max) return;
333 pw_buf0[0] = pws[gid].i[0];
334 pw_buf0[1] = pws[gid].i[1];
335 pw_buf0[2] = pws[gid].i[2];
336 pw_buf0[3] = pws[gid].i[3];
337 pw_buf1[0] = pws[gid].i[4];
338 pw_buf1[1] = pws[gid].i[5];
339 pw_buf1[2] = pws[gid].i[6];
340 pw_buf1[3] = pws[gid].i[7];
342 const u32 pw_len = pws[gid].pw_len;
353 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
354 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
355 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
356 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
357 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
358 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
359 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
360 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
361 salt_buf2[0] = salt_bufs[salt_pos].salt_buf[ 8];
362 salt_buf2[1] = salt_bufs[salt_pos].salt_buf[ 9];
363 salt_buf2[2] = salt_bufs[salt_pos].salt_buf[10];
364 salt_buf2[3] = salt_bufs[salt_pos].salt_buf[11];
365 salt_buf3[0] = salt_bufs[salt_pos].salt_buf[12];
366 salt_buf3[1] = salt_bufs[salt_pos].salt_buf[13];
367 salt_buf3[2] = salt_bufs[salt_pos].salt_buf[14];
368 salt_buf3[3] = salt_bufs[salt_pos].salt_buf[15];
370 const u32 salt_len = salt_bufs[salt_pos].salt_len;
376 const u32 search[4] =
378 digests_buf[digests_offset].digest_buf[DGST_R0],
379 digests_buf[digests_offset].digest_buf[DGST_R1],
380 digests_buf[digests_offset].digest_buf[DGST_R2],
381 digests_buf[digests_offset].digest_buf[DGST_R3]
388 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
395 const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1);
397 append_0x80_2x4_VV (w0, w1, out_len);
399 const u32x pw_salt_len = salt_len + out_len;
405 // first step fixed 56 bytes of salt
406 // after 56 byte salt, we have beginning of the password
413 w0_t[0] = salt_buf0[0];
414 w0_t[1] = salt_buf0[1];
415 w0_t[2] = salt_buf0[2];
416 w0_t[3] = salt_buf0[3];
417 w1_t[0] = salt_buf1[0];
418 w1_t[1] = salt_buf1[1];
419 w1_t[2] = salt_buf1[2];
420 w1_t[3] = salt_buf1[3];
421 w2_t[0] = salt_buf2[0];
422 w2_t[1] = salt_buf2[1];
423 w2_t[2] = salt_buf2[2];
424 w2_t[3] = salt_buf2[3];
425 w3_t[0] = salt_buf3[0];
426 w3_t[1] = salt_buf3[1];
439 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
440 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
441 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
442 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
443 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
444 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
445 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
446 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
447 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
448 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
449 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
450 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
451 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
452 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
453 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
454 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
456 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
457 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
458 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
459 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
460 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
461 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
462 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
463 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
464 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
465 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
466 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
467 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
468 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
469 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
470 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
471 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
473 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
474 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
475 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
476 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
477 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
478 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
479 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
480 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
481 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
482 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
483 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
484 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
485 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
486 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
487 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
488 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
490 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
491 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
492 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
493 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
494 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
495 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
496 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
497 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
498 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
499 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
500 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
501 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
502 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
503 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
504 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
505 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
533 w3_t[2] = pw_salt_len * 8;
536 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
537 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
538 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
539 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
540 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
541 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
542 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
543 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
544 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
545 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
546 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
547 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
548 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
549 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
550 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
551 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
553 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
554 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
555 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
556 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
557 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
558 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
559 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
560 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
561 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
562 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
563 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
564 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
565 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
566 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
567 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
568 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
570 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
571 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
572 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
573 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
574 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
575 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
576 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
577 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
578 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
579 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
580 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
581 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
582 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
583 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
584 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
585 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
587 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
588 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
589 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
590 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
591 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
592 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
593 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
594 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
595 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
596 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
597 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
598 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
599 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
600 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
601 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
602 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
609 COMPARE_S_SIMD (a, d, c, b);
613 __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_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_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)
617 __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_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_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)