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