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