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"
18 #define uint_to_hex_lower8_le(i) (u32x) (l_bin2asc[(i)])
20 #define uint_to_hex_lower8_le(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1])
22 #define uint_to_hex_lower8_le(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3])
24 #define uint_to_hex_lower8_le(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])
26 #define uint_to_hex_lower8_le(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])
29 __kernel void m04700_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)
35 const u32 gid = get_global_id (0);
36 const u32 lid = get_local_id (0);
37 const u32 lsz = get_local_size (0);
43 __local u32 l_bin2asc[256];
45 for (u32 i = lid; i < 256; i += lsz)
47 const u32 i0 = (i >> 0) & 15;
48 const u32 i1 = (i >> 4) & 15;
50 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 0
51 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 8;
54 barrier (CLK_LOCAL_MEM_FENCE);
56 if (gid >= gid_max) return;
65 pw_buf0[0] = pws[gid].i[0];
66 pw_buf0[1] = pws[gid].i[1];
67 pw_buf0[2] = pws[gid].i[2];
68 pw_buf0[3] = pws[gid].i[3];
69 pw_buf1[0] = pws[gid].i[4];
70 pw_buf1[1] = pws[gid].i[5];
71 pw_buf1[2] = pws[gid].i[6];
72 pw_buf1[3] = pws[gid].i[7];
74 const u32 pw_l_len = pws[gid].pw_len;
80 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
82 const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
84 const u32x pw_len = pw_l_len + pw_r_len;
87 * concat password candidate
90 u32x wordl0[4] = { 0 };
91 u32x wordl1[4] = { 0 };
92 u32x wordl2[4] = { 0 };
93 u32x wordl3[4] = { 0 };
95 wordl0[0] = pw_buf0[0];
96 wordl0[1] = pw_buf0[1];
97 wordl0[2] = pw_buf0[2];
98 wordl0[3] = pw_buf0[3];
99 wordl1[0] = pw_buf1[0];
100 wordl1[1] = pw_buf1[1];
101 wordl1[2] = pw_buf1[2];
102 wordl1[3] = pw_buf1[3];
104 u32x wordr0[4] = { 0 };
105 u32x wordr1[4] = { 0 };
106 u32x wordr2[4] = { 0 };
107 u32x wordr3[4] = { 0 };
109 wordr0[0] = ix_create_combt (combs_buf, il_pos, 0);
110 wordr0[1] = ix_create_combt (combs_buf, il_pos, 1);
111 wordr0[2] = ix_create_combt (combs_buf, il_pos, 2);
112 wordr0[3] = ix_create_combt (combs_buf, il_pos, 3);
113 wordr1[0] = ix_create_combt (combs_buf, il_pos, 4);
114 wordr1[1] = ix_create_combt (combs_buf, il_pos, 5);
115 wordr1[2] = ix_create_combt (combs_buf, il_pos, 6);
116 wordr1[3] = ix_create_combt (combs_buf, il_pos, 7);
118 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
120 switch_buffer_by_offset_le_VV (wordr0, wordr1, wordr2, wordr3, pw_l_len);
124 switch_buffer_by_offset_le_VV (wordl0, wordl1, wordl2, wordl3, pw_r_len);
132 w0[0] = wordl0[0] | wordr0[0];
133 w0[1] = wordl0[1] | wordr0[1];
134 w0[2] = wordl0[2] | wordr0[2];
135 w0[3] = wordl0[3] | wordr0[3];
136 w1[0] = wordl1[0] | wordr1[0];
137 w1[1] = wordl1[1] | wordr1[1];
138 w1[2] = wordl1[2] | wordr1[2];
139 w1[3] = wordl1[3] | wordr1[3];
140 w2[0] = wordl2[0] | wordr2[0];
141 w2[1] = wordl2[1] | wordr2[1];
142 w2[2] = wordl2[2] | wordr2[2];
143 w2[3] = wordl2[3] | wordr2[3];
144 w3[0] = wordl3[0] | wordr3[0];
145 w3[1] = wordl3[1] | wordr3[1];
159 MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
160 MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
161 MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
162 MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
163 MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
164 MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
165 MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
166 MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
167 MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
168 MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
169 MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
170 MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
171 MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
172 MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
173 MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
174 MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
176 MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
177 MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
178 MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
179 MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
180 MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
181 MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
182 MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
183 MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
184 MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
185 MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
186 MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
187 MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
188 MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
189 MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
190 MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
191 MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
193 MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
194 MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
195 MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
196 MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
197 MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
198 MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
199 MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
200 MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
201 MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
202 MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
203 MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
204 MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
205 MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
206 MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
207 MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
208 MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
210 MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
211 MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
212 MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
213 MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
214 MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
215 MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
216 MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
217 MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
218 MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
219 MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
220 MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
221 MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
222 MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
223 MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
224 MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
225 MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
236 u32x w0_t = uint_to_hex_lower8_le ((a >> 8) & 255) << 0
237 | uint_to_hex_lower8_le ((a >> 0) & 255) << 16;
238 u32x w1_t = uint_to_hex_lower8_le ((a >> 24) & 255) << 0
239 | uint_to_hex_lower8_le ((a >> 16) & 255) << 16;
240 u32x w2_t = uint_to_hex_lower8_le ((b >> 8) & 255) << 0
241 | uint_to_hex_lower8_le ((b >> 0) & 255) << 16;
242 u32x w3_t = uint_to_hex_lower8_le ((b >> 24) & 255) << 0
243 | uint_to_hex_lower8_le ((b >> 16) & 255) << 16;
244 u32x w4_t = uint_to_hex_lower8_le ((c >> 8) & 255) << 0
245 | uint_to_hex_lower8_le ((c >> 0) & 255) << 16;
246 u32x w5_t = uint_to_hex_lower8_le ((c >> 24) & 255) << 0
247 | uint_to_hex_lower8_le ((c >> 16) & 255) << 16;
248 u32x w6_t = uint_to_hex_lower8_le ((d >> 8) & 255) << 0
249 | uint_to_hex_lower8_le ((d >> 0) & 255) << 16;
250 u32x w7_t = uint_to_hex_lower8_le ((d >> 24) & 255) << 0
251 | uint_to_hex_lower8_le ((d >> 16) & 255) << 16;
252 u32x w8_t = 0x80000000;
270 SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0_t);
271 SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1_t);
272 SHA1_STEP (SHA1_F0o, d, e, a, b, c, w2_t);
273 SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3_t);
274 SHA1_STEP (SHA1_F0o, b, c, d, e, a, w4_t);
275 SHA1_STEP (SHA1_F0o, a, b, c, d, e, w5_t);
276 SHA1_STEP (SHA1_F0o, e, a, b, c, d, w6_t);
277 SHA1_STEP (SHA1_F0o, d, e, a, b, c, w7_t);
278 SHA1_STEP (SHA1_F0o, c, d, e, a, b, w8_t);
279 SHA1_STEP (SHA1_F0o, b, c, d, e, a, w9_t);
280 SHA1_STEP (SHA1_F0o, a, b, c, d, e, wa_t);
281 SHA1_STEP (SHA1_F0o, e, a, b, c, d, wb_t);
282 SHA1_STEP (SHA1_F0o, d, e, a, b, c, wc_t);
283 SHA1_STEP (SHA1_F0o, c, d, e, a, b, wd_t);
284 SHA1_STEP (SHA1_F0o, b, c, d, e, a, we_t);
285 SHA1_STEP (SHA1_F0o, a, b, c, d, e, wf_t);
286 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t);
287 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1_t);
288 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2_t);
289 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3_t);
294 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w4_t);
295 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w5_t);
296 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w6_t);
297 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w7_t);
298 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w8_t);
299 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w9_t);
300 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wa_t);
301 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wb_t);
302 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wc_t);
303 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wd_t);
304 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, we_t);
305 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wf_t);
306 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0_t);
307 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t);
308 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t);
309 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3_t);
310 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w4_t);
311 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w5_t);
312 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w6_t);
313 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w7_t);
318 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w8_t);
319 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w9_t);
320 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wa_t);
321 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wb_t);
322 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wc_t);
323 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, wd_t);
324 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, we_t);
325 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wf_t);
326 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w0_t);
327 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w1_t);
328 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w2_t);
329 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w3_t);
330 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w4_t);
331 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w5_t);
332 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w6_t);
333 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w7_t);
334 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w8_t);
335 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w9_t);
336 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wa_t);
337 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wb_t);
342 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wc_t);
343 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wd_t);
344 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, we_t);
345 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wf_t);
346 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0_t);
347 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1_t);
348 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w2_t);
349 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t);
350 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w4_t);
351 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w5_t);
352 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w6_t);
353 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w7_t);
354 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w8_t);
355 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w9_t);
356 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wa_t);
357 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wb_t);
358 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wc_t);
359 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd_t);
360 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we_t);
361 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf_t);
363 COMPARE_M_SIMD (d, e, c, b);
367 __kernel void m04700_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)
371 __kernel void m04700_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)
375 __kernel void m04700_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)
381 const u32 gid = get_global_id (0);
382 const u32 lid = get_local_id (0);
383 const u32 lsz = get_local_size (0);
389 __local u32 l_bin2asc[256];
391 for (u32 i = lid; i < 256; i += lsz)
393 const u32 i0 = (i >> 0) & 15;
394 const u32 i1 = (i >> 4) & 15;
396 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 0
397 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 8;
400 barrier (CLK_LOCAL_MEM_FENCE);
402 if (gid >= gid_max) return;
411 pw_buf0[0] = pws[gid].i[0];
412 pw_buf0[1] = pws[gid].i[1];
413 pw_buf0[2] = pws[gid].i[2];
414 pw_buf0[3] = pws[gid].i[3];
415 pw_buf1[0] = pws[gid].i[4];
416 pw_buf1[1] = pws[gid].i[5];
417 pw_buf1[2] = pws[gid].i[6];
418 pw_buf1[3] = pws[gid].i[7];
420 const u32 pw_l_len = pws[gid].pw_len;
426 const u32 search[4] =
428 digests_buf[digests_offset].digest_buf[DGST_R0],
429 digests_buf[digests_offset].digest_buf[DGST_R1],
430 digests_buf[digests_offset].digest_buf[DGST_R2],
431 digests_buf[digests_offset].digest_buf[DGST_R3]
438 const u32 e_rev = rotl32_S (search[1], 2u);
444 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
446 const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
448 const u32x pw_len = pw_l_len + pw_r_len;
451 * concat password candidate
454 u32x wordl0[4] = { 0 };
455 u32x wordl1[4] = { 0 };
456 u32x wordl2[4] = { 0 };
457 u32x wordl3[4] = { 0 };
459 wordl0[0] = pw_buf0[0];
460 wordl0[1] = pw_buf0[1];
461 wordl0[2] = pw_buf0[2];
462 wordl0[3] = pw_buf0[3];
463 wordl1[0] = pw_buf1[0];
464 wordl1[1] = pw_buf1[1];
465 wordl1[2] = pw_buf1[2];
466 wordl1[3] = pw_buf1[3];
468 u32x wordr0[4] = { 0 };
469 u32x wordr1[4] = { 0 };
470 u32x wordr2[4] = { 0 };
471 u32x wordr3[4] = { 0 };
473 wordr0[0] = ix_create_combt (combs_buf, il_pos, 0);
474 wordr0[1] = ix_create_combt (combs_buf, il_pos, 1);
475 wordr0[2] = ix_create_combt (combs_buf, il_pos, 2);
476 wordr0[3] = ix_create_combt (combs_buf, il_pos, 3);
477 wordr1[0] = ix_create_combt (combs_buf, il_pos, 4);
478 wordr1[1] = ix_create_combt (combs_buf, il_pos, 5);
479 wordr1[2] = ix_create_combt (combs_buf, il_pos, 6);
480 wordr1[3] = ix_create_combt (combs_buf, il_pos, 7);
482 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
484 switch_buffer_by_offset_le_VV (wordr0, wordr1, wordr2, wordr3, pw_l_len);
488 switch_buffer_by_offset_le_VV (wordl0, wordl1, wordl2, wordl3, pw_r_len);
496 w0[0] = wordl0[0] | wordr0[0];
497 w0[1] = wordl0[1] | wordr0[1];
498 w0[2] = wordl0[2] | wordr0[2];
499 w0[3] = wordl0[3] | wordr0[3];
500 w1[0] = wordl1[0] | wordr1[0];
501 w1[1] = wordl1[1] | wordr1[1];
502 w1[2] = wordl1[2] | wordr1[2];
503 w1[3] = wordl1[3] | wordr1[3];
504 w2[0] = wordl2[0] | wordr2[0];
505 w2[1] = wordl2[1] | wordr2[1];
506 w2[2] = wordl2[2] | wordr2[2];
507 w2[3] = wordl2[3] | wordr2[3];
508 w3[0] = wordl3[0] | wordr3[0];
509 w3[1] = wordl3[1] | wordr3[1];
523 MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
524 MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
525 MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
526 MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
527 MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
528 MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
529 MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
530 MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
531 MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
532 MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
533 MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
534 MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
535 MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
536 MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
537 MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
538 MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
540 MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
541 MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
542 MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
543 MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
544 MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
545 MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
546 MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
547 MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
548 MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
549 MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
550 MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
551 MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
552 MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
553 MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
554 MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
555 MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
557 MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
558 MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
559 MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
560 MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
561 MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
562 MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
563 MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
564 MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
565 MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
566 MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
567 MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
568 MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
569 MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
570 MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
571 MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
572 MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
574 MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
575 MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
576 MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
577 MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
578 MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
579 MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
580 MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
581 MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
582 MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
583 MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
584 MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
585 MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
586 MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
587 MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
588 MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
589 MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
600 u32x w0_t = uint_to_hex_lower8_le ((a >> 8) & 255) << 0
601 | uint_to_hex_lower8_le ((a >> 0) & 255) << 16;
602 u32x w1_t = uint_to_hex_lower8_le ((a >> 24) & 255) << 0
603 | uint_to_hex_lower8_le ((a >> 16) & 255) << 16;
604 u32x w2_t = uint_to_hex_lower8_le ((b >> 8) & 255) << 0
605 | uint_to_hex_lower8_le ((b >> 0) & 255) << 16;
606 u32x w3_t = uint_to_hex_lower8_le ((b >> 24) & 255) << 0
607 | uint_to_hex_lower8_le ((b >> 16) & 255) << 16;
608 u32x w4_t = uint_to_hex_lower8_le ((c >> 8) & 255) << 0
609 | uint_to_hex_lower8_le ((c >> 0) & 255) << 16;
610 u32x w5_t = uint_to_hex_lower8_le ((c >> 24) & 255) << 0
611 | uint_to_hex_lower8_le ((c >> 16) & 255) << 16;
612 u32x w6_t = uint_to_hex_lower8_le ((d >> 8) & 255) << 0
613 | uint_to_hex_lower8_le ((d >> 0) & 255) << 16;
614 u32x w7_t = uint_to_hex_lower8_le ((d >> 24) & 255) << 0
615 | uint_to_hex_lower8_le ((d >> 16) & 255) << 16;
616 u32x w8_t = 0x80000000;
634 SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0_t);
635 SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1_t);
636 SHA1_STEP (SHA1_F0o, d, e, a, b, c, w2_t);
637 SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3_t);
638 SHA1_STEP (SHA1_F0o, b, c, d, e, a, w4_t);
639 SHA1_STEP (SHA1_F0o, a, b, c, d, e, w5_t);
640 SHA1_STEP (SHA1_F0o, e, a, b, c, d, w6_t);
641 SHA1_STEP (SHA1_F0o, d, e, a, b, c, w7_t);
642 SHA1_STEP (SHA1_F0o, c, d, e, a, b, w8_t);
643 SHA1_STEP (SHA1_F0o, b, c, d, e, a, w9_t);
644 SHA1_STEP (SHA1_F0o, a, b, c, d, e, wa_t);
645 SHA1_STEP (SHA1_F0o, e, a, b, c, d, wb_t);
646 SHA1_STEP (SHA1_F0o, d, e, a, b, c, wc_t);
647 SHA1_STEP (SHA1_F0o, c, d, e, a, b, wd_t);
648 SHA1_STEP (SHA1_F0o, b, c, d, e, a, we_t);
649 SHA1_STEP (SHA1_F0o, a, b, c, d, e, wf_t);
650 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t);
651 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1_t);
652 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2_t);
653 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3_t);
658 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w4_t);
659 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w5_t);
660 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w6_t);
661 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w7_t);
662 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w8_t);
663 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w9_t);
664 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wa_t);
665 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wb_t);
666 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wc_t);
667 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wd_t);
668 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, we_t);
669 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wf_t);
670 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0_t);
671 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t);
672 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t);
673 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3_t);
674 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w4_t);
675 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w5_t);
676 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w6_t);
677 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w7_t);
682 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w8_t);
683 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w9_t);
684 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wa_t);
685 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wb_t);
686 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wc_t);
687 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, wd_t);
688 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, we_t);
689 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wf_t);
690 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w0_t);
691 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w1_t);
692 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w2_t);
693 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w3_t);
694 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w4_t);
695 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w5_t);
696 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w6_t);
697 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w7_t);
698 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w8_t);
699 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w9_t);
700 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wa_t);
701 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wb_t);
706 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wc_t);
707 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wd_t);
708 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, we_t);
709 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wf_t);
710 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0_t);
711 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1_t);
712 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w2_t);
713 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t);
714 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w4_t);
715 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w5_t);
716 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w6_t);
717 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w7_t);
718 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w8_t);
719 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w9_t);
720 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wa_t);
721 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wb_t);
723 if (MATCHES_NONE_VS (e, e_rev)) continue;
725 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wc_t);
726 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd_t);
727 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we_t);
728 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf_t);
730 COMPARE_S_SIMD (d, e, c, b);
734 __kernel void m04700_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)
738 __kernel void m04700_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)