Initial commit
[hashcat.git] / nv / m00120_a1.cu
1 /**
2  * Author......: Jens Steube <jens.steube@gmail.com>
3  * License.....: MIT
4  */
5
6 #define _SHA1_
7
8 #include "include/constants.h"
9 #include "include/kernel_vendor.h"
10
11 #ifdef  VLIW1
12 #define VECT_SIZE1
13 #endif
14
15 #ifdef  VLIW2
16 #define VECT_SIZE4
17 #endif
18
19 #define DGST_R0 3
20 #define DGST_R1 4
21 #define DGST_R2 2
22 #define DGST_R3 1
23
24 #include "include/kernel_functions.c"
25 #include "types_nv.c"
26 #include "common_nv.c"
27
28 #ifdef  VECT_SIZE1
29 #define VECT_COMPARE_S "check_single_vect1_comp4.c"
30 #define VECT_COMPARE_M "check_multi_vect1_comp4.c"
31 #endif
32
33 #ifdef  VECT_SIZE2
34 #define VECT_COMPARE_S "check_single_vect2_comp4.c"
35 #define VECT_COMPARE_M "check_multi_vect2_comp4.c"
36 #endif
37
38 #ifdef  VECT_SIZE4
39 #define VECT_COMPARE_S "check_single_vect4_comp4.c"
40 #define VECT_COMPARE_M "check_multi_vect4_comp4.c"
41 #endif
42
43 __device__ __constant__ comb_t c_combs[1024];
44
45 extern "C" __global__ void __launch_bounds__ (256, 1) m00120_m04 (const pw_t *pws, const gpu_rule_t *rules_buf, const comb_t *combs_buf, const bf_t *bfs_buf, const void *tmps, void *hooks, const u32 *bitmaps_buf_s1_a, const u32 *bitmaps_buf_s1_b, const u32 *bitmaps_buf_s1_c, const u32 *bitmaps_buf_s1_d, const u32 *bitmaps_buf_s2_a, const u32 *bitmaps_buf_s2_b, const u32 *bitmaps_buf_s2_c, const u32 *bitmaps_buf_s2_d, plain_t *plains_buf, const digest_t *digests_buf, u32 *hashes_shown, const salt_t *salt_bufs, const void *esalt_bufs, u32 *d_return_buf, 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)
46 {
47   /**
48    * modifier
49    */
50
51   const u32 lid = threadIdx.x;
52
53   /**
54    * base
55    */
56
57   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
58
59   if (gid >= gid_max) return;
60
61   u32x wordl0[4];
62
63   wordl0[0] = pws[gid].i[ 0];
64   wordl0[1] = pws[gid].i[ 1];
65   wordl0[2] = pws[gid].i[ 2];
66   wordl0[3] = pws[gid].i[ 3];
67
68   u32x wordl1[4];
69
70   wordl1[0] = pws[gid].i[ 4];
71   wordl1[1] = pws[gid].i[ 5];
72   wordl1[2] = pws[gid].i[ 6];
73   wordl1[3] = pws[gid].i[ 7];
74
75   u32x wordl2[4];
76
77   wordl2[0] = 0;
78   wordl2[1] = 0;
79   wordl2[2] = 0;
80   wordl2[3] = 0;
81
82   u32x wordl3[4];
83
84   wordl3[0] = 0;
85   wordl3[1] = 0;
86   wordl3[2] = 0;
87   wordl3[3] = 0;
88
89   const u32 pw_l_len = pws[gid].pw_len;
90
91   if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
92   {
93     switch_buffer_by_offset (wordl0, wordl1, wordl2, wordl3, c_combs[0].pw_len);
94   }
95
96   /**
97    * salt
98    */
99
100   u32 salt_buf0[4];
101
102   salt_buf0[0] = salt_bufs[salt_pos].salt_buf[0];
103   salt_buf0[1] = salt_bufs[salt_pos].salt_buf[1];
104   salt_buf0[2] = salt_bufs[salt_pos].salt_buf[2];
105   salt_buf0[3] = salt_bufs[salt_pos].salt_buf[3];
106
107   u32 salt_buf1[4];
108
109   salt_buf1[0] = salt_bufs[salt_pos].salt_buf[4];
110   salt_buf1[1] = salt_bufs[salt_pos].salt_buf[5];
111   salt_buf1[2] = salt_bufs[salt_pos].salt_buf[6];
112   salt_buf1[3] = salt_bufs[salt_pos].salt_buf[7];
113
114   const u32 salt_len = salt_bufs[salt_pos].salt_len;
115
116   /**
117    * loop
118    */
119
120   for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
121   {
122     const u32 pw_r_len = c_combs[il_pos].pw_len;
123
124     const u32 pw_len = pw_l_len + pw_r_len;
125
126     u32 wordr0[4];
127     u32 wordr1[4];
128     u32 wordr2[4];
129     u32 wordr3[4];
130
131     wordr0[0] = c_combs[il_pos].i[0];
132     wordr0[1] = c_combs[il_pos].i[1];
133     wordr0[2] = c_combs[il_pos].i[2];
134     wordr0[3] = c_combs[il_pos].i[3];
135     wordr1[0] = c_combs[il_pos].i[4];
136     wordr1[1] = c_combs[il_pos].i[5];
137     wordr1[2] = c_combs[il_pos].i[6];
138     wordr1[3] = c_combs[il_pos].i[7];
139     wordr2[0] = 0;
140     wordr2[1] = 0;
141     wordr2[2] = 0;
142     wordr2[3] = 0;
143     wordr3[0] = 0;
144     wordr3[1] = 0;
145     wordr3[2] = 0;
146     wordr3[3] = 0;
147
148     if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
149     {
150       switch_buffer_by_offset (wordr0, wordr1, wordr2, wordr3, pw_l_len);
151     }
152
153     u32x w0[4];
154     u32x w1[4];
155     u32x w2[4];
156     u32x w3[4];
157
158     w0[0] = wordl0[0] | wordr0[0];
159     w0[1] = wordl0[1] | wordr0[1];
160     w0[2] = wordl0[2] | wordr0[2];
161     w0[3] = wordl0[3] | wordr0[3];
162     w1[0] = wordl1[0] | wordr1[0];
163     w1[1] = wordl1[1] | wordr1[1];
164     w1[2] = wordl1[2] | wordr1[2];
165     w1[3] = wordl1[3] | wordr1[3];
166     w2[0] = wordl2[0] | wordr2[0];
167     w2[1] = wordl2[1] | wordr2[1];
168     w2[2] = wordl2[2] | wordr2[2];
169     w2[3] = wordl2[3] | wordr2[3];
170     w3[0] = wordl3[0] | wordr3[0];
171     w3[1] = wordl3[1] | wordr3[1];
172     w3[2] = wordl3[2] | wordr3[2];
173     w3[3] = wordl3[3] | wordr3[3];
174
175     /**
176      * prepend salt
177      */
178
179     const u32 pw_salt_len = pw_len + salt_len;
180
181     u32x w0_t[4];
182     u32x w1_t[4];
183     u32x w2_t[4];
184     u32x w3_t[4];
185
186     w0_t[0] = w0[0];
187     w0_t[1] = w0[1];
188     w0_t[2] = w0[2];
189     w0_t[3] = w0[3];
190     w1_t[0] = w1[0];
191     w1_t[1] = w1[1];
192     w1_t[2] = w1[2];
193     w1_t[3] = w1[3];
194     w2_t[0] = w2[0];
195     w2_t[1] = w2[1];
196     w2_t[2] = w2[2];
197     w2_t[3] = w2[3];
198     w3_t[0] = w3[0];
199     w3_t[1] = w3[1];
200     w3_t[2] = w3[2];
201     w3_t[3] = w3[3];
202
203     switch_buffer_by_offset (w0_t, w1_t, w2_t, w3_t, salt_len);
204
205     w0_t[0] |= salt_buf0[0];
206     w0_t[1] |= salt_buf0[1];
207     w0_t[2] |= salt_buf0[2];
208     w0_t[3] |= salt_buf0[3];
209     w1_t[0] |= salt_buf1[0];
210     w1_t[1] |= salt_buf1[1];
211     w1_t[2] |= salt_buf1[2];
212     w1_t[3] |= salt_buf1[3];
213
214     append_0x80_4 (w0_t, w1_t, w2_t, w3_t, pw_salt_len);
215
216     w3_t[3] = pw_salt_len * 8;
217
218     /**
219      * sha1
220      */
221
222     w0_t[0] = swap_workaround (w0_t[0]);
223     w0_t[1] = swap_workaround (w0_t[1]);
224     w0_t[2] = swap_workaround (w0_t[2]);
225     w0_t[3] = swap_workaround (w0_t[3]);
226     w1_t[0] = swap_workaround (w1_t[0]);
227     w1_t[1] = swap_workaround (w1_t[1]);
228     w1_t[2] = swap_workaround (w1_t[2]);
229     w1_t[3] = swap_workaround (w1_t[3]);
230     w2_t[0] = swap_workaround (w2_t[0]);
231     w2_t[1] = swap_workaround (w2_t[1]);
232     w2_t[2] = swap_workaround (w2_t[2]);
233     w2_t[3] = swap_workaround (w2_t[3]);
234     w3_t[0] = swap_workaround (w3_t[0]);
235     w3_t[1] = swap_workaround (w3_t[1]);
236     //w3_t[2] = swap_workaround (w3_t[2]);
237     //w3_t[3] = swap_workaround (w3_t[3]);
238
239     u32x a = SHA1M_A;
240     u32x b = SHA1M_B;
241     u32x c = SHA1M_C;
242     u32x d = SHA1M_D;
243     u32x e = SHA1M_E;
244
245     #undef K
246     #define K SHA1C00
247
248     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0_t[0]);
249     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t[1]);
250     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w0_t[2]);
251     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w0_t[3]);
252     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w1_t[0]);
253     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w1_t[1]);
254     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1_t[2]);
255     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1_t[3]);
256     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2_t[0]);
257     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w2_t[1]);
258     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w2_t[2]);
259     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w2_t[3]);
260     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w3_t[0]);
261     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3_t[1]);
262     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3_t[2]);
263     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w3_t[3]);
264     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]);
265     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]);
266     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]);
267     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]);
268
269     #undef K
270     #define K SHA1C01
271
272     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]);
273     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]);
274     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]);
275     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]);
276     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]);
277     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]);
278     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]);
279     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]);
280     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]);
281     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]);
282     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]);
283     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]);
284     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]);
285     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]);
286     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]);
287     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]);
288     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]);
289     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]);
290     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]);
291     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]);
292
293     #undef K
294     #define K SHA1C02
295
296     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]);
297     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]);
298     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]);
299     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]);
300     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]);
301     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]);
302     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]);
303     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]);
304     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]);
305     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]);
306     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]);
307     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]);
308     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]);
309     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]);
310     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]);
311     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]);
312     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]);
313     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]);
314     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]);
315     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]);
316
317     #undef K
318     #define K SHA1C03
319
320     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]);
321     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]);
322     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]);
323     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]);
324     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]);
325     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]);
326     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]);
327     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]);
328     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]);
329     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]);
330     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]);
331     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]);
332     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]);
333     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]);
334     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]);
335     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]);
336     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]);
337     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]);
338     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]);
339     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]);
340
341
342     const u32x r0 = d;
343     const u32x r1 = e;
344     const u32x r2 = c;
345     const u32x r3 = b;
346
347     #include VECT_COMPARE_M
348   }
349 }
350
351 extern "C" __global__ void __launch_bounds__ (256, 1) m00120_m08 (const pw_t *pws, const gpu_rule_t *rules_buf, const comb_t *combs_buf, const bf_t *bfs_buf, const void *tmps, void *hooks, const u32 *bitmaps_buf_s1_a, const u32 *bitmaps_buf_s1_b, const u32 *bitmaps_buf_s1_c, const u32 *bitmaps_buf_s1_d, const u32 *bitmaps_buf_s2_a, const u32 *bitmaps_buf_s2_b, const u32 *bitmaps_buf_s2_c, const u32 *bitmaps_buf_s2_d, plain_t *plains_buf, const digest_t *digests_buf, u32 *hashes_shown, const salt_t *salt_bufs, const void *esalt_bufs, u32 *d_return_buf, 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)
352 {
353 }
354
355 extern "C" __global__ void __launch_bounds__ (256, 1) m00120_m16 (const pw_t *pws, const gpu_rule_t *rules_buf, const comb_t *combs_buf, const bf_t *bfs_buf, const void *tmps, void *hooks, const u32 *bitmaps_buf_s1_a, const u32 *bitmaps_buf_s1_b, const u32 *bitmaps_buf_s1_c, const u32 *bitmaps_buf_s1_d, const u32 *bitmaps_buf_s2_a, const u32 *bitmaps_buf_s2_b, const u32 *bitmaps_buf_s2_c, const u32 *bitmaps_buf_s2_d, plain_t *plains_buf, const digest_t *digests_buf, u32 *hashes_shown, const salt_t *salt_bufs, const void *esalt_bufs, u32 *d_return_buf, 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)
356 {
357 }
358
359 extern "C" __global__ void __launch_bounds__ (256, 1) m00120_s04 (const pw_t *pws, const gpu_rule_t *rules_buf, const comb_t *combs_buf, const bf_t *bfs_buf, const void *tmps, void *hooks, const u32 *bitmaps_buf_s1_a, const u32 *bitmaps_buf_s1_b, const u32 *bitmaps_buf_s1_c, const u32 *bitmaps_buf_s1_d, const u32 *bitmaps_buf_s2_a, const u32 *bitmaps_buf_s2_b, const u32 *bitmaps_buf_s2_c, const u32 *bitmaps_buf_s2_d, plain_t *plains_buf, const digest_t *digests_buf, u32 *hashes_shown, const salt_t *salt_bufs, const void *esalt_bufs, u32 *d_return_buf, 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)
360 {
361   /**
362    * modifier
363    */
364
365   const u32 lid = threadIdx.x;
366
367   /**
368    * base
369    */
370
371   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
372
373   if (gid >= gid_max) return;
374
375   u32x wordl0[4];
376
377   wordl0[0] = pws[gid].i[ 0];
378   wordl0[1] = pws[gid].i[ 1];
379   wordl0[2] = pws[gid].i[ 2];
380   wordl0[3] = pws[gid].i[ 3];
381
382   u32x wordl1[4];
383
384   wordl1[0] = pws[gid].i[ 4];
385   wordl1[1] = pws[gid].i[ 5];
386   wordl1[2] = pws[gid].i[ 6];
387   wordl1[3] = pws[gid].i[ 7];
388
389   u32x wordl2[4];
390
391   wordl2[0] = 0;
392   wordl2[1] = 0;
393   wordl2[2] = 0;
394   wordl2[3] = 0;
395
396   u32x wordl3[4];
397
398   wordl3[0] = 0;
399   wordl3[1] = 0;
400   wordl3[2] = 0;
401   wordl3[3] = 0;
402
403   const u32 pw_l_len = pws[gid].pw_len;
404
405   if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
406   {
407     switch_buffer_by_offset (wordl0, wordl1, wordl2, wordl3, c_combs[0].pw_len);
408   }
409
410   /**
411    * salt
412    */
413
414   u32 salt_buf0[4];
415
416   salt_buf0[0] = salt_bufs[salt_pos].salt_buf[0];
417   salt_buf0[1] = salt_bufs[salt_pos].salt_buf[1];
418   salt_buf0[2] = salt_bufs[salt_pos].salt_buf[2];
419   salt_buf0[3] = salt_bufs[salt_pos].salt_buf[3];
420
421   u32 salt_buf1[4];
422
423   salt_buf1[0] = salt_bufs[salt_pos].salt_buf[4];
424   salt_buf1[1] = salt_bufs[salt_pos].salt_buf[5];
425   salt_buf1[2] = salt_bufs[salt_pos].salt_buf[6];
426   salt_buf1[3] = salt_bufs[salt_pos].salt_buf[7];
427
428   const u32 salt_len = salt_bufs[salt_pos].salt_len;
429
430   /**
431    * digest
432    */
433
434   const u32 search[4] =
435   {
436     digests_buf[digests_offset].digest_buf[DGST_R0],
437     digests_buf[digests_offset].digest_buf[DGST_R1],
438     digests_buf[digests_offset].digest_buf[DGST_R2],
439     digests_buf[digests_offset].digest_buf[DGST_R3]
440   };
441
442   /**
443    * reverse
444    */
445
446   const u32 e_rev = rotl32 (search[1], 2u);
447
448   /**
449    * loop
450    */
451
452   for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
453   {
454     const u32 pw_r_len = c_combs[il_pos].pw_len;
455
456     const u32 pw_len = pw_l_len + pw_r_len;
457
458     u32 wordr0[4];
459     u32 wordr1[4];
460     u32 wordr2[4];
461     u32 wordr3[4];
462
463     wordr0[0] = c_combs[il_pos].i[0];
464     wordr0[1] = c_combs[il_pos].i[1];
465     wordr0[2] = c_combs[il_pos].i[2];
466     wordr0[3] = c_combs[il_pos].i[3];
467     wordr1[0] = c_combs[il_pos].i[4];
468     wordr1[1] = c_combs[il_pos].i[5];
469     wordr1[2] = c_combs[il_pos].i[6];
470     wordr1[3] = c_combs[il_pos].i[7];
471     wordr2[0] = 0;
472     wordr2[1] = 0;
473     wordr2[2] = 0;
474     wordr2[3] = 0;
475     wordr3[0] = 0;
476     wordr3[1] = 0;
477     wordr3[2] = 0;
478     wordr3[3] = 0;
479
480     if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
481     {
482       switch_buffer_by_offset (wordr0, wordr1, wordr2, wordr3, pw_l_len);
483     }
484
485     u32x w0[4];
486     u32x w1[4];
487     u32x w2[4];
488     u32x w3[4];
489
490     w0[0] = wordl0[0] | wordr0[0];
491     w0[1] = wordl0[1] | wordr0[1];
492     w0[2] = wordl0[2] | wordr0[2];
493     w0[3] = wordl0[3] | wordr0[3];
494     w1[0] = wordl1[0] | wordr1[0];
495     w1[1] = wordl1[1] | wordr1[1];
496     w1[2] = wordl1[2] | wordr1[2];
497     w1[3] = wordl1[3] | wordr1[3];
498     w2[0] = wordl2[0] | wordr2[0];
499     w2[1] = wordl2[1] | wordr2[1];
500     w2[2] = wordl2[2] | wordr2[2];
501     w2[3] = wordl2[3] | wordr2[3];
502     w3[0] = wordl3[0] | wordr3[0];
503     w3[1] = wordl3[1] | wordr3[1];
504     w3[2] = wordl3[2] | wordr3[2];
505     w3[3] = wordl3[3] | wordr3[3];
506
507     /**
508      * prepend salt
509      */
510
511     const u32 pw_salt_len = pw_len + salt_len;
512
513     u32x w0_t[4];
514     u32x w1_t[4];
515     u32x w2_t[4];
516     u32x w3_t[4];
517
518     w0_t[0] = w0[0];
519     w0_t[1] = w0[1];
520     w0_t[2] = w0[2];
521     w0_t[3] = w0[3];
522     w1_t[0] = w1[0];
523     w1_t[1] = w1[1];
524     w1_t[2] = w1[2];
525     w1_t[3] = w1[3];
526     w2_t[0] = w2[0];
527     w2_t[1] = w2[1];
528     w2_t[2] = w2[2];
529     w2_t[3] = w2[3];
530     w3_t[0] = w3[0];
531     w3_t[1] = w3[1];
532     w3_t[2] = w3[2];
533     w3_t[3] = w3[3];
534
535     switch_buffer_by_offset (w0_t, w1_t, w2_t, w3_t, salt_len);
536
537     w0_t[0] |= salt_buf0[0];
538     w0_t[1] |= salt_buf0[1];
539     w0_t[2] |= salt_buf0[2];
540     w0_t[3] |= salt_buf0[3];
541     w1_t[0] |= salt_buf1[0];
542     w1_t[1] |= salt_buf1[1];
543     w1_t[2] |= salt_buf1[2];
544     w1_t[3] |= salt_buf1[3];
545
546     append_0x80_4 (w0_t, w1_t, w2_t, w3_t, pw_salt_len);
547
548     w3_t[3] = pw_salt_len * 8;
549
550     /**
551      * sha1
552      */
553
554     w0_t[0] = swap_workaround (w0_t[0]);
555     w0_t[1] = swap_workaround (w0_t[1]);
556     w0_t[2] = swap_workaround (w0_t[2]);
557     w0_t[3] = swap_workaround (w0_t[3]);
558     w1_t[0] = swap_workaround (w1_t[0]);
559     w1_t[1] = swap_workaround (w1_t[1]);
560     w1_t[2] = swap_workaround (w1_t[2]);
561     w1_t[3] = swap_workaround (w1_t[3]);
562     w2_t[0] = swap_workaround (w2_t[0]);
563     w2_t[1] = swap_workaround (w2_t[1]);
564     w2_t[2] = swap_workaround (w2_t[2]);
565     w2_t[3] = swap_workaround (w2_t[3]);
566     w3_t[0] = swap_workaround (w3_t[0]);
567     w3_t[1] = swap_workaround (w3_t[1]);
568     //w3_t[2] = swap_workaround (w3_t[2]);
569     //w3_t[3] = swap_workaround (w3_t[3]);
570
571     u32x a = SHA1M_A;
572     u32x b = SHA1M_B;
573     u32x c = SHA1M_C;
574     u32x d = SHA1M_D;
575     u32x e = SHA1M_E;
576
577     #undef K
578     #define K SHA1C00
579
580     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0_t[0]);
581     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t[1]);
582     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w0_t[2]);
583     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w0_t[3]);
584     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w1_t[0]);
585     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w1_t[1]);
586     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1_t[2]);
587     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1_t[3]);
588     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2_t[0]);
589     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w2_t[1]);
590     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w2_t[2]);
591     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w2_t[3]);
592     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w3_t[0]);
593     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3_t[1]);
594     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3_t[2]);
595     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w3_t[3]);
596     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]);
597     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]);
598     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]);
599     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]);
600
601     #undef K
602     #define K SHA1C01
603
604     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]);
605     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]);
606     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]);
607     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]);
608     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]);
609     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]);
610     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]);
611     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]);
612     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]);
613     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]);
614     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]);
615     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]);
616     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]);
617     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]);
618     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]);
619     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]);
620     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]);
621     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]);
622     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]);
623     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]);
624
625     #undef K
626     #define K SHA1C02
627
628     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]);
629     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]);
630     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]);
631     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]);
632     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]);
633     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]);
634     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]);
635     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]);
636     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]);
637     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]);
638     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]);
639     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]);
640     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]);
641     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]);
642     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]);
643     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]);
644     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]);
645     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]);
646     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]);
647     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]);
648
649     #undef K
650     #define K SHA1C03
651
652     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]);
653     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]);
654     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]);
655     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]);
656     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]);
657     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]);
658     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]);
659     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]);
660     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]);
661     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]);
662     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]);
663     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]);
664     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]);
665     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]);
666     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]);
667     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]);
668     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]);
669
670     if (e != e_rev) continue;
671
672     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]);
673     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]);
674     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]);
675
676
677     const u32x r0 = d;
678     const u32x r1 = e;
679     const u32x r2 = c;
680     const u32x r3 = b;
681
682     #include VECT_COMPARE_S
683   }
684 }
685
686 extern "C" __global__ void __launch_bounds__ (256, 1) m00120_s08 (const pw_t *pws, const gpu_rule_t *rules_buf, const comb_t *combs_buf, const bf_t *bfs_buf, const void *tmps, void *hooks, const u32 *bitmaps_buf_s1_a, const u32 *bitmaps_buf_s1_b, const u32 *bitmaps_buf_s1_c, const u32 *bitmaps_buf_s1_d, const u32 *bitmaps_buf_s2_a, const u32 *bitmaps_buf_s2_b, const u32 *bitmaps_buf_s2_c, const u32 *bitmaps_buf_s2_d, plain_t *plains_buf, const digest_t *digests_buf, u32 *hashes_shown, const salt_t *salt_bufs, const void *esalt_bufs, u32 *d_return_buf, 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)
687 {
688 }
689
690 extern "C" __global__ void __launch_bounds__ (256, 1) m00120_s16 (const pw_t *pws, const gpu_rule_t *rules_buf, const comb_t *combs_buf, const bf_t *bfs_buf, const void *tmps, void *hooks, const u32 *bitmaps_buf_s1_a, const u32 *bitmaps_buf_s1_b, const u32 *bitmaps_buf_s1_c, const u32 *bitmaps_buf_s1_d, const u32 *bitmaps_buf_s2_a, const u32 *bitmaps_buf_s2_b, const u32 *bitmaps_buf_s2_c, const u32 *bitmaps_buf_s2_d, plain_t *plains_buf, const digest_t *digests_buf, u32 *hashes_shown, const salt_t *salt_bufs, const void *esalt_bufs, u32 *d_return_buf, 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)
691 {
692 }