Upgrade kernel to support dynamic local work sizes
[hashcat.git] / OpenCL / m00900_a3.cl
1 /**
2  * Author......: Jens Steube <jens.steube@gmail.com>
3  * License.....: MIT
4  */
5
6 #define _MD4_
7
8 #include "include/constants.h"
9 #include "include/kernel_vendor.h"
10
11 #define DGST_R0 0
12 #define DGST_R1 3
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 #define MD4_STEP_REV(f,a,b,c,d,x,t,s)   \
24 {                                       \
25   a  = rotr32 (a, s);                   \
26   a -= f (b, c, d);                     \
27   a -= x;                               \
28   a -= t;                               \
29 }
30
31 #define MD4_STEP_REV1(f,a,b,c,d,x,t,s)  \
32 {                                       \
33   a  = rotr32 (a, s);                   \
34   a -= x;                               \
35   a -= t;                               \
36 }
37
38 static void m00900m (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)
39 {
40   /**
41    * modifier
42    */
43
44   const u32 gid = get_global_id (0);
45   const u32 lid = get_local_id (0);
46
47   /**
48    * base
49    */
50
51   const u32 F_w0c00 =     0 + MD4C00;
52   const u32 F_w1c00 = w[ 1] + MD4C00;
53   const u32 F_w2c00 = w[ 2] + MD4C00;
54   const u32 F_w3c00 = w[ 3] + MD4C00;
55   const u32 F_w4c00 = w[ 4] + MD4C00;
56   const u32 F_w5c00 = w[ 5] + MD4C00;
57   const u32 F_w6c00 = w[ 6] + MD4C00;
58   const u32 F_w7c00 = w[ 7] + MD4C00;
59   const u32 F_w8c00 = w[ 8] + MD4C00;
60   const u32 F_w9c00 = w[ 9] + MD4C00;
61   const u32 F_wac00 = w[10] + MD4C00;
62   const u32 F_wbc00 = w[11] + MD4C00;
63   const u32 F_wcc00 = w[12] + MD4C00;
64   const u32 F_wdc00 = w[13] + MD4C00;
65   const u32 F_wec00 = w[14] + MD4C00;
66   const u32 F_wfc00 = w[15] + MD4C00;
67
68   const u32 G_w0c01 =     0 + MD4C01;
69   const u32 G_w4c01 = w[ 4] + MD4C01;
70   const u32 G_w8c01 = w[ 8] + MD4C01;
71   const u32 G_wcc01 = w[12] + MD4C01;
72   const u32 G_w1c01 = w[ 1] + MD4C01;
73   const u32 G_w5c01 = w[ 5] + MD4C01;
74   const u32 G_w9c01 = w[ 9] + MD4C01;
75   const u32 G_wdc01 = w[13] + MD4C01;
76   const u32 G_w2c01 = w[ 2] + MD4C01;
77   const u32 G_w6c01 = w[ 6] + MD4C01;
78   const u32 G_wac01 = w[10] + MD4C01;
79   const u32 G_wec01 = w[14] + MD4C01;
80   const u32 G_w3c01 = w[ 3] + MD4C01;
81   const u32 G_w7c01 = w[ 7] + MD4C01;
82   const u32 G_wbc01 = w[11] + MD4C01;
83   const u32 G_wfc01 = w[15] + MD4C01;
84
85   const u32 H_w0c02 =     0 + MD4C02;
86   const u32 H_w8c02 = w[ 8] + MD4C02;
87   const u32 H_w4c02 = w[ 4] + MD4C02;
88   const u32 H_wcc02 = w[12] + MD4C02;
89   const u32 H_w2c02 = w[ 2] + MD4C02;
90   const u32 H_wac02 = w[10] + MD4C02;
91   const u32 H_w6c02 = w[ 6] + MD4C02;
92   const u32 H_wec02 = w[14] + MD4C02;
93   const u32 H_w1c02 = w[ 1] + MD4C02;
94   const u32 H_w9c02 = w[ 9] + MD4C02;
95   const u32 H_w5c02 = w[ 5] + MD4C02;
96   const u32 H_wdc02 = w[13] + MD4C02;
97   const u32 H_w3c02 = w[ 3] + MD4C02;
98   const u32 H_wbc02 = w[11] + MD4C02;
99   const u32 H_w7c02 = w[ 7] + MD4C02;
100   const u32 H_wfc02 = w[15] + MD4C02;
101
102   /**
103    * loop
104    */
105
106   u32 w0l = w[0];
107
108   for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos++)
109   {
110     const u32 w0r = words_buf_r[il_pos];
111
112     const u32 w0 = w0l | w0r;
113
114     u32 a = MD4M_A;
115     u32 b = MD4M_B;
116     u32 c = MD4M_C;
117     u32 d = MD4M_D;
118
119     MD4_STEP (MD4_Fo, a, b, c, d, w0, F_w0c00, MD4S00);
120     MD4_STEP0(MD4_Fo, d, a, b, c,     F_w1c00, MD4S01);
121     MD4_STEP0(MD4_Fo, c, d, a, b,     F_w2c00, MD4S02);
122     MD4_STEP0(MD4_Fo, b, c, d, a,     F_w3c00, MD4S03);
123     MD4_STEP0(MD4_Fo, a, b, c, d,     F_w4c00, MD4S00);
124     MD4_STEP0(MD4_Fo, d, a, b, c,     F_w5c00, MD4S01);
125     MD4_STEP0(MD4_Fo, c, d, a, b,     F_w6c00, MD4S02);
126     MD4_STEP0(MD4_Fo, b, c, d, a,     F_w7c00, MD4S03);
127     MD4_STEP0(MD4_Fo, a, b, c, d,     F_w8c00, MD4S00);
128     MD4_STEP0(MD4_Fo, d, a, b, c,     F_w9c00, MD4S01);
129     MD4_STEP0(MD4_Fo, c, d, a, b,     F_wac00, MD4S02);
130     MD4_STEP0(MD4_Fo, b, c, d, a,     F_wbc00, MD4S03);
131     MD4_STEP0(MD4_Fo, a, b, c, d,     F_wcc00, MD4S00);
132     MD4_STEP0(MD4_Fo, d, a, b, c,     F_wdc00, MD4S01);
133     MD4_STEP0(MD4_Fo, c, d, a, b,     F_wec00, MD4S02);
134     MD4_STEP0(MD4_Fo, b, c, d, a,     F_wfc00, MD4S03);
135
136     MD4_STEP (MD4_Go, a, b, c, d, w0, G_w0c01, MD4S10);
137     MD4_STEP0(MD4_Go, d, a, b, c,     G_w4c01, MD4S11);
138     MD4_STEP0(MD4_Go, c, d, a, b,     G_w8c01, MD4S12);
139     MD4_STEP0(MD4_Go, b, c, d, a,     G_wcc01, MD4S13);
140     MD4_STEP0(MD4_Go, a, b, c, d,     G_w1c01, MD4S10);
141     MD4_STEP0(MD4_Go, d, a, b, c,     G_w5c01, MD4S11);
142     MD4_STEP0(MD4_Go, c, d, a, b,     G_w9c01, MD4S12);
143     MD4_STEP0(MD4_Go, b, c, d, a,     G_wdc01, MD4S13);
144     MD4_STEP0(MD4_Go, a, b, c, d,     G_w2c01, MD4S10);
145     MD4_STEP0(MD4_Go, d, a, b, c,     G_w6c01, MD4S11);
146     MD4_STEP0(MD4_Go, c, d, a, b,     G_wac01, MD4S12);
147     MD4_STEP0(MD4_Go, b, c, d, a,     G_wec01, MD4S13);
148     MD4_STEP0(MD4_Go, a, b, c, d,     G_w3c01, MD4S10);
149     MD4_STEP0(MD4_Go, d, a, b, c,     G_w7c01, MD4S11);
150     MD4_STEP0(MD4_Go, c, d, a, b,     G_wbc01, MD4S12);
151     MD4_STEP0(MD4_Go, b, c, d, a,     G_wfc01, MD4S13);
152
153     MD4_STEP (MD4_H , a, b, c, d, w0, H_w0c02, MD4S20);
154     MD4_STEP0(MD4_H , d, a, b, c,     H_w8c02, MD4S21);
155     MD4_STEP0(MD4_H , c, d, a, b,     H_w4c02, MD4S22);
156     MD4_STEP0(MD4_H , b, c, d, a,     H_wcc02, MD4S23);
157     MD4_STEP0(MD4_H , a, b, c, d,     H_w2c02, MD4S20);
158     MD4_STEP0(MD4_H , d, a, b, c,     H_wac02, MD4S21);
159     MD4_STEP0(MD4_H , c, d, a, b,     H_w6c02, MD4S22);
160     MD4_STEP0(MD4_H , b, c, d, a,     H_wec02, MD4S23);
161     MD4_STEP0(MD4_H , a, b, c, d,     H_w1c02, MD4S20);
162     MD4_STEP0(MD4_H , d, a, b, c,     H_w9c02, MD4S21);
163     MD4_STEP0(MD4_H , c, d, a, b,     H_w5c02, MD4S22);
164     MD4_STEP0(MD4_H , b, c, d, a,     H_wdc02, MD4S23);
165     MD4_STEP0(MD4_H , a, b, c, d,     H_w3c02, MD4S20);
166     MD4_STEP0(MD4_H , d, a, b, c,     H_wbc02, MD4S21);
167     MD4_STEP0(MD4_H , c, d, a, b,     H_w7c02, MD4S22);
168     MD4_STEP0(MD4_H , b, c, d, a,     H_wfc02, MD4S23);
169
170     const u32 r0 = a;
171     const u32 r1 = d;
172     const u32 r2 = c;
173     const u32 r3 = b;
174
175     #include COMPARE_M
176   }
177 }
178
179 static void m00900s (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)
180 {
181   /**
182    * modifier
183    */
184
185   const u32 gid = get_global_id (0);
186   const u32 lid = get_local_id (0);
187
188   /**
189    * base
190    */
191
192   const u32 F_w0c00 =     0 + MD4C00;
193   const u32 F_w1c00 = w[ 1] + MD4C00;
194   const u32 F_w2c00 = w[ 2] + MD4C00;
195   const u32 F_w3c00 = w[ 3] + MD4C00;
196   const u32 F_w4c00 = w[ 4] + MD4C00;
197   const u32 F_w5c00 = w[ 5] + MD4C00;
198   const u32 F_w6c00 = w[ 6] + MD4C00;
199   const u32 F_w7c00 = w[ 7] + MD4C00;
200   const u32 F_w8c00 = w[ 8] + MD4C00;
201   const u32 F_w9c00 = w[ 9] + MD4C00;
202   const u32 F_wac00 = w[10] + MD4C00;
203   const u32 F_wbc00 = w[11] + MD4C00;
204   const u32 F_wcc00 = w[12] + MD4C00;
205   const u32 F_wdc00 = w[13] + MD4C00;
206   const u32 F_wec00 = w[14] + MD4C00;
207   const u32 F_wfc00 = w[15] + MD4C00;
208
209   const u32 G_w0c01 =     0 + MD4C01;
210   const u32 G_w4c01 = w[ 4] + MD4C01;
211   const u32 G_w8c01 = w[ 8] + MD4C01;
212   const u32 G_wcc01 = w[12] + MD4C01;
213   const u32 G_w1c01 = w[ 1] + MD4C01;
214   const u32 G_w5c01 = w[ 5] + MD4C01;
215   const u32 G_w9c01 = w[ 9] + MD4C01;
216   const u32 G_wdc01 = w[13] + MD4C01;
217   const u32 G_w2c01 = w[ 2] + MD4C01;
218   const u32 G_w6c01 = w[ 6] + MD4C01;
219   const u32 G_wac01 = w[10] + MD4C01;
220   const u32 G_wec01 = w[14] + MD4C01;
221   const u32 G_w3c01 = w[ 3] + MD4C01;
222   const u32 G_w7c01 = w[ 7] + MD4C01;
223   const u32 G_wbc01 = w[11] + MD4C01;
224   const u32 G_wfc01 = w[15] + MD4C01;
225
226   const u32 H_w0c02 =     0 + MD4C02;
227   const u32 H_w8c02 = w[ 8] + MD4C02;
228   const u32 H_w4c02 = w[ 4] + MD4C02;
229   const u32 H_wcc02 = w[12] + MD4C02;
230   const u32 H_w2c02 = w[ 2] + MD4C02;
231   const u32 H_wac02 = w[10] + MD4C02;
232   const u32 H_w6c02 = w[ 6] + MD4C02;
233   const u32 H_wec02 = w[14] + MD4C02;
234   const u32 H_w1c02 = w[ 1] + MD4C02;
235   const u32 H_w9c02 = w[ 9] + MD4C02;
236   const u32 H_w5c02 = w[ 5] + MD4C02;
237   const u32 H_wdc02 = w[13] + MD4C02;
238   const u32 H_w3c02 = w[ 3] + MD4C02;
239   const u32 H_wbc02 = w[11] + MD4C02;
240   const u32 H_w7c02 = w[ 7] + MD4C02;
241   const u32 H_wfc02 = w[15] + MD4C02;
242
243   /**
244    * digest
245    */
246
247   const u32 search[4] =
248   {
249     digests_buf[digests_offset].digest_buf[DGST_R0],
250     digests_buf[digests_offset].digest_buf[DGST_R1],
251     digests_buf[digests_offset].digest_buf[DGST_R2],
252     digests_buf[digests_offset].digest_buf[DGST_R3]
253   };
254
255   /**
256    * reverse
257    */
258
259   u32 a_rev = digests_buf[digests_offset].digest_buf[0];
260   u32 b_rev = digests_buf[digests_offset].digest_buf[1];
261   u32 c_rev = digests_buf[digests_offset].digest_buf[2];
262   u32 d_rev = digests_buf[digests_offset].digest_buf[3];
263
264   MD4_STEP_REV (MD4_H, b_rev, c_rev, d_rev, a_rev, w[15], MD4C02, MD4S23);
265   MD4_STEP_REV (MD4_H, c_rev, d_rev, a_rev, b_rev, w[ 7], MD4C02, MD4S22);
266   MD4_STEP_REV (MD4_H, d_rev, a_rev, b_rev, c_rev, w[11], MD4C02, MD4S21);
267   MD4_STEP_REV (MD4_H, a_rev, b_rev, c_rev, d_rev, w[ 3], MD4C02, MD4S20);
268   MD4_STEP_REV (MD4_H, b_rev, c_rev, d_rev, a_rev, w[13], MD4C02, MD4S23);
269   MD4_STEP_REV (MD4_H, c_rev, d_rev, a_rev, b_rev, w[ 5], MD4C02, MD4S22);
270   MD4_STEP_REV (MD4_H, d_rev, a_rev, b_rev, c_rev, w[ 9], MD4C02, MD4S21);
271   MD4_STEP_REV (MD4_H, a_rev, b_rev, c_rev, d_rev, w[ 1], MD4C02, MD4S20);
272   MD4_STEP_REV (MD4_H, b_rev, c_rev, d_rev, a_rev, w[14], MD4C02, MD4S23);
273   MD4_STEP_REV (MD4_H, c_rev, d_rev, a_rev, b_rev, w[ 6], MD4C02, MD4S22);
274   MD4_STEP_REV (MD4_H, d_rev, a_rev, b_rev, c_rev, w[10], MD4C02, MD4S21);
275   MD4_STEP_REV (MD4_H, a_rev, b_rev, c_rev, d_rev, w[ 2], MD4C02, MD4S20);
276   MD4_STEP_REV (MD4_H, b_rev, c_rev, d_rev, a_rev, w[12], MD4C02, MD4S23);
277   MD4_STEP_REV (MD4_H, c_rev, d_rev, a_rev, b_rev, w[ 4], MD4C02, MD4S22);
278   MD4_STEP_REV (MD4_H, d_rev, a_rev, b_rev, c_rev, w[ 8], MD4C02, MD4S21);
279   MD4_STEP_REV (MD4_H, a_rev, b_rev, c_rev, d_rev,     0, MD4C02, MD4S20);
280
281   const u32 sav_c = c_rev;
282   const u32 sav_d = d_rev;
283
284   MD4_STEP_REV1(MD4_G, b_rev, c_rev, d_rev, a_rev, w[15], MD4C01, MD4S13);
285   MD4_STEP_REV1(MD4_G, c_rev, d_rev, a_rev, b_rev, w[11], MD4C01, MD4S12);
286
287   /**
288    * loop
289    */
290
291   u32 w0l = w[0];
292
293   for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos++)
294   {
295     const u32 w0r = words_buf_r[il_pos];
296
297     const u32 w0 = w0l | w0r;
298
299     u32 pre_a = a_rev;
300     u32 pre_b = b_rev;
301     u32 pre_c = c_rev;
302
303     pre_a = pre_a - w0;
304     pre_b = pre_b - MD4_G (sav_c, sav_d, pre_a);
305     pre_c = pre_c - MD4_G (sav_d, pre_a, pre_b);
306
307     u32 a = MD4M_A;
308     u32 b = MD4M_B;
309     u32 c = MD4M_C;
310     u32 d = MD4M_D;
311
312     MD4_STEP (MD4_Fo, a, b, c, d, w0, F_w0c00, MD4S00);
313     MD4_STEP0(MD4_Fo, d, a, b, c,     F_w1c00, MD4S01);
314     MD4_STEP0(MD4_Fo, c, d, a, b,     F_w2c00, MD4S02);
315     MD4_STEP0(MD4_Fo, b, c, d, a,     F_w3c00, MD4S03);
316     MD4_STEP0(MD4_Fo, a, b, c, d,     F_w4c00, MD4S00);
317     MD4_STEP0(MD4_Fo, d, a, b, c,     F_w5c00, MD4S01);
318     MD4_STEP0(MD4_Fo, c, d, a, b,     F_w6c00, MD4S02);
319     MD4_STEP0(MD4_Fo, b, c, d, a,     F_w7c00, MD4S03);
320     MD4_STEP0(MD4_Fo, a, b, c, d,     F_w8c00, MD4S00);
321     MD4_STEP0(MD4_Fo, d, a, b, c,     F_w9c00, MD4S01);
322     MD4_STEP0(MD4_Fo, c, d, a, b,     F_wac00, MD4S02);
323     MD4_STEP0(MD4_Fo, b, c, d, a,     F_wbc00, MD4S03);
324     MD4_STEP0(MD4_Fo, a, b, c, d,     F_wcc00, MD4S00);
325     MD4_STEP0(MD4_Fo, d, a, b, c,     F_wdc00, MD4S01);
326     MD4_STEP0(MD4_Fo, c, d, a, b,     F_wec00, MD4S02);
327     MD4_STEP0(MD4_Fo, b, c, d, a,     F_wfc00, MD4S03);
328
329     MD4_STEP (MD4_Go, a, b, c, d, w0, G_w0c01, MD4S10);
330     MD4_STEP0(MD4_Go, d, a, b, c,     G_w4c01, MD4S11);
331     MD4_STEP0(MD4_Go, c, d, a, b,     G_w8c01, MD4S12);
332     MD4_STEP0(MD4_Go, b, c, d, a,     G_wcc01, MD4S13);
333     MD4_STEP0(MD4_Go, a, b, c, d,     G_w1c01, MD4S10);
334     MD4_STEP0(MD4_Go, d, a, b, c,     G_w5c01, MD4S11);
335     MD4_STEP0(MD4_Go, c, d, a, b,     G_w9c01, MD4S12);
336     MD4_STEP0(MD4_Go, b, c, d, a,     G_wdc01, MD4S13);
337     MD4_STEP0(MD4_Go, a, b, c, d,     G_w2c01, MD4S10);
338     MD4_STEP0(MD4_Go, d, a, b, c,     G_w6c01, MD4S11);
339     MD4_STEP0(MD4_Go, c, d, a, b,     G_wac01, MD4S12);
340
341     bool q_cond = allx (pre_c != c);
342
343     if (q_cond) continue;
344
345     MD4_STEP0(MD4_Go, b, c, d, a,     G_wec01, MD4S13);
346     MD4_STEP0(MD4_Go, a, b, c, d,     G_w3c01, MD4S10);
347
348     bool q_cond2 = allx (pre_a != a);
349
350     if (q_cond2) continue;
351
352     MD4_STEP0(MD4_Go, d, a, b, c,     G_w7c01, MD4S11);
353     MD4_STEP0(MD4_Go, c, d, a, b,     G_wbc01, MD4S12);
354     MD4_STEP0(MD4_Go, b, c, d, a,     G_wfc01, MD4S13);
355
356     MD4_STEP (MD4_H , a, b, c, d, w0, H_w0c02, MD4S20);
357     MD4_STEP0(MD4_H , d, a, b, c,     H_w8c02, MD4S21);
358     MD4_STEP0(MD4_H , c, d, a, b,     H_w4c02, MD4S22);
359     MD4_STEP0(MD4_H , b, c, d, a,     H_wcc02, MD4S23);
360     MD4_STEP0(MD4_H , a, b, c, d,     H_w2c02, MD4S20);
361     MD4_STEP0(MD4_H , d, a, b, c,     H_wac02, MD4S21);
362     MD4_STEP0(MD4_H , c, d, a, b,     H_w6c02, MD4S22);
363     MD4_STEP0(MD4_H , b, c, d, a,     H_wec02, MD4S23);
364     MD4_STEP0(MD4_H , a, b, c, d,     H_w1c02, MD4S20);
365     MD4_STEP0(MD4_H , d, a, b, c,     H_w9c02, MD4S21);
366     MD4_STEP0(MD4_H , c, d, a, b,     H_w5c02, MD4S22);
367     MD4_STEP0(MD4_H , b, c, d, a,     H_wdc02, MD4S23);
368     MD4_STEP0(MD4_H , a, b, c, d,     H_w3c02, MD4S20);
369     MD4_STEP0(MD4_H , d, a, b, c,     H_wbc02, MD4S21);
370     MD4_STEP0(MD4_H , c, d, a, b,     H_w7c02, MD4S22);
371     MD4_STEP0(MD4_H , b, c, d, a,     H_wfc02, MD4S23);
372
373     const u32 r0 = a;
374     const u32 r1 = d;
375     const u32 r2 = c;
376     const u32 r3 = b;
377
378     #include COMPARE_S
379   }
380 }
381
382 __kernel void m00900_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)
383 {
384   /**
385    * base
386    */
387
388   const u32 gid = get_global_id (0);
389
390   if (gid >= gid_max) return;
391
392   u32 w[16];
393
394   w[ 0] = pws[gid].i[ 0];
395   w[ 1] = pws[gid].i[ 1];
396   w[ 2] = pws[gid].i[ 2];
397   w[ 3] = pws[gid].i[ 3];
398   w[ 4] = 0;
399   w[ 5] = 0;
400   w[ 6] = 0;
401   w[ 7] = 0;
402   w[ 8] = 0;
403   w[ 9] = 0;
404   w[10] = 0;
405   w[11] = 0;
406   w[12] = 0;
407   w[13] = 0;
408   w[14] = pws[gid].i[14];
409   w[15] = 0;
410
411   const u32 pw_len = pws[gid].pw_len;
412
413   /**
414    * main
415    */
416
417   m00900m (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);
418 }
419
420 __kernel void m00900_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)
421 {
422   /**
423    * base
424    */
425
426   const u32 gid = get_global_id (0);
427
428   if (gid >= gid_max) return;
429
430   u32 w[16];
431
432   w[ 0] = pws[gid].i[ 0];
433   w[ 1] = pws[gid].i[ 1];
434   w[ 2] = pws[gid].i[ 2];
435   w[ 3] = pws[gid].i[ 3];
436   w[ 4] = pws[gid].i[ 4];
437   w[ 5] = pws[gid].i[ 5];
438   w[ 6] = pws[gid].i[ 6];
439   w[ 7] = pws[gid].i[ 7];
440   w[ 8] = 0;
441   w[ 9] = 0;
442   w[10] = 0;
443   w[11] = 0;
444   w[12] = 0;
445   w[13] = 0;
446   w[14] = pws[gid].i[14];
447   w[15] = 0;
448
449   const u32 pw_len = pws[gid].pw_len;
450
451   /**
452    * main
453    */
454
455   m00900m (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);
456 }
457
458 __kernel void m00900_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)
459 {
460   /**
461    * base
462    */
463
464   const u32 gid = get_global_id (0);
465
466   if (gid >= gid_max) return;
467
468   u32 w[16];
469
470   w[ 0] = pws[gid].i[ 0];
471   w[ 1] = pws[gid].i[ 1];
472   w[ 2] = pws[gid].i[ 2];
473   w[ 3] = pws[gid].i[ 3];
474   w[ 4] = pws[gid].i[ 4];
475   w[ 5] = pws[gid].i[ 5];
476   w[ 6] = pws[gid].i[ 6];
477   w[ 7] = pws[gid].i[ 7];
478   w[ 8] = pws[gid].i[ 8];
479   w[ 9] = pws[gid].i[ 9];
480   w[10] = pws[gid].i[10];
481   w[11] = pws[gid].i[11];
482   w[12] = pws[gid].i[12];
483   w[13] = pws[gid].i[13];
484   w[14] = pws[gid].i[14];
485   w[15] = pws[gid].i[15];
486
487   const u32 pw_len = pws[gid].pw_len;
488
489   /**
490    * main
491    */
492
493   m00900m (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);
494 }
495
496 __kernel void m00900_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)
497 {
498   /**
499    * base
500    */
501
502   const u32 gid = get_global_id (0);
503
504   if (gid >= gid_max) return;
505
506   u32 w[16];
507
508   w[ 0] = pws[gid].i[ 0];
509   w[ 1] = pws[gid].i[ 1];
510   w[ 2] = pws[gid].i[ 2];
511   w[ 3] = pws[gid].i[ 3];
512   w[ 4] = 0;
513   w[ 5] = 0;
514   w[ 6] = 0;
515   w[ 7] = 0;
516   w[ 8] = 0;
517   w[ 9] = 0;
518   w[10] = 0;
519   w[11] = 0;
520   w[12] = 0;
521   w[13] = 0;
522   w[14] = pws[gid].i[14];
523   w[15] = 0;
524
525   const u32 pw_len = pws[gid].pw_len;
526
527   /**
528    * main
529    */
530
531   m00900s (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);
532 }
533
534 __kernel void m00900_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)
535 {
536   /**
537    * base
538    */
539
540   const u32 gid = get_global_id (0);
541
542   if (gid >= gid_max) return;
543
544   u32 w[16];
545
546   w[ 0] = pws[gid].i[ 0];
547   w[ 1] = pws[gid].i[ 1];
548   w[ 2] = pws[gid].i[ 2];
549   w[ 3] = pws[gid].i[ 3];
550   w[ 4] = pws[gid].i[ 4];
551   w[ 5] = pws[gid].i[ 5];
552   w[ 6] = pws[gid].i[ 6];
553   w[ 7] = pws[gid].i[ 7];
554   w[ 8] = 0;
555   w[ 9] = 0;
556   w[10] = 0;
557   w[11] = 0;
558   w[12] = 0;
559   w[13] = 0;
560   w[14] = pws[gid].i[14];
561   w[15] = 0;
562
563   const u32 pw_len = pws[gid].pw_len;
564
565   /**
566    * main
567    */
568
569   m00900s (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);
570 }
571
572 __kernel void m00900_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)
573 {
574   /**
575    * base
576    */
577
578   const u32 gid = get_global_id (0);
579
580   if (gid >= gid_max) return;
581
582   u32 w[16];
583
584   w[ 0] = pws[gid].i[ 0];
585   w[ 1] = pws[gid].i[ 1];
586   w[ 2] = pws[gid].i[ 2];
587   w[ 3] = pws[gid].i[ 3];
588   w[ 4] = pws[gid].i[ 4];
589   w[ 5] = pws[gid].i[ 5];
590   w[ 6] = pws[gid].i[ 6];
591   w[ 7] = pws[gid].i[ 7];
592   w[ 8] = pws[gid].i[ 8];
593   w[ 9] = pws[gid].i[ 9];
594   w[10] = pws[gid].i[10];
595   w[11] = pws[gid].i[11];
596   w[12] = pws[gid].i[12];
597   w[13] = pws[gid].i[13];
598   w[14] = pws[gid].i[14];
599   w[15] = pws[gid].i[15];
600
601   const u32 pw_len = pws[gid].pw_len;
602
603   /**
604    * main
605    */
606
607   m00900s (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);
608 }