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_upper8(i) (u32x) (l_bin2asc[(i)])
29 #define uint_to_hex_upper8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1])
31 #define uint_to_hex_upper8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3])
33 #define uint_to_hex_upper8(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_upper8(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 m04310m (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[0];
57 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[1];
58 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[2];
59 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[3];
60 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[4];
61 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[5];
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] = uint_to_hex_upper8 ((a >> 0) & 255) << 0
192 | uint_to_hex_upper8 ((a >> 8) & 255) << 16;
193 w0_t[1] = uint_to_hex_upper8 ((a >> 16) & 255) << 0
194 | uint_to_hex_upper8 ((a >> 24) & 255) << 16;
195 w0_t[2] = uint_to_hex_upper8 ((b >> 0) & 255) << 0
196 | uint_to_hex_upper8 ((b >> 8) & 255) << 16;
197 w0_t[3] = uint_to_hex_upper8 ((b >> 16) & 255) << 0
198 | uint_to_hex_upper8 ((b >> 24) & 255) << 16;
199 w1_t[0] = uint_to_hex_upper8 ((c >> 0) & 255) << 0
200 | uint_to_hex_upper8 ((c >> 8) & 255) << 16;
201 w1_t[1] = uint_to_hex_upper8 ((c >> 16) & 255) << 0
202 | uint_to_hex_upper8 ((c >> 24) & 255) << 16;
203 w1_t[2] = uint_to_hex_upper8 ((d >> 0) & 255) << 0
204 | uint_to_hex_upper8 ((d >> 8) & 255) << 16;
205 w1_t[3] = uint_to_hex_upper8 ((d >> 16) & 255) << 0
206 | uint_to_hex_upper8 ((d >> 24) & 255) << 16;
208 w2_t[0] = salt_buf0[0];
209 w2_t[1] = salt_buf0[1];
210 w2_t[2] = salt_buf0[2];
211 w2_t[3] = salt_buf0[3];
212 w3_t[0] = salt_buf1[0];
213 w3_t[1] = salt_buf1[1];
214 w3_t[2] = (32 + salt_len) * 8;
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 COMPARE_M_SIMD (a, d, c, b);
294 static void m04310s (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)
300 const u32 gid = get_global_id (0);
301 const u32 lid = get_local_id (0);
312 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[0];
313 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[1];
314 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[2];
315 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[3];
316 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[4];
317 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[5];
329 const u32 salt_len = salt_bufs[salt_pos].salt_len;
335 const u32 search[4] =
337 digests_buf[digests_offset].digest_buf[DGST_R0],
338 digests_buf[digests_offset].digest_buf[DGST_R1],
339 digests_buf[digests_offset].digest_buf[DGST_R2],
340 digests_buf[digests_offset].digest_buf[DGST_R3]
349 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
351 const u32x w0r = ix_create_bft (bfs_buf, il_pos);
353 const u32x w0lr = w0l | w0r;
386 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
387 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
388 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
389 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
390 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
391 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
392 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
393 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
394 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
395 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
396 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
397 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
398 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
399 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
400 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
401 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
403 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
404 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
405 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
406 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
407 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
408 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
409 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
410 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
411 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
412 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
413 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
414 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
415 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
416 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
417 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
418 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
420 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
421 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
422 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
423 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
424 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
425 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
426 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
427 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
428 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
429 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
430 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
431 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
432 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
433 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
434 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
435 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
437 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
438 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
439 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
440 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
441 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
442 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
443 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
444 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
445 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
446 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
447 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
448 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
449 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
450 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
451 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
452 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
459 w0_t[0] = uint_to_hex_upper8 ((a >> 0) & 255) << 0
460 | uint_to_hex_upper8 ((a >> 8) & 255) << 16;
461 w0_t[1] = uint_to_hex_upper8 ((a >> 16) & 255) << 0
462 | uint_to_hex_upper8 ((a >> 24) & 255) << 16;
463 w0_t[2] = uint_to_hex_upper8 ((b >> 0) & 255) << 0
464 | uint_to_hex_upper8 ((b >> 8) & 255) << 16;
465 w0_t[3] = uint_to_hex_upper8 ((b >> 16) & 255) << 0
466 | uint_to_hex_upper8 ((b >> 24) & 255) << 16;
467 w1_t[0] = uint_to_hex_upper8 ((c >> 0) & 255) << 0
468 | uint_to_hex_upper8 ((c >> 8) & 255) << 16;
469 w1_t[1] = uint_to_hex_upper8 ((c >> 16) & 255) << 0
470 | uint_to_hex_upper8 ((c >> 24) & 255) << 16;
471 w1_t[2] = uint_to_hex_upper8 ((d >> 0) & 255) << 0
472 | uint_to_hex_upper8 ((d >> 8) & 255) << 16;
473 w1_t[3] = uint_to_hex_upper8 ((d >> 16) & 255) << 0
474 | uint_to_hex_upper8 ((d >> 24) & 255) << 16;
476 w2_t[0] = salt_buf0[0];
477 w2_t[1] = salt_buf0[1];
478 w2_t[2] = salt_buf0[2];
479 w2_t[3] = salt_buf0[3];
480 w3_t[0] = salt_buf1[0];
481 w3_t[1] = salt_buf1[1];
482 w3_t[2] = (32 + salt_len) * 8;
490 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
491 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
492 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
493 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
494 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
495 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
496 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
497 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
498 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
499 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
500 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
501 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
502 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
503 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
504 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
505 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
507 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
508 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
509 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
510 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
511 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
512 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
513 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
514 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
515 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
516 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
517 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
518 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
519 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
520 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
521 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
522 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
524 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
525 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
526 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
527 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
528 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
529 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
530 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
531 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
532 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
533 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
534 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
535 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
536 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
537 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
538 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
539 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
541 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
542 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
543 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
544 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
545 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
546 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
547 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
548 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
549 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
550 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
551 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
552 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
553 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
555 if (MATCHES_NONE_VS (a, search[0])) continue;
557 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
558 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
559 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
561 COMPARE_S_SIMD (a, d, c, b);
566 __kernel void m04310_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)
572 const u32 gid = get_global_id (0);
573 const u32 lid = get_local_id (0);
574 const u32 lsz = get_local_size (0);
582 w0[0] = pws[gid].i[ 0];
583 w0[1] = pws[gid].i[ 1];
584 w0[2] = pws[gid].i[ 2];
585 w0[3] = pws[gid].i[ 3];
605 w3[2] = pws[gid].i[14];
608 const u32 pw_len = pws[gid].pw_len;
614 __local u32 l_bin2asc[256];
616 for (u32 i = lid; i < 256; i += lsz)
618 const u32 i0 = (i >> 0) & 15;
619 const u32 i1 = (i >> 4) & 15;
621 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'A' - 10 + i0) << 8
622 | ((i1 < 10) ? '0' + i1 : 'A' - 10 + i1) << 0;
625 barrier (CLK_LOCAL_MEM_FENCE);
627 if (gid >= gid_max) return;
633 m04310m (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);
636 __kernel void m04310_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)
642 const u32 gid = get_global_id (0);
643 const u32 lid = get_local_id (0);
644 const u32 lsz = get_local_size (0);
652 w0[0] = pws[gid].i[ 0];
653 w0[1] = pws[gid].i[ 1];
654 w0[2] = pws[gid].i[ 2];
655 w0[3] = pws[gid].i[ 3];
659 w1[0] = pws[gid].i[ 4];
660 w1[1] = pws[gid].i[ 5];
661 w1[2] = pws[gid].i[ 6];
662 w1[3] = pws[gid].i[ 7];
675 w3[2] = pws[gid].i[14];
678 const u32 pw_len = pws[gid].pw_len;
684 __local u32 l_bin2asc[256];
686 for (u32 i = lid; i < 256; i += lsz)
688 const u32 i0 = (i >> 0) & 15;
689 const u32 i1 = (i >> 4) & 15;
691 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'A' - 10 + i0) << 8
692 | ((i1 < 10) ? '0' + i1 : 'A' - 10 + i1) << 0;
695 barrier (CLK_LOCAL_MEM_FENCE);
697 if (gid >= gid_max) return;
703 m04310m (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);
706 __kernel void m04310_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)
712 const u32 gid = get_global_id (0);
713 const u32 lid = get_local_id (0);
714 const u32 lsz = get_local_size (0);
722 w0[0] = pws[gid].i[ 0];
723 w0[1] = pws[gid].i[ 1];
724 w0[2] = pws[gid].i[ 2];
725 w0[3] = pws[gid].i[ 3];
729 w1[0] = pws[gid].i[ 4];
730 w1[1] = pws[gid].i[ 5];
731 w1[2] = pws[gid].i[ 6];
732 w1[3] = pws[gid].i[ 7];
736 w2[0] = pws[gid].i[ 8];
737 w2[1] = pws[gid].i[ 9];
738 w2[2] = pws[gid].i[10];
739 w2[3] = pws[gid].i[11];
743 w3[0] = pws[gid].i[12];
744 w3[1] = pws[gid].i[13];
745 w3[2] = pws[gid].i[14];
746 w3[3] = pws[gid].i[15];
748 const u32 pw_len = pws[gid].pw_len;
754 __local u32 l_bin2asc[256];
756 for (u32 i = lid; i < 256; i += lsz)
758 const u32 i0 = (i >> 0) & 15;
759 const u32 i1 = (i >> 4) & 15;
761 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'A' - 10 + i0) << 8
762 | ((i1 < 10) ? '0' + i1 : 'A' - 10 + i1) << 0;
765 barrier (CLK_LOCAL_MEM_FENCE);
767 if (gid >= gid_max) return;
773 m04310m (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);
776 __kernel void m04310_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)
782 const u32 gid = get_global_id (0);
783 const u32 lid = get_local_id (0);
784 const u32 lsz = get_local_size (0);
792 w0[0] = pws[gid].i[ 0];
793 w0[1] = pws[gid].i[ 1];
794 w0[2] = pws[gid].i[ 2];
795 w0[3] = pws[gid].i[ 3];
815 w3[2] = pws[gid].i[14];
818 const u32 pw_len = pws[gid].pw_len;
824 __local u32 l_bin2asc[256];
826 for (u32 i = lid; i < 256; i += lsz)
828 const u32 i0 = (i >> 0) & 15;
829 const u32 i1 = (i >> 4) & 15;
831 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'A' - 10 + i0) << 8
832 | ((i1 < 10) ? '0' + i1 : 'A' - 10 + i1) << 0;
835 barrier (CLK_LOCAL_MEM_FENCE);
837 if (gid >= gid_max) return;
843 m04310s (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);
846 __kernel void m04310_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)
852 const u32 gid = get_global_id (0);
853 const u32 lid = get_local_id (0);
854 const u32 lsz = get_local_size (0);
862 w0[0] = pws[gid].i[ 0];
863 w0[1] = pws[gid].i[ 1];
864 w0[2] = pws[gid].i[ 2];
865 w0[3] = pws[gid].i[ 3];
869 w1[0] = pws[gid].i[ 4];
870 w1[1] = pws[gid].i[ 5];
871 w1[2] = pws[gid].i[ 6];
872 w1[3] = pws[gid].i[ 7];
885 w3[2] = pws[gid].i[14];
888 const u32 pw_len = pws[gid].pw_len;
894 __local u32 l_bin2asc[256];
896 for (u32 i = lid; i < 256; i += lsz)
898 const u32 i0 = (i >> 0) & 15;
899 const u32 i1 = (i >> 4) & 15;
901 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'A' - 10 + i0) << 8
902 | ((i1 < 10) ? '0' + i1 : 'A' - 10 + i1) << 0;
905 barrier (CLK_LOCAL_MEM_FENCE);
907 if (gid >= gid_max) return;
913 m04310s (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);
916 __kernel void m04310_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)
922 const u32 gid = get_global_id (0);
923 const u32 lid = get_local_id (0);
924 const u32 lsz = get_local_size (0);
932 w0[0] = pws[gid].i[ 0];
933 w0[1] = pws[gid].i[ 1];
934 w0[2] = pws[gid].i[ 2];
935 w0[3] = pws[gid].i[ 3];
939 w1[0] = pws[gid].i[ 4];
940 w1[1] = pws[gid].i[ 5];
941 w1[2] = pws[gid].i[ 6];
942 w1[3] = pws[gid].i[ 7];
946 w2[0] = pws[gid].i[ 8];
947 w2[1] = pws[gid].i[ 9];
948 w2[2] = pws[gid].i[10];
949 w2[3] = pws[gid].i[11];
953 w3[0] = pws[gid].i[12];
954 w3[1] = pws[gid].i[13];
955 w3[2] = pws[gid].i[14];
956 w3[3] = pws[gid].i[15];
958 const u32 pw_len = pws[gid].pw_len;
964 __local u32 l_bin2asc[256];
966 for (u32 i = lid; i < 256; i += lsz)
968 const u32 i0 = (i >> 0) & 15;
969 const u32 i1 = (i >> 4) & 15;
971 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'A' - 10 + i0) << 8
972 | ((i1 < 10) ? '0' + i1 : 'A' - 10 + i1) << 0;
975 barrier (CLK_LOCAL_MEM_FENCE);
977 if (gid >= gid_max) return;
983 m04310s (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);