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