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"
23 void sha1_transform (const u32x w0[4], const u32x w1[4], const u32x w2[4], const u32x w3[4], u32x digest[5])
51 SHA1_STEP (SHA1_F0o, A, B, C, D, E, w0_t);
52 SHA1_STEP (SHA1_F0o, E, A, B, C, D, w1_t);
53 SHA1_STEP (SHA1_F0o, D, E, A, B, C, w2_t);
54 SHA1_STEP (SHA1_F0o, C, D, E, A, B, w3_t);
55 SHA1_STEP (SHA1_F0o, B, C, D, E, A, w4_t);
56 SHA1_STEP (SHA1_F0o, A, B, C, D, E, w5_t);
57 SHA1_STEP (SHA1_F0o, E, A, B, C, D, w6_t);
58 SHA1_STEP (SHA1_F0o, D, E, A, B, C, w7_t);
59 SHA1_STEP (SHA1_F0o, C, D, E, A, B, w8_t);
60 SHA1_STEP (SHA1_F0o, B, C, D, E, A, w9_t);
61 SHA1_STEP (SHA1_F0o, A, B, C, D, E, wa_t);
62 SHA1_STEP (SHA1_F0o, E, A, B, C, D, wb_t);
63 SHA1_STEP (SHA1_F0o, D, E, A, B, C, wc_t);
64 SHA1_STEP (SHA1_F0o, C, D, E, A, B, wd_t);
65 SHA1_STEP (SHA1_F0o, B, C, D, E, A, we_t);
66 SHA1_STEP (SHA1_F0o, A, B, C, D, E, wf_t);
67 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F0o, E, A, B, C, D, w0_t);
68 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F0o, D, E, A, B, C, w1_t);
69 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F0o, C, D, E, A, B, w2_t);
70 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F0o, B, C, D, E, A, w3_t);
75 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, A, B, C, D, E, w4_t);
76 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, E, A, B, C, D, w5_t);
77 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, D, E, A, B, C, w6_t);
78 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, C, D, E, A, B, w7_t);
79 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, B, C, D, E, A, w8_t);
80 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, A, B, C, D, E, w9_t);
81 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, E, A, B, C, D, wa_t);
82 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, D, E, A, B, C, wb_t);
83 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, C, D, E, A, B, wc_t);
84 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, B, C, D, E, A, wd_t);
85 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, A, B, C, D, E, we_t);
86 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, E, A, B, C, D, wf_t);
87 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, D, E, A, B, C, w0_t);
88 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, C, D, E, A, B, w1_t);
89 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, B, C, D, E, A, w2_t);
90 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, A, B, C, D, E, w3_t);
91 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, E, A, B, C, D, w4_t);
92 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, D, E, A, B, C, w5_t);
93 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, C, D, E, A, B, w6_t);
94 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, B, C, D, E, A, w7_t);
99 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, A, B, C, D, E, w8_t);
100 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, E, A, B, C, D, w9_t);
101 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, D, E, A, B, C, wa_t);
102 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, C, D, E, A, B, wb_t);
103 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F2o, B, C, D, E, A, wc_t);
104 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F2o, A, B, C, D, E, wd_t);
105 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F2o, E, A, B, C, D, we_t);
106 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F2o, D, E, A, B, C, wf_t);
107 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F2o, C, D, E, A, B, w0_t);
108 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F2o, B, C, D, E, A, w1_t);
109 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F2o, A, B, C, D, E, w2_t);
110 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F2o, E, A, B, C, D, w3_t);
111 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F2o, D, E, A, B, C, w4_t);
112 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F2o, C, D, E, A, B, w5_t);
113 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F2o, B, C, D, E, A, w6_t);
114 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F2o, A, B, C, D, E, w7_t);
115 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, E, A, B, C, D, w8_t);
116 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, D, E, A, B, C, w9_t);
117 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, C, D, E, A, B, wa_t);
118 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, B, C, D, E, A, wb_t);
123 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, A, B, C, D, E, wc_t);
124 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, E, A, B, C, D, wd_t);
125 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, D, E, A, B, C, we_t);
126 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, C, D, E, A, B, wf_t);
127 w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, B, C, D, E, A, w0_t);
128 w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, A, B, C, D, E, w1_t);
129 w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, E, A, B, C, D, w2_t);
130 w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, D, E, A, B, C, w3_t);
131 w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, C, D, E, A, B, w4_t);
132 w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, B, C, D, E, A, w5_t);
133 w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, A, B, C, D, E, w6_t);
134 w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, E, A, B, C, D, w7_t);
135 w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, D, E, A, B, C, w8_t);
136 w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, C, D, E, A, B, w9_t);
137 wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, B, C, D, E, A, wa_t);
138 wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, A, B, C, D, E, wb_t);
139 wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, E, A, B, C, D, wc_t);
140 wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, D, E, A, B, C, wd_t);
141 we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, C, D, E, A, B, we_t);
142 wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, B, C, D, E, A, wf_t);
151 __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_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)
157 const u32 lid = get_local_id (0);
163 const u32 gid = get_global_id (0);
165 if (gid >= gid_max) return;
170 pw_buf0[0] = pws[gid].i[0];
171 pw_buf0[1] = pws[gid].i[1];
172 pw_buf0[2] = pws[gid].i[2];
173 pw_buf0[3] = pws[gid].i[3];
174 pw_buf1[0] = pws[gid].i[4];
175 pw_buf1[1] = pws[gid].i[5];
176 pw_buf1[2] = pws[gid].i[6];
177 pw_buf1[3] = pws[gid].i[7];
179 const u32 pw_l_len = pws[gid].pw_len;
187 salt_buf[0] = salt_bufs[salt_pos].salt_buf[0];
188 salt_buf[1] = salt_bufs[salt_pos].salt_buf[1];
189 salt_buf[2] = salt_bufs[salt_pos].salt_buf[2];
190 salt_buf[3] = salt_bufs[salt_pos].salt_buf[3];
196 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
198 const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
200 const u32x pw_len = pw_l_len + pw_r_len;
203 * concat password candidate
206 u32x wordl0[4] = { 0 };
207 u32x wordl1[4] = { 0 };
208 u32x wordl2[4] = { 0 };
209 u32x wordl3[4] = { 0 };
211 wordl0[0] = pw_buf0[0];
212 wordl0[1] = pw_buf0[1];
213 wordl0[2] = pw_buf0[2];
214 wordl0[3] = pw_buf0[3];
215 wordl1[0] = pw_buf1[0];
216 wordl1[1] = pw_buf1[1];
217 wordl1[2] = pw_buf1[2];
218 wordl1[3] = pw_buf1[3];
220 u32x wordr0[4] = { 0 };
221 u32x wordr1[4] = { 0 };
222 u32x wordr2[4] = { 0 };
223 u32x wordr3[4] = { 0 };
225 wordr0[0] = ix_create_combt (combs_buf, il_pos, 0);
226 wordr0[1] = ix_create_combt (combs_buf, il_pos, 1);
227 wordr0[2] = ix_create_combt (combs_buf, il_pos, 2);
228 wordr0[3] = ix_create_combt (combs_buf, il_pos, 3);
229 wordr1[0] = ix_create_combt (combs_buf, il_pos, 4);
230 wordr1[1] = ix_create_combt (combs_buf, il_pos, 5);
231 wordr1[2] = ix_create_combt (combs_buf, il_pos, 6);
232 wordr1[3] = ix_create_combt (combs_buf, il_pos, 7);
234 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
236 switch_buffer_by_offset_le_VV (wordr0, wordr1, wordr2, wordr3, pw_l_len);
240 switch_buffer_by_offset_le_VV (wordl0, wordl1, wordl2, wordl3, pw_r_len);
248 w0[0] = wordl0[0] | wordr0[0];
249 w0[1] = wordl0[1] | wordr0[1];
250 w0[2] = wordl0[2] | wordr0[2];
251 w0[3] = wordl0[3] | wordr0[3];
252 w1[0] = wordl1[0] | wordr1[0];
253 w1[1] = wordl1[1] | wordr1[1];
254 w1[2] = wordl1[2] | wordr1[2];
255 w1[3] = wordl1[3] | wordr1[3];
261 make_unicode (w1, w2, w3);
262 make_unicode (w0, w0, w1);
264 const u32x pw_salt_len = (pw_len * 2) + 16;
266 w3[3] = pw_salt_len * 8;
268 w3[1] = swap32 (w2[1]);
269 w3[0] = swap32 (w2[0]);
270 w2[3] = swap32 (w1[3]);
271 w2[2] = swap32 (w1[2]);
272 w2[1] = swap32 (w1[1]);
273 w2[0] = swap32 (w1[0]);
274 w1[3] = swap32 (w0[3]);
275 w1[2] = swap32 (w0[2]);
276 w1[1] = swap32 (w0[1]);
277 w1[0] = swap32 (w0[0]);
291 sha1_transform (w0, w1, w2, w3, digest);
308 w3[3] = (20 + 4) * 8;
316 sha1_transform (w0, w1, w2, w3, digest);
318 digest[0] = swap32 (digest[0]);
319 digest[1] = swap32 (digest[1]) & 0xff;
323 COMPARE_M_SIMD (digest[0], digest[1], digest[2], digest[3]);
327 __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_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)
331 __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_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)
335 __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_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)
341 const u32 lid = get_local_id (0);
347 const u32 gid = get_global_id (0);
349 if (gid >= gid_max) return;
354 pw_buf0[0] = pws[gid].i[0];
355 pw_buf0[1] = pws[gid].i[1];
356 pw_buf0[2] = pws[gid].i[2];
357 pw_buf0[3] = pws[gid].i[3];
358 pw_buf1[0] = pws[gid].i[4];
359 pw_buf1[1] = pws[gid].i[5];
360 pw_buf1[2] = pws[gid].i[6];
361 pw_buf1[3] = pws[gid].i[7];
363 const u32 pw_l_len = pws[gid].pw_len;
371 salt_buf[0] = salt_bufs[salt_pos].salt_buf[0];
372 salt_buf[1] = salt_bufs[salt_pos].salt_buf[1];
373 salt_buf[2] = salt_bufs[salt_pos].salt_buf[2];
374 salt_buf[3] = salt_bufs[salt_pos].salt_buf[3];
380 const u32 search[4] =
382 digests_buf[digests_offset].digest_buf[DGST_R0],
383 digests_buf[digests_offset].digest_buf[DGST_R1],
384 digests_buf[digests_offset].digest_buf[DGST_R2],
385 digests_buf[digests_offset].digest_buf[DGST_R3]
392 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
394 const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
396 const u32x pw_len = pw_l_len + pw_r_len;
399 * concat password candidate
402 u32x wordl0[4] = { 0 };
403 u32x wordl1[4] = { 0 };
404 u32x wordl2[4] = { 0 };
405 u32x wordl3[4] = { 0 };
407 wordl0[0] = pw_buf0[0];
408 wordl0[1] = pw_buf0[1];
409 wordl0[2] = pw_buf0[2];
410 wordl0[3] = pw_buf0[3];
411 wordl1[0] = pw_buf1[0];
412 wordl1[1] = pw_buf1[1];
413 wordl1[2] = pw_buf1[2];
414 wordl1[3] = pw_buf1[3];
416 u32x wordr0[4] = { 0 };
417 u32x wordr1[4] = { 0 };
418 u32x wordr2[4] = { 0 };
419 u32x wordr3[4] = { 0 };
421 wordr0[0] = ix_create_combt (combs_buf, il_pos, 0);
422 wordr0[1] = ix_create_combt (combs_buf, il_pos, 1);
423 wordr0[2] = ix_create_combt (combs_buf, il_pos, 2);
424 wordr0[3] = ix_create_combt (combs_buf, il_pos, 3);
425 wordr1[0] = ix_create_combt (combs_buf, il_pos, 4);
426 wordr1[1] = ix_create_combt (combs_buf, il_pos, 5);
427 wordr1[2] = ix_create_combt (combs_buf, il_pos, 6);
428 wordr1[3] = ix_create_combt (combs_buf, il_pos, 7);
430 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
432 switch_buffer_by_offset_le_VV (wordr0, wordr1, wordr2, wordr3, pw_l_len);
436 switch_buffer_by_offset_le_VV (wordl0, wordl1, wordl2, wordl3, pw_r_len);
444 w0[0] = wordl0[0] | wordr0[0];
445 w0[1] = wordl0[1] | wordr0[1];
446 w0[2] = wordl0[2] | wordr0[2];
447 w0[3] = wordl0[3] | wordr0[3];
448 w1[0] = wordl1[0] | wordr1[0];
449 w1[1] = wordl1[1] | wordr1[1];
450 w1[2] = wordl1[2] | wordr1[2];
451 w1[3] = wordl1[3] | wordr1[3];
457 make_unicode (w1, w2, w3);
458 make_unicode (w0, w0, w1);
460 const u32x pw_salt_len = (pw_len * 2) + 16;
462 w3[3] = pw_salt_len * 8;
464 w3[1] = swap32 (w2[1]);
465 w3[0] = swap32 (w2[0]);
466 w2[3] = swap32 (w1[3]);
467 w2[2] = swap32 (w1[2]);
468 w2[1] = swap32 (w1[1]);
469 w2[0] = swap32 (w1[0]);
470 w1[3] = swap32 (w0[3]);
471 w1[2] = swap32 (w0[2]);
472 w1[1] = swap32 (w0[1]);
473 w1[0] = swap32 (w0[0]);
487 sha1_transform (w0, w1, w2, w3, digest);
504 w3[3] = (20 + 4) * 8;
512 sha1_transform (w0, w1, w2, w3, digest);
514 digest[0] = swap32 (digest[0]);
515 digest[1] = swap32 (digest[1]) & 0xff;
519 COMPARE_S_SIMD (digest[0], digest[1], digest[2], digest[3]);
523 __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_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)
527 __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_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)