2 * Author......: Jens Steube <jens.steube@gmail.com>
10 #include "inc_vendor.cl"
11 #include "inc_hash_constants.h"
12 #include "inc_hash_functions.cl"
13 #include "inc_types.cl"
14 #include "inc_common.cl"
15 #include "inc_simd.cl"
17 __kernel void m09900_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)
23 const u32 lid = get_local_id (0);
29 const u32 gid = get_global_id (0);
31 if (gid >= gid_max) return;
36 pw_buf0[0] = pws[gid].i[0];
37 pw_buf0[1] = pws[gid].i[1];
38 pw_buf0[2] = pws[gid].i[2];
39 pw_buf0[3] = pws[gid].i[3];
40 pw_buf1[0] = pws[gid].i[4];
41 pw_buf1[1] = pws[gid].i[5];
42 pw_buf1[2] = pws[gid].i[6];
43 pw_buf1[3] = pws[gid].i[7];
45 const u32 pw_l_len = pws[gid].pw_len;
51 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
53 const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
55 const u32x pw_len = pw_l_len + pw_r_len;
58 * concat password candidate
61 u32x wordl0[4] = { 0 };
62 u32x wordl1[4] = { 0 };
63 u32x wordl2[4] = { 0 };
64 u32x wordl3[4] = { 0 };
66 wordl0[0] = pw_buf0[0];
67 wordl0[1] = pw_buf0[1];
68 wordl0[2] = pw_buf0[2];
69 wordl0[3] = pw_buf0[3];
70 wordl1[0] = pw_buf1[0];
71 wordl1[1] = pw_buf1[1];
72 wordl1[2] = pw_buf1[2];
73 wordl1[3] = pw_buf1[3];
75 u32x wordr0[4] = { 0 };
76 u32x wordr1[4] = { 0 };
77 u32x wordr2[4] = { 0 };
78 u32x wordr3[4] = { 0 };
80 wordr0[0] = ix_create_combt (combs_buf, il_pos, 0);
81 wordr0[1] = ix_create_combt (combs_buf, il_pos, 1);
82 wordr0[2] = ix_create_combt (combs_buf, il_pos, 2);
83 wordr0[3] = ix_create_combt (combs_buf, il_pos, 3);
84 wordr1[0] = ix_create_combt (combs_buf, il_pos, 4);
85 wordr1[1] = ix_create_combt (combs_buf, il_pos, 5);
86 wordr1[2] = ix_create_combt (combs_buf, il_pos, 6);
87 wordr1[3] = ix_create_combt (combs_buf, il_pos, 7);
89 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
91 switch_buffer_by_offset_le_VV (wordr0, wordr1, wordr2, wordr3, pw_l_len);
95 switch_buffer_by_offset_le_VV (wordl0, wordl1, wordl2, wordl3, pw_r_len);
103 w0[0] = wordl0[0] | wordr0[0];
104 w0[1] = wordl0[1] | wordr0[1];
105 w0[2] = wordl0[2] | wordr0[2];
106 w0[3] = wordl0[3] | wordr0[3];
107 w1[0] = wordl1[0] | wordr1[0];
108 w1[1] = wordl1[1] | wordr1[1];
109 w1[2] = wordl1[2] | wordr1[2];
110 w1[3] = wordl1[3] | wordr1[3];
111 w2[0] = wordl2[0] | wordr2[0];
112 w2[1] = wordl2[1] | wordr2[1];
113 w2[2] = wordl2[2] | wordr2[2];
114 w2[3] = wordl2[3] | wordr2[3];
115 w3[0] = wordl3[0] | wordr3[0];
116 w3[1] = wordl3[1] | wordr3[1];
117 w3[2] = wordl3[2] | wordr3[2];
118 w3[3] = wordl3[3] | wordr3[3];
129 MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
130 MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
131 MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
132 MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
133 MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
134 MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
135 MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
136 MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
137 MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
138 MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
139 MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
140 MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
141 MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
142 MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
143 MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
144 MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
146 MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
147 MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
148 MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
149 MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
150 MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
151 MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
152 MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
153 MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
154 MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
155 MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
156 MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
157 MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
158 MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
159 MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
160 MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
161 MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
163 MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
164 MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
165 MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
166 MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
167 MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
168 MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
169 MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
170 MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
171 MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
172 MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
173 MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
174 MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
175 MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
176 MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
177 MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
178 MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
180 MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
181 MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
182 MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
183 MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
184 MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
185 MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
186 MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
187 MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
188 MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
189 MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
190 MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
191 MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
192 MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
193 MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
194 MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
195 MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
224 MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
225 MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
226 MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
227 MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
228 MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
229 MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
230 MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
231 MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
232 MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
233 MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
234 MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
235 MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
236 MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
237 MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
238 MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
239 MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
241 MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
242 MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
243 MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
244 MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
245 MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
246 MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
247 MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
248 MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
249 MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
250 MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
251 MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
252 MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
253 MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
254 MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
255 MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
256 MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
258 MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
259 MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
260 MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
261 MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
262 MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
263 MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
264 MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
265 MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
266 MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
267 MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
268 MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
269 MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
270 MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
271 MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
272 MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
273 MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
275 MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
276 MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
277 MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
278 MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
279 MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
280 MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
281 MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
282 MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
283 MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
284 MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
285 MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
286 MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
287 MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
288 MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
289 MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
290 MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
297 COMPARE_M_SIMD (a, d, c, b);
301 __kernel void m09900_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)
305 __kernel void m09900_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)
309 __kernel void m09900_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)
315 const u32 lid = get_local_id (0);
321 const u32 gid = get_global_id (0);
323 if (gid >= gid_max) return;
328 pw_buf0[0] = pws[gid].i[0];
329 pw_buf0[1] = pws[gid].i[1];
330 pw_buf0[2] = pws[gid].i[2];
331 pw_buf0[3] = pws[gid].i[3];
332 pw_buf1[0] = pws[gid].i[4];
333 pw_buf1[1] = pws[gid].i[5];
334 pw_buf1[2] = pws[gid].i[6];
335 pw_buf1[3] = pws[gid].i[7];
337 const u32 pw_l_len = pws[gid].pw_len;
343 const u32 search[4] =
345 digests_buf[digests_offset].digest_buf[DGST_R0],
346 digests_buf[digests_offset].digest_buf[DGST_R1],
347 digests_buf[digests_offset].digest_buf[DGST_R2],
348 digests_buf[digests_offset].digest_buf[DGST_R3]
355 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
357 const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
359 const u32x pw_len = pw_l_len + pw_r_len;
362 * concat password candidate
365 u32x wordl0[4] = { 0 };
366 u32x wordl1[4] = { 0 };
367 u32x wordl2[4] = { 0 };
368 u32x wordl3[4] = { 0 };
370 wordl0[0] = pw_buf0[0];
371 wordl0[1] = pw_buf0[1];
372 wordl0[2] = pw_buf0[2];
373 wordl0[3] = pw_buf0[3];
374 wordl1[0] = pw_buf1[0];
375 wordl1[1] = pw_buf1[1];
376 wordl1[2] = pw_buf1[2];
377 wordl1[3] = pw_buf1[3];
379 u32x wordr0[4] = { 0 };
380 u32x wordr1[4] = { 0 };
381 u32x wordr2[4] = { 0 };
382 u32x wordr3[4] = { 0 };
384 wordr0[0] = ix_create_combt (combs_buf, il_pos, 0);
385 wordr0[1] = ix_create_combt (combs_buf, il_pos, 1);
386 wordr0[2] = ix_create_combt (combs_buf, il_pos, 2);
387 wordr0[3] = ix_create_combt (combs_buf, il_pos, 3);
388 wordr1[0] = ix_create_combt (combs_buf, il_pos, 4);
389 wordr1[1] = ix_create_combt (combs_buf, il_pos, 5);
390 wordr1[2] = ix_create_combt (combs_buf, il_pos, 6);
391 wordr1[3] = ix_create_combt (combs_buf, il_pos, 7);
393 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
395 switch_buffer_by_offset_le_VV (wordr0, wordr1, wordr2, wordr3, pw_l_len);
399 switch_buffer_by_offset_le_VV (wordl0, wordl1, wordl2, wordl3, pw_r_len);
407 w0[0] = wordl0[0] | wordr0[0];
408 w0[1] = wordl0[1] | wordr0[1];
409 w0[2] = wordl0[2] | wordr0[2];
410 w0[3] = wordl0[3] | wordr0[3];
411 w1[0] = wordl1[0] | wordr1[0];
412 w1[1] = wordl1[1] | wordr1[1];
413 w1[2] = wordl1[2] | wordr1[2];
414 w1[3] = wordl1[3] | wordr1[3];
415 w2[0] = wordl2[0] | wordr2[0];
416 w2[1] = wordl2[1] | wordr2[1];
417 w2[2] = wordl2[2] | wordr2[2];
418 w2[3] = wordl2[3] | wordr2[3];
419 w3[0] = wordl3[0] | wordr3[0];
420 w3[1] = wordl3[1] | wordr3[1];
421 w3[2] = wordl3[2] | wordr3[2];
422 w3[3] = wordl3[3] | wordr3[3];
433 MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
434 MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
435 MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
436 MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
437 MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
438 MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
439 MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
440 MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
441 MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
442 MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
443 MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
444 MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
445 MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
446 MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
447 MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
448 MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
450 MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
451 MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
452 MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
453 MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
454 MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
455 MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
456 MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
457 MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
458 MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
459 MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
460 MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
461 MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
462 MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
463 MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
464 MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
465 MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
467 MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
468 MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
469 MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
470 MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
471 MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
472 MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
473 MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
474 MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
475 MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
476 MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
477 MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
478 MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
479 MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
480 MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
481 MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
482 MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
484 MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
485 MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
486 MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
487 MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
488 MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
489 MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
490 MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
491 MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
492 MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
493 MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
494 MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
495 MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
496 MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
497 MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
498 MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
499 MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
528 MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
529 MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
530 MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
531 MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
532 MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
533 MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
534 MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
535 MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
536 MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
537 MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
538 MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
539 MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
540 MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
541 MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
542 MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
543 MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
545 MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
546 MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
547 MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
548 MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
549 MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
550 MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
551 MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
552 MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
553 MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
554 MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
555 MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
556 MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
557 MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
558 MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
559 MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
560 MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
562 MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
563 MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
564 MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
565 MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
566 MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
567 MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
568 MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
569 MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
570 MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
571 MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
572 MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
573 MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
574 MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
575 MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
576 MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
577 MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
579 MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
580 MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
581 MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
582 MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
583 MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
584 MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
585 MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
586 MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
587 MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
588 MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
589 MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
590 MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
591 MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
593 if (MATCHES_NONE_VS ((a + r_a), search[0])) continue;
595 MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
596 MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
597 MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
604 COMPARE_S_SIMD (a, d, c, b);
608 __kernel void m09900_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)
612 __kernel void m09900_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)