2 * Author......: Jens Steube <jens.steube@gmail.com>
10 #include "inc_vendor.cl"
11 #include "inc_hash_constants.h"
12 #include "inc_hash_functions.cl"
13 #include "inc_types.cl"
14 #include "inc_common.cl"
15 #include "inc_simd.cl"
17 void sha1_transform (const u32x w0[4], const u32x w1[4], const u32x w2[4], const u32x w3[4], u32x digest[5])
45 SHA1_STEP (SHA1_F0o, A, B, C, D, E, w0_t);
46 SHA1_STEP (SHA1_F0o, E, A, B, C, D, w1_t);
47 SHA1_STEP (SHA1_F0o, D, E, A, B, C, w2_t);
48 SHA1_STEP (SHA1_F0o, C, D, E, A, B, w3_t);
49 SHA1_STEP (SHA1_F0o, B, C, D, E, A, w4_t);
50 SHA1_STEP (SHA1_F0o, A, B, C, D, E, w5_t);
51 SHA1_STEP (SHA1_F0o, E, A, B, C, D, w6_t);
52 SHA1_STEP (SHA1_F0o, D, E, A, B, C, w7_t);
53 SHA1_STEP (SHA1_F0o, C, D, E, A, B, w8_t);
54 SHA1_STEP (SHA1_F0o, B, C, D, E, A, w9_t);
55 SHA1_STEP (SHA1_F0o, A, B, C, D, E, wa_t);
56 SHA1_STEP (SHA1_F0o, E, A, B, C, D, wb_t);
57 SHA1_STEP (SHA1_F0o, D, E, A, B, C, wc_t);
58 SHA1_STEP (SHA1_F0o, C, D, E, A, B, wd_t);
59 SHA1_STEP (SHA1_F0o, B, C, D, E, A, we_t);
60 SHA1_STEP (SHA1_F0o, A, B, C, D, E, wf_t);
61 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F0o, E, A, B, C, D, w0_t);
62 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F0o, D, E, A, B, C, w1_t);
63 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F0o, C, D, E, A, B, w2_t);
64 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F0o, B, C, D, E, A, w3_t);
69 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, A, B, C, D, E, w4_t);
70 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, E, A, B, C, D, w5_t);
71 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, D, E, A, B, C, w6_t);
72 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, C, D, E, A, B, w7_t);
73 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, B, C, D, E, A, w8_t);
74 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, A, B, C, D, E, w9_t);
75 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, E, A, B, C, D, wa_t);
76 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, D, E, A, B, C, wb_t);
77 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, C, D, E, A, B, wc_t);
78 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, B, C, D, E, A, wd_t);
79 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, A, B, C, D, E, we_t);
80 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, E, A, B, C, D, wf_t);
81 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, D, E, A, B, C, w0_t);
82 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, C, D, E, A, B, w1_t);
83 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, B, C, D, E, A, w2_t);
84 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, A, B, C, D, E, w3_t);
85 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, E, A, B, C, D, w4_t);
86 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, D, E, A, B, C, w5_t);
87 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, C, D, E, A, B, w6_t);
88 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, B, C, D, E, A, w7_t);
93 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, A, B, C, D, E, w8_t);
94 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, E, A, B, C, D, w9_t);
95 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, D, E, A, B, C, wa_t);
96 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, C, D, E, A, B, wb_t);
97 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F2o, B, C, D, E, A, wc_t);
98 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F2o, A, B, C, D, E, wd_t);
99 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F2o, E, A, B, C, D, we_t);
100 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F2o, D, E, A, B, C, wf_t);
101 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F2o, C, D, E, A, B, w0_t);
102 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F2o, B, C, D, E, A, w1_t);
103 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F2o, A, B, C, D, E, w2_t);
104 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F2o, E, A, B, C, D, w3_t);
105 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F2o, D, E, A, B, C, w4_t);
106 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F2o, C, D, E, A, B, w5_t);
107 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F2o, B, C, D, E, A, w6_t);
108 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F2o, A, B, C, D, E, w7_t);
109 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, E, A, B, C, D, w8_t);
110 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, D, E, A, B, C, w9_t);
111 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, C, D, E, A, B, wa_t);
112 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, B, C, D, E, A, wb_t);
117 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, A, B, C, D, E, wc_t);
118 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, E, A, B, C, D, wd_t);
119 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, D, E, A, B, C, we_t);
120 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, C, D, E, A, B, wf_t);
121 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, B, C, D, E, A, w0_t);
122 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, A, B, C, D, E, w1_t);
123 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, E, A, B, C, D, w2_t);
124 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, D, E, A, B, C, w3_t);
125 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, C, D, E, A, B, w4_t);
126 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, B, C, D, E, A, w5_t);
127 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, A, B, C, D, E, w6_t);
128 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, E, A, B, C, D, w7_t);
129 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, D, E, A, B, C, w8_t);
130 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, C, D, E, A, B, w9_t);
131 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, B, C, D, E, A, wa_t);
132 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, A, B, C, D, E, wb_t);
133 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, E, A, B, C, D, wc_t);
134 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, D, E, A, B, C, wd_t);
135 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, C, D, E, A, B, we_t);
136 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, B, C, D, E, A, wf_t);
145 __kernel void m09820_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 oldoffice34_t *oldoffice34_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)
151 const u32 lid = get_local_id (0);
157 const u32 gid = get_global_id (0);
159 if (gid >= gid_max) return;
164 pw_buf0[0] = pws[gid].i[0];
165 pw_buf0[1] = pws[gid].i[1];
166 pw_buf0[2] = pws[gid].i[2];
167 pw_buf0[3] = pws[gid].i[3];
168 pw_buf1[0] = pws[gid].i[4];
169 pw_buf1[1] = pws[gid].i[5];
170 pw_buf1[2] = pws[gid].i[6];
171 pw_buf1[3] = pws[gid].i[7];
173 const u32 pw_l_len = pws[gid].pw_len;
181 salt_buf[0] = salt_bufs[salt_pos].salt_buf[0];
182 salt_buf[1] = salt_bufs[salt_pos].salt_buf[1];
183 salt_buf[2] = salt_bufs[salt_pos].salt_buf[2];
184 salt_buf[3] = salt_bufs[salt_pos].salt_buf[3];
190 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
192 const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
194 const u32x pw_len = pw_l_len + pw_r_len;
197 * concat password candidate
200 u32x wordl0[4] = { 0 };
201 u32x wordl1[4] = { 0 };
202 u32x wordl2[4] = { 0 };
203 u32x wordl3[4] = { 0 };
205 wordl0[0] = pw_buf0[0];
206 wordl0[1] = pw_buf0[1];
207 wordl0[2] = pw_buf0[2];
208 wordl0[3] = pw_buf0[3];
209 wordl1[0] = pw_buf1[0];
210 wordl1[1] = pw_buf1[1];
211 wordl1[2] = pw_buf1[2];
212 wordl1[3] = pw_buf1[3];
214 u32x wordr0[4] = { 0 };
215 u32x wordr1[4] = { 0 };
216 u32x wordr2[4] = { 0 };
217 u32x wordr3[4] = { 0 };
219 wordr0[0] = ix_create_combt (combs_buf, il_pos, 0);
220 wordr0[1] = ix_create_combt (combs_buf, il_pos, 1);
221 wordr0[2] = ix_create_combt (combs_buf, il_pos, 2);
222 wordr0[3] = ix_create_combt (combs_buf, il_pos, 3);
223 wordr1[0] = ix_create_combt (combs_buf, il_pos, 4);
224 wordr1[1] = ix_create_combt (combs_buf, il_pos, 5);
225 wordr1[2] = ix_create_combt (combs_buf, il_pos, 6);
226 wordr1[3] = ix_create_combt (combs_buf, il_pos, 7);
228 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
230 switch_buffer_by_offset_le_VV (wordr0, wordr1, wordr2, wordr3, pw_l_len);
234 switch_buffer_by_offset_le_VV (wordl0, wordl1, wordl2, wordl3, pw_r_len);
242 w0[0] = wordl0[0] | wordr0[0];
243 w0[1] = wordl0[1] | wordr0[1];
244 w0[2] = wordl0[2] | wordr0[2];
245 w0[3] = wordl0[3] | wordr0[3];
246 w1[0] = wordl1[0] | wordr1[0];
247 w1[1] = wordl1[1] | wordr1[1];
248 w1[2] = wordl1[2] | wordr1[2];
249 w1[3] = wordl1[3] | wordr1[3];
255 make_unicode (w1, w2, w3);
256 make_unicode (w0, w0, w1);
258 const u32x pw_salt_len = (pw_len * 2) + 16;
260 w3[3] = pw_salt_len * 8;
262 w3[1] = swap32 (w2[1]);
263 w3[0] = swap32 (w2[0]);
264 w2[3] = swap32 (w1[3]);
265 w2[2] = swap32 (w1[2]);
266 w2[1] = swap32 (w1[1]);
267 w2[0] = swap32 (w1[0]);
268 w1[3] = swap32 (w0[3]);
269 w1[2] = swap32 (w0[2]);
270 w1[1] = swap32 (w0[1]);
271 w1[0] = swap32 (w0[0]);
285 sha1_transform (w0, w1, w2, w3, digest);
302 w3[3] = (20 + 4) * 8;
310 sha1_transform (w0, w1, w2, w3, digest);
312 digest[0] = swap32 (digest[0]);
313 digest[1] = swap32 (digest[1]) & 0xff;
317 COMPARE_M_SIMD (digest[0], digest[1], digest[2], digest[3]);
321 __kernel void m09820_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 oldoffice34_t *oldoffice34_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)
325 __kernel void m09820_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 oldoffice34_t *oldoffice34_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)
329 __kernel void m09820_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 oldoffice34_t *oldoffice34_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)
335 const u32 lid = get_local_id (0);
341 const u32 gid = get_global_id (0);
343 if (gid >= gid_max) return;
348 pw_buf0[0] = pws[gid].i[0];
349 pw_buf0[1] = pws[gid].i[1];
350 pw_buf0[2] = pws[gid].i[2];
351 pw_buf0[3] = pws[gid].i[3];
352 pw_buf1[0] = pws[gid].i[4];
353 pw_buf1[1] = pws[gid].i[5];
354 pw_buf1[2] = pws[gid].i[6];
355 pw_buf1[3] = pws[gid].i[7];
357 const u32 pw_l_len = pws[gid].pw_len;
365 salt_buf[0] = salt_bufs[salt_pos].salt_buf[0];
366 salt_buf[1] = salt_bufs[salt_pos].salt_buf[1];
367 salt_buf[2] = salt_bufs[salt_pos].salt_buf[2];
368 salt_buf[3] = salt_bufs[salt_pos].salt_buf[3];
374 const u32 search[4] =
376 digests_buf[digests_offset].digest_buf[DGST_R0],
377 digests_buf[digests_offset].digest_buf[DGST_R1],
378 digests_buf[digests_offset].digest_buf[DGST_R2],
379 digests_buf[digests_offset].digest_buf[DGST_R3]
386 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
388 const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
390 const u32x pw_len = pw_l_len + pw_r_len;
393 * concat password candidate
396 u32x wordl0[4] = { 0 };
397 u32x wordl1[4] = { 0 };
398 u32x wordl2[4] = { 0 };
399 u32x wordl3[4] = { 0 };
401 wordl0[0] = pw_buf0[0];
402 wordl0[1] = pw_buf0[1];
403 wordl0[2] = pw_buf0[2];
404 wordl0[3] = pw_buf0[3];
405 wordl1[0] = pw_buf1[0];
406 wordl1[1] = pw_buf1[1];
407 wordl1[2] = pw_buf1[2];
408 wordl1[3] = pw_buf1[3];
410 u32x wordr0[4] = { 0 };
411 u32x wordr1[4] = { 0 };
412 u32x wordr2[4] = { 0 };
413 u32x wordr3[4] = { 0 };
415 wordr0[0] = ix_create_combt (combs_buf, il_pos, 0);
416 wordr0[1] = ix_create_combt (combs_buf, il_pos, 1);
417 wordr0[2] = ix_create_combt (combs_buf, il_pos, 2);
418 wordr0[3] = ix_create_combt (combs_buf, il_pos, 3);
419 wordr1[0] = ix_create_combt (combs_buf, il_pos, 4);
420 wordr1[1] = ix_create_combt (combs_buf, il_pos, 5);
421 wordr1[2] = ix_create_combt (combs_buf, il_pos, 6);
422 wordr1[3] = ix_create_combt (combs_buf, il_pos, 7);
424 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
426 switch_buffer_by_offset_le_VV (wordr0, wordr1, wordr2, wordr3, pw_l_len);
430 switch_buffer_by_offset_le_VV (wordl0, wordl1, wordl2, wordl3, pw_r_len);
438 w0[0] = wordl0[0] | wordr0[0];
439 w0[1] = wordl0[1] | wordr0[1];
440 w0[2] = wordl0[2] | wordr0[2];
441 w0[3] = wordl0[3] | wordr0[3];
442 w1[0] = wordl1[0] | wordr1[0];
443 w1[1] = wordl1[1] | wordr1[1];
444 w1[2] = wordl1[2] | wordr1[2];
445 w1[3] = wordl1[3] | wordr1[3];
451 make_unicode (w1, w2, w3);
452 make_unicode (w0, w0, w1);
454 const u32x pw_salt_len = (pw_len * 2) + 16;
456 w3[3] = pw_salt_len * 8;
458 w3[1] = swap32 (w2[1]);
459 w3[0] = swap32 (w2[0]);
460 w2[3] = swap32 (w1[3]);
461 w2[2] = swap32 (w1[2]);
462 w2[1] = swap32 (w1[1]);
463 w2[0] = swap32 (w1[0]);
464 w1[3] = swap32 (w0[3]);
465 w1[2] = swap32 (w0[2]);
466 w1[1] = swap32 (w0[1]);
467 w1[0] = swap32 (w0[0]);
481 sha1_transform (w0, w1, w2, w3, digest);
498 w3[3] = (20 + 4) * 8;
506 sha1_transform (w0, w1, w2, w3, digest);
508 digest[0] = swap32 (digest[0]);
509 digest[1] = swap32 (digest[1]) & 0xff;
513 COMPARE_S_SIMD (digest[0], digest[1], digest[2], digest[3]);
517 __kernel void m09820_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 oldoffice34_t *oldoffice34_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)
521 __kernel void m09820_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 oldoffice34_t *oldoffice34_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)