Fixed two major problems
[hashcat.git] / OpenCL / m09900_a0.cl
1 /**
2  * Author......: Jens Steube <jens.steube@gmail.com>
3  * License.....: MIT
4  */
5
6 #define _MD5_
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 m09900_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
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    * loop
59    */
60
61   for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
62   {
63     u32x w0[4] = { 0 };
64     u32x w1[4] = { 0 };
65     u32x w2[4] = { 0 };
66     u32x w3[4] = { 0 };
67
68     apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1);
69
70     u32x a = MD5M_A;
71     u32x b = MD5M_B;
72     u32x c = MD5M_C;
73     u32x d = MD5M_D;
74
75     MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
76     MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
77     MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
78     MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
79     MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
80     MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
81     MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
82     MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
83     MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
84     MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
85     MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
86     MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
87     MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
88     MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
89     MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
90     MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
91
92     MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
93     MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
94     MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
95     MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
96     MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
97     MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
98     MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
99     MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
100     MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
101     MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
102     MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
103     MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
104     MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
105     MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
106     MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
107     MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
108
109     MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
110     MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
111     MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
112     MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
113     MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
114     MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
115     MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
116     MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
117     MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
118     MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
119     MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
120     MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
121     MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
122     MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
123     MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
124     MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
125
126     MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
127     MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
128     MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
129     MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
130     MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
131     MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
132     MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
133     MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
134     MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
135     MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
136     MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
137     MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
138     MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
139     MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
140     MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
141     MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
142
143     a += MD5M_A;
144     b += MD5M_B;
145     c += MD5M_C;
146     d += MD5M_D;
147
148     u32x r_a = a;
149     u32x r_b = b;
150     u32x r_c = c;
151     u32x r_d = d;
152
153     u32x t0[4];
154     u32x t1[4];
155     u32x t2[4];
156     u32x t3[4];
157
158     t0[0] = 0;
159     t0[1] = 0;
160     t0[2] = 0;
161     t0[3] = 0;
162     t1[0] = 0;
163     t1[1] = 0;
164     t1[2] = 0;
165     t1[3] = 0;
166     t2[0] = 0;
167     t2[1] = 0x80;
168     t2[2] = 0;
169     t2[3] = 0;
170     t3[0] = 0;
171     t3[1] = 0;
172     t3[2] = 100 * 8;
173     t3[3] = 0;
174
175     MD5_STEP (MD5_Fo, a, b, c, d, t0[0], MD5C00, MD5S00);
176     MD5_STEP (MD5_Fo, d, a, b, c, t0[1], MD5C01, MD5S01);
177     MD5_STEP (MD5_Fo, c, d, a, b, t0[2], MD5C02, MD5S02);
178     MD5_STEP (MD5_Fo, b, c, d, a, t0[3], MD5C03, MD5S03);
179     MD5_STEP (MD5_Fo, a, b, c, d, t1[0], MD5C04, MD5S00);
180     MD5_STEP (MD5_Fo, d, a, b, c, t1[1], MD5C05, MD5S01);
181     MD5_STEP (MD5_Fo, c, d, a, b, t1[2], MD5C06, MD5S02);
182     MD5_STEP (MD5_Fo, b, c, d, a, t1[3], MD5C07, MD5S03);
183     MD5_STEP (MD5_Fo, a, b, c, d, t2[0], MD5C08, MD5S00);
184     MD5_STEP (MD5_Fo, d, a, b, c, t2[1], MD5C09, MD5S01);
185     MD5_STEP (MD5_Fo, c, d, a, b, t2[2], MD5C0a, MD5S02);
186     MD5_STEP (MD5_Fo, b, c, d, a, t2[3], MD5C0b, MD5S03);
187     MD5_STEP (MD5_Fo, a, b, c, d, t3[0], MD5C0c, MD5S00);
188     MD5_STEP (MD5_Fo, d, a, b, c, t3[1], MD5C0d, MD5S01);
189     MD5_STEP (MD5_Fo, c, d, a, b, t3[2], MD5C0e, MD5S02);
190     MD5_STEP (MD5_Fo, b, c, d, a, t3[3], MD5C0f, MD5S03);
191
192     MD5_STEP (MD5_Go, a, b, c, d, t0[1], MD5C10, MD5S10);
193     MD5_STEP (MD5_Go, d, a, b, c, t1[2], MD5C11, MD5S11);
194     MD5_STEP (MD5_Go, c, d, a, b, t2[3], MD5C12, MD5S12);
195     MD5_STEP (MD5_Go, b, c, d, a, t0[0], MD5C13, MD5S13);
196     MD5_STEP (MD5_Go, a, b, c, d, t1[1], MD5C14, MD5S10);
197     MD5_STEP (MD5_Go, d, a, b, c, t2[2], MD5C15, MD5S11);
198     MD5_STEP (MD5_Go, c, d, a, b, t3[3], MD5C16, MD5S12);
199     MD5_STEP (MD5_Go, b, c, d, a, t1[0], MD5C17, MD5S13);
200     MD5_STEP (MD5_Go, a, b, c, d, t2[1], MD5C18, MD5S10);
201     MD5_STEP (MD5_Go, d, a, b, c, t3[2], MD5C19, MD5S11);
202     MD5_STEP (MD5_Go, c, d, a, b, t0[3], MD5C1a, MD5S12);
203     MD5_STEP (MD5_Go, b, c, d, a, t2[0], MD5C1b, MD5S13);
204     MD5_STEP (MD5_Go, a, b, c, d, t3[1], MD5C1c, MD5S10);
205     MD5_STEP (MD5_Go, d, a, b, c, t0[2], MD5C1d, MD5S11);
206     MD5_STEP (MD5_Go, c, d, a, b, t1[3], MD5C1e, MD5S12);
207     MD5_STEP (MD5_Go, b, c, d, a, t3[0], MD5C1f, MD5S13);
208
209     MD5_STEP (MD5_H , a, b, c, d, t1[1], MD5C20, MD5S20);
210     MD5_STEP (MD5_H , d, a, b, c, t2[0], MD5C21, MD5S21);
211     MD5_STEP (MD5_H , c, d, a, b, t2[3], MD5C22, MD5S22);
212     MD5_STEP (MD5_H , b, c, d, a, t3[2], MD5C23, MD5S23);
213     MD5_STEP (MD5_H , a, b, c, d, t0[1], MD5C24, MD5S20);
214     MD5_STEP (MD5_H , d, a, b, c, t1[0], MD5C25, MD5S21);
215     MD5_STEP (MD5_H , c, d, a, b, t1[3], MD5C26, MD5S22);
216     MD5_STEP (MD5_H , b, c, d, a, t2[2], MD5C27, MD5S23);
217     MD5_STEP (MD5_H , a, b, c, d, t3[1], MD5C28, MD5S20);
218     MD5_STEP (MD5_H , d, a, b, c, t0[0], MD5C29, MD5S21);
219     MD5_STEP (MD5_H , c, d, a, b, t0[3], MD5C2a, MD5S22);
220     MD5_STEP (MD5_H , b, c, d, a, t1[2], MD5C2b, MD5S23);
221     MD5_STEP (MD5_H , a, b, c, d, t2[1], MD5C2c, MD5S20);
222     MD5_STEP (MD5_H , d, a, b, c, t3[0], MD5C2d, MD5S21);
223     MD5_STEP (MD5_H , c, d, a, b, t3[3], MD5C2e, MD5S22);
224     MD5_STEP (MD5_H , b, c, d, a, t0[2], MD5C2f, MD5S23);
225
226     MD5_STEP (MD5_I , a, b, c, d, t0[0], MD5C30, MD5S30);
227     MD5_STEP (MD5_I , d, a, b, c, t1[3], MD5C31, MD5S31);
228     MD5_STEP (MD5_I , c, d, a, b, t3[2], MD5C32, MD5S32);
229     MD5_STEP (MD5_I , b, c, d, a, t1[1], MD5C33, MD5S33);
230     MD5_STEP (MD5_I , a, b, c, d, t3[0], MD5C34, MD5S30);
231     MD5_STEP (MD5_I , d, a, b, c, t0[3], MD5C35, MD5S31);
232     MD5_STEP (MD5_I , c, d, a, b, t2[2], MD5C36, MD5S32);
233     MD5_STEP (MD5_I , b, c, d, a, t0[1], MD5C37, MD5S33);
234     MD5_STEP (MD5_I , a, b, c, d, t2[0], MD5C38, MD5S30);
235     MD5_STEP (MD5_I , d, a, b, c, t3[3], MD5C39, MD5S31);
236     MD5_STEP (MD5_I , c, d, a, b, t1[2], MD5C3a, MD5S32);
237     MD5_STEP (MD5_I , b, c, d, a, t3[1], MD5C3b, MD5S33);
238     MD5_STEP (MD5_I , a, b, c, d, t1[0], MD5C3c, MD5S30);
239     MD5_STEP (MD5_I , d, a, b, c, t2[3], MD5C3d, MD5S31);
240     MD5_STEP (MD5_I , c, d, a, b, t0[2], MD5C3e, MD5S32);
241     MD5_STEP (MD5_I , b, c, d, a, t2[1], MD5C3f, MD5S33);
242
243     a += r_a;
244     b += r_b;
245     c += r_c;
246     d += r_d;
247
248     COMPARE_M_SIMD (a, d, c, b);
249   }
250 }
251
252 __kernel void m09900_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)
253 {
254 }
255
256 __kernel void m09900_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)
257 {
258 }
259
260 __kernel void m09900_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)
261 {
262   /**
263    * modifier
264    */
265
266   const u32 lid = get_local_id (0);
267
268   /**
269    * base
270    */
271
272   const u32 gid = get_global_id (0);
273
274   if (gid >= gid_max) return;
275
276   u32 pw_buf0[4];
277
278   pw_buf0[0] = pws[gid].i[ 0];
279   pw_buf0[1] = pws[gid].i[ 1];
280   pw_buf0[2] = pws[gid].i[ 2];
281   pw_buf0[3] = pws[gid].i[ 3];
282
283   u32 pw_buf1[4];
284
285   pw_buf1[0] = pws[gid].i[ 4];
286   pw_buf1[1] = pws[gid].i[ 5];
287   pw_buf1[2] = pws[gid].i[ 6];
288   pw_buf1[3] = pws[gid].i[ 7];
289
290   const u32 pw_len = pws[gid].pw_len;
291
292   /**
293    * digest
294    */
295
296   const u32 search[4] =
297   {
298     digests_buf[digests_offset].digest_buf[DGST_R0],
299     digests_buf[digests_offset].digest_buf[DGST_R1],
300     digests_buf[digests_offset].digest_buf[DGST_R2],
301     digests_buf[digests_offset].digest_buf[DGST_R3]
302   };
303
304   /**
305    * loop
306    */
307
308   for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
309   {
310     u32x w0[4] = { 0 };
311     u32x w1[4] = { 0 };
312     u32x w2[4] = { 0 };
313     u32x w3[4] = { 0 };
314
315     apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1);
316
317     u32x a = MD5M_A;
318     u32x b = MD5M_B;
319     u32x c = MD5M_C;
320     u32x d = MD5M_D;
321
322     MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
323     MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
324     MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
325     MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
326     MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
327     MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
328     MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
329     MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
330     MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
331     MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
332     MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
333     MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
334     MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
335     MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
336     MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
337     MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
338
339     MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
340     MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
341     MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
342     MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
343     MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
344     MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
345     MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
346     MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
347     MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
348     MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
349     MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
350     MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
351     MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
352     MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
353     MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
354     MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
355
356     MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
357     MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
358     MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
359     MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
360     MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
361     MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
362     MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
363     MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
364     MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
365     MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
366     MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
367     MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
368     MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
369     MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
370     MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
371     MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
372
373     MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
374     MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
375     MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
376     MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
377     MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
378     MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
379     MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
380     MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
381     MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
382     MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
383     MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
384     MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
385     MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
386     MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
387     MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
388     MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
389
390     a += MD5M_A;
391     b += MD5M_B;
392     c += MD5M_C;
393     d += MD5M_D;
394
395     u32x r_a = a;
396     u32x r_b = b;
397     u32x r_c = c;
398     u32x r_d = d;
399
400     u32x t0[4];
401     u32x t1[4];
402     u32x t2[4];
403     u32x t3[4];
404
405     t0[0] = 0;
406     t0[1] = 0;
407     t0[2] = 0;
408     t0[3] = 0;
409     t1[0] = 0;
410     t1[1] = 0;
411     t1[2] = 0;
412     t1[3] = 0;
413     t2[0] = 0;
414     t2[1] = 0x80;
415     t2[2] = 0;
416     t2[3] = 0;
417     t3[0] = 0;
418     t3[1] = 0;
419     t3[2] = 100 * 8;
420     t3[3] = 0;
421
422     MD5_STEP (MD5_Fo, a, b, c, d, t0[0], MD5C00, MD5S00);
423     MD5_STEP (MD5_Fo, d, a, b, c, t0[1], MD5C01, MD5S01);
424     MD5_STEP (MD5_Fo, c, d, a, b, t0[2], MD5C02, MD5S02);
425     MD5_STEP (MD5_Fo, b, c, d, a, t0[3], MD5C03, MD5S03);
426     MD5_STEP (MD5_Fo, a, b, c, d, t1[0], MD5C04, MD5S00);
427     MD5_STEP (MD5_Fo, d, a, b, c, t1[1], MD5C05, MD5S01);
428     MD5_STEP (MD5_Fo, c, d, a, b, t1[2], MD5C06, MD5S02);
429     MD5_STEP (MD5_Fo, b, c, d, a, t1[3], MD5C07, MD5S03);
430     MD5_STEP (MD5_Fo, a, b, c, d, t2[0], MD5C08, MD5S00);
431     MD5_STEP (MD5_Fo, d, a, b, c, t2[1], MD5C09, MD5S01);
432     MD5_STEP (MD5_Fo, c, d, a, b, t2[2], MD5C0a, MD5S02);
433     MD5_STEP (MD5_Fo, b, c, d, a, t2[3], MD5C0b, MD5S03);
434     MD5_STEP (MD5_Fo, a, b, c, d, t3[0], MD5C0c, MD5S00);
435     MD5_STEP (MD5_Fo, d, a, b, c, t3[1], MD5C0d, MD5S01);
436     MD5_STEP (MD5_Fo, c, d, a, b, t3[2], MD5C0e, MD5S02);
437     MD5_STEP (MD5_Fo, b, c, d, a, t3[3], MD5C0f, MD5S03);
438
439     MD5_STEP (MD5_Go, a, b, c, d, t0[1], MD5C10, MD5S10);
440     MD5_STEP (MD5_Go, d, a, b, c, t1[2], MD5C11, MD5S11);
441     MD5_STEP (MD5_Go, c, d, a, b, t2[3], MD5C12, MD5S12);
442     MD5_STEP (MD5_Go, b, c, d, a, t0[0], MD5C13, MD5S13);
443     MD5_STEP (MD5_Go, a, b, c, d, t1[1], MD5C14, MD5S10);
444     MD5_STEP (MD5_Go, d, a, b, c, t2[2], MD5C15, MD5S11);
445     MD5_STEP (MD5_Go, c, d, a, b, t3[3], MD5C16, MD5S12);
446     MD5_STEP (MD5_Go, b, c, d, a, t1[0], MD5C17, MD5S13);
447     MD5_STEP (MD5_Go, a, b, c, d, t2[1], MD5C18, MD5S10);
448     MD5_STEP (MD5_Go, d, a, b, c, t3[2], MD5C19, MD5S11);
449     MD5_STEP (MD5_Go, c, d, a, b, t0[3], MD5C1a, MD5S12);
450     MD5_STEP (MD5_Go, b, c, d, a, t2[0], MD5C1b, MD5S13);
451     MD5_STEP (MD5_Go, a, b, c, d, t3[1], MD5C1c, MD5S10);
452     MD5_STEP (MD5_Go, d, a, b, c, t0[2], MD5C1d, MD5S11);
453     MD5_STEP (MD5_Go, c, d, a, b, t1[3], MD5C1e, MD5S12);
454     MD5_STEP (MD5_Go, b, c, d, a, t3[0], MD5C1f, MD5S13);
455
456     MD5_STEP (MD5_H , a, b, c, d, t1[1], MD5C20, MD5S20);
457     MD5_STEP (MD5_H , d, a, b, c, t2[0], MD5C21, MD5S21);
458     MD5_STEP (MD5_H , c, d, a, b, t2[3], MD5C22, MD5S22);
459     MD5_STEP (MD5_H , b, c, d, a, t3[2], MD5C23, MD5S23);
460     MD5_STEP (MD5_H , a, b, c, d, t0[1], MD5C24, MD5S20);
461     MD5_STEP (MD5_H , d, a, b, c, t1[0], MD5C25, MD5S21);
462     MD5_STEP (MD5_H , c, d, a, b, t1[3], MD5C26, MD5S22);
463     MD5_STEP (MD5_H , b, c, d, a, t2[2], MD5C27, MD5S23);
464     MD5_STEP (MD5_H , a, b, c, d, t3[1], MD5C28, MD5S20);
465     MD5_STEP (MD5_H , d, a, b, c, t0[0], MD5C29, MD5S21);
466     MD5_STEP (MD5_H , c, d, a, b, t0[3], MD5C2a, MD5S22);
467     MD5_STEP (MD5_H , b, c, d, a, t1[2], MD5C2b, MD5S23);
468     MD5_STEP (MD5_H , a, b, c, d, t2[1], MD5C2c, MD5S20);
469     MD5_STEP (MD5_H , d, a, b, c, t3[0], MD5C2d, MD5S21);
470     MD5_STEP (MD5_H , c, d, a, b, t3[3], MD5C2e, MD5S22);
471     MD5_STEP (MD5_H , b, c, d, a, t0[2], MD5C2f, MD5S23);
472
473     MD5_STEP (MD5_I , a, b, c, d, t0[0], MD5C30, MD5S30);
474     MD5_STEP (MD5_I , d, a, b, c, t1[3], MD5C31, MD5S31);
475     MD5_STEP (MD5_I , c, d, a, b, t3[2], MD5C32, MD5S32);
476     MD5_STEP (MD5_I , b, c, d, a, t1[1], MD5C33, MD5S33);
477     MD5_STEP (MD5_I , a, b, c, d, t3[0], MD5C34, MD5S30);
478     MD5_STEP (MD5_I , d, a, b, c, t0[3], MD5C35, MD5S31);
479     MD5_STEP (MD5_I , c, d, a, b, t2[2], MD5C36, MD5S32);
480     MD5_STEP (MD5_I , b, c, d, a, t0[1], MD5C37, MD5S33);
481     MD5_STEP (MD5_I , a, b, c, d, t2[0], MD5C38, MD5S30);
482     MD5_STEP (MD5_I , d, a, b, c, t3[3], MD5C39, MD5S31);
483     MD5_STEP (MD5_I , c, d, a, b, t1[2], MD5C3a, MD5S32);
484     MD5_STEP (MD5_I , b, c, d, a, t3[1], MD5C3b, MD5S33);
485     MD5_STEP (MD5_I , a, b, c, d, t1[0], MD5C3c, MD5S30);
486
487     if (MATCHES_NONE_VS ((a + r_a), search[0])) continue;
488
489     MD5_STEP (MD5_I , d, a, b, c, t2[3], MD5C3d, MD5S31);
490     MD5_STEP (MD5_I , c, d, a, b, t0[2], MD5C3e, MD5S32);
491     MD5_STEP (MD5_I , b, c, d, a, t2[1], MD5C3f, MD5S33);
492
493     a += r_a;
494     b += r_b;
495     c += r_c;
496     d += r_d;
497
498     COMPARE_S_SIMD (a, d, c, b);
499   }
500 }
501
502 __kernel void m09900_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)
503 {
504 }
505
506 __kernel void m09900_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)
507 {
508 }