2 * Author......: Jens Steube <jens.steube@gmail.com>
10 #include "inc_hash_constants.h"
11 #include "inc_vendor.cl"
18 #include "inc_hash_functions.cl"
19 #include "inc_types.cl"
20 #include "inc_common.cl"
23 #include "inc_simd.cl"
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;
44 pw_buf0[0] = pws[gid].i[0];
45 pw_buf0[1] = pws[gid].i[1];
46 pw_buf0[2] = pws[gid].i[2];
47 pw_buf0[3] = pws[gid].i[3];
48 pw_buf1[0] = pws[gid].i[4];
49 pw_buf1[1] = pws[gid].i[5];
50 pw_buf1[2] = pws[gid].i[6];
51 pw_buf1[3] = pws[gid].i[7];
53 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];
68 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
69 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
70 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
71 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
72 salt_buf2[0] = salt_bufs[salt_pos].salt_buf[ 8];
73 salt_buf2[1] = salt_bufs[salt_pos].salt_buf[ 9];
74 salt_buf2[2] = salt_bufs[salt_pos].salt_buf[10];
75 salt_buf2[3] = salt_bufs[salt_pos].salt_buf[11];
76 salt_buf3[0] = salt_bufs[salt_pos].salt_buf[12];
77 salt_buf3[1] = salt_bufs[salt_pos].salt_buf[13];
78 salt_buf3[2] = salt_bufs[salt_pos].salt_buf[14];
79 salt_buf3[3] = salt_bufs[salt_pos].salt_buf[15];
81 const u32 salt_len = salt_bufs[salt_pos].salt_len;
87 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
94 const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1);
96 append_0x80_2x4_VV (w0, w1, out_len);
98 const u32x pw_salt_len = salt_len + out_len;
104 // first step fixed 56 bytes of salt
105 // after 56 byte salt, we have beginning of the password
112 w0_t[0] = salt_buf0[0];
113 w0_t[1] = salt_buf0[1];
114 w0_t[2] = salt_buf0[2];
115 w0_t[3] = salt_buf0[3];
116 w1_t[0] = salt_buf1[0];
117 w1_t[1] = salt_buf1[1];
118 w1_t[2] = salt_buf1[2];
119 w1_t[3] = salt_buf1[3];
120 w2_t[0] = salt_buf2[0];
121 w2_t[1] = salt_buf2[1];
122 w2_t[2] = salt_buf2[2];
123 w2_t[3] = salt_buf2[3];
124 w3_t[0] = salt_buf3[0];
125 w3_t[1] = salt_buf3[1];
138 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
139 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
140 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
141 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
142 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
143 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
144 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
145 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
146 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
147 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
148 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
149 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
150 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
151 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
152 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
153 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
155 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
156 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
157 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
158 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
159 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
160 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
161 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
162 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
163 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
164 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
165 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
166 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
167 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
168 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
169 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
170 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
172 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
173 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
174 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
175 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
176 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
177 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
178 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
179 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
180 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
181 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
182 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
183 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
184 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
185 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
186 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
187 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
189 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
190 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
191 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
192 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
193 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
194 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
195 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
196 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
197 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
198 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
199 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
200 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
201 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
202 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
203 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
204 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
232 w3_t[2] = pw_salt_len * 8;
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);
308 COMPARE_M_SIMD (a, d, c, b);
312 __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)
316 __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)
320 __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)
326 const u32 lid = get_local_id (0);
332 const u32 gid = get_global_id (0);
334 if (gid >= gid_max) return;
339 pw_buf0[0] = pws[gid].i[0];
340 pw_buf0[1] = pws[gid].i[1];
341 pw_buf0[2] = pws[gid].i[2];
342 pw_buf0[3] = pws[gid].i[3];
343 pw_buf1[0] = pws[gid].i[4];
344 pw_buf1[1] = pws[gid].i[5];
345 pw_buf1[2] = pws[gid].i[6];
346 pw_buf1[3] = pws[gid].i[7];
348 const u32 pw_len = pws[gid].pw_len;
359 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
360 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
361 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
362 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
363 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
364 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
365 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
366 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
367 salt_buf2[0] = salt_bufs[salt_pos].salt_buf[ 8];
368 salt_buf2[1] = salt_bufs[salt_pos].salt_buf[ 9];
369 salt_buf2[2] = salt_bufs[salt_pos].salt_buf[10];
370 salt_buf2[3] = salt_bufs[salt_pos].salt_buf[11];
371 salt_buf3[0] = salt_bufs[salt_pos].salt_buf[12];
372 salt_buf3[1] = salt_bufs[salt_pos].salt_buf[13];
373 salt_buf3[2] = salt_bufs[salt_pos].salt_buf[14];
374 salt_buf3[3] = salt_bufs[salt_pos].salt_buf[15];
376 const u32 salt_len = salt_bufs[salt_pos].salt_len;
382 const u32 search[4] =
384 digests_buf[digests_offset].digest_buf[DGST_R0],
385 digests_buf[digests_offset].digest_buf[DGST_R1],
386 digests_buf[digests_offset].digest_buf[DGST_R2],
387 digests_buf[digests_offset].digest_buf[DGST_R3]
394 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
401 const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1);
403 append_0x80_2x4_VV (w0, w1, out_len);
405 const u32x pw_salt_len = salt_len + out_len;
411 // first step fixed 56 bytes of salt
412 // after 56 byte salt, we have beginning of the password
419 w0_t[0] = salt_buf0[0];
420 w0_t[1] = salt_buf0[1];
421 w0_t[2] = salt_buf0[2];
422 w0_t[3] = salt_buf0[3];
423 w1_t[0] = salt_buf1[0];
424 w1_t[1] = salt_buf1[1];
425 w1_t[2] = salt_buf1[2];
426 w1_t[3] = salt_buf1[3];
427 w2_t[0] = salt_buf2[0];
428 w2_t[1] = salt_buf2[1];
429 w2_t[2] = salt_buf2[2];
430 w2_t[3] = salt_buf2[3];
431 w3_t[0] = salt_buf3[0];
432 w3_t[1] = salt_buf3[1];
445 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
446 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
447 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
448 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
449 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
450 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
451 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
452 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
453 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
454 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
455 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
456 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
457 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
458 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
459 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
460 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
462 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
463 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
464 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
465 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
466 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
467 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
468 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
469 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
470 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
471 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
472 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
473 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
474 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
475 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
476 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
477 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
479 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
480 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
481 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
482 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
483 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
484 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
485 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
486 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
487 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
488 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
489 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
490 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
491 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
492 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
493 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
494 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
496 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
497 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
498 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
499 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
500 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
501 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
502 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
503 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
504 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
505 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
506 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
507 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
508 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
509 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
510 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
511 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
539 w3_t[2] = pw_salt_len * 8;
542 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
543 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
544 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
545 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
546 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
547 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
548 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
549 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
550 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
551 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
552 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
553 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
554 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
555 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
556 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
557 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
559 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
560 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
561 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
562 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
563 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
564 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
565 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
566 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
567 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
568 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
569 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
570 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
571 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
572 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
573 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
574 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
576 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
577 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
578 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
579 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
580 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
581 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
582 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
583 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
584 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
585 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
586 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
587 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
588 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
589 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
590 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
591 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
593 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
594 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
595 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
596 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
597 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
598 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
599 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
600 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
601 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
602 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
603 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
604 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
605 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
606 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
607 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
608 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
615 COMPARE_S_SIMD (a, d, c, b);
619 __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)
623 __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)