Initial commit
[hashcat.git] / nv / m00130_a3.cu
1 /**
2  * Author......: Jens Steube <jens.steube@gmail.com>
3  * License.....: MIT
4  */
5
6 #define _SHA1_
7 #define _SCALAR_
8
9 #include "include/constants.h"
10 #include "include/kernel_vendor.h"
11
12 #ifdef  VLIW1
13 #define VECT_SIZE1
14 #endif
15
16 #ifdef  VLIW2
17 #define VECT_SIZE4
18 #endif
19
20 #define DGST_R0 3
21 #define DGST_R1 4
22 #define DGST_R2 2
23 #define DGST_R3 1
24
25 #include "include/kernel_functions.c"
26 #include "types_nv.c"
27 #include "common_nv.c"
28
29 #ifdef  VECT_SIZE1
30 #define VECT_COMPARE_S "check_single_vect1_comp4_warp.c"
31 #define VECT_COMPARE_M "check_multi_vect1_comp4_warp.c"
32 #endif
33
34 #ifdef  VECT_SIZE2
35 #define VECT_COMPARE_S "check_single_vect2_comp4_warp.c"
36 #define VECT_COMPARE_M "check_multi_vect2_comp4_warp.c"
37 #endif
38
39 #ifdef  VECT_SIZE4
40 #define VECT_COMPARE_S "check_single_vect4_comp4_warp.c"
41 #define VECT_COMPARE_M "check_multi_vect4_comp4_warp.c"
42 #endif
43
44 __device__ __constant__ u32x c_bfs[1024];
45
46 __device__ static void m00130m (u32 w[16], const u32 pw_len, const pw_t *pws, const gpu_rule_t *rules_buf, const comb_t *combs_buf, const u32x *words_buf_r, 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)
47 {
48   /**
49    * modifier
50    */
51
52   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
53   const u32 lid = threadIdx.x;
54
55   /**
56    * salt
57    */
58
59   u32 salt_buf0[4];
60
61   salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
62   salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
63   salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
64   salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
65
66   u32 salt_buf1[4];
67
68   salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
69   salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
70   salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
71   salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
72
73   u32 salt_buf2[4];
74
75   salt_buf2[0] = salt_bufs[salt_pos].salt_buf[ 8];
76   salt_buf2[1] = 0;
77   salt_buf2[2] = 0;
78   salt_buf2[3] = 0;
79
80   u32 salt_buf3[4];
81
82   salt_buf3[0] = 0;
83   salt_buf3[1] = 0;
84   salt_buf3[2] = 0;
85   salt_buf3[3] = 0;
86
87   switch_buffer_by_offset (salt_buf0, salt_buf1, salt_buf2, salt_buf3, pw_len);
88
89   w[ 0] |= swap_workaround (salt_buf0[0]);
90   w[ 1] |= swap_workaround (salt_buf0[1]);
91   w[ 2] |= swap_workaround (salt_buf0[2]);
92   w[ 3] |= swap_workaround (salt_buf0[3]);
93   w[ 4] |= swap_workaround (salt_buf1[0]);
94   w[ 5] |= swap_workaround (salt_buf1[1]);
95   w[ 6] |= swap_workaround (salt_buf1[2]);
96   w[ 7] |= swap_workaround (salt_buf1[3]);
97   w[ 8] |= swap_workaround (salt_buf2[0]);
98   w[ 9] |= swap_workaround (salt_buf2[1]);
99   w[10] |= swap_workaround (salt_buf2[2]);
100   w[11] |= swap_workaround (salt_buf2[3]);
101   w[12] |= swap_workaround (salt_buf3[0]);
102   w[13] |= swap_workaround (salt_buf3[1]);
103   w[14] |= swap_workaround (salt_buf3[2]);
104   w[15] |= swap_workaround (salt_buf3[3]);
105
106   const u32 salt_len = salt_bufs[salt_pos].salt_len;
107
108   const u32 pw_salt_len = pw_len + salt_len;
109
110   w[15] = pw_salt_len * 8;
111
112   /**
113    * base
114    */
115
116   const u32 c_16s = rotl32 ((w[13] ^ w[ 8] ^ w[ 2]        ), 1u);
117   const u32 c_17s = rotl32 ((w[14] ^ w[ 9] ^ w[ 3] ^ w[ 1]), 1u);
118   const u32 c_18s = rotl32 ((w[15] ^ w[10] ^ w[ 4] ^ w[ 2]), 1u);
119   const u32 c_19s = rotl32 ((c_16s ^ w[11] ^ w[ 5] ^ w[ 3]), 1u);
120   const u32 c_20s = rotl32 ((c_17s ^ w[12] ^ w[ 6] ^ w[ 4]), 1u);
121   const u32 c_21s = rotl32 ((c_18s ^ w[13] ^ w[ 7] ^ w[ 5]), 1u);
122   const u32 c_22s = rotl32 ((c_19s ^ w[14] ^ w[ 8] ^ w[ 6]), 1u);
123   const u32 c_23s = rotl32 ((c_20s ^ w[15] ^ w[ 9] ^ w[ 7]), 1u);
124   const u32 c_24s = rotl32 ((c_21s ^ c_16s ^ w[10] ^ w[ 8]), 1u);
125   const u32 c_25s = rotl32 ((c_22s ^ c_17s ^ w[11] ^ w[ 9]), 1u);
126   const u32 c_26s = rotl32 ((c_23s ^ c_18s ^ w[12] ^ w[10]), 1u);
127   const u32 c_27s = rotl32 ((c_24s ^ c_19s ^ w[13] ^ w[11]), 1u);
128   const u32 c_28s = rotl32 ((c_25s ^ c_20s ^ w[14] ^ w[12]), 1u);
129   const u32 c_29s = rotl32 ((c_26s ^ c_21s ^ w[15] ^ w[13]), 1u);
130   const u32 c_30s = rotl32 ((c_27s ^ c_22s ^ c_16s ^ w[14]), 1u);
131   const u32 c_31s = rotl32 ((c_28s ^ c_23s ^ c_17s ^ w[15]), 1u);
132   const u32 c_32s = rotl32 ((c_29s ^ c_24s ^ c_18s ^ c_16s), 1u);
133   const u32 c_33s = rotl32 ((c_30s ^ c_25s ^ c_19s ^ c_17s), 1u);
134   const u32 c_34s = rotl32 ((c_31s ^ c_26s ^ c_20s ^ c_18s), 1u);
135   const u32 c_35s = rotl32 ((c_32s ^ c_27s ^ c_21s ^ c_19s), 1u);
136   const u32 c_36s = rotl32 ((c_33s ^ c_28s ^ c_22s ^ c_20s), 1u);
137   const u32 c_37s = rotl32 ((c_34s ^ c_29s ^ c_23s ^ c_21s), 1u);
138   const u32 c_38s = rotl32 ((c_35s ^ c_30s ^ c_24s ^ c_22s), 1u);
139   const u32 c_39s = rotl32 ((c_36s ^ c_31s ^ c_25s ^ c_23s), 1u);
140   const u32 c_40s = rotl32 ((c_37s ^ c_32s ^ c_26s ^ c_24s), 1u);
141   const u32 c_41s = rotl32 ((c_38s ^ c_33s ^ c_27s ^ c_25s), 1u);
142   const u32 c_42s = rotl32 ((c_39s ^ c_34s ^ c_28s ^ c_26s), 1u);
143   const u32 c_43s = rotl32 ((c_40s ^ c_35s ^ c_29s ^ c_27s), 1u);
144   const u32 c_44s = rotl32 ((c_41s ^ c_36s ^ c_30s ^ c_28s), 1u);
145   const u32 c_45s = rotl32 ((c_42s ^ c_37s ^ c_31s ^ c_29s), 1u);
146   const u32 c_46s = rotl32 ((c_43s ^ c_38s ^ c_32s ^ c_30s), 1u);
147   const u32 c_47s = rotl32 ((c_44s ^ c_39s ^ c_33s ^ c_31s), 1u);
148   const u32 c_48s = rotl32 ((c_45s ^ c_40s ^ c_34s ^ c_32s), 1u);
149   const u32 c_49s = rotl32 ((c_46s ^ c_41s ^ c_35s ^ c_33s), 1u);
150   const u32 c_50s = rotl32 ((c_47s ^ c_42s ^ c_36s ^ c_34s), 1u);
151   const u32 c_51s = rotl32 ((c_48s ^ c_43s ^ c_37s ^ c_35s), 1u);
152   const u32 c_52s = rotl32 ((c_49s ^ c_44s ^ c_38s ^ c_36s), 1u);
153   const u32 c_53s = rotl32 ((c_50s ^ c_45s ^ c_39s ^ c_37s), 1u);
154   const u32 c_54s = rotl32 ((c_51s ^ c_46s ^ c_40s ^ c_38s), 1u);
155   const u32 c_55s = rotl32 ((c_52s ^ c_47s ^ c_41s ^ c_39s), 1u);
156   const u32 c_56s = rotl32 ((c_53s ^ c_48s ^ c_42s ^ c_40s), 1u);
157   const u32 c_57s = rotl32 ((c_54s ^ c_49s ^ c_43s ^ c_41s), 1u);
158   const u32 c_58s = rotl32 ((c_55s ^ c_50s ^ c_44s ^ c_42s), 1u);
159   const u32 c_59s = rotl32 ((c_56s ^ c_51s ^ c_45s ^ c_43s), 1u);
160   const u32 c_60s = rotl32 ((c_57s ^ c_52s ^ c_46s ^ c_44s), 1u);
161   const u32 c_61s = rotl32 ((c_58s ^ c_53s ^ c_47s ^ c_45s), 1u);
162   const u32 c_62s = rotl32 ((c_59s ^ c_54s ^ c_48s ^ c_46s), 1u);
163   const u32 c_63s = rotl32 ((c_60s ^ c_55s ^ c_49s ^ c_47s), 1u);
164   const u32 c_64s = rotl32 ((c_61s ^ c_56s ^ c_50s ^ c_48s), 1u);
165   const u32 c_65s = rotl32 ((c_62s ^ c_57s ^ c_51s ^ c_49s), 1u);
166   const u32 c_66s = rotl32 ((c_63s ^ c_58s ^ c_52s ^ c_50s), 1u);
167   const u32 c_67s = rotl32 ((c_64s ^ c_59s ^ c_53s ^ c_51s), 1u);
168   const u32 c_68s = rotl32 ((c_65s ^ c_60s ^ c_54s ^ c_52s), 1u);
169   const u32 c_69s = rotl32 ((c_66s ^ c_61s ^ c_55s ^ c_53s), 1u);
170   const u32 c_70s = rotl32 ((c_67s ^ c_62s ^ c_56s ^ c_54s), 1u);
171   const u32 c_71s = rotl32 ((c_68s ^ c_63s ^ c_57s ^ c_55s), 1u);
172   const u32 c_72s = rotl32 ((c_69s ^ c_64s ^ c_58s ^ c_56s), 1u);
173   const u32 c_73s = rotl32 ((c_70s ^ c_65s ^ c_59s ^ c_57s), 1u);
174   const u32 c_74s = rotl32 ((c_71s ^ c_66s ^ c_60s ^ c_58s), 1u);
175   const u32 c_75s = rotl32 ((c_72s ^ c_67s ^ c_61s ^ c_59s), 1u);
176   const u32 c_76s = rotl32 ((c_73s ^ c_68s ^ c_62s ^ c_60s), 1u);
177   const u32 c_77s = rotl32 ((c_74s ^ c_69s ^ c_63s ^ c_61s), 1u);
178   const u32 c_78s = rotl32 ((c_75s ^ c_70s ^ c_64s ^ c_62s), 1u);
179   const u32 c_79s = rotl32 ((c_76s ^ c_71s ^ c_65s ^ c_63s), 1u);
180
181   const u32 c_17sK = c_17s + SHA1C00;
182   const u32 c_18sK = c_18s + SHA1C00;
183   const u32 c_20sK = c_20s + SHA1C01;
184   const u32 c_21sK = c_21s + SHA1C01;
185   const u32 c_23sK = c_23s + SHA1C01;
186   const u32 c_26sK = c_26s + SHA1C01;
187   const u32 c_27sK = c_27s + SHA1C01;
188   const u32 c_29sK = c_29s + SHA1C01;
189   const u32 c_33sK = c_33s + SHA1C01;
190   const u32 c_39sK = c_39s + SHA1C01;
191   const u32 c_41sK = c_41s + SHA1C02;
192   const u32 c_45sK = c_45s + SHA1C02;
193   const u32 c_53sK = c_53s + SHA1C02;
194   const u32 c_65sK = c_65s + SHA1C03;
195   const u32 c_69sK = c_69s + SHA1C03;
196
197   const u32 w1 = w[ 1] + SHA1C00;
198   const u32 w2 = w[ 2] + SHA1C00;
199   const u32 w3 = w[ 3] + SHA1C00;
200   const u32 w4 = w[ 4] + SHA1C00;
201   const u32 w5 = w[ 5] + SHA1C00;
202   const u32 w6 = w[ 6] + SHA1C00;
203   const u32 w7 = w[ 7] + SHA1C00;
204   const u32 w8 = w[ 8] + SHA1C00;
205   const u32 w9 = w[ 9] + SHA1C00;
206   const u32 wa = w[10] + SHA1C00;
207   const u32 wb = w[11] + SHA1C00;
208   const u32 wc = w[12] + SHA1C00;
209   const u32 wd = w[13] + SHA1C00;
210   const u32 we = w[14] + SHA1C00;
211   const u32 wf = w[15] + SHA1C00;
212
213  /**
214    * loop
215    */
216
217   const u32 bf_loops = ceil ((float) bfs_cnt / VECT_DIV);
218
219   u32x w0l = w[0];
220
221   for (u32 il_pos = 0; il_pos < bf_loops; il_pos++)
222   {
223     const u32x w0r = c_bfs[il_pos];
224
225     const u32x w0 = w0l | w0r;
226
227     const u32x w0s01 = rotl32 (w0, 1u);
228     const u32x w0s02 = rotl32 (w0, 2u);
229     const u32x w0s03 = rotl32 (w0, 3u);
230     const u32x w0s04 = rotl32 (w0, 4u);
231     const u32x w0s05 = rotl32 (w0, 5u);
232     const u32x w0s06 = rotl32 (w0, 6u);
233     const u32x w0s07 = rotl32 (w0, 7u);
234     const u32x w0s08 = rotl32 (w0, 8u);
235     const u32x w0s09 = rotl32 (w0, 9u);
236     const u32x w0s10 = rotl32 (w0, 10u);
237     const u32x w0s11 = rotl32 (w0, 11u);
238     const u32x w0s12 = rotl32 (w0, 12u);
239     const u32x w0s13 = rotl32 (w0, 13u);
240     const u32x w0s14 = rotl32 (w0, 14u);
241     const u32x w0s15 = rotl32 (w0, 15u);
242     const u32x w0s16 = rotl32 (w0, 16u);
243     const u32x w0s17 = rotl32 (w0, 17u);
244     const u32x w0s18 = rotl32 (w0, 18u);
245     const u32x w0s19 = rotl32 (w0, 19u);
246     const u32x w0s20 = rotl32 (w0, 20u);
247     const u32x w0s21 = rotl32 (w0, 21u);
248     const u32x w0s22 = rotl32 (w0, 22U);
249
250     const u32x w0s04___w0s06 = w0s04 ^ w0s06;
251     const u32x w0s04___w0s08 = w0s04 ^ w0s08;
252     const u32x w0s08___w0s12 = w0s08 ^ w0s12;
253     const u32x w0s04___w0s06___w0s07 = w0s04___w0s06 ^ w0s07;
254
255     u32x a = SHA1M_A;
256     u32x b = SHA1M_B;
257     u32x c = SHA1M_C;
258     u32x d = SHA1M_D;
259     u32x e = SHA1M_E;
260
261     #undef K
262     #define K SHA1C00
263
264     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0);
265     SHA1_STEPX(SHA1_F0o, e, a, b, c, d, w1);
266     SHA1_STEPX(SHA1_F0o, d, e, a, b, c, w2);
267     SHA1_STEPX(SHA1_F0o, c, d, e, a, b, w3);
268     SHA1_STEPX(SHA1_F0o, b, c, d, e, a, w4);
269     SHA1_STEPX(SHA1_F0o, a, b, c, d, e, w5);
270     SHA1_STEPX(SHA1_F0o, e, a, b, c, d, w6);
271     SHA1_STEPX(SHA1_F0o, d, e, a, b, c, w7);
272     SHA1_STEPX(SHA1_F0o, c, d, e, a, b, w8);
273     SHA1_STEPX(SHA1_F0o, b, c, d, e, a, w9);
274     SHA1_STEPX(SHA1_F0o, a, b, c, d, e, wa);
275     SHA1_STEPX(SHA1_F0o, e, a, b, c, d, wb);
276     SHA1_STEPX(SHA1_F0o, d, e, a, b, c, wc);
277     SHA1_STEPX(SHA1_F0o, c, d, e, a, b, wd);
278     SHA1_STEPX(SHA1_F0o, b, c, d, e, a, we);
279     SHA1_STEPX(SHA1_F0o, a, b, c, d, e, wf);
280
281     SHA1_STEP (SHA1_F0o, e, a, b, c, d, (c_16s ^ w0s01));
282     SHA1_STEPX(SHA1_F0o, d, e, a, b, c, (c_17sK));
283     SHA1_STEPX(SHA1_F0o, c, d, e, a, b, (c_18sK));
284     SHA1_STEP (SHA1_F0o, b, c, d, e, a, (c_19s ^ w0s02));
285
286     #undef K
287     #define K SHA1C01
288
289     SHA1_STEPX(SHA1_F1 , a, b, c, d, e, (c_20sK));
290     SHA1_STEPX(SHA1_F1 , e, a, b, c, d, (c_21sK));
291     SHA1_STEP (SHA1_F1 , d, e, a, b, c, (c_22s ^ w0s03));
292     SHA1_STEPX(SHA1_F1 , c, d, e, a, b, (c_23sK));
293     SHA1_STEP (SHA1_F1 , b, c, d, e, a, (c_24s ^ w0s02));
294     SHA1_STEP (SHA1_F1 , a, b, c, d, e, (c_25s ^ w0s04));
295     SHA1_STEPX(SHA1_F1 , e, a, b, c, d, (c_26sK));
296     SHA1_STEPX(SHA1_F1 , d, e, a, b, c, (c_27sK));
297     SHA1_STEP (SHA1_F1 , c, d, e, a, b, (c_28s ^ w0s05));
298     SHA1_STEPX(SHA1_F1 , b, c, d, e, a, (c_29sK));
299     SHA1_STEP (SHA1_F1 , a, b, c, d, e, (c_30s ^ w0s02 ^ w0s04));
300     SHA1_STEP (SHA1_F1 , e, a, b, c, d, (c_31s ^ w0s06));
301     SHA1_STEP (SHA1_F1 , d, e, a, b, c, (c_32s ^ w0s02 ^ w0s03));
302     SHA1_STEPX(SHA1_F1 , c, d, e, a, b, (c_33sK));
303     SHA1_STEP (SHA1_F1 , b, c, d, e, a, (c_34s ^ w0s07));
304     SHA1_STEP (SHA1_F1 , a, b, c, d, e, (c_35s ^ w0s04));
305     SHA1_STEP (SHA1_F1 , e, a, b, c, d, (c_36s ^ w0s04___w0s06));
306     SHA1_STEP (SHA1_F1 , d, e, a, b, c, (c_37s ^ w0s08));
307     SHA1_STEP (SHA1_F1 , c, d, e, a, b, (c_38s ^ w0s04));
308     SHA1_STEPX(SHA1_F1 , b, c, d, e, a, (c_39sK));
309
310     #undef K
311     #define K SHA1C02
312
313     SHA1_STEP (SHA1_F2o, a, b, c, d, e, (c_40s ^ w0s04 ^ w0s09));
314     SHA1_STEPX(SHA1_F2o, e, a, b, c, d, (c_41sK));
315     SHA1_STEP (SHA1_F2o, d, e, a, b, c, (c_42s ^ w0s06 ^ w0s08));
316     SHA1_STEP (SHA1_F2o, c, d, e, a, b, (c_43s ^ w0s10));
317     SHA1_STEP (SHA1_F2o, b, c, d, e, a, (c_44s ^ w0s03 ^ w0s06 ^ w0s07));
318     SHA1_STEPX(SHA1_F2o, a, b, c, d, e, (c_45sK));
319     SHA1_STEP (SHA1_F2o, e, a, b, c, d, (c_46s ^ w0s04 ^ w0s11));
320     SHA1_STEP (SHA1_F2o, d, e, a, b, c, (c_47s ^ w0s04___w0s08));
321     SHA1_STEP (SHA1_F2o, c, d, e, a, b, (c_48s ^ w0s03 ^ w0s04___w0s08 ^ w0s05 ^ w0s10));
322     SHA1_STEP (SHA1_F2o, b, c, d, e, a, (c_49s ^ w0s12));
323     SHA1_STEP (SHA1_F2o, a, b, c, d, e, (c_50s ^ w0s08));
324     SHA1_STEP (SHA1_F2o, e, a, b, c, d, (c_51s ^ w0s04___w0s06));
325     SHA1_STEP (SHA1_F2o, d, e, a, b, c, (c_52s ^ w0s04___w0s08 ^ w0s13));
326     SHA1_STEPX(SHA1_F2o, c, d, e, a, b, (c_53sK));
327     SHA1_STEP (SHA1_F2o, b, c, d, e, a, (c_54s ^ w0s07 ^ w0s10 ^ w0s12));
328     SHA1_STEP (SHA1_F2o, a, b, c, d, e, (c_55s ^ w0s14));
329     SHA1_STEP (SHA1_F2o, e, a, b, c, d, (c_56s ^ w0s04___w0s06___w0s07 ^ w0s10 ^ w0s11));
330     SHA1_STEP (SHA1_F2o, d, e, a, b, c, (c_57s ^ w0s08));
331     SHA1_STEP (SHA1_F2o, c, d, e, a, b, (c_58s ^ w0s04___w0s08 ^ w0s15));
332     SHA1_STEP (SHA1_F2o, b, c, d, e, a, (c_59s ^ w0s08___w0s12));
333
334     #undef K
335     #define K SHA1C03
336
337     SHA1_STEP (SHA1_F1 , a, b, c, d, e, (c_60s ^ w0s04 ^ w0s08___w0s12 ^ w0s07 ^ w0s14));
338     SHA1_STEP (SHA1_F1 , e, a, b, c, d, (c_61s ^ w0s16));
339     SHA1_STEP (SHA1_F1 , d, e, a, b, c, (c_62s ^ w0s04___w0s06 ^ w0s08___w0s12));
340     SHA1_STEP (SHA1_F1 , c, d, e, a, b, (c_63s ^ w0s08));
341     SHA1_STEP (SHA1_F1 , b, c, d, e, a, (c_64s ^ w0s04___w0s06___w0s07 ^ w0s08___w0s12 ^ w0s17));
342     SHA1_STEPX(SHA1_F1 , a, b, c, d, e, (c_65sK));
343     SHA1_STEP (SHA1_F1 , e, a, b, c, d, (c_66s ^ w0s14 ^ w0s16));
344     SHA1_STEP (SHA1_F1 , d, e, a, b, c, (c_67s ^ w0s08 ^ w0s18));
345     SHA1_STEP (SHA1_F1 , c, d, e, a, b, (c_68s ^ w0s11 ^ w0s14 ^ w0s15));
346     SHA1_STEPX(SHA1_F1 , b, c, d, e, a, (c_69sK));
347     SHA1_STEP (SHA1_F1 , a, b, c, d, e, (c_70s ^ w0s12 ^ w0s19));
348     SHA1_STEP (SHA1_F1 , e, a, b, c, d, (c_71s ^ w0s12 ^ w0s16));
349     SHA1_STEP (SHA1_F1 , d, e, a, b, c, (c_72s ^ w0s05 ^ w0s11 ^ w0s12 ^ w0s13 ^ w0s16 ^ w0s18));
350     SHA1_STEP (SHA1_F1 , c, d, e, a, b, (c_73s ^ w0s20));
351     SHA1_STEP (SHA1_F1 , b, c, d, e, a, (c_74s ^ w0s08 ^ w0s16));
352     SHA1_STEP (SHA1_F1 , a, b, c, d, e, (c_75s ^ w0s06 ^ w0s12 ^ w0s14));
353     SHA1_STEP (SHA1_F1 , e, a, b, c, d, (c_76s ^ w0s07 ^ w0s08___w0s12 ^ w0s16 ^ w0s21));
354     SHA1_STEP (SHA1_F1 , d, e, a, b, c, (c_77s));
355     SHA1_STEP (SHA1_F1 , c, d, e, a, b, (c_78s ^ w0s07 ^ w0s08 ^ w0s15 ^ w0s18 ^ w0s20));
356     SHA1_STEP (SHA1_F1 , b, c, d, e, a, (c_79s ^ w0s08 ^ w0s22));
357
358
359     const u32x r0 = d;
360     const u32x r1 = e;
361     const u32x r2 = c;
362     const u32x r3 = b;
363
364     #include VECT_COMPARE_M
365   }
366 }
367
368 __device__ static void m00130s (u32 w[16], const u32 pw_len, const pw_t *pws, const gpu_rule_t *rules_buf, const comb_t *combs_buf, const u32x *words_buf_r, 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)
369 {
370   /**
371    * modifier
372    */
373
374   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
375   const u32 lid = threadIdx.x;
376
377   /**
378    * base
379    */
380
381   const u32 c_16s = rotl32 ((w[13] ^ w[ 8] ^ w[ 2]        ), 1u);
382   const u32 c_17s = rotl32 ((w[14] ^ w[ 9] ^ w[ 3] ^ w[ 1]), 1u);
383   const u32 c_18s = rotl32 ((w[15] ^ w[10] ^ w[ 4] ^ w[ 2]), 1u);
384   const u32 c_19s = rotl32 ((c_16s ^ w[11] ^ w[ 5] ^ w[ 3]), 1u);
385   const u32 c_20s = rotl32 ((c_17s ^ w[12] ^ w[ 6] ^ w[ 4]), 1u);
386   const u32 c_21s = rotl32 ((c_18s ^ w[13] ^ w[ 7] ^ w[ 5]), 1u);
387   const u32 c_22s = rotl32 ((c_19s ^ w[14] ^ w[ 8] ^ w[ 6]), 1u);
388   const u32 c_23s = rotl32 ((c_20s ^ w[15] ^ w[ 9] ^ w[ 7]), 1u);
389   const u32 c_24s = rotl32 ((c_21s ^ c_16s ^ w[10] ^ w[ 8]), 1u);
390   const u32 c_25s = rotl32 ((c_22s ^ c_17s ^ w[11] ^ w[ 9]), 1u);
391   const u32 c_26s = rotl32 ((c_23s ^ c_18s ^ w[12] ^ w[10]), 1u);
392   const u32 c_27s = rotl32 ((c_24s ^ c_19s ^ w[13] ^ w[11]), 1u);
393   const u32 c_28s = rotl32 ((c_25s ^ c_20s ^ w[14] ^ w[12]), 1u);
394   const u32 c_29s = rotl32 ((c_26s ^ c_21s ^ w[15] ^ w[13]), 1u);
395   const u32 c_30s = rotl32 ((c_27s ^ c_22s ^ c_16s ^ w[14]), 1u);
396   const u32 c_31s = rotl32 ((c_28s ^ c_23s ^ c_17s ^ w[15]), 1u);
397   const u32 c_32s = rotl32 ((c_29s ^ c_24s ^ c_18s ^ c_16s), 1u);
398   const u32 c_33s = rotl32 ((c_30s ^ c_25s ^ c_19s ^ c_17s), 1u);
399   const u32 c_34s = rotl32 ((c_31s ^ c_26s ^ c_20s ^ c_18s), 1u);
400   const u32 c_35s = rotl32 ((c_32s ^ c_27s ^ c_21s ^ c_19s), 1u);
401   const u32 c_36s = rotl32 ((c_33s ^ c_28s ^ c_22s ^ c_20s), 1u);
402   const u32 c_37s = rotl32 ((c_34s ^ c_29s ^ c_23s ^ c_21s), 1u);
403   const u32 c_38s = rotl32 ((c_35s ^ c_30s ^ c_24s ^ c_22s), 1u);
404   const u32 c_39s = rotl32 ((c_36s ^ c_31s ^ c_25s ^ c_23s), 1u);
405   const u32 c_40s = rotl32 ((c_37s ^ c_32s ^ c_26s ^ c_24s), 1u);
406   const u32 c_41s = rotl32 ((c_38s ^ c_33s ^ c_27s ^ c_25s), 1u);
407   const u32 c_42s = rotl32 ((c_39s ^ c_34s ^ c_28s ^ c_26s), 1u);
408   const u32 c_43s = rotl32 ((c_40s ^ c_35s ^ c_29s ^ c_27s), 1u);
409   const u32 c_44s = rotl32 ((c_41s ^ c_36s ^ c_30s ^ c_28s), 1u);
410   const u32 c_45s = rotl32 ((c_42s ^ c_37s ^ c_31s ^ c_29s), 1u);
411   const u32 c_46s = rotl32 ((c_43s ^ c_38s ^ c_32s ^ c_30s), 1u);
412   const u32 c_47s = rotl32 ((c_44s ^ c_39s ^ c_33s ^ c_31s), 1u);
413   const u32 c_48s = rotl32 ((c_45s ^ c_40s ^ c_34s ^ c_32s), 1u);
414   const u32 c_49s = rotl32 ((c_46s ^ c_41s ^ c_35s ^ c_33s), 1u);
415   const u32 c_50s = rotl32 ((c_47s ^ c_42s ^ c_36s ^ c_34s), 1u);
416   const u32 c_51s = rotl32 ((c_48s ^ c_43s ^ c_37s ^ c_35s), 1u);
417   const u32 c_52s = rotl32 ((c_49s ^ c_44s ^ c_38s ^ c_36s), 1u);
418   const u32 c_53s = rotl32 ((c_50s ^ c_45s ^ c_39s ^ c_37s), 1u);
419   const u32 c_54s = rotl32 ((c_51s ^ c_46s ^ c_40s ^ c_38s), 1u);
420   const u32 c_55s = rotl32 ((c_52s ^ c_47s ^ c_41s ^ c_39s), 1u);
421   const u32 c_56s = rotl32 ((c_53s ^ c_48s ^ c_42s ^ c_40s), 1u);
422   const u32 c_57s = rotl32 ((c_54s ^ c_49s ^ c_43s ^ c_41s), 1u);
423   const u32 c_58s = rotl32 ((c_55s ^ c_50s ^ c_44s ^ c_42s), 1u);
424   const u32 c_59s = rotl32 ((c_56s ^ c_51s ^ c_45s ^ c_43s), 1u);
425   const u32 c_60s = rotl32 ((c_57s ^ c_52s ^ c_46s ^ c_44s), 1u);
426   const u32 c_61s = rotl32 ((c_58s ^ c_53s ^ c_47s ^ c_45s), 1u);
427   const u32 c_62s = rotl32 ((c_59s ^ c_54s ^ c_48s ^ c_46s), 1u);
428   const u32 c_63s = rotl32 ((c_60s ^ c_55s ^ c_49s ^ c_47s), 1u);
429   const u32 c_64s = rotl32 ((c_61s ^ c_56s ^ c_50s ^ c_48s), 1u);
430   const u32 c_65s = rotl32 ((c_62s ^ c_57s ^ c_51s ^ c_49s), 1u);
431   const u32 c_66s = rotl32 ((c_63s ^ c_58s ^ c_52s ^ c_50s), 1u);
432   const u32 c_67s = rotl32 ((c_64s ^ c_59s ^ c_53s ^ c_51s), 1u);
433   const u32 c_68s = rotl32 ((c_65s ^ c_60s ^ c_54s ^ c_52s), 1u);
434   const u32 c_69s = rotl32 ((c_66s ^ c_61s ^ c_55s ^ c_53s), 1u);
435   const u32 c_70s = rotl32 ((c_67s ^ c_62s ^ c_56s ^ c_54s), 1u);
436   const u32 c_71s = rotl32 ((c_68s ^ c_63s ^ c_57s ^ c_55s), 1u);
437   const u32 c_72s = rotl32 ((c_69s ^ c_64s ^ c_58s ^ c_56s), 1u);
438   const u32 c_73s = rotl32 ((c_70s ^ c_65s ^ c_59s ^ c_57s), 1u);
439   const u32 c_74s = rotl32 ((c_71s ^ c_66s ^ c_60s ^ c_58s), 1u);
440   const u32 c_75s = rotl32 ((c_72s ^ c_67s ^ c_61s ^ c_59s), 1u);
441
442   const u32 c_17sK = c_17s + SHA1C00;
443   const u32 c_18sK = c_18s + SHA1C00;
444   const u32 c_20sK = c_20s + SHA1C01;
445   const u32 c_21sK = c_21s + SHA1C01;
446   const u32 c_23sK = c_23s + SHA1C01;
447   const u32 c_26sK = c_26s + SHA1C01;
448   const u32 c_27sK = c_27s + SHA1C01;
449   const u32 c_29sK = c_29s + SHA1C01;
450   const u32 c_33sK = c_33s + SHA1C01;
451   const u32 c_39sK = c_39s + SHA1C01;
452   const u32 c_41sK = c_41s + SHA1C02;
453   const u32 c_45sK = c_45s + SHA1C02;
454   const u32 c_53sK = c_53s + SHA1C02;
455   const u32 c_65sK = c_65s + SHA1C03;
456   const u32 c_69sK = c_69s + SHA1C03;
457
458   const u32 w1 = w[ 1] + SHA1C00;
459   const u32 w2 = w[ 2] + SHA1C00;
460   const u32 w3 = w[ 3] + SHA1C00;
461   const u32 w4 = w[ 4] + SHA1C00;
462   const u32 w5 = w[ 5] + SHA1C00;
463   const u32 w6 = w[ 6] + SHA1C00;
464   const u32 w7 = w[ 7] + SHA1C00;
465   const u32 w8 = w[ 8] + SHA1C00;
466   const u32 w9 = w[ 9] + SHA1C00;
467   const u32 wa = w[10] + SHA1C00;
468   const u32 wb = w[11] + SHA1C00;
469   const u32 wc = w[12] + SHA1C00;
470   const u32 wd = w[13] + SHA1C00;
471   const u32 we = w[14] + SHA1C00;
472   const u32 wf = w[15] + SHA1C00;
473
474   /**
475    * digest
476    */
477
478   const u32 search[4] =
479   {
480     digests_buf[digests_offset].digest_buf[DGST_R0],
481     digests_buf[digests_offset].digest_buf[DGST_R1],
482     digests_buf[digests_offset].digest_buf[DGST_R2],
483     digests_buf[digests_offset].digest_buf[DGST_R3]
484   };
485
486   /**
487    * reverse
488    */
489
490   const u32 e_rev = rotl32 (search[1], 2u) - SHA1C03;
491
492  /**
493    * loop
494    */
495
496   const u32 bf_loops = ceil ((float) bfs_cnt / VECT_DIV);
497
498   u32x w0l = w[0];
499
500   for (u32 il_pos = 0; il_pos < bf_loops; il_pos++)
501   {
502     const u32x w0r = c_bfs[il_pos];
503
504     const u32x w0 = w0l | w0r;
505
506     const u32x w0s01 = rotl32 (w0, 1u);
507     const u32x w0s02 = rotl32 (w0, 2u);
508     const u32x w0s03 = rotl32 (w0, 3u);
509     const u32x w0s04 = rotl32 (w0, 4u);
510     const u32x w0s05 = rotl32 (w0, 5u);
511     const u32x w0s06 = rotl32 (w0, 6u);
512     const u32x w0s07 = rotl32 (w0, 7u);
513     const u32x w0s08 = rotl32 (w0, 8u);
514     const u32x w0s09 = rotl32 (w0, 9u);
515     const u32x w0s10 = rotl32 (w0, 10u);
516     const u32x w0s11 = rotl32 (w0, 11u);
517     const u32x w0s12 = rotl32 (w0, 12u);
518     const u32x w0s13 = rotl32 (w0, 13u);
519     const u32x w0s14 = rotl32 (w0, 14u);
520     const u32x w0s15 = rotl32 (w0, 15u);
521     const u32x w0s16 = rotl32 (w0, 16u);
522     const u32x w0s17 = rotl32 (w0, 17u);
523     const u32x w0s18 = rotl32 (w0, 18u);
524     const u32x w0s19 = rotl32 (w0, 19u);
525     const u32x w0s20 = rotl32 (w0, 20u);
526
527     const u32x w0s04___w0s06 = w0s04 ^ w0s06;
528     const u32x w0s04___w0s08 = w0s04 ^ w0s08;
529     const u32x w0s08___w0s12 = w0s08 ^ w0s12;
530     const u32x w0s04___w0s06___w0s07 = w0s04___w0s06 ^ w0s07;
531
532     u32x a = SHA1M_A;
533     u32x b = SHA1M_B;
534     u32x c = SHA1M_C;
535     u32x d = SHA1M_D;
536     u32x e = SHA1M_E;
537
538     #undef K
539     #define K SHA1C00
540
541     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0);
542     SHA1_STEPX(SHA1_F0o, e, a, b, c, d, w1);
543     SHA1_STEPX(SHA1_F0o, d, e, a, b, c, w2);
544     SHA1_STEPX(SHA1_F0o, c, d, e, a, b, w3);
545     SHA1_STEPX(SHA1_F0o, b, c, d, e, a, w4);
546     SHA1_STEPX(SHA1_F0o, a, b, c, d, e, w5);
547     SHA1_STEPX(SHA1_F0o, e, a, b, c, d, w6);
548     SHA1_STEPX(SHA1_F0o, d, e, a, b, c, w7);
549     SHA1_STEPX(SHA1_F0o, c, d, e, a, b, w8);
550     SHA1_STEPX(SHA1_F0o, b, c, d, e, a, w9);
551     SHA1_STEPX(SHA1_F0o, a, b, c, d, e, wa);
552     SHA1_STEPX(SHA1_F0o, e, a, b, c, d, wb);
553     SHA1_STEPX(SHA1_F0o, d, e, a, b, c, wc);
554     SHA1_STEPX(SHA1_F0o, c, d, e, a, b, wd);
555     SHA1_STEPX(SHA1_F0o, b, c, d, e, a, we);
556     SHA1_STEPX(SHA1_F0o, a, b, c, d, e, wf);
557
558     SHA1_STEP (SHA1_F0o, e, a, b, c, d, (c_16s ^ w0s01));
559     SHA1_STEPX(SHA1_F0o, d, e, a, b, c, (c_17sK));
560     SHA1_STEPX(SHA1_F0o, c, d, e, a, b, (c_18sK));
561     SHA1_STEP (SHA1_F0o, b, c, d, e, a, (c_19s ^ w0s02));
562
563     #undef K
564     #define K SHA1C01
565
566     SHA1_STEPX(SHA1_F1 , a, b, c, d, e, (c_20sK));
567     SHA1_STEPX(SHA1_F1 , e, a, b, c, d, (c_21sK));
568     SHA1_STEP (SHA1_F1 , d, e, a, b, c, (c_22s ^ w0s03));
569     SHA1_STEPX(SHA1_F1 , c, d, e, a, b, (c_23sK));
570     SHA1_STEP (SHA1_F1 , b, c, d, e, a, (c_24s ^ w0s02));
571     SHA1_STEP (SHA1_F1 , a, b, c, d, e, (c_25s ^ w0s04));
572     SHA1_STEPX(SHA1_F1 , e, a, b, c, d, (c_26sK));
573     SHA1_STEPX(SHA1_F1 , d, e, a, b, c, (c_27sK));
574     SHA1_STEP (SHA1_F1 , c, d, e, a, b, (c_28s ^ w0s05));
575     SHA1_STEPX(SHA1_F1 , b, c, d, e, a, (c_29sK));
576     SHA1_STEP (SHA1_F1 , a, b, c, d, e, (c_30s ^ w0s02 ^ w0s04));
577     SHA1_STEP (SHA1_F1 , e, a, b, c, d, (c_31s ^ w0s06));
578     SHA1_STEP (SHA1_F1 , d, e, a, b, c, (c_32s ^ w0s02 ^ w0s03));
579     SHA1_STEPX(SHA1_F1 , c, d, e, a, b, (c_33sK));
580     SHA1_STEP (SHA1_F1 , b, c, d, e, a, (c_34s ^ w0s07));
581     SHA1_STEP (SHA1_F1 , a, b, c, d, e, (c_35s ^ w0s04));
582     SHA1_STEP (SHA1_F1 , e, a, b, c, d, (c_36s ^ w0s04___w0s06));
583     SHA1_STEP (SHA1_F1 , d, e, a, b, c, (c_37s ^ w0s08));
584     SHA1_STEP (SHA1_F1 , c, d, e, a, b, (c_38s ^ w0s04));
585     SHA1_STEPX(SHA1_F1 , b, c, d, e, a, (c_39sK));
586
587     #undef K
588     #define K SHA1C02
589
590     SHA1_STEP (SHA1_F2o, a, b, c, d, e, (c_40s ^ w0s04 ^ w0s09));
591     SHA1_STEPX(SHA1_F2o, e, a, b, c, d, (c_41sK));
592     SHA1_STEP (SHA1_F2o, d, e, a, b, c, (c_42s ^ w0s06 ^ w0s08));
593     SHA1_STEP (SHA1_F2o, c, d, e, a, b, (c_43s ^ w0s10));
594     SHA1_STEP (SHA1_F2o, b, c, d, e, a, (c_44s ^ w0s03 ^ w0s06 ^ w0s07));
595     SHA1_STEPX(SHA1_F2o, a, b, c, d, e, (c_45sK));
596     SHA1_STEP (SHA1_F2o, e, a, b, c, d, (c_46s ^ w0s04 ^ w0s11));
597     SHA1_STEP (SHA1_F2o, d, e, a, b, c, (c_47s ^ w0s04___w0s08));
598     SHA1_STEP (SHA1_F2o, c, d, e, a, b, (c_48s ^ w0s03 ^ w0s04___w0s08 ^ w0s05 ^ w0s10));
599     SHA1_STEP (SHA1_F2o, b, c, d, e, a, (c_49s ^ w0s12));
600     SHA1_STEP (SHA1_F2o, a, b, c, d, e, (c_50s ^ w0s08));
601     SHA1_STEP (SHA1_F2o, e, a, b, c, d, (c_51s ^ w0s04___w0s06));
602     SHA1_STEP (SHA1_F2o, d, e, a, b, c, (c_52s ^ w0s04___w0s08 ^ w0s13));
603     SHA1_STEPX(SHA1_F2o, c, d, e, a, b, (c_53sK));
604     SHA1_STEP (SHA1_F2o, b, c, d, e, a, (c_54s ^ w0s07 ^ w0s10 ^ w0s12));
605     SHA1_STEP (SHA1_F2o, a, b, c, d, e, (c_55s ^ w0s14));
606     SHA1_STEP (SHA1_F2o, e, a, b, c, d, (c_56s ^ w0s04___w0s06___w0s07 ^ w0s10 ^ w0s11));
607     SHA1_STEP (SHA1_F2o, d, e, a, b, c, (c_57s ^ w0s08));
608     SHA1_STEP (SHA1_F2o, c, d, e, a, b, (c_58s ^ w0s04___w0s08 ^ w0s15));
609     SHA1_STEP (SHA1_F2o, b, c, d, e, a, (c_59s ^ w0s08___w0s12));
610
611     #undef K
612     #define K SHA1C03
613
614     SHA1_STEP (SHA1_F1 , a, b, c, d, e, (c_60s ^ w0s04 ^ w0s08___w0s12 ^ w0s07 ^ w0s14));
615     SHA1_STEP (SHA1_F1 , e, a, b, c, d, (c_61s ^ w0s16));
616     SHA1_STEP (SHA1_F1 , d, e, a, b, c, (c_62s ^ w0s04___w0s06 ^ w0s08___w0s12));
617     SHA1_STEP (SHA1_F1 , c, d, e, a, b, (c_63s ^ w0s08));
618     SHA1_STEP (SHA1_F1 , b, c, d, e, a, (c_64s ^ w0s04___w0s06___w0s07 ^ w0s08___w0s12 ^ w0s17));
619     SHA1_STEPX(SHA1_F1 , a, b, c, d, e, (c_65sK));
620     SHA1_STEP (SHA1_F1 , e, a, b, c, d, (c_66s ^ w0s14 ^ w0s16));
621     SHA1_STEP (SHA1_F1 , d, e, a, b, c, (c_67s ^ w0s08 ^ w0s18));
622     SHA1_STEP (SHA1_F1 , c, d, e, a, b, (c_68s ^ w0s11 ^ w0s14 ^ w0s15));
623     SHA1_STEPX(SHA1_F1 , b, c, d, e, a, (c_69sK));
624     SHA1_STEP (SHA1_F1 , a, b, c, d, e, (c_70s ^ w0s12 ^ w0s19));
625     SHA1_STEP (SHA1_F1 , e, a, b, c, d, (c_71s ^ w0s12 ^ w0s16));
626     SHA1_STEP (SHA1_F1 , d, e, a, b, c, (c_72s ^ w0s05 ^ w0s11 ^ w0s12 ^ w0s13 ^ w0s16 ^ w0s18));
627     SHA1_STEP (SHA1_F1 , c, d, e, a, b, (c_73s ^ w0s20));
628     SHA1_STEP (SHA1_F1 , b, c, d, e, a, (c_74s ^ w0s08 ^ w0s16));
629
630     SHA1_STEP_PE (SHA1_F1, a, b, c, d, e, (c_75s ^ w0s06 ^ w0s12 ^ w0s14));
631
632     bool q_cond = (e_rev != e);
633
634     if (q_cond) continue;
635
636     SHA1_STEP_PB (SHA1_F1, a, b, c, d, e, 0);
637
638     const u32 c_76s = rotl32 ((c_73s ^ c_68s ^ c_62s ^ c_60s), 1u);
639     const u32 c_77s = rotl32 ((c_74s ^ c_69s ^ c_63s ^ c_61s), 1u);
640     const u32 c_78s = rotl32 ((c_75s ^ c_70s ^ c_64s ^ c_62s), 1u);
641     const u32 c_79s = rotl32 ((c_76s ^ c_71s ^ c_65s ^ c_63s), 1u);
642
643     const u32x w0s21 = rotl32 (w0, 21u);
644     const u32x w0s22 = rotl32 (w0, 22U);
645
646     SHA1_STEP (SHA1_F1 , e, a, b, c, d, (c_76s ^ w0s07 ^ w0s08___w0s12 ^ w0s16 ^ w0s21));
647     SHA1_STEP (SHA1_F1 , d, e, a, b, c, (c_77s));
648     SHA1_STEP (SHA1_F1 , c, d, e, a, b, (c_78s ^ w0s07 ^ w0s08 ^ w0s15 ^ w0s18 ^ w0s20));
649     SHA1_STEP (SHA1_F1 , b, c, d, e, a, (c_79s ^ w0s08 ^ w0s22));
650
651
652     const u32x r0 = d;
653     const u32x r1 = e;
654     const u32x r2 = c;
655     const u32x r3 = b;
656
657     #include VECT_COMPARE_S
658   }
659 }
660
661 extern "C" __global__ void __launch_bounds__ (256, 1) m00130_m04 (const pw_t *pws, const gpu_rule_t *rules_buf, const comb_t *combs_buf, const u32x *words_buf_r, 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)
662 {
663   /**
664    * base
665    */
666
667   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
668
669   if (gid >= gid_max) return;
670
671   u32 w[16];
672
673   w[ 0] = pws[gid].i[ 0];
674   w[ 1] = pws[gid].i[ 1];
675   w[ 2] = pws[gid].i[ 2];
676   w[ 3] = pws[gid].i[ 3];
677   w[ 4] = 0;
678   w[ 5] = 0;
679   w[ 6] = 0;
680   w[ 7] = 0;
681   w[ 8] = 0;
682   w[ 9] = 0;
683   w[10] = 0;
684   w[11] = 0;
685   w[12] = 0;
686   w[13] = 0;
687   w[14] = 0;
688   w[15] = pws[gid].i[15];
689
690   const u32 pw_len = pws[gid].pw_len;
691
692   /**
693    * main
694    */
695
696   m00130m (w, pw_len, pws, rules_buf, combs_buf, words_buf_r, 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);
697 }
698
699 extern "C" __global__ void __launch_bounds__ (256, 1) m00130_m08 (const pw_t *pws, const gpu_rule_t *rules_buf, const comb_t *combs_buf, const u32x *words_buf_r, 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)
700 {
701   /**
702    * base
703    */
704
705   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
706
707   if (gid >= gid_max) return;
708
709   u32 w[16];
710
711   w[ 0] = pws[gid].i[ 0];
712   w[ 1] = pws[gid].i[ 1];
713   w[ 2] = pws[gid].i[ 2];
714   w[ 3] = pws[gid].i[ 3];
715   w[ 4] = pws[gid].i[ 4];
716   w[ 5] = pws[gid].i[ 5];
717   w[ 6] = pws[gid].i[ 6];
718   w[ 7] = pws[gid].i[ 7];
719   w[ 8] = 0;
720   w[ 9] = 0;
721   w[10] = 0;
722   w[11] = 0;
723   w[12] = 0;
724   w[13] = 0;
725   w[14] = 0;
726   w[15] = pws[gid].i[15];
727
728   const u32 pw_len = pws[gid].pw_len;
729
730   /**
731    * main
732    */
733
734   m00130m (w, pw_len, pws, rules_buf, combs_buf, words_buf_r, 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);
735 }
736
737 extern "C" __global__ void __launch_bounds__ (256, 1) m00130_m16 (const pw_t *pws, const gpu_rule_t *rules_buf, const comb_t *combs_buf, const u32x *words_buf_r, 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)
738 {
739   /**
740    * base
741    */
742
743   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
744
745   if (gid >= gid_max) return;
746
747   u32 w[16];
748
749   w[ 0] = pws[gid].i[ 0];
750   w[ 1] = pws[gid].i[ 1];
751   w[ 2] = pws[gid].i[ 2];
752   w[ 3] = pws[gid].i[ 3];
753   w[ 4] = pws[gid].i[ 4];
754   w[ 5] = pws[gid].i[ 5];
755   w[ 6] = pws[gid].i[ 6];
756   w[ 7] = pws[gid].i[ 7];
757   w[ 8] = pws[gid].i[ 8];
758   w[ 9] = pws[gid].i[ 9];
759   w[10] = pws[gid].i[10];
760   w[11] = pws[gid].i[11];
761   w[12] = pws[gid].i[12];
762   w[13] = pws[gid].i[13];
763   w[14] = pws[gid].i[14];
764   w[15] = pws[gid].i[15];
765
766   const u32 pw_len = pws[gid].pw_len;
767
768   /**
769    * main
770    */
771
772   m00130m (w, pw_len, pws, rules_buf, combs_buf, words_buf_r, 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);
773 }
774
775 extern "C" __global__ void __launch_bounds__ (256, 1) m00130_s04 (const pw_t *pws, const gpu_rule_t *rules_buf, const comb_t *combs_buf, const u32x *words_buf_r, 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)
776 {
777   /**
778    * base
779    */
780
781   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
782
783   if (gid >= gid_max) return;
784
785   u32 w[16];
786
787   w[ 0] = pws[gid].i[ 0];
788   w[ 1] = pws[gid].i[ 1];
789   w[ 2] = pws[gid].i[ 2];
790   w[ 3] = pws[gid].i[ 3];
791   w[ 4] = 0;
792   w[ 5] = 0;
793   w[ 6] = 0;
794   w[ 7] = 0;
795   w[ 8] = 0;
796   w[ 9] = 0;
797   w[10] = 0;
798   w[11] = 0;
799   w[12] = 0;
800   w[13] = 0;
801   w[14] = 0;
802   w[15] = pws[gid].i[15];
803
804   const u32 pw_len = pws[gid].pw_len;
805
806   /**
807    * main
808    */
809
810   m00130s (w, pw_len, pws, rules_buf, combs_buf, words_buf_r, 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);
811 }
812
813 extern "C" __global__ void __launch_bounds__ (256, 1) m00130_s08 (const pw_t *pws, const gpu_rule_t *rules_buf, const comb_t *combs_buf, const u32x *words_buf_r, 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)
814 {
815   /**
816    * base
817    */
818
819   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
820
821   if (gid >= gid_max) return;
822
823   u32 w[16];
824
825   w[ 0] = pws[gid].i[ 0];
826   w[ 1] = pws[gid].i[ 1];
827   w[ 2] = pws[gid].i[ 2];
828   w[ 3] = pws[gid].i[ 3];
829   w[ 4] = pws[gid].i[ 4];
830   w[ 5] = pws[gid].i[ 5];
831   w[ 6] = pws[gid].i[ 6];
832   w[ 7] = pws[gid].i[ 7];
833   w[ 8] = 0;
834   w[ 9] = 0;
835   w[10] = 0;
836   w[11] = 0;
837   w[12] = 0;
838   w[13] = 0;
839   w[14] = 0;
840   w[15] = pws[gid].i[15];
841
842   const u32 pw_len = pws[gid].pw_len;
843
844   /**
845    * main
846    */
847
848   m00130s (w, pw_len, pws, rules_buf, combs_buf, words_buf_r, 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);
849 }
850
851 extern "C" __global__ void __launch_bounds__ (256, 1) m00130_s16 (const pw_t *pws, const gpu_rule_t *rules_buf, const comb_t *combs_buf, const u32x *words_buf_r, 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)
852 {
853   /**
854    * base
855    */
856
857   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
858
859   if (gid >= gid_max) return;
860
861   u32 w[16];
862
863   w[ 0] = pws[gid].i[ 0];
864   w[ 1] = pws[gid].i[ 1];
865   w[ 2] = pws[gid].i[ 2];
866   w[ 3] = pws[gid].i[ 3];
867   w[ 4] = pws[gid].i[ 4];
868   w[ 5] = pws[gid].i[ 5];
869   w[ 6] = pws[gid].i[ 6];
870   w[ 7] = pws[gid].i[ 7];
871   w[ 8] = pws[gid].i[ 8];
872   w[ 9] = pws[gid].i[ 9];
873   w[10] = pws[gid].i[10];
874   w[11] = pws[gid].i[11];
875   w[12] = pws[gid].i[12];
876   w[13] = pws[gid].i[13];
877   w[14] = pws[gid].i[14];
878   w[15] = pws[gid].i[15];
879
880   const u32 pw_len = pws[gid].pw_len;
881
882   /**
883    * main
884    */
885
886   m00130s (w, pw_len, pws, rules_buf, combs_buf, words_buf_r, 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);
887 }