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 #define uint_to_hex_lower8(i) l_bin2asc[(i)]
25 __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 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
31 const u32 gid = get_global_id (0);
32 const u32 lid = get_local_id (0);
33 const u32 lsz = get_local_size (0);
39 __local u32 l_bin2asc[256];
41 for (u32 i = lid; i < 256; i += lsz)
43 const u32 i0 = (i >> 0) & 15;
44 const u32 i1 = (i >> 4) & 15;
46 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
47 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
50 barrier (CLK_LOCAL_MEM_FENCE);
52 if (gid >= gid_max) return;
61 pws0[0] = pws[gid].i[0];
62 pws0[1] = pws[gid].i[1];
63 pws0[2] = pws[gid].i[2];
64 pws0[3] = pws[gid].i[3];
65 pws1[0] = pws[gid].i[4];
66 pws1[1] = pws[gid].i[5];
67 pws1[2] = pws[gid].i[6];
68 pws1[3] = pws[gid].i[7];
70 const u32 pw_l_len = pws[gid].pw_len;
76 for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
78 const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
80 const u32x pw_len = pw_l_len + pw_r_len;
82 u32x wordr0[4] = { 0 };
83 u32x wordr1[4] = { 0 };
84 u32x wordr2[4] = { 0 };
85 u32x wordr3[4] = { 0 };
87 wordr0[0] = ix_create_combt (combs_buf, il_pos, 0);
88 wordr0[1] = ix_create_combt (combs_buf, il_pos, 1);
89 wordr0[2] = ix_create_combt (combs_buf, il_pos, 2);
90 wordr0[3] = ix_create_combt (combs_buf, il_pos, 3);
91 wordr1[0] = ix_create_combt (combs_buf, il_pos, 4);
92 wordr1[1] = ix_create_combt (combs_buf, il_pos, 5);
93 wordr1[2] = ix_create_combt (combs_buf, il_pos, 6);
94 wordr1[3] = ix_create_combt (combs_buf, il_pos, 7);
96 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
98 append_0x80_2x4 (wordr0, wordr1, pw_r_len);
100 switch_buffer_by_offset_le (wordr0, wordr1, wordr2, wordr3, pw_l_len);
105 w0[0] = wordl0[0] | wordr0[0];
106 w0[1] = wordl0[1] | wordr0[1];
107 w0[2] = wordl0[2] | wordr0[2];
108 w0[3] = wordl0[3] | wordr0[3];
112 w1[0] = wordl1[0] | wordr1[0];
113 w1[1] = wordl1[1] | wordr1[1];
114 w1[2] = wordl1[2] | wordr1[2];
115 w1[3] = wordl1[3] | wordr1[3];
119 w2[0] = wordl2[0] | wordr2[0];
120 w2[1] = wordl2[1] | wordr2[1];
121 w2[2] = wordl2[2] | wordr2[2];
122 w2[3] = wordl2[3] | wordr2[3];
126 w3[0] = wordl3[0] | wordr3[0];
127 w3[1] = wordl3[1] | wordr3[1];
135 u32x w0_t = swap32 (w0[0]);
136 u32x w1_t = swap32 (w0[1]);
137 u32x w2_t = swap32 (w0[2]);
138 u32x w3_t = swap32 (w0[3]);
139 u32x w4_t = swap32 (w1[0]);
140 u32x w5_t = swap32 (w1[1]);
141 u32x w6_t = swap32 (w1[2]);
142 u32x w7_t = swap32 (w1[3]);
143 u32x w8_t = swap32 (w2[0]);
144 u32x w9_t = swap32 (w2[1]);
145 u32x wa_t = swap32 (w2[2]);
146 u32x wb_t = swap32 (w2[3]);
147 u32x wc_t = swap32 (w3[0]);
148 u32x wd_t = swap32 (w3[1]);
150 u32x wf_t = pw_len * 8;
161 SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0_t);
162 SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1_t);
163 SHA1_STEP (SHA1_F0o, d, e, a, b, c, w2_t);
164 SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3_t);
165 SHA1_STEP (SHA1_F0o, b, c, d, e, a, w4_t);
166 SHA1_STEP (SHA1_F0o, a, b, c, d, e, w5_t);
167 SHA1_STEP (SHA1_F0o, e, a, b, c, d, w6_t);
168 SHA1_STEP (SHA1_F0o, d, e, a, b, c, w7_t);
169 SHA1_STEP (SHA1_F0o, c, d, e, a, b, w8_t);
170 SHA1_STEP (SHA1_F0o, b, c, d, e, a, w9_t);
171 SHA1_STEP (SHA1_F0o, a, b, c, d, e, wa_t);
172 SHA1_STEP (SHA1_F0o, e, a, b, c, d, wb_t);
173 SHA1_STEP (SHA1_F0o, d, e, a, b, c, wc_t);
174 SHA1_STEP (SHA1_F0o, c, d, e, a, b, wd_t);
175 SHA1_STEP (SHA1_F0o, b, c, d, e, a, we_t);
176 SHA1_STEP (SHA1_F0o, a, b, c, d, e, wf_t);
177 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t);
178 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1_t);
179 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2_t);
180 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3_t);
185 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w4_t);
186 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w5_t);
187 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w6_t);
188 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w7_t);
189 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w8_t);
190 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w9_t);
191 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wa_t);
192 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wb_t);
193 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wc_t);
194 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wd_t);
195 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, we_t);
196 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wf_t);
197 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0_t);
198 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t);
199 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t);
200 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3_t);
201 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w4_t);
202 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w5_t);
203 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w6_t);
204 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w7_t);
209 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w8_t);
210 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w9_t);
211 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wa_t);
212 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wb_t);
213 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wc_t);
214 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, wd_t);
215 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, we_t);
216 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wf_t);
217 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w0_t);
218 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w1_t);
219 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w2_t);
220 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w3_t);
221 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w4_t);
222 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w5_t);
223 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w6_t);
224 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w7_t);
225 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w8_t);
226 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w9_t);
227 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wa_t);
228 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wb_t);
233 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wc_t);
234 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wd_t);
235 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, we_t);
236 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wf_t);
237 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0_t);
238 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1_t);
239 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w2_t);
240 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t);
241 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w4_t);
242 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w5_t);
243 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w6_t);
244 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w7_t);
245 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w8_t);
246 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w9_t);
247 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wa_t);
248 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wb_t);
249 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wc_t);
250 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd_t);
251 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we_t);
252 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf_t);
264 w0_t = uint_to_hex_lower8 ((a >> 24) & 255) << 0
265 | uint_to_hex_lower8 ((a >> 16) & 255) << 16;
266 w1_t = uint_to_hex_lower8 ((a >> 8) & 255) << 0
267 | uint_to_hex_lower8 ((a >> 0) & 255) << 16;
268 w2_t = uint_to_hex_lower8 ((b >> 24) & 255) << 0
269 | uint_to_hex_lower8 ((b >> 16) & 255) << 16;
270 w3_t = uint_to_hex_lower8 ((b >> 8) & 255) << 0
271 | uint_to_hex_lower8 ((b >> 0) & 255) << 16;
272 w4_t = uint_to_hex_lower8 ((c >> 24) & 255) << 0
273 | uint_to_hex_lower8 ((c >> 16) & 255) << 16;
274 w5_t = uint_to_hex_lower8 ((c >> 8) & 255) << 0
275 | uint_to_hex_lower8 ((c >> 0) & 255) << 16;
276 w6_t = uint_to_hex_lower8 ((d >> 24) & 255) << 0
277 | uint_to_hex_lower8 ((d >> 16) & 255) << 16;
278 w7_t = uint_to_hex_lower8 ((d >> 8) & 255) << 0
279 | uint_to_hex_lower8 ((d >> 0) & 255) << 16;
280 w8_t = uint_to_hex_lower8 ((e >> 24) & 255) << 0
281 | uint_to_hex_lower8 ((e >> 16) & 255) << 16;
282 w9_t = uint_to_hex_lower8 ((e >> 8) & 255) << 0
283 | uint_to_hex_lower8 ((e >> 0) & 255) << 16;
297 MD5_STEP (MD5_Fo, a, b, c, d, w0_t, MD5C00, MD5S00);
298 MD5_STEP (MD5_Fo, d, a, b, c, w1_t, MD5C01, MD5S01);
299 MD5_STEP (MD5_Fo, c, d, a, b, w2_t, MD5C02, MD5S02);
300 MD5_STEP (MD5_Fo, b, c, d, a, w3_t, MD5C03, MD5S03);
301 MD5_STEP (MD5_Fo, a, b, c, d, w4_t, MD5C04, MD5S00);
302 MD5_STEP (MD5_Fo, d, a, b, c, w5_t, MD5C05, MD5S01);
303 MD5_STEP (MD5_Fo, c, d, a, b, w6_t, MD5C06, MD5S02);
304 MD5_STEP (MD5_Fo, b, c, d, a, w7_t, MD5C07, MD5S03);
305 MD5_STEP (MD5_Fo, a, b, c, d, w8_t, MD5C08, MD5S00);
306 MD5_STEP (MD5_Fo, d, a, b, c, w9_t, MD5C09, MD5S01);
307 MD5_STEP (MD5_Fo, c, d, a, b, wa_t, MD5C0a, MD5S02);
308 MD5_STEP (MD5_Fo, b, c, d, a, wb_t, MD5C0b, MD5S03);
309 MD5_STEP (MD5_Fo, a, b, c, d, wc_t, MD5C0c, MD5S00);
310 MD5_STEP (MD5_Fo, d, a, b, c, wd_t, MD5C0d, MD5S01);
311 MD5_STEP (MD5_Fo, c, d, a, b, we_t, MD5C0e, MD5S02);
312 MD5_STEP (MD5_Fo, b, c, d, a, wf_t, MD5C0f, MD5S03);
314 MD5_STEP (MD5_Go, a, b, c, d, w1_t, MD5C10, MD5S10);
315 MD5_STEP (MD5_Go, d, a, b, c, w6_t, MD5C11, MD5S11);
316 MD5_STEP (MD5_Go, c, d, a, b, wb_t, MD5C12, MD5S12);
317 MD5_STEP (MD5_Go, b, c, d, a, w0_t, MD5C13, MD5S13);
318 MD5_STEP (MD5_Go, a, b, c, d, w5_t, MD5C14, MD5S10);
319 MD5_STEP (MD5_Go, d, a, b, c, wa_t, MD5C15, MD5S11);
320 MD5_STEP (MD5_Go, c, d, a, b, wf_t, MD5C16, MD5S12);
321 MD5_STEP (MD5_Go, b, c, d, a, w4_t, MD5C17, MD5S13);
322 MD5_STEP (MD5_Go, a, b, c, d, w9_t, MD5C18, MD5S10);
323 MD5_STEP (MD5_Go, d, a, b, c, we_t, MD5C19, MD5S11);
324 MD5_STEP (MD5_Go, c, d, a, b, w3_t, MD5C1a, MD5S12);
325 MD5_STEP (MD5_Go, b, c, d, a, w8_t, MD5C1b, MD5S13);
326 MD5_STEP (MD5_Go, a, b, c, d, wd_t, MD5C1c, MD5S10);
327 MD5_STEP (MD5_Go, d, a, b, c, w2_t, MD5C1d, MD5S11);
328 MD5_STEP (MD5_Go, c, d, a, b, w7_t, MD5C1e, MD5S12);
329 MD5_STEP (MD5_Go, b, c, d, a, wc_t, MD5C1f, MD5S13);
331 MD5_STEP (MD5_H , a, b, c, d, w5_t, MD5C20, MD5S20);
332 MD5_STEP (MD5_H , d, a, b, c, w8_t, MD5C21, MD5S21);
333 MD5_STEP (MD5_H , c, d, a, b, wb_t, MD5C22, MD5S22);
334 MD5_STEP (MD5_H , b, c, d, a, we_t, MD5C23, MD5S23);
335 MD5_STEP (MD5_H , a, b, c, d, w1_t, MD5C24, MD5S20);
336 MD5_STEP (MD5_H , d, a, b, c, w4_t, MD5C25, MD5S21);
337 MD5_STEP (MD5_H , c, d, a, b, w7_t, MD5C26, MD5S22);
338 MD5_STEP (MD5_H , b, c, d, a, wa_t, MD5C27, MD5S23);
339 MD5_STEP (MD5_H , a, b, c, d, wd_t, MD5C28, MD5S20);
340 MD5_STEP (MD5_H , d, a, b, c, w0_t, MD5C29, MD5S21);
341 MD5_STEP (MD5_H , c, d, a, b, w3_t, MD5C2a, MD5S22);
342 MD5_STEP (MD5_H , b, c, d, a, w6_t, MD5C2b, MD5S23);
343 MD5_STEP (MD5_H , a, b, c, d, w9_t, MD5C2c, MD5S20);
344 MD5_STEP (MD5_H , d, a, b, c, wc_t, MD5C2d, MD5S21);
345 MD5_STEP (MD5_H , c, d, a, b, wf_t, MD5C2e, MD5S22);
346 MD5_STEP (MD5_H , b, c, d, a, w2_t, MD5C2f, MD5S23);
348 MD5_STEP (MD5_I , a, b, c, d, w0_t, MD5C30, MD5S30);
349 MD5_STEP (MD5_I , d, a, b, c, w7_t, MD5C31, MD5S31);
350 MD5_STEP (MD5_I , c, d, a, b, we_t, MD5C32, MD5S32);
351 MD5_STEP (MD5_I , b, c, d, a, w5_t, MD5C33, MD5S33);
352 MD5_STEP (MD5_I , a, b, c, d, wc_t, MD5C34, MD5S30);
353 MD5_STEP (MD5_I , d, a, b, c, w3_t, MD5C35, MD5S31);
354 MD5_STEP (MD5_I , c, d, a, b, wa_t, MD5C36, MD5S32);
355 MD5_STEP (MD5_I , b, c, d, a, w1_t, MD5C37, MD5S33);
356 MD5_STEP (MD5_I , a, b, c, d, w8_t, MD5C38, MD5S30);
357 MD5_STEP (MD5_I , d, a, b, c, wf_t, MD5C39, MD5S31);
358 MD5_STEP (MD5_I , c, d, a, b, w6_t, MD5C3a, MD5S32);
359 MD5_STEP (MD5_I , b, c, d, a, wd_t, MD5C3b, MD5S33);
360 MD5_STEP (MD5_I , a, b, c, d, w4_t, MD5C3c, MD5S30);
361 MD5_STEP (MD5_I , d, a, b, c, wb_t, MD5C3d, MD5S31);
362 MD5_STEP (MD5_I , c, d, a, b, w2_t, MD5C3e, MD5S32);
363 MD5_STEP (MD5_I , b, c, d, a, w9_t, MD5C3f, MD5S33);
364 COMPARE_M_SIMD (a, d, c, b);
368 __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 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
372 __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 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
376 __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 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
382 const u32 gid = get_global_id (0);
383 const u32 lid = get_local_id (0);
384 const u32 lsz = get_local_size (0);
390 __local u32 l_bin2asc[256];
392 for (u32 i = lid; i < 256; i += lsz)
394 const u32 i0 = (i >> 0) & 15;
395 const u32 i1 = (i >> 4) & 15;
397 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
398 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
401 barrier (CLK_LOCAL_MEM_FENCE);
403 if (gid >= gid_max) return;
412 pws0[0] = pws[gid].i[0];
413 pws0[1] = pws[gid].i[1];
414 pws0[2] = pws[gid].i[2];
415 pws0[3] = pws[gid].i[3];
416 pws1[0] = pws[gid].i[4];
417 pws1[1] = pws[gid].i[5];
418 pws1[2] = pws[gid].i[6];
419 pws1[3] = pws[gid].i[7];
421 const u32 pw_l_len = pws[gid].pw_len;
427 const u32 search[4] =
429 digests_buf[digests_offset].digest_buf[DGST_R0],
430 digests_buf[digests_offset].digest_buf[DGST_R1],
431 digests_buf[digests_offset].digest_buf[DGST_R2],
432 digests_buf[digests_offset].digest_buf[DGST_R3]
439 for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
441 const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
443 const u32x pw_len = pw_l_len + pw_r_len;
445 u32x wordr0[4] = { 0 };
446 u32x wordr1[4] = { 0 };
447 u32x wordr2[4] = { 0 };
448 u32x wordr3[4] = { 0 };
450 wordr0[0] = ix_create_combt (combs_buf, il_pos, 0);
451 wordr0[1] = ix_create_combt (combs_buf, il_pos, 1);
452 wordr0[2] = ix_create_combt (combs_buf, il_pos, 2);
453 wordr0[3] = ix_create_combt (combs_buf, il_pos, 3);
454 wordr1[0] = ix_create_combt (combs_buf, il_pos, 4);
455 wordr1[1] = ix_create_combt (combs_buf, il_pos, 5);
456 wordr1[2] = ix_create_combt (combs_buf, il_pos, 6);
457 wordr1[3] = ix_create_combt (combs_buf, il_pos, 7);
459 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
461 append_0x80_2x4 (wordr0, wordr1, pw_r_len);
463 switch_buffer_by_offset_le (wordr0, wordr1, wordr2, wordr3, pw_l_len);
468 w0[0] = wordl0[0] | wordr0[0];
469 w0[1] = wordl0[1] | wordr0[1];
470 w0[2] = wordl0[2] | wordr0[2];
471 w0[3] = wordl0[3] | wordr0[3];
475 w1[0] = wordl1[0] | wordr1[0];
476 w1[1] = wordl1[1] | wordr1[1];
477 w1[2] = wordl1[2] | wordr1[2];
478 w1[3] = wordl1[3] | wordr1[3];
482 w2[0] = wordl2[0] | wordr2[0];
483 w2[1] = wordl2[1] | wordr2[1];
484 w2[2] = wordl2[2] | wordr2[2];
485 w2[3] = wordl2[3] | wordr2[3];
489 w3[0] = wordl3[0] | wordr3[0];
490 w3[1] = wordl3[1] | wordr3[1];
498 u32x w0_t = swap32 (w0[0]);
499 u32x w1_t = swap32 (w0[1]);
500 u32x w2_t = swap32 (w0[2]);
501 u32x w3_t = swap32 (w0[3]);
502 u32x w4_t = swap32 (w1[0]);
503 u32x w5_t = swap32 (w1[1]);
504 u32x w6_t = swap32 (w1[2]);
505 u32x w7_t = swap32 (w1[3]);
506 u32x w8_t = swap32 (w2[0]);
507 u32x w9_t = swap32 (w2[1]);
508 u32x wa_t = swap32 (w2[2]);
509 u32x wb_t = swap32 (w2[3]);
510 u32x wc_t = swap32 (w3[0]);
511 u32x wd_t = swap32 (w3[1]);
513 u32x wf_t = pw_len * 8;
524 SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0_t);
525 SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1_t);
526 SHA1_STEP (SHA1_F0o, d, e, a, b, c, w2_t);
527 SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3_t);
528 SHA1_STEP (SHA1_F0o, b, c, d, e, a, w4_t);
529 SHA1_STEP (SHA1_F0o, a, b, c, d, e, w5_t);
530 SHA1_STEP (SHA1_F0o, e, a, b, c, d, w6_t);
531 SHA1_STEP (SHA1_F0o, d, e, a, b, c, w7_t);
532 SHA1_STEP (SHA1_F0o, c, d, e, a, b, w8_t);
533 SHA1_STEP (SHA1_F0o, b, c, d, e, a, w9_t);
534 SHA1_STEP (SHA1_F0o, a, b, c, d, e, wa_t);
535 SHA1_STEP (SHA1_F0o, e, a, b, c, d, wb_t);
536 SHA1_STEP (SHA1_F0o, d, e, a, b, c, wc_t);
537 SHA1_STEP (SHA1_F0o, c, d, e, a, b, wd_t);
538 SHA1_STEP (SHA1_F0o, b, c, d, e, a, we_t);
539 SHA1_STEP (SHA1_F0o, a, b, c, d, e, wf_t);
540 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t);
541 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1_t);
542 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2_t);
543 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3_t);
548 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w4_t);
549 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w5_t);
550 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w6_t);
551 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w7_t);
552 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w8_t);
553 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w9_t);
554 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wa_t);
555 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wb_t);
556 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wc_t);
557 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wd_t);
558 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, we_t);
559 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wf_t);
560 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0_t);
561 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t);
562 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t);
563 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3_t);
564 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w4_t);
565 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w5_t);
566 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w6_t);
567 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w7_t);
572 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w8_t);
573 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w9_t);
574 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wa_t);
575 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wb_t);
576 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wc_t);
577 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, wd_t);
578 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, we_t);
579 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wf_t);
580 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w0_t);
581 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w1_t);
582 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w2_t);
583 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w3_t);
584 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w4_t);
585 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w5_t);
586 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w6_t);
587 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w7_t);
588 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w8_t);
589 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w9_t);
590 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wa_t);
591 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wb_t);
596 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wc_t);
597 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wd_t);
598 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, we_t);
599 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wf_t);
600 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0_t);
601 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1_t);
602 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w2_t);
603 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t);
604 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w4_t);
605 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w5_t);
606 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w6_t);
607 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w7_t);
608 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w8_t);
609 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w9_t);
610 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wa_t);
611 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wb_t);
612 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wc_t);
613 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd_t);
614 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we_t);
615 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf_t);
627 w0_t = uint_to_hex_lower8 ((a >> 24) & 255) << 0
628 | uint_to_hex_lower8 ((a >> 16) & 255) << 16;
629 w1_t = uint_to_hex_lower8 ((a >> 8) & 255) << 0
630 | uint_to_hex_lower8 ((a >> 0) & 255) << 16;
631 w2_t = uint_to_hex_lower8 ((b >> 24) & 255) << 0
632 | uint_to_hex_lower8 ((b >> 16) & 255) << 16;
633 w3_t = uint_to_hex_lower8 ((b >> 8) & 255) << 0
634 | uint_to_hex_lower8 ((b >> 0) & 255) << 16;
635 w4_t = uint_to_hex_lower8 ((c >> 24) & 255) << 0
636 | uint_to_hex_lower8 ((c >> 16) & 255) << 16;
637 w5_t = uint_to_hex_lower8 ((c >> 8) & 255) << 0
638 | uint_to_hex_lower8 ((c >> 0) & 255) << 16;
639 w6_t = uint_to_hex_lower8 ((d >> 24) & 255) << 0
640 | uint_to_hex_lower8 ((d >> 16) & 255) << 16;
641 w7_t = uint_to_hex_lower8 ((d >> 8) & 255) << 0
642 | uint_to_hex_lower8 ((d >> 0) & 255) << 16;
643 w8_t = uint_to_hex_lower8 ((e >> 24) & 255) << 0
644 | uint_to_hex_lower8 ((e >> 16) & 255) << 16;
645 w9_t = uint_to_hex_lower8 ((e >> 8) & 255) << 0
646 | uint_to_hex_lower8 ((e >> 0) & 255) << 16;
660 MD5_STEP (MD5_Fo, a, b, c, d, w0_t, MD5C00, MD5S00);
661 MD5_STEP (MD5_Fo, d, a, b, c, w1_t, MD5C01, MD5S01);
662 MD5_STEP (MD5_Fo, c, d, a, b, w2_t, MD5C02, MD5S02);
663 MD5_STEP (MD5_Fo, b, c, d, a, w3_t, MD5C03, MD5S03);
664 MD5_STEP (MD5_Fo, a, b, c, d, w4_t, MD5C04, MD5S00);
665 MD5_STEP (MD5_Fo, d, a, b, c, w5_t, MD5C05, MD5S01);
666 MD5_STEP (MD5_Fo, c, d, a, b, w6_t, MD5C06, MD5S02);
667 MD5_STEP (MD5_Fo, b, c, d, a, w7_t, MD5C07, MD5S03);
668 MD5_STEP (MD5_Fo, a, b, c, d, w8_t, MD5C08, MD5S00);
669 MD5_STEP (MD5_Fo, d, a, b, c, w9_t, MD5C09, MD5S01);
670 MD5_STEP (MD5_Fo, c, d, a, b, wa_t, MD5C0a, MD5S02);
671 MD5_STEP (MD5_Fo, b, c, d, a, wb_t, MD5C0b, MD5S03);
672 MD5_STEP (MD5_Fo, a, b, c, d, wc_t, MD5C0c, MD5S00);
673 MD5_STEP (MD5_Fo, d, a, b, c, wd_t, MD5C0d, MD5S01);
674 MD5_STEP (MD5_Fo, c, d, a, b, we_t, MD5C0e, MD5S02);
675 MD5_STEP (MD5_Fo, b, c, d, a, wf_t, MD5C0f, MD5S03);
677 MD5_STEP (MD5_Go, a, b, c, d, w1_t, MD5C10, MD5S10);
678 MD5_STEP (MD5_Go, d, a, b, c, w6_t, MD5C11, MD5S11);
679 MD5_STEP (MD5_Go, c, d, a, b, wb_t, MD5C12, MD5S12);
680 MD5_STEP (MD5_Go, b, c, d, a, w0_t, MD5C13, MD5S13);
681 MD5_STEP (MD5_Go, a, b, c, d, w5_t, MD5C14, MD5S10);
682 MD5_STEP (MD5_Go, d, a, b, c, wa_t, MD5C15, MD5S11);
683 MD5_STEP (MD5_Go, c, d, a, b, wf_t, MD5C16, MD5S12);
684 MD5_STEP (MD5_Go, b, c, d, a, w4_t, MD5C17, MD5S13);
685 MD5_STEP (MD5_Go, a, b, c, d, w9_t, MD5C18, MD5S10);
686 MD5_STEP (MD5_Go, d, a, b, c, we_t, MD5C19, MD5S11);
687 MD5_STEP (MD5_Go, c, d, a, b, w3_t, MD5C1a, MD5S12);
688 MD5_STEP (MD5_Go, b, c, d, a, w8_t, MD5C1b, MD5S13);
689 MD5_STEP (MD5_Go, a, b, c, d, wd_t, MD5C1c, MD5S10);
690 MD5_STEP (MD5_Go, d, a, b, c, w2_t, MD5C1d, MD5S11);
691 MD5_STEP (MD5_Go, c, d, a, b, w7_t, MD5C1e, MD5S12);
692 MD5_STEP (MD5_Go, b, c, d, a, wc_t, MD5C1f, MD5S13);
694 MD5_STEP (MD5_H , a, b, c, d, w5_t, MD5C20, MD5S20);
695 MD5_STEP (MD5_H , d, a, b, c, w8_t, MD5C21, MD5S21);
696 MD5_STEP (MD5_H , c, d, a, b, wb_t, MD5C22, MD5S22);
697 MD5_STEP (MD5_H , b, c, d, a, we_t, MD5C23, MD5S23);
698 MD5_STEP (MD5_H , a, b, c, d, w1_t, MD5C24, MD5S20);
699 MD5_STEP (MD5_H , d, a, b, c, w4_t, MD5C25, MD5S21);
700 MD5_STEP (MD5_H , c, d, a, b, w7_t, MD5C26, MD5S22);
701 MD5_STEP (MD5_H , b, c, d, a, wa_t, MD5C27, MD5S23);
702 MD5_STEP (MD5_H , a, b, c, d, wd_t, MD5C28, MD5S20);
703 MD5_STEP (MD5_H , d, a, b, c, w0_t, MD5C29, MD5S21);
704 MD5_STEP (MD5_H , c, d, a, b, w3_t, MD5C2a, MD5S22);
705 MD5_STEP (MD5_H , b, c, d, a, w6_t, MD5C2b, MD5S23);
706 MD5_STEP (MD5_H , a, b, c, d, w9_t, MD5C2c, MD5S20);
707 MD5_STEP (MD5_H , d, a, b, c, wc_t, MD5C2d, MD5S21);
708 MD5_STEP (MD5_H , c, d, a, b, wf_t, MD5C2e, MD5S22);
709 MD5_STEP (MD5_H , b, c, d, a, w2_t, MD5C2f, MD5S23);
711 MD5_STEP (MD5_I , a, b, c, d, w0_t, MD5C30, MD5S30);
712 MD5_STEP (MD5_I , d, a, b, c, w7_t, MD5C31, MD5S31);
713 MD5_STEP (MD5_I , c, d, a, b, we_t, MD5C32, MD5S32);
714 MD5_STEP (MD5_I , b, c, d, a, w5_t, MD5C33, MD5S33);
715 MD5_STEP (MD5_I , a, b, c, d, wc_t, MD5C34, MD5S30);
716 MD5_STEP (MD5_I , d, a, b, c, w3_t, MD5C35, MD5S31);
717 MD5_STEP (MD5_I , c, d, a, b, wa_t, MD5C36, MD5S32);
718 MD5_STEP (MD5_I , b, c, d, a, w1_t, MD5C37, MD5S33);
719 MD5_STEP (MD5_I , a, b, c, d, w8_t, MD5C38, MD5S30);
720 MD5_STEP (MD5_I , d, a, b, c, wf_t, MD5C39, MD5S31);
721 MD5_STEP (MD5_I , c, d, a, b, w6_t, MD5C3a, MD5S32);
722 MD5_STEP (MD5_I , b, c, d, a, wd_t, MD5C3b, MD5S33);
723 MD5_STEP (MD5_I , a, b, c, d, w4_t, MD5C3c, MD5S30);
724 MD5_STEP (MD5_I , d, a, b, c, wb_t, MD5C3d, MD5S31);
725 MD5_STEP (MD5_I , c, d, a, b, w2_t, MD5C3e, MD5S32);
726 MD5_STEP (MD5_I , b, c, d, a, w9_t, MD5C3f, MD5S33);
727 COMPARE_S_SIMD (a, d, c, b);
731 __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 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
735 __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 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)