2 * Authors.....: Jens Steube <jens.steube@gmail.com>
3 * Gabriele Gristina <matrix@hashcat.net>
4 * magnum <john.magnum@hushmail.com>
13 #include "inc_vendor.cl"
14 #include "inc_hash_constants.h"
15 #include "inc_hash_functions.cl"
16 #include "inc_types.cl"
17 #include "inc_common.cl"
18 #include "inc_simd.cl"
21 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i)])
23 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1])
25 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3])
27 #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])
29 #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])
32 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_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_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)
38 const u32 gid = get_global_id (0);
39 const u32 lid = get_local_id (0);
50 salt_buf0[0] = salt_bufs[salt_pos].salt_buf_pc[0];
51 salt_buf0[1] = salt_bufs[salt_pos].salt_buf_pc[1];
52 salt_buf0[2] = salt_bufs[salt_pos].salt_buf_pc[2];
53 salt_buf0[3] = salt_bufs[salt_pos].salt_buf_pc[3];
54 salt_buf1[0] = salt_bufs[salt_pos].salt_buf_pc[4];
55 salt_buf1[1] = salt_bufs[salt_pos].salt_buf_pc[5];
56 salt_buf1[2] = salt_bufs[salt_pos].salt_buf_pc[6];
57 salt_buf1[3] = salt_bufs[salt_pos].salt_buf_pc[7];
67 const u32 salt_len = salt_bufs[salt_pos].salt_len;
75 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
77 const u32x w0r = ix_create_bft (bfs_buf, il_pos);
79 const u32x w0lr = w0l | w0r;
112 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
113 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
114 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
115 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
116 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
117 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
118 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
119 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
120 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
121 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
122 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
123 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
124 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
125 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
126 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
127 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
129 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
130 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
131 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
132 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
133 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
134 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
135 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
136 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
137 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
138 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
139 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
140 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
141 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
142 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
143 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
144 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
146 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
147 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
148 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
149 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
150 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
151 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
152 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
153 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
154 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
155 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
156 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
157 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
158 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
159 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
160 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
161 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
163 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
164 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
165 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
166 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
167 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
168 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
169 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
170 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
171 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
172 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
173 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
174 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
175 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
176 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
177 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
178 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
185 w0_t[0] = salt_buf0[0];
186 w0_t[1] = salt_buf0[1];
187 w0_t[2] = salt_buf0[2];
188 w0_t[3] = salt_buf0[3];
189 w1_t[0] = salt_buf1[0];
190 w1_t[1] = salt_buf1[1];
191 w1_t[2] = salt_buf1[2];
192 w1_t[3] = salt_buf1[3];
194 w2_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
195 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
196 w2_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
197 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
198 w2_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
199 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
200 w2_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
201 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
202 w3_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
203 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
204 w3_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
205 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
206 w3_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
207 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
208 w3_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
209 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
216 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
217 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
218 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
219 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
220 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
221 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
222 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
223 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
224 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
225 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
226 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
227 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
228 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
229 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
230 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
231 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
233 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
234 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
235 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
236 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
237 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
238 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
239 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
240 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
241 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
242 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
243 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
244 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
245 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
246 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
247 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
248 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
250 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
251 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
252 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
253 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
254 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
255 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
256 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
257 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
258 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
259 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
260 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
261 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
262 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
263 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
264 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
265 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
267 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
268 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
269 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
270 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
271 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
272 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
273 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
274 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
275 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
276 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
277 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
278 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
279 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
280 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
281 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
282 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
284 const u32x r_a = a + MD5M_A;
285 const u32x r_b = b + MD5M_B;
286 const u32x r_c = c + MD5M_C;
287 const u32x r_d = d + MD5M_D;
289 const u32x r_00 = 0x80;
290 const u32x r_14 = 64 * 8;
297 MD5_STEP (MD5_Fo, a, b, c, d, r_00, MD5C00, MD5S00);
298 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C01, MD5S01);
299 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C02, MD5S02);
300 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C03, MD5S03);
301 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C04, MD5S00);
302 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C05, MD5S01);
303 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C06, MD5S02);
304 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C07, MD5S03);
305 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C08, MD5S00);
306 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C09, MD5S01);
307 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C0a, MD5S02);
308 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0b, MD5S03);
309 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C0c, MD5S00);
310 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C0d, MD5S01);
311 MD5_STEP (MD5_Fo, c, d, a, b, r_14, MD5C0e, MD5S02);
312 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0f, MD5S03);
314 MD5_STEP0(MD5_Go, a, b, c, d, MD5C10, MD5S10);
315 MD5_STEP0(MD5_Go, d, a, b, c, MD5C11, MD5S11);
316 MD5_STEP0(MD5_Go, c, d, a, b, MD5C12, MD5S12);
317 MD5_STEP (MD5_Go, b, c, d, a, r_00, MD5C13, MD5S13);
318 MD5_STEP0(MD5_Go, a, b, c, d, MD5C14, MD5S10);
319 MD5_STEP0(MD5_Go, d, a, b, c, MD5C15, MD5S11);
320 MD5_STEP0(MD5_Go, c, d, a, b, MD5C16, MD5S12);
321 MD5_STEP0(MD5_Go, b, c, d, a, MD5C17, MD5S13);
322 MD5_STEP0(MD5_Go, a, b, c, d, MD5C18, MD5S10);
323 MD5_STEP (MD5_Go, d, a, b, c, r_14, MD5C19, MD5S11);
324 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1a, MD5S12);
325 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1b, MD5S13);
326 MD5_STEP0(MD5_Go, a, b, c, d, MD5C1c, MD5S10);
327 MD5_STEP0(MD5_Go, d, a, b, c, MD5C1d, MD5S11);
328 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1e, MD5S12);
329 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1f, MD5S13);
331 MD5_STEP0(MD5_H , a, b, c, d, MD5C20, MD5S20);
332 MD5_STEP0(MD5_H , d, a, b, c, MD5C21, MD5S21);
333 MD5_STEP0(MD5_H , c, d, a, b, MD5C22, MD5S22);
334 MD5_STEP (MD5_H , b, c, d, a, r_14, MD5C23, MD5S23);
335 MD5_STEP0(MD5_H , a, b, c, d, MD5C24, MD5S20);
336 MD5_STEP0(MD5_H , d, a, b, c, MD5C25, MD5S21);
337 MD5_STEP0(MD5_H , c, d, a, b, MD5C26, MD5S22);
338 MD5_STEP0(MD5_H , b, c, d, a, MD5C27, MD5S23);
339 MD5_STEP0(MD5_H , a, b, c, d, MD5C28, MD5S20);
340 MD5_STEP (MD5_H , d, a, b, c, r_00, MD5C29, MD5S21);
341 MD5_STEP0(MD5_H , c, d, a, b, MD5C2a, MD5S22);
342 MD5_STEP0(MD5_H , b, c, d, a, MD5C2b, MD5S23);
343 MD5_STEP0(MD5_H , a, b, c, d, MD5C2c, MD5S20);
344 MD5_STEP0(MD5_H , d, a, b, c, MD5C2d, MD5S21);
345 MD5_STEP0(MD5_H , c, d, a, b, MD5C2e, MD5S22);
346 MD5_STEP0(MD5_H , b, c, d, a, MD5C2f, MD5S23);
348 MD5_STEP (MD5_I , a, b, c, d, r_00, MD5C30, MD5S30);
349 MD5_STEP0(MD5_I , d, a, b, c, MD5C31, MD5S31);
350 MD5_STEP (MD5_I , c, d, a, b, r_14, MD5C32, MD5S32);
351 MD5_STEP0(MD5_I , b, c, d, a, MD5C33, MD5S33);
352 MD5_STEP0(MD5_I , a, b, c, d, MD5C34, MD5S30);
353 MD5_STEP0(MD5_I , d, a, b, c, MD5C35, MD5S31);
354 MD5_STEP0(MD5_I , c, d, a, b, MD5C36, MD5S32);
355 MD5_STEP0(MD5_I , b, c, d, a, MD5C37, MD5S33);
356 MD5_STEP0(MD5_I , a, b, c, d, MD5C38, MD5S30);
357 MD5_STEP0(MD5_I , d, a, b, c, MD5C39, MD5S31);
358 MD5_STEP0(MD5_I , c, d, a, b, MD5C3a, MD5S32);
359 MD5_STEP0(MD5_I , b, c, d, a, MD5C3b, MD5S33);
360 MD5_STEP0(MD5_I , a, b, c, d, MD5C3c, MD5S30);
361 MD5_STEP0(MD5_I , d, a, b, c, MD5C3d, MD5S31);
362 MD5_STEP0(MD5_I , c, d, a, b, MD5C3e, MD5S32);
363 MD5_STEP0(MD5_I , b, c, d, a, MD5C3f, MD5S33);
370 COMPARE_M_SIMD (a, d, c, b);
374 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_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_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)
380 const u32 gid = get_global_id (0);
381 const u32 lid = get_local_id (0);
392 salt_buf0[0] = salt_bufs[salt_pos].salt_buf_pc[0];
393 salt_buf0[1] = salt_bufs[salt_pos].salt_buf_pc[1];
394 salt_buf0[2] = salt_bufs[salt_pos].salt_buf_pc[2];
395 salt_buf0[3] = salt_bufs[salt_pos].salt_buf_pc[3];
396 salt_buf1[0] = salt_bufs[salt_pos].salt_buf_pc[4];
397 salt_buf1[1] = salt_bufs[salt_pos].salt_buf_pc[5];
398 salt_buf1[2] = salt_bufs[salt_pos].salt_buf_pc[6];
399 salt_buf1[3] = salt_bufs[salt_pos].salt_buf_pc[7];
409 const u32 salt_len = salt_bufs[salt_pos].salt_len;
415 const u32 search[4] =
417 digests_buf[digests_offset].digest_buf[DGST_R0],
418 digests_buf[digests_offset].digest_buf[DGST_R1],
419 digests_buf[digests_offset].digest_buf[DGST_R2],
420 digests_buf[digests_offset].digest_buf[DGST_R3]
429 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
431 const u32x w0r = ix_create_bft (bfs_buf, il_pos);
433 const u32x w0lr = w0l | w0r;
466 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
467 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
468 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
469 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
470 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
471 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
472 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
473 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
474 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
475 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
476 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
477 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
478 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
479 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
480 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
481 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
483 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
484 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
485 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
486 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
487 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
488 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
489 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
490 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
491 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
492 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
493 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
494 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
495 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
496 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
497 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
498 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
500 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
501 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
502 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
503 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
504 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
505 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
506 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
507 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
508 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
509 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
510 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
511 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
512 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
513 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
514 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
515 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
517 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
518 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
519 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
520 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
521 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
522 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
523 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
524 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
525 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
526 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
527 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
528 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
529 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
530 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
531 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
532 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
539 w0_t[0] = salt_buf0[0];
540 w0_t[1] = salt_buf0[1];
541 w0_t[2] = salt_buf0[2];
542 w0_t[3] = salt_buf0[3];
543 w1_t[0] = salt_buf1[0];
544 w1_t[1] = salt_buf1[1];
545 w1_t[2] = salt_buf1[2];
546 w1_t[3] = salt_buf1[3];
548 w2_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
549 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
550 w2_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
551 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
552 w2_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
553 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
554 w2_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
555 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
556 w3_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
557 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
558 w3_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
559 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
560 w3_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
561 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
562 w3_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
563 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
570 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
571 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
572 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
573 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
574 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
575 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
576 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
577 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
578 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
579 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
580 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
581 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
582 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
583 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
584 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
585 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
587 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
588 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
589 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
590 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
591 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
592 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
593 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
594 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
595 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
596 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
597 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
598 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
599 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
600 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
601 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
602 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
604 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
605 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
606 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
607 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
608 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
609 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
610 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
611 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
612 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
613 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
614 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
615 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
616 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
617 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
618 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
619 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
621 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
622 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
623 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
624 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
625 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
626 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
627 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
628 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
629 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
630 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
631 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
632 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
633 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
634 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
635 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
636 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
638 const u32x r_a = a + MD5M_A;
639 const u32x r_b = b + MD5M_B;
640 const u32x r_c = c + MD5M_C;
641 const u32x r_d = d + MD5M_D;
643 const u32x r_00 = 0x80;
644 const u32x r_14 = 64 * 8;
651 MD5_STEP (MD5_Fo, a, b, c, d, r_00, MD5C00, MD5S00);
652 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C01, MD5S01);
653 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C02, MD5S02);
654 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C03, MD5S03);
655 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C04, MD5S00);
656 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C05, MD5S01);
657 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C06, MD5S02);
658 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C07, MD5S03);
659 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C08, MD5S00);
660 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C09, MD5S01);
661 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C0a, MD5S02);
662 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0b, MD5S03);
663 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C0c, MD5S00);
664 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C0d, MD5S01);
665 MD5_STEP (MD5_Fo, c, d, a, b, r_14, MD5C0e, MD5S02);
666 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0f, MD5S03);
668 MD5_STEP0(MD5_Go, a, b, c, d, MD5C10, MD5S10);
669 MD5_STEP0(MD5_Go, d, a, b, c, MD5C11, MD5S11);
670 MD5_STEP0(MD5_Go, c, d, a, b, MD5C12, MD5S12);
671 MD5_STEP (MD5_Go, b, c, d, a, r_00, MD5C13, MD5S13);
672 MD5_STEP0(MD5_Go, a, b, c, d, MD5C14, MD5S10);
673 MD5_STEP0(MD5_Go, d, a, b, c, MD5C15, MD5S11);
674 MD5_STEP0(MD5_Go, c, d, a, b, MD5C16, MD5S12);
675 MD5_STEP0(MD5_Go, b, c, d, a, MD5C17, MD5S13);
676 MD5_STEP0(MD5_Go, a, b, c, d, MD5C18, MD5S10);
677 MD5_STEP (MD5_Go, d, a, b, c, r_14, MD5C19, MD5S11);
678 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1a, MD5S12);
679 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1b, MD5S13);
680 MD5_STEP0(MD5_Go, a, b, c, d, MD5C1c, MD5S10);
681 MD5_STEP0(MD5_Go, d, a, b, c, MD5C1d, MD5S11);
682 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1e, MD5S12);
683 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1f, MD5S13);
685 MD5_STEP0(MD5_H , a, b, c, d, MD5C20, MD5S20);
686 MD5_STEP0(MD5_H , d, a, b, c, MD5C21, MD5S21);
687 MD5_STEP0(MD5_H , c, d, a, b, MD5C22, MD5S22);
688 MD5_STEP (MD5_H , b, c, d, a, r_14, MD5C23, MD5S23);
689 MD5_STEP0(MD5_H , a, b, c, d, MD5C24, MD5S20);
690 MD5_STEP0(MD5_H , d, a, b, c, MD5C25, MD5S21);
691 MD5_STEP0(MD5_H , c, d, a, b, MD5C26, MD5S22);
692 MD5_STEP0(MD5_H , b, c, d, a, MD5C27, MD5S23);
693 MD5_STEP0(MD5_H , a, b, c, d, MD5C28, MD5S20);
694 MD5_STEP (MD5_H , d, a, b, c, r_00, MD5C29, MD5S21);
695 MD5_STEP0(MD5_H , c, d, a, b, MD5C2a, MD5S22);
696 MD5_STEP0(MD5_H , b, c, d, a, MD5C2b, MD5S23);
697 MD5_STEP0(MD5_H , a, b, c, d, MD5C2c, MD5S20);
698 MD5_STEP0(MD5_H , d, a, b, c, MD5C2d, MD5S21);
699 MD5_STEP0(MD5_H , c, d, a, b, MD5C2e, MD5S22);
700 MD5_STEP0(MD5_H , b, c, d, a, MD5C2f, MD5S23);
702 MD5_STEP (MD5_I , a, b, c, d, r_00, MD5C30, MD5S30);
703 MD5_STEP0(MD5_I , d, a, b, c, MD5C31, MD5S31);
704 MD5_STEP (MD5_I , c, d, a, b, r_14, MD5C32, MD5S32);
705 MD5_STEP0(MD5_I , b, c, d, a, MD5C33, MD5S33);
706 MD5_STEP0(MD5_I , a, b, c, d, MD5C34, MD5S30);
707 MD5_STEP0(MD5_I , d, a, b, c, MD5C35, MD5S31);
708 MD5_STEP0(MD5_I , c, d, a, b, MD5C36, MD5S32);
709 MD5_STEP0(MD5_I , b, c, d, a, MD5C37, MD5S33);
710 MD5_STEP0(MD5_I , a, b, c, d, MD5C38, MD5S30);
711 MD5_STEP0(MD5_I , d, a, b, c, MD5C39, MD5S31);
712 MD5_STEP0(MD5_I , c, d, a, b, MD5C3a, MD5S32);
713 MD5_STEP0(MD5_I , b, c, d, a, MD5C3b, MD5S33);
714 MD5_STEP0(MD5_I , a, b, c, d, MD5C3c, MD5S30);
716 if (MATCHES_NONE_VS ((a + r_a), search[0])) continue;
718 MD5_STEP0(MD5_I , d, a, b, c, MD5C3d, MD5S31);
719 MD5_STEP0(MD5_I , c, d, a, b, MD5C3e, MD5S32);
720 MD5_STEP0(MD5_I , b, c, d, a, MD5C3f, MD5S33);
727 COMPARE_S_SIMD (a, d, c, b);
731 __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_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_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)
737 const u32 gid = get_global_id (0);
738 const u32 lid = get_local_id (0);
739 const u32 lsz = get_local_size (0);
747 w0[0] = pws[gid].i[ 0];
748 w0[1] = pws[gid].i[ 1];
749 w0[2] = pws[gid].i[ 2];
750 w0[3] = pws[gid].i[ 3];
770 w3[2] = pws[gid].i[14];
773 const u32 pw_len = pws[gid].pw_len;
779 __local u32 l_bin2asc[256];
781 for (u32 i = lid; i < 256; i += lsz)
783 const u32 i0 = (i >> 0) & 15;
784 const u32 i1 = (i >> 4) & 15;
786 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
787 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
790 barrier (CLK_LOCAL_MEM_FENCE);
792 if (gid >= gid_max) return;
798 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_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);
801 __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_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_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)
807 const u32 gid = get_global_id (0);
808 const u32 lid = get_local_id (0);
809 const u32 lsz = get_local_size (0);
817 w0[0] = pws[gid].i[ 0];
818 w0[1] = pws[gid].i[ 1];
819 w0[2] = pws[gid].i[ 2];
820 w0[3] = pws[gid].i[ 3];
824 w1[0] = pws[gid].i[ 4];
825 w1[1] = pws[gid].i[ 5];
826 w1[2] = pws[gid].i[ 6];
827 w1[3] = pws[gid].i[ 7];
840 w3[2] = pws[gid].i[14];
843 const u32 pw_len = pws[gid].pw_len;
849 __local u32 l_bin2asc[256];
851 for (u32 i = lid; i < 256; i += lsz)
853 const u32 i0 = (i >> 0) & 15;
854 const u32 i1 = (i >> 4) & 15;
856 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
857 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
860 barrier (CLK_LOCAL_MEM_FENCE);
862 if (gid >= gid_max) return;
868 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_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);
871 __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_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_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)
877 const u32 gid = get_global_id (0);
878 const u32 lid = get_local_id (0);
879 const u32 lsz = get_local_size (0);
887 w0[0] = pws[gid].i[ 0];
888 w0[1] = pws[gid].i[ 1];
889 w0[2] = pws[gid].i[ 2];
890 w0[3] = pws[gid].i[ 3];
894 w1[0] = pws[gid].i[ 4];
895 w1[1] = pws[gid].i[ 5];
896 w1[2] = pws[gid].i[ 6];
897 w1[3] = pws[gid].i[ 7];
901 w2[0] = pws[gid].i[ 8];
902 w2[1] = pws[gid].i[ 9];
903 w2[2] = pws[gid].i[10];
904 w2[3] = pws[gid].i[11];
908 w3[0] = pws[gid].i[12];
909 w3[1] = pws[gid].i[13];
910 w3[2] = pws[gid].i[14];
911 w3[3] = pws[gid].i[15];
913 const u32 pw_len = pws[gid].pw_len;
919 __local u32 l_bin2asc[256];
921 for (u32 i = lid; i < 256; i += lsz)
923 const u32 i0 = (i >> 0) & 15;
924 const u32 i1 = (i >> 4) & 15;
926 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
927 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
930 barrier (CLK_LOCAL_MEM_FENCE);
932 if (gid >= gid_max) return;
938 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_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);
941 __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_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_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)
947 const u32 gid = get_global_id (0);
948 const u32 lid = get_local_id (0);
949 const u32 lsz = get_local_size (0);
957 w0[0] = pws[gid].i[ 0];
958 w0[1] = pws[gid].i[ 1];
959 w0[2] = pws[gid].i[ 2];
960 w0[3] = pws[gid].i[ 3];
980 w3[2] = pws[gid].i[14];
983 const u32 pw_len = pws[gid].pw_len;
989 __local u32 l_bin2asc[256];
991 for (u32 i = lid; i < 256; i += lsz)
993 const u32 i0 = (i >> 0) & 15;
994 const u32 i1 = (i >> 4) & 15;
996 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
997 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
1000 barrier (CLK_LOCAL_MEM_FENCE);
1002 if (gid >= gid_max) return;
1008 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_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);
1011 __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_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_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)
1017 const u32 gid = get_global_id (0);
1018 const u32 lid = get_local_id (0);
1019 const u32 lsz = get_local_size (0);
1027 w0[0] = pws[gid].i[ 0];
1028 w0[1] = pws[gid].i[ 1];
1029 w0[2] = pws[gid].i[ 2];
1030 w0[3] = pws[gid].i[ 3];
1034 w1[0] = pws[gid].i[ 4];
1035 w1[1] = pws[gid].i[ 5];
1036 w1[2] = pws[gid].i[ 6];
1037 w1[3] = pws[gid].i[ 7];
1050 w3[2] = pws[gid].i[14];
1053 const u32 pw_len = pws[gid].pw_len;
1059 __local u32 l_bin2asc[256];
1061 for (u32 i = lid; i < 256; i += lsz)
1063 const u32 i0 = (i >> 0) & 15;
1064 const u32 i1 = (i >> 4) & 15;
1066 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
1067 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
1070 barrier (CLK_LOCAL_MEM_FENCE);
1072 if (gid >= gid_max) return;
1078 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_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);
1081 __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_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_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)
1087 const u32 gid = get_global_id (0);
1088 const u32 lid = get_local_id (0);
1089 const u32 lsz = get_local_size (0);
1097 w0[0] = pws[gid].i[ 0];
1098 w0[1] = pws[gid].i[ 1];
1099 w0[2] = pws[gid].i[ 2];
1100 w0[3] = pws[gid].i[ 3];
1104 w1[0] = pws[gid].i[ 4];
1105 w1[1] = pws[gid].i[ 5];
1106 w1[2] = pws[gid].i[ 6];
1107 w1[3] = pws[gid].i[ 7];
1111 w2[0] = pws[gid].i[ 8];
1112 w2[1] = pws[gid].i[ 9];
1113 w2[2] = pws[gid].i[10];
1114 w2[3] = pws[gid].i[11];
1118 w3[0] = pws[gid].i[12];
1119 w3[1] = pws[gid].i[13];
1120 w3[2] = pws[gid].i[14];
1121 w3[3] = pws[gid].i[15];
1123 const u32 pw_len = pws[gid].pw_len;
1129 __local u32 l_bin2asc[256];
1131 for (u32 i = lid; i < 256; i += lsz)
1133 const u32 i0 = (i >> 0) & 15;
1134 const u32 i1 = (i >> 4) & 15;
1136 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
1137 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
1140 barrier (CLK_LOCAL_MEM_FENCE);
1142 if (gid >= gid_max) return;
1148 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_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);