Fix m 60 a 0 by making modified variable non-const
[hashcat.git] / OpenCL / m04800_a3.cl
1 /**
2  * Author......: Jens Steube <jens.steube@gmail.com>
3  * License.....: MIT
4  */
5
6 #define _MD5_
7
8 #define NEW_SIMD_CODE
9
10 #include "inc_vendor.cl"
11 #include "inc_hash_constants.h"
12 #include "inc_hash_functions.cl"
13 #include "inc_types.cl"
14 #include "inc_common.cl"
15 #include "inc_simd.cl"
16
17 void m04800m (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_len, __global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset)
18 {
19   /**
20    * modifier
21    */
22
23   const u32 gid = get_global_id (0);
24   const u32 lid = get_local_id (0);
25
26   /**
27    * salt
28    */
29
30   u32 salt_buf[5];
31
32   salt_buf[0] = salt_bufs[salt_pos].salt_buf[0];
33   salt_buf[1] = salt_bufs[salt_pos].salt_buf[1];
34   salt_buf[2] = salt_bufs[salt_pos].salt_buf[2];
35   salt_buf[3] = salt_bufs[salt_pos].salt_buf[3];
36   salt_buf[4] = salt_bufs[salt_pos].salt_buf[4];
37
38   const u32 salt_len = salt_bufs[salt_pos].salt_len;
39
40   const u32 pw_salt_len = pw_len + salt_len;
41
42   u32 s0[4];
43   u32 s1[4];
44   u32 s2[4];
45   u32 s3[4];
46
47   s0[0] = salt_buf[0];
48   s0[1] = salt_buf[1];
49   s0[2] = salt_buf[2];
50   s0[3] = salt_buf[3];
51   s1[0] = 0x80;
52   s1[1] = 0;
53   s1[2] = 0;
54   s1[3] = 0;
55   s2[0] = 0;
56   s2[1] = 0;
57   s2[2] = 0;
58   s2[3] = 0;
59   s3[0] = 0;
60   s3[1] = 0;
61   s3[2] = 0;
62   s3[3] = 0;
63
64   switch_buffer_by_offset_le_S (s0, s1, s2, s3, pw_len);
65
66   w0[0] |= s0[0];
67   w0[1] |= s0[1];
68   w0[2] |= s0[2];
69   w0[3] |= s0[3];
70   w1[0] |= s1[0];
71   w1[1] |= s1[1];
72   w1[2] |= s1[2];
73   w1[3] |= s1[3];
74   w2[0] |= s2[0];
75   w2[1] |= s2[1];
76   w2[2] |= s2[2];
77   w2[3] |= s2[3];
78   w3[0] |= s3[0];
79   w3[1] |= s3[1];
80   w3[2] |= s3[2];
81   w3[3] |= s3[3];
82
83   switch_buffer_by_offset_le_S (w0, w1, w2, w3, 1);
84
85   w0[0] |= salt_buf[4];
86
87   const u32 w0l = w0[0];
88   const u32 w1l = w0[1];
89
90   w3[2] = pw_salt_len * 8;
91   w3[3] = 0;
92
93   /**
94    * loop
95    */
96
97   for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
98   {
99     const u32x w0r = ix_create_bft (bfs_buf, il_pos);
100
101     const u32x w0lr = w0l | w0r;
102
103     u32x w0_t = w0l | (w0r <<  8);
104     u32x w1_t = w1l | (w0r >> 24);
105     u32x w2_t = w0[2];
106     u32x w3_t = w0[3];
107     u32x w4_t = w1[0];
108     u32x w5_t = w1[1];
109     u32x w6_t = w1[2];
110     u32x w7_t = w1[3];
111     u32x w8_t = w2[0];
112     u32x w9_t = w2[1];
113     u32x wa_t = w2[2];
114     u32x wb_t = w2[3];
115     u32x wc_t = w3[0];
116     u32x wd_t = w3[1];
117     u32x we_t = w3[2];
118     u32x wf_t = w3[3];
119
120     /**
121      * md5
122      */
123
124     u32x a = MD5M_A;
125     u32x b = MD5M_B;
126     u32x c = MD5M_C;
127     u32x d = MD5M_D;
128
129     MD5_STEP (MD5_Fo, a, b, c, d, w0_t, MD5C00, MD5S00);
130     MD5_STEP (MD5_Fo, d, a, b, c, w1_t, MD5C01, MD5S01);
131     MD5_STEP (MD5_Fo, c, d, a, b, w2_t, MD5C02, MD5S02);
132     MD5_STEP (MD5_Fo, b, c, d, a, w3_t, MD5C03, MD5S03);
133     MD5_STEP (MD5_Fo, a, b, c, d, w4_t, MD5C04, MD5S00);
134     MD5_STEP (MD5_Fo, d, a, b, c, w5_t, MD5C05, MD5S01);
135     MD5_STEP (MD5_Fo, c, d, a, b, w6_t, MD5C06, MD5S02);
136     MD5_STEP (MD5_Fo, b, c, d, a, w7_t, MD5C07, MD5S03);
137     MD5_STEP (MD5_Fo, a, b, c, d, w8_t, MD5C08, MD5S00);
138     MD5_STEP (MD5_Fo, d, a, b, c, w9_t, MD5C09, MD5S01);
139     MD5_STEP (MD5_Fo, c, d, a, b, wa_t, MD5C0a, MD5S02);
140     MD5_STEP (MD5_Fo, b, c, d, a, wb_t, MD5C0b, MD5S03);
141     MD5_STEP (MD5_Fo, a, b, c, d, wc_t, MD5C0c, MD5S00);
142     MD5_STEP (MD5_Fo, d, a, b, c, wd_t, MD5C0d, MD5S01);
143     MD5_STEP (MD5_Fo, c, d, a, b, we_t, MD5C0e, MD5S02);
144     MD5_STEP (MD5_Fo, b, c, d, a, wf_t, MD5C0f, MD5S03);
145
146     MD5_STEP (MD5_Go, a, b, c, d, w1_t, MD5C10, MD5S10);
147     MD5_STEP (MD5_Go, d, a, b, c, w6_t, MD5C11, MD5S11);
148     MD5_STEP (MD5_Go, c, d, a, b, wb_t, MD5C12, MD5S12);
149     MD5_STEP (MD5_Go, b, c, d, a, w0_t, MD5C13, MD5S13);
150     MD5_STEP (MD5_Go, a, b, c, d, w5_t, MD5C14, MD5S10);
151     MD5_STEP (MD5_Go, d, a, b, c, wa_t, MD5C15, MD5S11);
152     MD5_STEP (MD5_Go, c, d, a, b, wf_t, MD5C16, MD5S12);
153     MD5_STEP (MD5_Go, b, c, d, a, w4_t, MD5C17, MD5S13);
154     MD5_STEP (MD5_Go, a, b, c, d, w9_t, MD5C18, MD5S10);
155     MD5_STEP (MD5_Go, d, a, b, c, we_t, MD5C19, MD5S11);
156     MD5_STEP (MD5_Go, c, d, a, b, w3_t, MD5C1a, MD5S12);
157     MD5_STEP (MD5_Go, b, c, d, a, w8_t, MD5C1b, MD5S13);
158     MD5_STEP (MD5_Go, a, b, c, d, wd_t, MD5C1c, MD5S10);
159     MD5_STEP (MD5_Go, d, a, b, c, w2_t, MD5C1d, MD5S11);
160     MD5_STEP (MD5_Go, c, d, a, b, w7_t, MD5C1e, MD5S12);
161     MD5_STEP (MD5_Go, b, c, d, a, wc_t, MD5C1f, MD5S13);
162
163     MD5_STEP (MD5_H , a, b, c, d, w5_t, MD5C20, MD5S20);
164     MD5_STEP (MD5_H , d, a, b, c, w8_t, MD5C21, MD5S21);
165     MD5_STEP (MD5_H , c, d, a, b, wb_t, MD5C22, MD5S22);
166     MD5_STEP (MD5_H , b, c, d, a, we_t, MD5C23, MD5S23);
167     MD5_STEP (MD5_H , a, b, c, d, w1_t, MD5C24, MD5S20);
168     MD5_STEP (MD5_H , d, a, b, c, w4_t, MD5C25, MD5S21);
169     MD5_STEP (MD5_H , c, d, a, b, w7_t, MD5C26, MD5S22);
170     MD5_STEP (MD5_H , b, c, d, a, wa_t, MD5C27, MD5S23);
171     MD5_STEP (MD5_H , a, b, c, d, wd_t, MD5C28, MD5S20);
172     MD5_STEP (MD5_H , d, a, b, c, w0_t, MD5C29, MD5S21);
173     MD5_STEP (MD5_H , c, d, a, b, w3_t, MD5C2a, MD5S22);
174     MD5_STEP (MD5_H , b, c, d, a, w6_t, MD5C2b, MD5S23);
175     MD5_STEP (MD5_H , a, b, c, d, w9_t, MD5C2c, MD5S20);
176     MD5_STEP (MD5_H , d, a, b, c, wc_t, MD5C2d, MD5S21);
177     MD5_STEP (MD5_H , c, d, a, b, wf_t, MD5C2e, MD5S22);
178     MD5_STEP (MD5_H , b, c, d, a, w2_t, MD5C2f, MD5S23);
179
180     MD5_STEP (MD5_I , a, b, c, d, w0_t, MD5C30, MD5S30);
181     MD5_STEP (MD5_I , d, a, b, c, w7_t, MD5C31, MD5S31);
182     MD5_STEP (MD5_I , c, d, a, b, we_t, MD5C32, MD5S32);
183     MD5_STEP (MD5_I , b, c, d, a, w5_t, MD5C33, MD5S33);
184     MD5_STEP (MD5_I , a, b, c, d, wc_t, MD5C34, MD5S30);
185     MD5_STEP (MD5_I , d, a, b, c, w3_t, MD5C35, MD5S31);
186     MD5_STEP (MD5_I , c, d, a, b, wa_t, MD5C36, MD5S32);
187     MD5_STEP (MD5_I , b, c, d, a, w1_t, MD5C37, MD5S33);
188     MD5_STEP (MD5_I , a, b, c, d, w8_t, MD5C38, MD5S30);
189     MD5_STEP (MD5_I , d, a, b, c, wf_t, MD5C39, MD5S31);
190     MD5_STEP (MD5_I , c, d, a, b, w6_t, MD5C3a, MD5S32);
191     MD5_STEP (MD5_I , b, c, d, a, wd_t, MD5C3b, MD5S33);
192     MD5_STEP (MD5_I , a, b, c, d, w4_t, MD5C3c, MD5S30);
193     MD5_STEP (MD5_I , d, a, b, c, wb_t, MD5C3d, MD5S31);
194     MD5_STEP (MD5_I , c, d, a, b, w2_t, MD5C3e, MD5S32);
195     MD5_STEP (MD5_I , b, c, d, a, w9_t, MD5C3f, MD5S33);
196
197     COMPARE_M_SIMD (a, d, c, b);
198   }
199 }
200
201 void m04800s (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_len, __global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset)
202 {
203   /**
204    * modifier
205    */
206
207   const u32 gid = get_global_id (0);
208   const u32 lid = get_local_id (0);
209
210   /**
211    * salt
212    */
213
214   u32 salt_buf[5];
215
216   salt_buf[0] = salt_bufs[salt_pos].salt_buf[0];
217   salt_buf[1] = salt_bufs[salt_pos].salt_buf[1];
218   salt_buf[2] = salt_bufs[salt_pos].salt_buf[2];
219   salt_buf[3] = salt_bufs[salt_pos].salt_buf[3];
220   salt_buf[4] = salt_bufs[salt_pos].salt_buf[4];
221
222   const u32 salt_len = salt_bufs[salt_pos].salt_len;
223
224   const u32 pw_salt_len = pw_len + salt_len;
225
226   u32 s0[4];
227   u32 s1[4];
228   u32 s2[4];
229   u32 s3[4];
230
231   s0[0] = salt_buf[0];
232   s0[1] = salt_buf[1];
233   s0[2] = salt_buf[2];
234   s0[3] = salt_buf[3];
235   s1[0] = 0x80;
236   s1[1] = 0;
237   s1[2] = 0;
238   s1[3] = 0;
239   s2[0] = 0;
240   s2[1] = 0;
241   s2[2] = 0;
242   s2[3] = 0;
243   s3[0] = 0;
244   s3[1] = 0;
245   s3[2] = 0;
246   s3[3] = 0;
247
248   switch_buffer_by_offset_le_S (s0, s1, s2, s3, pw_len);
249
250   w0[0] |= s0[0];
251   w0[1] |= s0[1];
252   w0[2] |= s0[2];
253   w0[3] |= s0[3];
254   w1[0] |= s1[0];
255   w1[1] |= s1[1];
256   w1[2] |= s1[2];
257   w1[3] |= s1[3];
258   w2[0] |= s2[0];
259   w2[1] |= s2[1];
260   w2[2] |= s2[2];
261   w2[3] |= s2[3];
262   w3[0] |= s3[0];
263   w3[1] |= s3[1];
264   w3[2] |= s3[2];
265   w3[3] |= s3[3];
266
267   switch_buffer_by_offset_le_S (w0, w1, w2, w3, 1);
268
269   w0[0] |= salt_buf[4];
270
271   const u32 w0l = w0[0];
272   const u32 w1l = w0[1];
273
274   w3[2] = pw_salt_len * 8;
275   w3[3] = 0;
276
277   /**
278    * digest
279    */
280
281   const u32 search[4] =
282   {
283     digests_buf[digests_offset].digest_buf[DGST_R0],
284     digests_buf[digests_offset].digest_buf[DGST_R1],
285     digests_buf[digests_offset].digest_buf[DGST_R2],
286     digests_buf[digests_offset].digest_buf[DGST_R3]
287   };
288
289   /**
290    * loop
291    */
292
293   for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
294   {
295     const u32x w0r = ix_create_bft (bfs_buf, il_pos);
296
297     const u32x w0lr = w0l | w0r;
298
299     u32x w0_t = w0l | (w0r <<  8);
300     u32x w1_t = w1l | (w0r >> 24);
301     u32x w2_t = w0[2];
302     u32x w3_t = w0[3];
303     u32x w4_t = w1[0];
304     u32x w5_t = w1[1];
305     u32x w6_t = w1[2];
306     u32x w7_t = w1[3];
307     u32x w8_t = w2[0];
308     u32x w9_t = w2[1];
309     u32x wa_t = w2[2];
310     u32x wb_t = w2[3];
311     u32x wc_t = w3[0];
312     u32x wd_t = w3[1];
313     u32x we_t = w3[2];
314     u32x wf_t = w3[3];
315
316     /**
317      * md5
318      */
319
320     u32x a = MD5M_A;
321     u32x b = MD5M_B;
322     u32x c = MD5M_C;
323     u32x d = MD5M_D;
324
325     MD5_STEP (MD5_Fo, a, b, c, d, w0_t, MD5C00, MD5S00);
326     MD5_STEP (MD5_Fo, d, a, b, c, w1_t, MD5C01, MD5S01);
327     MD5_STEP (MD5_Fo, c, d, a, b, w2_t, MD5C02, MD5S02);
328     MD5_STEP (MD5_Fo, b, c, d, a, w3_t, MD5C03, MD5S03);
329     MD5_STEP (MD5_Fo, a, b, c, d, w4_t, MD5C04, MD5S00);
330     MD5_STEP (MD5_Fo, d, a, b, c, w5_t, MD5C05, MD5S01);
331     MD5_STEP (MD5_Fo, c, d, a, b, w6_t, MD5C06, MD5S02);
332     MD5_STEP (MD5_Fo, b, c, d, a, w7_t, MD5C07, MD5S03);
333     MD5_STEP (MD5_Fo, a, b, c, d, w8_t, MD5C08, MD5S00);
334     MD5_STEP (MD5_Fo, d, a, b, c, w9_t, MD5C09, MD5S01);
335     MD5_STEP (MD5_Fo, c, d, a, b, wa_t, MD5C0a, MD5S02);
336     MD5_STEP (MD5_Fo, b, c, d, a, wb_t, MD5C0b, MD5S03);
337     MD5_STEP (MD5_Fo, a, b, c, d, wc_t, MD5C0c, MD5S00);
338     MD5_STEP (MD5_Fo, d, a, b, c, wd_t, MD5C0d, MD5S01);
339     MD5_STEP (MD5_Fo, c, d, a, b, we_t, MD5C0e, MD5S02);
340     MD5_STEP (MD5_Fo, b, c, d, a, wf_t, MD5C0f, MD5S03);
341
342     MD5_STEP (MD5_Go, a, b, c, d, w1_t, MD5C10, MD5S10);
343     MD5_STEP (MD5_Go, d, a, b, c, w6_t, MD5C11, MD5S11);
344     MD5_STEP (MD5_Go, c, d, a, b, wb_t, MD5C12, MD5S12);
345     MD5_STEP (MD5_Go, b, c, d, a, w0_t, MD5C13, MD5S13);
346     MD5_STEP (MD5_Go, a, b, c, d, w5_t, MD5C14, MD5S10);
347     MD5_STEP (MD5_Go, d, a, b, c, wa_t, MD5C15, MD5S11);
348     MD5_STEP (MD5_Go, c, d, a, b, wf_t, MD5C16, MD5S12);
349     MD5_STEP (MD5_Go, b, c, d, a, w4_t, MD5C17, MD5S13);
350     MD5_STEP (MD5_Go, a, b, c, d, w9_t, MD5C18, MD5S10);
351     MD5_STEP (MD5_Go, d, a, b, c, we_t, MD5C19, MD5S11);
352     MD5_STEP (MD5_Go, c, d, a, b, w3_t, MD5C1a, MD5S12);
353     MD5_STEP (MD5_Go, b, c, d, a, w8_t, MD5C1b, MD5S13);
354     MD5_STEP (MD5_Go, a, b, c, d, wd_t, MD5C1c, MD5S10);
355     MD5_STEP (MD5_Go, d, a, b, c, w2_t, MD5C1d, MD5S11);
356     MD5_STEP (MD5_Go, c, d, a, b, w7_t, MD5C1e, MD5S12);
357     MD5_STEP (MD5_Go, b, c, d, a, wc_t, MD5C1f, MD5S13);
358
359     MD5_STEP (MD5_H , a, b, c, d, w5_t, MD5C20, MD5S20);
360     MD5_STEP (MD5_H , d, a, b, c, w8_t, MD5C21, MD5S21);
361     MD5_STEP (MD5_H , c, d, a, b, wb_t, MD5C22, MD5S22);
362     MD5_STEP (MD5_H , b, c, d, a, we_t, MD5C23, MD5S23);
363     MD5_STEP (MD5_H , a, b, c, d, w1_t, MD5C24, MD5S20);
364     MD5_STEP (MD5_H , d, a, b, c, w4_t, MD5C25, MD5S21);
365     MD5_STEP (MD5_H , c, d, a, b, w7_t, MD5C26, MD5S22);
366     MD5_STEP (MD5_H , b, c, d, a, wa_t, MD5C27, MD5S23);
367     MD5_STEP (MD5_H , a, b, c, d, wd_t, MD5C28, MD5S20);
368     MD5_STEP (MD5_H , d, a, b, c, w0_t, MD5C29, MD5S21);
369     MD5_STEP (MD5_H , c, d, a, b, w3_t, MD5C2a, MD5S22);
370     MD5_STEP (MD5_H , b, c, d, a, w6_t, MD5C2b, MD5S23);
371     MD5_STEP (MD5_H , a, b, c, d, w9_t, MD5C2c, MD5S20);
372     MD5_STEP (MD5_H , d, a, b, c, wc_t, MD5C2d, MD5S21);
373     MD5_STEP (MD5_H , c, d, a, b, wf_t, MD5C2e, MD5S22);
374     MD5_STEP (MD5_H , b, c, d, a, w2_t, MD5C2f, MD5S23);
375
376     MD5_STEP (MD5_I , a, b, c, d, w0_t, MD5C30, MD5S30);
377     MD5_STEP (MD5_I , d, a, b, c, w7_t, MD5C31, MD5S31);
378     MD5_STEP (MD5_I , c, d, a, b, we_t, MD5C32, MD5S32);
379     MD5_STEP (MD5_I , b, c, d, a, w5_t, MD5C33, MD5S33);
380     MD5_STEP (MD5_I , a, b, c, d, wc_t, MD5C34, MD5S30);
381     MD5_STEP (MD5_I , d, a, b, c, w3_t, MD5C35, MD5S31);
382     MD5_STEP (MD5_I , c, d, a, b, wa_t, MD5C36, MD5S32);
383     MD5_STEP (MD5_I , b, c, d, a, w1_t, MD5C37, MD5S33);
384     MD5_STEP (MD5_I , a, b, c, d, w8_t, MD5C38, MD5S30);
385     MD5_STEP (MD5_I , d, a, b, c, wf_t, MD5C39, MD5S31);
386     MD5_STEP (MD5_I , c, d, a, b, w6_t, MD5C3a, MD5S32);
387     MD5_STEP (MD5_I , b, c, d, a, wd_t, MD5C3b, MD5S33);
388     MD5_STEP (MD5_I , a, b, c, d, w4_t, MD5C3c, MD5S30);
389
390     if (MATCHES_NONE_VS (a, search[0])) continue;
391
392     MD5_STEP (MD5_I , d, a, b, c, wb_t, MD5C3d, MD5S31);
393     MD5_STEP (MD5_I , c, d, a, b, w2_t, MD5C3e, MD5S32);
394     MD5_STEP (MD5_I , b, c, d, a, w9_t, MD5C3f, MD5S33);
395
396     COMPARE_S_SIMD (a, d, c, b);
397   }
398 }
399
400 __kernel void m04800_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
401 {
402   /**
403    * base
404    */
405
406   const u32 gid = get_global_id (0);
407
408   if (gid >= gid_max) return;
409
410   /**
411    * modifier
412    */
413
414   const u32 lid = get_local_id (0);
415
416
417   u32 w0[4];
418
419   w0[0] = pws[gid].i[ 0];
420   w0[1] = pws[gid].i[ 1];
421   w0[2] = pws[gid].i[ 2];
422   w0[3] = pws[gid].i[ 3];
423
424   u32 w1[4];
425
426   w1[0] = 0;
427   w1[1] = 0;
428   w1[2] = 0;
429   w1[3] = 0;
430
431   u32 w2[4];
432
433   w2[0] = 0;
434   w2[1] = 0;
435   w2[2] = 0;
436   w2[3] = 0;
437
438   u32 w3[4];
439
440   w3[0] = 0;
441   w3[1] = 0;
442   w3[2] = 0;
443   w3[3] = 0;
444
445   const u32 pw_len = pws[gid].pw_len;
446
447   /**
448    * main
449    */
450
451   m04800m (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset);
452 }
453
454 __kernel void m04800_m08 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
455 {
456   /**
457    * base
458    */
459
460   const u32 gid = get_global_id (0);
461
462   if (gid >= gid_max) return;
463
464   /**
465    * modifier
466    */
467
468   const u32 lid = get_local_id (0);
469
470   u32 w0[4];
471
472   w0[0] = pws[gid].i[ 0];
473   w0[1] = pws[gid].i[ 1];
474   w0[2] = pws[gid].i[ 2];
475   w0[3] = pws[gid].i[ 3];
476
477   u32 w1[4];
478
479   w1[0] = pws[gid].i[ 4];
480   w1[1] = pws[gid].i[ 5];
481   w1[2] = pws[gid].i[ 6];
482   w1[3] = pws[gid].i[ 7];
483
484   u32 w2[4];
485
486   w2[0] = 0;
487   w2[1] = 0;
488   w2[2] = 0;
489   w2[3] = 0;
490
491   u32 w3[4];
492
493   w3[0] = 0;
494   w3[1] = 0;
495   w3[2] = 0;
496   w3[3] = 0;
497
498   const u32 pw_len = pws[gid].pw_len;
499
500   /**
501    * main
502    */
503
504   m04800m (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset);
505 }
506
507 __kernel void m04800_m16 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
508 {
509   /**
510    * base
511    */
512
513   const u32 gid = get_global_id (0);
514
515   if (gid >= gid_max) return;
516
517   /**
518    * modifier
519    */
520
521   const u32 lid = get_local_id (0);
522
523   u32 w0[4];
524
525   w0[0] = pws[gid].i[ 0];
526   w0[1] = pws[gid].i[ 1];
527   w0[2] = pws[gid].i[ 2];
528   w0[3] = pws[gid].i[ 3];
529
530   u32 w1[4];
531
532   w1[0] = pws[gid].i[ 4];
533   w1[1] = pws[gid].i[ 5];
534   w1[2] = pws[gid].i[ 6];
535   w1[3] = pws[gid].i[ 7];
536
537   u32 w2[4];
538
539   w2[0] = pws[gid].i[ 8];
540   w2[1] = pws[gid].i[ 9];
541   w2[2] = pws[gid].i[10];
542   w2[3] = pws[gid].i[11];
543
544   u32 w3[4];
545
546   w3[0] = pws[gid].i[12];
547   w3[1] = pws[gid].i[13];
548   w3[2] = pws[gid].i[14];
549   w3[3] = pws[gid].i[15];
550
551   const u32 pw_len = pws[gid].pw_len;
552
553   /**
554    * main
555    */
556
557   m04800m (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset);
558 }
559
560 __kernel void m04800_s04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
561 {
562   /**
563    * base
564    */
565
566   const u32 gid = get_global_id (0);
567
568   if (gid >= gid_max) return;
569
570   /**
571    * modifier
572    */
573
574   const u32 lid = get_local_id (0);
575
576   u32 w0[4];
577
578   w0[0] = pws[gid].i[ 0];
579   w0[1] = pws[gid].i[ 1];
580   w0[2] = pws[gid].i[ 2];
581   w0[3] = pws[gid].i[ 3];
582
583   u32 w1[4];
584
585   w1[0] = 0;
586   w1[1] = 0;
587   w1[2] = 0;
588   w1[3] = 0;
589
590   u32 w2[4];
591
592   w2[0] = 0;
593   w2[1] = 0;
594   w2[2] = 0;
595   w2[3] = 0;
596
597   u32 w3[4];
598
599   w3[0] = 0;
600   w3[1] = 0;
601   w3[2] = 0;
602   w3[3] = 0;
603
604   const u32 pw_len = pws[gid].pw_len;
605
606   /**
607    * main
608    */
609
610   m04800s (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset);
611 }
612
613 __kernel void m04800_s08 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
614 {
615   /**
616    * base
617    */
618
619   const u32 gid = get_global_id (0);
620
621   if (gid >= gid_max) return;
622
623   /**
624    * modifier
625    */
626
627   const u32 lid = get_local_id (0);
628
629   u32 w0[4];
630
631   w0[0] = pws[gid].i[ 0];
632   w0[1] = pws[gid].i[ 1];
633   w0[2] = pws[gid].i[ 2];
634   w0[3] = pws[gid].i[ 3];
635
636   u32 w1[4];
637
638   w1[0] = pws[gid].i[ 4];
639   w1[1] = pws[gid].i[ 5];
640   w1[2] = pws[gid].i[ 6];
641   w1[3] = pws[gid].i[ 7];
642
643   u32 w2[4];
644
645   w2[0] = 0;
646   w2[1] = 0;
647   w2[2] = 0;
648   w2[3] = 0;
649
650   u32 w3[4];
651
652   w3[0] = 0;
653   w3[1] = 0;
654   w3[2] = 0;
655   w3[3] = 0;
656
657   const u32 pw_len = pws[gid].pw_len;
658
659   /**
660    * main
661    */
662
663   m04800s (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset);
664 }
665
666 __kernel void m04800_s16 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
667 {
668   /**
669    * base
670    */
671
672   const u32 gid = get_global_id (0);
673
674   if (gid >= gid_max) return;
675
676   /**
677    * modifier
678    */
679
680   const u32 lid = get_local_id (0);
681
682   u32 w0[4];
683
684   w0[0] = pws[gid].i[ 0];
685   w0[1] = pws[gid].i[ 1];
686   w0[2] = pws[gid].i[ 2];
687   w0[3] = pws[gid].i[ 3];
688
689   u32 w1[4];
690
691   w1[0] = pws[gid].i[ 4];
692   w1[1] = pws[gid].i[ 5];
693   w1[2] = pws[gid].i[ 6];
694   w1[3] = pws[gid].i[ 7];
695
696   u32 w2[4];
697
698   w2[0] = pws[gid].i[ 8];
699   w2[1] = pws[gid].i[ 9];
700   w2[2] = pws[gid].i[10];
701   w2[3] = pws[gid].i[11];
702
703   u32 w3[4];
704
705   w3[0] = pws[gid].i[12];
706   w3[1] = pws[gid].i[13];
707   w3[2] = pws[gid].i[14];
708   w3[3] = pws[gid].i[15];
709
710   const u32 pw_len = pws[gid].pw_len;
711
712   /**
713    * main
714    */
715
716   m04800s (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset);
717 }