2 * Author......: Jens Steube <jens.steube@gmail.com>
10 #include "include/constants.h"
11 #include "include/kernel_vendor.h"
18 #include "include/kernel_functions.c"
19 #include "OpenCL/types_ocl.c"
20 #include "OpenCL/common.c"
21 #include "OpenCL/simd.c"
23 __kernel void m01100_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)
29 const u32 lid = get_local_id (0);
35 const u32 gid = get_global_id (0);
37 if (gid >= gid_max) return;
42 pw_buf0[0] = pws[gid].i[0];
43 pw_buf0[1] = pws[gid].i[1];
44 pw_buf0[2] = pws[gid].i[2];
45 pw_buf0[3] = pws[gid].i[3];
46 pw_buf1[0] = pws[gid].i[4];
47 pw_buf1[1] = pws[gid].i[5];
48 pw_buf1[2] = pws[gid].i[6];
49 pw_buf1[3] = pws[gid].i[7];
51 const u32 pw_l_len = pws[gid].pw_len;
57 const u32 salt_buf0 = salt_bufs[salt_pos].salt_buf[0];
58 const u32 salt_buf1 = salt_bufs[salt_pos].salt_buf[1];
59 const u32 salt_buf2 = salt_bufs[salt_pos].salt_buf[2];
60 const u32 salt_buf3 = salt_bufs[salt_pos].salt_buf[3];
61 const u32 salt_buf4 = salt_bufs[salt_pos].salt_buf[4];
62 const u32 salt_buf5 = salt_bufs[salt_pos].salt_buf[5];
63 const u32 salt_buf6 = salt_bufs[salt_pos].salt_buf[6];
64 const u32 salt_buf7 = salt_bufs[salt_pos].salt_buf[7];
65 const u32 salt_buf8 = salt_bufs[salt_pos].salt_buf[8];
66 const u32 salt_buf9 = salt_bufs[salt_pos].salt_buf[9];
68 const u32 salt_len = salt_bufs[salt_pos].salt_len;
74 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
76 const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
78 const u32x pw_len = pw_l_len + pw_r_len;
81 * concat password candidate
84 u32x wordl0[4] = { 0 };
85 u32x wordl1[4] = { 0 };
86 u32x wordl2[4] = { 0 };
87 u32x wordl3[4] = { 0 };
89 wordl0[0] = pw_buf0[0];
90 wordl0[1] = pw_buf0[1];
91 wordl0[2] = pw_buf0[2];
92 wordl0[3] = pw_buf0[3];
93 wordl1[0] = pw_buf1[0];
94 wordl1[1] = pw_buf1[1];
95 wordl1[2] = pw_buf1[2];
96 wordl1[3] = pw_buf1[3];
98 u32x wordr0[4] = { 0 };
99 u32x wordr1[4] = { 0 };
100 u32x wordr2[4] = { 0 };
101 u32x wordr3[4] = { 0 };
103 wordr0[0] = ix_create_combt (combs_buf, il_pos, 0);
104 wordr0[1] = ix_create_combt (combs_buf, il_pos, 1);
105 wordr0[2] = ix_create_combt (combs_buf, il_pos, 2);
106 wordr0[3] = ix_create_combt (combs_buf, il_pos, 3);
107 wordr1[0] = ix_create_combt (combs_buf, il_pos, 4);
108 wordr1[1] = ix_create_combt (combs_buf, il_pos, 5);
109 wordr1[2] = ix_create_combt (combs_buf, il_pos, 6);
110 wordr1[3] = ix_create_combt (combs_buf, il_pos, 7);
112 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
114 switch_buffer_by_offset_le_VV (wordr0, wordr1, wordr2, wordr3, pw_l_len);
118 switch_buffer_by_offset_le_VV (wordl0, wordl1, wordl2, wordl3, pw_r_len);
126 w0[0] = wordl0[0] | wordr0[0];
127 w0[1] = wordl0[1] | wordr0[1];
128 w0[2] = wordl0[2] | wordr0[2];
129 w0[3] = wordl0[3] | wordr0[3];
130 w1[0] = wordl1[0] | wordr1[0];
131 w1[1] = wordl1[1] | wordr1[1];
132 w1[2] = wordl1[2] | wordr1[2];
133 w1[3] = wordl1[3] | wordr1[3];
134 w2[0] = wordl2[0] | wordr2[0];
135 w2[1] = wordl2[1] | wordr2[1];
136 w2[2] = wordl2[2] | wordr2[2];
137 w2[3] = wordl2[3] | wordr2[3];
138 w3[0] = wordl3[0] | wordr3[0];
139 w3[1] = wordl3[1] | wordr3[1];
140 w3[2] = wordl3[2] | wordr3[2];
141 w3[3] = wordl3[3] | wordr3[3];
143 make_unicode (w1, w2, w3);
144 make_unicode (w0, w0, w1);
146 w3[2] = pw_len * 2 * 8;
158 MD4_STEP (MD4_Fo, a, b, c, d, w0[0], MD4C00, MD4S00);
159 MD4_STEP (MD4_Fo, d, a, b, c, w0[1], MD4C00, MD4S01);
160 MD4_STEP (MD4_Fo, c, d, a, b, w0[2], MD4C00, MD4S02);
161 MD4_STEP (MD4_Fo, b, c, d, a, w0[3], MD4C00, MD4S03);
162 MD4_STEP (MD4_Fo, a, b, c, d, w1[0], MD4C00, MD4S00);
163 MD4_STEP (MD4_Fo, d, a, b, c, w1[1], MD4C00, MD4S01);
164 MD4_STEP (MD4_Fo, c, d, a, b, w1[2], MD4C00, MD4S02);
165 MD4_STEP (MD4_Fo, b, c, d, a, w1[3], MD4C00, MD4S03);
166 MD4_STEP (MD4_Fo, a, b, c, d, w2[0], MD4C00, MD4S00);
167 MD4_STEP (MD4_Fo, d, a, b, c, w2[1], MD4C00, MD4S01);
168 MD4_STEP (MD4_Fo, c, d, a, b, w2[2], MD4C00, MD4S02);
169 MD4_STEP (MD4_Fo, b, c, d, a, w2[3], MD4C00, MD4S03);
170 MD4_STEP (MD4_Fo, a, b, c, d, w3[0], MD4C00, MD4S00);
171 MD4_STEP (MD4_Fo, d, a, b, c, w3[1], MD4C00, MD4S01);
172 MD4_STEP (MD4_Fo, c, d, a, b, w3[2], MD4C00, MD4S02);
173 MD4_STEP (MD4_Fo, b, c, d, a, w3[3], MD4C00, MD4S03);
175 MD4_STEP (MD4_Go, a, b, c, d, w0[0], MD4C01, MD4S10);
176 MD4_STEP (MD4_Go, d, a, b, c, w1[0], MD4C01, MD4S11);
177 MD4_STEP (MD4_Go, c, d, a, b, w2[0], MD4C01, MD4S12);
178 MD4_STEP (MD4_Go, b, c, d, a, w3[0], MD4C01, MD4S13);
179 MD4_STEP (MD4_Go, a, b, c, d, w0[1], MD4C01, MD4S10);
180 MD4_STEP (MD4_Go, d, a, b, c, w1[1], MD4C01, MD4S11);
181 MD4_STEP (MD4_Go, c, d, a, b, w2[1], MD4C01, MD4S12);
182 MD4_STEP (MD4_Go, b, c, d, a, w3[1], MD4C01, MD4S13);
183 MD4_STEP (MD4_Go, a, b, c, d, w0[2], MD4C01, MD4S10);
184 MD4_STEP (MD4_Go, d, a, b, c, w1[2], MD4C01, MD4S11);
185 MD4_STEP (MD4_Go, c, d, a, b, w2[2], MD4C01, MD4S12);
186 MD4_STEP (MD4_Go, b, c, d, a, w3[2], MD4C01, MD4S13);
187 MD4_STEP (MD4_Go, a, b, c, d, w0[3], MD4C01, MD4S10);
188 MD4_STEP (MD4_Go, d, a, b, c, w1[3], MD4C01, MD4S11);
189 MD4_STEP (MD4_Go, c, d, a, b, w2[3], MD4C01, MD4S12);
190 MD4_STEP (MD4_Go, b, c, d, a, w3[3], MD4C01, MD4S13);
192 MD4_STEP (MD4_H , a, b, c, d, w0[0], MD4C02, MD4S20);
193 MD4_STEP (MD4_H , d, a, b, c, w2[0], MD4C02, MD4S21);
194 MD4_STEP (MD4_H , c, d, a, b, w1[0], MD4C02, MD4S22);
195 MD4_STEP (MD4_H , b, c, d, a, w3[0], MD4C02, MD4S23);
196 MD4_STEP (MD4_H , a, b, c, d, w0[2], MD4C02, MD4S20);
197 MD4_STEP (MD4_H , d, a, b, c, w2[2], MD4C02, MD4S21);
198 MD4_STEP (MD4_H , c, d, a, b, w1[2], MD4C02, MD4S22);
199 MD4_STEP (MD4_H , b, c, d, a, w3[2], MD4C02, MD4S23);
200 MD4_STEP (MD4_H , a, b, c, d, w0[1], MD4C02, MD4S20);
201 MD4_STEP (MD4_H , d, a, b, c, w2[1], MD4C02, MD4S21);
202 MD4_STEP (MD4_H , c, d, a, b, w1[1], MD4C02, MD4S22);
203 MD4_STEP (MD4_H , b, c, d, a, w3[1], MD4C02, MD4S23);
204 MD4_STEP (MD4_H , a, b, c, d, w0[3], MD4C02, MD4S20);
205 MD4_STEP (MD4_H , d, a, b, c, w2[3], MD4C02, MD4S21);
206 MD4_STEP (MD4_H , c, d, a, b, w1[3], MD4C02, MD4S22);
207 MD4_STEP (MD4_H , b, c, d, a, w3[3], MD4C02, MD4S23);
228 w3[2] = (16 + salt_len) * 8;
236 MD4_STEP (MD4_Fo, a, b, c, d, w0[0], MD4C00, MD4S00);
237 MD4_STEP (MD4_Fo, d, a, b, c, w0[1], MD4C00, MD4S01);
238 MD4_STEP (MD4_Fo, c, d, a, b, w0[2], MD4C00, MD4S02);
239 MD4_STEP (MD4_Fo, b, c, d, a, w0[3], MD4C00, MD4S03);
240 MD4_STEP (MD4_Fo, a, b, c, d, w1[0], MD4C00, MD4S00);
241 MD4_STEP (MD4_Fo, d, a, b, c, w1[1], MD4C00, MD4S01);
242 MD4_STEP (MD4_Fo, c, d, a, b, w1[2], MD4C00, MD4S02);
243 MD4_STEP (MD4_Fo, b, c, d, a, w1[3], MD4C00, MD4S03);
244 MD4_STEP (MD4_Fo, a, b, c, d, w2[0], MD4C00, MD4S00);
245 MD4_STEP (MD4_Fo, d, a, b, c, w2[1], MD4C00, MD4S01);
246 MD4_STEP (MD4_Fo, c, d, a, b, w2[2], MD4C00, MD4S02);
247 MD4_STEP (MD4_Fo, b, c, d, a, w2[3], MD4C00, MD4S03);
248 MD4_STEP (MD4_Fo, a, b, c, d, w3[0], MD4C00, MD4S00);
249 MD4_STEP (MD4_Fo, d, a, b, c, w3[1], MD4C00, MD4S01);
250 MD4_STEP (MD4_Fo, c, d, a, b, w3[2], MD4C00, MD4S02);
251 MD4_STEP (MD4_Fo, b, c, d, a, w3[3], MD4C00, MD4S03);
253 MD4_STEP (MD4_Go, a, b, c, d, w0[0], MD4C01, MD4S10);
254 MD4_STEP (MD4_Go, d, a, b, c, w1[0], MD4C01, MD4S11);
255 MD4_STEP (MD4_Go, c, d, a, b, w2[0], MD4C01, MD4S12);
256 MD4_STEP (MD4_Go, b, c, d, a, w3[0], MD4C01, MD4S13);
257 MD4_STEP (MD4_Go, a, b, c, d, w0[1], MD4C01, MD4S10);
258 MD4_STEP (MD4_Go, d, a, b, c, w1[1], MD4C01, MD4S11);
259 MD4_STEP (MD4_Go, c, d, a, b, w2[1], MD4C01, MD4S12);
260 MD4_STEP (MD4_Go, b, c, d, a, w3[1], MD4C01, MD4S13);
261 MD4_STEP (MD4_Go, a, b, c, d, w0[2], MD4C01, MD4S10);
262 MD4_STEP (MD4_Go, d, a, b, c, w1[2], MD4C01, MD4S11);
263 MD4_STEP (MD4_Go, c, d, a, b, w2[2], MD4C01, MD4S12);
264 MD4_STEP (MD4_Go, b, c, d, a, w3[2], MD4C01, MD4S13);
265 MD4_STEP (MD4_Go, a, b, c, d, w0[3], MD4C01, MD4S10);
266 MD4_STEP (MD4_Go, d, a, b, c, w1[3], MD4C01, MD4S11);
267 MD4_STEP (MD4_Go, c, d, a, b, w2[3], MD4C01, MD4S12);
268 MD4_STEP (MD4_Go, b, c, d, a, w3[3], MD4C01, MD4S13);
270 MD4_STEP (MD4_H , a, b, c, d, w0[0], MD4C02, MD4S20);
271 MD4_STEP (MD4_H , d, a, b, c, w2[0], MD4C02, MD4S21);
272 MD4_STEP (MD4_H , c, d, a, b, w1[0], MD4C02, MD4S22);
273 MD4_STEP (MD4_H , b, c, d, a, w3[0], MD4C02, MD4S23);
274 MD4_STEP (MD4_H , a, b, c, d, w0[2], MD4C02, MD4S20);
275 MD4_STEP (MD4_H , d, a, b, c, w2[2], MD4C02, MD4S21);
276 MD4_STEP (MD4_H , c, d, a, b, w1[2], MD4C02, MD4S22);
277 MD4_STEP (MD4_H , b, c, d, a, w3[2], MD4C02, MD4S23);
278 MD4_STEP (MD4_H , a, b, c, d, w0[1], MD4C02, MD4S20);
279 MD4_STEP (MD4_H , d, a, b, c, w2[1], MD4C02, MD4S21);
280 MD4_STEP (MD4_H , c, d, a, b, w1[1], MD4C02, MD4S22);
281 MD4_STEP (MD4_H , b, c, d, a, w3[1], MD4C02, MD4S23);
282 MD4_STEP (MD4_H , a, b, c, d, w0[3], MD4C02, MD4S20);
283 MD4_STEP (MD4_H , d, a, b, c, w2[3], MD4C02, MD4S21);
284 MD4_STEP (MD4_H , c, d, a, b, w1[3], MD4C02, MD4S22);
285 MD4_STEP (MD4_H , b, c, d, a, w3[3], MD4C02, MD4S23);
287 COMPARE_M_SIMD (a, d, c, b);
291 __kernel void m01100_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)
295 __kernel void m01100_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)
299 __kernel void m01100_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)
305 const u32 lid = get_local_id (0);
311 const u32 gid = get_global_id (0);
313 if (gid >= gid_max) return;
318 pw_buf0[0] = pws[gid].i[0];
319 pw_buf0[1] = pws[gid].i[1];
320 pw_buf0[2] = pws[gid].i[2];
321 pw_buf0[3] = pws[gid].i[3];
322 pw_buf1[0] = pws[gid].i[4];
323 pw_buf1[1] = pws[gid].i[5];
324 pw_buf1[2] = pws[gid].i[6];
325 pw_buf1[3] = pws[gid].i[7];
327 const u32 pw_l_len = pws[gid].pw_len;
333 const u32 salt_buf0 = salt_bufs[salt_pos].salt_buf[0];
334 const u32 salt_buf1 = salt_bufs[salt_pos].salt_buf[1];
335 const u32 salt_buf2 = salt_bufs[salt_pos].salt_buf[2];
336 const u32 salt_buf3 = salt_bufs[salt_pos].salt_buf[3];
337 const u32 salt_buf4 = salt_bufs[salt_pos].salt_buf[4];
338 const u32 salt_buf5 = salt_bufs[salt_pos].salt_buf[5];
339 const u32 salt_buf6 = salt_bufs[salt_pos].salt_buf[6];
340 const u32 salt_buf7 = salt_bufs[salt_pos].salt_buf[7];
341 const u32 salt_buf8 = salt_bufs[salt_pos].salt_buf[8];
342 const u32 salt_buf9 = salt_bufs[salt_pos].salt_buf[9];
344 const u32 salt_len = salt_bufs[salt_pos].salt_len;
350 const u32 search[4] =
352 digests_buf[digests_offset].digest_buf[DGST_R0],
353 digests_buf[digests_offset].digest_buf[DGST_R1],
354 digests_buf[digests_offset].digest_buf[DGST_R2],
355 digests_buf[digests_offset].digest_buf[DGST_R3]
362 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
364 const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
366 const u32x pw_len = pw_l_len + pw_r_len;
369 * concat password candidate
372 u32x wordl0[4] = { 0 };
373 u32x wordl1[4] = { 0 };
374 u32x wordl2[4] = { 0 };
375 u32x wordl3[4] = { 0 };
377 wordl0[0] = pw_buf0[0];
378 wordl0[1] = pw_buf0[1];
379 wordl0[2] = pw_buf0[2];
380 wordl0[3] = pw_buf0[3];
381 wordl1[0] = pw_buf1[0];
382 wordl1[1] = pw_buf1[1];
383 wordl1[2] = pw_buf1[2];
384 wordl1[3] = pw_buf1[3];
386 u32x wordr0[4] = { 0 };
387 u32x wordr1[4] = { 0 };
388 u32x wordr2[4] = { 0 };
389 u32x wordr3[4] = { 0 };
391 wordr0[0] = ix_create_combt (combs_buf, il_pos, 0);
392 wordr0[1] = ix_create_combt (combs_buf, il_pos, 1);
393 wordr0[2] = ix_create_combt (combs_buf, il_pos, 2);
394 wordr0[3] = ix_create_combt (combs_buf, il_pos, 3);
395 wordr1[0] = ix_create_combt (combs_buf, il_pos, 4);
396 wordr1[1] = ix_create_combt (combs_buf, il_pos, 5);
397 wordr1[2] = ix_create_combt (combs_buf, il_pos, 6);
398 wordr1[3] = ix_create_combt (combs_buf, il_pos, 7);
400 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
402 switch_buffer_by_offset_le_VV (wordr0, wordr1, wordr2, wordr3, pw_l_len);
406 switch_buffer_by_offset_le_VV (wordl0, wordl1, wordl2, wordl3, pw_r_len);
414 w0[0] = wordl0[0] | wordr0[0];
415 w0[1] = wordl0[1] | wordr0[1];
416 w0[2] = wordl0[2] | wordr0[2];
417 w0[3] = wordl0[3] | wordr0[3];
418 w1[0] = wordl1[0] | wordr1[0];
419 w1[1] = wordl1[1] | wordr1[1];
420 w1[2] = wordl1[2] | wordr1[2];
421 w1[3] = wordl1[3] | wordr1[3];
422 w2[0] = wordl2[0] | wordr2[0];
423 w2[1] = wordl2[1] | wordr2[1];
424 w2[2] = wordl2[2] | wordr2[2];
425 w2[3] = wordl2[3] | wordr2[3];
426 w3[0] = wordl3[0] | wordr3[0];
427 w3[1] = wordl3[1] | wordr3[1];
428 w3[2] = wordl3[2] | wordr3[2];
429 w3[3] = wordl3[3] | wordr3[3];
431 make_unicode (w1, w2, w3);
432 make_unicode (w0, w0, w1);
434 w3[2] = pw_len * 2 * 8;
446 MD4_STEP (MD4_Fo, a, b, c, d, w0[0], MD4C00, MD4S00);
447 MD4_STEP (MD4_Fo, d, a, b, c, w0[1], MD4C00, MD4S01);
448 MD4_STEP (MD4_Fo, c, d, a, b, w0[2], MD4C00, MD4S02);
449 MD4_STEP (MD4_Fo, b, c, d, a, w0[3], MD4C00, MD4S03);
450 MD4_STEP (MD4_Fo, a, b, c, d, w1[0], MD4C00, MD4S00);
451 MD4_STEP (MD4_Fo, d, a, b, c, w1[1], MD4C00, MD4S01);
452 MD4_STEP (MD4_Fo, c, d, a, b, w1[2], MD4C00, MD4S02);
453 MD4_STEP (MD4_Fo, b, c, d, a, w1[3], MD4C00, MD4S03);
454 MD4_STEP (MD4_Fo, a, b, c, d, w2[0], MD4C00, MD4S00);
455 MD4_STEP (MD4_Fo, d, a, b, c, w2[1], MD4C00, MD4S01);
456 MD4_STEP (MD4_Fo, c, d, a, b, w2[2], MD4C00, MD4S02);
457 MD4_STEP (MD4_Fo, b, c, d, a, w2[3], MD4C00, MD4S03);
458 MD4_STEP (MD4_Fo, a, b, c, d, w3[0], MD4C00, MD4S00);
459 MD4_STEP (MD4_Fo, d, a, b, c, w3[1], MD4C00, MD4S01);
460 MD4_STEP (MD4_Fo, c, d, a, b, w3[2], MD4C00, MD4S02);
461 MD4_STEP (MD4_Fo, b, c, d, a, w3[3], MD4C00, MD4S03);
463 MD4_STEP (MD4_Go, a, b, c, d, w0[0], MD4C01, MD4S10);
464 MD4_STEP (MD4_Go, d, a, b, c, w1[0], MD4C01, MD4S11);
465 MD4_STEP (MD4_Go, c, d, a, b, w2[0], MD4C01, MD4S12);
466 MD4_STEP (MD4_Go, b, c, d, a, w3[0], MD4C01, MD4S13);
467 MD4_STEP (MD4_Go, a, b, c, d, w0[1], MD4C01, MD4S10);
468 MD4_STEP (MD4_Go, d, a, b, c, w1[1], MD4C01, MD4S11);
469 MD4_STEP (MD4_Go, c, d, a, b, w2[1], MD4C01, MD4S12);
470 MD4_STEP (MD4_Go, b, c, d, a, w3[1], MD4C01, MD4S13);
471 MD4_STEP (MD4_Go, a, b, c, d, w0[2], MD4C01, MD4S10);
472 MD4_STEP (MD4_Go, d, a, b, c, w1[2], MD4C01, MD4S11);
473 MD4_STEP (MD4_Go, c, d, a, b, w2[2], MD4C01, MD4S12);
474 MD4_STEP (MD4_Go, b, c, d, a, w3[2], MD4C01, MD4S13);
475 MD4_STEP (MD4_Go, a, b, c, d, w0[3], MD4C01, MD4S10);
476 MD4_STEP (MD4_Go, d, a, b, c, w1[3], MD4C01, MD4S11);
477 MD4_STEP (MD4_Go, c, d, a, b, w2[3], MD4C01, MD4S12);
478 MD4_STEP (MD4_Go, b, c, d, a, w3[3], MD4C01, MD4S13);
480 MD4_STEP (MD4_H , a, b, c, d, w0[0], MD4C02, MD4S20);
481 MD4_STEP (MD4_H , d, a, b, c, w2[0], MD4C02, MD4S21);
482 MD4_STEP (MD4_H , c, d, a, b, w1[0], MD4C02, MD4S22);
483 MD4_STEP (MD4_H , b, c, d, a, w3[0], MD4C02, MD4S23);
484 MD4_STEP (MD4_H , a, b, c, d, w0[2], MD4C02, MD4S20);
485 MD4_STEP (MD4_H , d, a, b, c, w2[2], MD4C02, MD4S21);
486 MD4_STEP (MD4_H , c, d, a, b, w1[2], MD4C02, MD4S22);
487 MD4_STEP (MD4_H , b, c, d, a, w3[2], MD4C02, MD4S23);
488 MD4_STEP (MD4_H , a, b, c, d, w0[1], MD4C02, MD4S20);
489 MD4_STEP (MD4_H , d, a, b, c, w2[1], MD4C02, MD4S21);
490 MD4_STEP (MD4_H , c, d, a, b, w1[1], MD4C02, MD4S22);
491 MD4_STEP (MD4_H , b, c, d, a, w3[1], MD4C02, MD4S23);
492 MD4_STEP (MD4_H , a, b, c, d, w0[3], MD4C02, MD4S20);
493 MD4_STEP (MD4_H , d, a, b, c, w2[3], MD4C02, MD4S21);
494 MD4_STEP (MD4_H , c, d, a, b, w1[3], MD4C02, MD4S22);
495 MD4_STEP (MD4_H , b, c, d, a, w3[3], MD4C02, MD4S23);
516 w3[2] = (16 + salt_len) * 8;
524 MD4_STEP (MD4_Fo, a, b, c, d, w0[0], MD4C00, MD4S00);
525 MD4_STEP (MD4_Fo, d, a, b, c, w0[1], MD4C00, MD4S01);
526 MD4_STEP (MD4_Fo, c, d, a, b, w0[2], MD4C00, MD4S02);
527 MD4_STEP (MD4_Fo, b, c, d, a, w0[3], MD4C00, MD4S03);
528 MD4_STEP (MD4_Fo, a, b, c, d, w1[0], MD4C00, MD4S00);
529 MD4_STEP (MD4_Fo, d, a, b, c, w1[1], MD4C00, MD4S01);
530 MD4_STEP (MD4_Fo, c, d, a, b, w1[2], MD4C00, MD4S02);
531 MD4_STEP (MD4_Fo, b, c, d, a, w1[3], MD4C00, MD4S03);
532 MD4_STEP (MD4_Fo, a, b, c, d, w2[0], MD4C00, MD4S00);
533 MD4_STEP (MD4_Fo, d, a, b, c, w2[1], MD4C00, MD4S01);
534 MD4_STEP (MD4_Fo, c, d, a, b, w2[2], MD4C00, MD4S02);
535 MD4_STEP (MD4_Fo, b, c, d, a, w2[3], MD4C00, MD4S03);
536 MD4_STEP (MD4_Fo, a, b, c, d, w3[0], MD4C00, MD4S00);
537 MD4_STEP (MD4_Fo, d, a, b, c, w3[1], MD4C00, MD4S01);
538 MD4_STEP (MD4_Fo, c, d, a, b, w3[2], MD4C00, MD4S02);
539 MD4_STEP (MD4_Fo, b, c, d, a, w3[3], MD4C00, MD4S03);
541 MD4_STEP (MD4_Go, a, b, c, d, w0[0], MD4C01, MD4S10);
542 MD4_STEP (MD4_Go, d, a, b, c, w1[0], MD4C01, MD4S11);
543 MD4_STEP (MD4_Go, c, d, a, b, w2[0], MD4C01, MD4S12);
544 MD4_STEP (MD4_Go, b, c, d, a, w3[0], MD4C01, MD4S13);
545 MD4_STEP (MD4_Go, a, b, c, d, w0[1], MD4C01, MD4S10);
546 MD4_STEP (MD4_Go, d, a, b, c, w1[1], MD4C01, MD4S11);
547 MD4_STEP (MD4_Go, c, d, a, b, w2[1], MD4C01, MD4S12);
548 MD4_STEP (MD4_Go, b, c, d, a, w3[1], MD4C01, MD4S13);
549 MD4_STEP (MD4_Go, a, b, c, d, w0[2], MD4C01, MD4S10);
550 MD4_STEP (MD4_Go, d, a, b, c, w1[2], MD4C01, MD4S11);
551 MD4_STEP (MD4_Go, c, d, a, b, w2[2], MD4C01, MD4S12);
552 MD4_STEP (MD4_Go, b, c, d, a, w3[2], MD4C01, MD4S13);
553 MD4_STEP (MD4_Go, a, b, c, d, w0[3], MD4C01, MD4S10);
554 MD4_STEP (MD4_Go, d, a, b, c, w1[3], MD4C01, MD4S11);
555 MD4_STEP (MD4_Go, c, d, a, b, w2[3], MD4C01, MD4S12);
556 MD4_STEP (MD4_Go, b, c, d, a, w3[3], MD4C01, MD4S13);
558 MD4_STEP (MD4_H , a, b, c, d, w0[0], MD4C02, MD4S20);
559 MD4_STEP (MD4_H , d, a, b, c, w2[0], MD4C02, MD4S21);
560 MD4_STEP (MD4_H , c, d, a, b, w1[0], MD4C02, MD4S22);
561 MD4_STEP (MD4_H , b, c, d, a, w3[0], MD4C02, MD4S23);
562 MD4_STEP (MD4_H , a, b, c, d, w0[2], MD4C02, MD4S20);
563 MD4_STEP (MD4_H , d, a, b, c, w2[2], MD4C02, MD4S21);
564 MD4_STEP (MD4_H , c, d, a, b, w1[2], MD4C02, MD4S22);
565 MD4_STEP (MD4_H , b, c, d, a, w3[2], MD4C02, MD4S23);
566 MD4_STEP (MD4_H , a, b, c, d, w0[1], MD4C02, MD4S20);
567 MD4_STEP (MD4_H , d, a, b, c, w2[1], MD4C02, MD4S21);
568 MD4_STEP (MD4_H , c, d, a, b, w1[1], MD4C02, MD4S22);
569 MD4_STEP (MD4_H , b, c, d, a, w3[1], MD4C02, MD4S23);
570 MD4_STEP (MD4_H , a, b, c, d, w0[3], MD4C02, MD4S20);
572 if (MATCHES_NONE_VS (a, search[0])) continue;
574 MD4_STEP (MD4_H , d, a, b, c, w2[3], MD4C02, MD4S21);
575 MD4_STEP (MD4_H , c, d, a, b, w1[3], MD4C02, MD4S22);
576 MD4_STEP (MD4_H , b, c, d, a, w3[3], MD4C02, MD4S23);
578 COMPARE_S_SIMD (a, d, c, b);
582 __kernel void m01100_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)
586 __kernel void m01100_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)