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 m02810m (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);
53 s[0] = salt_bufs[salt_pos].salt_buf_pc[0];
54 s[1] = salt_bufs[salt_pos].salt_buf_pc[1];
55 s[2] = salt_bufs[salt_pos].salt_buf_pc[2];
56 s[3] = salt_bufs[salt_pos].salt_buf_pc[3];
57 s[4] = salt_bufs[salt_pos].salt_buf_pc[4];
58 s[5] = salt_bufs[salt_pos].salt_buf_pc[5];
59 s[6] = salt_bufs[salt_pos].salt_buf_pc[6];
60 s[7] = salt_bufs[salt_pos].salt_buf_pc[7];
62 const u32 r_00 = 0x80;
63 const u32 r_14 = 64 * 8;
71 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
73 const u32x w0r = ix_create_bft (bfs_buf, il_pos);
75 const u32x w0lr = w0l | w0r;
110 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
111 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
112 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
113 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
114 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
115 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
116 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
117 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
118 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
119 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
120 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
121 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
122 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
123 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
124 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
125 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
127 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
128 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
129 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
130 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
131 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
132 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
133 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
134 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
135 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
136 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
137 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
138 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
139 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
140 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
141 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
142 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
144 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
145 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
146 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
147 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
148 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
149 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
150 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
151 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
152 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
153 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
154 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
155 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
156 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
157 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
158 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
159 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
161 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
162 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
163 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
164 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
165 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
166 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
167 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
168 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
169 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
170 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
171 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
172 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
173 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
174 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
175 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
176 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
193 w2_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
194 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
195 w2_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
196 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
197 w2_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
198 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
199 w2_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
200 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
201 w3_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
202 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
203 w3_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
204 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
205 w3_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
206 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
207 w3_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
208 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
215 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
216 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
217 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
218 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
219 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
220 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
221 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
222 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
223 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
224 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
225 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
226 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
227 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
228 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
229 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
230 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
232 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
233 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
234 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
235 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
236 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
237 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
238 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
239 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
240 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
241 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
242 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
243 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
244 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
245 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
246 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
247 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
249 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
250 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
251 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
252 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
253 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
254 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
255 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
256 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
257 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
258 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
259 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
260 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
261 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
262 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
263 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
264 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
266 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
267 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
268 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
269 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
270 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
271 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
272 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
273 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
274 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
275 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
276 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
277 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
278 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
279 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
280 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
281 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
283 const u32x r_a = a + MD5M_A;
284 const u32x r_b = b + MD5M_B;
285 const u32x r_c = c + MD5M_C;
286 const u32x r_d = d + MD5M_D;
293 MD5_STEP (MD5_Fo, a, b, c, d, r_00, MD5C00, MD5S00);
294 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C01, MD5S01);
295 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C02, MD5S02);
296 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C03, MD5S03);
297 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C04, MD5S00);
298 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C05, MD5S01);
299 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C06, MD5S02);
300 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C07, MD5S03);
301 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C08, MD5S00);
302 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C09, MD5S01);
303 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C0a, MD5S02);
304 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0b, MD5S03);
305 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C0c, MD5S00);
306 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C0d, MD5S01);
307 MD5_STEP (MD5_Fo, c, d, a, b, r_14, MD5C0e, MD5S02);
308 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0f, MD5S03);
310 MD5_STEP0(MD5_Go, a, b, c, d, MD5C10, MD5S10);
311 MD5_STEP0(MD5_Go, d, a, b, c, MD5C11, MD5S11);
312 MD5_STEP0(MD5_Go, c, d, a, b, MD5C12, MD5S12);
313 MD5_STEP (MD5_Go, b, c, d, a, r_00, MD5C13, MD5S13);
314 MD5_STEP0(MD5_Go, a, b, c, d, MD5C14, MD5S10);
315 MD5_STEP0(MD5_Go, d, a, b, c, MD5C15, MD5S11);
316 MD5_STEP0(MD5_Go, c, d, a, b, MD5C16, MD5S12);
317 MD5_STEP0(MD5_Go, b, c, d, a, MD5C17, MD5S13);
318 MD5_STEP0(MD5_Go, a, b, c, d, MD5C18, MD5S10);
319 MD5_STEP (MD5_Go, d, a, b, c, r_14, MD5C19, MD5S11);
320 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1a, MD5S12);
321 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1b, MD5S13);
322 MD5_STEP0(MD5_Go, a, b, c, d, MD5C1c, MD5S10);
323 MD5_STEP0(MD5_Go, d, a, b, c, MD5C1d, MD5S11);
324 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1e, MD5S12);
325 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1f, MD5S13);
327 MD5_STEP0(MD5_H , a, b, c, d, MD5C20, MD5S20);
328 MD5_STEP0(MD5_H , d, a, b, c, MD5C21, MD5S21);
329 MD5_STEP0(MD5_H , c, d, a, b, MD5C22, MD5S22);
330 MD5_STEP (MD5_H , b, c, d, a, r_14, MD5C23, MD5S23);
331 MD5_STEP0(MD5_H , a, b, c, d, MD5C24, MD5S20);
332 MD5_STEP0(MD5_H , d, a, b, c, MD5C25, MD5S21);
333 MD5_STEP0(MD5_H , c, d, a, b, MD5C26, MD5S22);
334 MD5_STEP0(MD5_H , b, c, d, a, MD5C27, MD5S23);
335 MD5_STEP0(MD5_H , a, b, c, d, MD5C28, MD5S20);
336 MD5_STEP (MD5_H , d, a, b, c, r_00, MD5C29, MD5S21);
337 MD5_STEP0(MD5_H , c, d, a, b, MD5C2a, MD5S22);
338 MD5_STEP0(MD5_H , b, c, d, a, MD5C2b, MD5S23);
339 MD5_STEP0(MD5_H , a, b, c, d, MD5C2c, MD5S20);
340 MD5_STEP0(MD5_H , d, a, b, c, MD5C2d, MD5S21);
341 MD5_STEP0(MD5_H , c, d, a, b, MD5C2e, MD5S22);
342 MD5_STEP0(MD5_H , b, c, d, a, MD5C2f, MD5S23);
344 MD5_STEP (MD5_I , a, b, c, d, r_00, MD5C30, MD5S30);
345 MD5_STEP0(MD5_I , d, a, b, c, MD5C31, MD5S31);
346 MD5_STEP (MD5_I , c, d, a, b, r_14, MD5C32, MD5S32);
347 MD5_STEP0(MD5_I , b, c, d, a, MD5C33, MD5S33);
348 MD5_STEP0(MD5_I , a, b, c, d, MD5C34, MD5S30);
349 MD5_STEP0(MD5_I , d, a, b, c, MD5C35, MD5S31);
350 MD5_STEP0(MD5_I , c, d, a, b, MD5C36, MD5S32);
351 MD5_STEP0(MD5_I , b, c, d, a, MD5C37, MD5S33);
352 MD5_STEP0(MD5_I , a, b, c, d, MD5C38, MD5S30);
353 MD5_STEP0(MD5_I , d, a, b, c, MD5C39, MD5S31);
354 MD5_STEP0(MD5_I , c, d, a, b, MD5C3a, MD5S32);
355 MD5_STEP0(MD5_I , b, c, d, a, MD5C3b, MD5S33);
356 MD5_STEP0(MD5_I , a, b, c, d, MD5C3c, MD5S30);
357 MD5_STEP0(MD5_I , d, a, b, c, MD5C3d, MD5S31);
358 MD5_STEP0(MD5_I , c, d, a, b, MD5C3e, MD5S32);
359 MD5_STEP0(MD5_I , b, c, d, a, MD5C3f, MD5S33);
366 COMPARE_M_SIMD (a, d, c, b);
370 static void m02810s (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)
376 const u32 gid = get_global_id (0);
377 const u32 lid = get_local_id (0);
383 const u32 search[4] =
385 digests_buf[digests_offset].digest_buf[DGST_R0],
386 digests_buf[digests_offset].digest_buf[DGST_R1],
387 digests_buf[digests_offset].digest_buf[DGST_R2],
388 digests_buf[digests_offset].digest_buf[DGST_R3]
397 s[0] = salt_bufs[salt_pos].salt_buf_pc[0];
398 s[1] = salt_bufs[salt_pos].salt_buf_pc[1];
399 s[2] = salt_bufs[salt_pos].salt_buf_pc[2];
400 s[3] = salt_bufs[salt_pos].salt_buf_pc[3];
401 s[4] = salt_bufs[salt_pos].salt_buf_pc[4];
402 s[5] = salt_bufs[salt_pos].salt_buf_pc[5];
403 s[6] = salt_bufs[salt_pos].salt_buf_pc[6];
404 s[7] = salt_bufs[salt_pos].salt_buf_pc[7];
406 const u32 r_00 = 0x80;
407 const u32 r_14 = 64 * 8;
415 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
417 const u32x w0r = ix_create_bft (bfs_buf, il_pos);
419 const u32x w0lr = w0l | w0r;
454 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
455 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
456 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
457 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
458 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
459 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
460 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
461 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
462 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
463 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
464 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
465 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
466 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
467 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
468 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
469 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
471 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
472 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
473 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
474 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
475 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
476 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
477 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
478 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
479 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
480 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
481 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
482 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
483 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
484 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
485 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
486 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
488 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
489 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
490 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
491 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
492 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
493 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
494 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
495 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
496 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
497 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
498 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
499 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
500 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
501 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
502 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
503 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
505 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
506 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
507 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
508 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
509 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
510 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
511 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
512 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
513 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
514 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
515 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
516 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
517 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
518 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
519 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
520 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
537 w2_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
538 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
539 w2_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
540 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
541 w2_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
542 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
543 w2_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
544 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
545 w3_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
546 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
547 w3_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
548 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
549 w3_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
550 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
551 w3_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
552 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
559 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
560 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
561 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
562 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
563 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
564 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
565 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
566 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
567 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
568 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
569 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
570 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
571 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
572 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
573 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
574 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
576 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
577 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
578 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
579 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
580 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
581 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
582 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
583 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
584 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
585 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
586 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
587 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
588 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
589 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
590 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
591 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
593 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
594 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
595 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
596 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
597 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
598 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
599 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
600 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
601 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
602 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
603 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
604 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
605 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
606 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
607 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
608 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
610 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
611 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
612 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
613 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
614 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
615 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
616 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
617 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
618 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
619 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
620 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
621 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
622 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
623 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
624 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
625 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
627 const u32x r_a = a + MD5M_A;
628 const u32x r_b = b + MD5M_B;
629 const u32x r_c = c + MD5M_C;
630 const u32x r_d = d + MD5M_D;
637 MD5_STEP (MD5_Fo, a, b, c, d, r_00, MD5C00, MD5S00);
638 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C01, MD5S01);
639 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C02, MD5S02);
640 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C03, MD5S03);
641 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C04, MD5S00);
642 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C05, MD5S01);
643 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C06, MD5S02);
644 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C07, MD5S03);
645 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C08, MD5S00);
646 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C09, MD5S01);
647 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C0a, MD5S02);
648 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0b, MD5S03);
649 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C0c, MD5S00);
650 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C0d, MD5S01);
651 MD5_STEP (MD5_Fo, c, d, a, b, r_14, MD5C0e, MD5S02);
652 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0f, MD5S03);
654 MD5_STEP0(MD5_Go, a, b, c, d, MD5C10, MD5S10);
655 MD5_STEP0(MD5_Go, d, a, b, c, MD5C11, MD5S11);
656 MD5_STEP0(MD5_Go, c, d, a, b, MD5C12, MD5S12);
657 MD5_STEP (MD5_Go, b, c, d, a, r_00, MD5C13, MD5S13);
658 MD5_STEP0(MD5_Go, a, b, c, d, MD5C14, MD5S10);
659 MD5_STEP0(MD5_Go, d, a, b, c, MD5C15, MD5S11);
660 MD5_STEP0(MD5_Go, c, d, a, b, MD5C16, MD5S12);
661 MD5_STEP0(MD5_Go, b, c, d, a, MD5C17, MD5S13);
662 MD5_STEP0(MD5_Go, a, b, c, d, MD5C18, MD5S10);
663 MD5_STEP (MD5_Go, d, a, b, c, r_14, MD5C19, MD5S11);
664 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1a, MD5S12);
665 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1b, MD5S13);
666 MD5_STEP0(MD5_Go, a, b, c, d, MD5C1c, MD5S10);
667 MD5_STEP0(MD5_Go, d, a, b, c, MD5C1d, MD5S11);
668 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1e, MD5S12);
669 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1f, MD5S13);
671 MD5_STEP0(MD5_H , a, b, c, d, MD5C20, MD5S20);
672 MD5_STEP0(MD5_H , d, a, b, c, MD5C21, MD5S21);
673 MD5_STEP0(MD5_H , c, d, a, b, MD5C22, MD5S22);
674 MD5_STEP (MD5_H , b, c, d, a, r_14, MD5C23, MD5S23);
675 MD5_STEP0(MD5_H , a, b, c, d, MD5C24, MD5S20);
676 MD5_STEP0(MD5_H , d, a, b, c, MD5C25, MD5S21);
677 MD5_STEP0(MD5_H , c, d, a, b, MD5C26, MD5S22);
678 MD5_STEP0(MD5_H , b, c, d, a, MD5C27, MD5S23);
679 MD5_STEP0(MD5_H , a, b, c, d, MD5C28, MD5S20);
680 MD5_STEP (MD5_H , d, a, b, c, r_00, MD5C29, MD5S21);
681 MD5_STEP0(MD5_H , c, d, a, b, MD5C2a, MD5S22);
682 MD5_STEP0(MD5_H , b, c, d, a, MD5C2b, MD5S23);
683 MD5_STEP0(MD5_H , a, b, c, d, MD5C2c, MD5S20);
684 MD5_STEP0(MD5_H , d, a, b, c, MD5C2d, MD5S21);
685 MD5_STEP0(MD5_H , c, d, a, b, MD5C2e, MD5S22);
686 MD5_STEP0(MD5_H , b, c, d, a, MD5C2f, MD5S23);
688 MD5_STEP (MD5_I , a, b, c, d, r_00, MD5C30, MD5S30);
689 MD5_STEP0(MD5_I , d, a, b, c, MD5C31, MD5S31);
690 MD5_STEP (MD5_I , c, d, a, b, r_14, MD5C32, MD5S32);
691 MD5_STEP0(MD5_I , b, c, d, a, MD5C33, MD5S33);
692 MD5_STEP0(MD5_I , a, b, c, d, MD5C34, MD5S30);
693 MD5_STEP0(MD5_I , d, a, b, c, MD5C35, MD5S31);
694 MD5_STEP0(MD5_I , c, d, a, b, MD5C36, MD5S32);
695 MD5_STEP0(MD5_I , b, c, d, a, MD5C37, MD5S33);
696 MD5_STEP0(MD5_I , a, b, c, d, MD5C38, MD5S30);
697 MD5_STEP0(MD5_I , d, a, b, c, MD5C39, MD5S31);
698 MD5_STEP0(MD5_I , c, d, a, b, MD5C3a, MD5S32);
699 MD5_STEP0(MD5_I , b, c, d, a, MD5C3b, MD5S33);
700 MD5_STEP0(MD5_I , a, b, c, d, MD5C3c, MD5S30);
702 if (MATCHES_NONE_VS ((a + r_a), search[0])) continue;
704 MD5_STEP0(MD5_I , d, a, b, c, MD5C3d, MD5S31);
705 MD5_STEP0(MD5_I , c, d, a, b, MD5C3e, MD5S32);
706 MD5_STEP0(MD5_I , b, c, d, a, MD5C3f, MD5S33);
713 COMPARE_S_SIMD (a, d, c, b);
717 __kernel void m02810_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)
723 const u32 gid = get_global_id (0);
724 const u32 lid = get_local_id (0);
725 const u32 lsz = get_local_size (0);
733 w0[0] = pws[gid].i[ 0];
734 w0[1] = pws[gid].i[ 1];
735 w0[2] = pws[gid].i[ 2];
736 w0[3] = pws[gid].i[ 3];
756 w3[2] = pws[gid].i[14];
759 const u32 pw_len = pws[gid].pw_len;
765 __local u32 l_bin2asc[256];
767 for (u32 i = lid; i < 256; i += lsz)
769 const u32 i0 = (i >> 0) & 15;
770 const u32 i1 = (i >> 4) & 15;
772 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
773 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
776 barrier (CLK_LOCAL_MEM_FENCE);
778 if (gid >= gid_max) return;
784 m02810m (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);
787 __kernel void m02810_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)
793 const u32 gid = get_global_id (0);
794 const u32 lid = get_local_id (0);
795 const u32 lsz = get_local_size (0);
803 w0[0] = pws[gid].i[ 0];
804 w0[1] = pws[gid].i[ 1];
805 w0[2] = pws[gid].i[ 2];
806 w0[3] = pws[gid].i[ 3];
810 w1[0] = pws[gid].i[ 4];
811 w1[1] = pws[gid].i[ 5];
812 w1[2] = pws[gid].i[ 6];
813 w1[3] = pws[gid].i[ 7];
826 w3[2] = pws[gid].i[14];
829 const u32 pw_len = pws[gid].pw_len;
835 __local u32 l_bin2asc[256];
837 for (u32 i = lid; i < 256; i += lsz)
839 const u32 i0 = (i >> 0) & 15;
840 const u32 i1 = (i >> 4) & 15;
842 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
843 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
846 barrier (CLK_LOCAL_MEM_FENCE);
848 if (gid >= gid_max) return;
854 m02810m (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);
857 __kernel void m02810_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)
863 const u32 gid = get_global_id (0);
864 const u32 lid = get_local_id (0);
865 const u32 lsz = get_local_size (0);
873 w0[0] = pws[gid].i[ 0];
874 w0[1] = pws[gid].i[ 1];
875 w0[2] = pws[gid].i[ 2];
876 w0[3] = pws[gid].i[ 3];
880 w1[0] = pws[gid].i[ 4];
881 w1[1] = pws[gid].i[ 5];
882 w1[2] = pws[gid].i[ 6];
883 w1[3] = pws[gid].i[ 7];
887 w2[0] = pws[gid].i[ 8];
888 w2[1] = pws[gid].i[ 9];
889 w2[2] = pws[gid].i[10];
890 w2[3] = pws[gid].i[11];
894 w3[0] = pws[gid].i[12];
895 w3[1] = pws[gid].i[13];
896 w3[2] = pws[gid].i[14];
897 w3[3] = pws[gid].i[15];
899 const u32 pw_len = pws[gid].pw_len;
905 __local u32 l_bin2asc[256];
907 for (u32 i = lid; i < 256; i += lsz)
909 const u32 i0 = (i >> 0) & 15;
910 const u32 i1 = (i >> 4) & 15;
912 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
913 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
916 barrier (CLK_LOCAL_MEM_FENCE);
918 if (gid >= gid_max) return;
924 m02810m (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);
927 __kernel void m02810_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)
933 const u32 gid = get_global_id (0);
934 const u32 lid = get_local_id (0);
935 const u32 lsz = get_local_size (0);
943 w0[0] = pws[gid].i[ 0];
944 w0[1] = pws[gid].i[ 1];
945 w0[2] = pws[gid].i[ 2];
946 w0[3] = pws[gid].i[ 3];
966 w3[2] = pws[gid].i[14];
969 const u32 pw_len = pws[gid].pw_len;
975 __local u32 l_bin2asc[256];
977 for (u32 i = lid; i < 256; i += lsz)
979 const u32 i0 = (i >> 0) & 15;
980 const u32 i1 = (i >> 4) & 15;
982 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
983 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
986 barrier (CLK_LOCAL_MEM_FENCE);
988 if (gid >= gid_max) return;
994 m02810s (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);
997 __kernel void m02810_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)
1003 const u32 gid = get_global_id (0);
1004 const u32 lid = get_local_id (0);
1005 const u32 lsz = get_local_size (0);
1013 w0[0] = pws[gid].i[ 0];
1014 w0[1] = pws[gid].i[ 1];
1015 w0[2] = pws[gid].i[ 2];
1016 w0[3] = pws[gid].i[ 3];
1020 w1[0] = pws[gid].i[ 4];
1021 w1[1] = pws[gid].i[ 5];
1022 w1[2] = pws[gid].i[ 6];
1023 w1[3] = pws[gid].i[ 7];
1036 w3[2] = pws[gid].i[14];
1039 const u32 pw_len = pws[gid].pw_len;
1045 __local u32 l_bin2asc[256];
1047 for (u32 i = lid; i < 256; i += lsz)
1049 const u32 i0 = (i >> 0) & 15;
1050 const u32 i1 = (i >> 4) & 15;
1052 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
1053 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
1056 barrier (CLK_LOCAL_MEM_FENCE);
1058 if (gid >= gid_max) return;
1064 m02810s (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);
1067 __kernel void m02810_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)
1073 const u32 gid = get_global_id (0);
1074 const u32 lid = get_local_id (0);
1075 const u32 lsz = get_local_size (0);
1083 w0[0] = pws[gid].i[ 0];
1084 w0[1] = pws[gid].i[ 1];
1085 w0[2] = pws[gid].i[ 2];
1086 w0[3] = pws[gid].i[ 3];
1090 w1[0] = pws[gid].i[ 4];
1091 w1[1] = pws[gid].i[ 5];
1092 w1[2] = pws[gid].i[ 6];
1093 w1[3] = pws[gid].i[ 7];
1097 w2[0] = pws[gid].i[ 8];
1098 w2[1] = pws[gid].i[ 9];
1099 w2[2] = pws[gid].i[10];
1100 w2[3] = pws[gid].i[11];
1104 w3[0] = pws[gid].i[12];
1105 w3[1] = pws[gid].i[13];
1106 w3[2] = pws[gid].i[14];
1107 w3[3] = pws[gid].i[15];
1109 const u32 pw_len = pws[gid].pw_len;
1115 __local u32 l_bin2asc[256];
1117 for (u32 i = lid; i < 256; i += lsz)
1119 const u32 i0 = (i >> 0) & 15;
1120 const u32 i1 = (i >> 4) & 15;
1122 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
1123 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
1126 barrier (CLK_LOCAL_MEM_FENCE);
1128 if (gid >= gid_max) return;
1134 m02810s (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);