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