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_le(i) (u32x) (l_bin2asc[(i)])
26 #define uint_to_hex_lower8_le(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1])
28 #define uint_to_hex_lower8_le(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3])
30 #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])
32 #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])
35 __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_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) << 0
57 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 8;
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];
165 MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
166 MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
167 MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
168 MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
169 MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
170 MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
171 MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
172 MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
173 MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
174 MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
175 MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
176 MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
177 MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
178 MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
179 MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
180 MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
182 MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
183 MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
184 MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
185 MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
186 MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
187 MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
188 MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
189 MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
190 MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
191 MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
192 MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
193 MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
194 MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
195 MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
196 MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
197 MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
199 MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
200 MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
201 MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
202 MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
203 MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
204 MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
205 MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
206 MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
207 MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
208 MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
209 MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
210 MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
211 MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
212 MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
213 MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
214 MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
216 MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
217 MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
218 MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
219 MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
220 MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
221 MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
222 MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
223 MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
224 MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
225 MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
226 MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
227 MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
228 MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
229 MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
230 MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
231 MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
242 u32x w0_t = uint_to_hex_lower8_le ((a >> 8) & 255) << 0
243 | uint_to_hex_lower8_le ((a >> 0) & 255) << 16;
244 u32x w1_t = uint_to_hex_lower8_le ((a >> 24) & 255) << 0
245 | uint_to_hex_lower8_le ((a >> 16) & 255) << 16;
246 u32x w2_t = uint_to_hex_lower8_le ((b >> 8) & 255) << 0
247 | uint_to_hex_lower8_le ((b >> 0) & 255) << 16;
248 u32x w3_t = uint_to_hex_lower8_le ((b >> 24) & 255) << 0
249 | uint_to_hex_lower8_le ((b >> 16) & 255) << 16;
250 u32x w4_t = uint_to_hex_lower8_le ((c >> 8) & 255) << 0
251 | uint_to_hex_lower8_le ((c >> 0) & 255) << 16;
252 u32x w5_t = uint_to_hex_lower8_le ((c >> 24) & 255) << 0
253 | uint_to_hex_lower8_le ((c >> 16) & 255) << 16;
254 u32x w6_t = uint_to_hex_lower8_le ((d >> 8) & 255) << 0
255 | uint_to_hex_lower8_le ((d >> 0) & 255) << 16;
256 u32x w7_t = uint_to_hex_lower8_le ((d >> 24) & 255) << 0
257 | uint_to_hex_lower8_le ((d >> 16) & 255) << 16;
258 u32x w8_t = 0x80000000;
276 SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0_t);
277 SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1_t);
278 SHA1_STEP (SHA1_F0o, d, e, a, b, c, w2_t);
279 SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3_t);
280 SHA1_STEP (SHA1_F0o, b, c, d, e, a, w4_t);
281 SHA1_STEP (SHA1_F0o, a, b, c, d, e, w5_t);
282 SHA1_STEP (SHA1_F0o, e, a, b, c, d, w6_t);
283 SHA1_STEP (SHA1_F0o, d, e, a, b, c, w7_t);
284 SHA1_STEP (SHA1_F0o, c, d, e, a, b, w8_t);
285 SHA1_STEP (SHA1_F0o, b, c, d, e, a, w9_t);
286 SHA1_STEP (SHA1_F0o, a, b, c, d, e, wa_t);
287 SHA1_STEP (SHA1_F0o, e, a, b, c, d, wb_t);
288 SHA1_STEP (SHA1_F0o, d, e, a, b, c, wc_t);
289 SHA1_STEP (SHA1_F0o, c, d, e, a, b, wd_t);
290 SHA1_STEP (SHA1_F0o, b, c, d, e, a, we_t);
291 SHA1_STEP (SHA1_F0o, a, b, c, d, e, wf_t);
292 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t);
293 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1_t);
294 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2_t);
295 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3_t);
300 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w4_t);
301 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w5_t);
302 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w6_t);
303 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w7_t);
304 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w8_t);
305 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w9_t);
306 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wa_t);
307 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wb_t);
308 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wc_t);
309 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wd_t);
310 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, we_t);
311 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wf_t);
312 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0_t);
313 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t);
314 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t);
315 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3_t);
316 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w4_t);
317 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w5_t);
318 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w6_t);
319 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w7_t);
324 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w8_t);
325 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w9_t);
326 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wa_t);
327 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wb_t);
328 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wc_t);
329 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, wd_t);
330 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, we_t);
331 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wf_t);
332 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w0_t);
333 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w1_t);
334 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w2_t);
335 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w3_t);
336 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w4_t);
337 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w5_t);
338 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w6_t);
339 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w7_t);
340 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w8_t);
341 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w9_t);
342 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wa_t);
343 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wb_t);
348 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wc_t);
349 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wd_t);
350 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, we_t);
351 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wf_t);
352 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0_t);
353 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1_t);
354 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w2_t);
355 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t);
356 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w4_t);
357 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w5_t);
358 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w6_t);
359 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w7_t);
360 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w8_t);
361 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w9_t);
362 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wa_t);
363 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wb_t);
364 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wc_t);
365 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd_t);
366 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we_t);
367 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf_t);
369 COMPARE_M_SIMD (d, e, c, b);
373 __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_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)
377 __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_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)
381 __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_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)
387 const u32 gid = get_global_id (0);
388 const u32 lid = get_local_id (0);
389 const u32 lsz = get_local_size (0);
395 __local u32 l_bin2asc[256];
397 for (u32 i = lid; i < 256; i += lsz)
399 const u32 i0 = (i >> 0) & 15;
400 const u32 i1 = (i >> 4) & 15;
402 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 0
403 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 8;
406 barrier (CLK_LOCAL_MEM_FENCE);
408 if (gid >= gid_max) return;
417 pw_buf0[0] = pws[gid].i[0];
418 pw_buf0[1] = pws[gid].i[1];
419 pw_buf0[2] = pws[gid].i[2];
420 pw_buf0[3] = pws[gid].i[3];
421 pw_buf1[0] = pws[gid].i[4];
422 pw_buf1[1] = pws[gid].i[5];
423 pw_buf1[2] = pws[gid].i[6];
424 pw_buf1[3] = pws[gid].i[7];
426 const u32 pw_l_len = pws[gid].pw_len;
432 const u32 search[4] =
434 digests_buf[digests_offset].digest_buf[DGST_R0],
435 digests_buf[digests_offset].digest_buf[DGST_R1],
436 digests_buf[digests_offset].digest_buf[DGST_R2],
437 digests_buf[digests_offset].digest_buf[DGST_R3]
444 const u32 e_rev = rotl32_S (search[1], 2u);
450 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
452 const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
454 const u32x pw_len = pw_l_len + pw_r_len;
457 * concat password candidate
460 u32x wordl0[4] = { 0 };
461 u32x wordl1[4] = { 0 };
462 u32x wordl2[4] = { 0 };
463 u32x wordl3[4] = { 0 };
465 wordl0[0] = pw_buf0[0];
466 wordl0[1] = pw_buf0[1];
467 wordl0[2] = pw_buf0[2];
468 wordl0[3] = pw_buf0[3];
469 wordl1[0] = pw_buf1[0];
470 wordl1[1] = pw_buf1[1];
471 wordl1[2] = pw_buf1[2];
472 wordl1[3] = pw_buf1[3];
474 u32x wordr0[4] = { 0 };
475 u32x wordr1[4] = { 0 };
476 u32x wordr2[4] = { 0 };
477 u32x wordr3[4] = { 0 };
479 wordr0[0] = ix_create_combt (combs_buf, il_pos, 0);
480 wordr0[1] = ix_create_combt (combs_buf, il_pos, 1);
481 wordr0[2] = ix_create_combt (combs_buf, il_pos, 2);
482 wordr0[3] = ix_create_combt (combs_buf, il_pos, 3);
483 wordr1[0] = ix_create_combt (combs_buf, il_pos, 4);
484 wordr1[1] = ix_create_combt (combs_buf, il_pos, 5);
485 wordr1[2] = ix_create_combt (combs_buf, il_pos, 6);
486 wordr1[3] = ix_create_combt (combs_buf, il_pos, 7);
488 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
490 switch_buffer_by_offset_le_VV (wordr0, wordr1, wordr2, wordr3, pw_l_len);
494 switch_buffer_by_offset_le_VV (wordl0, wordl1, wordl2, wordl3, pw_r_len);
502 w0[0] = wordl0[0] | wordr0[0];
503 w0[1] = wordl0[1] | wordr0[1];
504 w0[2] = wordl0[2] | wordr0[2];
505 w0[3] = wordl0[3] | wordr0[3];
506 w1[0] = wordl1[0] | wordr1[0];
507 w1[1] = wordl1[1] | wordr1[1];
508 w1[2] = wordl1[2] | wordr1[2];
509 w1[3] = wordl1[3] | wordr1[3];
510 w2[0] = wordl2[0] | wordr2[0];
511 w2[1] = wordl2[1] | wordr2[1];
512 w2[2] = wordl2[2] | wordr2[2];
513 w2[3] = wordl2[3] | wordr2[3];
514 w3[0] = wordl3[0] | wordr3[0];
515 w3[1] = wordl3[1] | wordr3[1];
529 MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
530 MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
531 MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
532 MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
533 MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
534 MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
535 MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
536 MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
537 MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
538 MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
539 MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
540 MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
541 MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
542 MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
543 MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
544 MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
546 MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
547 MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
548 MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
549 MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
550 MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
551 MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
552 MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
553 MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
554 MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
555 MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
556 MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
557 MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
558 MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
559 MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
560 MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
561 MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
563 MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
564 MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
565 MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
566 MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
567 MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
568 MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
569 MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
570 MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
571 MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
572 MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
573 MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
574 MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
575 MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
576 MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
577 MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
578 MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
580 MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
581 MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
582 MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
583 MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
584 MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
585 MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
586 MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
587 MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
588 MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
589 MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
590 MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
591 MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
592 MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
593 MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
594 MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
595 MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
606 u32x w0_t = uint_to_hex_lower8_le ((a >> 8) & 255) << 0
607 | uint_to_hex_lower8_le ((a >> 0) & 255) << 16;
608 u32x w1_t = uint_to_hex_lower8_le ((a >> 24) & 255) << 0
609 | uint_to_hex_lower8_le ((a >> 16) & 255) << 16;
610 u32x w2_t = uint_to_hex_lower8_le ((b >> 8) & 255) << 0
611 | uint_to_hex_lower8_le ((b >> 0) & 255) << 16;
612 u32x w3_t = uint_to_hex_lower8_le ((b >> 24) & 255) << 0
613 | uint_to_hex_lower8_le ((b >> 16) & 255) << 16;
614 u32x w4_t = uint_to_hex_lower8_le ((c >> 8) & 255) << 0
615 | uint_to_hex_lower8_le ((c >> 0) & 255) << 16;
616 u32x w5_t = uint_to_hex_lower8_le ((c >> 24) & 255) << 0
617 | uint_to_hex_lower8_le ((c >> 16) & 255) << 16;
618 u32x w6_t = uint_to_hex_lower8_le ((d >> 8) & 255) << 0
619 | uint_to_hex_lower8_le ((d >> 0) & 255) << 16;
620 u32x w7_t = uint_to_hex_lower8_le ((d >> 24) & 255) << 0
621 | uint_to_hex_lower8_le ((d >> 16) & 255) << 16;
622 u32x w8_t = 0x80000000;
640 SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0_t);
641 SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1_t);
642 SHA1_STEP (SHA1_F0o, d, e, a, b, c, w2_t);
643 SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3_t);
644 SHA1_STEP (SHA1_F0o, b, c, d, e, a, w4_t);
645 SHA1_STEP (SHA1_F0o, a, b, c, d, e, w5_t);
646 SHA1_STEP (SHA1_F0o, e, a, b, c, d, w6_t);
647 SHA1_STEP (SHA1_F0o, d, e, a, b, c, w7_t);
648 SHA1_STEP (SHA1_F0o, c, d, e, a, b, w8_t);
649 SHA1_STEP (SHA1_F0o, b, c, d, e, a, w9_t);
650 SHA1_STEP (SHA1_F0o, a, b, c, d, e, wa_t);
651 SHA1_STEP (SHA1_F0o, e, a, b, c, d, wb_t);
652 SHA1_STEP (SHA1_F0o, d, e, a, b, c, wc_t);
653 SHA1_STEP (SHA1_F0o, c, d, e, a, b, wd_t);
654 SHA1_STEP (SHA1_F0o, b, c, d, e, a, we_t);
655 SHA1_STEP (SHA1_F0o, a, b, c, d, e, wf_t);
656 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t);
657 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1_t);
658 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2_t);
659 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3_t);
664 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w4_t);
665 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w5_t);
666 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w6_t);
667 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w7_t);
668 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w8_t);
669 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w9_t);
670 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wa_t);
671 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wb_t);
672 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wc_t);
673 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wd_t);
674 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, we_t);
675 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wf_t);
676 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0_t);
677 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t);
678 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t);
679 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3_t);
680 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w4_t);
681 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w5_t);
682 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w6_t);
683 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w7_t);
688 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w8_t);
689 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w9_t);
690 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wa_t);
691 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wb_t);
692 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wc_t);
693 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, wd_t);
694 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, we_t);
695 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wf_t);
696 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w0_t);
697 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w1_t);
698 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w2_t);
699 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w3_t);
700 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w4_t);
701 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w5_t);
702 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w6_t);
703 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w7_t);
704 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w8_t);
705 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w9_t);
706 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wa_t);
707 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wb_t);
712 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wc_t);
713 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wd_t);
714 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, we_t);
715 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wf_t);
716 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0_t);
717 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1_t);
718 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w2_t);
719 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t);
720 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w4_t);
721 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w5_t);
722 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w6_t);
723 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w7_t);
724 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w8_t);
725 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w9_t);
726 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wa_t);
727 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wb_t);
729 if (MATCHES_NONE_VS (e, e_rev)) continue;
731 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wc_t);
732 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd_t);
733 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we_t);
734 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf_t);
736 COMPARE_S_SIMD (d, e, c, b);
740 __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_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)
744 __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_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)