2 * Author......: Jens Steube <jens.steube@gmail.com>
10 #include "include/constants.h"
11 #include "include/kernel_vendor.h"
18 #include "include/kernel_functions.c"
19 #include "OpenCL/types_ocl.c"
20 #include "OpenCL/common.c"
21 #include "OpenCL/simd.c"
24 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i)])
26 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1])
28 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3])
30 #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])
33 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[256])
39 const u32 gid = get_global_id (0);
40 const u32 lid = get_local_id (0);
48 s[0] = salt_bufs[salt_pos].salt_buf_pc[0];
49 s[1] = salt_bufs[salt_pos].salt_buf_pc[1];
50 s[2] = salt_bufs[salt_pos].salt_buf_pc[2];
51 s[3] = salt_bufs[salt_pos].salt_buf_pc[3];
52 s[4] = salt_bufs[salt_pos].salt_buf_pc[4];
53 s[5] = salt_bufs[salt_pos].salt_buf_pc[5];
54 s[6] = salt_bufs[salt_pos].salt_buf_pc[6];
55 s[7] = salt_bufs[salt_pos].salt_buf_pc[7];
57 const u32 r_00 = 0x80;
58 const u32 r_14 = 64 * 8;
66 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
68 const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
70 const u32x w0lr = w0l | w0r;
105 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
106 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
107 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
108 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
109 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
110 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
111 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
112 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
113 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
114 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
115 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
116 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
117 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
118 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
119 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
120 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
122 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
123 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
124 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
125 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
126 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
127 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
128 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
129 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
130 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
131 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
132 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
133 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
134 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
135 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
136 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
137 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
139 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
140 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
141 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
142 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
143 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
144 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
145 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
146 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
147 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
148 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
149 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
150 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
151 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
152 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
153 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
154 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
156 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
157 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
158 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
159 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
160 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
161 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
162 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
163 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
164 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
165 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
166 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
167 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
168 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
169 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
170 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
171 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
188 w2_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
189 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
190 w2_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
191 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
192 w2_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
193 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
194 w2_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
195 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
196 w3_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
197 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
198 w3_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
199 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
200 w3_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
201 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
202 w3_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
203 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
210 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
211 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
212 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
213 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
214 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
215 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
216 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
217 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
218 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
219 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
220 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
221 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
222 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
223 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
224 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
225 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
227 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
228 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
229 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
230 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
231 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
232 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
233 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
234 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
235 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
236 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
237 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
238 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
239 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
240 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
241 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
242 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
244 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
245 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
246 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
247 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
248 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
249 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
250 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
251 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
252 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
253 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
254 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
255 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
256 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
257 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
258 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
259 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
261 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
262 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
263 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
264 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
265 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
266 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
267 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
268 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
269 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
270 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
271 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
272 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
273 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
274 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
275 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
276 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
278 const u32x r_a = a + MD5M_A;
279 const u32x r_b = b + MD5M_B;
280 const u32x r_c = c + MD5M_C;
281 const u32x r_d = d + MD5M_D;
288 MD5_STEP (MD5_Fo, a, b, c, d, r_00, MD5C00, MD5S00);
289 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C01, MD5S01);
290 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C02, MD5S02);
291 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C03, MD5S03);
292 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C04, MD5S00);
293 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C05, MD5S01);
294 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C06, MD5S02);
295 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C07, MD5S03);
296 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C08, MD5S00);
297 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C09, MD5S01);
298 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C0a, MD5S02);
299 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0b, MD5S03);
300 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C0c, MD5S00);
301 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C0d, MD5S01);
302 MD5_STEP (MD5_Fo, c, d, a, b, r_14, MD5C0e, MD5S02);
303 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0f, MD5S03);
305 MD5_STEP0(MD5_Go, a, b, c, d, MD5C10, MD5S10);
306 MD5_STEP0(MD5_Go, d, a, b, c, MD5C11, MD5S11);
307 MD5_STEP0(MD5_Go, c, d, a, b, MD5C12, MD5S12);
308 MD5_STEP (MD5_Go, b, c, d, a, r_00, MD5C13, MD5S13);
309 MD5_STEP0(MD5_Go, a, b, c, d, MD5C14, MD5S10);
310 MD5_STEP0(MD5_Go, d, a, b, c, MD5C15, MD5S11);
311 MD5_STEP0(MD5_Go, c, d, a, b, MD5C16, MD5S12);
312 MD5_STEP0(MD5_Go, b, c, d, a, MD5C17, MD5S13);
313 MD5_STEP0(MD5_Go, a, b, c, d, MD5C18, MD5S10);
314 MD5_STEP (MD5_Go, d, a, b, c, r_14, MD5C19, MD5S11);
315 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1a, MD5S12);
316 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1b, MD5S13);
317 MD5_STEP0(MD5_Go, a, b, c, d, MD5C1c, MD5S10);
318 MD5_STEP0(MD5_Go, d, a, b, c, MD5C1d, MD5S11);
319 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1e, MD5S12);
320 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1f, MD5S13);
322 MD5_STEP0(MD5_H , a, b, c, d, MD5C20, MD5S20);
323 MD5_STEP0(MD5_H , d, a, b, c, MD5C21, MD5S21);
324 MD5_STEP0(MD5_H , c, d, a, b, MD5C22, MD5S22);
325 MD5_STEP (MD5_H , b, c, d, a, r_14, MD5C23, MD5S23);
326 MD5_STEP0(MD5_H , a, b, c, d, MD5C24, MD5S20);
327 MD5_STEP0(MD5_H , d, a, b, c, MD5C25, MD5S21);
328 MD5_STEP0(MD5_H , c, d, a, b, MD5C26, MD5S22);
329 MD5_STEP0(MD5_H , b, c, d, a, MD5C27, MD5S23);
330 MD5_STEP0(MD5_H , a, b, c, d, MD5C28, MD5S20);
331 MD5_STEP (MD5_H , d, a, b, c, r_00, MD5C29, MD5S21);
332 MD5_STEP0(MD5_H , c, d, a, b, MD5C2a, MD5S22);
333 MD5_STEP0(MD5_H , b, c, d, a, MD5C2b, MD5S23);
334 MD5_STEP0(MD5_H , a, b, c, d, MD5C2c, MD5S20);
335 MD5_STEP0(MD5_H , d, a, b, c, MD5C2d, MD5S21);
336 MD5_STEP0(MD5_H , c, d, a, b, MD5C2e, MD5S22);
337 MD5_STEP0(MD5_H , b, c, d, a, MD5C2f, MD5S23);
339 MD5_STEP (MD5_I , a, b, c, d, r_00, MD5C30, MD5S30);
340 MD5_STEP0(MD5_I , d, a, b, c, MD5C31, MD5S31);
341 MD5_STEP (MD5_I , c, d, a, b, r_14, MD5C32, MD5S32);
342 MD5_STEP0(MD5_I , b, c, d, a, MD5C33, MD5S33);
343 MD5_STEP0(MD5_I , a, b, c, d, MD5C34, MD5S30);
344 MD5_STEP0(MD5_I , d, a, b, c, MD5C35, MD5S31);
345 MD5_STEP0(MD5_I , c, d, a, b, MD5C36, MD5S32);
346 MD5_STEP0(MD5_I , b, c, d, a, MD5C37, MD5S33);
347 MD5_STEP0(MD5_I , a, b, c, d, MD5C38, MD5S30);
348 MD5_STEP0(MD5_I , d, a, b, c, MD5C39, MD5S31);
349 MD5_STEP0(MD5_I , c, d, a, b, MD5C3a, MD5S32);
350 MD5_STEP0(MD5_I , b, c, d, a, MD5C3b, MD5S33);
351 MD5_STEP0(MD5_I , a, b, c, d, MD5C3c, MD5S30);
352 MD5_STEP0(MD5_I , d, a, b, c, MD5C3d, MD5S31);
353 MD5_STEP0(MD5_I , c, d, a, b, MD5C3e, MD5S32);
354 MD5_STEP0(MD5_I , b, c, d, a, MD5C3f, MD5S33);
361 COMPARE_M_SIMD (a, d, c, b);
365 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[256])
371 const u32 gid = get_global_id (0);
372 const u32 lid = get_local_id (0);
378 const u32 search[4] =
380 digests_buf[digests_offset].digest_buf[DGST_R0],
381 digests_buf[digests_offset].digest_buf[DGST_R1],
382 digests_buf[digests_offset].digest_buf[DGST_R2],
383 digests_buf[digests_offset].digest_buf[DGST_R3]
392 s[0] = salt_bufs[salt_pos].salt_buf_pc[0];
393 s[1] = salt_bufs[salt_pos].salt_buf_pc[1];
394 s[2] = salt_bufs[salt_pos].salt_buf_pc[2];
395 s[3] = salt_bufs[salt_pos].salt_buf_pc[3];
396 s[4] = salt_bufs[salt_pos].salt_buf_pc[4];
397 s[5] = salt_bufs[salt_pos].salt_buf_pc[5];
398 s[6] = salt_bufs[salt_pos].salt_buf_pc[6];
399 s[7] = salt_bufs[salt_pos].salt_buf_pc[7];
401 const u32 r_00 = 0x80;
402 const u32 r_14 = 64 * 8;
410 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
412 const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
414 const u32x w0lr = w0l | w0r;
449 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
450 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
451 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
452 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
453 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
454 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
455 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
456 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
457 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
458 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
459 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
460 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
461 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
462 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
463 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
464 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
466 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
467 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
468 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
469 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
470 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
471 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
472 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
473 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
474 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
475 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
476 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
477 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
478 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
479 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
480 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
481 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
483 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
484 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
485 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
486 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
487 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
488 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
489 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
490 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
491 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
492 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
493 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
494 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
495 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
496 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
497 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
498 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
500 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
501 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
502 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
503 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
504 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
505 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
506 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
507 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
508 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
509 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
510 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
511 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
512 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
513 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
514 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
515 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
532 w2_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
533 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
534 w2_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
535 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
536 w2_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
537 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
538 w2_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
539 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
540 w3_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
541 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
542 w3_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
543 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
544 w3_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
545 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
546 w3_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
547 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
554 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
555 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
556 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
557 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
558 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
559 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
560 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
561 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
562 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
563 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
564 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
565 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
566 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
567 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
568 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
569 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
571 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
572 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
573 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
574 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
575 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
576 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
577 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
578 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
579 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
580 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
581 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
582 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
583 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
584 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
585 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
586 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
588 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
589 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
590 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
591 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
592 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
593 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
594 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
595 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
596 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
597 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
598 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
599 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
600 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
601 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
602 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
603 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
605 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
606 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
607 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
608 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
609 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
610 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
611 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
612 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
613 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
614 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
615 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
616 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
617 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
618 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
619 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
620 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
622 const u32x r_a = a + MD5M_A;
623 const u32x r_b = b + MD5M_B;
624 const u32x r_c = c + MD5M_C;
625 const u32x r_d = d + MD5M_D;
632 MD5_STEP (MD5_Fo, a, b, c, d, r_00, MD5C00, MD5S00);
633 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C01, MD5S01);
634 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C02, MD5S02);
635 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C03, MD5S03);
636 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C04, MD5S00);
637 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C05, MD5S01);
638 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C06, MD5S02);
639 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C07, MD5S03);
640 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C08, MD5S00);
641 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C09, MD5S01);
642 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C0a, MD5S02);
643 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0b, MD5S03);
644 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C0c, MD5S00);
645 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C0d, MD5S01);
646 MD5_STEP (MD5_Fo, c, d, a, b, r_14, MD5C0e, MD5S02);
647 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0f, MD5S03);
649 MD5_STEP0(MD5_Go, a, b, c, d, MD5C10, MD5S10);
650 MD5_STEP0(MD5_Go, d, a, b, c, MD5C11, MD5S11);
651 MD5_STEP0(MD5_Go, c, d, a, b, MD5C12, MD5S12);
652 MD5_STEP (MD5_Go, b, c, d, a, r_00, MD5C13, MD5S13);
653 MD5_STEP0(MD5_Go, a, b, c, d, MD5C14, MD5S10);
654 MD5_STEP0(MD5_Go, d, a, b, c, MD5C15, MD5S11);
655 MD5_STEP0(MD5_Go, c, d, a, b, MD5C16, MD5S12);
656 MD5_STEP0(MD5_Go, b, c, d, a, MD5C17, MD5S13);
657 MD5_STEP0(MD5_Go, a, b, c, d, MD5C18, MD5S10);
658 MD5_STEP (MD5_Go, d, a, b, c, r_14, MD5C19, MD5S11);
659 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1a, MD5S12);
660 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1b, MD5S13);
661 MD5_STEP0(MD5_Go, a, b, c, d, MD5C1c, MD5S10);
662 MD5_STEP0(MD5_Go, d, a, b, c, MD5C1d, MD5S11);
663 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1e, MD5S12);
664 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1f, MD5S13);
666 MD5_STEP0(MD5_H , a, b, c, d, MD5C20, MD5S20);
667 MD5_STEP0(MD5_H , d, a, b, c, MD5C21, MD5S21);
668 MD5_STEP0(MD5_H , c, d, a, b, MD5C22, MD5S22);
669 MD5_STEP (MD5_H , b, c, d, a, r_14, MD5C23, MD5S23);
670 MD5_STEP0(MD5_H , a, b, c, d, MD5C24, MD5S20);
671 MD5_STEP0(MD5_H , d, a, b, c, MD5C25, MD5S21);
672 MD5_STEP0(MD5_H , c, d, a, b, MD5C26, MD5S22);
673 MD5_STEP0(MD5_H , b, c, d, a, MD5C27, MD5S23);
674 MD5_STEP0(MD5_H , a, b, c, d, MD5C28, MD5S20);
675 MD5_STEP (MD5_H , d, a, b, c, r_00, MD5C29, MD5S21);
676 MD5_STEP0(MD5_H , c, d, a, b, MD5C2a, MD5S22);
677 MD5_STEP0(MD5_H , b, c, d, a, MD5C2b, MD5S23);
678 MD5_STEP0(MD5_H , a, b, c, d, MD5C2c, MD5S20);
679 MD5_STEP0(MD5_H , d, a, b, c, MD5C2d, MD5S21);
680 MD5_STEP0(MD5_H , c, d, a, b, MD5C2e, MD5S22);
681 MD5_STEP0(MD5_H , b, c, d, a, MD5C2f, MD5S23);
683 MD5_STEP (MD5_I , a, b, c, d, r_00, MD5C30, MD5S30);
684 MD5_STEP0(MD5_I , d, a, b, c, MD5C31, MD5S31);
685 MD5_STEP (MD5_I , c, d, a, b, r_14, MD5C32, MD5S32);
686 MD5_STEP0(MD5_I , b, c, d, a, MD5C33, MD5S33);
687 MD5_STEP0(MD5_I , a, b, c, d, MD5C34, MD5S30);
688 MD5_STEP0(MD5_I , d, a, b, c, MD5C35, MD5S31);
689 MD5_STEP0(MD5_I , c, d, a, b, MD5C36, MD5S32);
690 MD5_STEP0(MD5_I , b, c, d, a, MD5C37, MD5S33);
691 MD5_STEP0(MD5_I , a, b, c, d, MD5C38, MD5S30);
692 MD5_STEP0(MD5_I , d, a, b, c, MD5C39, MD5S31);
693 MD5_STEP0(MD5_I , c, d, a, b, MD5C3a, MD5S32);
694 MD5_STEP0(MD5_I , b, c, d, a, MD5C3b, MD5S33);
695 MD5_STEP0(MD5_I , a, b, c, d, MD5C3c, MD5S30);
697 if (MATCHES_NONE_VS ((a + r_a), search[0])) continue;
699 MD5_STEP0(MD5_I , d, a, b, c, MD5C3d, MD5S31);
700 MD5_STEP0(MD5_I , c, d, a, b, MD5C3e, MD5S32);
701 MD5_STEP0(MD5_I , b, c, d, a, MD5C3f, MD5S33);
708 COMPARE_S_SIMD (a, d, c, b);
712 __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)
718 const u32 gid = get_global_id (0);
719 const u32 lid = get_local_id (0);
720 const u32 lsz = get_local_size (0);
728 w0[0] = pws[gid].i[ 0];
729 w0[1] = pws[gid].i[ 1];
730 w0[2] = pws[gid].i[ 2];
731 w0[3] = pws[gid].i[ 3];
751 w3[2] = pws[gid].i[14];
754 const u32 pw_len = pws[gid].pw_len;
760 __local u32 l_bin2asc[256];
762 for (u32 i = lid; i < 256; i += lsz)
764 const u32 i0 = (i >> 0) & 15;
765 const u32 i1 = (i >> 4) & 15;
767 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
768 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
771 barrier (CLK_LOCAL_MEM_FENCE);
773 if (gid >= gid_max) return;
779 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);
782 __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)
788 const u32 gid = get_global_id (0);
789 const u32 lid = get_local_id (0);
790 const u32 lsz = get_local_size (0);
798 w0[0] = pws[gid].i[ 0];
799 w0[1] = pws[gid].i[ 1];
800 w0[2] = pws[gid].i[ 2];
801 w0[3] = pws[gid].i[ 3];
805 w1[0] = pws[gid].i[ 4];
806 w1[1] = pws[gid].i[ 5];
807 w1[2] = pws[gid].i[ 6];
808 w1[3] = pws[gid].i[ 7];
821 w3[2] = pws[gid].i[14];
824 const u32 pw_len = pws[gid].pw_len;
830 __local u32 l_bin2asc[256];
832 for (u32 i = lid; i < 256; i += lsz)
834 const u32 i0 = (i >> 0) & 15;
835 const u32 i1 = (i >> 4) & 15;
837 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
838 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
841 barrier (CLK_LOCAL_MEM_FENCE);
843 if (gid >= gid_max) return;
849 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);
852 __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)
858 const u32 gid = get_global_id (0);
859 const u32 lid = get_local_id (0);
860 const u32 lsz = get_local_size (0);
868 w0[0] = pws[gid].i[ 0];
869 w0[1] = pws[gid].i[ 1];
870 w0[2] = pws[gid].i[ 2];
871 w0[3] = pws[gid].i[ 3];
875 w1[0] = pws[gid].i[ 4];
876 w1[1] = pws[gid].i[ 5];
877 w1[2] = pws[gid].i[ 6];
878 w1[3] = pws[gid].i[ 7];
882 w2[0] = pws[gid].i[ 8];
883 w2[1] = pws[gid].i[ 9];
884 w2[2] = pws[gid].i[10];
885 w2[3] = pws[gid].i[11];
889 w3[0] = pws[gid].i[12];
890 w3[1] = pws[gid].i[13];
891 w3[2] = pws[gid].i[14];
892 w3[3] = pws[gid].i[15];
894 const u32 pw_len = pws[gid].pw_len;
900 __local u32 l_bin2asc[256];
902 for (u32 i = lid; i < 256; i += lsz)
904 const u32 i0 = (i >> 0) & 15;
905 const u32 i1 = (i >> 4) & 15;
907 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
908 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
911 barrier (CLK_LOCAL_MEM_FENCE);
913 if (gid >= gid_max) return;
919 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);
922 __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)
928 const u32 gid = get_global_id (0);
929 const u32 lid = get_local_id (0);
930 const u32 lsz = get_local_size (0);
938 w0[0] = pws[gid].i[ 0];
939 w0[1] = pws[gid].i[ 1];
940 w0[2] = pws[gid].i[ 2];
941 w0[3] = pws[gid].i[ 3];
961 w3[2] = pws[gid].i[14];
964 const u32 pw_len = pws[gid].pw_len;
970 __local u32 l_bin2asc[256];
972 for (u32 i = lid; i < 256; i += lsz)
974 const u32 i0 = (i >> 0) & 15;
975 const u32 i1 = (i >> 4) & 15;
977 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
978 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
981 barrier (CLK_LOCAL_MEM_FENCE);
983 if (gid >= gid_max) return;
989 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);
992 __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)
998 const u32 gid = get_global_id (0);
999 const u32 lid = get_local_id (0);
1000 const u32 lsz = get_local_size (0);
1008 w0[0] = pws[gid].i[ 0];
1009 w0[1] = pws[gid].i[ 1];
1010 w0[2] = pws[gid].i[ 2];
1011 w0[3] = pws[gid].i[ 3];
1015 w1[0] = pws[gid].i[ 4];
1016 w1[1] = pws[gid].i[ 5];
1017 w1[2] = pws[gid].i[ 6];
1018 w1[3] = pws[gid].i[ 7];
1031 w3[2] = pws[gid].i[14];
1034 const u32 pw_len = pws[gid].pw_len;
1040 __local u32 l_bin2asc[256];
1042 for (u32 i = lid; i < 256; i += lsz)
1044 const u32 i0 = (i >> 0) & 15;
1045 const u32 i1 = (i >> 4) & 15;
1047 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
1048 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
1051 barrier (CLK_LOCAL_MEM_FENCE);
1053 if (gid >= gid_max) return;
1059 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);
1062 __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)
1068 const u32 gid = get_global_id (0);
1069 const u32 lid = get_local_id (0);
1070 const u32 lsz = get_local_size (0);
1078 w0[0] = pws[gid].i[ 0];
1079 w0[1] = pws[gid].i[ 1];
1080 w0[2] = pws[gid].i[ 2];
1081 w0[3] = pws[gid].i[ 3];
1085 w1[0] = pws[gid].i[ 4];
1086 w1[1] = pws[gid].i[ 5];
1087 w1[2] = pws[gid].i[ 6];
1088 w1[3] = pws[gid].i[ 7];
1092 w2[0] = pws[gid].i[ 8];
1093 w2[1] = pws[gid].i[ 9];
1094 w2[2] = pws[gid].i[10];
1095 w2[3] = pws[gid].i[11];
1099 w3[0] = pws[gid].i[12];
1100 w3[1] = pws[gid].i[13];
1101 w3[2] = pws[gid].i[14];
1102 w3[3] = pws[gid].i[15];
1104 const u32 pw_len = pws[gid].pw_len;
1110 __local u32 l_bin2asc[256];
1112 for (u32 i = lid; i < 256; i += lsz)
1114 const u32 i0 = (i >> 0) & 15;
1115 const u32 i1 = (i >> 4) & 15;
1117 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
1118 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
1121 barrier (CLK_LOCAL_MEM_FENCE);
1123 if (gid >= gid_max) return;
1129 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);