Zero pws_buf before reuse
[hashcat.git] / OpenCL / m00120_a1.cl
1 /**
2  * Author......: Jens Steube <jens.steube@gmail.com>
3  * License.....: MIT
4  */
5
6 #define _SHA1_
7
8 #define NEW_SIMD_CODE
9
10 #include "include/constants.h"
11 #include "include/kernel_vendor.h"
12
13 #define DGST_R0 3
14 #define DGST_R1 4
15 #define DGST_R2 2
16 #define DGST_R3 1
17
18 #include "include/kernel_functions.c"
19 #include "OpenCL/types_ocl.c"
20 #include "OpenCL/common.c"
21 #include "OpenCL/simd.c"
22
23 __kernel void m00120_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 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
24 {
25   /**
26    * modifier
27    */
28
29   const u32 lid = get_local_id (0);
30
31   /**
32    * base
33    */
34
35   const u32 gid = get_global_id (0);
36
37   if (gid >= gid_max) return;
38
39   u32 pws0[4] = { 0 };
40   u32 pws1[4] = { 0 };
41
42   pws0[0] = pws[gid].i[0];
43   pws0[1] = pws[gid].i[1];
44   pws0[2] = pws[gid].i[2];
45   pws0[3] = pws[gid].i[3];
46   pws1[0] = pws[gid].i[4];
47   pws1[1] = pws[gid].i[5];
48   pws1[2] = pws[gid].i[6];
49   pws1[3] = pws[gid].i[7];
50
51   const u32 pw_l_len = pws[gid].pw_len;
52
53   /**
54    * salt
55    */
56
57   u32 salt_buf0[4];
58   u32 salt_buf1[4];
59
60   salt_buf0[0] = salt_bufs[salt_pos].salt_buf[0];
61   salt_buf0[1] = salt_bufs[salt_pos].salt_buf[1];
62   salt_buf0[2] = salt_bufs[salt_pos].salt_buf[2];
63   salt_buf0[3] = salt_bufs[salt_pos].salt_buf[3];
64   salt_buf1[0] = salt_bufs[salt_pos].salt_buf[4];
65   salt_buf1[1] = salt_bufs[salt_pos].salt_buf[5];
66   salt_buf1[2] = salt_bufs[salt_pos].salt_buf[6];
67   salt_buf1[3] = salt_bufs[salt_pos].salt_buf[7];
68
69   const u32 salt_len = salt_bufs[salt_pos].salt_len;
70
71   /**
72    * loop
73    */
74
75   for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
76   {
77     const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
78
79     const u32x pw_len = pw_l_len + pw_r_len;
80
81     u32x wordr0[4] = { 0 };
82     u32x wordr1[4] = { 0 };
83     u32x wordr2[4] = { 0 };
84     u32x wordr3[4] = { 0 };
85
86     wordr0[0] = ix_create_combt (combs_buf, il_pos, 0);
87     wordr0[1] = ix_create_combt (combs_buf, il_pos, 1);
88     wordr0[2] = ix_create_combt (combs_buf, il_pos, 2);
89     wordr0[3] = ix_create_combt (combs_buf, il_pos, 3);
90     wordr1[0] = ix_create_combt (combs_buf, il_pos, 4);
91     wordr1[1] = ix_create_combt (combs_buf, il_pos, 5);
92     wordr1[2] = ix_create_combt (combs_buf, il_pos, 6);
93     wordr1[3] = ix_create_combt (combs_buf, il_pos, 7);
94
95     if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
96     {
97       switch_buffer_by_offset_le (wordr0, wordr1, wordr2, wordr3, pw_l_len);
98     }
99
100     u32x w0[4];
101     u32x w1[4];
102     u32x w2[4];
103     u32x w3[4];
104
105     w0[0] = wordl0[0] | wordr0[0];
106     w0[1] = wordl0[1] | wordr0[1];
107     w0[2] = wordl0[2] | wordr0[2];
108     w0[3] = wordl0[3] | wordr0[3];
109     w1[0] = wordl1[0] | wordr1[0];
110     w1[1] = wordl1[1] | wordr1[1];
111     w1[2] = wordl1[2] | wordr1[2];
112     w1[3] = wordl1[3] | wordr1[3];
113     w2[0] = wordl2[0] | wordr2[0];
114     w2[1] = wordl2[1] | wordr2[1];
115     w2[2] = wordl2[2] | wordr2[2];
116     w2[3] = wordl2[3] | wordr2[3];
117     w3[0] = wordl3[0] | wordr3[0];
118     w3[1] = wordl3[1] | wordr3[1];
119     w3[2] = wordl3[2] | wordr3[2];
120     w3[3] = wordl3[3] | wordr3[3];
121
122     /**
123      * prepend salt
124      */
125
126     const u32x pw_salt_len = pw_len + salt_len;
127
128     u32x w0_t[4];
129     u32x w1_t[4];
130     u32x w2_t[4];
131     u32x w3_t[4];
132
133     w0_t[0] = w0[0];
134     w0_t[1] = w0[1];
135     w0_t[2] = w0[2];
136     w0_t[3] = w0[3];
137     w1_t[0] = w1[0];
138     w1_t[1] = w1[1];
139     w1_t[2] = w1[2];
140     w1_t[3] = w1[3];
141     w2_t[0] = w2[0];
142     w2_t[1] = w2[1];
143     w2_t[2] = w2[2];
144     w2_t[3] = w2[3];
145     w3_t[0] = w3[0];
146     w3_t[1] = w3[1];
147     w3_t[2] = w3[2];
148     w3_t[3] = w3[3];
149
150     switch_buffer_by_offset_le (w0_t, w1_t, w2_t, w3_t, salt_len);
151
152     w0_t[0] |= salt_buf0[0];
153     w0_t[1] |= salt_buf0[1];
154     w0_t[2] |= salt_buf0[2];
155     w0_t[3] |= salt_buf0[3];
156     w1_t[0] |= salt_buf1[0];
157     w1_t[1] |= salt_buf1[1];
158     w1_t[2] |= salt_buf1[2];
159     w1_t[3] |= salt_buf1[3];
160
161     append_0x80_4x4 (w0_t, w1_t, w2_t, w3_t, pw_salt_len);
162
163     w3_t[3] = pw_salt_len * 8;
164
165     /**
166      * sha1
167      */
168
169     w0_t[0] = swap32 (w0_t[0]);
170     w0_t[1] = swap32 (w0_t[1]);
171     w0_t[2] = swap32 (w0_t[2]);
172     w0_t[3] = swap32 (w0_t[3]);
173     w1_t[0] = swap32 (w1_t[0]);
174     w1_t[1] = swap32 (w1_t[1]);
175     w1_t[2] = swap32 (w1_t[2]);
176     w1_t[3] = swap32 (w1_t[3]);
177     w2_t[0] = swap32 (w2_t[0]);
178     w2_t[1] = swap32 (w2_t[1]);
179     w2_t[2] = swap32 (w2_t[2]);
180     w2_t[3] = swap32 (w2_t[3]);
181     w3_t[0] = swap32 (w3_t[0]);
182     w3_t[1] = swap32 (w3_t[1]);
183     //w3_t[2] = swap32 (w3_t[2]);
184     //w3_t[3] = swap32 (w3_t[3]);
185
186     u32x a = SHA1M_A;
187     u32x b = SHA1M_B;
188     u32x c = SHA1M_C;
189     u32x d = SHA1M_D;
190     u32x e = SHA1M_E;
191
192     #undef K
193     #define K SHA1C00
194
195     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0_t[0]);
196     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t[1]);
197     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w0_t[2]);
198     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w0_t[3]);
199     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w1_t[0]);
200     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w1_t[1]);
201     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1_t[2]);
202     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1_t[3]);
203     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2_t[0]);
204     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w2_t[1]);
205     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w2_t[2]);
206     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w2_t[3]);
207     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w3_t[0]);
208     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3_t[1]);
209     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3_t[2]);
210     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w3_t[3]);
211     w0_t[0] = rotl32 ((w3_t[1] ^ w2_t[0] ^ w0_t[2] ^ w0_t[0]), 1u); SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t[0]);
212     w0_t[1] = rotl32 ((w3_t[2] ^ w2_t[1] ^ w0_t[3] ^ w0_t[1]), 1u); SHA1_STEP (SHA1_F0o, d, e, a, b, c, w0_t[1]);
213     w0_t[2] = rotl32 ((w3_t[3] ^ w2_t[2] ^ w1_t[0] ^ w0_t[2]), 1u); SHA1_STEP (SHA1_F0o, c, d, e, a, b, w0_t[2]);
214     w0_t[3] = rotl32 ((w0_t[0] ^ w2_t[3] ^ w1_t[1] ^ w0_t[3]), 1u); SHA1_STEP (SHA1_F0o, b, c, d, e, a, w0_t[3]);
215
216     #undef K
217     #define K SHA1C01
218
219     w1_t[0] = rotl32 ((w0_t[1] ^ w3_t[0] ^ w1_t[2] ^ w1_t[0]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1_t[0]);
220     w1_t[1] = rotl32 ((w0_t[2] ^ w3_t[1] ^ w1_t[3] ^ w1_t[1]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w1_t[1]);
221     w1_t[2] = rotl32 ((w0_t[3] ^ w3_t[2] ^ w2_t[0] ^ w1_t[2]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w1_t[2]);
222     w1_t[3] = rotl32 ((w1_t[0] ^ w3_t[3] ^ w2_t[1] ^ w1_t[3]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t[3]);
223     w2_t[0] = rotl32 ((w1_t[1] ^ w0_t[0] ^ w2_t[2] ^ w2_t[0]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t[0]);
224     w2_t[1] = rotl32 ((w1_t[2] ^ w0_t[1] ^ w2_t[3] ^ w2_t[1]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w2_t[1]);
225     w2_t[2] = rotl32 ((w1_t[3] ^ w0_t[2] ^ w3_t[0] ^ w2_t[2]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w2_t[2]);
226     w2_t[3] = rotl32 ((w2_t[0] ^ w0_t[3] ^ w3_t[1] ^ w2_t[3]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w2_t[3]);
227     w3_t[0] = rotl32 ((w2_t[1] ^ w1_t[0] ^ w3_t[2] ^ w3_t[0]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w3_t[0]);
228     w3_t[1] = rotl32 ((w2_t[2] ^ w1_t[1] ^ w3_t[3] ^ w3_t[1]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w3_t[1]);
229     w3_t[2] = rotl32 ((w2_t[3] ^ w1_t[2] ^ w0_t[0] ^ w3_t[2]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3_t[2]);
230     w3_t[3] = rotl32 ((w3_t[0] ^ w1_t[3] ^ w0_t[1] ^ w3_t[3]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w3_t[3]);
231     w0_t[0] = rotl32 ((w3_t[1] ^ w2_t[0] ^ w0_t[2] ^ w0_t[0]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0_t[0]);
232     w0_t[1] = rotl32 ((w3_t[2] ^ w2_t[1] ^ w0_t[3] ^ w0_t[1]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w0_t[1]);
233     w0_t[2] = rotl32 ((w3_t[3] ^ w2_t[2] ^ w1_t[0] ^ w0_t[2]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0_t[2]);
234     w0_t[3] = rotl32 ((w0_t[0] ^ w2_t[3] ^ w1_t[1] ^ w0_t[3]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w0_t[3]);
235     w1_t[0] = rotl32 ((w0_t[1] ^ w3_t[0] ^ w1_t[2] ^ w1_t[0]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w1_t[0]);
236     w1_t[1] = rotl32 ((w0_t[2] ^ w3_t[1] ^ w1_t[3] ^ w1_t[1]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w1_t[1]);
237     w1_t[2] = rotl32 ((w0_t[3] ^ w3_t[2] ^ w2_t[0] ^ w1_t[2]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t[2]);
238     w1_t[3] = rotl32 ((w1_t[0] ^ w3_t[3] ^ w2_t[1] ^ w1_t[3]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w1_t[3]);
239
240     #undef K
241     #define K SHA1C02
242
243     w2_t[0] = rotl32 ((w1_t[1] ^ w0_t[0] ^ w2_t[2] ^ w2_t[0]), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w2_t[0]);
244     w2_t[1] = rotl32 ((w1_t[2] ^ w0_t[1] ^ w2_t[3] ^ w2_t[1]), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w2_t[1]);
245     w2_t[2] = rotl32 ((w1_t[3] ^ w0_t[2] ^ w3_t[0] ^ w2_t[2]), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w2_t[2]);
246     w2_t[3] = rotl32 ((w2_t[0] ^ w0_t[3] ^ w3_t[1] ^ w2_t[3]), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w2_t[3]);
247     w3_t[0] = rotl32 ((w2_t[1] ^ w1_t[0] ^ w3_t[2] ^ w3_t[0]), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w3_t[0]);
248     w3_t[1] = rotl32 ((w2_t[2] ^ w1_t[1] ^ w3_t[3] ^ w3_t[1]), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w3_t[1]);
249     w3_t[2] = rotl32 ((w2_t[3] ^ w1_t[2] ^ w0_t[0] ^ w3_t[2]), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w3_t[2]);
250     w3_t[3] = rotl32 ((w3_t[0] ^ w1_t[3] ^ w0_t[1] ^ w3_t[3]), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w3_t[3]);
251     w0_t[0] = rotl32 ((w3_t[1] ^ w2_t[0] ^ w0_t[2] ^ w0_t[0]), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w0_t[0]);
252     w0_t[1] = rotl32 ((w3_t[2] ^ w2_t[1] ^ w0_t[3] ^ w0_t[1]), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w0_t[1]);
253     w0_t[2] = rotl32 ((w3_t[3] ^ w2_t[2] ^ w1_t[0] ^ w0_t[2]), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w0_t[2]);
254     w0_t[3] = rotl32 ((w0_t[0] ^ w2_t[3] ^ w1_t[1] ^ w0_t[3]), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w0_t[3]);
255     w1_t[0] = rotl32 ((w0_t[1] ^ w3_t[0] ^ w1_t[2] ^ w1_t[0]), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w1_t[0]);
256     w1_t[1] = rotl32 ((w0_t[2] ^ w3_t[1] ^ w1_t[3] ^ w1_t[1]), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w1_t[1]);
257     w1_t[2] = rotl32 ((w0_t[3] ^ w3_t[2] ^ w2_t[0] ^ w1_t[2]), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w1_t[2]);
258     w1_t[3] = rotl32 ((w1_t[0] ^ w3_t[3] ^ w2_t[1] ^ w1_t[3]), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w1_t[3]);
259     w2_t[0] = rotl32 ((w1_t[1] ^ w0_t[0] ^ w2_t[2] ^ w2_t[0]), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w2_t[0]);
260     w2_t[1] = rotl32 ((w1_t[2] ^ w0_t[1] ^ w2_t[3] ^ w2_t[1]), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w2_t[1]);
261     w2_t[2] = rotl32 ((w1_t[3] ^ w0_t[2] ^ w3_t[0] ^ w2_t[2]), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w2_t[2]);
262     w2_t[3] = rotl32 ((w2_t[0] ^ w0_t[3] ^ w3_t[1] ^ w2_t[3]), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w2_t[3]);
263
264     #undef K
265     #define K SHA1C03
266
267     w3_t[0] = rotl32 ((w2_t[1] ^ w1_t[0] ^ w3_t[2] ^ w3_t[0]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3_t[0]);
268     w3_t[1] = rotl32 ((w2_t[2] ^ w1_t[1] ^ w3_t[3] ^ w3_t[1]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w3_t[1]);
269     w3_t[2] = rotl32 ((w2_t[3] ^ w1_t[2] ^ w0_t[0] ^ w3_t[2]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t[2]);
270     w3_t[3] = rotl32 ((w3_t[0] ^ w1_t[3] ^ w0_t[1] ^ w3_t[3]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w3_t[3]);
271     w0_t[0] = rotl32 ((w3_t[1] ^ w2_t[0] ^ w0_t[2] ^ w0_t[0]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0_t[0]);
272     w0_t[1] = rotl32 ((w3_t[2] ^ w2_t[1] ^ w0_t[3] ^ w0_t[1]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w0_t[1]);
273     w0_t[2] = rotl32 ((w3_t[3] ^ w2_t[2] ^ w1_t[0] ^ w0_t[2]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w0_t[2]);
274     w0_t[3] = rotl32 ((w0_t[0] ^ w2_t[3] ^ w1_t[1] ^ w0_t[3]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0_t[3]);
275     w1_t[0] = rotl32 ((w0_t[1] ^ w3_t[0] ^ w1_t[2] ^ w1_t[0]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t[0]);
276     w1_t[1] = rotl32 ((w0_t[2] ^ w3_t[1] ^ w1_t[3] ^ w1_t[1]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w1_t[1]);
277     w1_t[2] = rotl32 ((w0_t[3] ^ w3_t[2] ^ w2_t[0] ^ w1_t[2]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1_t[2]);
278     w1_t[3] = rotl32 ((w1_t[0] ^ w3_t[3] ^ w2_t[1] ^ w1_t[3]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w1_t[3]);
279     w2_t[0] = rotl32 ((w1_t[1] ^ w0_t[0] ^ w2_t[2] ^ w2_t[0]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w2_t[0]);
280     w2_t[1] = rotl32 ((w1_t[2] ^ w0_t[1] ^ w2_t[3] ^ w2_t[1]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w2_t[1]);
281     w2_t[2] = rotl32 ((w1_t[3] ^ w0_t[2] ^ w3_t[0] ^ w2_t[2]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t[2]);
282     w2_t[3] = rotl32 ((w2_t[0] ^ w0_t[3] ^ w3_t[1] ^ w2_t[3]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w2_t[3]);
283     w3_t[0] = rotl32 ((w2_t[1] ^ w1_t[0] ^ w3_t[2] ^ w3_t[0]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w3_t[0]);
284     w3_t[1] = rotl32 ((w2_t[2] ^ w1_t[1] ^ w3_t[3] ^ w3_t[1]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t[1]);
285     w3_t[2] = rotl32 ((w2_t[3] ^ w1_t[2] ^ w0_t[0] ^ w3_t[2]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w3_t[2]);
286     w3_t[3] = rotl32 ((w3_t[0] ^ w1_t[3] ^ w0_t[1] ^ w3_t[3]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w3_t[3]);
287
288     COMPARE_M_SIMD (d, e, c, b);
289   }
290 }
291
292 __kernel void m00120_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 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
293 {
294 }
295
296 __kernel void m00120_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 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
297 {
298 }
299
300 __kernel void m00120_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 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
301 {
302   /**
303    * modifier
304    */
305
306   const u32 lid = get_local_id (0);
307
308   /**
309    * base
310    */
311
312   const u32 gid = get_global_id (0);
313
314   if (gid >= gid_max) return;
315
316   u32 pws0[4] = { 0 };
317   u32 pws1[4] = { 0 };
318
319   pws0[0] = pws[gid].i[0];
320   pws0[1] = pws[gid].i[1];
321   pws0[2] = pws[gid].i[2];
322   pws0[3] = pws[gid].i[3];
323   pws1[0] = pws[gid].i[4];
324   pws1[1] = pws[gid].i[5];
325   pws1[2] = pws[gid].i[6];
326   pws1[3] = pws[gid].i[7];
327
328   const u32 pw_l_len = pws[gid].pw_len;
329
330   /**
331    * salt
332    */
333
334   u32 salt_buf0[4];
335   u32 salt_buf1[4];
336
337   salt_buf0[0] = salt_bufs[salt_pos].salt_buf[0];
338   salt_buf0[1] = salt_bufs[salt_pos].salt_buf[1];
339   salt_buf0[2] = salt_bufs[salt_pos].salt_buf[2];
340   salt_buf0[3] = salt_bufs[salt_pos].salt_buf[3];
341   salt_buf1[0] = salt_bufs[salt_pos].salt_buf[4];
342   salt_buf1[1] = salt_bufs[salt_pos].salt_buf[5];
343   salt_buf1[2] = salt_bufs[salt_pos].salt_buf[6];
344   salt_buf1[3] = salt_bufs[salt_pos].salt_buf[7];
345
346   const u32 salt_len = salt_bufs[salt_pos].salt_len;
347
348   /**
349    * digest
350    */
351
352   const u32 search[4] =
353   {
354     digests_buf[digests_offset].digest_buf[DGST_R0],
355     digests_buf[digests_offset].digest_buf[DGST_R1],
356     digests_buf[digests_offset].digest_buf[DGST_R2],
357     digests_buf[digests_offset].digest_buf[DGST_R3]
358   };
359
360   /**
361    * reverse
362    */
363
364   const u32 e_rev = rotl32_S (search[1], 2u);
365
366   /**
367    * loop
368    */
369
370   for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
371   {
372     const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
373
374     const u32x pw_len = pw_l_len + pw_r_len;
375
376     u32x wordr0[4] = { 0 };
377     u32x wordr1[4] = { 0 };
378     u32x wordr2[4] = { 0 };
379     u32x wordr3[4] = { 0 };
380
381     wordr0[0] = ix_create_combt (combs_buf, il_pos, 0);
382     wordr0[1] = ix_create_combt (combs_buf, il_pos, 1);
383     wordr0[2] = ix_create_combt (combs_buf, il_pos, 2);
384     wordr0[3] = ix_create_combt (combs_buf, il_pos, 3);
385     wordr1[0] = ix_create_combt (combs_buf, il_pos, 4);
386     wordr1[1] = ix_create_combt (combs_buf, il_pos, 5);
387     wordr1[2] = ix_create_combt (combs_buf, il_pos, 6);
388     wordr1[3] = ix_create_combt (combs_buf, il_pos, 7);
389
390     if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
391     {
392       switch_buffer_by_offset_le (wordr0, wordr1, wordr2, wordr3, pw_l_len);
393     }
394
395     u32x w0[4];
396     u32x w1[4];
397     u32x w2[4];
398     u32x w3[4];
399
400     w0[0] = wordl0[0] | wordr0[0];
401     w0[1] = wordl0[1] | wordr0[1];
402     w0[2] = wordl0[2] | wordr0[2];
403     w0[3] = wordl0[3] | wordr0[3];
404     w1[0] = wordl1[0] | wordr1[0];
405     w1[1] = wordl1[1] | wordr1[1];
406     w1[2] = wordl1[2] | wordr1[2];
407     w1[3] = wordl1[3] | wordr1[3];
408     w2[0] = wordl2[0] | wordr2[0];
409     w2[1] = wordl2[1] | wordr2[1];
410     w2[2] = wordl2[2] | wordr2[2];
411     w2[3] = wordl2[3] | wordr2[3];
412     w3[0] = wordl3[0] | wordr3[0];
413     w3[1] = wordl3[1] | wordr3[1];
414     w3[2] = wordl3[2] | wordr3[2];
415     w3[3] = wordl3[3] | wordr3[3];
416
417     /**
418      * prepend salt
419      */
420
421     const u32x pw_salt_len = pw_len + salt_len;
422
423     u32x w0_t[4];
424     u32x w1_t[4];
425     u32x w2_t[4];
426     u32x w3_t[4];
427
428     w0_t[0] = w0[0];
429     w0_t[1] = w0[1];
430     w0_t[2] = w0[2];
431     w0_t[3] = w0[3];
432     w1_t[0] = w1[0];
433     w1_t[1] = w1[1];
434     w1_t[2] = w1[2];
435     w1_t[3] = w1[3];
436     w2_t[0] = w2[0];
437     w2_t[1] = w2[1];
438     w2_t[2] = w2[2];
439     w2_t[3] = w2[3];
440     w3_t[0] = w3[0];
441     w3_t[1] = w3[1];
442     w3_t[2] = w3[2];
443     w3_t[3] = w3[3];
444
445     switch_buffer_by_offset_le (w0_t, w1_t, w2_t, w3_t, salt_len);
446
447     w0_t[0] |= salt_buf0[0];
448     w0_t[1] |= salt_buf0[1];
449     w0_t[2] |= salt_buf0[2];
450     w0_t[3] |= salt_buf0[3];
451     w1_t[0] |= salt_buf1[0];
452     w1_t[1] |= salt_buf1[1];
453     w1_t[2] |= salt_buf1[2];
454     w1_t[3] |= salt_buf1[3];
455
456     append_0x80_4x4 (w0_t, w1_t, w2_t, w3_t, pw_salt_len);
457
458     w3_t[3] = pw_salt_len * 8;
459
460     /**
461      * sha1
462      */
463
464     w0_t[0] = swap32 (w0_t[0]);
465     w0_t[1] = swap32 (w0_t[1]);
466     w0_t[2] = swap32 (w0_t[2]);
467     w0_t[3] = swap32 (w0_t[3]);
468     w1_t[0] = swap32 (w1_t[0]);
469     w1_t[1] = swap32 (w1_t[1]);
470     w1_t[2] = swap32 (w1_t[2]);
471     w1_t[3] = swap32 (w1_t[3]);
472     w2_t[0] = swap32 (w2_t[0]);
473     w2_t[1] = swap32 (w2_t[1]);
474     w2_t[2] = swap32 (w2_t[2]);
475     w2_t[3] = swap32 (w2_t[3]);
476     w3_t[0] = swap32 (w3_t[0]);
477     w3_t[1] = swap32 (w3_t[1]);
478     //w3_t[2] = swap32 (w3_t[2]);
479     //w3_t[3] = swap32 (w3_t[3]);
480
481     u32x a = SHA1M_A;
482     u32x b = SHA1M_B;
483     u32x c = SHA1M_C;
484     u32x d = SHA1M_D;
485     u32x e = SHA1M_E;
486
487     #undef K
488     #define K SHA1C00
489
490     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0_t[0]);
491     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t[1]);
492     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w0_t[2]);
493     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w0_t[3]);
494     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w1_t[0]);
495     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w1_t[1]);
496     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1_t[2]);
497     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1_t[3]);
498     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2_t[0]);
499     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w2_t[1]);
500     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w2_t[2]);
501     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w2_t[3]);
502     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w3_t[0]);
503     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3_t[1]);
504     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3_t[2]);
505     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w3_t[3]);
506     w0_t[0] = rotl32 ((w3_t[1] ^ w2_t[0] ^ w0_t[2] ^ w0_t[0]), 1u); SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t[0]);
507     w0_t[1] = rotl32 ((w3_t[2] ^ w2_t[1] ^ w0_t[3] ^ w0_t[1]), 1u); SHA1_STEP (SHA1_F0o, d, e, a, b, c, w0_t[1]);
508     w0_t[2] = rotl32 ((w3_t[3] ^ w2_t[2] ^ w1_t[0] ^ w0_t[2]), 1u); SHA1_STEP (SHA1_F0o, c, d, e, a, b, w0_t[2]);
509     w0_t[3] = rotl32 ((w0_t[0] ^ w2_t[3] ^ w1_t[1] ^ w0_t[3]), 1u); SHA1_STEP (SHA1_F0o, b, c, d, e, a, w0_t[3]);
510
511     #undef K
512     #define K SHA1C01
513
514     w1_t[0] = rotl32 ((w0_t[1] ^ w3_t[0] ^ w1_t[2] ^ w1_t[0]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1_t[0]);
515     w1_t[1] = rotl32 ((w0_t[2] ^ w3_t[1] ^ w1_t[3] ^ w1_t[1]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w1_t[1]);
516     w1_t[2] = rotl32 ((w0_t[3] ^ w3_t[2] ^ w2_t[0] ^ w1_t[2]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w1_t[2]);
517     w1_t[3] = rotl32 ((w1_t[0] ^ w3_t[3] ^ w2_t[1] ^ w1_t[3]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t[3]);
518     w2_t[0] = rotl32 ((w1_t[1] ^ w0_t[0] ^ w2_t[2] ^ w2_t[0]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t[0]);
519     w2_t[1] = rotl32 ((w1_t[2] ^ w0_t[1] ^ w2_t[3] ^ w2_t[1]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w2_t[1]);
520     w2_t[2] = rotl32 ((w1_t[3] ^ w0_t[2] ^ w3_t[0] ^ w2_t[2]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w2_t[2]);
521     w2_t[3] = rotl32 ((w2_t[0] ^ w0_t[3] ^ w3_t[1] ^ w2_t[3]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w2_t[3]);
522     w3_t[0] = rotl32 ((w2_t[1] ^ w1_t[0] ^ w3_t[2] ^ w3_t[0]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w3_t[0]);
523     w3_t[1] = rotl32 ((w2_t[2] ^ w1_t[1] ^ w3_t[3] ^ w3_t[1]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w3_t[1]);
524     w3_t[2] = rotl32 ((w2_t[3] ^ w1_t[2] ^ w0_t[0] ^ w3_t[2]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3_t[2]);
525     w3_t[3] = rotl32 ((w3_t[0] ^ w1_t[3] ^ w0_t[1] ^ w3_t[3]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w3_t[3]);
526     w0_t[0] = rotl32 ((w3_t[1] ^ w2_t[0] ^ w0_t[2] ^ w0_t[0]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0_t[0]);
527     w0_t[1] = rotl32 ((w3_t[2] ^ w2_t[1] ^ w0_t[3] ^ w0_t[1]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w0_t[1]);
528     w0_t[2] = rotl32 ((w3_t[3] ^ w2_t[2] ^ w1_t[0] ^ w0_t[2]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0_t[2]);
529     w0_t[3] = rotl32 ((w0_t[0] ^ w2_t[3] ^ w1_t[1] ^ w0_t[3]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w0_t[3]);
530     w1_t[0] = rotl32 ((w0_t[1] ^ w3_t[0] ^ w1_t[2] ^ w1_t[0]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w1_t[0]);
531     w1_t[1] = rotl32 ((w0_t[2] ^ w3_t[1] ^ w1_t[3] ^ w1_t[1]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w1_t[1]);
532     w1_t[2] = rotl32 ((w0_t[3] ^ w3_t[2] ^ w2_t[0] ^ w1_t[2]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t[2]);
533     w1_t[3] = rotl32 ((w1_t[0] ^ w3_t[3] ^ w2_t[1] ^ w1_t[3]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w1_t[3]);
534
535     #undef K
536     #define K SHA1C02
537
538     w2_t[0] = rotl32 ((w1_t[1] ^ w0_t[0] ^ w2_t[2] ^ w2_t[0]), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w2_t[0]);
539     w2_t[1] = rotl32 ((w1_t[2] ^ w0_t[1] ^ w2_t[3] ^ w2_t[1]), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w2_t[1]);
540     w2_t[2] = rotl32 ((w1_t[3] ^ w0_t[2] ^ w3_t[0] ^ w2_t[2]), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w2_t[2]);
541     w2_t[3] = rotl32 ((w2_t[0] ^ w0_t[3] ^ w3_t[1] ^ w2_t[3]), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w2_t[3]);
542     w3_t[0] = rotl32 ((w2_t[1] ^ w1_t[0] ^ w3_t[2] ^ w3_t[0]), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w3_t[0]);
543     w3_t[1] = rotl32 ((w2_t[2] ^ w1_t[1] ^ w3_t[3] ^ w3_t[1]), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w3_t[1]);
544     w3_t[2] = rotl32 ((w2_t[3] ^ w1_t[2] ^ w0_t[0] ^ w3_t[2]), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w3_t[2]);
545     w3_t[3] = rotl32 ((w3_t[0] ^ w1_t[3] ^ w0_t[1] ^ w3_t[3]), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w3_t[3]);
546     w0_t[0] = rotl32 ((w3_t[1] ^ w2_t[0] ^ w0_t[2] ^ w0_t[0]), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w0_t[0]);
547     w0_t[1] = rotl32 ((w3_t[2] ^ w2_t[1] ^ w0_t[3] ^ w0_t[1]), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w0_t[1]);
548     w0_t[2] = rotl32 ((w3_t[3] ^ w2_t[2] ^ w1_t[0] ^ w0_t[2]), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w0_t[2]);
549     w0_t[3] = rotl32 ((w0_t[0] ^ w2_t[3] ^ w1_t[1] ^ w0_t[3]), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w0_t[3]);
550     w1_t[0] = rotl32 ((w0_t[1] ^ w3_t[0] ^ w1_t[2] ^ w1_t[0]), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w1_t[0]);
551     w1_t[1] = rotl32 ((w0_t[2] ^ w3_t[1] ^ w1_t[3] ^ w1_t[1]), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w1_t[1]);
552     w1_t[2] = rotl32 ((w0_t[3] ^ w3_t[2] ^ w2_t[0] ^ w1_t[2]), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w1_t[2]);
553     w1_t[3] = rotl32 ((w1_t[0] ^ w3_t[3] ^ w2_t[1] ^ w1_t[3]), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w1_t[3]);
554     w2_t[0] = rotl32 ((w1_t[1] ^ w0_t[0] ^ w2_t[2] ^ w2_t[0]), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w2_t[0]);
555     w2_t[1] = rotl32 ((w1_t[2] ^ w0_t[1] ^ w2_t[3] ^ w2_t[1]), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w2_t[1]);
556     w2_t[2] = rotl32 ((w1_t[3] ^ w0_t[2] ^ w3_t[0] ^ w2_t[2]), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w2_t[2]);
557     w2_t[3] = rotl32 ((w2_t[0] ^ w0_t[3] ^ w3_t[1] ^ w2_t[3]), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w2_t[3]);
558
559     #undef K
560     #define K SHA1C03
561
562     w3_t[0] = rotl32 ((w2_t[1] ^ w1_t[0] ^ w3_t[2] ^ w3_t[0]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3_t[0]);
563     w3_t[1] = rotl32 ((w2_t[2] ^ w1_t[1] ^ w3_t[3] ^ w3_t[1]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w3_t[1]);
564     w3_t[2] = rotl32 ((w2_t[3] ^ w1_t[2] ^ w0_t[0] ^ w3_t[2]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t[2]);
565     w3_t[3] = rotl32 ((w3_t[0] ^ w1_t[3] ^ w0_t[1] ^ w3_t[3]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w3_t[3]);
566     w0_t[0] = rotl32 ((w3_t[1] ^ w2_t[0] ^ w0_t[2] ^ w0_t[0]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0_t[0]);
567     w0_t[1] = rotl32 ((w3_t[2] ^ w2_t[1] ^ w0_t[3] ^ w0_t[1]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w0_t[1]);
568     w0_t[2] = rotl32 ((w3_t[3] ^ w2_t[2] ^ w1_t[0] ^ w0_t[2]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w0_t[2]);
569     w0_t[3] = rotl32 ((w0_t[0] ^ w2_t[3] ^ w1_t[1] ^ w0_t[3]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0_t[3]);
570     w1_t[0] = rotl32 ((w0_t[1] ^ w3_t[0] ^ w1_t[2] ^ w1_t[0]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t[0]);
571     w1_t[1] = rotl32 ((w0_t[2] ^ w3_t[1] ^ w1_t[3] ^ w1_t[1]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w1_t[1]);
572     w1_t[2] = rotl32 ((w0_t[3] ^ w3_t[2] ^ w2_t[0] ^ w1_t[2]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1_t[2]);
573     w1_t[3] = rotl32 ((w1_t[0] ^ w3_t[3] ^ w2_t[1] ^ w1_t[3]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w1_t[3]);
574     w2_t[0] = rotl32 ((w1_t[1] ^ w0_t[0] ^ w2_t[2] ^ w2_t[0]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w2_t[0]);
575     w2_t[1] = rotl32 ((w1_t[2] ^ w0_t[1] ^ w2_t[3] ^ w2_t[1]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w2_t[1]);
576     w2_t[2] = rotl32 ((w1_t[3] ^ w0_t[2] ^ w3_t[0] ^ w2_t[2]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t[2]);
577     w2_t[3] = rotl32 ((w2_t[0] ^ w0_t[3] ^ w3_t[1] ^ w2_t[3]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w2_t[3]);
578     w3_t[0] = rotl32 ((w2_t[1] ^ w1_t[0] ^ w3_t[2] ^ w3_t[0]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w3_t[0]);
579
580     if (MATCHES_NONE_VS (e, e_rev)) continue;
581
582     w3_t[1] = rotl32 ((w2_t[2] ^ w1_t[1] ^ w3_t[3] ^ w3_t[1]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t[1]);
583     w3_t[2] = rotl32 ((w2_t[3] ^ w1_t[2] ^ w0_t[0] ^ w3_t[2]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w3_t[2]);
584     w3_t[3] = rotl32 ((w3_t[0] ^ w1_t[3] ^ w0_t[1] ^ w3_t[3]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w3_t[3]);
585
586     COMPARE_S_SIMD (d, e, c, b);
587   }
588 }
589
590 __kernel void m00120_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 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
591 {
592 }
593
594 __kernel void m00120_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 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
595 {
596 }