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