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