2 * Author......: Jens Steube <jens.steube@gmail.com>
8 #include "inc_vendor.cl"
9 #include "inc_hash_constants.h"
10 #include "inc_hash_functions.cl"
11 #include "inc_types.cl"
12 #include "inc_common.cl"
14 #define COMPARE_S "inc_comp_single.cl"
15 #define COMPARE_M "inc_comp_multi.cl"
17 void sha1_transform (const u32 w0[4], const u32 w1[4], const u32 w2[4], const u32 w3[4], u32 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 void hmac_sha1_pad (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], u32 ipad[5], u32 opad[5])
147 w0[0] = w0[0] ^ 0x36363636;
148 w0[1] = w0[1] ^ 0x36363636;
149 w0[2] = w0[2] ^ 0x36363636;
150 w0[3] = w0[3] ^ 0x36363636;
151 w1[0] = w1[0] ^ 0x36363636;
152 w1[1] = w1[1] ^ 0x36363636;
153 w1[2] = w1[2] ^ 0x36363636;
154 w1[3] = w1[3] ^ 0x36363636;
155 w2[0] = w2[0] ^ 0x36363636;
156 w2[1] = w2[1] ^ 0x36363636;
157 w2[2] = w2[2] ^ 0x36363636;
158 w2[3] = w2[3] ^ 0x36363636;
159 w3[0] = w3[0] ^ 0x36363636;
160 w3[1] = w3[1] ^ 0x36363636;
161 w3[2] = w3[2] ^ 0x36363636;
162 w3[3] = w3[3] ^ 0x36363636;
170 sha1_transform (w0, w1, w2, w3, ipad);
172 w0[0] = w0[0] ^ 0x6a6a6a6a;
173 w0[1] = w0[1] ^ 0x6a6a6a6a;
174 w0[2] = w0[2] ^ 0x6a6a6a6a;
175 w0[3] = w0[3] ^ 0x6a6a6a6a;
176 w1[0] = w1[0] ^ 0x6a6a6a6a;
177 w1[1] = w1[1] ^ 0x6a6a6a6a;
178 w1[2] = w1[2] ^ 0x6a6a6a6a;
179 w1[3] = w1[3] ^ 0x6a6a6a6a;
180 w2[0] = w2[0] ^ 0x6a6a6a6a;
181 w2[1] = w2[1] ^ 0x6a6a6a6a;
182 w2[2] = w2[2] ^ 0x6a6a6a6a;
183 w2[3] = w2[3] ^ 0x6a6a6a6a;
184 w3[0] = w3[0] ^ 0x6a6a6a6a;
185 w3[1] = w3[1] ^ 0x6a6a6a6a;
186 w3[2] = w3[2] ^ 0x6a6a6a6a;
187 w3[3] = w3[3] ^ 0x6a6a6a6a;
195 sha1_transform (w0, w1, w2, w3, opad);
198 void hmac_sha1_run (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], u32 ipad[5], u32 opad[5], u32 digest[5])
206 sha1_transform (w0, w1, w2, w3, digest);
223 w3[3] = (64 + 20) * 8;
231 sha1_transform (w0, w1, w2, w3, digest);
234 __kernel void m06700_init (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global sha1aix_tmp_t *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 wpa_t *wpa_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)
240 const u32 gid = get_global_id (0);
242 if (gid >= gid_max) return;
246 w0[0] = pws[gid].i[ 0];
247 w0[1] = pws[gid].i[ 1];
248 w0[2] = pws[gid].i[ 2];
249 w0[3] = pws[gid].i[ 3];
253 w1[0] = pws[gid].i[ 4];
254 w1[1] = pws[gid].i[ 5];
255 w1[2] = pws[gid].i[ 6];
256 w1[3] = pws[gid].i[ 7];
260 w2[0] = pws[gid].i[ 8];
261 w2[1] = pws[gid].i[ 9];
262 w2[2] = pws[gid].i[10];
263 w2[3] = pws[gid].i[11];
267 w3[0] = pws[gid].i[12];
268 w3[1] = pws[gid].i[13];
269 w3[2] = pws[gid].i[14];
270 w3[3] = pws[gid].i[15];
276 u32 salt_len = salt_bufs[salt_pos].salt_len;
280 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
281 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
282 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
283 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
287 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
288 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
289 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
290 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
294 salt_buf2[0] = salt_bufs[salt_pos].salt_buf[ 8];
295 salt_buf2[1] = salt_bufs[salt_pos].salt_buf[ 9];
296 salt_buf2[2] = salt_bufs[salt_pos].salt_buf[10];
297 salt_buf2[3] = salt_bufs[salt_pos].salt_buf[11];
306 append_0x01_4x4 (salt_buf0, salt_buf1, salt_buf2, salt_buf3, salt_len + 3);
308 append_0x80_4x4 (salt_buf0, salt_buf1, salt_buf2, salt_buf3, salt_len + 4);
314 w0[0] = swap32 (w0[0]);
315 w0[1] = swap32 (w0[1]);
316 w0[2] = swap32 (w0[2]);
317 w0[3] = swap32 (w0[3]);
318 w1[0] = swap32 (w1[0]);
319 w1[1] = swap32 (w1[1]);
320 w1[2] = swap32 (w1[2]);
321 w1[3] = swap32 (w1[3]);
322 w2[0] = swap32 (w2[0]);
323 w2[1] = swap32 (w2[1]);
324 w2[2] = swap32 (w2[2]);
325 w2[3] = swap32 (w2[3]);
326 w3[0] = swap32 (w3[0]);
327 w3[1] = swap32 (w3[1]);
328 w3[2] = swap32 (w3[2]);
329 w3[3] = swap32 (w3[3]);
334 hmac_sha1_pad (w0, w1, w2, w3, ipad, opad);
336 tmps[gid].ipad[0] = ipad[0];
337 tmps[gid].ipad[1] = ipad[1];
338 tmps[gid].ipad[2] = ipad[2];
339 tmps[gid].ipad[3] = ipad[3];
340 tmps[gid].ipad[4] = ipad[4];
342 tmps[gid].opad[0] = opad[0];
343 tmps[gid].opad[1] = opad[1];
344 tmps[gid].opad[2] = opad[2];
345 tmps[gid].opad[3] = opad[3];
346 tmps[gid].opad[4] = opad[4];
348 w0[0] = salt_buf0[0];
349 w0[1] = salt_buf0[1];
350 w0[2] = salt_buf0[2];
351 w0[3] = salt_buf0[3];
352 w1[0] = salt_buf1[0];
353 w1[1] = salt_buf1[1];
354 w1[2] = salt_buf1[2];
355 w1[3] = salt_buf1[3];
356 w2[0] = salt_buf2[0];
357 w2[1] = salt_buf2[1];
358 w2[2] = salt_buf2[2];
359 w2[3] = salt_buf2[3];
360 w3[0] = salt_buf3[0];
361 w3[1] = salt_buf3[1];
362 w3[2] = salt_buf3[2];
363 //w3[3] = salt_buf3[3];
365 w0[0] = swap32 (w0[0]);
366 w0[1] = swap32 (w0[1]);
367 w0[2] = swap32 (w0[2]);
368 w0[3] = swap32 (w0[3]);
369 w1[0] = swap32 (w1[0]);
370 w1[1] = swap32 (w1[1]);
371 w1[2] = swap32 (w1[2]);
372 w1[3] = swap32 (w1[3]);
373 w2[0] = swap32 (w2[0]);
374 w2[1] = swap32 (w2[1]);
375 w2[2] = swap32 (w2[2]);
376 w2[3] = swap32 (w2[3]);
377 w3[0] = swap32 (w3[0]);
378 w3[1] = swap32 (w3[1]);
379 w3[2] = swap32 (w3[2]);
380 w3[3] = (64 + salt_len + 4) * 8;
384 hmac_sha1_run (w0, w1, w2, w3, ipad, opad, dgst);
386 tmps[gid].dgst[0] = dgst[0];
387 tmps[gid].dgst[1] = dgst[1];
388 tmps[gid].dgst[2] = dgst[2];
389 tmps[gid].dgst[3] = dgst[3];
390 tmps[gid].dgst[4] = dgst[4];
392 tmps[gid].out[0] = dgst[0];
393 tmps[gid].out[1] = dgst[1];
394 tmps[gid].out[2] = dgst[2];
395 tmps[gid].out[3] = dgst[3];
396 tmps[gid].out[4] = dgst[4];
399 __kernel void m06700_loop (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global sha1aix_tmp_t *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 wpa_t *wpa_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)
401 const u32 gid = get_global_id (0);
403 if (gid >= gid_max) return;
408 ipad[0] = tmps[gid].ipad[0];
409 ipad[1] = tmps[gid].ipad[1];
410 ipad[2] = tmps[gid].ipad[2];
411 ipad[3] = tmps[gid].ipad[3];
412 ipad[4] = tmps[gid].ipad[4];
414 opad[0] = tmps[gid].opad[0];
415 opad[1] = tmps[gid].opad[1];
416 opad[2] = tmps[gid].opad[2];
417 opad[3] = tmps[gid].opad[3];
418 opad[4] = tmps[gid].opad[4];
423 dgst[0] = tmps[gid].dgst[0];
424 dgst[1] = tmps[gid].dgst[1];
425 dgst[2] = tmps[gid].dgst[2];
426 dgst[3] = tmps[gid].dgst[3];
427 dgst[4] = tmps[gid].dgst[4];
429 out[0] = tmps[gid].out[0];
430 out[1] = tmps[gid].out[1];
431 out[2] = tmps[gid].out[2];
432 out[3] = tmps[gid].out[3];
433 out[4] = tmps[gid].out[4];
435 for (u32 j = 0; j < loop_cnt; j++)
457 w3[3] = (64 + 20) * 8;
459 hmac_sha1_run (w0, w1, w2, w3, ipad, opad, dgst);
468 tmps[gid].dgst[0] = dgst[0];
469 tmps[gid].dgst[1] = dgst[1];
470 tmps[gid].dgst[2] = dgst[2];
471 tmps[gid].dgst[3] = dgst[3];
472 tmps[gid].dgst[4] = dgst[4];
474 tmps[gid].out[0] = out[0];
475 tmps[gid].out[1] = out[1];
476 tmps[gid].out[2] = out[2];
477 tmps[gid].out[3] = out[3];
478 tmps[gid].out[4] = out[4];
481 __kernel void m06700_comp (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global sha1aix_tmp_t *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 wpa_t *wpa_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)
487 const u32 gid = get_global_id (0);
489 if (gid >= gid_max) return;
491 const u32 lid = get_local_id (0);
498 u32 a = tmps[gid].out[0];
499 u32 b = tmps[gid].out[1];
500 u32 c = tmps[gid].out[2];
501 u32 d = tmps[gid].out[3];
502 u32 e = tmps[gid].out[4] & 0xffff03ff;
505 const u32 r0 = tmps[gid].out[DGST_R0];
506 const u32 r1 = tmps[gid].out[DGST_R1];
507 const u32 r2 = tmps[gid].out[DGST_R2];
508 const u32 r3 = tmps[gid].out[DGST_R3];