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