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 bfs_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[0];
54 s[1] = salt_bufs[salt_pos].salt_buf[1];
55 s[2] = salt_bufs[salt_pos].salt_buf[2];
56 s[3] = salt_bufs[salt_pos].salt_buf[3];
57 s[4] = salt_bufs[salt_pos].salt_buf[4];
58 s[5] = salt_bufs[salt_pos].salt_buf[5];
59 s[6] = salt_bufs[salt_pos].salt_buf[6];
60 s[7] = salt_bufs[salt_pos].salt_buf[7];
62 const u32 salt_len = salt_bufs[salt_pos].salt_len;
64 const u32 r_14 = (32 + salt_len) * 8;
72 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
74 const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
76 const u32x w0lr = w0l | w0r;
111 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
112 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
113 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
114 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
115 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
116 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
117 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
118 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
119 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
120 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
121 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
122 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
123 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
124 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
125 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
126 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
128 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
129 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
130 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
131 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
132 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
133 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
134 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
135 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
136 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
137 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
138 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
139 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
140 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
141 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
142 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
143 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
145 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
146 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
147 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
148 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
149 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
150 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
151 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
152 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
153 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
154 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
155 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
156 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
157 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
158 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
159 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
160 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
162 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
163 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
164 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
165 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
166 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
167 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
168 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
169 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
170 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
171 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
172 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
173 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
174 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
175 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
176 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
177 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
184 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
185 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
186 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
187 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
188 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
189 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
190 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
191 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
192 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
193 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
194 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
195 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
196 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
197 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
198 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
199 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
216 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
217 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
218 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
219 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
220 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
221 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
222 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
223 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
224 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
225 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
226 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
227 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
228 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
229 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
230 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
231 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
233 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
234 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
235 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
236 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
237 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
238 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
239 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
240 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
241 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
242 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
243 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
244 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
245 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
246 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
247 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
248 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
250 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
251 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
252 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
253 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
254 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
255 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
256 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
257 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
258 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
259 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
260 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
261 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
262 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
263 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
264 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
265 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
267 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
268 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
269 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
270 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
271 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
272 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
273 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
274 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
275 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
276 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
277 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
278 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
279 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
280 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
281 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
282 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
284 const u32x r_a = a + MD5M_A;
285 const u32x r_b = b + MD5M_B;
286 const u32x r_c = c + MD5M_C;
287 const u32x r_d = d + MD5M_D;
294 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C00, MD5S00);
295 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C01, MD5S01);
296 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C02, MD5S02);
297 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C03, MD5S03);
298 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C04, MD5S00);
299 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C05, MD5S01);
300 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C06, MD5S02);
301 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C07, MD5S03);
302 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C08, MD5S00);
303 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C09, MD5S01);
304 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C0a, MD5S02);
305 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0b, MD5S03);
306 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C0c, MD5S00);
307 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C0d, MD5S01);
308 MD5_STEP (MD5_Fo, c, d, a, b, r_14, MD5C0e, MD5S02);
309 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0f, MD5S03);
311 MD5_STEP0(MD5_Go, a, b, c, d, MD5C10, MD5S10);
312 MD5_STEP0(MD5_Go, d, a, b, c, MD5C11, MD5S11);
313 MD5_STEP0(MD5_Go, c, d, a, b, MD5C12, MD5S12);
314 MD5_STEP0(MD5_Go, b, c, d, a, MD5C13, MD5S13);
315 MD5_STEP0(MD5_Go, a, b, c, d, MD5C14, MD5S10);
316 MD5_STEP0(MD5_Go, d, a, b, c, MD5C15, MD5S11);
317 MD5_STEP0(MD5_Go, c, d, a, b, MD5C16, MD5S12);
318 MD5_STEP0(MD5_Go, b, c, d, a, MD5C17, MD5S13);
319 MD5_STEP0(MD5_Go, a, b, c, d, MD5C18, MD5S10);
320 MD5_STEP (MD5_Go, d, a, b, c, r_14, MD5C19, MD5S11);
321 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1a, MD5S12);
322 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1b, MD5S13);
323 MD5_STEP0(MD5_Go, a, b, c, d, MD5C1c, MD5S10);
324 MD5_STEP0(MD5_Go, d, a, b, c, MD5C1d, MD5S11);
325 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1e, MD5S12);
326 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1f, MD5S13);
328 MD5_STEP0(MD5_H , a, b, c, d, MD5C20, MD5S20);
329 MD5_STEP0(MD5_H , d, a, b, c, MD5C21, MD5S21);
330 MD5_STEP0(MD5_H , c, d, a, b, MD5C22, MD5S22);
331 MD5_STEP (MD5_H , b, c, d, a, r_14, MD5C23, MD5S23);
332 MD5_STEP0(MD5_H , a, b, c, d, MD5C24, MD5S20);
333 MD5_STEP0(MD5_H , d, a, b, c, MD5C25, MD5S21);
334 MD5_STEP0(MD5_H , c, d, a, b, MD5C26, MD5S22);
335 MD5_STEP0(MD5_H , b, c, d, a, MD5C27, MD5S23);
336 MD5_STEP0(MD5_H , a, b, c, d, MD5C28, MD5S20);
337 MD5_STEP0(MD5_H , d, a, b, c, MD5C29, MD5S21);
338 MD5_STEP0(MD5_H , c, d, a, b, MD5C2a, MD5S22);
339 MD5_STEP0(MD5_H , b, c, d, a, MD5C2b, MD5S23);
340 MD5_STEP0(MD5_H , a, b, c, d, MD5C2c, MD5S20);
341 MD5_STEP0(MD5_H , d, a, b, c, MD5C2d, MD5S21);
342 MD5_STEP0(MD5_H , c, d, a, b, MD5C2e, MD5S22);
343 MD5_STEP0(MD5_H , b, c, d, a, MD5C2f, MD5S23);
345 MD5_STEP0(MD5_I , a, b, c, d, MD5C30, MD5S30);
346 MD5_STEP0(MD5_I , d, a, b, c, MD5C31, MD5S31);
347 MD5_STEP (MD5_I , c, d, a, b, r_14, MD5C32, MD5S32);
348 MD5_STEP0(MD5_I , b, c, d, a, MD5C33, MD5S33);
349 MD5_STEP0(MD5_I , a, b, c, d, MD5C34, MD5S30);
350 MD5_STEP0(MD5_I , d, a, b, c, MD5C35, MD5S31);
351 MD5_STEP0(MD5_I , c, d, a, b, MD5C36, MD5S32);
352 MD5_STEP0(MD5_I , b, c, d, a, MD5C37, MD5S33);
353 MD5_STEP0(MD5_I , a, b, c, d, MD5C38, MD5S30);
354 MD5_STEP0(MD5_I , d, a, b, c, MD5C39, MD5S31);
355 MD5_STEP0(MD5_I , c, d, a, b, MD5C3a, MD5S32);
356 MD5_STEP0(MD5_I , b, c, d, a, MD5C3b, MD5S33);
357 MD5_STEP0(MD5_I , a, b, c, d, MD5C3c, MD5S30);
358 MD5_STEP0(MD5_I , d, a, b, c, MD5C3d, MD5S31);
359 MD5_STEP0(MD5_I , c, d, a, b, MD5C3e, MD5S32);
360 MD5_STEP0(MD5_I , b, c, d, a, MD5C3f, MD5S33);
367 COMPARE_M_SIMD (a, d, c, b);
371 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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, __local u32 *l_bin2asc)
377 const u32 gid = get_global_id (0);
378 const u32 lid = get_local_id (0);
384 const u32 search[4] =
386 digests_buf[digests_offset].digest_buf[DGST_R0],
387 digests_buf[digests_offset].digest_buf[DGST_R1],
388 digests_buf[digests_offset].digest_buf[DGST_R2],
389 digests_buf[digests_offset].digest_buf[DGST_R3]
398 s[0] = salt_bufs[salt_pos].salt_buf[0];
399 s[1] = salt_bufs[salt_pos].salt_buf[1];
400 s[2] = salt_bufs[salt_pos].salt_buf[2];
401 s[3] = salt_bufs[salt_pos].salt_buf[3];
402 s[4] = salt_bufs[salt_pos].salt_buf[4];
403 s[5] = salt_bufs[salt_pos].salt_buf[5];
404 s[6] = salt_bufs[salt_pos].salt_buf[6];
405 s[7] = salt_bufs[salt_pos].salt_buf[7];
407 const u32 salt_len = salt_bufs[salt_pos].salt_len;
409 const u32 r_14 = (32 + salt_len) * 8;
417 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
419 const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
421 const u32x w0lr = w0l | w0r;
456 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
457 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
458 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
459 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
460 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
461 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
462 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
463 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
464 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
465 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
466 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
467 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
468 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
469 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
470 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
471 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
473 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
474 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
475 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
476 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
477 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
478 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
479 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
480 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
481 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
482 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
483 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
484 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
485 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
486 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
487 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
488 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
490 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
491 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
492 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
493 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
494 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
495 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
496 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
497 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
498 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
499 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
500 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
501 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
502 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
503 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
504 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
505 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
507 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
508 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
509 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
510 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
511 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
512 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
513 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
514 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
515 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
516 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
517 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
518 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
519 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
520 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
521 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
522 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
529 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
530 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
531 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
532 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
533 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
534 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
535 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
536 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
537 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
538 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
539 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
540 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
541 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
542 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
543 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
544 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
561 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
562 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
563 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
564 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
565 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
566 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
567 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
568 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
569 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
570 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
571 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
572 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
573 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
574 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
575 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
576 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
578 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
579 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
580 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
581 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
582 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
583 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
584 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
585 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
586 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
587 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
588 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
589 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
590 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
591 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
592 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
593 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
595 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
596 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
597 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
598 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
599 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
600 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
601 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
602 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
603 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
604 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
605 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
606 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
607 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
608 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
609 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
610 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
612 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
613 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
614 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
615 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
616 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
617 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
618 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
619 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
620 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
621 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
622 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
623 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
624 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
625 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
626 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
627 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
629 const u32x r_a = a + MD5M_A;
630 const u32x r_b = b + MD5M_B;
631 const u32x r_c = c + MD5M_C;
632 const u32x r_d = d + MD5M_D;
639 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C00, MD5S00);
640 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C01, MD5S01);
641 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C02, MD5S02);
642 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C03, MD5S03);
643 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C04, MD5S00);
644 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C05, MD5S01);
645 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C06, MD5S02);
646 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C07, MD5S03);
647 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C08, MD5S00);
648 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C09, MD5S01);
649 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C0a, MD5S02);
650 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0b, MD5S03);
651 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C0c, MD5S00);
652 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C0d, MD5S01);
653 MD5_STEP (MD5_Fo, c, d, a, b, r_14, MD5C0e, MD5S02);
654 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0f, MD5S03);
656 MD5_STEP0(MD5_Go, a, b, c, d, MD5C10, MD5S10);
657 MD5_STEP0(MD5_Go, d, a, b, c, MD5C11, MD5S11);
658 MD5_STEP0(MD5_Go, c, d, a, b, MD5C12, MD5S12);
659 MD5_STEP0(MD5_Go, b, c, d, a, MD5C13, MD5S13);
660 MD5_STEP0(MD5_Go, a, b, c, d, MD5C14, MD5S10);
661 MD5_STEP0(MD5_Go, d, a, b, c, MD5C15, MD5S11);
662 MD5_STEP0(MD5_Go, c, d, a, b, MD5C16, MD5S12);
663 MD5_STEP0(MD5_Go, b, c, d, a, MD5C17, MD5S13);
664 MD5_STEP0(MD5_Go, a, b, c, d, MD5C18, MD5S10);
665 MD5_STEP (MD5_Go, d, a, b, c, r_14, MD5C19, MD5S11);
666 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1a, MD5S12);
667 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1b, MD5S13);
668 MD5_STEP0(MD5_Go, a, b, c, d, MD5C1c, MD5S10);
669 MD5_STEP0(MD5_Go, d, a, b, c, MD5C1d, MD5S11);
670 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1e, MD5S12);
671 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1f, MD5S13);
673 MD5_STEP0(MD5_H , a, b, c, d, MD5C20, MD5S20);
674 MD5_STEP0(MD5_H , d, a, b, c, MD5C21, MD5S21);
675 MD5_STEP0(MD5_H , c, d, a, b, MD5C22, MD5S22);
676 MD5_STEP (MD5_H , b, c, d, a, r_14, MD5C23, MD5S23);
677 MD5_STEP0(MD5_H , a, b, c, d, MD5C24, MD5S20);
678 MD5_STEP0(MD5_H , d, a, b, c, MD5C25, MD5S21);
679 MD5_STEP0(MD5_H , c, d, a, b, MD5C26, MD5S22);
680 MD5_STEP0(MD5_H , b, c, d, a, MD5C27, MD5S23);
681 MD5_STEP0(MD5_H , a, b, c, d, MD5C28, MD5S20);
682 MD5_STEP0(MD5_H , d, a, b, c, MD5C29, MD5S21);
683 MD5_STEP0(MD5_H , c, d, a, b, MD5C2a, MD5S22);
684 MD5_STEP0(MD5_H , b, c, d, a, MD5C2b, MD5S23);
685 MD5_STEP0(MD5_H , a, b, c, d, MD5C2c, MD5S20);
686 MD5_STEP0(MD5_H , d, a, b, c, MD5C2d, MD5S21);
687 MD5_STEP0(MD5_H , c, d, a, b, MD5C2e, MD5S22);
688 MD5_STEP0(MD5_H , b, c, d, a, MD5C2f, MD5S23);
690 MD5_STEP0(MD5_I , a, b, c, d, MD5C30, MD5S30);
691 MD5_STEP0(MD5_I , d, a, b, c, MD5C31, MD5S31);
692 MD5_STEP (MD5_I , c, d, a, b, r_14, MD5C32, MD5S32);
693 MD5_STEP0(MD5_I , b, c, d, a, MD5C33, MD5S33);
694 MD5_STEP0(MD5_I , a, b, c, d, MD5C34, MD5S30);
695 MD5_STEP0(MD5_I , d, a, b, c, MD5C35, MD5S31);
696 MD5_STEP0(MD5_I , c, d, a, b, MD5C36, MD5S32);
697 MD5_STEP0(MD5_I , b, c, d, a, MD5C37, MD5S33);
698 MD5_STEP0(MD5_I , a, b, c, d, MD5C38, MD5S30);
699 MD5_STEP0(MD5_I , d, a, b, c, MD5C39, MD5S31);
700 MD5_STEP0(MD5_I , c, d, a, b, MD5C3a, MD5S32);
701 MD5_STEP0(MD5_I , b, c, d, a, MD5C3b, MD5S33);
702 MD5_STEP0(MD5_I , a, b, c, d, MD5C3c, MD5S30);
704 if (MATCHES_NONE_VS ((a + r_a), search[0])) continue;
706 MD5_STEP0(MD5_I , d, a, b, c, MD5C3d, MD5S31);
707 MD5_STEP0(MD5_I , c, d, a, b, MD5C3e, MD5S32);
708 MD5_STEP0(MD5_I , b, c, d, a, MD5C3f, MD5S33);
715 COMPARE_S_SIMD (a, d, c, b);
719 __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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
725 const u32 gid = get_global_id (0);
726 const u32 lid = get_local_id (0);
727 const u32 lsz = get_local_size (0);
735 w0[0] = pws[gid].i[ 0];
736 w0[1] = pws[gid].i[ 1];
737 w0[2] = pws[gid].i[ 2];
738 w0[3] = pws[gid].i[ 3];
758 w3[2] = pws[gid].i[14];
761 const u32 pw_len = pws[gid].pw_len;
767 __local u32 l_bin2asc[256];
769 for (u32 i = lid; i < 256; i += lsz)
771 const u32 i0 = (i >> 0) & 15;
772 const u32 i1 = (i >> 4) & 15;
774 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
775 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
778 barrier (CLK_LOCAL_MEM_FENCE);
780 if (gid >= gid_max) return;
786 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, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
789 __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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
795 const u32 gid = get_global_id (0);
796 const u32 lid = get_local_id (0);
797 const u32 lsz = get_local_size (0);
805 w0[0] = pws[gid].i[ 0];
806 w0[1] = pws[gid].i[ 1];
807 w0[2] = pws[gid].i[ 2];
808 w0[3] = pws[gid].i[ 3];
812 w1[0] = pws[gid].i[ 4];
813 w1[1] = pws[gid].i[ 5];
814 w1[2] = pws[gid].i[ 6];
815 w1[3] = pws[gid].i[ 7];
828 w3[2] = pws[gid].i[14];
831 const u32 pw_len = pws[gid].pw_len;
837 __local u32 l_bin2asc[256];
839 for (u32 i = lid; i < 256; i += lsz)
841 const u32 i0 = (i >> 0) & 15;
842 const u32 i1 = (i >> 4) & 15;
844 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
845 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
848 barrier (CLK_LOCAL_MEM_FENCE);
850 if (gid >= gid_max) return;
856 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, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
859 __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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
865 const u32 gid = get_global_id (0);
866 const u32 lid = get_local_id (0);
867 const u32 lsz = get_local_size (0);
875 w0[0] = pws[gid].i[ 0];
876 w0[1] = pws[gid].i[ 1];
877 w0[2] = pws[gid].i[ 2];
878 w0[3] = pws[gid].i[ 3];
882 w1[0] = pws[gid].i[ 4];
883 w1[1] = pws[gid].i[ 5];
884 w1[2] = pws[gid].i[ 6];
885 w1[3] = pws[gid].i[ 7];
889 w2[0] = pws[gid].i[ 8];
890 w2[1] = pws[gid].i[ 9];
891 w2[2] = pws[gid].i[10];
892 w2[3] = pws[gid].i[11];
896 w3[0] = pws[gid].i[12];
897 w3[1] = pws[gid].i[13];
898 w3[2] = pws[gid].i[14];
899 w3[3] = pws[gid].i[15];
901 const u32 pw_len = pws[gid].pw_len;
907 __local u32 l_bin2asc[256];
909 for (u32 i = lid; i < 256; i += lsz)
911 const u32 i0 = (i >> 0) & 15;
912 const u32 i1 = (i >> 4) & 15;
914 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
915 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
918 barrier (CLK_LOCAL_MEM_FENCE);
920 if (gid >= gid_max) return;
926 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, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
929 __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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
935 const u32 gid = get_global_id (0);
936 const u32 lid = get_local_id (0);
937 const u32 lsz = get_local_size (0);
945 w0[0] = pws[gid].i[ 0];
946 w0[1] = pws[gid].i[ 1];
947 w0[2] = pws[gid].i[ 2];
948 w0[3] = pws[gid].i[ 3];
968 w3[2] = pws[gid].i[14];
971 const u32 pw_len = pws[gid].pw_len;
977 __local u32 l_bin2asc[256];
979 for (u32 i = lid; i < 256; i += lsz)
981 const u32 i0 = (i >> 0) & 15;
982 const u32 i1 = (i >> 4) & 15;
984 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
985 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
988 barrier (CLK_LOCAL_MEM_FENCE);
990 if (gid >= gid_max) return;
996 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, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
999 __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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
1005 const u32 gid = get_global_id (0);
1006 const u32 lid = get_local_id (0);
1007 const u32 lsz = get_local_size (0);
1015 w0[0] = pws[gid].i[ 0];
1016 w0[1] = pws[gid].i[ 1];
1017 w0[2] = pws[gid].i[ 2];
1018 w0[3] = pws[gid].i[ 3];
1022 w1[0] = pws[gid].i[ 4];
1023 w1[1] = pws[gid].i[ 5];
1024 w1[2] = pws[gid].i[ 6];
1025 w1[3] = pws[gid].i[ 7];
1038 w3[2] = pws[gid].i[14];
1041 const u32 pw_len = pws[gid].pw_len;
1047 __local u32 l_bin2asc[256];
1049 for (u32 i = lid; i < 256; i += lsz)
1051 const u32 i0 = (i >> 0) & 15;
1052 const u32 i1 = (i >> 4) & 15;
1054 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
1055 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
1058 barrier (CLK_LOCAL_MEM_FENCE);
1060 if (gid >= gid_max) return;
1066 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, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
1069 __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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
1075 const u32 gid = get_global_id (0);
1076 const u32 lid = get_local_id (0);
1077 const u32 lsz = get_local_size (0);
1085 w0[0] = pws[gid].i[ 0];
1086 w0[1] = pws[gid].i[ 1];
1087 w0[2] = pws[gid].i[ 2];
1088 w0[3] = pws[gid].i[ 3];
1092 w1[0] = pws[gid].i[ 4];
1093 w1[1] = pws[gid].i[ 5];
1094 w1[2] = pws[gid].i[ 6];
1095 w1[3] = pws[gid].i[ 7];
1099 w2[0] = pws[gid].i[ 8];
1100 w2[1] = pws[gid].i[ 9];
1101 w2[2] = pws[gid].i[10];
1102 w2[3] = pws[gid].i[11];
1106 w3[0] = pws[gid].i[12];
1107 w3[1] = pws[gid].i[13];
1108 w3[2] = pws[gid].i[14];
1109 w3[3] = pws[gid].i[15];
1111 const u32 pw_len = pws[gid].pw_len;
1117 __local u32 l_bin2asc[256];
1119 for (u32 i = lid; i < 256; i += lsz)
1121 const u32 i0 = (i >> 0) & 15;
1122 const u32 i1 = (i >> 4) & 15;
1124 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
1125 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
1128 barrier (CLK_LOCAL_MEM_FENCE);
1130 if (gid >= gid_max) return;
1136 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, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);