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