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