2 * Authors.....: Jens Steube <jens.steube@gmail.com>
3 * Gabriele Gristina <matrix@hashcat.net>
12 #include "include/constants.h"
13 #include "include/kernel_vendor.h"
20 #include "include/kernel_functions.c"
21 #include "OpenCL/types_ocl.c"
22 #include "OpenCL/common.c"
23 #include "OpenCL/simd.c"
26 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i)])
28 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1])
30 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3])
32 #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 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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, __local u32 *l_bin2asc)
41 const u32 gid = get_global_id (0);
42 const u32 lid = get_local_id (0);
50 s[0] = salt_bufs[salt_pos].salt_buf_pc[0];
51 s[1] = salt_bufs[salt_pos].salt_buf_pc[1];
52 s[2] = salt_bufs[salt_pos].salt_buf_pc[2];
53 s[3] = salt_bufs[salt_pos].salt_buf_pc[3];
54 s[4] = salt_bufs[salt_pos].salt_buf_pc[4];
55 s[5] = salt_bufs[salt_pos].salt_buf_pc[5];
56 s[6] = salt_bufs[salt_pos].salt_buf_pc[6];
57 s[7] = salt_bufs[salt_pos].salt_buf_pc[7];
59 const u32 r_00 = 0x80;
60 const u32 r_14 = 64 * 8;
68 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
70 const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
72 const u32x w0lr = w0l | w0r;
107 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
108 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
109 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
110 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
111 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
112 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
113 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
114 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
115 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
116 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
117 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
118 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
119 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
120 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
121 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
122 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
124 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
125 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
126 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
127 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
128 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
129 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
130 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
131 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
132 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
133 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
134 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
135 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
136 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
137 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
138 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
139 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
141 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
142 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
143 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
144 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
145 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
146 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
147 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
148 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
149 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
150 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
151 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
152 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
153 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
154 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
155 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
156 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
158 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
159 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
160 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
161 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
162 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
163 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
164 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
165 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
166 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
167 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
168 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
169 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
170 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
171 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
172 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
173 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
190 w2_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
191 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
192 w2_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
193 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
194 w2_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
195 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
196 w2_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
197 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
198 w3_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
199 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
200 w3_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
201 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
202 w3_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
203 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
204 w3_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
205 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
212 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
213 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
214 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
215 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
216 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
217 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
218 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
219 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
220 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
221 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
222 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
223 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
224 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
225 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
226 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
227 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
229 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
230 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
231 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
232 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
233 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
234 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
235 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
236 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
237 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
238 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
239 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
240 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
241 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
242 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
243 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
244 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
246 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
247 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
248 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
249 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
250 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
251 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
252 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
253 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
254 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
255 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
256 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
257 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
258 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
259 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
260 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
261 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
263 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
264 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
265 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
266 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
267 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
268 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
269 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
270 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
271 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
272 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
273 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
274 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
275 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
276 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
277 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
278 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
280 const u32x r_a = a + MD5M_A;
281 const u32x r_b = b + MD5M_B;
282 const u32x r_c = c + MD5M_C;
283 const u32x r_d = d + MD5M_D;
290 MD5_STEP (MD5_Fo, a, b, c, d, r_00, MD5C00, MD5S00);
291 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C01, MD5S01);
292 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C02, MD5S02);
293 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C03, MD5S03);
294 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C04, MD5S00);
295 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C05, MD5S01);
296 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C06, MD5S02);
297 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C07, MD5S03);
298 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C08, MD5S00);
299 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C09, MD5S01);
300 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C0a, MD5S02);
301 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0b, MD5S03);
302 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C0c, MD5S00);
303 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C0d, MD5S01);
304 MD5_STEP (MD5_Fo, c, d, a, b, r_14, MD5C0e, MD5S02);
305 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0f, MD5S03);
307 MD5_STEP0(MD5_Go, a, b, c, d, MD5C10, MD5S10);
308 MD5_STEP0(MD5_Go, d, a, b, c, MD5C11, MD5S11);
309 MD5_STEP0(MD5_Go, c, d, a, b, MD5C12, MD5S12);
310 MD5_STEP (MD5_Go, b, c, d, a, r_00, MD5C13, MD5S13);
311 MD5_STEP0(MD5_Go, a, b, c, d, MD5C14, MD5S10);
312 MD5_STEP0(MD5_Go, d, a, b, c, MD5C15, MD5S11);
313 MD5_STEP0(MD5_Go, c, d, a, b, MD5C16, MD5S12);
314 MD5_STEP0(MD5_Go, b, c, d, a, MD5C17, MD5S13);
315 MD5_STEP0(MD5_Go, a, b, c, d, MD5C18, MD5S10);
316 MD5_STEP (MD5_Go, d, a, b, c, r_14, MD5C19, MD5S11);
317 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1a, MD5S12);
318 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1b, MD5S13);
319 MD5_STEP0(MD5_Go, a, b, c, d, MD5C1c, MD5S10);
320 MD5_STEP0(MD5_Go, d, a, b, c, MD5C1d, MD5S11);
321 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1e, MD5S12);
322 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1f, MD5S13);
324 MD5_STEP0(MD5_H , a, b, c, d, MD5C20, MD5S20);
325 MD5_STEP0(MD5_H , d, a, b, c, MD5C21, MD5S21);
326 MD5_STEP0(MD5_H , c, d, a, b, MD5C22, MD5S22);
327 MD5_STEP (MD5_H , b, c, d, a, r_14, MD5C23, MD5S23);
328 MD5_STEP0(MD5_H , a, b, c, d, MD5C24, MD5S20);
329 MD5_STEP0(MD5_H , d, a, b, c, MD5C25, MD5S21);
330 MD5_STEP0(MD5_H , c, d, a, b, MD5C26, MD5S22);
331 MD5_STEP0(MD5_H , b, c, d, a, MD5C27, MD5S23);
332 MD5_STEP0(MD5_H , a, b, c, d, MD5C28, MD5S20);
333 MD5_STEP (MD5_H , d, a, b, c, r_00, MD5C29, MD5S21);
334 MD5_STEP0(MD5_H , c, d, a, b, MD5C2a, MD5S22);
335 MD5_STEP0(MD5_H , b, c, d, a, MD5C2b, MD5S23);
336 MD5_STEP0(MD5_H , a, b, c, d, MD5C2c, MD5S20);
337 MD5_STEP0(MD5_H , d, a, b, c, MD5C2d, MD5S21);
338 MD5_STEP0(MD5_H , c, d, a, b, MD5C2e, MD5S22);
339 MD5_STEP0(MD5_H , b, c, d, a, MD5C2f, MD5S23);
341 MD5_STEP (MD5_I , a, b, c, d, r_00, MD5C30, MD5S30);
342 MD5_STEP0(MD5_I , d, a, b, c, MD5C31, MD5S31);
343 MD5_STEP (MD5_I , c, d, a, b, r_14, MD5C32, MD5S32);
344 MD5_STEP0(MD5_I , b, c, d, a, MD5C33, MD5S33);
345 MD5_STEP0(MD5_I , a, b, c, d, MD5C34, MD5S30);
346 MD5_STEP0(MD5_I , d, a, b, c, MD5C35, MD5S31);
347 MD5_STEP0(MD5_I , c, d, a, b, MD5C36, MD5S32);
348 MD5_STEP0(MD5_I , b, c, d, a, MD5C37, MD5S33);
349 MD5_STEP0(MD5_I , a, b, c, d, MD5C38, MD5S30);
350 MD5_STEP0(MD5_I , d, a, b, c, MD5C39, MD5S31);
351 MD5_STEP0(MD5_I , c, d, a, b, MD5C3a, MD5S32);
352 MD5_STEP0(MD5_I , b, c, d, a, MD5C3b, MD5S33);
353 MD5_STEP0(MD5_I , a, b, c, d, MD5C3c, MD5S30);
354 MD5_STEP0(MD5_I , d, a, b, c, MD5C3d, MD5S31);
355 MD5_STEP0(MD5_I , c, d, a, b, MD5C3e, MD5S32);
356 MD5_STEP0(MD5_I , b, c, d, a, MD5C3f, MD5S33);
363 COMPARE_M_SIMD (a, d, c, b);
367 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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, __local u32 *l_bin2asc)
373 const u32 gid = get_global_id (0);
374 const u32 lid = get_local_id (0);
380 const u32 search[4] =
382 digests_buf[digests_offset].digest_buf[DGST_R0],
383 digests_buf[digests_offset].digest_buf[DGST_R1],
384 digests_buf[digests_offset].digest_buf[DGST_R2],
385 digests_buf[digests_offset].digest_buf[DGST_R3]
394 s[0] = salt_bufs[salt_pos].salt_buf_pc[0];
395 s[1] = salt_bufs[salt_pos].salt_buf_pc[1];
396 s[2] = salt_bufs[salt_pos].salt_buf_pc[2];
397 s[3] = salt_bufs[salt_pos].salt_buf_pc[3];
398 s[4] = salt_bufs[salt_pos].salt_buf_pc[4];
399 s[5] = salt_bufs[salt_pos].salt_buf_pc[5];
400 s[6] = salt_bufs[salt_pos].salt_buf_pc[6];
401 s[7] = salt_bufs[salt_pos].salt_buf_pc[7];
403 const u32 r_00 = 0x80;
404 const u32 r_14 = 64 * 8;
412 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
414 const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
416 const u32x w0lr = w0l | w0r;
451 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
452 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
453 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
454 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
455 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
456 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
457 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
458 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
459 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
460 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
461 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
462 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
463 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
464 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
465 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
466 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
468 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
469 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
470 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
471 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
472 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
473 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
474 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
475 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
476 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
477 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
478 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
479 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
480 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
481 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
482 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
483 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
485 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
486 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
487 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
488 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
489 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
490 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
491 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
492 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
493 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
494 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
495 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
496 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
497 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
498 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
499 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
500 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
502 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
503 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
504 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
505 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
506 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
507 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
508 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
509 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
510 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
511 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
512 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
513 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
514 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
515 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
516 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
517 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
534 w2_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
535 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
536 w2_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
537 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
538 w2_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
539 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
540 w2_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
541 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
542 w3_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
543 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
544 w3_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
545 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
546 w3_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
547 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
548 w3_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
549 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
556 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
557 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
558 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
559 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
560 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
561 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
562 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
563 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
564 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
565 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
566 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
567 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
568 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
569 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
570 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
571 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
573 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
574 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
575 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
576 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
577 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
578 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
579 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
580 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
581 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
582 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
583 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
584 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
585 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
586 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
587 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
588 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
590 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
591 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
592 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
593 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
594 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
595 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
596 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
597 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
598 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
599 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
600 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
601 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
602 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
603 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
604 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
605 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
607 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
608 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
609 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
610 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
611 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
612 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
613 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
614 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
615 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
616 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
617 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
618 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
619 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
620 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
621 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
622 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
624 const u32x r_a = a + MD5M_A;
625 const u32x r_b = b + MD5M_B;
626 const u32x r_c = c + MD5M_C;
627 const u32x r_d = d + MD5M_D;
634 MD5_STEP (MD5_Fo, a, b, c, d, r_00, MD5C00, MD5S00);
635 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C01, MD5S01);
636 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C02, MD5S02);
637 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C03, MD5S03);
638 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C04, MD5S00);
639 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C05, MD5S01);
640 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C06, MD5S02);
641 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C07, MD5S03);
642 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C08, MD5S00);
643 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C09, MD5S01);
644 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C0a, MD5S02);
645 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0b, MD5S03);
646 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C0c, MD5S00);
647 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C0d, MD5S01);
648 MD5_STEP (MD5_Fo, c, d, a, b, r_14, MD5C0e, MD5S02);
649 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0f, MD5S03);
651 MD5_STEP0(MD5_Go, a, b, c, d, MD5C10, MD5S10);
652 MD5_STEP0(MD5_Go, d, a, b, c, MD5C11, MD5S11);
653 MD5_STEP0(MD5_Go, c, d, a, b, MD5C12, MD5S12);
654 MD5_STEP (MD5_Go, b, c, d, a, r_00, MD5C13, MD5S13);
655 MD5_STEP0(MD5_Go, a, b, c, d, MD5C14, MD5S10);
656 MD5_STEP0(MD5_Go, d, a, b, c, MD5C15, MD5S11);
657 MD5_STEP0(MD5_Go, c, d, a, b, MD5C16, MD5S12);
658 MD5_STEP0(MD5_Go, b, c, d, a, MD5C17, MD5S13);
659 MD5_STEP0(MD5_Go, a, b, c, d, MD5C18, MD5S10);
660 MD5_STEP (MD5_Go, d, a, b, c, r_14, MD5C19, MD5S11);
661 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1a, MD5S12);
662 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1b, MD5S13);
663 MD5_STEP0(MD5_Go, a, b, c, d, MD5C1c, MD5S10);
664 MD5_STEP0(MD5_Go, d, a, b, c, MD5C1d, MD5S11);
665 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1e, MD5S12);
666 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1f, MD5S13);
668 MD5_STEP0(MD5_H , a, b, c, d, MD5C20, MD5S20);
669 MD5_STEP0(MD5_H , d, a, b, c, MD5C21, MD5S21);
670 MD5_STEP0(MD5_H , c, d, a, b, MD5C22, MD5S22);
671 MD5_STEP (MD5_H , b, c, d, a, r_14, MD5C23, MD5S23);
672 MD5_STEP0(MD5_H , a, b, c, d, MD5C24, MD5S20);
673 MD5_STEP0(MD5_H , d, a, b, c, MD5C25, MD5S21);
674 MD5_STEP0(MD5_H , c, d, a, b, MD5C26, MD5S22);
675 MD5_STEP0(MD5_H , b, c, d, a, MD5C27, MD5S23);
676 MD5_STEP0(MD5_H , a, b, c, d, MD5C28, MD5S20);
677 MD5_STEP (MD5_H , d, a, b, c, r_00, MD5C29, MD5S21);
678 MD5_STEP0(MD5_H , c, d, a, b, MD5C2a, MD5S22);
679 MD5_STEP0(MD5_H , b, c, d, a, MD5C2b, MD5S23);
680 MD5_STEP0(MD5_H , a, b, c, d, MD5C2c, MD5S20);
681 MD5_STEP0(MD5_H , d, a, b, c, MD5C2d, MD5S21);
682 MD5_STEP0(MD5_H , c, d, a, b, MD5C2e, MD5S22);
683 MD5_STEP0(MD5_H , b, c, d, a, MD5C2f, MD5S23);
685 MD5_STEP (MD5_I , a, b, c, d, r_00, MD5C30, MD5S30);
686 MD5_STEP0(MD5_I , d, a, b, c, MD5C31, MD5S31);
687 MD5_STEP (MD5_I , c, d, a, b, r_14, MD5C32, MD5S32);
688 MD5_STEP0(MD5_I , b, c, d, a, MD5C33, MD5S33);
689 MD5_STEP0(MD5_I , a, b, c, d, MD5C34, MD5S30);
690 MD5_STEP0(MD5_I , d, a, b, c, MD5C35, MD5S31);
691 MD5_STEP0(MD5_I , c, d, a, b, MD5C36, MD5S32);
692 MD5_STEP0(MD5_I , b, c, d, a, MD5C37, MD5S33);
693 MD5_STEP0(MD5_I , a, b, c, d, MD5C38, MD5S30);
694 MD5_STEP0(MD5_I , d, a, b, c, MD5C39, MD5S31);
695 MD5_STEP0(MD5_I , c, d, a, b, MD5C3a, MD5S32);
696 MD5_STEP0(MD5_I , b, c, d, a, MD5C3b, MD5S33);
697 MD5_STEP0(MD5_I , a, b, c, d, MD5C3c, MD5S30);
699 if (MATCHES_NONE_VS ((a + r_a), search[0])) continue;
701 MD5_STEP0(MD5_I , d, a, b, c, MD5C3d, MD5S31);
702 MD5_STEP0(MD5_I , c, d, a, b, MD5C3e, MD5S32);
703 MD5_STEP0(MD5_I , b, c, d, a, MD5C3f, MD5S33);
710 COMPARE_S_SIMD (a, d, c, b);
714 __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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
720 const u32 gid = get_global_id (0);
721 const u32 lid = get_local_id (0);
722 const u32 lsz = get_local_size (0);
730 w0[0] = pws[gid].i[ 0];
731 w0[1] = pws[gid].i[ 1];
732 w0[2] = pws[gid].i[ 2];
733 w0[3] = pws[gid].i[ 3];
753 w3[2] = pws[gid].i[14];
756 const u32 pw_len = pws[gid].pw_len;
762 __local u32 l_bin2asc[256];
764 for (u32 i = lid; i < 256; i += lsz)
766 const u32 i0 = (i >> 0) & 15;
767 const u32 i1 = (i >> 4) & 15;
769 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
770 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
773 barrier (CLK_LOCAL_MEM_FENCE);
775 if (gid >= gid_max) return;
781 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, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
784 __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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
790 const u32 gid = get_global_id (0);
791 const u32 lid = get_local_id (0);
792 const u32 lsz = get_local_size (0);
800 w0[0] = pws[gid].i[ 0];
801 w0[1] = pws[gid].i[ 1];
802 w0[2] = pws[gid].i[ 2];
803 w0[3] = pws[gid].i[ 3];
807 w1[0] = pws[gid].i[ 4];
808 w1[1] = pws[gid].i[ 5];
809 w1[2] = pws[gid].i[ 6];
810 w1[3] = pws[gid].i[ 7];
823 w3[2] = pws[gid].i[14];
826 const u32 pw_len = pws[gid].pw_len;
832 __local u32 l_bin2asc[256];
834 for (u32 i = lid; i < 256; i += lsz)
836 const u32 i0 = (i >> 0) & 15;
837 const u32 i1 = (i >> 4) & 15;
839 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
840 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
843 barrier (CLK_LOCAL_MEM_FENCE);
845 if (gid >= gid_max) return;
851 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, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
854 __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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
860 const u32 gid = get_global_id (0);
861 const u32 lid = get_local_id (0);
862 const u32 lsz = get_local_size (0);
870 w0[0] = pws[gid].i[ 0];
871 w0[1] = pws[gid].i[ 1];
872 w0[2] = pws[gid].i[ 2];
873 w0[3] = pws[gid].i[ 3];
877 w1[0] = pws[gid].i[ 4];
878 w1[1] = pws[gid].i[ 5];
879 w1[2] = pws[gid].i[ 6];
880 w1[3] = pws[gid].i[ 7];
884 w2[0] = pws[gid].i[ 8];
885 w2[1] = pws[gid].i[ 9];
886 w2[2] = pws[gid].i[10];
887 w2[3] = pws[gid].i[11];
891 w3[0] = pws[gid].i[12];
892 w3[1] = pws[gid].i[13];
893 w3[2] = pws[gid].i[14];
894 w3[3] = pws[gid].i[15];
896 const u32 pw_len = pws[gid].pw_len;
902 __local u32 l_bin2asc[256];
904 for (u32 i = lid; i < 256; i += lsz)
906 const u32 i0 = (i >> 0) & 15;
907 const u32 i1 = (i >> 4) & 15;
909 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
910 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
913 barrier (CLK_LOCAL_MEM_FENCE);
915 if (gid >= gid_max) return;
921 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, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
924 __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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
930 const u32 gid = get_global_id (0);
931 const u32 lid = get_local_id (0);
932 const u32 lsz = get_local_size (0);
940 w0[0] = pws[gid].i[ 0];
941 w0[1] = pws[gid].i[ 1];
942 w0[2] = pws[gid].i[ 2];
943 w0[3] = pws[gid].i[ 3];
963 w3[2] = pws[gid].i[14];
966 const u32 pw_len = pws[gid].pw_len;
972 __local u32 l_bin2asc[256];
974 for (u32 i = lid; i < 256; i += lsz)
976 const u32 i0 = (i >> 0) & 15;
977 const u32 i1 = (i >> 4) & 15;
979 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
980 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
983 barrier (CLK_LOCAL_MEM_FENCE);
985 if (gid >= gid_max) return;
991 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, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
994 __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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
1000 const u32 gid = get_global_id (0);
1001 const u32 lid = get_local_id (0);
1002 const u32 lsz = get_local_size (0);
1010 w0[0] = pws[gid].i[ 0];
1011 w0[1] = pws[gid].i[ 1];
1012 w0[2] = pws[gid].i[ 2];
1013 w0[3] = pws[gid].i[ 3];
1017 w1[0] = pws[gid].i[ 4];
1018 w1[1] = pws[gid].i[ 5];
1019 w1[2] = pws[gid].i[ 6];
1020 w1[3] = pws[gid].i[ 7];
1033 w3[2] = pws[gid].i[14];
1036 const u32 pw_len = pws[gid].pw_len;
1042 __local u32 l_bin2asc[256];
1044 for (u32 i = lid; i < 256; i += lsz)
1046 const u32 i0 = (i >> 0) & 15;
1047 const u32 i1 = (i >> 4) & 15;
1049 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
1050 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
1053 barrier (CLK_LOCAL_MEM_FENCE);
1055 if (gid >= gid_max) return;
1061 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, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
1064 __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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
1070 const u32 gid = get_global_id (0);
1071 const u32 lid = get_local_id (0);
1072 const u32 lsz = get_local_size (0);
1080 w0[0] = pws[gid].i[ 0];
1081 w0[1] = pws[gid].i[ 1];
1082 w0[2] = pws[gid].i[ 2];
1083 w0[3] = pws[gid].i[ 3];
1087 w1[0] = pws[gid].i[ 4];
1088 w1[1] = pws[gid].i[ 5];
1089 w1[2] = pws[gid].i[ 6];
1090 w1[3] = pws[gid].i[ 7];
1094 w2[0] = pws[gid].i[ 8];
1095 w2[1] = pws[gid].i[ 9];
1096 w2[2] = pws[gid].i[10];
1097 w2[3] = pws[gid].i[11];
1101 w3[0] = pws[gid].i[12];
1102 w3[1] = pws[gid].i[13];
1103 w3[2] = pws[gid].i[14];
1104 w3[3] = pws[gid].i[15];
1106 const u32 pw_len = pws[gid].pw_len;
1112 __local u32 l_bin2asc[256];
1114 for (u32 i = lid; i < 256; i += lsz)
1116 const u32 i0 = (i >> 0) & 15;
1117 const u32 i1 = (i >> 4) & 15;
1119 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
1120 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
1123 barrier (CLK_LOCAL_MEM_FENCE);
1125 if (gid >= gid_max) return;
1131 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, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);