Fix path to includes
[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 #include "include/constants.h"
9 #include "include/kernel_vendor.h"
10
11 #define DGST_R0 0
12 #define DGST_R1 3
13 #define DGST_R2 2
14 #define DGST_R3 1
15
16 #include "include/kernel_functions.c"
17 #include "OpenCL/types_ocl.c"
18 #include "OpenCL/common.c"
19 #include "include/rp_gpu.h"
20 #include "OpenCL/rp.c"
21
22 #define COMPARE_S "OpenCL/check_single_comp4.c"
23 #define COMPARE_M "OpenCL/check_multi_comp4.c"
24
25 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m01100_m04 (__global pw_t *pws, __global gpu_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++)
89   {
90     u32 w0[4];
91
92     w0[0] = pw_buf0[0];
93     w0[1] = pw_buf0[1];
94     w0[2] = pw_buf0[2];
95     w0[3] = pw_buf0[3];
96
97     u32 w1[4];
98
99     w1[0] = pw_buf1[0];
100     w1[1] = pw_buf1[1];
101     w1[2] = pw_buf1[2];
102     w1[3] = pw_buf1[3];
103
104     u32 w2[4];
105
106     w2[0] = 0;
107     w2[1] = 0;
108     w2[2] = 0;
109     w2[3] = 0;
110
111     u32 w3[4];
112
113     w3[0] = 0;
114     w3[1] = 0;
115     w3[2] = 0;
116     w3[3] = 0;
117
118     const u32 out_len = apply_rules (rules_buf[il_pos].cmds, w0, w1, pw_len);
119
120     append_0x80_2x4 (w0, w1, out_len);
121
122     u32 w0_t[4];
123     u32 w1_t[4];
124     u32 w2_t[4];
125     u32 w3_t[4];
126
127     make_unicode (w0, w0_t, w1_t);
128     make_unicode (w1, w2_t, w3_t);
129
130     w3_t[2] = out_len * 8 * 2;
131
132     u32 a = MD4M_A;
133     u32 b = MD4M_B;
134     u32 c = MD4M_C;
135     u32 d = MD4M_D;
136
137     MD4_STEP (MD4_Fo, a, b, c, d, w0_t[0], MD4C00, MD4S00);
138     MD4_STEP (MD4_Fo, d, a, b, c, w0_t[1], MD4C00, MD4S01);
139     MD4_STEP (MD4_Fo, c, d, a, b, w0_t[2], MD4C00, MD4S02);
140     MD4_STEP (MD4_Fo, b, c, d, a, w0_t[3], MD4C00, MD4S03);
141     MD4_STEP (MD4_Fo, a, b, c, d, w1_t[0], MD4C00, MD4S00);
142     MD4_STEP (MD4_Fo, d, a, b, c, w1_t[1], MD4C00, MD4S01);
143     MD4_STEP (MD4_Fo, c, d, a, b, w1_t[2], MD4C00, MD4S02);
144     MD4_STEP (MD4_Fo, b, c, d, a, w1_t[3], MD4C00, MD4S03);
145     MD4_STEP (MD4_Fo, a, b, c, d, w2_t[0], MD4C00, MD4S00);
146     MD4_STEP (MD4_Fo, d, a, b, c, w2_t[1], MD4C00, MD4S01);
147     MD4_STEP (MD4_Fo, c, d, a, b, w2_t[2], MD4C00, MD4S02);
148     MD4_STEP (MD4_Fo, b, c, d, a, w2_t[3], MD4C00, MD4S03);
149     MD4_STEP (MD4_Fo, a, b, c, d, w3_t[0], MD4C00, MD4S00);
150     MD4_STEP (MD4_Fo, d, a, b, c, w3_t[1], MD4C00, MD4S01);
151     MD4_STEP (MD4_Fo, c, d, a, b, w3_t[2], MD4C00, MD4S02);
152     MD4_STEP (MD4_Fo, b, c, d, a, w3_t[3], MD4C00, MD4S03);
153
154     MD4_STEP (MD4_Go, a, b, c, d, w0_t[0], MD4C01, MD4S10);
155     MD4_STEP (MD4_Go, d, a, b, c, w1_t[0], MD4C01, MD4S11);
156     MD4_STEP (MD4_Go, c, d, a, b, w2_t[0], MD4C01, MD4S12);
157     MD4_STEP (MD4_Go, b, c, d, a, w3_t[0], MD4C01, MD4S13);
158     MD4_STEP (MD4_Go, a, b, c, d, w0_t[1], MD4C01, MD4S10);
159     MD4_STEP (MD4_Go, d, a, b, c, w1_t[1], MD4C01, MD4S11);
160     MD4_STEP (MD4_Go, c, d, a, b, w2_t[1], MD4C01, MD4S12);
161     MD4_STEP (MD4_Go, b, c, d, a, w3_t[1], MD4C01, MD4S13);
162     MD4_STEP (MD4_Go, a, b, c, d, w0_t[2], MD4C01, MD4S10);
163     MD4_STEP (MD4_Go, d, a, b, c, w1_t[2], MD4C01, MD4S11);
164     MD4_STEP (MD4_Go, c, d, a, b, w2_t[2], MD4C01, MD4S12);
165     MD4_STEP (MD4_Go, b, c, d, a, w3_t[2], MD4C01, MD4S13);
166     MD4_STEP (MD4_Go, a, b, c, d, w0_t[3], MD4C01, MD4S10);
167     MD4_STEP (MD4_Go, d, a, b, c, w1_t[3], MD4C01, MD4S11);
168     MD4_STEP (MD4_Go, c, d, a, b, w2_t[3], MD4C01, MD4S12);
169     MD4_STEP (MD4_Go, b, c, d, a, w3_t[3], MD4C01, MD4S13);
170
171     MD4_STEP (MD4_H , a, b, c, d, w0_t[0], MD4C02, MD4S20);
172     MD4_STEP (MD4_H , d, a, b, c, w2_t[0], MD4C02, MD4S21);
173     MD4_STEP (MD4_H , c, d, a, b, w1_t[0], MD4C02, MD4S22);
174     MD4_STEP (MD4_H , b, c, d, a, w3_t[0], MD4C02, MD4S23);
175     MD4_STEP (MD4_H , a, b, c, d, w0_t[2], MD4C02, MD4S20);
176     MD4_STEP (MD4_H , d, a, b, c, w2_t[2], MD4C02, MD4S21);
177     MD4_STEP (MD4_H , c, d, a, b, w1_t[2], MD4C02, MD4S22);
178     MD4_STEP (MD4_H , b, c, d, a, w3_t[2], MD4C02, MD4S23);
179     MD4_STEP (MD4_H , a, b, c, d, w0_t[1], MD4C02, MD4S20);
180     MD4_STEP (MD4_H , d, a, b, c, w2_t[1], MD4C02, MD4S21);
181     MD4_STEP (MD4_H , c, d, a, b, w1_t[1], MD4C02, MD4S22);
182     MD4_STEP (MD4_H , b, c, d, a, w3_t[1], MD4C02, MD4S23);
183     MD4_STEP (MD4_H , a, b, c, d, w0_t[3], MD4C02, MD4S20);
184     MD4_STEP (MD4_H , d, a, b, c, w2_t[3], MD4C02, MD4S21);
185     MD4_STEP (MD4_H , c, d, a, b, w1_t[3], MD4C02, MD4S22);
186     MD4_STEP (MD4_H , b, c, d, a, w3_t[3], MD4C02, MD4S23);
187
188     a += MD4M_A;
189     b += MD4M_B;
190     c += MD4M_C;
191     d += MD4M_D;
192
193     w0_t[0] = a;
194     w0_t[1] = b;
195     w0_t[2] = c;
196     w0_t[3] = d;
197     w1_t[0] = salt_buf0[0];
198     w1_t[1] = salt_buf0[1];
199     w1_t[2] = salt_buf0[2];
200     w1_t[3] = salt_buf0[3];
201     w2_t[0] = salt_buf1[0];
202     w2_t[1] = salt_buf1[1];
203     w2_t[2] = salt_buf1[2];
204     w2_t[3] = salt_buf1[3];
205     w3_t[0] = salt_buf2[0];
206     w3_t[1] = salt_buf2[1];
207     w3_t[2] = (16 + salt_len) * 8;
208     w3_t[3] = 0;
209
210     a = MD4M_A;
211     b = MD4M_B;
212     c = MD4M_C;
213     d = MD4M_D;
214
215     MD4_STEP (MD4_Fo, a, b, c, d, w0_t[0], MD4C00, MD4S00);
216     MD4_STEP (MD4_Fo, d, a, b, c, w0_t[1], MD4C00, MD4S01);
217     MD4_STEP (MD4_Fo, c, d, a, b, w0_t[2], MD4C00, MD4S02);
218     MD4_STEP (MD4_Fo, b, c, d, a, w0_t[3], MD4C00, MD4S03);
219     MD4_STEP (MD4_Fo, a, b, c, d, w1_t[0], MD4C00, MD4S00);
220     MD4_STEP (MD4_Fo, d, a, b, c, w1_t[1], MD4C00, MD4S01);
221     MD4_STEP (MD4_Fo, c, d, a, b, w1_t[2], MD4C00, MD4S02);
222     MD4_STEP (MD4_Fo, b, c, d, a, w1_t[3], MD4C00, MD4S03);
223     MD4_STEP (MD4_Fo, a, b, c, d, w2_t[0], MD4C00, MD4S00);
224     MD4_STEP (MD4_Fo, d, a, b, c, w2_t[1], MD4C00, MD4S01);
225     MD4_STEP (MD4_Fo, c, d, a, b, w2_t[2], MD4C00, MD4S02);
226     MD4_STEP (MD4_Fo, b, c, d, a, w2_t[3], MD4C00, MD4S03);
227     MD4_STEP (MD4_Fo, a, b, c, d, w3_t[0], MD4C00, MD4S00);
228     MD4_STEP (MD4_Fo, d, a, b, c, w3_t[1], MD4C00, MD4S01);
229     MD4_STEP (MD4_Fo, c, d, a, b, w3_t[2], MD4C00, MD4S02);
230     MD4_STEP (MD4_Fo, b, c, d, a, w3_t[3], MD4C00, MD4S03);
231
232     MD4_STEP (MD4_Go, a, b, c, d, w0_t[0], MD4C01, MD4S10);
233     MD4_STEP (MD4_Go, d, a, b, c, w1_t[0], MD4C01, MD4S11);
234     MD4_STEP (MD4_Go, c, d, a, b, w2_t[0], MD4C01, MD4S12);
235     MD4_STEP (MD4_Go, b, c, d, a, w3_t[0], MD4C01, MD4S13);
236     MD4_STEP (MD4_Go, a, b, c, d, w0_t[1], MD4C01, MD4S10);
237     MD4_STEP (MD4_Go, d, a, b, c, w1_t[1], MD4C01, MD4S11);
238     MD4_STEP (MD4_Go, c, d, a, b, w2_t[1], MD4C01, MD4S12);
239     MD4_STEP (MD4_Go, b, c, d, a, w3_t[1], MD4C01, MD4S13);
240     MD4_STEP (MD4_Go, a, b, c, d, w0_t[2], MD4C01, MD4S10);
241     MD4_STEP (MD4_Go, d, a, b, c, w1_t[2], MD4C01, MD4S11);
242     MD4_STEP (MD4_Go, c, d, a, b, w2_t[2], MD4C01, MD4S12);
243     MD4_STEP (MD4_Go, b, c, d, a, w3_t[2], MD4C01, MD4S13);
244     MD4_STEP (MD4_Go, a, b, c, d, w0_t[3], MD4C01, MD4S10);
245     MD4_STEP (MD4_Go, d, a, b, c, w1_t[3], MD4C01, MD4S11);
246     MD4_STEP (MD4_Go, c, d, a, b, w2_t[3], MD4C01, MD4S12);
247     MD4_STEP (MD4_Go, b, c, d, a, w3_t[3], MD4C01, MD4S13);
248
249     MD4_STEP (MD4_H , a, b, c, d, w0_t[0], MD4C02, MD4S20);
250     MD4_STEP (MD4_H , d, a, b, c, w2_t[0], MD4C02, MD4S21);
251     MD4_STEP (MD4_H , c, d, a, b, w1_t[0], MD4C02, MD4S22);
252     MD4_STEP (MD4_H , b, c, d, a, w3_t[0], MD4C02, MD4S23);
253     MD4_STEP (MD4_H , a, b, c, d, w0_t[2], MD4C02, MD4S20);
254     MD4_STEP (MD4_H , d, a, b, c, w2_t[2], MD4C02, MD4S21);
255     MD4_STEP (MD4_H , c, d, a, b, w1_t[2], MD4C02, MD4S22);
256     MD4_STEP (MD4_H , b, c, d, a, w3_t[2], MD4C02, MD4S23);
257     MD4_STEP (MD4_H , a, b, c, d, w0_t[1], MD4C02, MD4S20);
258     MD4_STEP (MD4_H , d, a, b, c, w2_t[1], MD4C02, MD4S21);
259     MD4_STEP (MD4_H , c, d, a, b, w1_t[1], MD4C02, MD4S22);
260     MD4_STEP (MD4_H , b, c, d, a, w3_t[1], MD4C02, MD4S23);
261     MD4_STEP (MD4_H , a, b, c, d, w0_t[3], MD4C02, MD4S20);
262     MD4_STEP (MD4_H , d, a, b, c, w2_t[3], MD4C02, MD4S21);
263     MD4_STEP (MD4_H , c, d, a, b, w1_t[3], MD4C02, MD4S22);
264     MD4_STEP (MD4_H , b, c, d, a, w3_t[3], MD4C02, MD4S23);
265
266     const u32 r0 = a;
267     const u32 r1 = d;
268     const u32 r2 = c;
269     const u32 r3 = b;
270
271     #include COMPARE_M
272   }
273 }
274
275 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m01100_m08 (__global pw_t *pws, __global gpu_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)
276 {
277 }
278
279 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m01100_m16 (__global pw_t *pws, __global gpu_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)
280 {
281 }
282
283 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m01100_s04 (__global pw_t *pws, __global gpu_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)
284 {
285   /**
286    * modifier
287    */
288
289   const u32 lid = get_local_id (0);
290
291   /**
292    * base
293    */
294
295   const u32 gid = get_global_id (0);
296
297   if (gid >= gid_max) return;
298
299   u32 pw_buf0[4];
300
301   pw_buf0[0] = pws[gid].i[ 0];
302   pw_buf0[1] = pws[gid].i[ 1];
303   pw_buf0[2] = pws[gid].i[ 2];
304   pw_buf0[3] = pws[gid].i[ 3];
305
306   u32 pw_buf1[4];
307
308   pw_buf1[0] = pws[gid].i[ 4];
309   pw_buf1[1] = pws[gid].i[ 5];
310   pw_buf1[2] = pws[gid].i[ 6];
311   pw_buf1[3] = pws[gid].i[ 7];
312
313   const u32 pw_len = pws[gid].pw_len;
314
315   /**
316    * digest
317    */
318
319   const u32 search[4] =
320   {
321     digests_buf[digests_offset].digest_buf[DGST_R0],
322     digests_buf[digests_offset].digest_buf[DGST_R1],
323     digests_buf[digests_offset].digest_buf[DGST_R2],
324     digests_buf[digests_offset].digest_buf[DGST_R3]
325   };
326
327   /**
328    * salt
329    */
330
331   u32 salt_buf0[4];
332
333   salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
334   salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
335   salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
336   salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
337
338   u32 salt_buf1[4];
339
340   salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
341   salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
342   salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
343   salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
344
345   u32 salt_buf2[4];
346
347   salt_buf2[0] = salt_bufs[salt_pos].salt_buf[ 8];
348   salt_buf2[1] = salt_bufs[salt_pos].salt_buf[ 9];
349   salt_buf2[2] = 0;
350   salt_buf2[3] = 0;
351
352   const u32 salt_len = salt_bufs[salt_pos].salt_len;
353
354   /**
355    * loop
356    */
357
358   for (u32 il_pos = 0; il_pos < rules_cnt; il_pos++)
359   {
360     u32 w0[4];
361
362     w0[0] = pw_buf0[0];
363     w0[1] = pw_buf0[1];
364     w0[2] = pw_buf0[2];
365     w0[3] = pw_buf0[3];
366
367     u32 w1[4];
368
369     w1[0] = pw_buf1[0];
370     w1[1] = pw_buf1[1];
371     w1[2] = pw_buf1[2];
372     w1[3] = pw_buf1[3];
373
374     u32 w2[4];
375
376     w2[0] = 0;
377     w2[1] = 0;
378     w2[2] = 0;
379     w2[3] = 0;
380
381     u32 w3[4];
382
383     w3[0] = 0;
384     w3[1] = 0;
385     w3[2] = 0;
386     w3[3] = 0;
387
388     const u32 out_len = apply_rules (rules_buf[il_pos].cmds, w0, w1, pw_len);
389
390     append_0x80_2x4 (w0, w1, out_len);
391
392     u32 w0_t[4];
393     u32 w1_t[4];
394     u32 w2_t[4];
395     u32 w3_t[4];
396
397     make_unicode (w0, w0_t, w1_t);
398     make_unicode (w1, w2_t, w3_t);
399
400     w3_t[2] = out_len * 8 * 2;
401
402     u32 a = MD4M_A;
403     u32 b = MD4M_B;
404     u32 c = MD4M_C;
405     u32 d = MD4M_D;
406
407     MD4_STEP (MD4_Fo, a, b, c, d, w0_t[0], MD4C00, MD4S00);
408     MD4_STEP (MD4_Fo, d, a, b, c, w0_t[1], MD4C00, MD4S01);
409     MD4_STEP (MD4_Fo, c, d, a, b, w0_t[2], MD4C00, MD4S02);
410     MD4_STEP (MD4_Fo, b, c, d, a, w0_t[3], MD4C00, MD4S03);
411     MD4_STEP (MD4_Fo, a, b, c, d, w1_t[0], MD4C00, MD4S00);
412     MD4_STEP (MD4_Fo, d, a, b, c, w1_t[1], MD4C00, MD4S01);
413     MD4_STEP (MD4_Fo, c, d, a, b, w1_t[2], MD4C00, MD4S02);
414     MD4_STEP (MD4_Fo, b, c, d, a, w1_t[3], MD4C00, MD4S03);
415     MD4_STEP (MD4_Fo, a, b, c, d, w2_t[0], MD4C00, MD4S00);
416     MD4_STEP (MD4_Fo, d, a, b, c, w2_t[1], MD4C00, MD4S01);
417     MD4_STEP (MD4_Fo, c, d, a, b, w2_t[2], MD4C00, MD4S02);
418     MD4_STEP (MD4_Fo, b, c, d, a, w2_t[3], MD4C00, MD4S03);
419     MD4_STEP (MD4_Fo, a, b, c, d, w3_t[0], MD4C00, MD4S00);
420     MD4_STEP (MD4_Fo, d, a, b, c, w3_t[1], MD4C00, MD4S01);
421     MD4_STEP (MD4_Fo, c, d, a, b, w3_t[2], MD4C00, MD4S02);
422     MD4_STEP (MD4_Fo, b, c, d, a, w3_t[3], MD4C00, MD4S03);
423
424     MD4_STEP (MD4_Go, a, b, c, d, w0_t[0], MD4C01, MD4S10);
425     MD4_STEP (MD4_Go, d, a, b, c, w1_t[0], MD4C01, MD4S11);
426     MD4_STEP (MD4_Go, c, d, a, b, w2_t[0], MD4C01, MD4S12);
427     MD4_STEP (MD4_Go, b, c, d, a, w3_t[0], MD4C01, MD4S13);
428     MD4_STEP (MD4_Go, a, b, c, d, w0_t[1], MD4C01, MD4S10);
429     MD4_STEP (MD4_Go, d, a, b, c, w1_t[1], MD4C01, MD4S11);
430     MD4_STEP (MD4_Go, c, d, a, b, w2_t[1], MD4C01, MD4S12);
431     MD4_STEP (MD4_Go, b, c, d, a, w3_t[1], MD4C01, MD4S13);
432     MD4_STEP (MD4_Go, a, b, c, d, w0_t[2], MD4C01, MD4S10);
433     MD4_STEP (MD4_Go, d, a, b, c, w1_t[2], MD4C01, MD4S11);
434     MD4_STEP (MD4_Go, c, d, a, b, w2_t[2], MD4C01, MD4S12);
435     MD4_STEP (MD4_Go, b, c, d, a, w3_t[2], MD4C01, MD4S13);
436     MD4_STEP (MD4_Go, a, b, c, d, w0_t[3], MD4C01, MD4S10);
437     MD4_STEP (MD4_Go, d, a, b, c, w1_t[3], MD4C01, MD4S11);
438     MD4_STEP (MD4_Go, c, d, a, b, w2_t[3], MD4C01, MD4S12);
439     MD4_STEP (MD4_Go, b, c, d, a, w3_t[3], MD4C01, MD4S13);
440
441     MD4_STEP (MD4_H , a, b, c, d, w0_t[0], MD4C02, MD4S20);
442     MD4_STEP (MD4_H , d, a, b, c, w2_t[0], MD4C02, MD4S21);
443     MD4_STEP (MD4_H , c, d, a, b, w1_t[0], MD4C02, MD4S22);
444     MD4_STEP (MD4_H , b, c, d, a, w3_t[0], MD4C02, MD4S23);
445     MD4_STEP (MD4_H , a, b, c, d, w0_t[2], MD4C02, MD4S20);
446     MD4_STEP (MD4_H , d, a, b, c, w2_t[2], MD4C02, MD4S21);
447     MD4_STEP (MD4_H , c, d, a, b, w1_t[2], MD4C02, MD4S22);
448     MD4_STEP (MD4_H , b, c, d, a, w3_t[2], MD4C02, MD4S23);
449     MD4_STEP (MD4_H , a, b, c, d, w0_t[1], MD4C02, MD4S20);
450     MD4_STEP (MD4_H , d, a, b, c, w2_t[1], MD4C02, MD4S21);
451     MD4_STEP (MD4_H , c, d, a, b, w1_t[1], MD4C02, MD4S22);
452     MD4_STEP (MD4_H , b, c, d, a, w3_t[1], MD4C02, MD4S23);
453     MD4_STEP (MD4_H , a, b, c, d, w0_t[3], MD4C02, MD4S20);
454     MD4_STEP (MD4_H , d, a, b, c, w2_t[3], MD4C02, MD4S21);
455     MD4_STEP (MD4_H , c, d, a, b, w1_t[3], MD4C02, MD4S22);
456     MD4_STEP (MD4_H , b, c, d, a, w3_t[3], MD4C02, MD4S23);
457
458     a += MD4M_A;
459     b += MD4M_B;
460     c += MD4M_C;
461     d += MD4M_D;
462
463     w0_t[0] = a;
464     w0_t[1] = b;
465     w0_t[2] = c;
466     w0_t[3] = d;
467     w1_t[0] = salt_buf0[0];
468     w1_t[1] = salt_buf0[1];
469     w1_t[2] = salt_buf0[2];
470     w1_t[3] = salt_buf0[3];
471     w2_t[0] = salt_buf1[0];
472     w2_t[1] = salt_buf1[1];
473     w2_t[2] = salt_buf1[2];
474     w2_t[3] = salt_buf1[3];
475     w3_t[0] = salt_buf2[0];
476     w3_t[1] = salt_buf2[1];
477     w3_t[2] = (16 + salt_len) * 8;
478     w3_t[3] = 0;
479
480     a = MD4M_A;
481     b = MD4M_B;
482     c = MD4M_C;
483     d = MD4M_D;
484
485     MD4_STEP (MD4_Fo, a, b, c, d, w0_t[0], MD4C00, MD4S00);
486     MD4_STEP (MD4_Fo, d, a, b, c, w0_t[1], MD4C00, MD4S01);
487     MD4_STEP (MD4_Fo, c, d, a, b, w0_t[2], MD4C00, MD4S02);
488     MD4_STEP (MD4_Fo, b, c, d, a, w0_t[3], MD4C00, MD4S03);
489     MD4_STEP (MD4_Fo, a, b, c, d, w1_t[0], MD4C00, MD4S00);
490     MD4_STEP (MD4_Fo, d, a, b, c, w1_t[1], MD4C00, MD4S01);
491     MD4_STEP (MD4_Fo, c, d, a, b, w1_t[2], MD4C00, MD4S02);
492     MD4_STEP (MD4_Fo, b, c, d, a, w1_t[3], MD4C00, MD4S03);
493     MD4_STEP (MD4_Fo, a, b, c, d, w2_t[0], MD4C00, MD4S00);
494     MD4_STEP (MD4_Fo, d, a, b, c, w2_t[1], MD4C00, MD4S01);
495     MD4_STEP (MD4_Fo, c, d, a, b, w2_t[2], MD4C00, MD4S02);
496     MD4_STEP (MD4_Fo, b, c, d, a, w2_t[3], MD4C00, MD4S03);
497     MD4_STEP (MD4_Fo, a, b, c, d, w3_t[0], MD4C00, MD4S00);
498     MD4_STEP (MD4_Fo, d, a, b, c, w3_t[1], MD4C00, MD4S01);
499     MD4_STEP (MD4_Fo, c, d, a, b, w3_t[2], MD4C00, MD4S02);
500     MD4_STEP (MD4_Fo, b, c, d, a, w3_t[3], MD4C00, MD4S03);
501
502     MD4_STEP (MD4_Go, a, b, c, d, w0_t[0], MD4C01, MD4S10);
503     MD4_STEP (MD4_Go, d, a, b, c, w1_t[0], MD4C01, MD4S11);
504     MD4_STEP (MD4_Go, c, d, a, b, w2_t[0], MD4C01, MD4S12);
505     MD4_STEP (MD4_Go, b, c, d, a, w3_t[0], MD4C01, MD4S13);
506     MD4_STEP (MD4_Go, a, b, c, d, w0_t[1], MD4C01, MD4S10);
507     MD4_STEP (MD4_Go, d, a, b, c, w1_t[1], MD4C01, MD4S11);
508     MD4_STEP (MD4_Go, c, d, a, b, w2_t[1], MD4C01, MD4S12);
509     MD4_STEP (MD4_Go, b, c, d, a, w3_t[1], MD4C01, MD4S13);
510     MD4_STEP (MD4_Go, a, b, c, d, w0_t[2], MD4C01, MD4S10);
511     MD4_STEP (MD4_Go, d, a, b, c, w1_t[2], MD4C01, MD4S11);
512     MD4_STEP (MD4_Go, c, d, a, b, w2_t[2], MD4C01, MD4S12);
513     MD4_STEP (MD4_Go, b, c, d, a, w3_t[2], MD4C01, MD4S13);
514     MD4_STEP (MD4_Go, a, b, c, d, w0_t[3], MD4C01, MD4S10);
515     MD4_STEP (MD4_Go, d, a, b, c, w1_t[3], MD4C01, MD4S11);
516     MD4_STEP (MD4_Go, c, d, a, b, w2_t[3], MD4C01, MD4S12);
517     MD4_STEP (MD4_Go, b, c, d, a, w3_t[3], MD4C01, MD4S13);
518
519     MD4_STEP (MD4_H , a, b, c, d, w0_t[0], MD4C02, MD4S20);
520     MD4_STEP (MD4_H , d, a, b, c, w2_t[0], MD4C02, MD4S21);
521     MD4_STEP (MD4_H , c, d, a, b, w1_t[0], MD4C02, MD4S22);
522     MD4_STEP (MD4_H , b, c, d, a, w3_t[0], MD4C02, MD4S23);
523     MD4_STEP (MD4_H , a, b, c, d, w0_t[2], MD4C02, MD4S20);
524     MD4_STEP (MD4_H , d, a, b, c, w2_t[2], MD4C02, MD4S21);
525     MD4_STEP (MD4_H , c, d, a, b, w1_t[2], MD4C02, MD4S22);
526     MD4_STEP (MD4_H , b, c, d, a, w3_t[2], MD4C02, MD4S23);
527     MD4_STEP (MD4_H , a, b, c, d, w0_t[1], MD4C02, MD4S20);
528     MD4_STEP (MD4_H , d, a, b, c, w2_t[1], MD4C02, MD4S21);
529     MD4_STEP (MD4_H , c, d, a, b, w1_t[1], MD4C02, MD4S22);
530     MD4_STEP (MD4_H , b, c, d, a, w3_t[1], MD4C02, MD4S23);
531     MD4_STEP (MD4_H , a, b, c, d, w0_t[3], MD4C02, MD4S20);
532
533     bool q_cond = allx (search[0] != a);
534
535     if (q_cond) continue;
536
537     MD4_STEP (MD4_H , d, a, b, c, w2_t[3], MD4C02, MD4S21);
538     MD4_STEP (MD4_H , c, d, a, b, w1_t[3], MD4C02, MD4S22);
539     MD4_STEP (MD4_H , b, c, d, a, w3_t[3], MD4C02, MD4S23);
540
541     const u32 r0 = a;
542     const u32 r1 = d;
543     const u32 r2 = c;
544     const u32 r3 = b;
545
546     #include COMPARE_S
547   }
548 }
549
550 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m01100_s08 (__global pw_t *pws, __global gpu_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)
551 {
552 }
553
554 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m01100_s16 (__global pw_t *pws, __global gpu_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)
555 {
556 }