Converted _a3 kernels, use SIMD for CPU and GPU
[hashcat.git] / OpenCL / m00030_a0.cl
1 /**
2  * Author......: Jens Steube <jens.steube@gmail.com>
3  * License.....: MIT
4  */
5
6 #define _MD5_
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_kernel.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 // no unicode yet
26
27 __kernel void m00030_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
28 {
29   /**
30    * modifier
31    */
32
33   const u32 lid = get_local_id (0);
34
35   /**
36    * base
37    */
38
39   const u32 gid = get_global_id (0);
40
41   if (gid >= gid_max) return;
42
43   u32 pw_buf0[4];
44
45   pw_buf0[0] = pws[gid].i[ 0];
46   pw_buf0[1] = pws[gid].i[ 1];
47   pw_buf0[2] = pws[gid].i[ 2];
48   pw_buf0[3] = pws[gid].i[ 3];
49
50   u32 pw_buf1[4];
51
52   pw_buf1[0] = pws[gid].i[ 4];
53   pw_buf1[1] = pws[gid].i[ 5];
54   pw_buf1[2] = pws[gid].i[ 6];
55   pw_buf1[3] = pws[gid].i[ 7];
56
57   const u32 pw_len = pws[gid].pw_len;
58
59   /**
60    * salt
61    */
62
63   u32 salt_buf0[4];
64
65   salt_buf0[0] = salt_bufs[salt_pos].salt_buf[0];
66   salt_buf0[1] = salt_bufs[salt_pos].salt_buf[1];
67   salt_buf0[2] = salt_bufs[salt_pos].salt_buf[2];
68   salt_buf0[3] = salt_bufs[salt_pos].salt_buf[3];
69
70   u32 salt_buf1[4];
71
72   salt_buf1[0] = salt_bufs[salt_pos].salt_buf[4];
73   salt_buf1[1] = salt_bufs[salt_pos].salt_buf[5];
74   salt_buf1[2] = salt_bufs[salt_pos].salt_buf[6];
75   salt_buf1[3] = salt_bufs[salt_pos].salt_buf[7];
76
77   const u32 salt_len = salt_bufs[salt_pos].salt_len;
78
79   /**
80    * loop
81    */
82
83   for (u32 il_pos = 0; il_pos < rules_cnt; il_pos++)
84   {
85     u32 w0[4];
86
87     w0[0] = pw_buf0[0];
88     w0[1] = pw_buf0[1];
89     w0[2] = pw_buf0[2];
90     w0[3] = pw_buf0[3];
91
92     u32 w1[4];
93
94     w1[0] = pw_buf1[0];
95     w1[1] = pw_buf1[1];
96     w1[2] = pw_buf1[2];
97     w1[3] = pw_buf1[3];
98
99     u32 w2[4];
100
101     w2[0] = 0;
102     w2[1] = 0;
103     w2[2] = 0;
104     w2[3] = 0;
105
106     u32 w3[4];
107
108     w3[0] = 0;
109     w3[1] = 0;
110     w3[2] = 0;
111     w3[3] = 0;
112
113     const u32 out_len = apply_rules (rules_buf[il_pos].cmds, w0, w1, pw_len);
114
115     /**
116      * append salt
117      */
118
119     u32 s0[4];
120
121     s0[0] = salt_buf0[0];
122     s0[1] = salt_buf0[1];
123     s0[2] = salt_buf0[2];
124     s0[3] = salt_buf0[3];
125
126     u32 s1[4];
127
128     s1[0] = salt_buf1[0];
129     s1[1] = salt_buf1[1];
130     s1[2] = salt_buf1[2];
131     s1[3] = salt_buf1[3];
132
133     u32 s2[4];
134
135     s2[0] = 0;
136     s2[1] = 0;
137     s2[2] = 0;
138     s2[3] = 0;
139
140     u32 s3[4];
141
142     s3[0] = 0;
143     s3[1] = 0;
144     s3[2] = 0;
145     s3[3] = 0;
146
147     switch_buffer_by_offset_le (s0, s1, s2, s3, (out_len * 2));
148
149     const u32 out_salt_len = (out_len * 2) + salt_len;
150
151     u32 w0_t[4];
152     u32 w1_t[4];
153     u32 w2_t[4];
154     u32 w3_t[4];
155
156     make_unicode (w0, w0_t, w1_t);
157     make_unicode (w1, w2_t, w3_t);
158
159     w0_t[0] |= s0[0];
160     w0_t[1] |= s0[1];
161     w0_t[2] |= s0[2];
162     w0_t[3] |= s0[3];
163     w1_t[0] |= s1[0];
164     w1_t[1] |= s1[1];
165     w1_t[2] |= s1[2];
166     w1_t[3] |= s1[3];
167     w2_t[0] |= s2[0];
168     w2_t[1] |= s2[1];
169     w2_t[2] |= s2[2];
170     w2_t[3] |= s2[3];
171     w3_t[0] |= s3[0];
172     w3_t[1] |= s3[1];
173     w3_t[2] |= s3[2];
174     w3_t[3] |= s3[3];
175
176     append_0x80_4x4 (w0_t, w1_t, w2_t, w3_t, out_salt_len);
177
178     w3_t[2] = out_salt_len * 8;
179
180     /**
181      * md5
182      */
183
184     u32 a = MD5M_A;
185     u32 b = MD5M_B;
186     u32 c = MD5M_C;
187     u32 d = MD5M_D;
188
189     MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
190     MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
191     MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
192     MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
193     MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
194     MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
195     MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
196     MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
197     MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
198     MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
199     MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
200     MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
201     MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
202     MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
203     MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
204     MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
205
206     MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
207     MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
208     MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
209     MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
210     MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
211     MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
212     MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
213     MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
214     MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
215     MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
216     MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
217     MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
218     MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
219     MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
220     MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
221     MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
222
223     MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
224     MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
225     MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
226     MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
227     MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
228     MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
229     MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
230     MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
231     MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
232     MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
233     MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
234     MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
235     MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
236     MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
237     MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
238     MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
239
240     MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
241     MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
242     MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
243     MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
244     MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
245     MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
246     MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
247     MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
248     MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
249     MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
250     MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
251     MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
252     MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
253     MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
254     MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
255     MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
256
257
258     const u32 r0 = a;
259     const u32 r1 = d;
260     const u32 r2 = c;
261     const u32 r3 = b;
262
263     #include COMPARE_M
264   }
265 }
266
267 __kernel void m00030_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 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
268 {
269 }
270
271 __kernel void m00030_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 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
272 {
273 }
274
275 __kernel void m00030_s04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
276 {
277   /**
278    * modifier
279    */
280
281   const u32 lid = get_local_id (0);
282
283   /**
284    * base
285    */
286
287   const u32 gid = get_global_id (0);
288
289   if (gid >= gid_max) return;
290
291   u32 pw_buf0[4];
292
293   pw_buf0[0] = pws[gid].i[ 0];
294   pw_buf0[1] = pws[gid].i[ 1];
295   pw_buf0[2] = pws[gid].i[ 2];
296   pw_buf0[3] = pws[gid].i[ 3];
297
298   u32 pw_buf1[4];
299
300   pw_buf1[0] = pws[gid].i[ 4];
301   pw_buf1[1] = pws[gid].i[ 5];
302   pw_buf1[2] = pws[gid].i[ 6];
303   pw_buf1[3] = pws[gid].i[ 7];
304
305   const u32 pw_len = pws[gid].pw_len;
306
307   /**
308    * salt
309    */
310
311   u32 salt_buf0[4];
312
313   salt_buf0[0] = salt_bufs[salt_pos].salt_buf[0];
314   salt_buf0[1] = salt_bufs[salt_pos].salt_buf[1];
315   salt_buf0[2] = salt_bufs[salt_pos].salt_buf[2];
316   salt_buf0[3] = salt_bufs[salt_pos].salt_buf[3];
317
318   u32 salt_buf1[4];
319
320   salt_buf1[0] = salt_bufs[salt_pos].salt_buf[4];
321   salt_buf1[1] = salt_bufs[salt_pos].salt_buf[5];
322   salt_buf1[2] = salt_bufs[salt_pos].salt_buf[6];
323   salt_buf1[3] = salt_bufs[salt_pos].salt_buf[7];
324
325   const u32 salt_len = salt_bufs[salt_pos].salt_len;
326
327   /**
328    * digest
329    */
330
331   const u32 search[4] =
332   {
333     digests_buf[digests_offset].digest_buf[DGST_R0],
334     digests_buf[digests_offset].digest_buf[DGST_R1],
335     digests_buf[digests_offset].digest_buf[DGST_R2],
336     digests_buf[digests_offset].digest_buf[DGST_R3]
337   };
338
339   /**
340    * loop
341    */
342
343   for (u32 il_pos = 0; il_pos < rules_cnt; il_pos++)
344   {
345     u32 w0[4];
346
347     w0[0] = pw_buf0[0];
348     w0[1] = pw_buf0[1];
349     w0[2] = pw_buf0[2];
350     w0[3] = pw_buf0[3];
351
352     u32 w1[4];
353
354     w1[0] = pw_buf1[0];
355     w1[1] = pw_buf1[1];
356     w1[2] = pw_buf1[2];
357     w1[3] = pw_buf1[3];
358
359     u32 w2[4];
360
361     w2[0] = 0;
362     w2[1] = 0;
363     w2[2] = 0;
364     w2[3] = 0;
365
366     u32 w3[4];
367
368     w3[0] = 0;
369     w3[1] = 0;
370     w3[2] = 0;
371     w3[3] = 0;
372
373     const u32 out_len = apply_rules (rules_buf[il_pos].cmds, w0, w1, pw_len);
374
375     /**
376      * append salt
377      */
378
379     u32 s0[4];
380
381     s0[0] = salt_buf0[0];
382     s0[1] = salt_buf0[1];
383     s0[2] = salt_buf0[2];
384     s0[3] = salt_buf0[3];
385
386     u32 s1[4];
387
388     s1[0] = salt_buf1[0];
389     s1[1] = salt_buf1[1];
390     s1[2] = salt_buf1[2];
391     s1[3] = salt_buf1[3];
392
393     u32 s2[4];
394
395     s2[0] = 0;
396     s2[1] = 0;
397     s2[2] = 0;
398     s2[3] = 0;
399
400     u32 s3[4];
401
402     s3[0] = 0;
403     s3[1] = 0;
404     s3[2] = 0;
405     s3[3] = 0;
406
407     switch_buffer_by_offset_le (s0, s1, s2, s3, (out_len * 2));
408
409     const u32 out_salt_len = (out_len * 2) + salt_len;
410
411     u32 w0_t[4];
412     u32 w1_t[4];
413     u32 w2_t[4];
414     u32 w3_t[4];
415
416     make_unicode (w0, w0_t, w1_t);
417     make_unicode (w1, w2_t, w3_t);
418
419     w0_t[0] |= s0[0];
420     w0_t[1] |= s0[1];
421     w0_t[2] |= s0[2];
422     w0_t[3] |= s0[3];
423     w1_t[0] |= s1[0];
424     w1_t[1] |= s1[1];
425     w1_t[2] |= s1[2];
426     w1_t[3] |= s1[3];
427     w2_t[0] |= s2[0];
428     w2_t[1] |= s2[1];
429     w2_t[2] |= s2[2];
430     w2_t[3] |= s2[3];
431     w3_t[0] |= s3[0];
432     w3_t[1] |= s3[1];
433     w3_t[2] |= s3[2];
434     w3_t[3] |= s3[3];
435
436     append_0x80_4x4 (w0_t, w1_t, w2_t, w3_t, out_salt_len);
437
438     w3_t[2] = out_salt_len * 8;
439
440     /**
441      * md5
442      */
443
444     u32 a = MD5M_A;
445     u32 b = MD5M_B;
446     u32 c = MD5M_C;
447     u32 d = MD5M_D;
448
449     MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
450     MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
451     MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
452     MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
453     MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
454     MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
455     MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
456     MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
457     MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
458     MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
459     MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
460     MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
461     MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
462     MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
463     MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
464     MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
465
466     MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
467     MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
468     MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
469     MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
470     MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
471     MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
472     MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
473     MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
474     MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
475     MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
476     MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
477     MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
478     MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
479     MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
480     MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
481     MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
482
483     MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
484     MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
485     MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
486     MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
487     MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
488     MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
489     MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
490     MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
491     MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
492     MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
493     MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
494     MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
495     MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
496     MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
497     MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
498     MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
499
500     MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
501     MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
502     MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
503     MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
504     MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
505     MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
506     MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
507     MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
508     MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
509     MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
510     MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
511     MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
512     MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
513
514     bool q_cond = allx (search[0] != a);
515
516     if (q_cond) continue;
517
518     MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
519     MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
520     MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
521
522
523     const u32 r0 = a;
524     const u32 r1 = d;
525     const u32 r2 = c;
526     const u32 r3 = b;
527
528     #include COMPARE_S
529   }
530 }
531
532 __kernel void m00030_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 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
533 {
534 }
535
536 __kernel void m00030_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 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
537 {
538 }