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