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