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