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