2 * Authors.....: Jens Steube <jens.steube@gmail.com>
3 * Gabriele Gristina <matrix@hashcat.net>
4 * magnum <john.magnum@hushmail.com>
13 #include "include/constants.h"
14 #include "include/kernel_vendor.h"
21 #include "include/kernel_functions.c"
22 #include "OpenCL/types_ocl.c"
23 #include "OpenCL/common.c"
24 #include "OpenCL/simd.c"
27 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i)])
29 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1])
31 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3])
33 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3], l_bin2asc[(i).s4], l_bin2asc[(i).s5], l_bin2asc[(i).s6], l_bin2asc[(i).s7])
35 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3], l_bin2asc[(i).s4], l_bin2asc[(i).s5], l_bin2asc[(i).s6], l_bin2asc[(i).s7], l_bin2asc[(i).s8], l_bin2asc[(i).s9], l_bin2asc[(i).sa], l_bin2asc[(i).sb], l_bin2asc[(i).sc], l_bin2asc[(i).sd], l_bin2asc[(i).se], l_bin2asc[(i).sf])
38 static void m02810m (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_len, __global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, __local u32 *l_bin2asc)
44 const u32 gid = get_global_id (0);
45 const u32 lid = get_local_id (0);
56 salt_buf0[0] = salt_bufs[salt_pos].salt_buf_pc[0];
57 salt_buf0[1] = salt_bufs[salt_pos].salt_buf_pc[1];
58 salt_buf0[2] = salt_bufs[salt_pos].salt_buf_pc[2];
59 salt_buf0[3] = salt_bufs[salt_pos].salt_buf_pc[3];
60 salt_buf1[0] = salt_bufs[salt_pos].salt_buf_pc[4];
61 salt_buf1[1] = salt_bufs[salt_pos].salt_buf_pc[5];
62 salt_buf1[2] = salt_bufs[salt_pos].salt_buf_pc[6];
63 salt_buf1[3] = salt_bufs[salt_pos].salt_buf_pc[7];
73 const u32 salt_len = salt_bufs[salt_pos].salt_len;
81 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
83 const u32x w0r = ix_create_bft (bfs_buf, il_pos);
85 const u32x w0lr = w0l | w0r;
118 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
119 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
120 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
121 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
122 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
123 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
124 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
125 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
126 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
127 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
128 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
129 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
130 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
131 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
132 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
133 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
135 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
136 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
137 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
138 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
139 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
140 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
141 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
142 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
143 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
144 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
145 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
146 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
147 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
148 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
149 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
150 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
152 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
153 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
154 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
155 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
156 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
157 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
158 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
159 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
160 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
161 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
162 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
163 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
164 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
165 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
166 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
167 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
169 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
170 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
171 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
172 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
173 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
174 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
175 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
176 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
177 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
178 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
179 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
180 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
181 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
182 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
183 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
184 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
191 w0_t[0] = salt_buf0[0];
192 w0_t[1] = salt_buf0[1];
193 w0_t[2] = salt_buf0[2];
194 w0_t[3] = salt_buf0[3];
195 w1_t[0] = salt_buf1[0];
196 w1_t[1] = salt_buf1[1];
197 w1_t[2] = salt_buf1[2];
198 w1_t[3] = salt_buf1[3];
200 w2_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
201 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
202 w2_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
203 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
204 w2_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
205 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
206 w2_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
207 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
208 w3_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
209 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
210 w3_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
211 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
212 w3_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
213 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
214 w3_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
215 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
222 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
223 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
224 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
225 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
226 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
227 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
228 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
229 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
230 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
231 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
232 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
233 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
234 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
235 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
236 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
237 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
239 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
240 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
241 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
242 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
243 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
244 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
245 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
246 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
247 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
248 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
249 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
250 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
251 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
252 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
253 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
254 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
256 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
257 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
258 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
259 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
260 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
261 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
262 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
263 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
264 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
265 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
266 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
267 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
268 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
269 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
270 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
271 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
273 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
274 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
275 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
276 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
277 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
278 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
279 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
280 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
281 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
282 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
283 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
284 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
285 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
286 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
287 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
288 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
290 const u32x r_a = a + MD5M_A;
291 const u32x r_b = b + MD5M_B;
292 const u32x r_c = c + MD5M_C;
293 const u32x r_d = d + MD5M_D;
295 const u32x r_00 = 0x80;
296 const u32x r_14 = 64 * 8;
303 MD5_STEP (MD5_Fo, a, b, c, d, r_00, MD5C00, MD5S00);
304 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C01, MD5S01);
305 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C02, MD5S02);
306 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C03, MD5S03);
307 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C04, MD5S00);
308 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C05, MD5S01);
309 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C06, MD5S02);
310 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C07, MD5S03);
311 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C08, MD5S00);
312 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C09, MD5S01);
313 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C0a, MD5S02);
314 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0b, MD5S03);
315 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C0c, MD5S00);
316 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C0d, MD5S01);
317 MD5_STEP (MD5_Fo, c, d, a, b, r_14, MD5C0e, MD5S02);
318 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0f, MD5S03);
320 MD5_STEP0(MD5_Go, a, b, c, d, MD5C10, MD5S10);
321 MD5_STEP0(MD5_Go, d, a, b, c, MD5C11, MD5S11);
322 MD5_STEP0(MD5_Go, c, d, a, b, MD5C12, MD5S12);
323 MD5_STEP (MD5_Go, b, c, d, a, r_00, MD5C13, MD5S13);
324 MD5_STEP0(MD5_Go, a, b, c, d, MD5C14, MD5S10);
325 MD5_STEP0(MD5_Go, d, a, b, c, MD5C15, MD5S11);
326 MD5_STEP0(MD5_Go, c, d, a, b, MD5C16, MD5S12);
327 MD5_STEP0(MD5_Go, b, c, d, a, MD5C17, MD5S13);
328 MD5_STEP0(MD5_Go, a, b, c, d, MD5C18, MD5S10);
329 MD5_STEP (MD5_Go, d, a, b, c, r_14, MD5C19, MD5S11);
330 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1a, MD5S12);
331 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1b, MD5S13);
332 MD5_STEP0(MD5_Go, a, b, c, d, MD5C1c, MD5S10);
333 MD5_STEP0(MD5_Go, d, a, b, c, MD5C1d, MD5S11);
334 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1e, MD5S12);
335 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1f, MD5S13);
337 MD5_STEP0(MD5_H , a, b, c, d, MD5C20, MD5S20);
338 MD5_STEP0(MD5_H , d, a, b, c, MD5C21, MD5S21);
339 MD5_STEP0(MD5_H , c, d, a, b, MD5C22, MD5S22);
340 MD5_STEP (MD5_H , b, c, d, a, r_14, MD5C23, MD5S23);
341 MD5_STEP0(MD5_H , a, b, c, d, MD5C24, MD5S20);
342 MD5_STEP0(MD5_H , d, a, b, c, MD5C25, MD5S21);
343 MD5_STEP0(MD5_H , c, d, a, b, MD5C26, MD5S22);
344 MD5_STEP0(MD5_H , b, c, d, a, MD5C27, MD5S23);
345 MD5_STEP0(MD5_H , a, b, c, d, MD5C28, MD5S20);
346 MD5_STEP (MD5_H , d, a, b, c, r_00, MD5C29, MD5S21);
347 MD5_STEP0(MD5_H , c, d, a, b, MD5C2a, MD5S22);
348 MD5_STEP0(MD5_H , b, c, d, a, MD5C2b, MD5S23);
349 MD5_STEP0(MD5_H , a, b, c, d, MD5C2c, MD5S20);
350 MD5_STEP0(MD5_H , d, a, b, c, MD5C2d, MD5S21);
351 MD5_STEP0(MD5_H , c, d, a, b, MD5C2e, MD5S22);
352 MD5_STEP0(MD5_H , b, c, d, a, MD5C2f, MD5S23);
354 MD5_STEP (MD5_I , a, b, c, d, r_00, MD5C30, MD5S30);
355 MD5_STEP0(MD5_I , d, a, b, c, MD5C31, MD5S31);
356 MD5_STEP (MD5_I , c, d, a, b, r_14, MD5C32, MD5S32);
357 MD5_STEP0(MD5_I , b, c, d, a, MD5C33, MD5S33);
358 MD5_STEP0(MD5_I , a, b, c, d, MD5C34, MD5S30);
359 MD5_STEP0(MD5_I , d, a, b, c, MD5C35, MD5S31);
360 MD5_STEP0(MD5_I , c, d, a, b, MD5C36, MD5S32);
361 MD5_STEP0(MD5_I , b, c, d, a, MD5C37, MD5S33);
362 MD5_STEP0(MD5_I , a, b, c, d, MD5C38, MD5S30);
363 MD5_STEP0(MD5_I , d, a, b, c, MD5C39, MD5S31);
364 MD5_STEP0(MD5_I , c, d, a, b, MD5C3a, MD5S32);
365 MD5_STEP0(MD5_I , b, c, d, a, MD5C3b, MD5S33);
366 MD5_STEP0(MD5_I , a, b, c, d, MD5C3c, MD5S30);
367 MD5_STEP0(MD5_I , d, a, b, c, MD5C3d, MD5S31);
368 MD5_STEP0(MD5_I , c, d, a, b, MD5C3e, MD5S32);
369 MD5_STEP0(MD5_I , b, c, d, a, MD5C3f, MD5S33);
376 COMPARE_M_SIMD (a, d, c, b);
380 static void m02810s (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_len, __global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, __local u32 *l_bin2asc)
386 const u32 gid = get_global_id (0);
387 const u32 lid = get_local_id (0);
398 salt_buf0[0] = salt_bufs[salt_pos].salt_buf_pc[0];
399 salt_buf0[1] = salt_bufs[salt_pos].salt_buf_pc[1];
400 salt_buf0[2] = salt_bufs[salt_pos].salt_buf_pc[2];
401 salt_buf0[3] = salt_bufs[salt_pos].salt_buf_pc[3];
402 salt_buf1[0] = salt_bufs[salt_pos].salt_buf_pc[4];
403 salt_buf1[1] = salt_bufs[salt_pos].salt_buf_pc[5];
404 salt_buf1[2] = salt_bufs[salt_pos].salt_buf_pc[6];
405 salt_buf1[3] = salt_bufs[salt_pos].salt_buf_pc[7];
415 const u32 salt_len = salt_bufs[salt_pos].salt_len;
421 const u32 search[4] =
423 digests_buf[digests_offset].digest_buf[DGST_R0],
424 digests_buf[digests_offset].digest_buf[DGST_R1],
425 digests_buf[digests_offset].digest_buf[DGST_R2],
426 digests_buf[digests_offset].digest_buf[DGST_R3]
435 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
437 const u32x w0r = ix_create_bft (bfs_buf, il_pos);
439 const u32x w0lr = w0l | w0r;
472 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
473 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
474 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
475 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
476 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
477 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
478 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
479 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
480 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
481 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
482 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
483 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
484 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
485 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
486 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
487 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
489 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
490 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
491 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
492 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
493 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
494 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
495 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
496 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
497 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
498 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
499 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
500 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
501 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
502 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
503 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
504 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
506 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
507 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
508 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
509 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
510 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
511 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
512 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
513 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
514 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
515 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
516 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
517 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
518 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
519 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
520 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
521 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
523 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
524 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
525 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
526 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
527 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
528 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
529 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
530 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
531 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
532 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
533 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
534 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
535 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
536 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
537 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
538 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
545 w0_t[0] = salt_buf0[0];
546 w0_t[1] = salt_buf0[1];
547 w0_t[2] = salt_buf0[2];
548 w0_t[3] = salt_buf0[3];
549 w1_t[0] = salt_buf1[0];
550 w1_t[1] = salt_buf1[1];
551 w1_t[2] = salt_buf1[2];
552 w1_t[3] = salt_buf1[3];
554 w2_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
555 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
556 w2_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
557 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
558 w2_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
559 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
560 w2_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
561 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
562 w3_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
563 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
564 w3_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
565 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
566 w3_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
567 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
568 w3_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
569 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
576 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
577 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
578 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
579 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
580 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
581 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
582 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
583 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
584 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
585 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
586 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
587 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
588 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
589 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
590 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
591 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
593 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
594 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
595 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
596 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
597 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
598 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
599 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
600 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
601 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
602 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
603 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
604 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
605 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
606 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
607 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
608 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
610 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
611 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
612 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
613 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
614 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
615 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
616 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
617 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
618 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
619 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
620 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
621 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
622 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
623 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
624 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
625 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
627 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
628 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
629 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
630 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
631 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
632 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
633 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
634 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
635 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
636 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
637 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
638 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
639 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
640 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
641 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
642 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
644 const u32x r_a = a + MD5M_A;
645 const u32x r_b = b + MD5M_B;
646 const u32x r_c = c + MD5M_C;
647 const u32x r_d = d + MD5M_D;
649 const u32x r_00 = 0x80;
650 const u32x r_14 = 64 * 8;
657 MD5_STEP (MD5_Fo, a, b, c, d, r_00, MD5C00, MD5S00);
658 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C01, MD5S01);
659 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C02, MD5S02);
660 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C03, MD5S03);
661 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C04, MD5S00);
662 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C05, MD5S01);
663 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C06, MD5S02);
664 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C07, MD5S03);
665 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C08, MD5S00);
666 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C09, MD5S01);
667 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C0a, MD5S02);
668 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0b, MD5S03);
669 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C0c, MD5S00);
670 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C0d, MD5S01);
671 MD5_STEP (MD5_Fo, c, d, a, b, r_14, MD5C0e, MD5S02);
672 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0f, MD5S03);
674 MD5_STEP0(MD5_Go, a, b, c, d, MD5C10, MD5S10);
675 MD5_STEP0(MD5_Go, d, a, b, c, MD5C11, MD5S11);
676 MD5_STEP0(MD5_Go, c, d, a, b, MD5C12, MD5S12);
677 MD5_STEP (MD5_Go, b, c, d, a, r_00, MD5C13, MD5S13);
678 MD5_STEP0(MD5_Go, a, b, c, d, MD5C14, MD5S10);
679 MD5_STEP0(MD5_Go, d, a, b, c, MD5C15, MD5S11);
680 MD5_STEP0(MD5_Go, c, d, a, b, MD5C16, MD5S12);
681 MD5_STEP0(MD5_Go, b, c, d, a, MD5C17, MD5S13);
682 MD5_STEP0(MD5_Go, a, b, c, d, MD5C18, MD5S10);
683 MD5_STEP (MD5_Go, d, a, b, c, r_14, MD5C19, MD5S11);
684 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1a, MD5S12);
685 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1b, MD5S13);
686 MD5_STEP0(MD5_Go, a, b, c, d, MD5C1c, MD5S10);
687 MD5_STEP0(MD5_Go, d, a, b, c, MD5C1d, MD5S11);
688 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1e, MD5S12);
689 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1f, MD5S13);
691 MD5_STEP0(MD5_H , a, b, c, d, MD5C20, MD5S20);
692 MD5_STEP0(MD5_H , d, a, b, c, MD5C21, MD5S21);
693 MD5_STEP0(MD5_H , c, d, a, b, MD5C22, MD5S22);
694 MD5_STEP (MD5_H , b, c, d, a, r_14, MD5C23, MD5S23);
695 MD5_STEP0(MD5_H , a, b, c, d, MD5C24, MD5S20);
696 MD5_STEP0(MD5_H , d, a, b, c, MD5C25, MD5S21);
697 MD5_STEP0(MD5_H , c, d, a, b, MD5C26, MD5S22);
698 MD5_STEP0(MD5_H , b, c, d, a, MD5C27, MD5S23);
699 MD5_STEP0(MD5_H , a, b, c, d, MD5C28, MD5S20);
700 MD5_STEP (MD5_H , d, a, b, c, r_00, MD5C29, MD5S21);
701 MD5_STEP0(MD5_H , c, d, a, b, MD5C2a, MD5S22);
702 MD5_STEP0(MD5_H , b, c, d, a, MD5C2b, MD5S23);
703 MD5_STEP0(MD5_H , a, b, c, d, MD5C2c, MD5S20);
704 MD5_STEP0(MD5_H , d, a, b, c, MD5C2d, MD5S21);
705 MD5_STEP0(MD5_H , c, d, a, b, MD5C2e, MD5S22);
706 MD5_STEP0(MD5_H , b, c, d, a, MD5C2f, MD5S23);
708 MD5_STEP (MD5_I , a, b, c, d, r_00, MD5C30, MD5S30);
709 MD5_STEP0(MD5_I , d, a, b, c, MD5C31, MD5S31);
710 MD5_STEP (MD5_I , c, d, a, b, r_14, MD5C32, MD5S32);
711 MD5_STEP0(MD5_I , b, c, d, a, MD5C33, MD5S33);
712 MD5_STEP0(MD5_I , a, b, c, d, MD5C34, MD5S30);
713 MD5_STEP0(MD5_I , d, a, b, c, MD5C35, MD5S31);
714 MD5_STEP0(MD5_I , c, d, a, b, MD5C36, MD5S32);
715 MD5_STEP0(MD5_I , b, c, d, a, MD5C37, MD5S33);
716 MD5_STEP0(MD5_I , a, b, c, d, MD5C38, MD5S30);
717 MD5_STEP0(MD5_I , d, a, b, c, MD5C39, MD5S31);
718 MD5_STEP0(MD5_I , c, d, a, b, MD5C3a, MD5S32);
719 MD5_STEP0(MD5_I , b, c, d, a, MD5C3b, MD5S33);
720 MD5_STEP0(MD5_I , a, b, c, d, MD5C3c, MD5S30);
722 if (MATCHES_NONE_VS ((a + r_a), search[0])) continue;
724 MD5_STEP0(MD5_I , d, a, b, c, MD5C3d, MD5S31);
725 MD5_STEP0(MD5_I , c, d, a, b, MD5C3e, MD5S32);
726 MD5_STEP0(MD5_I , b, c, d, a, MD5C3f, MD5S33);
733 COMPARE_S_SIMD (a, d, c, b);
737 __kernel void m02810_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
743 const u32 gid = get_global_id (0);
744 const u32 lid = get_local_id (0);
745 const u32 lsz = get_local_size (0);
753 w0[0] = pws[gid].i[ 0];
754 w0[1] = pws[gid].i[ 1];
755 w0[2] = pws[gid].i[ 2];
756 w0[3] = pws[gid].i[ 3];
776 w3[2] = pws[gid].i[14];
779 const u32 pw_len = pws[gid].pw_len;
785 __local u32 l_bin2asc[256];
787 for (u32 i = lid; i < 256; i += lsz)
789 const u32 i0 = (i >> 0) & 15;
790 const u32 i1 = (i >> 4) & 15;
792 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
793 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
796 barrier (CLK_LOCAL_MEM_FENCE);
798 if (gid >= gid_max) return;
804 m02810m (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);
807 __kernel void m02810_m08 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
813 const u32 gid = get_global_id (0);
814 const u32 lid = get_local_id (0);
815 const u32 lsz = get_local_size (0);
823 w0[0] = pws[gid].i[ 0];
824 w0[1] = pws[gid].i[ 1];
825 w0[2] = pws[gid].i[ 2];
826 w0[3] = pws[gid].i[ 3];
830 w1[0] = pws[gid].i[ 4];
831 w1[1] = pws[gid].i[ 5];
832 w1[2] = pws[gid].i[ 6];
833 w1[3] = pws[gid].i[ 7];
846 w3[2] = pws[gid].i[14];
849 const u32 pw_len = pws[gid].pw_len;
855 __local u32 l_bin2asc[256];
857 for (u32 i = lid; i < 256; i += lsz)
859 const u32 i0 = (i >> 0) & 15;
860 const u32 i1 = (i >> 4) & 15;
862 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
863 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
866 barrier (CLK_LOCAL_MEM_FENCE);
868 if (gid >= gid_max) return;
874 m02810m (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);
877 __kernel void m02810_m16 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
883 const u32 gid = get_global_id (0);
884 const u32 lid = get_local_id (0);
885 const u32 lsz = get_local_size (0);
893 w0[0] = pws[gid].i[ 0];
894 w0[1] = pws[gid].i[ 1];
895 w0[2] = pws[gid].i[ 2];
896 w0[3] = pws[gid].i[ 3];
900 w1[0] = pws[gid].i[ 4];
901 w1[1] = pws[gid].i[ 5];
902 w1[2] = pws[gid].i[ 6];
903 w1[3] = pws[gid].i[ 7];
907 w2[0] = pws[gid].i[ 8];
908 w2[1] = pws[gid].i[ 9];
909 w2[2] = pws[gid].i[10];
910 w2[3] = pws[gid].i[11];
914 w3[0] = pws[gid].i[12];
915 w3[1] = pws[gid].i[13];
916 w3[2] = pws[gid].i[14];
917 w3[3] = pws[gid].i[15];
919 const u32 pw_len = pws[gid].pw_len;
925 __local u32 l_bin2asc[256];
927 for (u32 i = lid; i < 256; i += lsz)
929 const u32 i0 = (i >> 0) & 15;
930 const u32 i1 = (i >> 4) & 15;
932 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
933 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
936 barrier (CLK_LOCAL_MEM_FENCE);
938 if (gid >= gid_max) return;
944 m02810m (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);
947 __kernel void m02810_s04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
953 const u32 gid = get_global_id (0);
954 const u32 lid = get_local_id (0);
955 const u32 lsz = get_local_size (0);
963 w0[0] = pws[gid].i[ 0];
964 w0[1] = pws[gid].i[ 1];
965 w0[2] = pws[gid].i[ 2];
966 w0[3] = pws[gid].i[ 3];
986 w3[2] = pws[gid].i[14];
989 const u32 pw_len = pws[gid].pw_len;
995 __local u32 l_bin2asc[256];
997 for (u32 i = lid; i < 256; i += lsz)
999 const u32 i0 = (i >> 0) & 15;
1000 const u32 i1 = (i >> 4) & 15;
1002 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
1003 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
1006 barrier (CLK_LOCAL_MEM_FENCE);
1008 if (gid >= gid_max) return;
1014 m02810s (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);
1017 __kernel void m02810_s08 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
1023 const u32 gid = get_global_id (0);
1024 const u32 lid = get_local_id (0);
1025 const u32 lsz = get_local_size (0);
1033 w0[0] = pws[gid].i[ 0];
1034 w0[1] = pws[gid].i[ 1];
1035 w0[2] = pws[gid].i[ 2];
1036 w0[3] = pws[gid].i[ 3];
1040 w1[0] = pws[gid].i[ 4];
1041 w1[1] = pws[gid].i[ 5];
1042 w1[2] = pws[gid].i[ 6];
1043 w1[3] = pws[gid].i[ 7];
1056 w3[2] = pws[gid].i[14];
1059 const u32 pw_len = pws[gid].pw_len;
1065 __local u32 l_bin2asc[256];
1067 for (u32 i = lid; i < 256; i += lsz)
1069 const u32 i0 = (i >> 0) & 15;
1070 const u32 i1 = (i >> 4) & 15;
1072 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
1073 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
1076 barrier (CLK_LOCAL_MEM_FENCE);
1078 if (gid >= gid_max) return;
1084 m02810s (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);
1087 __kernel void m02810_s16 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
1093 const u32 gid = get_global_id (0);
1094 const u32 lid = get_local_id (0);
1095 const u32 lsz = get_local_size (0);
1103 w0[0] = pws[gid].i[ 0];
1104 w0[1] = pws[gid].i[ 1];
1105 w0[2] = pws[gid].i[ 2];
1106 w0[3] = pws[gid].i[ 3];
1110 w1[0] = pws[gid].i[ 4];
1111 w1[1] = pws[gid].i[ 5];
1112 w1[2] = pws[gid].i[ 6];
1113 w1[3] = pws[gid].i[ 7];
1117 w2[0] = pws[gid].i[ 8];
1118 w2[1] = pws[gid].i[ 9];
1119 w2[2] = pws[gid].i[10];
1120 w2[3] = pws[gid].i[11];
1124 w3[0] = pws[gid].i[12];
1125 w3[1] = pws[gid].i[13];
1126 w3[2] = pws[gid].i[14];
1127 w3[3] = pws[gid].i[15];
1129 const u32 pw_len = pws[gid].pw_len;
1135 __local u32 l_bin2asc[256];
1137 for (u32 i = lid; i < 256; i += lsz)
1139 const u32 i0 = (i >> 0) & 15;
1140 const u32 i1 = (i >> 4) & 15;
1142 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
1143 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
1146 barrier (CLK_LOCAL_MEM_FENCE);
1148 if (gid >= gid_max) return;
1154 m02810s (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);