Fix m 60 a 0 by making modified variable non-const
[hashcat.git] / OpenCL / m03800_a0.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_rp.h"
16 #include "inc_rp.cl"
17 #include "inc_simd.cl"
18
19 __kernel void m03800_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)
20 {
21   /**
22    * modifier
23    */
24
25   const u32 lid = get_local_id (0);
26
27   /**
28    * base
29    */
30
31   const u32 gid = get_global_id (0);
32
33   if (gid >= gid_max) return;
34
35   u32 pw_buf0[4];
36   u32 pw_buf1[4];
37
38   pw_buf0[0] = pws[gid].i[0];
39   pw_buf0[1] = pws[gid].i[1];
40   pw_buf0[2] = pws[gid].i[2];
41   pw_buf0[3] = pws[gid].i[3];
42   pw_buf1[0] = pws[gid].i[4];
43   pw_buf1[1] = pws[gid].i[5];
44   pw_buf1[2] = pws[gid].i[6];
45   pw_buf1[3] = pws[gid].i[7];
46
47   const u32 pw_len = pws[gid].pw_len;
48
49   /**
50    * salt
51    */
52
53   u32 salt_buf0[4];
54   u32 salt_buf1[4];
55   u32 salt_buf2[4];
56   u32 salt_buf3[4];
57
58   salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
59   salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
60   salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
61   salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
62   salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
63   salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
64   salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
65   salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
66   salt_buf2[0] = salt_bufs[salt_pos].salt_buf[ 8];
67   salt_buf2[1] = salt_bufs[salt_pos].salt_buf[ 9];
68   salt_buf2[2] = salt_bufs[salt_pos].salt_buf[10];
69   salt_buf2[3] = salt_bufs[salt_pos].salt_buf[11];
70   salt_buf3[0] = salt_bufs[salt_pos].salt_buf[12];
71   salt_buf3[1] = salt_bufs[salt_pos].salt_buf[13];
72   salt_buf3[2] = salt_bufs[salt_pos].salt_buf[14];
73   salt_buf3[3] = salt_bufs[salt_pos].salt_buf[15];
74
75   const u32 salt_len = salt_bufs[salt_pos].salt_len;
76
77   /**
78    * loop
79    */
80
81   for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
82   {
83     u32x w0[4] = { 0 };
84     u32x w1[4] = { 0 };
85     u32x w2[4] = { 0 };
86     u32x w3[4] = { 0 };
87
88     const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1);
89
90     /**
91      * prepend salt
92      */
93
94     const u32x out_salt_len = out_len + salt_len;
95
96     switch_buffer_by_offset_le_VV (w0, w1, w2, w3, salt_len);
97
98     w0[0] |= salt_buf0[0];
99     w0[1] |= salt_buf0[1];
100     w0[2] |= salt_buf0[2];
101     w0[3] |= salt_buf0[3];
102     w1[0] |= salt_buf1[0];
103     w1[1] |= salt_buf1[1];
104     w1[2] |= salt_buf1[2];
105     w1[3] |= salt_buf1[3];
106     w2[0] |= salt_buf2[0];
107     w2[1] |= salt_buf2[1];
108     w2[2] |= salt_buf2[2];
109     w2[3] |= salt_buf2[3];
110     w3[0] |= salt_buf3[0];
111     w3[1] |= salt_buf3[1];
112     w3[2] |= salt_buf3[2];
113     w3[3] |= salt_buf3[3];
114
115     /**
116      * append salt
117      */
118
119     u32x s0[4];
120     u32x s1[4];
121     u32x s2[4];
122     u32x s3[4];
123
124     s0[0] = salt_buf0[0];
125     s0[1] = salt_buf0[1];
126     s0[2] = salt_buf0[2];
127     s0[3] = salt_buf0[3];
128     s1[0] = salt_buf1[0];
129     s1[1] = salt_buf1[1];
130     s1[2] = salt_buf1[2];
131     s1[3] = salt_buf1[3];
132     s2[0] = salt_buf2[0];
133     s2[1] = salt_buf2[1];
134     s2[2] = salt_buf2[2];
135     s2[3] = salt_buf2[3];
136     s3[0] = salt_buf3[0];
137     s3[1] = salt_buf3[1];
138     s3[2] = salt_buf3[2];
139     s3[3] = salt_buf3[3];
140
141     switch_buffer_by_offset_le_VV (s0, s1, s2, s3, out_salt_len);
142
143     w0[0] |= s0[0];
144     w0[1] |= s0[1];
145     w0[2] |= s0[2];
146     w0[3] |= s0[3];
147     w1[0] |= s1[0];
148     w1[1] |= s1[1];
149     w1[2] |= s1[2];
150     w1[3] |= s1[3];
151     w2[0] |= s2[0];
152     w2[1] |= s2[1];
153     w2[2] |= s2[2];
154     w2[3] |= s2[3];
155     w3[0] |= s3[0];
156     w3[1] |= s3[1];
157     w3[2] |= s3[2];
158     w3[3] |= s3[3];
159
160     const u32x salt_out_salt_len = salt_len + out_len + salt_len;
161
162     append_0x80_4x4_VV (w0, w1, w2, w3, salt_out_salt_len);
163
164     w3[2] = salt_out_salt_len * 8;
165     w3[3] = 0;
166
167     /**
168      * md5
169      */
170
171     u32x a = MD5M_A;
172     u32x b = MD5M_B;
173     u32x c = MD5M_C;
174     u32x d = MD5M_D;
175
176     MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
177     MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
178     MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
179     MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
180     MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
181     MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
182     MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
183     MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
184     MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
185     MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
186     MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
187     MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
188     MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
189     MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
190     MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
191     MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
192
193     MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
194     MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
195     MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
196     MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
197     MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
198     MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
199     MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
200     MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
201     MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
202     MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
203     MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
204     MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
205     MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
206     MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
207     MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
208     MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
209
210     MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
211     MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
212     MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
213     MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
214     MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
215     MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
216     MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
217     MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
218     MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
219     MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
220     MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
221     MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
222     MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
223     MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
224     MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
225     MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
226
227     MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
228     MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
229     MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
230     MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
231     MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
232     MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
233     MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
234     MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
235     MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
236     MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
237     MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
238     MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
239     MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
240     MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
241     MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
242     MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
243
244     COMPARE_M_SIMD (a, d, c, b);
245   }
246 }
247
248 __kernel void m03800_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)
249 {
250 }
251
252 __kernel void m03800_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)
253 {
254 }
255
256 __kernel void m03800_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)
257 {
258   /**
259    * modifier
260    */
261
262   const u32 lid = get_local_id (0);
263
264   /**
265    * base
266    */
267
268   const u32 gid = get_global_id (0);
269
270   if (gid >= gid_max) return;
271
272   u32 pw_buf0[4];
273   u32 pw_buf1[4];
274
275   pw_buf0[0] = pws[gid].i[0];
276   pw_buf0[1] = pws[gid].i[1];
277   pw_buf0[2] = pws[gid].i[2];
278   pw_buf0[3] = pws[gid].i[3];
279   pw_buf1[0] = pws[gid].i[4];
280   pw_buf1[1] = pws[gid].i[5];
281   pw_buf1[2] = pws[gid].i[6];
282   pw_buf1[3] = pws[gid].i[7];
283
284   const u32 pw_len = pws[gid].pw_len;
285
286   /**
287    * salt
288    */
289
290   u32 salt_buf0[4];
291   u32 salt_buf1[4];
292   u32 salt_buf2[4];
293   u32 salt_buf3[4];
294
295   salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
296   salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
297   salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
298   salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
299   salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
300   salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
301   salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
302   salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
303   salt_buf2[0] = salt_bufs[salt_pos].salt_buf[ 8];
304   salt_buf2[1] = salt_bufs[salt_pos].salt_buf[ 9];
305   salt_buf2[2] = salt_bufs[salt_pos].salt_buf[10];
306   salt_buf2[3] = salt_bufs[salt_pos].salt_buf[11];
307   salt_buf3[0] = salt_bufs[salt_pos].salt_buf[12];
308   salt_buf3[1] = salt_bufs[salt_pos].salt_buf[13];
309   salt_buf3[2] = salt_bufs[salt_pos].salt_buf[14];
310   salt_buf3[3] = salt_bufs[salt_pos].salt_buf[15];
311
312   const u32 salt_len = salt_bufs[salt_pos].salt_len;
313
314   /**
315    * digest
316    */
317
318   const u32 search[4] =
319   {
320     digests_buf[digests_offset].digest_buf[DGST_R0],
321     digests_buf[digests_offset].digest_buf[DGST_R1],
322     digests_buf[digests_offset].digest_buf[DGST_R2],
323     digests_buf[digests_offset].digest_buf[DGST_R3]
324   };
325
326   /**
327    * loop
328    */
329
330   for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
331   {
332     u32x w0[4] = { 0 };
333     u32x w1[4] = { 0 };
334     u32x w2[4] = { 0 };
335     u32x w3[4] = { 0 };
336
337     const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1);
338
339     /**
340      * prepend salt
341      */
342
343     const u32x out_salt_len = out_len + salt_len;
344
345     switch_buffer_by_offset_le_VV (w0, w1, w2, w3, salt_len);
346
347     w0[0] |= salt_buf0[0];
348     w0[1] |= salt_buf0[1];
349     w0[2] |= salt_buf0[2];
350     w0[3] |= salt_buf0[3];
351     w1[0] |= salt_buf1[0];
352     w1[1] |= salt_buf1[1];
353     w1[2] |= salt_buf1[2];
354     w1[3] |= salt_buf1[3];
355     w2[0] |= salt_buf2[0];
356     w2[1] |= salt_buf2[1];
357     w2[2] |= salt_buf2[2];
358     w2[3] |= salt_buf2[3];
359     w3[0] |= salt_buf3[0];
360     w3[1] |= salt_buf3[1];
361     w3[2] |= salt_buf3[2];
362     w3[3] |= salt_buf3[3];
363
364     /**
365      * append salt
366      */
367
368     u32x s0[4];
369     u32x s1[4];
370     u32x s2[4];
371     u32x s3[4];
372
373     s0[0] = salt_buf0[0];
374     s0[1] = salt_buf0[1];
375     s0[2] = salt_buf0[2];
376     s0[3] = salt_buf0[3];
377     s1[0] = salt_buf1[0];
378     s1[1] = salt_buf1[1];
379     s1[2] = salt_buf1[2];
380     s1[3] = salt_buf1[3];
381     s2[0] = salt_buf2[0];
382     s2[1] = salt_buf2[1];
383     s2[2] = salt_buf2[2];
384     s2[3] = salt_buf2[3];
385     s3[0] = salt_buf3[0];
386     s3[1] = salt_buf3[1];
387     s3[2] = salt_buf3[2];
388     s3[3] = salt_buf3[3];
389
390     switch_buffer_by_offset_le_VV (s0, s1, s2, s3, out_salt_len);
391
392     w0[0] |= s0[0];
393     w0[1] |= s0[1];
394     w0[2] |= s0[2];
395     w0[3] |= s0[3];
396     w1[0] |= s1[0];
397     w1[1] |= s1[1];
398     w1[2] |= s1[2];
399     w1[3] |= s1[3];
400     w2[0] |= s2[0];
401     w2[1] |= s2[1];
402     w2[2] |= s2[2];
403     w2[3] |= s2[3];
404     w3[0] |= s3[0];
405     w3[1] |= s3[1];
406     w3[2] |= s3[2];
407     w3[3] |= s3[3];
408
409     const u32x salt_out_salt_len = salt_len + out_len + salt_len;
410
411     append_0x80_4x4_VV (w0, w1, w2, w3, salt_out_salt_len);
412
413     w3[2] = salt_out_salt_len * 8;
414     w3[3] = 0;
415
416     /**
417      * md5
418      */
419
420     u32x a = MD5M_A;
421     u32x b = MD5M_B;
422     u32x c = MD5M_C;
423     u32x d = MD5M_D;
424
425     MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
426     MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
427     MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
428     MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
429     MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
430     MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
431     MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
432     MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
433     MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
434     MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
435     MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
436     MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
437     MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
438     MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
439     MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
440     MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
441
442     MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
443     MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
444     MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
445     MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
446     MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
447     MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
448     MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
449     MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
450     MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
451     MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
452     MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
453     MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
454     MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
455     MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
456     MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
457     MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
458
459     MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
460     MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
461     MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
462     MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
463     MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
464     MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
465     MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
466     MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
467     MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
468     MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
469     MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
470     MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
471     MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
472     MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
473     MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
474     MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
475
476     MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
477     MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
478     MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
479     MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
480     MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
481     MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
482     MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
483     MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
484     MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
485     MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
486     MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
487     MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
488     MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
489
490     if (MATCHES_NONE_VS (a, search[0])) continue;
491
492     MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
493     MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
494     MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
495
496     COMPARE_S_SIMD (a, d, c, b);
497   }
498 }
499
500 __kernel void m03800_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)
501 {
502 }
503
504 __kernel void m03800_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)
505 {
506 }