Initial commit
[hashcat.git] / nv / m04400_a0.cu
1 /**
2  * Author......: Jens Steube <jens.steube@gmail.com>
3  * License.....: MIT
4  */
5
6 #define _MD5_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 0
20 #define DGST_R1 3
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 #include "include/rp_gpu.h"
28 #include "rp_nv.c"
29
30 #ifdef  VECT_SIZE1
31 #define VECT_COMPARE_S "check_single_vect1_comp4.c"
32 #define VECT_COMPARE_M "check_multi_vect1_comp4.c"
33 #endif
34
35 #ifdef  VECT_SIZE2
36 #define VECT_COMPARE_S "check_single_vect2_comp4.c"
37 #define VECT_COMPARE_M "check_multi_vect2_comp4.c"
38 #endif
39
40 #ifdef  VECT_SIZE4
41 #define VECT_COMPARE_S "check_single_vect4_comp4.c"
42 #define VECT_COMPARE_M "check_multi_vect4_comp4.c"
43 #endif
44
45 #ifdef VECT_SIZE1
46 #define uint_to_hex_lower8(i) l_bin2asc[(i)]
47 #endif
48
49 #ifdef VECT_SIZE2
50 #define uint_to_hex_lower8(i) u32x (l_bin2asc[(i).x], l_bin2asc[(i).y])
51 #endif
52
53 #ifdef VECT_SIZE4
54 #define uint_to_hex_lower8(i) u32x (l_bin2asc[(i).x], l_bin2asc[(i).y], l_bin2asc[(i).z], l_bin2asc[(i).w])
55 #endif
56
57 __device__ __constant__ char c_bin2asc[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
58
59 __device__ __shared__ short l_bin2asc[256];
60
61 __device__ __constant__ gpu_rule_t c_rules[1024];
62
63 extern "C" __global__ void __launch_bounds__ (256, 1) m04400_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 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
64 {
65   /**
66    * modifier
67    */
68
69   const u32 lid = threadIdx.x;
70
71   /**
72    * base
73    */
74
75   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
76
77   u32x pw_buf0[4];
78
79   pw_buf0[0] = pws[gid].i[ 0];
80   pw_buf0[1] = pws[gid].i[ 1];
81   pw_buf0[2] = pws[gid].i[ 2];
82   pw_buf0[3] = pws[gid].i[ 3];
83
84   u32x pw_buf1[4];
85
86   pw_buf1[0] = pws[gid].i[ 4];
87   pw_buf1[1] = pws[gid].i[ 5];
88   pw_buf1[2] = pws[gid].i[ 6];
89   pw_buf1[3] = pws[gid].i[ 7];
90
91   const u32 pw_len = pws[gid].pw_len;
92
93   /**
94    * bin2asc table
95    */
96
97   l_bin2asc[lid] = c_bin2asc[(lid >> 0) & 15] << 8
98                  | c_bin2asc[(lid >> 4) & 15] << 0;
99
100   __syncthreads ();
101
102   if (gid >= gid_max) return;
103
104   /**
105    * loop
106    */
107
108   for (u32 il_pos = 0; il_pos < rules_cnt; il_pos++)
109   {
110     u32x w0[4];
111
112     w0[0] = pw_buf0[0];
113     w0[1] = pw_buf0[1];
114     w0[2] = pw_buf0[2];
115     w0[3] = pw_buf0[3];
116
117     u32x w1[4];
118
119     w1[0] = pw_buf1[0];
120     w1[1] = pw_buf1[1];
121     w1[2] = pw_buf1[2];
122     w1[3] = pw_buf1[3];
123
124     u32x w2[4];
125
126     w2[0] = 0;
127     w2[1] = 0;
128     w2[2] = 0;
129     w2[3] = 0;
130
131     u32x w3[4];
132
133     w3[0] = 0;
134     w3[1] = 0;
135     w3[2] = 0;
136     w3[3] = 0;
137
138     const u32 out_len = apply_rules (c_rules[il_pos].cmds, w0, w1, pw_len);
139
140     append_0x80_2 (w0, w1, out_len);
141
142     /**
143      * sha1
144      */
145
146     u32x w0_t = swap_workaround (w0[0]);
147     u32x w1_t = swap_workaround (w0[1]);
148     u32x w2_t = swap_workaround (w0[2]);
149     u32x w3_t = swap_workaround (w0[3]);
150     u32x w4_t = swap_workaround (w1[0]);
151     u32x w5_t = swap_workaround (w1[1]);
152     u32x w6_t = swap_workaround (w1[2]);
153     u32x w7_t = swap_workaround (w1[3]);
154     u32x w8_t = swap_workaround (w2[0]);
155     u32x w9_t = swap_workaround (w2[1]);
156     u32x wa_t = swap_workaround (w2[2]);
157     u32x wb_t = swap_workaround (w2[3]);
158     u32x wc_t = swap_workaround (w3[0]);
159     u32x wd_t = swap_workaround (w3[1]);
160     u32x we_t = 0;
161     u32x wf_t = out_len * 8;
162
163     u32x a = SHA1M_A;
164     u32x b = SHA1M_B;
165     u32x c = SHA1M_C;
166     u32x d = SHA1M_D;
167     u32x e = SHA1M_E;
168
169     #undef K
170     #define K SHA1C00
171
172     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0_t);
173     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1_t);
174     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w2_t);
175     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3_t);
176     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w4_t);
177     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w5_t);
178     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w6_t);
179     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w7_t);
180     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w8_t);
181     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w9_t);
182     SHA1_STEP (SHA1_F0o, a, b, c, d, e, wa_t);
183     SHA1_STEP (SHA1_F0o, e, a, b, c, d, wb_t);
184     SHA1_STEP (SHA1_F0o, d, e, a, b, c, wc_t);
185     SHA1_STEP (SHA1_F0o, c, d, e, a, b, wd_t);
186     SHA1_STEP (SHA1_F0o, b, c, d, e, a, we_t);
187     SHA1_STEP (SHA1_F0o, a, b, c, d, e, wf_t);
188     w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t);
189     w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1_t);
190     w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2_t);
191     w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3_t);
192
193     #undef K
194     #define K SHA1C01
195
196     w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w4_t);
197     w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w5_t);
198     w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w6_t);
199     w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w7_t);
200     w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w8_t);
201     w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w9_t);
202     wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wa_t);
203     wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wb_t);
204     wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wc_t);
205     wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wd_t);
206     we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, we_t);
207     wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wf_t);
208     w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0_t);
209     w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t);
210     w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t);
211     w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3_t);
212     w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w4_t);
213     w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w5_t);
214     w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w6_t);
215     w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w7_t);
216
217     #undef K
218     #define K SHA1C02
219
220     w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w8_t);
221     w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w9_t);
222     wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wa_t);
223     wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wb_t);
224     wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wc_t);
225     wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, wd_t);
226     we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, we_t);
227     wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wf_t);
228     w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w0_t);
229     w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w1_t);
230     w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w2_t);
231     w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w3_t);
232     w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w4_t);
233     w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w5_t);
234     w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w6_t);
235     w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w7_t);
236     w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w8_t);
237     w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w9_t);
238     wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wa_t);
239     wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wb_t);
240
241     #undef K
242     #define K SHA1C03
243
244     wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wc_t);
245     wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wd_t);
246     we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, we_t);
247     wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wf_t);
248     w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0_t);
249     w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1_t);
250     w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w2_t);
251     w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t);
252     w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w4_t);
253     w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w5_t);
254     w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w6_t);
255     w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w7_t);
256     w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w8_t);
257     w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w9_t);
258     wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wa_t);
259     wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wb_t);
260     wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wc_t);
261     wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd_t);
262     we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we_t);
263     wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf_t);
264
265     a += SHA1M_A;
266     b += SHA1M_B;
267     c += SHA1M_C;
268     d += SHA1M_D;
269     e += SHA1M_E;
270
271     /**
272      * md5
273      */
274
275     w0_t = uint_to_hex_lower8 ((a >> 24) & 255) <<  0
276          | uint_to_hex_lower8 ((a >> 16) & 255) << 16;
277     w1_t = uint_to_hex_lower8 ((a >>  8) & 255) <<  0
278          | uint_to_hex_lower8 ((a >>  0) & 255) << 16;
279     w2_t = uint_to_hex_lower8 ((b >> 24) & 255) <<  0
280          | uint_to_hex_lower8 ((b >> 16) & 255) << 16;
281     w3_t = uint_to_hex_lower8 ((b >>  8) & 255) <<  0
282          | uint_to_hex_lower8 ((b >>  0) & 255) << 16;
283     w4_t = uint_to_hex_lower8 ((c >> 24) & 255) <<  0
284          | uint_to_hex_lower8 ((c >> 16) & 255) << 16;
285     w5_t = uint_to_hex_lower8 ((c >>  8) & 255) <<  0
286          | uint_to_hex_lower8 ((c >>  0) & 255) << 16;
287     w6_t = uint_to_hex_lower8 ((d >> 24) & 255) <<  0
288          | uint_to_hex_lower8 ((d >> 16) & 255) << 16;
289     w7_t = uint_to_hex_lower8 ((d >>  8) & 255) <<  0
290          | uint_to_hex_lower8 ((d >>  0) & 255) << 16;
291     w8_t = uint_to_hex_lower8 ((e >> 24) & 255) <<  0
292          | uint_to_hex_lower8 ((e >> 16) & 255) << 16;
293     w9_t = uint_to_hex_lower8 ((e >>  8) & 255) <<  0
294          | uint_to_hex_lower8 ((e >>  0) & 255) << 16;
295
296     wa_t = 0x80;
297     wb_t = 0;
298     wc_t = 0;
299     wd_t = 0;
300     we_t = 40 * 8;
301     wf_t = 0;
302
303     a = MD5M_A;
304     b = MD5M_B;
305     c = MD5M_C;
306     d = MD5M_D;
307
308     MD5_STEP (MD5_Fo, a, b, c, d, w0_t, MD5C00, MD5S00);
309     MD5_STEP (MD5_Fo, d, a, b, c, w1_t, MD5C01, MD5S01);
310     MD5_STEP (MD5_Fo, c, d, a, b, w2_t, MD5C02, MD5S02);
311     MD5_STEP (MD5_Fo, b, c, d, a, w3_t, MD5C03, MD5S03);
312     MD5_STEP (MD5_Fo, a, b, c, d, w4_t, MD5C04, MD5S00);
313     MD5_STEP (MD5_Fo, d, a, b, c, w5_t, MD5C05, MD5S01);
314     MD5_STEP (MD5_Fo, c, d, a, b, w6_t, MD5C06, MD5S02);
315     MD5_STEP (MD5_Fo, b, c, d, a, w7_t, MD5C07, MD5S03);
316     MD5_STEP (MD5_Fo, a, b, c, d, w8_t, MD5C08, MD5S00);
317     MD5_STEP (MD5_Fo, d, a, b, c, w9_t, MD5C09, MD5S01);
318     MD5_STEP (MD5_Fo, c, d, a, b, wa_t, MD5C0a, MD5S02);
319     MD5_STEP (MD5_Fo, b, c, d, a, wb_t, MD5C0b, MD5S03);
320     MD5_STEP (MD5_Fo, a, b, c, d, wc_t, MD5C0c, MD5S00);
321     MD5_STEP (MD5_Fo, d, a, b, c, wd_t, MD5C0d, MD5S01);
322     MD5_STEP (MD5_Fo, c, d, a, b, we_t, MD5C0e, MD5S02);
323     MD5_STEP (MD5_Fo, b, c, d, a, wf_t, MD5C0f, MD5S03);
324
325     MD5_STEP (MD5_Go, a, b, c, d, w1_t, MD5C10, MD5S10);
326     MD5_STEP (MD5_Go, d, a, b, c, w6_t, MD5C11, MD5S11);
327     MD5_STEP (MD5_Go, c, d, a, b, wb_t, MD5C12, MD5S12);
328     MD5_STEP (MD5_Go, b, c, d, a, w0_t, MD5C13, MD5S13);
329     MD5_STEP (MD5_Go, a, b, c, d, w5_t, MD5C14, MD5S10);
330     MD5_STEP (MD5_Go, d, a, b, c, wa_t, MD5C15, MD5S11);
331     MD5_STEP (MD5_Go, c, d, a, b, wf_t, MD5C16, MD5S12);
332     MD5_STEP (MD5_Go, b, c, d, a, w4_t, MD5C17, MD5S13);
333     MD5_STEP (MD5_Go, a, b, c, d, w9_t, MD5C18, MD5S10);
334     MD5_STEP (MD5_Go, d, a, b, c, we_t, MD5C19, MD5S11);
335     MD5_STEP (MD5_Go, c, d, a, b, w3_t, MD5C1a, MD5S12);
336     MD5_STEP (MD5_Go, b, c, d, a, w8_t, MD5C1b, MD5S13);
337     MD5_STEP (MD5_Go, a, b, c, d, wd_t, MD5C1c, MD5S10);
338     MD5_STEP (MD5_Go, d, a, b, c, w2_t, MD5C1d, MD5S11);
339     MD5_STEP (MD5_Go, c, d, a, b, w7_t, MD5C1e, MD5S12);
340     MD5_STEP (MD5_Go, b, c, d, a, wc_t, MD5C1f, MD5S13);
341
342     MD5_STEP (MD5_H , a, b, c, d, w5_t, MD5C20, MD5S20);
343     MD5_STEP (MD5_H , d, a, b, c, w8_t, MD5C21, MD5S21);
344     MD5_STEP (MD5_H , c, d, a, b, wb_t, MD5C22, MD5S22);
345     MD5_STEP (MD5_H , b, c, d, a, we_t, MD5C23, MD5S23);
346     MD5_STEP (MD5_H , a, b, c, d, w1_t, MD5C24, MD5S20);
347     MD5_STEP (MD5_H , d, a, b, c, w4_t, MD5C25, MD5S21);
348     MD5_STEP (MD5_H , c, d, a, b, w7_t, MD5C26, MD5S22);
349     MD5_STEP (MD5_H , b, c, d, a, wa_t, MD5C27, MD5S23);
350     MD5_STEP (MD5_H , a, b, c, d, wd_t, MD5C28, MD5S20);
351     MD5_STEP (MD5_H , d, a, b, c, w0_t, MD5C29, MD5S21);
352     MD5_STEP (MD5_H , c, d, a, b, w3_t, MD5C2a, MD5S22);
353     MD5_STEP (MD5_H , b, c, d, a, w6_t, MD5C2b, MD5S23);
354     MD5_STEP (MD5_H , a, b, c, d, w9_t, MD5C2c, MD5S20);
355     MD5_STEP (MD5_H , d, a, b, c, wc_t, MD5C2d, MD5S21);
356     MD5_STEP (MD5_H , c, d, a, b, wf_t, MD5C2e, MD5S22);
357     MD5_STEP (MD5_H , b, c, d, a, w2_t, MD5C2f, MD5S23);
358
359     MD5_STEP (MD5_I , a, b, c, d, w0_t, MD5C30, MD5S30);
360     MD5_STEP (MD5_I , d, a, b, c, w7_t, MD5C31, MD5S31);
361     MD5_STEP (MD5_I , c, d, a, b, we_t, MD5C32, MD5S32);
362     MD5_STEP (MD5_I , b, c, d, a, w5_t, MD5C33, MD5S33);
363     MD5_STEP (MD5_I , a, b, c, d, wc_t, MD5C34, MD5S30);
364     MD5_STEP (MD5_I , d, a, b, c, w3_t, MD5C35, MD5S31);
365     MD5_STEP (MD5_I , c, d, a, b, wa_t, MD5C36, MD5S32);
366     MD5_STEP (MD5_I , b, c, d, a, w1_t, MD5C37, MD5S33);
367     MD5_STEP (MD5_I , a, b, c, d, w8_t, MD5C38, MD5S30);
368     MD5_STEP (MD5_I , d, a, b, c, wf_t, MD5C39, MD5S31);
369     MD5_STEP (MD5_I , c, d, a, b, w6_t, MD5C3a, MD5S32);
370     MD5_STEP (MD5_I , b, c, d, a, wd_t, MD5C3b, MD5S33);
371     MD5_STEP (MD5_I , a, b, c, d, w4_t, MD5C3c, MD5S30);
372     MD5_STEP (MD5_I , d, a, b, c, wb_t, MD5C3d, MD5S31);
373     MD5_STEP (MD5_I , c, d, a, b, w2_t, MD5C3e, MD5S32);
374     MD5_STEP (MD5_I , b, c, d, a, w9_t, MD5C3f, MD5S33);
375
376     const u32x r0 = a;
377     const u32x r1 = d;
378     const u32x r2 = c;
379     const u32x r3 = b;
380
381     #include VECT_COMPARE_M
382   }
383 }
384
385 extern "C" __global__ void __launch_bounds__ (256, 1) m04400_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 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
386 {
387 }
388
389 extern "C" __global__ void __launch_bounds__ (256, 1) m04400_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 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
390 {
391 }
392
393 extern "C" __global__ void __launch_bounds__ (256, 1) m04400_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 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
394 {
395   /**
396    * modifier
397    */
398
399   const u32 lid = threadIdx.x;
400
401   /**
402    * base
403    */
404
405   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
406
407   u32x pw_buf0[4];
408
409   pw_buf0[0] = pws[gid].i[ 0];
410   pw_buf0[1] = pws[gid].i[ 1];
411   pw_buf0[2] = pws[gid].i[ 2];
412   pw_buf0[3] = pws[gid].i[ 3];
413
414   u32x pw_buf1[4];
415
416   pw_buf1[0] = pws[gid].i[ 4];
417   pw_buf1[1] = pws[gid].i[ 5];
418   pw_buf1[2] = pws[gid].i[ 6];
419   pw_buf1[3] = pws[gid].i[ 7];
420
421   const u32 pw_len = pws[gid].pw_len;
422
423   /**
424    * bin2asc table
425    */
426
427   l_bin2asc[lid] = c_bin2asc[(lid >> 0) & 15] << 8
428                  | c_bin2asc[(lid >> 4) & 15] << 0;
429
430   __syncthreads ();
431
432   if (gid >= gid_max) return;
433
434   /**
435    * digest
436    */
437
438   const u32 search[4] =
439   {
440     digests_buf[digests_offset].digest_buf[DGST_R0],
441     digests_buf[digests_offset].digest_buf[DGST_R1],
442     digests_buf[digests_offset].digest_buf[DGST_R2],
443     digests_buf[digests_offset].digest_buf[DGST_R3]
444   };
445
446   /**
447    * loop
448    */
449
450   for (u32 il_pos = 0; il_pos < rules_cnt; il_pos++)
451   {
452     u32x w0[4];
453
454     w0[0] = pw_buf0[0];
455     w0[1] = pw_buf0[1];
456     w0[2] = pw_buf0[2];
457     w0[3] = pw_buf0[3];
458
459     u32x w1[4];
460
461     w1[0] = pw_buf1[0];
462     w1[1] = pw_buf1[1];
463     w1[2] = pw_buf1[2];
464     w1[3] = pw_buf1[3];
465
466     u32x w2[4];
467
468     w2[0] = 0;
469     w2[1] = 0;
470     w2[2] = 0;
471     w2[3] = 0;
472
473     u32x w3[4];
474
475     w3[0] = 0;
476     w3[1] = 0;
477     w3[2] = 0;
478     w3[3] = 0;
479
480     const u32 out_len = apply_rules (c_rules[il_pos].cmds, w0, w1, pw_len);
481
482     append_0x80_2 (w0, w1, out_len);
483
484     /**
485      * sha1
486      */
487
488     u32x w0_t = swap_workaround (w0[0]);
489     u32x w1_t = swap_workaround (w0[1]);
490     u32x w2_t = swap_workaround (w0[2]);
491     u32x w3_t = swap_workaround (w0[3]);
492     u32x w4_t = swap_workaround (w1[0]);
493     u32x w5_t = swap_workaround (w1[1]);
494     u32x w6_t = swap_workaround (w1[2]);
495     u32x w7_t = swap_workaround (w1[3]);
496     u32x w8_t = swap_workaround (w2[0]);
497     u32x w9_t = swap_workaround (w2[1]);
498     u32x wa_t = swap_workaround (w2[2]);
499     u32x wb_t = swap_workaround (w2[3]);
500     u32x wc_t = swap_workaround (w3[0]);
501     u32x wd_t = swap_workaround (w3[1]);
502     u32x we_t = 0;
503     u32x wf_t = out_len * 8;
504
505     u32x a = SHA1M_A;
506     u32x b = SHA1M_B;
507     u32x c = SHA1M_C;
508     u32x d = SHA1M_D;
509     u32x e = SHA1M_E;
510
511     #undef K
512     #define K SHA1C00
513
514     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0_t);
515     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1_t);
516     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w2_t);
517     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3_t);
518     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w4_t);
519     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w5_t);
520     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w6_t);
521     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w7_t);
522     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w8_t);
523     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w9_t);
524     SHA1_STEP (SHA1_F0o, a, b, c, d, e, wa_t);
525     SHA1_STEP (SHA1_F0o, e, a, b, c, d, wb_t);
526     SHA1_STEP (SHA1_F0o, d, e, a, b, c, wc_t);
527     SHA1_STEP (SHA1_F0o, c, d, e, a, b, wd_t);
528     SHA1_STEP (SHA1_F0o, b, c, d, e, a, we_t);
529     SHA1_STEP (SHA1_F0o, a, b, c, d, e, wf_t);
530     w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t);
531     w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1_t);
532     w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2_t);
533     w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3_t);
534
535     #undef K
536     #define K SHA1C01
537
538     w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w4_t);
539     w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w5_t);
540     w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w6_t);
541     w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w7_t);
542     w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w8_t);
543     w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w9_t);
544     wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wa_t);
545     wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wb_t);
546     wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wc_t);
547     wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wd_t);
548     we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, we_t);
549     wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wf_t);
550     w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0_t);
551     w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t);
552     w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t);
553     w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3_t);
554     w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w4_t);
555     w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w5_t);
556     w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w6_t);
557     w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w7_t);
558
559     #undef K
560     #define K SHA1C02
561
562     w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w8_t);
563     w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w9_t);
564     wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wa_t);
565     wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wb_t);
566     wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wc_t);
567     wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, wd_t);
568     we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, we_t);
569     wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wf_t);
570     w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w0_t);
571     w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w1_t);
572     w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w2_t);
573     w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w3_t);
574     w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w4_t);
575     w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w5_t);
576     w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w6_t);
577     w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w7_t);
578     w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w8_t);
579     w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w9_t);
580     wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wa_t);
581     wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wb_t);
582
583     #undef K
584     #define K SHA1C03
585
586     wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wc_t);
587     wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wd_t);
588     we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, we_t);
589     wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wf_t);
590     w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0_t);
591     w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1_t);
592     w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w2_t);
593     w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t);
594     w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w4_t);
595     w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w5_t);
596     w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w6_t);
597     w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w7_t);
598     w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w8_t);
599     w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w9_t);
600     wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wa_t);
601     wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wb_t);
602     wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wc_t);
603     wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd_t);
604     we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we_t);
605     wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf_t);
606
607     a += SHA1M_A;
608     b += SHA1M_B;
609     c += SHA1M_C;
610     d += SHA1M_D;
611     e += SHA1M_E;
612
613     /**
614      * md5
615      */
616
617     w0_t = uint_to_hex_lower8 ((a >> 24) & 255) <<  0
618          | uint_to_hex_lower8 ((a >> 16) & 255) << 16;
619     w1_t = uint_to_hex_lower8 ((a >>  8) & 255) <<  0
620          | uint_to_hex_lower8 ((a >>  0) & 255) << 16;
621     w2_t = uint_to_hex_lower8 ((b >> 24) & 255) <<  0
622          | uint_to_hex_lower8 ((b >> 16) & 255) << 16;
623     w3_t = uint_to_hex_lower8 ((b >>  8) & 255) <<  0
624          | uint_to_hex_lower8 ((b >>  0) & 255) << 16;
625     w4_t = uint_to_hex_lower8 ((c >> 24) & 255) <<  0
626          | uint_to_hex_lower8 ((c >> 16) & 255) << 16;
627     w5_t = uint_to_hex_lower8 ((c >>  8) & 255) <<  0
628          | uint_to_hex_lower8 ((c >>  0) & 255) << 16;
629     w6_t = uint_to_hex_lower8 ((d >> 24) & 255) <<  0
630          | uint_to_hex_lower8 ((d >> 16) & 255) << 16;
631     w7_t = uint_to_hex_lower8 ((d >>  8) & 255) <<  0
632          | uint_to_hex_lower8 ((d >>  0) & 255) << 16;
633     w8_t = uint_to_hex_lower8 ((e >> 24) & 255) <<  0
634          | uint_to_hex_lower8 ((e >> 16) & 255) << 16;
635     w9_t = uint_to_hex_lower8 ((e >>  8) & 255) <<  0
636          | uint_to_hex_lower8 ((e >>  0) & 255) << 16;
637
638     wa_t = 0x80;
639     wb_t = 0;
640     wc_t = 0;
641     wd_t = 0;
642     we_t = 40 * 8;
643     wf_t = 0;
644
645     a = MD5M_A;
646     b = MD5M_B;
647     c = MD5M_C;
648     d = MD5M_D;
649
650     MD5_STEP (MD5_Fo, a, b, c, d, w0_t, MD5C00, MD5S00);
651     MD5_STEP (MD5_Fo, d, a, b, c, w1_t, MD5C01, MD5S01);
652     MD5_STEP (MD5_Fo, c, d, a, b, w2_t, MD5C02, MD5S02);
653     MD5_STEP (MD5_Fo, b, c, d, a, w3_t, MD5C03, MD5S03);
654     MD5_STEP (MD5_Fo, a, b, c, d, w4_t, MD5C04, MD5S00);
655     MD5_STEP (MD5_Fo, d, a, b, c, w5_t, MD5C05, MD5S01);
656     MD5_STEP (MD5_Fo, c, d, a, b, w6_t, MD5C06, MD5S02);
657     MD5_STEP (MD5_Fo, b, c, d, a, w7_t, MD5C07, MD5S03);
658     MD5_STEP (MD5_Fo, a, b, c, d, w8_t, MD5C08, MD5S00);
659     MD5_STEP (MD5_Fo, d, a, b, c, w9_t, MD5C09, MD5S01);
660     MD5_STEP (MD5_Fo, c, d, a, b, wa_t, MD5C0a, MD5S02);
661     MD5_STEP (MD5_Fo, b, c, d, a, wb_t, MD5C0b, MD5S03);
662     MD5_STEP (MD5_Fo, a, b, c, d, wc_t, MD5C0c, MD5S00);
663     MD5_STEP (MD5_Fo, d, a, b, c, wd_t, MD5C0d, MD5S01);
664     MD5_STEP (MD5_Fo, c, d, a, b, we_t, MD5C0e, MD5S02);
665     MD5_STEP (MD5_Fo, b, c, d, a, wf_t, MD5C0f, MD5S03);
666
667     MD5_STEP (MD5_Go, a, b, c, d, w1_t, MD5C10, MD5S10);
668     MD5_STEP (MD5_Go, d, a, b, c, w6_t, MD5C11, MD5S11);
669     MD5_STEP (MD5_Go, c, d, a, b, wb_t, MD5C12, MD5S12);
670     MD5_STEP (MD5_Go, b, c, d, a, w0_t, MD5C13, MD5S13);
671     MD5_STEP (MD5_Go, a, b, c, d, w5_t, MD5C14, MD5S10);
672     MD5_STEP (MD5_Go, d, a, b, c, wa_t, MD5C15, MD5S11);
673     MD5_STEP (MD5_Go, c, d, a, b, wf_t, MD5C16, MD5S12);
674     MD5_STEP (MD5_Go, b, c, d, a, w4_t, MD5C17, MD5S13);
675     MD5_STEP (MD5_Go, a, b, c, d, w9_t, MD5C18, MD5S10);
676     MD5_STEP (MD5_Go, d, a, b, c, we_t, MD5C19, MD5S11);
677     MD5_STEP (MD5_Go, c, d, a, b, w3_t, MD5C1a, MD5S12);
678     MD5_STEP (MD5_Go, b, c, d, a, w8_t, MD5C1b, MD5S13);
679     MD5_STEP (MD5_Go, a, b, c, d, wd_t, MD5C1c, MD5S10);
680     MD5_STEP (MD5_Go, d, a, b, c, w2_t, MD5C1d, MD5S11);
681     MD5_STEP (MD5_Go, c, d, a, b, w7_t, MD5C1e, MD5S12);
682     MD5_STEP (MD5_Go, b, c, d, a, wc_t, MD5C1f, MD5S13);
683
684     MD5_STEP (MD5_H , a, b, c, d, w5_t, MD5C20, MD5S20);
685     MD5_STEP (MD5_H , d, a, b, c, w8_t, MD5C21, MD5S21);
686     MD5_STEP (MD5_H , c, d, a, b, wb_t, MD5C22, MD5S22);
687     MD5_STEP (MD5_H , b, c, d, a, we_t, MD5C23, MD5S23);
688     MD5_STEP (MD5_H , a, b, c, d, w1_t, MD5C24, MD5S20);
689     MD5_STEP (MD5_H , d, a, b, c, w4_t, MD5C25, MD5S21);
690     MD5_STEP (MD5_H , c, d, a, b, w7_t, MD5C26, MD5S22);
691     MD5_STEP (MD5_H , b, c, d, a, wa_t, MD5C27, MD5S23);
692     MD5_STEP (MD5_H , a, b, c, d, wd_t, MD5C28, MD5S20);
693     MD5_STEP (MD5_H , d, a, b, c, w0_t, MD5C29, MD5S21);
694     MD5_STEP (MD5_H , c, d, a, b, w3_t, MD5C2a, MD5S22);
695     MD5_STEP (MD5_H , b, c, d, a, w6_t, MD5C2b, MD5S23);
696     MD5_STEP (MD5_H , a, b, c, d, w9_t, MD5C2c, MD5S20);
697     MD5_STEP (MD5_H , d, a, b, c, wc_t, MD5C2d, MD5S21);
698     MD5_STEP (MD5_H , c, d, a, b, wf_t, MD5C2e, MD5S22);
699     MD5_STEP (MD5_H , b, c, d, a, w2_t, MD5C2f, MD5S23);
700
701     MD5_STEP (MD5_I , a, b, c, d, w0_t, MD5C30, MD5S30);
702     MD5_STEP (MD5_I , d, a, b, c, w7_t, MD5C31, MD5S31);
703     MD5_STEP (MD5_I , c, d, a, b, we_t, MD5C32, MD5S32);
704     MD5_STEP (MD5_I , b, c, d, a, w5_t, MD5C33, MD5S33);
705     MD5_STEP (MD5_I , a, b, c, d, wc_t, MD5C34, MD5S30);
706     MD5_STEP (MD5_I , d, a, b, c, w3_t, MD5C35, MD5S31);
707     MD5_STEP (MD5_I , c, d, a, b, wa_t, MD5C36, MD5S32);
708     MD5_STEP (MD5_I , b, c, d, a, w1_t, MD5C37, MD5S33);
709     MD5_STEP (MD5_I , a, b, c, d, w8_t, MD5C38, MD5S30);
710     MD5_STEP (MD5_I , d, a, b, c, wf_t, MD5C39, MD5S31);
711     MD5_STEP (MD5_I , c, d, a, b, w6_t, MD5C3a, MD5S32);
712     MD5_STEP (MD5_I , b, c, d, a, wd_t, MD5C3b, MD5S33);
713     MD5_STEP (MD5_I , a, b, c, d, w4_t, MD5C3c, MD5S30);
714     MD5_STEP (MD5_I , d, a, b, c, wb_t, MD5C3d, MD5S31);
715     MD5_STEP (MD5_I , c, d, a, b, w2_t, MD5C3e, MD5S32);
716     MD5_STEP (MD5_I , b, c, d, a, w9_t, MD5C3f, MD5S33);
717
718     const u32x r0 = a;
719     const u32x r1 = d;
720     const u32x r2 = c;
721     const u32x r3 = b;
722
723     #include VECT_COMPARE_S
724   }
725 }
726
727 extern "C" __global__ void __launch_bounds__ (256, 1) m04400_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 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
728 {
729 }
730
731 extern "C" __global__ void __launch_bounds__ (256, 1) m04400_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 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
732 {
733 }