2 * Author......: Jens Steube <jens.steube@gmail.com>
10 #include "inc_hash_constants.h"
11 #include "inc_vendor.cl"
18 #include "inc_hash_functions.cl"
19 #include "inc_types.cl"
20 #include "inc_common.cl"
21 #include "inc_simd.cl"
24 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i)])
26 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1])
28 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3])
30 #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])
32 #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])
35 __kernel void m04400_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)
41 const u32 gid = get_global_id (0);
42 const u32 lid = get_local_id (0);
43 const u32 lsz = get_local_size (0);
49 __local u32 l_bin2asc[256];
51 for (u32 i = lid; i < 256; i += lsz)
53 const u32 i0 = (i >> 0) & 15;
54 const u32 i1 = (i >> 4) & 15;
56 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
57 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
60 barrier (CLK_LOCAL_MEM_FENCE);
62 if (gid >= gid_max) return;
71 pw_buf0[0] = pws[gid].i[0];
72 pw_buf0[1] = pws[gid].i[1];
73 pw_buf0[2] = pws[gid].i[2];
74 pw_buf0[3] = pws[gid].i[3];
75 pw_buf1[0] = pws[gid].i[4];
76 pw_buf1[1] = pws[gid].i[5];
77 pw_buf1[2] = pws[gid].i[6];
78 pw_buf1[3] = pws[gid].i[7];
80 const u32 pw_l_len = pws[gid].pw_len;
86 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
88 const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
90 const u32x pw_len = pw_l_len + pw_r_len;
93 * concat password candidate
96 u32x wordl0[4] = { 0 };
97 u32x wordl1[4] = { 0 };
98 u32x wordl2[4] = { 0 };
99 u32x wordl3[4] = { 0 };
101 wordl0[0] = pw_buf0[0];
102 wordl0[1] = pw_buf0[1];
103 wordl0[2] = pw_buf0[2];
104 wordl0[3] = pw_buf0[3];
105 wordl1[0] = pw_buf1[0];
106 wordl1[1] = pw_buf1[1];
107 wordl1[2] = pw_buf1[2];
108 wordl1[3] = pw_buf1[3];
110 u32x wordr0[4] = { 0 };
111 u32x wordr1[4] = { 0 };
112 u32x wordr2[4] = { 0 };
113 u32x wordr3[4] = { 0 };
115 wordr0[0] = ix_create_combt (combs_buf, il_pos, 0);
116 wordr0[1] = ix_create_combt (combs_buf, il_pos, 1);
117 wordr0[2] = ix_create_combt (combs_buf, il_pos, 2);
118 wordr0[3] = ix_create_combt (combs_buf, il_pos, 3);
119 wordr1[0] = ix_create_combt (combs_buf, il_pos, 4);
120 wordr1[1] = ix_create_combt (combs_buf, il_pos, 5);
121 wordr1[2] = ix_create_combt (combs_buf, il_pos, 6);
122 wordr1[3] = ix_create_combt (combs_buf, il_pos, 7);
124 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
126 switch_buffer_by_offset_le_VV (wordr0, wordr1, wordr2, wordr3, pw_l_len);
130 switch_buffer_by_offset_le_VV (wordl0, wordl1, wordl2, wordl3, pw_r_len);
138 w0[0] = wordl0[0] | wordr0[0];
139 w0[1] = wordl0[1] | wordr0[1];
140 w0[2] = wordl0[2] | wordr0[2];
141 w0[3] = wordl0[3] | wordr0[3];
142 w1[0] = wordl1[0] | wordr1[0];
143 w1[1] = wordl1[1] | wordr1[1];
144 w1[2] = wordl1[2] | wordr1[2];
145 w1[3] = wordl1[3] | wordr1[3];
146 w2[0] = wordl2[0] | wordr2[0];
147 w2[1] = wordl2[1] | wordr2[1];
148 w2[2] = wordl2[2] | wordr2[2];
149 w2[3] = wordl2[3] | wordr2[3];
150 w3[0] = wordl3[0] | wordr3[0];
151 w3[1] = wordl3[1] | wordr3[1];
152 w3[2] = wordl3[2] | wordr3[2];
153 w3[3] = wordl3[3] | wordr3[3];
159 u32x w0_t = swap32 (w0[0]);
160 u32x w1_t = swap32 (w0[1]);
161 u32x w2_t = swap32 (w0[2]);
162 u32x w3_t = swap32 (w0[3]);
163 u32x w4_t = swap32 (w1[0]);
164 u32x w5_t = swap32 (w1[1]);
165 u32x w6_t = swap32 (w1[2]);
166 u32x w7_t = swap32 (w1[3]);
167 u32x w8_t = swap32 (w2[0]);
168 u32x w9_t = swap32 (w2[1]);
169 u32x wa_t = swap32 (w2[2]);
170 u32x wb_t = swap32 (w2[3]);
171 u32x wc_t = swap32 (w3[0]);
172 u32x wd_t = swap32 (w3[1]);
174 u32x wf_t = pw_len * 8;
185 SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0_t);
186 SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1_t);
187 SHA1_STEP (SHA1_F0o, d, e, a, b, c, w2_t);
188 SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3_t);
189 SHA1_STEP (SHA1_F0o, b, c, d, e, a, w4_t);
190 SHA1_STEP (SHA1_F0o, a, b, c, d, e, w5_t);
191 SHA1_STEP (SHA1_F0o, e, a, b, c, d, w6_t);
192 SHA1_STEP (SHA1_F0o, d, e, a, b, c, w7_t);
193 SHA1_STEP (SHA1_F0o, c, d, e, a, b, w8_t);
194 SHA1_STEP (SHA1_F0o, b, c, d, e, a, w9_t);
195 SHA1_STEP (SHA1_F0o, a, b, c, d, e, wa_t);
196 SHA1_STEP (SHA1_F0o, e, a, b, c, d, wb_t);
197 SHA1_STEP (SHA1_F0o, d, e, a, b, c, wc_t);
198 SHA1_STEP (SHA1_F0o, c, d, e, a, b, wd_t);
199 SHA1_STEP (SHA1_F0o, b, c, d, e, a, we_t);
200 SHA1_STEP (SHA1_F0o, a, b, c, d, e, wf_t);
201 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t);
202 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1_t);
203 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2_t);
204 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3_t);
209 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w4_t);
210 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w5_t);
211 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w6_t);
212 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w7_t);
213 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w8_t);
214 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w9_t);
215 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wa_t);
216 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wb_t);
217 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wc_t);
218 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wd_t);
219 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, we_t);
220 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wf_t);
221 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0_t);
222 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t);
223 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t);
224 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3_t);
225 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w4_t);
226 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w5_t);
227 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w6_t);
228 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w7_t);
233 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w8_t);
234 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w9_t);
235 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wa_t);
236 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wb_t);
237 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wc_t);
238 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, wd_t);
239 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, we_t);
240 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wf_t);
241 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w0_t);
242 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w1_t);
243 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w2_t);
244 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w3_t);
245 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w4_t);
246 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w5_t);
247 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w6_t);
248 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w7_t);
249 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w8_t);
250 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w9_t);
251 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wa_t);
252 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wb_t);
257 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wc_t);
258 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wd_t);
259 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, we_t);
260 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wf_t);
261 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0_t);
262 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1_t);
263 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w2_t);
264 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t);
265 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w4_t);
266 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w5_t);
267 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w6_t);
268 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w7_t);
269 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w8_t);
270 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w9_t);
271 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wa_t);
272 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wb_t);
273 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wc_t);
274 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd_t);
275 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we_t);
276 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf_t);
288 w0_t = uint_to_hex_lower8 ((a >> 24) & 255) << 0
289 | uint_to_hex_lower8 ((a >> 16) & 255) << 16;
290 w1_t = uint_to_hex_lower8 ((a >> 8) & 255) << 0
291 | uint_to_hex_lower8 ((a >> 0) & 255) << 16;
292 w2_t = uint_to_hex_lower8 ((b >> 24) & 255) << 0
293 | uint_to_hex_lower8 ((b >> 16) & 255) << 16;
294 w3_t = uint_to_hex_lower8 ((b >> 8) & 255) << 0
295 | uint_to_hex_lower8 ((b >> 0) & 255) << 16;
296 w4_t = uint_to_hex_lower8 ((c >> 24) & 255) << 0
297 | uint_to_hex_lower8 ((c >> 16) & 255) << 16;
298 w5_t = uint_to_hex_lower8 ((c >> 8) & 255) << 0
299 | uint_to_hex_lower8 ((c >> 0) & 255) << 16;
300 w6_t = uint_to_hex_lower8 ((d >> 24) & 255) << 0
301 | uint_to_hex_lower8 ((d >> 16) & 255) << 16;
302 w7_t = uint_to_hex_lower8 ((d >> 8) & 255) << 0
303 | uint_to_hex_lower8 ((d >> 0) & 255) << 16;
304 w8_t = uint_to_hex_lower8 ((e >> 24) & 255) << 0
305 | uint_to_hex_lower8 ((e >> 16) & 255) << 16;
306 w9_t = uint_to_hex_lower8 ((e >> 8) & 255) << 0
307 | uint_to_hex_lower8 ((e >> 0) & 255) << 16;
321 MD5_STEP (MD5_Fo, a, b, c, d, w0_t, MD5C00, MD5S00);
322 MD5_STEP (MD5_Fo, d, a, b, c, w1_t, MD5C01, MD5S01);
323 MD5_STEP (MD5_Fo, c, d, a, b, w2_t, MD5C02, MD5S02);
324 MD5_STEP (MD5_Fo, b, c, d, a, w3_t, MD5C03, MD5S03);
325 MD5_STEP (MD5_Fo, a, b, c, d, w4_t, MD5C04, MD5S00);
326 MD5_STEP (MD5_Fo, d, a, b, c, w5_t, MD5C05, MD5S01);
327 MD5_STEP (MD5_Fo, c, d, a, b, w6_t, MD5C06, MD5S02);
328 MD5_STEP (MD5_Fo, b, c, d, a, w7_t, MD5C07, MD5S03);
329 MD5_STEP (MD5_Fo, a, b, c, d, w8_t, MD5C08, MD5S00);
330 MD5_STEP (MD5_Fo, d, a, b, c, w9_t, MD5C09, MD5S01);
331 MD5_STEP (MD5_Fo, c, d, a, b, wa_t, MD5C0a, MD5S02);
332 MD5_STEP (MD5_Fo, b, c, d, a, wb_t, MD5C0b, MD5S03);
333 MD5_STEP (MD5_Fo, a, b, c, d, wc_t, MD5C0c, MD5S00);
334 MD5_STEP (MD5_Fo, d, a, b, c, wd_t, MD5C0d, MD5S01);
335 MD5_STEP (MD5_Fo, c, d, a, b, we_t, MD5C0e, MD5S02);
336 MD5_STEP (MD5_Fo, b, c, d, a, wf_t, MD5C0f, MD5S03);
338 MD5_STEP (MD5_Go, a, b, c, d, w1_t, MD5C10, MD5S10);
339 MD5_STEP (MD5_Go, d, a, b, c, w6_t, MD5C11, MD5S11);
340 MD5_STEP (MD5_Go, c, d, a, b, wb_t, MD5C12, MD5S12);
341 MD5_STEP (MD5_Go, b, c, d, a, w0_t, MD5C13, MD5S13);
342 MD5_STEP (MD5_Go, a, b, c, d, w5_t, MD5C14, MD5S10);
343 MD5_STEP (MD5_Go, d, a, b, c, wa_t, MD5C15, MD5S11);
344 MD5_STEP (MD5_Go, c, d, a, b, wf_t, MD5C16, MD5S12);
345 MD5_STEP (MD5_Go, b, c, d, a, w4_t, MD5C17, MD5S13);
346 MD5_STEP (MD5_Go, a, b, c, d, w9_t, MD5C18, MD5S10);
347 MD5_STEP (MD5_Go, d, a, b, c, we_t, MD5C19, MD5S11);
348 MD5_STEP (MD5_Go, c, d, a, b, w3_t, MD5C1a, MD5S12);
349 MD5_STEP (MD5_Go, b, c, d, a, w8_t, MD5C1b, MD5S13);
350 MD5_STEP (MD5_Go, a, b, c, d, wd_t, MD5C1c, MD5S10);
351 MD5_STEP (MD5_Go, d, a, b, c, w2_t, MD5C1d, MD5S11);
352 MD5_STEP (MD5_Go, c, d, a, b, w7_t, MD5C1e, MD5S12);
353 MD5_STEP (MD5_Go, b, c, d, a, wc_t, MD5C1f, MD5S13);
355 MD5_STEP (MD5_H , a, b, c, d, w5_t, MD5C20, MD5S20);
356 MD5_STEP (MD5_H , d, a, b, c, w8_t, MD5C21, MD5S21);
357 MD5_STEP (MD5_H , c, d, a, b, wb_t, MD5C22, MD5S22);
358 MD5_STEP (MD5_H , b, c, d, a, we_t, MD5C23, MD5S23);
359 MD5_STEP (MD5_H , a, b, c, d, w1_t, MD5C24, MD5S20);
360 MD5_STEP (MD5_H , d, a, b, c, w4_t, MD5C25, MD5S21);
361 MD5_STEP (MD5_H , c, d, a, b, w7_t, MD5C26, MD5S22);
362 MD5_STEP (MD5_H , b, c, d, a, wa_t, MD5C27, MD5S23);
363 MD5_STEP (MD5_H , a, b, c, d, wd_t, MD5C28, MD5S20);
364 MD5_STEP (MD5_H , d, a, b, c, w0_t, MD5C29, MD5S21);
365 MD5_STEP (MD5_H , c, d, a, b, w3_t, MD5C2a, MD5S22);
366 MD5_STEP (MD5_H , b, c, d, a, w6_t, MD5C2b, MD5S23);
367 MD5_STEP (MD5_H , a, b, c, d, w9_t, MD5C2c, MD5S20);
368 MD5_STEP (MD5_H , d, a, b, c, wc_t, MD5C2d, MD5S21);
369 MD5_STEP (MD5_H , c, d, a, b, wf_t, MD5C2e, MD5S22);
370 MD5_STEP (MD5_H , b, c, d, a, w2_t, MD5C2f, MD5S23);
372 MD5_STEP (MD5_I , a, b, c, d, w0_t, MD5C30, MD5S30);
373 MD5_STEP (MD5_I , d, a, b, c, w7_t, MD5C31, MD5S31);
374 MD5_STEP (MD5_I , c, d, a, b, we_t, MD5C32, MD5S32);
375 MD5_STEP (MD5_I , b, c, d, a, w5_t, MD5C33, MD5S33);
376 MD5_STEP (MD5_I , a, b, c, d, wc_t, MD5C34, MD5S30);
377 MD5_STEP (MD5_I , d, a, b, c, w3_t, MD5C35, MD5S31);
378 MD5_STEP (MD5_I , c, d, a, b, wa_t, MD5C36, MD5S32);
379 MD5_STEP (MD5_I , b, c, d, a, w1_t, MD5C37, MD5S33);
380 MD5_STEP (MD5_I , a, b, c, d, w8_t, MD5C38, MD5S30);
381 MD5_STEP (MD5_I , d, a, b, c, wf_t, MD5C39, MD5S31);
382 MD5_STEP (MD5_I , c, d, a, b, w6_t, MD5C3a, MD5S32);
383 MD5_STEP (MD5_I , b, c, d, a, wd_t, MD5C3b, MD5S33);
384 MD5_STEP (MD5_I , a, b, c, d, w4_t, MD5C3c, MD5S30);
385 MD5_STEP (MD5_I , d, a, b, c, wb_t, MD5C3d, MD5S31);
386 MD5_STEP (MD5_I , c, d, a, b, w2_t, MD5C3e, MD5S32);
387 MD5_STEP (MD5_I , b, c, d, a, w9_t, MD5C3f, MD5S33);
389 COMPARE_M_SIMD (a, d, c, b);
393 __kernel void m04400_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)
397 __kernel void m04400_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)
401 __kernel void m04400_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)
407 const u32 gid = get_global_id (0);
408 const u32 lid = get_local_id (0);
409 const u32 lsz = get_local_size (0);
415 __local u32 l_bin2asc[256];
417 for (u32 i = lid; i < 256; i += lsz)
419 const u32 i0 = (i >> 0) & 15;
420 const u32 i1 = (i >> 4) & 15;
422 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
423 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
426 barrier (CLK_LOCAL_MEM_FENCE);
428 if (gid >= gid_max) return;
437 pw_buf0[0] = pws[gid].i[0];
438 pw_buf0[1] = pws[gid].i[1];
439 pw_buf0[2] = pws[gid].i[2];
440 pw_buf0[3] = pws[gid].i[3];
441 pw_buf1[0] = pws[gid].i[4];
442 pw_buf1[1] = pws[gid].i[5];
443 pw_buf1[2] = pws[gid].i[6];
444 pw_buf1[3] = pws[gid].i[7];
446 const u32 pw_l_len = pws[gid].pw_len;
452 const u32 search[4] =
454 digests_buf[digests_offset].digest_buf[DGST_R0],
455 digests_buf[digests_offset].digest_buf[DGST_R1],
456 digests_buf[digests_offset].digest_buf[DGST_R2],
457 digests_buf[digests_offset].digest_buf[DGST_R3]
464 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
466 const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
468 const u32x pw_len = pw_l_len + pw_r_len;
471 * concat password candidate
474 u32x wordl0[4] = { 0 };
475 u32x wordl1[4] = { 0 };
476 u32x wordl2[4] = { 0 };
477 u32x wordl3[4] = { 0 };
479 wordl0[0] = pw_buf0[0];
480 wordl0[1] = pw_buf0[1];
481 wordl0[2] = pw_buf0[2];
482 wordl0[3] = pw_buf0[3];
483 wordl1[0] = pw_buf1[0];
484 wordl1[1] = pw_buf1[1];
485 wordl1[2] = pw_buf1[2];
486 wordl1[3] = pw_buf1[3];
488 u32x wordr0[4] = { 0 };
489 u32x wordr1[4] = { 0 };
490 u32x wordr2[4] = { 0 };
491 u32x wordr3[4] = { 0 };
493 wordr0[0] = ix_create_combt (combs_buf, il_pos, 0);
494 wordr0[1] = ix_create_combt (combs_buf, il_pos, 1);
495 wordr0[2] = ix_create_combt (combs_buf, il_pos, 2);
496 wordr0[3] = ix_create_combt (combs_buf, il_pos, 3);
497 wordr1[0] = ix_create_combt (combs_buf, il_pos, 4);
498 wordr1[1] = ix_create_combt (combs_buf, il_pos, 5);
499 wordr1[2] = ix_create_combt (combs_buf, il_pos, 6);
500 wordr1[3] = ix_create_combt (combs_buf, il_pos, 7);
502 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
504 switch_buffer_by_offset_le_VV (wordr0, wordr1, wordr2, wordr3, pw_l_len);
508 switch_buffer_by_offset_le_VV (wordl0, wordl1, wordl2, wordl3, pw_r_len);
516 w0[0] = wordl0[0] | wordr0[0];
517 w0[1] = wordl0[1] | wordr0[1];
518 w0[2] = wordl0[2] | wordr0[2];
519 w0[3] = wordl0[3] | wordr0[3];
520 w1[0] = wordl1[0] | wordr1[0];
521 w1[1] = wordl1[1] | wordr1[1];
522 w1[2] = wordl1[2] | wordr1[2];
523 w1[3] = wordl1[3] | wordr1[3];
524 w2[0] = wordl2[0] | wordr2[0];
525 w2[1] = wordl2[1] | wordr2[1];
526 w2[2] = wordl2[2] | wordr2[2];
527 w2[3] = wordl2[3] | wordr2[3];
528 w3[0] = wordl3[0] | wordr3[0];
529 w3[1] = wordl3[1] | wordr3[1];
530 w3[2] = wordl3[2] | wordr3[2];
531 w3[3] = wordl3[3] | wordr3[3];
537 u32x w0_t = swap32 (w0[0]);
538 u32x w1_t = swap32 (w0[1]);
539 u32x w2_t = swap32 (w0[2]);
540 u32x w3_t = swap32 (w0[3]);
541 u32x w4_t = swap32 (w1[0]);
542 u32x w5_t = swap32 (w1[1]);
543 u32x w6_t = swap32 (w1[2]);
544 u32x w7_t = swap32 (w1[3]);
545 u32x w8_t = swap32 (w2[0]);
546 u32x w9_t = swap32 (w2[1]);
547 u32x wa_t = swap32 (w2[2]);
548 u32x wb_t = swap32 (w2[3]);
549 u32x wc_t = swap32 (w3[0]);
550 u32x wd_t = swap32 (w3[1]);
552 u32x wf_t = pw_len * 8;
563 SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0_t);
564 SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1_t);
565 SHA1_STEP (SHA1_F0o, d, e, a, b, c, w2_t);
566 SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3_t);
567 SHA1_STEP (SHA1_F0o, b, c, d, e, a, w4_t);
568 SHA1_STEP (SHA1_F0o, a, b, c, d, e, w5_t);
569 SHA1_STEP (SHA1_F0o, e, a, b, c, d, w6_t);
570 SHA1_STEP (SHA1_F0o, d, e, a, b, c, w7_t);
571 SHA1_STEP (SHA1_F0o, c, d, e, a, b, w8_t);
572 SHA1_STEP (SHA1_F0o, b, c, d, e, a, w9_t);
573 SHA1_STEP (SHA1_F0o, a, b, c, d, e, wa_t);
574 SHA1_STEP (SHA1_F0o, e, a, b, c, d, wb_t);
575 SHA1_STEP (SHA1_F0o, d, e, a, b, c, wc_t);
576 SHA1_STEP (SHA1_F0o, c, d, e, a, b, wd_t);
577 SHA1_STEP (SHA1_F0o, b, c, d, e, a, we_t);
578 SHA1_STEP (SHA1_F0o, a, b, c, d, e, wf_t);
579 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t);
580 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1_t);
581 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2_t);
582 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3_t);
587 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w4_t);
588 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w5_t);
589 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w6_t);
590 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w7_t);
591 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w8_t);
592 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w9_t);
593 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wa_t);
594 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wb_t);
595 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wc_t);
596 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wd_t);
597 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, we_t);
598 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wf_t);
599 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0_t);
600 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t);
601 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t);
602 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3_t);
603 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w4_t);
604 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w5_t);
605 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w6_t);
606 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w7_t);
611 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w8_t);
612 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w9_t);
613 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wa_t);
614 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wb_t);
615 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wc_t);
616 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, wd_t);
617 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, we_t);
618 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wf_t);
619 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w0_t);
620 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w1_t);
621 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w2_t);
622 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w3_t);
623 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w4_t);
624 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w5_t);
625 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w6_t);
626 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w7_t);
627 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w8_t);
628 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w9_t);
629 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wa_t);
630 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wb_t);
635 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wc_t);
636 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wd_t);
637 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, we_t);
638 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wf_t);
639 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0_t);
640 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1_t);
641 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w2_t);
642 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t);
643 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w4_t);
644 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w5_t);
645 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w6_t);
646 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w7_t);
647 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w8_t);
648 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w9_t);
649 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wa_t);
650 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wb_t);
651 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wc_t);
652 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd_t);
653 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we_t);
654 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf_t);
666 w0_t = uint_to_hex_lower8 ((a >> 24) & 255) << 0
667 | uint_to_hex_lower8 ((a >> 16) & 255) << 16;
668 w1_t = uint_to_hex_lower8 ((a >> 8) & 255) << 0
669 | uint_to_hex_lower8 ((a >> 0) & 255) << 16;
670 w2_t = uint_to_hex_lower8 ((b >> 24) & 255) << 0
671 | uint_to_hex_lower8 ((b >> 16) & 255) << 16;
672 w3_t = uint_to_hex_lower8 ((b >> 8) & 255) << 0
673 | uint_to_hex_lower8 ((b >> 0) & 255) << 16;
674 w4_t = uint_to_hex_lower8 ((c >> 24) & 255) << 0
675 | uint_to_hex_lower8 ((c >> 16) & 255) << 16;
676 w5_t = uint_to_hex_lower8 ((c >> 8) & 255) << 0
677 | uint_to_hex_lower8 ((c >> 0) & 255) << 16;
678 w6_t = uint_to_hex_lower8 ((d >> 24) & 255) << 0
679 | uint_to_hex_lower8 ((d >> 16) & 255) << 16;
680 w7_t = uint_to_hex_lower8 ((d >> 8) & 255) << 0
681 | uint_to_hex_lower8 ((d >> 0) & 255) << 16;
682 w8_t = uint_to_hex_lower8 ((e >> 24) & 255) << 0
683 | uint_to_hex_lower8 ((e >> 16) & 255) << 16;
684 w9_t = uint_to_hex_lower8 ((e >> 8) & 255) << 0
685 | uint_to_hex_lower8 ((e >> 0) & 255) << 16;
699 MD5_STEP (MD5_Fo, a, b, c, d, w0_t, MD5C00, MD5S00);
700 MD5_STEP (MD5_Fo, d, a, b, c, w1_t, MD5C01, MD5S01);
701 MD5_STEP (MD5_Fo, c, d, a, b, w2_t, MD5C02, MD5S02);
702 MD5_STEP (MD5_Fo, b, c, d, a, w3_t, MD5C03, MD5S03);
703 MD5_STEP (MD5_Fo, a, b, c, d, w4_t, MD5C04, MD5S00);
704 MD5_STEP (MD5_Fo, d, a, b, c, w5_t, MD5C05, MD5S01);
705 MD5_STEP (MD5_Fo, c, d, a, b, w6_t, MD5C06, MD5S02);
706 MD5_STEP (MD5_Fo, b, c, d, a, w7_t, MD5C07, MD5S03);
707 MD5_STEP (MD5_Fo, a, b, c, d, w8_t, MD5C08, MD5S00);
708 MD5_STEP (MD5_Fo, d, a, b, c, w9_t, MD5C09, MD5S01);
709 MD5_STEP (MD5_Fo, c, d, a, b, wa_t, MD5C0a, MD5S02);
710 MD5_STEP (MD5_Fo, b, c, d, a, wb_t, MD5C0b, MD5S03);
711 MD5_STEP (MD5_Fo, a, b, c, d, wc_t, MD5C0c, MD5S00);
712 MD5_STEP (MD5_Fo, d, a, b, c, wd_t, MD5C0d, MD5S01);
713 MD5_STEP (MD5_Fo, c, d, a, b, we_t, MD5C0e, MD5S02);
714 MD5_STEP (MD5_Fo, b, c, d, a, wf_t, MD5C0f, MD5S03);
716 MD5_STEP (MD5_Go, a, b, c, d, w1_t, MD5C10, MD5S10);
717 MD5_STEP (MD5_Go, d, a, b, c, w6_t, MD5C11, MD5S11);
718 MD5_STEP (MD5_Go, c, d, a, b, wb_t, MD5C12, MD5S12);
719 MD5_STEP (MD5_Go, b, c, d, a, w0_t, MD5C13, MD5S13);
720 MD5_STEP (MD5_Go, a, b, c, d, w5_t, MD5C14, MD5S10);
721 MD5_STEP (MD5_Go, d, a, b, c, wa_t, MD5C15, MD5S11);
722 MD5_STEP (MD5_Go, c, d, a, b, wf_t, MD5C16, MD5S12);
723 MD5_STEP (MD5_Go, b, c, d, a, w4_t, MD5C17, MD5S13);
724 MD5_STEP (MD5_Go, a, b, c, d, w9_t, MD5C18, MD5S10);
725 MD5_STEP (MD5_Go, d, a, b, c, we_t, MD5C19, MD5S11);
726 MD5_STEP (MD5_Go, c, d, a, b, w3_t, MD5C1a, MD5S12);
727 MD5_STEP (MD5_Go, b, c, d, a, w8_t, MD5C1b, MD5S13);
728 MD5_STEP (MD5_Go, a, b, c, d, wd_t, MD5C1c, MD5S10);
729 MD5_STEP (MD5_Go, d, a, b, c, w2_t, MD5C1d, MD5S11);
730 MD5_STEP (MD5_Go, c, d, a, b, w7_t, MD5C1e, MD5S12);
731 MD5_STEP (MD5_Go, b, c, d, a, wc_t, MD5C1f, MD5S13);
733 MD5_STEP (MD5_H , a, b, c, d, w5_t, MD5C20, MD5S20);
734 MD5_STEP (MD5_H , d, a, b, c, w8_t, MD5C21, MD5S21);
735 MD5_STEP (MD5_H , c, d, a, b, wb_t, MD5C22, MD5S22);
736 MD5_STEP (MD5_H , b, c, d, a, we_t, MD5C23, MD5S23);
737 MD5_STEP (MD5_H , a, b, c, d, w1_t, MD5C24, MD5S20);
738 MD5_STEP (MD5_H , d, a, b, c, w4_t, MD5C25, MD5S21);
739 MD5_STEP (MD5_H , c, d, a, b, w7_t, MD5C26, MD5S22);
740 MD5_STEP (MD5_H , b, c, d, a, wa_t, MD5C27, MD5S23);
741 MD5_STEP (MD5_H , a, b, c, d, wd_t, MD5C28, MD5S20);
742 MD5_STEP (MD5_H , d, a, b, c, w0_t, MD5C29, MD5S21);
743 MD5_STEP (MD5_H , c, d, a, b, w3_t, MD5C2a, MD5S22);
744 MD5_STEP (MD5_H , b, c, d, a, w6_t, MD5C2b, MD5S23);
745 MD5_STEP (MD5_H , a, b, c, d, w9_t, MD5C2c, MD5S20);
746 MD5_STEP (MD5_H , d, a, b, c, wc_t, MD5C2d, MD5S21);
747 MD5_STEP (MD5_H , c, d, a, b, wf_t, MD5C2e, MD5S22);
748 MD5_STEP (MD5_H , b, c, d, a, w2_t, MD5C2f, MD5S23);
750 MD5_STEP (MD5_I , a, b, c, d, w0_t, MD5C30, MD5S30);
751 MD5_STEP (MD5_I , d, a, b, c, w7_t, MD5C31, MD5S31);
752 MD5_STEP (MD5_I , c, d, a, b, we_t, MD5C32, MD5S32);
753 MD5_STEP (MD5_I , b, c, d, a, w5_t, MD5C33, MD5S33);
754 MD5_STEP (MD5_I , a, b, c, d, wc_t, MD5C34, MD5S30);
755 MD5_STEP (MD5_I , d, a, b, c, w3_t, MD5C35, MD5S31);
756 MD5_STEP (MD5_I , c, d, a, b, wa_t, MD5C36, MD5S32);
757 MD5_STEP (MD5_I , b, c, d, a, w1_t, MD5C37, MD5S33);
758 MD5_STEP (MD5_I , a, b, c, d, w8_t, MD5C38, MD5S30);
759 MD5_STEP (MD5_I , d, a, b, c, wf_t, MD5C39, MD5S31);
760 MD5_STEP (MD5_I , c, d, a, b, w6_t, MD5C3a, MD5S32);
761 MD5_STEP (MD5_I , b, c, d, a, wd_t, MD5C3b, MD5S33);
762 MD5_STEP (MD5_I , a, b, c, d, w4_t, MD5C3c, MD5S30);
764 if (MATCHES_NONE_VS (a, search[0])) continue;
766 MD5_STEP (MD5_I , d, a, b, c, wb_t, MD5C3d, MD5S31);
767 MD5_STEP (MD5_I , c, d, a, b, w2_t, MD5C3e, MD5S32);
768 MD5_STEP (MD5_I , b, c, d, a, w9_t, MD5C3f, MD5S33);
770 COMPARE_S_SIMD (a, d, c, b);
774 __kernel void m04400_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)
778 __kernel void m04400_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)