Merge pull request #135 from gm4tr1x/master
[hashcat.git] / OpenCL / m01000_a3.cl
1 /**
2  * Author......: Jens Steube <jens.steube@gmail.com>
3  * License.....: MIT
4  */
5
6 #define _MD4_
7
8 #define NEW_SIMD_CODE
9
10 #include "include/constants.h"
11 #include "include/kernel_vendor.h"
12
13 #define DGST_R0 0
14 #define DGST_R1 3
15 #define DGST_R2 2
16 #define DGST_R3 1
17
18 #include "include/kernel_functions.c"
19 #include "OpenCL/types_ocl.c"
20 #include "OpenCL/common.c"
21 #include "OpenCL/simd.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 m01000m (u32 w[16], const u32 pw_len, __global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __constant u32x * words_buf_r, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 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 += VECT_SIZE)
109   {
110     const u32x w0r = words_buf_r[il_pos / VECT_SIZE];
111
112     const u32x w0 = w0l | w0r;
113
114     u32x tmp2;
115
116     u32x a = MD4M_A;
117     u32x b = MD4M_B;
118     u32x c = MD4M_C;
119     u32x d = MD4M_D;
120
121     MD4_STEP (MD4_Fo, a, b, c, d, w0, F_w0c00, MD4S00);
122     MD4_STEP0(MD4_Fo, d, a, b, c,     F_w1c00, MD4S01);
123     MD4_STEP0(MD4_Fo, c, d, a, b,     F_w2c00, MD4S02);
124     MD4_STEP0(MD4_Fo, b, c, d, a,     F_w3c00, MD4S03);
125     MD4_STEP0(MD4_Fo, a, b, c, d,     F_w4c00, MD4S00);
126     MD4_STEP0(MD4_Fo, d, a, b, c,     F_w5c00, MD4S01);
127     MD4_STEP0(MD4_Fo, c, d, a, b,     F_w6c00, MD4S02);
128     MD4_STEP0(MD4_Fo, b, c, d, a,     F_w7c00, MD4S03);
129     MD4_STEP0(MD4_Fo, a, b, c, d,     F_w8c00, MD4S00);
130     MD4_STEP0(MD4_Fo, d, a, b, c,     F_w9c00, MD4S01);
131     MD4_STEP0(MD4_Fo, c, d, a, b,     F_wac00, MD4S02);
132     MD4_STEP0(MD4_Fo, b, c, d, a,     F_wbc00, MD4S03);
133     MD4_STEP0(MD4_Fo, a, b, c, d,     F_wcc00, MD4S00);
134     MD4_STEP0(MD4_Fo, d, a, b, c,     F_wdc00, MD4S01);
135     MD4_STEP0(MD4_Fo, c, d, a, b,     F_wec00, MD4S02);
136     MD4_STEP0(MD4_Fo, b, c, d, a,     F_wfc00, MD4S03);
137
138     MD4_STEP (MD4_Go, a, b, c, d, w0, G_w0c01, MD4S10);
139     MD4_STEP0(MD4_Go, d, a, b, c,     G_w4c01, MD4S11);
140     MD4_STEP0(MD4_Go, c, d, a, b,     G_w8c01, MD4S12);
141     MD4_STEP0(MD4_Go, b, c, d, a,     G_wcc01, MD4S13);
142     MD4_STEP0(MD4_Go, a, b, c, d,     G_w1c01, MD4S10);
143     MD4_STEP0(MD4_Go, d, a, b, c,     G_w5c01, MD4S11);
144     MD4_STEP0(MD4_Go, c, d, a, b,     G_w9c01, MD4S12);
145     MD4_STEP0(MD4_Go, b, c, d, a,     G_wdc01, MD4S13);
146     MD4_STEP0(MD4_Go, a, b, c, d,     G_w2c01, MD4S10);
147     MD4_STEP0(MD4_Go, d, a, b, c,     G_w6c01, MD4S11);
148     MD4_STEP0(MD4_Go, c, d, a, b,     G_wac01, MD4S12);
149     MD4_STEP0(MD4_Go, b, c, d, a,     G_wec01, MD4S13);
150     MD4_STEP0(MD4_Go, a, b, c, d,     G_w3c01, MD4S10);
151     MD4_STEP0(MD4_Go, d, a, b, c,     G_w7c01, MD4S11);
152     MD4_STEP0(MD4_Go, c, d, a, b,     G_wbc01, MD4S12);
153     MD4_STEP0(MD4_Go, b, c, d, a,     G_wfc01, MD4S13);
154
155     MD4_STEP (MD4_H1, a, b, c, d, w0, H_w0c02, MD4S20);
156     MD4_STEP0(MD4_H2, d, a, b, c,     H_w8c02, MD4S21);
157     MD4_STEP0(MD4_H1, c, d, a, b,     H_w4c02, MD4S22);
158     MD4_STEP0(MD4_H2, b, c, d, a,     H_wcc02, MD4S23);
159     MD4_STEP0(MD4_H1, a, b, c, d,     H_w2c02, MD4S20);
160     MD4_STEP0(MD4_H2, d, a, b, c,     H_wac02, MD4S21);
161     MD4_STEP0(MD4_H1, c, d, a, b,     H_w6c02, MD4S22);
162     MD4_STEP0(MD4_H2, b, c, d, a,     H_wec02, MD4S23);
163     MD4_STEP0(MD4_H1, a, b, c, d,     H_w1c02, MD4S20);
164     MD4_STEP0(MD4_H2, d, a, b, c,     H_w9c02, MD4S21);
165     MD4_STEP0(MD4_H1, c, d, a, b,     H_w5c02, MD4S22);
166     MD4_STEP0(MD4_H2, b, c, d, a,     H_wdc02, MD4S23);
167     MD4_STEP0(MD4_H1, a, b, c, d,     H_w3c02, MD4S20);
168     MD4_STEP0(MD4_H2, d, a, b, c,     H_wbc02, MD4S21);
169     MD4_STEP0(MD4_H1, c, d, a, b,     H_w7c02, MD4S22);
170     MD4_STEP0(MD4_H2, b, c, d, a,     H_wfc02, MD4S23);
171
172     COMPARE_M_SIMD (a, d, c, b);
173   }
174 }
175
176 static void m01000s (u32 w[16], const u32 pw_len, __global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __constant u32x * words_buf_r, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 bfs_cnt, const u32 digests_cnt, const u32 digests_offset)
177 {
178   /**
179    * modifier
180    */
181
182   const u32 gid = get_global_id (0);
183   const u32 lid = get_local_id (0);
184
185   /**
186    * base
187    */
188
189   const u32 F_w0c00 =     0 + MD4C00;
190   const u32 F_w1c00 = w[ 1] + MD4C00;
191   const u32 F_w2c00 = w[ 2] + MD4C00;
192   const u32 F_w3c00 = w[ 3] + MD4C00;
193   const u32 F_w4c00 = w[ 4] + MD4C00;
194   const u32 F_w5c00 = w[ 5] + MD4C00;
195   const u32 F_w6c00 = w[ 6] + MD4C00;
196   const u32 F_w7c00 = w[ 7] + MD4C00;
197   const u32 F_w8c00 = w[ 8] + MD4C00;
198   const u32 F_w9c00 = w[ 9] + MD4C00;
199   const u32 F_wac00 = w[10] + MD4C00;
200   const u32 F_wbc00 = w[11] + MD4C00;
201   const u32 F_wcc00 = w[12] + MD4C00;
202   const u32 F_wdc00 = w[13] + MD4C00;
203   const u32 F_wec00 = w[14] + MD4C00;
204   const u32 F_wfc00 = w[15] + MD4C00;
205
206   const u32 G_w0c01 =     0 + MD4C01;
207   const u32 G_w4c01 = w[ 4] + MD4C01;
208   const u32 G_w8c01 = w[ 8] + MD4C01;
209   const u32 G_wcc01 = w[12] + MD4C01;
210   const u32 G_w1c01 = w[ 1] + MD4C01;
211   const u32 G_w5c01 = w[ 5] + MD4C01;
212   const u32 G_w9c01 = w[ 9] + MD4C01;
213   const u32 G_wdc01 = w[13] + MD4C01;
214   const u32 G_w2c01 = w[ 2] + MD4C01;
215   const u32 G_w6c01 = w[ 6] + MD4C01;
216   const u32 G_wac01 = w[10] + MD4C01;
217   const u32 G_wec01 = w[14] + MD4C01;
218   const u32 G_w3c01 = w[ 3] + MD4C01;
219   const u32 G_w7c01 = w[ 7] + MD4C01;
220   const u32 G_wbc01 = w[11] + MD4C01;
221   const u32 G_wfc01 = w[15] + MD4C01;
222
223   const u32 H_w0c02 =     0 + MD4C02;
224   const u32 H_w8c02 = w[ 8] + MD4C02;
225   const u32 H_w4c02 = w[ 4] + MD4C02;
226   const u32 H_wcc02 = w[12] + MD4C02;
227   const u32 H_w2c02 = w[ 2] + MD4C02;
228   const u32 H_wac02 = w[10] + MD4C02;
229   const u32 H_w6c02 = w[ 6] + MD4C02;
230   const u32 H_wec02 = w[14] + MD4C02;
231   const u32 H_w1c02 = w[ 1] + MD4C02;
232   const u32 H_w9c02 = w[ 9] + MD4C02;
233   const u32 H_w5c02 = w[ 5] + MD4C02;
234   const u32 H_wdc02 = w[13] + MD4C02;
235   const u32 H_w3c02 = w[ 3] + MD4C02;
236   const u32 H_wbc02 = w[11] + MD4C02;
237   const u32 H_w7c02 = w[ 7] + MD4C02;
238   const u32 H_wfc02 = w[15] + MD4C02;
239
240   /**
241    * digest
242    */
243
244   const u32 search[4] =
245   {
246     digests_buf[digests_offset].digest_buf[DGST_R0],
247     digests_buf[digests_offset].digest_buf[DGST_R1],
248     digests_buf[digests_offset].digest_buf[DGST_R2],
249     digests_buf[digests_offset].digest_buf[DGST_R3]
250   };
251
252   /**
253    * reverse
254    */
255
256   u32x a_rev = digests_buf[digests_offset].digest_buf[0];
257   u32x b_rev = digests_buf[digests_offset].digest_buf[1];
258   u32x c_rev = digests_buf[digests_offset].digest_buf[2];
259   u32x d_rev = digests_buf[digests_offset].digest_buf[3];
260
261   MD4_STEP_REV (MD4_H, b_rev, c_rev, d_rev, a_rev, w[15], MD4C02, MD4S23);
262   MD4_STEP_REV (MD4_H, c_rev, d_rev, a_rev, b_rev, w[ 7], MD4C02, MD4S22);
263   MD4_STEP_REV (MD4_H, d_rev, a_rev, b_rev, c_rev, w[11], MD4C02, MD4S21);
264   MD4_STEP_REV (MD4_H, a_rev, b_rev, c_rev, d_rev, w[ 3], MD4C02, MD4S20);
265   MD4_STEP_REV (MD4_H, b_rev, c_rev, d_rev, a_rev, w[13], MD4C02, MD4S23);
266   MD4_STEP_REV (MD4_H, c_rev, d_rev, a_rev, b_rev, w[ 5], MD4C02, MD4S22);
267   MD4_STEP_REV (MD4_H, d_rev, a_rev, b_rev, c_rev, w[ 9], MD4C02, MD4S21);
268   MD4_STEP_REV (MD4_H, a_rev, b_rev, c_rev, d_rev, w[ 1], MD4C02, MD4S20);
269   MD4_STEP_REV (MD4_H, b_rev, c_rev, d_rev, a_rev, w[14], MD4C02, MD4S23);
270   MD4_STEP_REV (MD4_H, c_rev, d_rev, a_rev, b_rev, w[ 6], MD4C02, MD4S22);
271   MD4_STEP_REV (MD4_H, d_rev, a_rev, b_rev, c_rev, w[10], MD4C02, MD4S21);
272   MD4_STEP_REV (MD4_H, a_rev, b_rev, c_rev, d_rev, w[ 2], MD4C02, MD4S20);
273   MD4_STEP_REV (MD4_H, b_rev, c_rev, d_rev, a_rev, w[12], MD4C02, MD4S23);
274   MD4_STEP_REV (MD4_H, c_rev, d_rev, a_rev, b_rev, w[ 4], MD4C02, MD4S22);
275   MD4_STEP_REV (MD4_H, d_rev, a_rev, b_rev, c_rev, w[ 8], MD4C02, MD4S21);
276   MD4_STEP_REV (MD4_H, a_rev, b_rev, c_rev, d_rev,     0, MD4C02, MD4S20);
277
278   const u32x sav_c = c_rev;
279   const u32x sav_d = d_rev;
280
281   MD4_STEP_REV1(MD4_G, b_rev, c_rev, d_rev, a_rev, w[15], MD4C01, MD4S13);
282   MD4_STEP_REV1(MD4_G, c_rev, d_rev, a_rev, b_rev, w[11], MD4C01, MD4S12);
283
284   /**
285    * loop
286    */
287
288   u32 w0l = w[0];
289
290   for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
291   {
292     const u32x w0r = words_buf_r[il_pos / VECT_SIZE];
293
294     const u32x w0 = w0l | w0r;
295
296     u32x pre_a = a_rev;
297     u32x pre_b = b_rev;
298     u32x pre_c = c_rev;
299
300     pre_a = pre_a - w0;
301     pre_b = pre_b - MD4_G (sav_c, sav_d, pre_a);
302     pre_c = pre_c - MD4_G (sav_d, pre_a, pre_b);
303
304     u32x tmp2;
305
306     u32x a = MD4M_A;
307     u32x b = MD4M_B;
308     u32x c = MD4M_C;
309     u32x d = MD4M_D;
310
311     MD4_STEP (MD4_Fo, a, b, c, d, w0, F_w0c00, MD4S00);
312     MD4_STEP0(MD4_Fo, d, a, b, c,     F_w1c00, MD4S01);
313     MD4_STEP0(MD4_Fo, c, d, a, b,     F_w2c00, MD4S02);
314     MD4_STEP0(MD4_Fo, b, c, d, a,     F_w3c00, MD4S03);
315     MD4_STEP0(MD4_Fo, a, b, c, d,     F_w4c00, MD4S00);
316     MD4_STEP0(MD4_Fo, d, a, b, c,     F_w5c00, MD4S01);
317     MD4_STEP0(MD4_Fo, c, d, a, b,     F_w6c00, MD4S02);
318     MD4_STEP0(MD4_Fo, b, c, d, a,     F_w7c00, MD4S03);
319     MD4_STEP0(MD4_Fo, a, b, c, d,     F_w8c00, MD4S00);
320     MD4_STEP0(MD4_Fo, d, a, b, c,     F_w9c00, MD4S01);
321     MD4_STEP0(MD4_Fo, c, d, a, b,     F_wac00, MD4S02);
322     MD4_STEP0(MD4_Fo, b, c, d, a,     F_wbc00, MD4S03);
323     MD4_STEP0(MD4_Fo, a, b, c, d,     F_wcc00, MD4S00);
324     MD4_STEP0(MD4_Fo, d, a, b, c,     F_wdc00, MD4S01);
325     MD4_STEP0(MD4_Fo, c, d, a, b,     F_wec00, MD4S02);
326     MD4_STEP0(MD4_Fo, b, c, d, a,     F_wfc00, MD4S03);
327
328     MD4_STEP (MD4_Go, a, b, c, d, w0, G_w0c01, MD4S10);
329     MD4_STEP0(MD4_Go, d, a, b, c,     G_w4c01, MD4S11);
330     MD4_STEP0(MD4_Go, c, d, a, b,     G_w8c01, MD4S12);
331     MD4_STEP0(MD4_Go, b, c, d, a,     G_wcc01, MD4S13);
332     MD4_STEP0(MD4_Go, a, b, c, d,     G_w1c01, MD4S10);
333     MD4_STEP0(MD4_Go, d, a, b, c,     G_w5c01, MD4S11);
334     MD4_STEP0(MD4_Go, c, d, a, b,     G_w9c01, MD4S12);
335     MD4_STEP0(MD4_Go, b, c, d, a,     G_wdc01, MD4S13);
336     MD4_STEP0(MD4_Go, a, b, c, d,     G_w2c01, MD4S10);
337     MD4_STEP0(MD4_Go, d, a, b, c,     G_w6c01, MD4S11);
338     MD4_STEP0(MD4_Go, c, d, a, b,     G_wac01, MD4S12);
339
340     if (MATCHES_NONE_VV (pre_c, c)) continue;
341
342     MD4_STEP0(MD4_Go, b, c, d, a,     G_wec01, MD4S13);
343     MD4_STEP0(MD4_Go, a, b, c, d,     G_w3c01, MD4S10);
344
345     if (MATCHES_NONE_VV (pre_a, a)) continue;
346
347     MD4_STEP0(MD4_Go, d, a, b, c,     G_w7c01, MD4S11);
348     MD4_STEP0(MD4_Go, c, d, a, b,     G_wbc01, MD4S12);
349     MD4_STEP0(MD4_Go, b, c, d, a,     G_wfc01, MD4S13);
350
351     MD4_STEP (MD4_H1, a, b, c, d, w0, H_w0c02, MD4S20);
352     MD4_STEP0(MD4_H2, d, a, b, c,     H_w8c02, MD4S21);
353     MD4_STEP0(MD4_H1, c, d, a, b,     H_w4c02, MD4S22);
354     MD4_STEP0(MD4_H2, b, c, d, a,     H_wcc02, MD4S23);
355     MD4_STEP0(MD4_H1, a, b, c, d,     H_w2c02, MD4S20);
356     MD4_STEP0(MD4_H2, d, a, b, c,     H_wac02, MD4S21);
357     MD4_STEP0(MD4_H1, c, d, a, b,     H_w6c02, MD4S22);
358     MD4_STEP0(MD4_H2, b, c, d, a,     H_wec02, MD4S23);
359     MD4_STEP0(MD4_H1, a, b, c, d,     H_w1c02, MD4S20);
360     MD4_STEP0(MD4_H2, d, a, b, c,     H_w9c02, MD4S21);
361     MD4_STEP0(MD4_H1, c, d, a, b,     H_w5c02, MD4S22);
362     MD4_STEP0(MD4_H2, b, c, d, a,     H_wdc02, MD4S23);
363     MD4_STEP0(MD4_H1, a, b, c, d,     H_w3c02, MD4S20);
364     MD4_STEP0(MD4_H2, d, a, b, c,     H_wbc02, MD4S21);
365     MD4_STEP0(MD4_H1, c, d, a, b,     H_w7c02, MD4S22);
366     MD4_STEP0(MD4_H2, b, c, d, a,     H_wfc02, MD4S23);
367
368     COMPARE_S_SIMD (a, d, c, b);
369   }
370 }
371
372 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m01000_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __constant u32x * words_buf_r, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
373 {
374   /**
375    * base
376    */
377
378   const u32 gid = get_global_id (0);
379
380   if (gid >= gid_max) return;
381
382   u32 w[16];
383
384   w[ 0] = pws[gid].i[ 0];
385   w[ 1] = pws[gid].i[ 1];
386   w[ 2] = pws[gid].i[ 2];
387   w[ 3] = pws[gid].i[ 3];
388   w[ 4] = 0;
389   w[ 5] = 0;
390   w[ 6] = 0;
391   w[ 7] = 0;
392   w[ 8] = 0;
393   w[ 9] = 0;
394   w[10] = 0;
395   w[11] = 0;
396   w[12] = 0;
397   w[13] = 0;
398   w[14] = pws[gid].i[14];
399   w[15] = 0;
400
401   const u32 pw_len = pws[gid].pw_len;
402
403   /**
404    * main
405    */
406
407   m01000m (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);
408 }
409
410 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m01000_m08 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __constant u32x * words_buf_r, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
411 {
412   /**
413    * base
414    */
415
416   const u32 gid = get_global_id (0);
417
418   if (gid >= gid_max) return;
419
420   u32 w[16];
421
422   w[ 0] = pws[gid].i[ 0];
423   w[ 1] = pws[gid].i[ 1];
424   w[ 2] = pws[gid].i[ 2];
425   w[ 3] = pws[gid].i[ 3];
426   w[ 4] = pws[gid].i[ 4];
427   w[ 5] = pws[gid].i[ 5];
428   w[ 6] = pws[gid].i[ 6];
429   w[ 7] = pws[gid].i[ 7];
430   w[ 8] = 0;
431   w[ 9] = 0;
432   w[10] = 0;
433   w[11] = 0;
434   w[12] = 0;
435   w[13] = 0;
436   w[14] = pws[gid].i[14];
437   w[15] = 0;
438
439   const u32 pw_len = pws[gid].pw_len;
440
441   /**
442    * main
443    */
444
445   m01000m (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);
446 }
447
448 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m01000_m16 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __constant u32x * words_buf_r, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
449 {
450   /**
451    * base
452    */
453
454   const u32 gid = get_global_id (0);
455
456   if (gid >= gid_max) return;
457
458   u32 w[16];
459
460   w[ 0] = pws[gid].i[ 0];
461   w[ 1] = pws[gid].i[ 1];
462   w[ 2] = pws[gid].i[ 2];
463   w[ 3] = pws[gid].i[ 3];
464   w[ 4] = pws[gid].i[ 4];
465   w[ 5] = pws[gid].i[ 5];
466   w[ 6] = pws[gid].i[ 6];
467   w[ 7] = pws[gid].i[ 7];
468   w[ 8] = pws[gid].i[ 8];
469   w[ 9] = pws[gid].i[ 9];
470   w[10] = pws[gid].i[10];
471   w[11] = pws[gid].i[11];
472   w[12] = pws[gid].i[12];
473   w[13] = pws[gid].i[13];
474   w[14] = pws[gid].i[14];
475   w[15] = pws[gid].i[15];
476
477   const u32 pw_len = pws[gid].pw_len;
478
479   /**
480    * main
481    */
482
483   m01000m (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);
484 }
485
486 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m01000_s04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __constant u32x * words_buf_r, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
487 {
488   /**
489    * base
490    */
491
492   const u32 gid = get_global_id (0);
493
494   if (gid >= gid_max) return;
495
496   u32 w[16];
497
498   w[ 0] = pws[gid].i[ 0];
499   w[ 1] = pws[gid].i[ 1];
500   w[ 2] = pws[gid].i[ 2];
501   w[ 3] = pws[gid].i[ 3];
502   w[ 4] = 0;
503   w[ 5] = 0;
504   w[ 6] = 0;
505   w[ 7] = 0;
506   w[ 8] = 0;
507   w[ 9] = 0;
508   w[10] = 0;
509   w[11] = 0;
510   w[12] = 0;
511   w[13] = 0;
512   w[14] = pws[gid].i[14];
513   w[15] = 0;
514
515   const u32 pw_len = pws[gid].pw_len;
516
517   /**
518    * main
519    */
520
521   m01000s (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);
522 }
523
524 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m01000_s08 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __constant u32x * words_buf_r, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
525 {
526   /**
527    * base
528    */
529
530   const u32 gid = get_global_id (0);
531
532   if (gid >= gid_max) return;
533
534   u32 w[16];
535
536   w[ 0] = pws[gid].i[ 0];
537   w[ 1] = pws[gid].i[ 1];
538   w[ 2] = pws[gid].i[ 2];
539   w[ 3] = pws[gid].i[ 3];
540   w[ 4] = pws[gid].i[ 4];
541   w[ 5] = pws[gid].i[ 5];
542   w[ 6] = pws[gid].i[ 6];
543   w[ 7] = pws[gid].i[ 7];
544   w[ 8] = 0;
545   w[ 9] = 0;
546   w[10] = 0;
547   w[11] = 0;
548   w[12] = 0;
549   w[13] = 0;
550   w[14] = pws[gid].i[14];
551   w[15] = 0;
552
553   const u32 pw_len = pws[gid].pw_len;
554
555   /**
556    * main
557    */
558
559   m01000s (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);
560 }
561
562 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m01000_s16 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __constant u32x * words_buf_r, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
563 {
564   /**
565    * base
566    */
567
568   const u32 gid = get_global_id (0);
569
570   if (gid >= gid_max) return;
571
572   u32 w[16];
573
574   w[ 0] = pws[gid].i[ 0];
575   w[ 1] = pws[gid].i[ 1];
576   w[ 2] = pws[gid].i[ 2];
577   w[ 3] = pws[gid].i[ 3];
578   w[ 4] = pws[gid].i[ 4];
579   w[ 5] = pws[gid].i[ 5];
580   w[ 6] = pws[gid].i[ 6];
581   w[ 7] = pws[gid].i[ 7];
582   w[ 8] = pws[gid].i[ 8];
583   w[ 9] = pws[gid].i[ 9];
584   w[10] = pws[gid].i[10];
585   w[11] = pws[gid].i[11];
586   w[12] = pws[gid].i[12];
587   w[13] = pws[gid].i[13];
588   w[14] = pws[gid].i[14];
589   w[15] = pws[gid].i[15];
590
591   const u32 pw_len = pws[gid].pw_len;
592
593   /**
594    * main
595    */
596
597   m01000s (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);
598 }