2 * Authors.....: Jens Steube <jens.steube@gmail.com>
3 * Gabriele Gristina <matrix@hashcat.net>
4 * magnum <john.magnum@hushmail.com>
13 #include "include/constants.h"
14 #include "include/kernel_vendor.h"
21 #include "include/kernel_functions.c"
22 #include "OpenCL/types_ocl.c"
23 #include "OpenCL/common.c"
24 #include "OpenCL/simd.c"
27 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i)])
29 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1])
31 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3])
33 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3], l_bin2asc[(i).s4], l_bin2asc[(i).s5], l_bin2asc[(i).s6], l_bin2asc[(i).s7])
35 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3], l_bin2asc[(i).s4], l_bin2asc[(i).s5], l_bin2asc[(i).s6], l_bin2asc[(i).s7], l_bin2asc[(i).s8], l_bin2asc[(i).s9], l_bin2asc[(i).sa], l_bin2asc[(i).sb], l_bin2asc[(i).sc], l_bin2asc[(i).sd], l_bin2asc[(i).se], l_bin2asc[(i).sf])
38 static void m02710m (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_len, __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, __local u32 *l_bin2asc)
44 const u32 gid = get_global_id (0);
45 const u32 lid = get_local_id (0);
56 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[0];
57 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[1];
58 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[2];
59 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[3];
60 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[4];
61 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[5];
62 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[6];
63 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[7];
73 const u32 salt_len = salt_bufs[salt_pos].salt_len;
81 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
83 const u32x w0r = ix_create_bft (bfs_buf, il_pos);
85 const u32x w0lr = w0l | w0r;
118 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
119 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
120 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
121 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
122 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
123 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
124 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
125 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
126 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
127 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
128 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
129 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
130 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
131 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
132 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
133 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
135 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
136 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
137 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
138 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
139 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
140 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
141 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
142 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
143 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
144 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
145 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
146 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
147 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
148 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
149 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
150 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
152 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
153 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
154 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
155 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
156 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
157 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
158 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
159 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
160 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
161 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
162 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
163 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
164 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
165 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
166 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
167 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
169 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
170 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
171 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
172 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
173 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
174 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
175 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
176 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
177 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
178 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
179 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
180 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
181 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
182 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
183 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
184 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
191 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
192 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
193 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
194 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
195 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
196 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
197 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
198 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
199 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
200 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
201 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
202 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
203 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
204 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
205 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
206 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
208 w2_t[0] = salt_buf0[0];
209 w2_t[1] = salt_buf0[1];
210 w2_t[2] = salt_buf0[2];
211 w2_t[3] = salt_buf0[3];
212 w3_t[0] = salt_buf1[0];
213 w3_t[1] = salt_buf1[1];
214 w3_t[2] = salt_buf1[2];
215 w3_t[3] = salt_buf1[3];
222 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
223 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
224 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
225 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
226 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
227 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
228 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
229 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
230 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
231 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
232 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
233 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
234 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
235 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
236 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
237 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
239 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
240 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
241 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
242 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
243 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
244 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
245 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
246 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
247 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
248 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
249 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
250 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
251 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
252 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
253 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
254 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
256 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
257 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
258 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
259 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
260 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
261 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
262 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
263 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
264 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
265 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
266 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
267 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
268 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
269 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
270 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
271 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
273 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
274 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
275 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
276 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
277 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
278 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
279 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
280 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
281 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
282 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
283 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
284 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
285 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
286 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
287 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
288 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
290 const u32x r_a = a + MD5M_A;
291 const u32x r_b = b + MD5M_B;
292 const u32x r_c = c + MD5M_C;
293 const u32x r_d = d + MD5M_D;
295 const u32x r_14 = (32 + salt_len) * 8;
302 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C00, MD5S00);
303 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C01, MD5S01);
304 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C02, MD5S02);
305 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C03, MD5S03);
306 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C04, MD5S00);
307 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C05, MD5S01);
308 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C06, MD5S02);
309 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C07, MD5S03);
310 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C08, MD5S00);
311 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C09, MD5S01);
312 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C0a, MD5S02);
313 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0b, MD5S03);
314 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C0c, MD5S00);
315 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C0d, MD5S01);
316 MD5_STEP (MD5_Fo, c, d, a, b, r_14, MD5C0e, MD5S02);
317 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0f, MD5S03);
319 MD5_STEP0(MD5_Go, a, b, c, d, MD5C10, MD5S10);
320 MD5_STEP0(MD5_Go, d, a, b, c, MD5C11, MD5S11);
321 MD5_STEP0(MD5_Go, c, d, a, b, MD5C12, MD5S12);
322 MD5_STEP0(MD5_Go, b, c, d, a, MD5C13, MD5S13);
323 MD5_STEP0(MD5_Go, a, b, c, d, MD5C14, MD5S10);
324 MD5_STEP0(MD5_Go, d, a, b, c, MD5C15, MD5S11);
325 MD5_STEP0(MD5_Go, c, d, a, b, MD5C16, MD5S12);
326 MD5_STEP0(MD5_Go, b, c, d, a, MD5C17, MD5S13);
327 MD5_STEP0(MD5_Go, a, b, c, d, MD5C18, MD5S10);
328 MD5_STEP (MD5_Go, d, a, b, c, r_14, MD5C19, MD5S11);
329 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1a, MD5S12);
330 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1b, MD5S13);
331 MD5_STEP0(MD5_Go, a, b, c, d, MD5C1c, MD5S10);
332 MD5_STEP0(MD5_Go, d, a, b, c, MD5C1d, MD5S11);
333 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1e, MD5S12);
334 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1f, MD5S13);
336 MD5_STEP0(MD5_H , a, b, c, d, MD5C20, MD5S20);
337 MD5_STEP0(MD5_H , d, a, b, c, MD5C21, MD5S21);
338 MD5_STEP0(MD5_H , c, d, a, b, MD5C22, MD5S22);
339 MD5_STEP (MD5_H , b, c, d, a, r_14, MD5C23, MD5S23);
340 MD5_STEP0(MD5_H , a, b, c, d, MD5C24, MD5S20);
341 MD5_STEP0(MD5_H , d, a, b, c, MD5C25, MD5S21);
342 MD5_STEP0(MD5_H , c, d, a, b, MD5C26, MD5S22);
343 MD5_STEP0(MD5_H , b, c, d, a, MD5C27, MD5S23);
344 MD5_STEP0(MD5_H , a, b, c, d, MD5C28, MD5S20);
345 MD5_STEP0(MD5_H , d, a, b, c, MD5C29, MD5S21);
346 MD5_STEP0(MD5_H , c, d, a, b, MD5C2a, MD5S22);
347 MD5_STEP0(MD5_H , b, c, d, a, MD5C2b, MD5S23);
348 MD5_STEP0(MD5_H , a, b, c, d, MD5C2c, MD5S20);
349 MD5_STEP0(MD5_H , d, a, b, c, MD5C2d, MD5S21);
350 MD5_STEP0(MD5_H , c, d, a, b, MD5C2e, MD5S22);
351 MD5_STEP0(MD5_H , b, c, d, a, MD5C2f, MD5S23);
353 MD5_STEP0(MD5_I , a, b, c, d, MD5C30, MD5S30);
354 MD5_STEP0(MD5_I , d, a, b, c, MD5C31, MD5S31);
355 MD5_STEP (MD5_I , c, d, a, b, r_14, MD5C32, MD5S32);
356 MD5_STEP0(MD5_I , b, c, d, a, MD5C33, MD5S33);
357 MD5_STEP0(MD5_I , a, b, c, d, MD5C34, MD5S30);
358 MD5_STEP0(MD5_I , d, a, b, c, MD5C35, MD5S31);
359 MD5_STEP0(MD5_I , c, d, a, b, MD5C36, MD5S32);
360 MD5_STEP0(MD5_I , b, c, d, a, MD5C37, MD5S33);
361 MD5_STEP0(MD5_I , a, b, c, d, MD5C38, MD5S30);
362 MD5_STEP0(MD5_I , d, a, b, c, MD5C39, MD5S31);
363 MD5_STEP0(MD5_I , c, d, a, b, MD5C3a, MD5S32);
364 MD5_STEP0(MD5_I , b, c, d, a, MD5C3b, MD5S33);
365 MD5_STEP0(MD5_I , a, b, c, d, MD5C3c, MD5S30);
366 MD5_STEP0(MD5_I , d, a, b, c, MD5C3d, MD5S31);
367 MD5_STEP0(MD5_I , c, d, a, b, MD5C3e, MD5S32);
368 MD5_STEP0(MD5_I , b, c, d, a, MD5C3f, MD5S33);
375 COMPARE_M_SIMD (a, d, c, b);
379 static void m02710s (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_len, __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, __local u32 *l_bin2asc)
385 const u32 gid = get_global_id (0);
386 const u32 lid = get_local_id (0);
397 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[0];
398 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[1];
399 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[2];
400 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[3];
401 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[4];
402 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[5];
403 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[6];
404 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[7];
414 const u32 salt_len = salt_bufs[salt_pos].salt_len;
420 const u32 search[4] =
422 digests_buf[digests_offset].digest_buf[DGST_R0],
423 digests_buf[digests_offset].digest_buf[DGST_R1],
424 digests_buf[digests_offset].digest_buf[DGST_R2],
425 digests_buf[digests_offset].digest_buf[DGST_R3]
434 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
436 const u32x w0r = ix_create_bft (bfs_buf, il_pos);
438 const u32x w0lr = w0l | w0r;
471 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
472 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
473 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
474 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
475 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
476 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
477 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
478 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
479 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
480 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
481 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
482 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
483 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
484 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
485 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
486 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
488 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
489 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
490 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
491 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
492 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
493 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
494 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
495 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
496 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
497 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
498 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
499 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
500 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
501 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
502 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
503 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
505 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
506 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
507 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
508 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
509 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
510 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
511 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
512 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
513 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
514 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
515 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
516 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
517 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
518 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
519 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
520 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
522 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
523 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
524 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
525 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
526 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
527 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
528 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
529 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
530 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
531 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
532 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
533 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
534 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
535 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
536 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
537 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
544 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
545 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
546 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
547 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
548 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
549 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
550 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
551 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
552 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
553 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
554 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
555 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
556 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
557 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
558 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
559 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
561 w2_t[0] = salt_buf0[0];
562 w2_t[1] = salt_buf0[1];
563 w2_t[2] = salt_buf0[2];
564 w2_t[3] = salt_buf0[3];
565 w3_t[0] = salt_buf1[0];
566 w3_t[1] = salt_buf1[1];
567 w3_t[2] = salt_buf1[2];
568 w3_t[3] = salt_buf1[3];
575 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
576 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
577 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
578 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
579 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
580 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
581 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
582 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
583 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
584 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
585 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
586 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
587 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
588 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
589 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
590 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
592 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
593 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
594 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
595 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
596 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
597 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
598 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
599 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
600 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
601 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
602 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
603 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
604 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
605 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
606 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
607 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
609 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
610 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
611 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
612 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
613 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
614 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
615 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
616 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
617 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
618 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
619 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
620 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
621 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
622 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
623 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
624 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
626 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
627 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
628 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
629 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
630 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
631 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
632 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
633 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
634 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
635 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
636 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
637 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
638 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
639 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
640 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
641 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
643 const u32x r_a = a + MD5M_A;
644 const u32x r_b = b + MD5M_B;
645 const u32x r_c = c + MD5M_C;
646 const u32x r_d = d + MD5M_D;
648 const u32x r_14 = (32 + salt_len) * 8;
655 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C00, MD5S00);
656 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C01, MD5S01);
657 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C02, MD5S02);
658 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C03, MD5S03);
659 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C04, MD5S00);
660 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C05, MD5S01);
661 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C06, MD5S02);
662 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C07, MD5S03);
663 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C08, MD5S00);
664 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C09, MD5S01);
665 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C0a, MD5S02);
666 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0b, MD5S03);
667 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C0c, MD5S00);
668 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C0d, MD5S01);
669 MD5_STEP (MD5_Fo, c, d, a, b, r_14, MD5C0e, MD5S02);
670 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0f, MD5S03);
672 MD5_STEP0(MD5_Go, a, b, c, d, MD5C10, MD5S10);
673 MD5_STEP0(MD5_Go, d, a, b, c, MD5C11, MD5S11);
674 MD5_STEP0(MD5_Go, c, d, a, b, MD5C12, MD5S12);
675 MD5_STEP0(MD5_Go, b, c, d, a, MD5C13, MD5S13);
676 MD5_STEP0(MD5_Go, a, b, c, d, MD5C14, MD5S10);
677 MD5_STEP0(MD5_Go, d, a, b, c, MD5C15, MD5S11);
678 MD5_STEP0(MD5_Go, c, d, a, b, MD5C16, MD5S12);
679 MD5_STEP0(MD5_Go, b, c, d, a, MD5C17, MD5S13);
680 MD5_STEP0(MD5_Go, a, b, c, d, MD5C18, MD5S10);
681 MD5_STEP (MD5_Go, d, a, b, c, r_14, MD5C19, MD5S11);
682 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1a, MD5S12);
683 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1b, MD5S13);
684 MD5_STEP0(MD5_Go, a, b, c, d, MD5C1c, MD5S10);
685 MD5_STEP0(MD5_Go, d, a, b, c, MD5C1d, MD5S11);
686 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1e, MD5S12);
687 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1f, MD5S13);
689 MD5_STEP0(MD5_H , a, b, c, d, MD5C20, MD5S20);
690 MD5_STEP0(MD5_H , d, a, b, c, MD5C21, MD5S21);
691 MD5_STEP0(MD5_H , c, d, a, b, MD5C22, MD5S22);
692 MD5_STEP (MD5_H , b, c, d, a, r_14, MD5C23, MD5S23);
693 MD5_STEP0(MD5_H , a, b, c, d, MD5C24, MD5S20);
694 MD5_STEP0(MD5_H , d, a, b, c, MD5C25, MD5S21);
695 MD5_STEP0(MD5_H , c, d, a, b, MD5C26, MD5S22);
696 MD5_STEP0(MD5_H , b, c, d, a, MD5C27, MD5S23);
697 MD5_STEP0(MD5_H , a, b, c, d, MD5C28, MD5S20);
698 MD5_STEP0(MD5_H , d, a, b, c, MD5C29, MD5S21);
699 MD5_STEP0(MD5_H , c, d, a, b, MD5C2a, MD5S22);
700 MD5_STEP0(MD5_H , b, c, d, a, MD5C2b, MD5S23);
701 MD5_STEP0(MD5_H , a, b, c, d, MD5C2c, MD5S20);
702 MD5_STEP0(MD5_H , d, a, b, c, MD5C2d, MD5S21);
703 MD5_STEP0(MD5_H , c, d, a, b, MD5C2e, MD5S22);
704 MD5_STEP0(MD5_H , b, c, d, a, MD5C2f, MD5S23);
706 MD5_STEP0(MD5_I , a, b, c, d, MD5C30, MD5S30);
707 MD5_STEP0(MD5_I , d, a, b, c, MD5C31, MD5S31);
708 MD5_STEP (MD5_I , c, d, a, b, r_14, MD5C32, MD5S32);
709 MD5_STEP0(MD5_I , b, c, d, a, MD5C33, MD5S33);
710 MD5_STEP0(MD5_I , a, b, c, d, MD5C34, MD5S30);
711 MD5_STEP0(MD5_I , d, a, b, c, MD5C35, MD5S31);
712 MD5_STEP0(MD5_I , c, d, a, b, MD5C36, MD5S32);
713 MD5_STEP0(MD5_I , b, c, d, a, MD5C37, MD5S33);
714 MD5_STEP0(MD5_I , a, b, c, d, MD5C38, MD5S30);
715 MD5_STEP0(MD5_I , d, a, b, c, MD5C39, MD5S31);
716 MD5_STEP0(MD5_I , c, d, a, b, MD5C3a, MD5S32);
717 MD5_STEP0(MD5_I , b, c, d, a, MD5C3b, MD5S33);
718 MD5_STEP0(MD5_I , a, b, c, d, MD5C3c, MD5S30);
720 if (MATCHES_NONE_VS ((a + r_a), search[0])) continue;
722 MD5_STEP0(MD5_I , d, a, b, c, MD5C3d, MD5S31);
723 MD5_STEP0(MD5_I , c, d, a, b, MD5C3e, MD5S32);
724 MD5_STEP0(MD5_I , b, c, d, a, MD5C3f, MD5S33);
731 COMPARE_S_SIMD (a, d, c, b);
735 __kernel void m02710_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)
741 const u32 gid = get_global_id (0);
742 const u32 lid = get_local_id (0);
743 const u32 lsz = get_local_size (0);
751 w0[0] = pws[gid].i[ 0];
752 w0[1] = pws[gid].i[ 1];
753 w0[2] = pws[gid].i[ 2];
754 w0[3] = pws[gid].i[ 3];
774 w3[2] = pws[gid].i[14];
777 const u32 pw_len = pws[gid].pw_len;
783 __local u32 l_bin2asc[256];
785 for (u32 i = lid; i < 256; i += lsz)
787 const u32 i0 = (i >> 0) & 15;
788 const u32 i1 = (i >> 4) & 15;
790 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
791 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
794 barrier (CLK_LOCAL_MEM_FENCE);
796 if (gid >= gid_max) return;
802 m02710m (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);
805 __kernel void m02710_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)
811 const u32 gid = get_global_id (0);
812 const u32 lid = get_local_id (0);
813 const u32 lsz = get_local_size (0);
821 w0[0] = pws[gid].i[ 0];
822 w0[1] = pws[gid].i[ 1];
823 w0[2] = pws[gid].i[ 2];
824 w0[3] = pws[gid].i[ 3];
828 w1[0] = pws[gid].i[ 4];
829 w1[1] = pws[gid].i[ 5];
830 w1[2] = pws[gid].i[ 6];
831 w1[3] = pws[gid].i[ 7];
844 w3[2] = pws[gid].i[14];
847 const u32 pw_len = pws[gid].pw_len;
853 __local u32 l_bin2asc[256];
855 for (u32 i = lid; i < 256; i += lsz)
857 const u32 i0 = (i >> 0) & 15;
858 const u32 i1 = (i >> 4) & 15;
860 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
861 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
864 barrier (CLK_LOCAL_MEM_FENCE);
866 if (gid >= gid_max) return;
872 m02710m (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);
875 __kernel void m02710_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)
881 const u32 gid = get_global_id (0);
882 const u32 lid = get_local_id (0);
883 const u32 lsz = get_local_size (0);
891 w0[0] = pws[gid].i[ 0];
892 w0[1] = pws[gid].i[ 1];
893 w0[2] = pws[gid].i[ 2];
894 w0[3] = pws[gid].i[ 3];
898 w1[0] = pws[gid].i[ 4];
899 w1[1] = pws[gid].i[ 5];
900 w1[2] = pws[gid].i[ 6];
901 w1[3] = pws[gid].i[ 7];
905 w2[0] = pws[gid].i[ 8];
906 w2[1] = pws[gid].i[ 9];
907 w2[2] = pws[gid].i[10];
908 w2[3] = pws[gid].i[11];
912 w3[0] = pws[gid].i[12];
913 w3[1] = pws[gid].i[13];
914 w3[2] = pws[gid].i[14];
915 w3[3] = pws[gid].i[15];
917 const u32 pw_len = pws[gid].pw_len;
923 __local u32 l_bin2asc[256];
925 for (u32 i = lid; i < 256; i += lsz)
927 const u32 i0 = (i >> 0) & 15;
928 const u32 i1 = (i >> 4) & 15;
930 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
931 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
934 barrier (CLK_LOCAL_MEM_FENCE);
936 if (gid >= gid_max) return;
942 m02710m (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);
945 __kernel void m02710_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)
951 const u32 gid = get_global_id (0);
952 const u32 lid = get_local_id (0);
953 const u32 lsz = get_local_size (0);
961 w0[0] = pws[gid].i[ 0];
962 w0[1] = pws[gid].i[ 1];
963 w0[2] = pws[gid].i[ 2];
964 w0[3] = pws[gid].i[ 3];
984 w3[2] = pws[gid].i[14];
987 const u32 pw_len = pws[gid].pw_len;
993 __local u32 l_bin2asc[256];
995 for (u32 i = lid; i < 256; i += lsz)
997 const u32 i0 = (i >> 0) & 15;
998 const u32 i1 = (i >> 4) & 15;
1000 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
1001 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
1004 barrier (CLK_LOCAL_MEM_FENCE);
1006 if (gid >= gid_max) return;
1012 m02710s (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);
1015 __kernel void m02710_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)
1021 const u32 gid = get_global_id (0);
1022 const u32 lid = get_local_id (0);
1023 const u32 lsz = get_local_size (0);
1031 w0[0] = pws[gid].i[ 0];
1032 w0[1] = pws[gid].i[ 1];
1033 w0[2] = pws[gid].i[ 2];
1034 w0[3] = pws[gid].i[ 3];
1038 w1[0] = pws[gid].i[ 4];
1039 w1[1] = pws[gid].i[ 5];
1040 w1[2] = pws[gid].i[ 6];
1041 w1[3] = pws[gid].i[ 7];
1054 w3[2] = pws[gid].i[14];
1057 const u32 pw_len = pws[gid].pw_len;
1063 __local u32 l_bin2asc[256];
1065 for (u32 i = lid; i < 256; i += lsz)
1067 const u32 i0 = (i >> 0) & 15;
1068 const u32 i1 = (i >> 4) & 15;
1070 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
1071 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
1074 barrier (CLK_LOCAL_MEM_FENCE);
1076 if (gid >= gid_max) return;
1082 m02710s (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);
1085 __kernel void m02710_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)
1091 const u32 gid = get_global_id (0);
1092 const u32 lid = get_local_id (0);
1093 const u32 lsz = get_local_size (0);
1101 w0[0] = pws[gid].i[ 0];
1102 w0[1] = pws[gid].i[ 1];
1103 w0[2] = pws[gid].i[ 2];
1104 w0[3] = pws[gid].i[ 3];
1108 w1[0] = pws[gid].i[ 4];
1109 w1[1] = pws[gid].i[ 5];
1110 w1[2] = pws[gid].i[ 6];
1111 w1[3] = pws[gid].i[ 7];
1115 w2[0] = pws[gid].i[ 8];
1116 w2[1] = pws[gid].i[ 9];
1117 w2[2] = pws[gid].i[10];
1118 w2[3] = pws[gid].i[11];
1122 w3[0] = pws[gid].i[12];
1123 w3[1] = pws[gid].i[13];
1124 w3[2] = pws[gid].i[14];
1125 w3[3] = pws[gid].i[15];
1127 const u32 pw_len = pws[gid].pw_len;
1133 __local u32 l_bin2asc[256];
1135 for (u32 i = lid; i < 256; i += lsz)
1137 const u32 i0 = (i >> 0) & 15;
1138 const u32 i1 = (i >> 4) & 15;
1140 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
1141 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
1144 barrier (CLK_LOCAL_MEM_FENCE);
1146 if (gid >= gid_max) return;
1152 m02710s (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);