Move files from include/ to OpenCL/ if they are used within kernels
[hashcat.git] / OpenCL / m01100_a0.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_rp.h"
22 #include "inc_rp.cl"
23 #include "inc_simd.cl"
24
25 __kernel void m01100_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)
26 {
27   /**
28    * modifier
29    */
30
31   const u32 lid = get_local_id (0);
32
33   /**
34    * base
35    */
36
37   const u32 gid = get_global_id (0);
38
39   if (gid >= gid_max) return;
40
41   u32 pw_buf0[4];
42   u32 pw_buf1[4];
43
44   pw_buf0[0] = pws[gid].i[0];
45   pw_buf0[1] = pws[gid].i[1];
46   pw_buf0[2] = pws[gid].i[2];
47   pw_buf0[3] = pws[gid].i[3];
48   pw_buf1[0] = pws[gid].i[4];
49   pw_buf1[1] = pws[gid].i[5];
50   pw_buf1[2] = pws[gid].i[6];
51   pw_buf1[3] = pws[gid].i[7];
52
53   const u32 pw_len = pws[gid].pw_len;
54
55   /**
56    * salt
57    */
58
59   const u32 salt_buf0 = salt_bufs[salt_pos].salt_buf[0];
60   const u32 salt_buf1 = salt_bufs[salt_pos].salt_buf[1];
61   const u32 salt_buf2 = salt_bufs[salt_pos].salt_buf[2];
62   const u32 salt_buf3 = salt_bufs[salt_pos].salt_buf[3];
63   const u32 salt_buf4 = salt_bufs[salt_pos].salt_buf[4];
64   const u32 salt_buf5 = salt_bufs[salt_pos].salt_buf[5];
65   const u32 salt_buf6 = salt_bufs[salt_pos].salt_buf[6];
66   const u32 salt_buf7 = salt_bufs[salt_pos].salt_buf[7];
67   const u32 salt_buf8 = salt_bufs[salt_pos].salt_buf[8];
68   const u32 salt_buf9 = salt_bufs[salt_pos].salt_buf[9];
69
70   const u32 salt_len  = salt_bufs[salt_pos].salt_len;
71
72   /**
73    * loop
74    */
75
76   for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
77   {
78     u32x w0[4] = { 0 };
79     u32x w1[4] = { 0 };
80     u32x w2[4] = { 0 };
81     u32x w3[4] = { 0 };
82
83     const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1);
84
85     append_0x80_2x4_VV (w0, w1, out_len);
86
87     make_unicode (w1, w2, w3);
88     make_unicode (w0, w0, w1);
89
90     w3[2] = out_len * 2 * 8;
91     w3[3] = 0;
92
93     u32x a = MD4M_A;
94     u32x b = MD4M_B;
95     u32x c = MD4M_C;
96     u32x d = MD4M_D;
97
98     MD4_STEP (MD4_Fo, a, b, c, d, w0[0], MD4C00, MD4S00);
99     MD4_STEP (MD4_Fo, d, a, b, c, w0[1], MD4C00, MD4S01);
100     MD4_STEP (MD4_Fo, c, d, a, b, w0[2], MD4C00, MD4S02);
101     MD4_STEP (MD4_Fo, b, c, d, a, w0[3], MD4C00, MD4S03);
102     MD4_STEP (MD4_Fo, a, b, c, d, w1[0], MD4C00, MD4S00);
103     MD4_STEP (MD4_Fo, d, a, b, c, w1[1], MD4C00, MD4S01);
104     MD4_STEP (MD4_Fo, c, d, a, b, w1[2], MD4C00, MD4S02);
105     MD4_STEP (MD4_Fo, b, c, d, a, w1[3], MD4C00, MD4S03);
106     MD4_STEP (MD4_Fo, a, b, c, d, w2[0], MD4C00, MD4S00);
107     MD4_STEP (MD4_Fo, d, a, b, c, w2[1], MD4C00, MD4S01);
108     MD4_STEP (MD4_Fo, c, d, a, b, w2[2], MD4C00, MD4S02);
109     MD4_STEP (MD4_Fo, b, c, d, a, w2[3], MD4C00, MD4S03);
110     MD4_STEP (MD4_Fo, a, b, c, d, w3[0], MD4C00, MD4S00);
111     MD4_STEP (MD4_Fo, d, a, b, c, w3[1], MD4C00, MD4S01);
112     MD4_STEP (MD4_Fo, c, d, a, b, w3[2], MD4C00, MD4S02);
113     MD4_STEP (MD4_Fo, b, c, d, a, w3[3], MD4C00, MD4S03);
114
115     MD4_STEP (MD4_Go, a, b, c, d, w0[0], MD4C01, MD4S10);
116     MD4_STEP (MD4_Go, d, a, b, c, w1[0], MD4C01, MD4S11);
117     MD4_STEP (MD4_Go, c, d, a, b, w2[0], MD4C01, MD4S12);
118     MD4_STEP (MD4_Go, b, c, d, a, w3[0], MD4C01, MD4S13);
119     MD4_STEP (MD4_Go, a, b, c, d, w0[1], MD4C01, MD4S10);
120     MD4_STEP (MD4_Go, d, a, b, c, w1[1], MD4C01, MD4S11);
121     MD4_STEP (MD4_Go, c, d, a, b, w2[1], MD4C01, MD4S12);
122     MD4_STEP (MD4_Go, b, c, d, a, w3[1], MD4C01, MD4S13);
123     MD4_STEP (MD4_Go, a, b, c, d, w0[2], MD4C01, MD4S10);
124     MD4_STEP (MD4_Go, d, a, b, c, w1[2], MD4C01, MD4S11);
125     MD4_STEP (MD4_Go, c, d, a, b, w2[2], MD4C01, MD4S12);
126     MD4_STEP (MD4_Go, b, c, d, a, w3[2], MD4C01, MD4S13);
127     MD4_STEP (MD4_Go, a, b, c, d, w0[3], MD4C01, MD4S10);
128     MD4_STEP (MD4_Go, d, a, b, c, w1[3], MD4C01, MD4S11);
129     MD4_STEP (MD4_Go, c, d, a, b, w2[3], MD4C01, MD4S12);
130     MD4_STEP (MD4_Go, b, c, d, a, w3[3], MD4C01, MD4S13);
131
132     MD4_STEP (MD4_H , a, b, c, d, w0[0], MD4C02, MD4S20);
133     MD4_STEP (MD4_H , d, a, b, c, w2[0], MD4C02, MD4S21);
134     MD4_STEP (MD4_H , c, d, a, b, w1[0], MD4C02, MD4S22);
135     MD4_STEP (MD4_H , b, c, d, a, w3[0], MD4C02, MD4S23);
136     MD4_STEP (MD4_H , a, b, c, d, w0[2], MD4C02, MD4S20);
137     MD4_STEP (MD4_H , d, a, b, c, w2[2], MD4C02, MD4S21);
138     MD4_STEP (MD4_H , c, d, a, b, w1[2], MD4C02, MD4S22);
139     MD4_STEP (MD4_H , b, c, d, a, w3[2], MD4C02, MD4S23);
140     MD4_STEP (MD4_H , a, b, c, d, w0[1], MD4C02, MD4S20);
141     MD4_STEP (MD4_H , d, a, b, c, w2[1], MD4C02, MD4S21);
142     MD4_STEP (MD4_H , c, d, a, b, w1[1], MD4C02, MD4S22);
143     MD4_STEP (MD4_H , b, c, d, a, w3[1], MD4C02, MD4S23);
144     MD4_STEP (MD4_H , a, b, c, d, w0[3], MD4C02, MD4S20);
145     MD4_STEP (MD4_H , d, a, b, c, w2[3], MD4C02, MD4S21);
146     MD4_STEP (MD4_H , c, d, a, b, w1[3], MD4C02, MD4S22);
147     MD4_STEP (MD4_H , b, c, d, a, w3[3], MD4C02, MD4S23);
148
149     a += MD4M_A;
150     b += MD4M_B;
151     c += MD4M_C;
152     d += MD4M_D;
153
154     w0[0] = a;
155     w0[1] = b;
156     w0[2] = c;
157     w0[3] = d;
158     w1[0] = salt_buf0;
159     w1[1] = salt_buf1;
160     w1[2] = salt_buf2;
161     w1[3] = salt_buf3;
162     w2[0] = salt_buf4;
163     w2[1] = salt_buf5;
164     w2[2] = salt_buf6;
165     w2[3] = salt_buf7;
166     w3[0] = salt_buf8;
167     w3[1] = salt_buf9;
168     w3[2] = (16 + salt_len) * 8;
169     w3[3] = 0;
170
171     a = MD4M_A;
172     b = MD4M_B;
173     c = MD4M_C;
174     d = MD4M_D;
175
176     MD4_STEP (MD4_Fo, a, b, c, d, w0[0], MD4C00, MD4S00);
177     MD4_STEP (MD4_Fo, d, a, b, c, w0[1], MD4C00, MD4S01);
178     MD4_STEP (MD4_Fo, c, d, a, b, w0[2], MD4C00, MD4S02);
179     MD4_STEP (MD4_Fo, b, c, d, a, w0[3], MD4C00, MD4S03);
180     MD4_STEP (MD4_Fo, a, b, c, d, w1[0], MD4C00, MD4S00);
181     MD4_STEP (MD4_Fo, d, a, b, c, w1[1], MD4C00, MD4S01);
182     MD4_STEP (MD4_Fo, c, d, a, b, w1[2], MD4C00, MD4S02);
183     MD4_STEP (MD4_Fo, b, c, d, a, w1[3], MD4C00, MD4S03);
184     MD4_STEP (MD4_Fo, a, b, c, d, w2[0], MD4C00, MD4S00);
185     MD4_STEP (MD4_Fo, d, a, b, c, w2[1], MD4C00, MD4S01);
186     MD4_STEP (MD4_Fo, c, d, a, b, w2[2], MD4C00, MD4S02);
187     MD4_STEP (MD4_Fo, b, c, d, a, w2[3], MD4C00, MD4S03);
188     MD4_STEP (MD4_Fo, a, b, c, d, w3[0], MD4C00, MD4S00);
189     MD4_STEP (MD4_Fo, d, a, b, c, w3[1], MD4C00, MD4S01);
190     MD4_STEP (MD4_Fo, c, d, a, b, w3[2], MD4C00, MD4S02);
191     MD4_STEP (MD4_Fo, b, c, d, a, w3[3], MD4C00, MD4S03);
192
193     MD4_STEP (MD4_Go, a, b, c, d, w0[0], MD4C01, MD4S10);
194     MD4_STEP (MD4_Go, d, a, b, c, w1[0], MD4C01, MD4S11);
195     MD4_STEP (MD4_Go, c, d, a, b, w2[0], MD4C01, MD4S12);
196     MD4_STEP (MD4_Go, b, c, d, a, w3[0], MD4C01, MD4S13);
197     MD4_STEP (MD4_Go, a, b, c, d, w0[1], MD4C01, MD4S10);
198     MD4_STEP (MD4_Go, d, a, b, c, w1[1], MD4C01, MD4S11);
199     MD4_STEP (MD4_Go, c, d, a, b, w2[1], MD4C01, MD4S12);
200     MD4_STEP (MD4_Go, b, c, d, a, w3[1], MD4C01, MD4S13);
201     MD4_STEP (MD4_Go, a, b, c, d, w0[2], MD4C01, MD4S10);
202     MD4_STEP (MD4_Go, d, a, b, c, w1[2], MD4C01, MD4S11);
203     MD4_STEP (MD4_Go, c, d, a, b, w2[2], MD4C01, MD4S12);
204     MD4_STEP (MD4_Go, b, c, d, a, w3[2], MD4C01, MD4S13);
205     MD4_STEP (MD4_Go, a, b, c, d, w0[3], MD4C01, MD4S10);
206     MD4_STEP (MD4_Go, d, a, b, c, w1[3], MD4C01, MD4S11);
207     MD4_STEP (MD4_Go, c, d, a, b, w2[3], MD4C01, MD4S12);
208     MD4_STEP (MD4_Go, b, c, d, a, w3[3], MD4C01, MD4S13);
209
210     MD4_STEP (MD4_H , a, b, c, d, w0[0], MD4C02, MD4S20);
211     MD4_STEP (MD4_H , d, a, b, c, w2[0], MD4C02, MD4S21);
212     MD4_STEP (MD4_H , c, d, a, b, w1[0], MD4C02, MD4S22);
213     MD4_STEP (MD4_H , b, c, d, a, w3[0], MD4C02, MD4S23);
214     MD4_STEP (MD4_H , a, b, c, d, w0[2], MD4C02, MD4S20);
215     MD4_STEP (MD4_H , d, a, b, c, w2[2], MD4C02, MD4S21);
216     MD4_STEP (MD4_H , c, d, a, b, w1[2], MD4C02, MD4S22);
217     MD4_STEP (MD4_H , b, c, d, a, w3[2], MD4C02, MD4S23);
218     MD4_STEP (MD4_H , a, b, c, d, w0[1], MD4C02, MD4S20);
219     MD4_STEP (MD4_H , d, a, b, c, w2[1], MD4C02, MD4S21);
220     MD4_STEP (MD4_H , c, d, a, b, w1[1], MD4C02, MD4S22);
221     MD4_STEP (MD4_H , b, c, d, a, w3[1], MD4C02, MD4S23);
222     MD4_STEP (MD4_H , a, b, c, d, w0[3], MD4C02, MD4S20);
223     MD4_STEP (MD4_H , d, a, b, c, w2[3], MD4C02, MD4S21);
224     MD4_STEP (MD4_H , c, d, a, b, w1[3], MD4C02, MD4S22);
225     MD4_STEP (MD4_H , b, c, d, a, w3[3], MD4C02, MD4S23);
226
227     COMPARE_M_SIMD (a, d, c, b);
228   }
229 }
230
231 __kernel void m01100_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)
232 {
233 }
234
235 __kernel void m01100_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)
236 {
237 }
238
239 __kernel void m01100_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)
240 {
241   /**
242    * modifier
243    */
244
245   const u32 lid = get_local_id (0);
246
247   /**
248    * base
249    */
250
251   const u32 gid = get_global_id (0);
252
253   if (gid >= gid_max) return;
254
255   u32 pw_buf0[4];
256   u32 pw_buf1[4];
257
258   pw_buf0[0] = pws[gid].i[0];
259   pw_buf0[1] = pws[gid].i[1];
260   pw_buf0[2] = pws[gid].i[2];
261   pw_buf0[3] = pws[gid].i[3];
262   pw_buf1[0] = pws[gid].i[4];
263   pw_buf1[1] = pws[gid].i[5];
264   pw_buf1[2] = pws[gid].i[6];
265   pw_buf1[3] = pws[gid].i[7];
266
267   const u32 pw_len = pws[gid].pw_len;
268
269   /**
270    * digest
271    */
272
273   const u32 search[4] =
274   {
275     digests_buf[digests_offset].digest_buf[DGST_R0],
276     digests_buf[digests_offset].digest_buf[DGST_R1],
277     digests_buf[digests_offset].digest_buf[DGST_R2],
278     digests_buf[digests_offset].digest_buf[DGST_R3]
279   };
280
281   /**
282    * salt
283    */
284
285   const u32 salt_buf0 = salt_bufs[salt_pos].salt_buf[0];
286   const u32 salt_buf1 = salt_bufs[salt_pos].salt_buf[1];
287   const u32 salt_buf2 = salt_bufs[salt_pos].salt_buf[2];
288   const u32 salt_buf3 = salt_bufs[salt_pos].salt_buf[3];
289   const u32 salt_buf4 = salt_bufs[salt_pos].salt_buf[4];
290   const u32 salt_buf5 = salt_bufs[salt_pos].salt_buf[5];
291   const u32 salt_buf6 = salt_bufs[salt_pos].salt_buf[6];
292   const u32 salt_buf7 = salt_bufs[salt_pos].salt_buf[7];
293   const u32 salt_buf8 = salt_bufs[salt_pos].salt_buf[8];
294   const u32 salt_buf9 = salt_bufs[salt_pos].salt_buf[9];
295
296   const u32 salt_len  = salt_bufs[salt_pos].salt_len;
297
298   /**
299    * loop
300    */
301
302   for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
303   {
304     u32x w0[4] = { 0 };
305     u32x w1[4] = { 0 };
306     u32x w2[4] = { 0 };
307     u32x w3[4] = { 0 };
308
309     const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1);
310
311     append_0x80_2x4_VV (w0, w1, out_len);
312
313     make_unicode (w1, w2, w3);
314     make_unicode (w0, w0, w1);
315
316     w3[2] = out_len * 2 * 8;
317     w3[3] = 0;
318
319     u32x a = MD4M_A;
320     u32x b = MD4M_B;
321     u32x c = MD4M_C;
322     u32x d = MD4M_D;
323
324     MD4_STEP (MD4_Fo, a, b, c, d, w0[0], MD4C00, MD4S00);
325     MD4_STEP (MD4_Fo, d, a, b, c, w0[1], MD4C00, MD4S01);
326     MD4_STEP (MD4_Fo, c, d, a, b, w0[2], MD4C00, MD4S02);
327     MD4_STEP (MD4_Fo, b, c, d, a, w0[3], MD4C00, MD4S03);
328     MD4_STEP (MD4_Fo, a, b, c, d, w1[0], MD4C00, MD4S00);
329     MD4_STEP (MD4_Fo, d, a, b, c, w1[1], MD4C00, MD4S01);
330     MD4_STEP (MD4_Fo, c, d, a, b, w1[2], MD4C00, MD4S02);
331     MD4_STEP (MD4_Fo, b, c, d, a, w1[3], MD4C00, MD4S03);
332     MD4_STEP (MD4_Fo, a, b, c, d, w2[0], MD4C00, MD4S00);
333     MD4_STEP (MD4_Fo, d, a, b, c, w2[1], MD4C00, MD4S01);
334     MD4_STEP (MD4_Fo, c, d, a, b, w2[2], MD4C00, MD4S02);
335     MD4_STEP (MD4_Fo, b, c, d, a, w2[3], MD4C00, MD4S03);
336     MD4_STEP (MD4_Fo, a, b, c, d, w3[0], MD4C00, MD4S00);
337     MD4_STEP (MD4_Fo, d, a, b, c, w3[1], MD4C00, MD4S01);
338     MD4_STEP (MD4_Fo, c, d, a, b, w3[2], MD4C00, MD4S02);
339     MD4_STEP (MD4_Fo, b, c, d, a, w3[3], MD4C00, MD4S03);
340
341     MD4_STEP (MD4_Go, a, b, c, d, w0[0], MD4C01, MD4S10);
342     MD4_STEP (MD4_Go, d, a, b, c, w1[0], MD4C01, MD4S11);
343     MD4_STEP (MD4_Go, c, d, a, b, w2[0], MD4C01, MD4S12);
344     MD4_STEP (MD4_Go, b, c, d, a, w3[0], MD4C01, MD4S13);
345     MD4_STEP (MD4_Go, a, b, c, d, w0[1], MD4C01, MD4S10);
346     MD4_STEP (MD4_Go, d, a, b, c, w1[1], MD4C01, MD4S11);
347     MD4_STEP (MD4_Go, c, d, a, b, w2[1], MD4C01, MD4S12);
348     MD4_STEP (MD4_Go, b, c, d, a, w3[1], MD4C01, MD4S13);
349     MD4_STEP (MD4_Go, a, b, c, d, w0[2], MD4C01, MD4S10);
350     MD4_STEP (MD4_Go, d, a, b, c, w1[2], MD4C01, MD4S11);
351     MD4_STEP (MD4_Go, c, d, a, b, w2[2], MD4C01, MD4S12);
352     MD4_STEP (MD4_Go, b, c, d, a, w3[2], MD4C01, MD4S13);
353     MD4_STEP (MD4_Go, a, b, c, d, w0[3], MD4C01, MD4S10);
354     MD4_STEP (MD4_Go, d, a, b, c, w1[3], MD4C01, MD4S11);
355     MD4_STEP (MD4_Go, c, d, a, b, w2[3], MD4C01, MD4S12);
356     MD4_STEP (MD4_Go, b, c, d, a, w3[3], MD4C01, MD4S13);
357
358     MD4_STEP (MD4_H , a, b, c, d, w0[0], MD4C02, MD4S20);
359     MD4_STEP (MD4_H , d, a, b, c, w2[0], MD4C02, MD4S21);
360     MD4_STEP (MD4_H , c, d, a, b, w1[0], MD4C02, MD4S22);
361     MD4_STEP (MD4_H , b, c, d, a, w3[0], MD4C02, MD4S23);
362     MD4_STEP (MD4_H , a, b, c, d, w0[2], MD4C02, MD4S20);
363     MD4_STEP (MD4_H , d, a, b, c, w2[2], MD4C02, MD4S21);
364     MD4_STEP (MD4_H , c, d, a, b, w1[2], MD4C02, MD4S22);
365     MD4_STEP (MD4_H , b, c, d, a, w3[2], MD4C02, MD4S23);
366     MD4_STEP (MD4_H , a, b, c, d, w0[1], MD4C02, MD4S20);
367     MD4_STEP (MD4_H , d, a, b, c, w2[1], MD4C02, MD4S21);
368     MD4_STEP (MD4_H , c, d, a, b, w1[1], MD4C02, MD4S22);
369     MD4_STEP (MD4_H , b, c, d, a, w3[1], MD4C02, MD4S23);
370     MD4_STEP (MD4_H , a, b, c, d, w0[3], MD4C02, MD4S20);
371     MD4_STEP (MD4_H , d, a, b, c, w2[3], MD4C02, MD4S21);
372     MD4_STEP (MD4_H , c, d, a, b, w1[3], MD4C02, MD4S22);
373     MD4_STEP (MD4_H , b, c, d, a, w3[3], MD4C02, MD4S23);
374
375     a += MD4M_A;
376     b += MD4M_B;
377     c += MD4M_C;
378     d += MD4M_D;
379
380     w0[0] = a;
381     w0[1] = b;
382     w0[2] = c;
383     w0[3] = d;
384     w1[0] = salt_buf0;
385     w1[1] = salt_buf1;
386     w1[2] = salt_buf2;
387     w1[3] = salt_buf3;
388     w2[0] = salt_buf4;
389     w2[1] = salt_buf5;
390     w2[2] = salt_buf6;
391     w2[3] = salt_buf7;
392     w3[0] = salt_buf8;
393     w3[1] = salt_buf9;
394     w3[2] = (16 + salt_len) * 8;
395     w3[3] = 0;
396
397     a = MD4M_A;
398     b = MD4M_B;
399     c = MD4M_C;
400     d = MD4M_D;
401
402     MD4_STEP (MD4_Fo, a, b, c, d, w0[0], MD4C00, MD4S00);
403     MD4_STEP (MD4_Fo, d, a, b, c, w0[1], MD4C00, MD4S01);
404     MD4_STEP (MD4_Fo, c, d, a, b, w0[2], MD4C00, MD4S02);
405     MD4_STEP (MD4_Fo, b, c, d, a, w0[3], MD4C00, MD4S03);
406     MD4_STEP (MD4_Fo, a, b, c, d, w1[0], MD4C00, MD4S00);
407     MD4_STEP (MD4_Fo, d, a, b, c, w1[1], MD4C00, MD4S01);
408     MD4_STEP (MD4_Fo, c, d, a, b, w1[2], MD4C00, MD4S02);
409     MD4_STEP (MD4_Fo, b, c, d, a, w1[3], MD4C00, MD4S03);
410     MD4_STEP (MD4_Fo, a, b, c, d, w2[0], MD4C00, MD4S00);
411     MD4_STEP (MD4_Fo, d, a, b, c, w2[1], MD4C00, MD4S01);
412     MD4_STEP (MD4_Fo, c, d, a, b, w2[2], MD4C00, MD4S02);
413     MD4_STEP (MD4_Fo, b, c, d, a, w2[3], MD4C00, MD4S03);
414     MD4_STEP (MD4_Fo, a, b, c, d, w3[0], MD4C00, MD4S00);
415     MD4_STEP (MD4_Fo, d, a, b, c, w3[1], MD4C00, MD4S01);
416     MD4_STEP (MD4_Fo, c, d, a, b, w3[2], MD4C00, MD4S02);
417     MD4_STEP (MD4_Fo, b, c, d, a, w3[3], MD4C00, MD4S03);
418
419     MD4_STEP (MD4_Go, a, b, c, d, w0[0], MD4C01, MD4S10);
420     MD4_STEP (MD4_Go, d, a, b, c, w1[0], MD4C01, MD4S11);
421     MD4_STEP (MD4_Go, c, d, a, b, w2[0], MD4C01, MD4S12);
422     MD4_STEP (MD4_Go, b, c, d, a, w3[0], MD4C01, MD4S13);
423     MD4_STEP (MD4_Go, a, b, c, d, w0[1], MD4C01, MD4S10);
424     MD4_STEP (MD4_Go, d, a, b, c, w1[1], MD4C01, MD4S11);
425     MD4_STEP (MD4_Go, c, d, a, b, w2[1], MD4C01, MD4S12);
426     MD4_STEP (MD4_Go, b, c, d, a, w3[1], MD4C01, MD4S13);
427     MD4_STEP (MD4_Go, a, b, c, d, w0[2], MD4C01, MD4S10);
428     MD4_STEP (MD4_Go, d, a, b, c, w1[2], MD4C01, MD4S11);
429     MD4_STEP (MD4_Go, c, d, a, b, w2[2], MD4C01, MD4S12);
430     MD4_STEP (MD4_Go, b, c, d, a, w3[2], MD4C01, MD4S13);
431     MD4_STEP (MD4_Go, a, b, c, d, w0[3], MD4C01, MD4S10);
432     MD4_STEP (MD4_Go, d, a, b, c, w1[3], MD4C01, MD4S11);
433     MD4_STEP (MD4_Go, c, d, a, b, w2[3], MD4C01, MD4S12);
434     MD4_STEP (MD4_Go, b, c, d, a, w3[3], MD4C01, MD4S13);
435
436     MD4_STEP (MD4_H , a, b, c, d, w0[0], MD4C02, MD4S20);
437     MD4_STEP (MD4_H , d, a, b, c, w2[0], MD4C02, MD4S21);
438     MD4_STEP (MD4_H , c, d, a, b, w1[0], MD4C02, MD4S22);
439     MD4_STEP (MD4_H , b, c, d, a, w3[0], MD4C02, MD4S23);
440     MD4_STEP (MD4_H , a, b, c, d, w0[2], MD4C02, MD4S20);
441     MD4_STEP (MD4_H , d, a, b, c, w2[2], MD4C02, MD4S21);
442     MD4_STEP (MD4_H , c, d, a, b, w1[2], MD4C02, MD4S22);
443     MD4_STEP (MD4_H , b, c, d, a, w3[2], MD4C02, MD4S23);
444     MD4_STEP (MD4_H , a, b, c, d, w0[1], MD4C02, MD4S20);
445     MD4_STEP (MD4_H , d, a, b, c, w2[1], MD4C02, MD4S21);
446     MD4_STEP (MD4_H , c, d, a, b, w1[1], MD4C02, MD4S22);
447     MD4_STEP (MD4_H , b, c, d, a, w3[1], MD4C02, MD4S23);
448     MD4_STEP (MD4_H , a, b, c, d, w0[3], MD4C02, MD4S20);
449
450     if (MATCHES_NONE_VS (a, search[0])) continue;
451
452     MD4_STEP (MD4_H , d, a, b, c, w2[3], MD4C02, MD4S21);
453     MD4_STEP (MD4_H , c, d, a, b, w1[3], MD4C02, MD4S22);
454     MD4_STEP (MD4_H , b, c, d, a, w3[3], MD4C02, MD4S23);
455
456     COMPARE_S_SIMD (a, d, c, b);
457   }
458 }
459
460 __kernel void m01100_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)
461 {
462 }
463
464 __kernel void m01100_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)
465 {
466 }