Initial commit
[hashcat.git] / nv / m04900_a3.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__ bf_t c_bfs[1024];
44
45 __device__ static void m04900m (u32x w0[4], u32x w1[4], u32x w2[4], u32x w3[4], const u32 pw_len, 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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset)
46 {
47   /**
48    * modifier
49    */
50
51   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
52   const u32 lid = threadIdx.x;
53
54   /**
55    * salt
56    */
57
58   u32 salt_buf0_t[4];
59
60   salt_buf0_t[0] = salt_bufs[salt_pos].salt_buf[0];
61   salt_buf0_t[1] = salt_bufs[salt_pos].salt_buf[1];
62   salt_buf0_t[2] = salt_bufs[salt_pos].salt_buf[2];
63   salt_buf0_t[3] = salt_bufs[salt_pos].salt_buf[3];
64
65   u32 salt_buf1_t[4];
66
67   salt_buf1_t[0] = salt_bufs[salt_pos].salt_buf[4];
68   salt_buf1_t[1] = salt_bufs[salt_pos].salt_buf[5];
69   salt_buf1_t[2] = salt_bufs[salt_pos].salt_buf[6];
70   salt_buf1_t[3] = salt_bufs[salt_pos].salt_buf[7];
71
72   u32 salt_buf2_t[4];
73
74   salt_buf2_t[0] = 0;
75   salt_buf2_t[1] = 0;
76   salt_buf2_t[2] = 0;
77   salt_buf2_t[3] = 0;
78
79   u32 salt_buf3_t[4];
80
81   salt_buf3_t[0] = 0;
82   salt_buf3_t[1] = 0;
83   salt_buf3_t[2] = 0;
84   salt_buf3_t[3] = 0;
85
86   const u32 salt_len = salt_bufs[salt_pos].salt_len;
87
88   const u32 pw_salt_len = salt_len + pw_len + salt_len;
89
90   // first we need to switch the right-hand salt to the correct position (2nd salt)
91
92   switch_buffer_by_offset (salt_buf0_t, salt_buf1_t, salt_buf2_t, salt_buf3_t, salt_len + pw_len);
93
94   u32 salt_buf0[4];
95
96   salt_buf0[0] = salt_bufs[salt_pos].salt_buf[0];
97   salt_buf0[1] = salt_bufs[salt_pos].salt_buf[1];
98   salt_buf0[2] = salt_bufs[salt_pos].salt_buf[2];
99   salt_buf0[3] = salt_bufs[salt_pos].salt_buf[3];
100
101   u32 salt_buf1[4];
102
103   salt_buf1[0] = salt_bufs[salt_pos].salt_buf[4];
104   salt_buf1[1] = salt_bufs[salt_pos].salt_buf[5];
105   salt_buf1[2] = salt_bufs[salt_pos].salt_buf[6];
106   salt_buf1[3] = salt_bufs[salt_pos].salt_buf[7];
107
108   u32 salt_buf2[4];
109
110   salt_buf2[0] = 0;
111   salt_buf2[1] = 0;
112   salt_buf2[2] = 0;
113   salt_buf2[3] = 0;
114
115   u32 salt_buf3[4];
116
117   salt_buf3[0] = 0;
118   salt_buf3[1] = 0;
119   salt_buf3[2] = 0;
120   salt_buf3[3] = 0;
121
122   // concatenate the 1st and 2nd instance of the salt
123
124   salt_buf0[0] |= salt_buf0_t[0];
125   salt_buf0[1] |= salt_buf0_t[1];
126   salt_buf0[2] |= salt_buf0_t[2];
127   salt_buf0[3] |= salt_buf0_t[3];
128
129   salt_buf1[0] |= salt_buf1_t[0];
130   salt_buf1[1] |= salt_buf1_t[1];
131   salt_buf1[2] |= salt_buf1_t[2];
132   salt_buf1[3] |= salt_buf1_t[3];
133
134   salt_buf2[0] |= salt_buf2_t[0];
135   salt_buf2[1] |= salt_buf2_t[1];
136   salt_buf2[2] |= salt_buf2_t[2];
137   salt_buf2[3] |= salt_buf2_t[3];
138
139   salt_buf3[0] |= salt_buf3_t[0];
140   salt_buf3[1] |= salt_buf3_t[1];
141   salt_buf3[2] |= salt_buf3_t[2];
142   salt_buf3[3] |= salt_buf3_t[3];
143
144   append_0x80_4 (salt_buf0, salt_buf1, salt_buf2, salt_buf3, pw_salt_len);
145
146   /**
147    * loop
148    */
149
150   u32x w0l = w0[0];
151
152   for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos++)
153   {
154     const u32 w0r = c_bfs[il_pos].i;
155
156     w0[0] = w0l | w0r;
157
158     u32x w0_t[4];
159
160     w0_t[0] = w0[0];
161     w0_t[1] = w0[1];
162     w0_t[2] = w0[2];
163     w0_t[3] = w0[3];
164
165     u32x w1_t[4];
166
167     w1_t[0] = w1[0];
168     w1_t[1] = w1[1];
169     w1_t[2] = w1[2];
170     w1_t[3] = w1[3];
171
172     u32x w2_t[4];
173
174     w2_t[0] = w2[0];
175     w2_t[1] = w2[1];
176     w2_t[2] = w2[2];
177     w2_t[3] = w2[3];
178
179     u32x w3_t[4];
180
181     w3_t[0] = w3[0];
182     w3_t[1] = w3[1];
183     w3_t[2] = w3[2];
184     w3_t[3] = w3[3];
185
186     /**
187      * put the password after the first salt but before the second salt
188      */
189
190     switch_buffer_by_offset (w0_t, w1_t, w2_t, w3_t, salt_len);
191
192     w0_t[0] |= salt_buf0[0];
193     w0_t[1] |= salt_buf0[1];
194     w0_t[2] |= salt_buf0[2];
195     w0_t[3] |= salt_buf0[3];
196     w1_t[0] |= salt_buf1[0];
197     w1_t[1] |= salt_buf1[1];
198     w1_t[2] |= salt_buf1[2];
199     w1_t[3] |= salt_buf1[3];
200     w2_t[0] |= salt_buf2[0];
201     w2_t[1] |= salt_buf2[1];
202     w2_t[2] |= salt_buf2[2];
203     w2_t[3] |= salt_buf2[3];
204     w3_t[0] |= salt_buf3[0];
205     w3_t[1] |= salt_buf3[1];
206     w3_t[2] |= salt_buf3[2];
207
208     u32x w0 = swap_workaround (w0_t[0]);
209     u32x w1 = swap_workaround (w0_t[1]);
210     u32x w2 = swap_workaround (w0_t[2]);
211     u32x w3 = swap_workaround (w0_t[3]);
212     u32x w4 = swap_workaround (w1_t[0]);
213     u32x w5 = swap_workaround (w1_t[1]);
214     u32x w6 = swap_workaround (w1_t[2]);
215     u32x w7 = swap_workaround (w1_t[3]);
216     u32x w8 = swap_workaround (w2_t[0]);
217     u32x w9 = swap_workaround (w2_t[1]);
218     u32x wa = swap_workaround (w2_t[2]);
219     u32x wb = swap_workaround (w2_t[3]);
220     u32x wc = swap_workaround (w3_t[0]);
221     u32x wd = swap_workaround (w3_t[1]);
222     u32x we = swap_workaround (w3_t[2]);
223     u32x wf = pw_salt_len * 8;
224
225     /**
226      * sha1
227      */
228
229     u32x a = SHA1M_A;
230     u32x b = SHA1M_B;
231     u32x c = SHA1M_C;
232     u32x d = SHA1M_D;
233     u32x e = SHA1M_E;
234
235     #undef K
236     #define K SHA1C00
237
238     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0);
239     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1);
240     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w2);
241     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3);
242     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w4);
243     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w5);
244     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w6);
245     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w7);
246     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w8);
247     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w9);
248     SHA1_STEP (SHA1_F0o, a, b, c, d, e, wa);
249     SHA1_STEP (SHA1_F0o, e, a, b, c, d, wb);
250     SHA1_STEP (SHA1_F0o, d, e, a, b, c, wc);
251     SHA1_STEP (SHA1_F0o, c, d, e, a, b, wd);
252     SHA1_STEP (SHA1_F0o, b, c, d, e, a, we);
253     SHA1_STEP (SHA1_F0o, a, b, c, d, e, wf);
254     w0 = rotl32 ((wd ^ w8 ^ w2 ^ w0), 1u); SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0);
255     w1 = rotl32 ((we ^ w9 ^ w3 ^ w1), 1u); SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1);
256     w2 = rotl32 ((wf ^ wa ^ w4 ^ w2), 1u); SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2);
257     w3 = rotl32 ((w0 ^ wb ^ w5 ^ w3), 1u); SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3);
258
259     #undef K
260     #define K SHA1C01
261
262     w4 = rotl32 ((w1 ^ wc ^ w6 ^ w4), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w4);
263     w5 = rotl32 ((w2 ^ wd ^ w7 ^ w5), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w5);
264     w6 = rotl32 ((w3 ^ we ^ w8 ^ w6), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w6);
265     w7 = rotl32 ((w4 ^ wf ^ w9 ^ w7), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w7);
266     w8 = rotl32 ((w5 ^ w0 ^ wa ^ w8), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w8);
267     w9 = rotl32 ((w6 ^ w1 ^ wb ^ w9), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w9);
268     wa = rotl32 ((w7 ^ w2 ^ wc ^ wa), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wa);
269     wb = rotl32 ((w8 ^ w3 ^ wd ^ wb), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wb);
270     wc = rotl32 ((w9 ^ w4 ^ we ^ wc), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wc);
271     wd = rotl32 ((wa ^ w5 ^ wf ^ wd), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wd);
272     we = rotl32 ((wb ^ w6 ^ w0 ^ we), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, we);
273     wf = rotl32 ((wc ^ w7 ^ w1 ^ wf), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wf);
274     w0 = rotl32 ((wd ^ w8 ^ w2 ^ w0), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0);
275     w1 = rotl32 ((we ^ w9 ^ w3 ^ w1), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1);
276     w2 = rotl32 ((wf ^ wa ^ w4 ^ w2), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2);
277     w3 = rotl32 ((w0 ^ wb ^ w5 ^ w3), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3);
278     w4 = rotl32 ((w1 ^ wc ^ w6 ^ w4), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w4);
279     w5 = rotl32 ((w2 ^ wd ^ w7 ^ w5), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w5);
280     w6 = rotl32 ((w3 ^ we ^ w8 ^ w6), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w6);
281     w7 = rotl32 ((w4 ^ wf ^ w9 ^ w7), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w7);
282
283     #undef K
284     #define K SHA1C02
285
286     w8 = rotl32 ((w5 ^ w0 ^ wa ^ w8), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w8);
287     w9 = rotl32 ((w6 ^ w1 ^ wb ^ w9), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w9);
288     wa = rotl32 ((w7 ^ w2 ^ wc ^ wa), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wa);
289     wb = rotl32 ((w8 ^ w3 ^ wd ^ wb), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wb);
290     wc = rotl32 ((w9 ^ w4 ^ we ^ wc), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wc);
291     wd = rotl32 ((wa ^ w5 ^ wf ^ wd), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, wd);
292     we = rotl32 ((wb ^ w6 ^ w0 ^ we), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, we);
293     wf = rotl32 ((wc ^ w7 ^ w1 ^ wf), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wf);
294     w0 = rotl32 ((wd ^ w8 ^ w2 ^ w0), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w0);
295     w1 = rotl32 ((we ^ w9 ^ w3 ^ w1), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w1);
296     w2 = rotl32 ((wf ^ wa ^ w4 ^ w2), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w2);
297     w3 = rotl32 ((w0 ^ wb ^ w5 ^ w3), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w3);
298     w4 = rotl32 ((w1 ^ wc ^ w6 ^ w4), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w4);
299     w5 = rotl32 ((w2 ^ wd ^ w7 ^ w5), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w5);
300     w6 = rotl32 ((w3 ^ we ^ w8 ^ w6), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w6);
301     w7 = rotl32 ((w4 ^ wf ^ w9 ^ w7), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w7);
302     w8 = rotl32 ((w5 ^ w0 ^ wa ^ w8), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w8);
303     w9 = rotl32 ((w6 ^ w1 ^ wb ^ w9), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w9);
304     wa = rotl32 ((w7 ^ w2 ^ wc ^ wa), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wa);
305     wb = rotl32 ((w8 ^ w3 ^ wd ^ wb), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wb);
306
307     #undef K
308     #define K SHA1C03
309
310     wc = rotl32 ((w9 ^ w4 ^ we ^ wc), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wc);
311     wd = rotl32 ((wa ^ w5 ^ wf ^ wd), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wd);
312     we = rotl32 ((wb ^ w6 ^ w0 ^ we), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, we);
313     wf = rotl32 ((wc ^ w7 ^ w1 ^ wf), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wf);
314     w0 = rotl32 ((wd ^ w8 ^ w2 ^ w0), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0);
315     w1 = rotl32 ((we ^ w9 ^ w3 ^ w1), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1);
316     w2 = rotl32 ((wf ^ wa ^ w4 ^ w2), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w2);
317     w3 = rotl32 ((w0 ^ wb ^ w5 ^ w3), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3);
318     w4 = rotl32 ((w1 ^ wc ^ w6 ^ w4), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w4);
319     w5 = rotl32 ((w2 ^ wd ^ w7 ^ w5), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w5);
320     w6 = rotl32 ((w3 ^ we ^ w8 ^ w6), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w6);
321     w7 = rotl32 ((w4 ^ wf ^ w9 ^ w7), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w7);
322     w8 = rotl32 ((w5 ^ w0 ^ wa ^ w8), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w8);
323     w9 = rotl32 ((w6 ^ w1 ^ wb ^ w9), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w9);
324     wa = rotl32 ((w7 ^ w2 ^ wc ^ wa), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wa);
325     wb = rotl32 ((w8 ^ w3 ^ wd ^ wb), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wb);
326     wc = rotl32 ((w9 ^ w4 ^ we ^ wc), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wc);
327     wd = rotl32 ((wa ^ w5 ^ wf ^ wd), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd);
328     we = rotl32 ((wb ^ w6 ^ w0 ^ we), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we);
329     wf = rotl32 ((wc ^ w7 ^ w1 ^ wf), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf);
330
331     const u32x r0 = d;
332     const u32x r1 = e;
333     const u32x r2 = c;
334     const u32x r3 = b;
335
336     #include VECT_COMPARE_M
337   }
338 }
339
340 __device__ static void m04900s (u32x w0[4], u32x w1[4], u32x w2[4], u32x w3[4], const u32 pw_len, 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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset)
341 {
342   /**
343    * modifier
344    */
345
346   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
347   const u32 lid = threadIdx.x;
348
349   /**
350    * digest
351    */
352
353   const u32 search[4] =
354   {
355     digests_buf[digests_offset].digest_buf[DGST_R0],
356     digests_buf[digests_offset].digest_buf[DGST_R1],
357     digests_buf[digests_offset].digest_buf[DGST_R2],
358     digests_buf[digests_offset].digest_buf[DGST_R3]
359   };
360
361   /**
362    * reverse
363    */
364
365   const u32 e_rev = rotl32 (search[1], 2u);
366
367   /**
368    * salt
369    */
370
371   u32 salt_buf0_t[4];
372
373   salt_buf0_t[0] = salt_bufs[salt_pos].salt_buf[0];
374   salt_buf0_t[1] = salt_bufs[salt_pos].salt_buf[1];
375   salt_buf0_t[2] = salt_bufs[salt_pos].salt_buf[2];
376   salt_buf0_t[3] = salt_bufs[salt_pos].salt_buf[3];
377
378   u32 salt_buf1_t[4];
379
380   salt_buf1_t[0] = salt_bufs[salt_pos].salt_buf[4];
381   salt_buf1_t[1] = salt_bufs[salt_pos].salt_buf[5];
382   salt_buf1_t[2] = salt_bufs[salt_pos].salt_buf[6];
383   salt_buf1_t[3] = salt_bufs[salt_pos].salt_buf[7];
384
385   u32 salt_buf2_t[4];
386
387   salt_buf2_t[0] = 0;
388   salt_buf2_t[1] = 0;
389   salt_buf2_t[2] = 0;
390   salt_buf2_t[3] = 0;
391
392   u32 salt_buf3_t[4];
393
394   salt_buf3_t[0] = 0;
395   salt_buf3_t[1] = 0;
396   salt_buf3_t[2] = 0;
397   salt_buf3_t[3] = 0;
398
399   const u32 salt_len = salt_bufs[salt_pos].salt_len;
400
401   const u32 pw_salt_len = salt_len + pw_len + salt_len;
402
403   // first we need to switch the right-hand salt to the correct position (2nd salt)
404
405   switch_buffer_by_offset (salt_buf0_t, salt_buf1_t, salt_buf2_t, salt_buf3_t, salt_len + pw_len);
406
407   u32 salt_buf0[4];
408
409   salt_buf0[0] = salt_bufs[salt_pos].salt_buf[0];
410   salt_buf0[1] = salt_bufs[salt_pos].salt_buf[1];
411   salt_buf0[2] = salt_bufs[salt_pos].salt_buf[2];
412   salt_buf0[3] = salt_bufs[salt_pos].salt_buf[3];
413
414   u32 salt_buf1[4];
415
416   salt_buf1[0] = salt_bufs[salt_pos].salt_buf[4];
417   salt_buf1[1] = salt_bufs[salt_pos].salt_buf[5];
418   salt_buf1[2] = salt_bufs[salt_pos].salt_buf[6];
419   salt_buf1[3] = salt_bufs[salt_pos].salt_buf[7];
420
421   u32 salt_buf2[4];
422
423   salt_buf2[0] = 0;
424   salt_buf2[1] = 0;
425   salt_buf2[2] = 0;
426   salt_buf2[3] = 0;
427
428   u32 salt_buf3[4];
429
430   salt_buf3[0] = 0;
431   salt_buf3[1] = 0;
432   salt_buf3[2] = 0;
433   salt_buf3[3] = 0;
434
435   // concatenate the 1st and 2nd instance of the salt
436
437   salt_buf0[0] |= salt_buf0_t[0];
438   salt_buf0[1] |= salt_buf0_t[1];
439   salt_buf0[2] |= salt_buf0_t[2];
440   salt_buf0[3] |= salt_buf0_t[3];
441
442   salt_buf1[0] |= salt_buf1_t[0];
443   salt_buf1[1] |= salt_buf1_t[1];
444   salt_buf1[2] |= salt_buf1_t[2];
445   salt_buf1[3] |= salt_buf1_t[3];
446
447   salt_buf2[0] |= salt_buf2_t[0];
448   salt_buf2[1] |= salt_buf2_t[1];
449   salt_buf2[2] |= salt_buf2_t[2];
450   salt_buf2[3] |= salt_buf2_t[3];
451
452   salt_buf3[0] |= salt_buf3_t[0];
453   salt_buf3[1] |= salt_buf3_t[1];
454   salt_buf3[2] |= salt_buf3_t[2];
455   salt_buf3[3] |= salt_buf3_t[3];
456
457   append_0x80_4 (salt_buf0, salt_buf1, salt_buf2, salt_buf3, pw_salt_len);
458
459   /**
460    * loop
461    */
462
463   u32x w0l = w0[0];
464
465   for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos++)
466   {
467     const u32 w0r = c_bfs[il_pos].i;
468
469     w0[0] = w0l | w0r;
470
471     u32x w0_t[4];
472
473     w0_t[0] = w0[0];
474     w0_t[1] = w0[1];
475     w0_t[2] = w0[2];
476     w0_t[3] = w0[3];
477
478     u32x w1_t[4];
479
480     w1_t[0] = w1[0];
481     w1_t[1] = w1[1];
482     w1_t[2] = w1[2];
483     w1_t[3] = w1[3];
484
485     u32x w2_t[4];
486
487     w2_t[0] = w2[0];
488     w2_t[1] = w2[1];
489     w2_t[2] = w2[2];
490     w2_t[3] = w2[3];
491
492     u32x w3_t[4];
493
494     w3_t[0] = w3[0];
495     w3_t[1] = w3[1];
496     w3_t[2] = w3[2];
497     w3_t[3] = w3[3];
498
499     /**
500      * put the password after the first salt but before the second salt
501      */
502
503     switch_buffer_by_offset (w0_t, w1_t, w2_t, w3_t, salt_len);
504
505     w0_t[0] |= salt_buf0[0];
506     w0_t[1] |= salt_buf0[1];
507     w0_t[2] |= salt_buf0[2];
508     w0_t[3] |= salt_buf0[3];
509     w1_t[0] |= salt_buf1[0];
510     w1_t[1] |= salt_buf1[1];
511     w1_t[2] |= salt_buf1[2];
512     w1_t[3] |= salt_buf1[3];
513     w2_t[0] |= salt_buf2[0];
514     w2_t[1] |= salt_buf2[1];
515     w2_t[2] |= salt_buf2[2];
516     w2_t[3] |= salt_buf2[3];
517     w3_t[0] |= salt_buf3[0];
518     w3_t[1] |= salt_buf3[1];
519     w3_t[2] |= salt_buf3[2];
520
521     u32x w0 = swap_workaround (w0_t[0]);
522     u32x w1 = swap_workaround (w0_t[1]);
523     u32x w2 = swap_workaround (w0_t[2]);
524     u32x w3 = swap_workaround (w0_t[3]);
525     u32x w4 = swap_workaround (w1_t[0]);
526     u32x w5 = swap_workaround (w1_t[1]);
527     u32x w6 = swap_workaround (w1_t[2]);
528     u32x w7 = swap_workaround (w1_t[3]);
529     u32x w8 = swap_workaround (w2_t[0]);
530     u32x w9 = swap_workaround (w2_t[1]);
531     u32x wa = swap_workaround (w2_t[2]);
532     u32x wb = swap_workaround (w2_t[3]);
533     u32x wc = swap_workaround (w3_t[0]);
534     u32x wd = swap_workaround (w3_t[1]);
535     u32x we = swap_workaround (w3_t[2]);
536     u32x wf = pw_salt_len * 8;
537
538     /**
539      * sha1
540      */
541
542     u32x a = SHA1M_A;
543     u32x b = SHA1M_B;
544     u32x c = SHA1M_C;
545     u32x d = SHA1M_D;
546     u32x e = SHA1M_E;
547
548     #undef K
549     #define K SHA1C00
550
551     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0);
552     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1);
553     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w2);
554     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3);
555     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w4);
556     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w5);
557     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w6);
558     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w7);
559     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w8);
560     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w9);
561     SHA1_STEP (SHA1_F0o, a, b, c, d, e, wa);
562     SHA1_STEP (SHA1_F0o, e, a, b, c, d, wb);
563     SHA1_STEP (SHA1_F0o, d, e, a, b, c, wc);
564     SHA1_STEP (SHA1_F0o, c, d, e, a, b, wd);
565     SHA1_STEP (SHA1_F0o, b, c, d, e, a, we);
566     SHA1_STEP (SHA1_F0o, a, b, c, d, e, wf);
567     w0 = rotl32 ((wd ^ w8 ^ w2 ^ w0), 1u); SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0);
568     w1 = rotl32 ((we ^ w9 ^ w3 ^ w1), 1u); SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1);
569     w2 = rotl32 ((wf ^ wa ^ w4 ^ w2), 1u); SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2);
570     w3 = rotl32 ((w0 ^ wb ^ w5 ^ w3), 1u); SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3);
571
572     #undef K
573     #define K SHA1C01
574
575     w4 = rotl32 ((w1 ^ wc ^ w6 ^ w4), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w4);
576     w5 = rotl32 ((w2 ^ wd ^ w7 ^ w5), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w5);
577     w6 = rotl32 ((w3 ^ we ^ w8 ^ w6), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w6);
578     w7 = rotl32 ((w4 ^ wf ^ w9 ^ w7), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w7);
579     w8 = rotl32 ((w5 ^ w0 ^ wa ^ w8), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w8);
580     w9 = rotl32 ((w6 ^ w1 ^ wb ^ w9), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w9);
581     wa = rotl32 ((w7 ^ w2 ^ wc ^ wa), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wa);
582     wb = rotl32 ((w8 ^ w3 ^ wd ^ wb), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wb);
583     wc = rotl32 ((w9 ^ w4 ^ we ^ wc), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wc);
584     wd = rotl32 ((wa ^ w5 ^ wf ^ wd), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wd);
585     we = rotl32 ((wb ^ w6 ^ w0 ^ we), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, we);
586     wf = rotl32 ((wc ^ w7 ^ w1 ^ wf), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wf);
587     w0 = rotl32 ((wd ^ w8 ^ w2 ^ w0), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0);
588     w1 = rotl32 ((we ^ w9 ^ w3 ^ w1), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1);
589     w2 = rotl32 ((wf ^ wa ^ w4 ^ w2), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2);
590     w3 = rotl32 ((w0 ^ wb ^ w5 ^ w3), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3);
591     w4 = rotl32 ((w1 ^ wc ^ w6 ^ w4), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w4);
592     w5 = rotl32 ((w2 ^ wd ^ w7 ^ w5), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w5);
593     w6 = rotl32 ((w3 ^ we ^ w8 ^ w6), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w6);
594     w7 = rotl32 ((w4 ^ wf ^ w9 ^ w7), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w7);
595
596     #undef K
597     #define K SHA1C02
598
599     w8 = rotl32 ((w5 ^ w0 ^ wa ^ w8), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w8);
600     w9 = rotl32 ((w6 ^ w1 ^ wb ^ w9), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w9);
601     wa = rotl32 ((w7 ^ w2 ^ wc ^ wa), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wa);
602     wb = rotl32 ((w8 ^ w3 ^ wd ^ wb), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wb);
603     wc = rotl32 ((w9 ^ w4 ^ we ^ wc), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wc);
604     wd = rotl32 ((wa ^ w5 ^ wf ^ wd), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, wd);
605     we = rotl32 ((wb ^ w6 ^ w0 ^ we), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, we);
606     wf = rotl32 ((wc ^ w7 ^ w1 ^ wf), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wf);
607     w0 = rotl32 ((wd ^ w8 ^ w2 ^ w0), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w0);
608     w1 = rotl32 ((we ^ w9 ^ w3 ^ w1), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w1);
609     w2 = rotl32 ((wf ^ wa ^ w4 ^ w2), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w2);
610     w3 = rotl32 ((w0 ^ wb ^ w5 ^ w3), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w3);
611     w4 = rotl32 ((w1 ^ wc ^ w6 ^ w4), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w4);
612     w5 = rotl32 ((w2 ^ wd ^ w7 ^ w5), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w5);
613     w6 = rotl32 ((w3 ^ we ^ w8 ^ w6), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w6);
614     w7 = rotl32 ((w4 ^ wf ^ w9 ^ w7), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w7);
615     w8 = rotl32 ((w5 ^ w0 ^ wa ^ w8), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w8);
616     w9 = rotl32 ((w6 ^ w1 ^ wb ^ w9), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w9);
617     wa = rotl32 ((w7 ^ w2 ^ wc ^ wa), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wa);
618     wb = rotl32 ((w8 ^ w3 ^ wd ^ wb), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wb);
619
620     #undef K
621     #define K SHA1C03
622
623     wc = rotl32 ((w9 ^ w4 ^ we ^ wc), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wc);
624     wd = rotl32 ((wa ^ w5 ^ wf ^ wd), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wd);
625     we = rotl32 ((wb ^ w6 ^ w0 ^ we), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, we);
626     wf = rotl32 ((wc ^ w7 ^ w1 ^ wf), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wf);
627     w0 = rotl32 ((wd ^ w8 ^ w2 ^ w0), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0);
628     w1 = rotl32 ((we ^ w9 ^ w3 ^ w1), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1);
629     w2 = rotl32 ((wf ^ wa ^ w4 ^ w2), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w2);
630     w3 = rotl32 ((w0 ^ wb ^ w5 ^ w3), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3);
631     w4 = rotl32 ((w1 ^ wc ^ w6 ^ w4), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w4);
632     w5 = rotl32 ((w2 ^ wd ^ w7 ^ w5), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w5);
633     w6 = rotl32 ((w3 ^ we ^ w8 ^ w6), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w6);
634     w7 = rotl32 ((w4 ^ wf ^ w9 ^ w7), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w7);
635     w8 = rotl32 ((w5 ^ w0 ^ wa ^ w8), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w8);
636     w9 = rotl32 ((w6 ^ w1 ^ wb ^ w9), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w9);
637     wa = rotl32 ((w7 ^ w2 ^ wc ^ wa), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wa);
638     wb = rotl32 ((w8 ^ w3 ^ wd ^ wb), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wb);
639
640     if (e != e_rev) continue;
641
642     wc = rotl32 ((w9 ^ w4 ^ we ^ wc), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wc);
643     wd = rotl32 ((wa ^ w5 ^ wf ^ wd), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd);
644     we = rotl32 ((wb ^ w6 ^ w0 ^ we), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we);
645     wf = rotl32 ((wc ^ w7 ^ w1 ^ wf), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf);
646
647     const u32x r0 = d;
648     const u32x r1 = e;
649     const u32x r2 = c;
650     const u32x r3 = b;
651
652     #include VECT_COMPARE_S
653   }
654 }
655
656 extern "C" __global__ void __launch_bounds__ (256, 1) m04900_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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
657 {
658   /**
659    * base
660    */
661
662   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
663
664   if (gid >= gid_max) return;
665
666   u32x w0[4];
667
668   w0[0] = pws[gid].i[ 0];
669   w0[1] = pws[gid].i[ 1];
670   w0[2] = pws[gid].i[ 2];
671   w0[3] = pws[gid].i[ 3];
672
673   u32x w1[4];
674
675   w1[0] = 0;
676   w1[1] = 0;
677   w1[2] = 0;
678   w1[3] = 0;
679
680   u32x w2[4];
681
682   w2[0] = 0;
683   w2[1] = 0;
684   w2[2] = 0;
685   w2[3] = 0;
686
687   u32x w3[4];
688
689   w3[0] = 0;
690   w3[1] = 0;
691   w3[2] = pws[gid].i[14];
692   w3[3] = 0;
693
694   const u32 pw_len = pws[gid].pw_len;
695
696   /**
697    * main
698    */
699
700   m04900m (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, bfs_cnt, digests_cnt, digests_offset);
701 }
702
703 extern "C" __global__ void __launch_bounds__ (256, 1) m04900_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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
704 {
705   /**
706    * base
707    */
708
709   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
710
711   if (gid >= gid_max) return;
712
713   u32x w0[4];
714
715   w0[0] = pws[gid].i[ 0];
716   w0[1] = pws[gid].i[ 1];
717   w0[2] = pws[gid].i[ 2];
718   w0[3] = pws[gid].i[ 3];
719
720   u32x w1[4];
721
722   w1[0] = pws[gid].i[ 4];
723   w1[1] = pws[gid].i[ 5];
724   w1[2] = pws[gid].i[ 6];
725   w1[3] = pws[gid].i[ 7];
726
727   u32x w2[4];
728
729   w2[0] = 0;
730   w2[1] = 0;
731   w2[2] = 0;
732   w2[3] = 0;
733
734   u32x w3[4];
735
736   w3[0] = 0;
737   w3[1] = 0;
738   w3[2] = pws[gid].i[14];
739   w3[3] = 0;
740
741   const u32 pw_len = pws[gid].pw_len;
742
743   /**
744    * main
745    */
746
747   m04900m (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, bfs_cnt, digests_cnt, digests_offset);
748 }
749
750 extern "C" __global__ void __launch_bounds__ (256, 1) m04900_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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
751 {
752   /**
753    * base
754    */
755
756   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
757
758   if (gid >= gid_max) return;
759
760   u32x w0[4];
761
762   w0[0] = pws[gid].i[ 0];
763   w0[1] = pws[gid].i[ 1];
764   w0[2] = pws[gid].i[ 2];
765   w0[3] = pws[gid].i[ 3];
766
767   u32x w1[4];
768
769   w1[0] = pws[gid].i[ 4];
770   w1[1] = pws[gid].i[ 5];
771   w1[2] = pws[gid].i[ 6];
772   w1[3] = pws[gid].i[ 7];
773
774   u32x w2[4];
775
776   w2[0] = pws[gid].i[ 8];
777   w2[1] = pws[gid].i[ 9];
778   w2[2] = pws[gid].i[10];
779   w2[3] = pws[gid].i[11];
780
781   u32x w3[4];
782
783   w3[0] = pws[gid].i[12];
784   w3[1] = pws[gid].i[13];
785   w3[2] = pws[gid].i[14];
786   w3[3] = pws[gid].i[15];
787
788   const u32 pw_len = pws[gid].pw_len;
789
790   /**
791    * main
792    */
793
794   m04900m (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, bfs_cnt, digests_cnt, digests_offset);
795 }
796
797 extern "C" __global__ void __launch_bounds__ (256, 1) m04900_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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
798 {
799   /**
800    * base
801    */
802
803   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
804
805   if (gid >= gid_max) return;
806
807   u32x w0[4];
808
809   w0[0] = pws[gid].i[ 0];
810   w0[1] = pws[gid].i[ 1];
811   w0[2] = pws[gid].i[ 2];
812   w0[3] = pws[gid].i[ 3];
813
814   u32x w1[4];
815
816   w1[0] = 0;
817   w1[1] = 0;
818   w1[2] = 0;
819   w1[3] = 0;
820
821   u32x w2[4];
822
823   w2[0] = 0;
824   w2[1] = 0;
825   w2[2] = 0;
826   w2[3] = 0;
827
828   u32x w3[4];
829
830   w3[0] = 0;
831   w3[1] = 0;
832   w3[2] = pws[gid].i[14];
833   w3[3] = 0;
834
835   const u32 pw_len = pws[gid].pw_len;
836
837   /**
838    * main
839    */
840
841   m04900s (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, bfs_cnt, digests_cnt, digests_offset);
842 }
843
844 extern "C" __global__ void __launch_bounds__ (256, 1) m04900_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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
845 {
846   /**
847    * base
848    */
849
850   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
851
852   if (gid >= gid_max) return;
853
854   u32x w0[4];
855
856   w0[0] = pws[gid].i[ 0];
857   w0[1] = pws[gid].i[ 1];
858   w0[2] = pws[gid].i[ 2];
859   w0[3] = pws[gid].i[ 3];
860
861   u32x w1[4];
862
863   w1[0] = pws[gid].i[ 4];
864   w1[1] = pws[gid].i[ 5];
865   w1[2] = pws[gid].i[ 6];
866   w1[3] = pws[gid].i[ 7];
867
868   u32x w2[4];
869
870   w2[0] = 0;
871   w2[1] = 0;
872   w2[2] = 0;
873   w2[3] = 0;
874
875   u32x w3[4];
876
877   w3[0] = 0;
878   w3[1] = 0;
879   w3[2] = pws[gid].i[14];
880   w3[3] = 0;
881
882   const u32 pw_len = pws[gid].pw_len;
883
884   /**
885    * main
886    */
887
888   m04900s (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, bfs_cnt, digests_cnt, digests_offset);
889 }
890
891 extern "C" __global__ void __launch_bounds__ (256, 1) m04900_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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
892 {
893   /**
894    * base
895    */
896
897   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
898
899   if (gid >= gid_max) return;
900
901   u32x w0[4];
902
903   w0[0] = pws[gid].i[ 0];
904   w0[1] = pws[gid].i[ 1];
905   w0[2] = pws[gid].i[ 2];
906   w0[3] = pws[gid].i[ 3];
907
908   u32x w1[4];
909
910   w1[0] = pws[gid].i[ 4];
911   w1[1] = pws[gid].i[ 5];
912   w1[2] = pws[gid].i[ 6];
913   w1[3] = pws[gid].i[ 7];
914
915   u32x w2[4];
916
917   w2[0] = pws[gid].i[ 8];
918   w2[1] = pws[gid].i[ 9];
919   w2[2] = pws[gid].i[10];
920   w2[3] = pws[gid].i[11];
921
922   u32x w3[4];
923
924   w3[0] = pws[gid].i[12];
925   w3[1] = pws[gid].i[13];
926   w3[2] = pws[gid].i[14];
927   w3[3] = pws[gid].i[15];
928
929   const u32 pw_len = pws[gid].pw_len;
930
931   /**
932    * main
933    */
934
935   m04900s (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, bfs_cnt, digests_cnt, digests_offset);
936 }