Initial commit
[hashcat.git] / amd / m00120_a1.cl
1 /**
2  * Author......: Jens Steube <jens.steube@gmail.com>
3  * License.....: MIT
4  */
5
6 #define _SHA1_
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 3
24 #define DGST_R1 4
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))) m00120_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     u32 wordr1[4];
130     u32 wordr2[4];
131     u32 wordr3[4];
132
133     wordr0[0] = combs_buf[il_pos].i[0];
134     wordr0[1] = combs_buf[il_pos].i[1];
135     wordr0[2] = combs_buf[il_pos].i[2];
136     wordr0[3] = combs_buf[il_pos].i[3];
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     wordr2[0] = 0;
142     wordr2[1] = 0;
143     wordr2[2] = 0;
144     wordr2[3] = 0;
145     wordr3[0] = 0;
146     wordr3[1] = 0;
147     wordr3[2] = 0;
148     wordr3[3] = 0;
149
150     if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
151     {
152       switch_buffer_by_offset (wordr0, wordr1, wordr2, wordr3, pw_l_len);
153     }
154
155     u32x w0[4];
156     u32x w1[4];
157     u32x w2[4];
158     u32x w3[4];
159
160     w0[0] = wordl0[0] | wordr0[0];
161     w0[1] = wordl0[1] | wordr0[1];
162     w0[2] = wordl0[2] | wordr0[2];
163     w0[3] = wordl0[3] | wordr0[3];
164     w1[0] = wordl1[0] | wordr1[0];
165     w1[1] = wordl1[1] | wordr1[1];
166     w1[2] = wordl1[2] | wordr1[2];
167     w1[3] = wordl1[3] | wordr1[3];
168     w2[0] = wordl2[0] | wordr2[0];
169     w2[1] = wordl2[1] | wordr2[1];
170     w2[2] = wordl2[2] | wordr2[2];
171     w2[3] = wordl2[3] | wordr2[3];
172     w3[0] = wordl3[0] | wordr3[0];
173     w3[1] = wordl3[1] | wordr3[1];
174     w3[2] = wordl3[2] | wordr3[2];
175     w3[3] = wordl3[3] | wordr3[3];
176
177     /**
178      * prepend salt
179      */
180
181     const u32 pw_salt_len = pw_len + salt_len;
182
183     u32x w0_t[4];
184     u32x w1_t[4];
185     u32x w2_t[4];
186     u32x w3_t[4];
187
188     w0_t[0] = w0[0];
189     w0_t[1] = w0[1];
190     w0_t[2] = w0[2];
191     w0_t[3] = w0[3];
192     w1_t[0] = w1[0];
193     w1_t[1] = w1[1];
194     w1_t[2] = w1[2];
195     w1_t[3] = w1[3];
196     w2_t[0] = w2[0];
197     w2_t[1] = w2[1];
198     w2_t[2] = w2[2];
199     w2_t[3] = w2[3];
200     w3_t[0] = w3[0];
201     w3_t[1] = w3[1];
202     w3_t[2] = w3[2];
203     w3_t[3] = w3[3];
204
205     switch_buffer_by_offset (w0_t, w1_t, w2_t, w3_t, salt_len);
206
207     w0_t[0] |= salt_buf0[0];
208     w0_t[1] |= salt_buf0[1];
209     w0_t[2] |= salt_buf0[2];
210     w0_t[3] |= salt_buf0[3];
211     w1_t[0] |= salt_buf1[0];
212     w1_t[1] |= salt_buf1[1];
213     w1_t[2] |= salt_buf1[2];
214     w1_t[3] |= salt_buf1[3];
215
216     append_0x80_4 (w0_t, w1_t, w2_t, w3_t, pw_salt_len);
217
218     w3_t[3] = pw_salt_len * 8;
219
220     /**
221      * sha1
222      */
223
224     w0_t[0] = swap_workaround (w0_t[0]);
225     w0_t[1] = swap_workaround (w0_t[1]);
226     w0_t[2] = swap_workaround (w0_t[2]);
227     w0_t[3] = swap_workaround (w0_t[3]);
228     w1_t[0] = swap_workaround (w1_t[0]);
229     w1_t[1] = swap_workaround (w1_t[1]);
230     w1_t[2] = swap_workaround (w1_t[2]);
231     w1_t[3] = swap_workaround (w1_t[3]);
232     w2_t[0] = swap_workaround (w2_t[0]);
233     w2_t[1] = swap_workaround (w2_t[1]);
234     w2_t[2] = swap_workaround (w2_t[2]);
235     w2_t[3] = swap_workaround (w2_t[3]);
236     w3_t[0] = swap_workaround (w3_t[0]);
237     w3_t[1] = swap_workaround (w3_t[1]);
238     //w3_t[2] = swap_workaround (w3_t[2]);
239     //w3_t[3] = swap_workaround (w3_t[3]);
240
241     u32x a = SHA1M_A;
242     u32x b = SHA1M_B;
243     u32x c = SHA1M_C;
244     u32x d = SHA1M_D;
245     u32x e = SHA1M_E;
246
247     #undef K
248     #define K SHA1C00
249
250     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0_t[0]);
251     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t[1]);
252     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w0_t[2]);
253     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w0_t[3]);
254     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w1_t[0]);
255     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w1_t[1]);
256     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1_t[2]);
257     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1_t[3]);
258     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2_t[0]);
259     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w2_t[1]);
260     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w2_t[2]);
261     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w2_t[3]);
262     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w3_t[0]);
263     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3_t[1]);
264     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3_t[2]);
265     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w3_t[3]);
266     w0_t[0] = rotl32 ((w3_t[1] ^ w2_t[0] ^ w0_t[2] ^ w0_t[0]), 1u); SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t[0]);
267     w0_t[1] = rotl32 ((w3_t[2] ^ w2_t[1] ^ w0_t[3] ^ w0_t[1]), 1u); SHA1_STEP (SHA1_F0o, d, e, a, b, c, w0_t[1]);
268     w0_t[2] = rotl32 ((w3_t[3] ^ w2_t[2] ^ w1_t[0] ^ w0_t[2]), 1u); SHA1_STEP (SHA1_F0o, c, d, e, a, b, w0_t[2]);
269     w0_t[3] = rotl32 ((w0_t[0] ^ w2_t[3] ^ w1_t[1] ^ w0_t[3]), 1u); SHA1_STEP (SHA1_F0o, b, c, d, e, a, w0_t[3]);
270
271     #undef K
272     #define K SHA1C01
273
274     w1_t[0] = rotl32 ((w0_t[1] ^ w3_t[0] ^ w1_t[2] ^ w1_t[0]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1_t[0]);
275     w1_t[1] = rotl32 ((w0_t[2] ^ w3_t[1] ^ w1_t[3] ^ w1_t[1]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w1_t[1]);
276     w1_t[2] = rotl32 ((w0_t[3] ^ w3_t[2] ^ w2_t[0] ^ w1_t[2]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w1_t[2]);
277     w1_t[3] = rotl32 ((w1_t[0] ^ w3_t[3] ^ w2_t[1] ^ w1_t[3]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t[3]);
278     w2_t[0] = rotl32 ((w1_t[1] ^ w0_t[0] ^ w2_t[2] ^ w2_t[0]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t[0]);
279     w2_t[1] = rotl32 ((w1_t[2] ^ w0_t[1] ^ w2_t[3] ^ w2_t[1]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w2_t[1]);
280     w2_t[2] = rotl32 ((w1_t[3] ^ w0_t[2] ^ w3_t[0] ^ w2_t[2]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w2_t[2]);
281     w2_t[3] = rotl32 ((w2_t[0] ^ w0_t[3] ^ w3_t[1] ^ w2_t[3]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w2_t[3]);
282     w3_t[0] = rotl32 ((w2_t[1] ^ w1_t[0] ^ w3_t[2] ^ w3_t[0]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w3_t[0]);
283     w3_t[1] = rotl32 ((w2_t[2] ^ w1_t[1] ^ w3_t[3] ^ w3_t[1]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w3_t[1]);
284     w3_t[2] = rotl32 ((w2_t[3] ^ w1_t[2] ^ w0_t[0] ^ w3_t[2]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3_t[2]);
285     w3_t[3] = rotl32 ((w3_t[0] ^ w1_t[3] ^ w0_t[1] ^ w3_t[3]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w3_t[3]);
286     w0_t[0] = rotl32 ((w3_t[1] ^ w2_t[0] ^ w0_t[2] ^ w0_t[0]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0_t[0]);
287     w0_t[1] = rotl32 ((w3_t[2] ^ w2_t[1] ^ w0_t[3] ^ w0_t[1]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w0_t[1]);
288     w0_t[2] = rotl32 ((w3_t[3] ^ w2_t[2] ^ w1_t[0] ^ w0_t[2]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0_t[2]);
289     w0_t[3] = rotl32 ((w0_t[0] ^ w2_t[3] ^ w1_t[1] ^ w0_t[3]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w0_t[3]);
290     w1_t[0] = rotl32 ((w0_t[1] ^ w3_t[0] ^ w1_t[2] ^ w1_t[0]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w1_t[0]);
291     w1_t[1] = rotl32 ((w0_t[2] ^ w3_t[1] ^ w1_t[3] ^ w1_t[1]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w1_t[1]);
292     w1_t[2] = rotl32 ((w0_t[3] ^ w3_t[2] ^ w2_t[0] ^ w1_t[2]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t[2]);
293     w1_t[3] = rotl32 ((w1_t[0] ^ w3_t[3] ^ w2_t[1] ^ w1_t[3]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w1_t[3]);
294
295     #undef K
296     #define K SHA1C02
297
298     w2_t[0] = rotl32 ((w1_t[1] ^ w0_t[0] ^ w2_t[2] ^ w2_t[0]), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w2_t[0]);
299     w2_t[1] = rotl32 ((w1_t[2] ^ w0_t[1] ^ w2_t[3] ^ w2_t[1]), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w2_t[1]);
300     w2_t[2] = rotl32 ((w1_t[3] ^ w0_t[2] ^ w3_t[0] ^ w2_t[2]), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w2_t[2]);
301     w2_t[3] = rotl32 ((w2_t[0] ^ w0_t[3] ^ w3_t[1] ^ w2_t[3]), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w2_t[3]);
302     w3_t[0] = rotl32 ((w2_t[1] ^ w1_t[0] ^ w3_t[2] ^ w3_t[0]), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w3_t[0]);
303     w3_t[1] = rotl32 ((w2_t[2] ^ w1_t[1] ^ w3_t[3] ^ w3_t[1]), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w3_t[1]);
304     w3_t[2] = rotl32 ((w2_t[3] ^ w1_t[2] ^ w0_t[0] ^ w3_t[2]), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w3_t[2]);
305     w3_t[3] = rotl32 ((w3_t[0] ^ w1_t[3] ^ w0_t[1] ^ w3_t[3]), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w3_t[3]);
306     w0_t[0] = rotl32 ((w3_t[1] ^ w2_t[0] ^ w0_t[2] ^ w0_t[0]), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w0_t[0]);
307     w0_t[1] = rotl32 ((w3_t[2] ^ w2_t[1] ^ w0_t[3] ^ w0_t[1]), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w0_t[1]);
308     w0_t[2] = rotl32 ((w3_t[3] ^ w2_t[2] ^ w1_t[0] ^ w0_t[2]), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w0_t[2]);
309     w0_t[3] = rotl32 ((w0_t[0] ^ w2_t[3] ^ w1_t[1] ^ w0_t[3]), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w0_t[3]);
310     w1_t[0] = rotl32 ((w0_t[1] ^ w3_t[0] ^ w1_t[2] ^ w1_t[0]), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w1_t[0]);
311     w1_t[1] = rotl32 ((w0_t[2] ^ w3_t[1] ^ w1_t[3] ^ w1_t[1]), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w1_t[1]);
312     w1_t[2] = rotl32 ((w0_t[3] ^ w3_t[2] ^ w2_t[0] ^ w1_t[2]), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w1_t[2]);
313     w1_t[3] = rotl32 ((w1_t[0] ^ w3_t[3] ^ w2_t[1] ^ w1_t[3]), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w1_t[3]);
314     w2_t[0] = rotl32 ((w1_t[1] ^ w0_t[0] ^ w2_t[2] ^ w2_t[0]), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w2_t[0]);
315     w2_t[1] = rotl32 ((w1_t[2] ^ w0_t[1] ^ w2_t[3] ^ w2_t[1]), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w2_t[1]);
316     w2_t[2] = rotl32 ((w1_t[3] ^ w0_t[2] ^ w3_t[0] ^ w2_t[2]), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w2_t[2]);
317     w2_t[3] = rotl32 ((w2_t[0] ^ w0_t[3] ^ w3_t[1] ^ w2_t[3]), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w2_t[3]);
318
319     #undef K
320     #define K SHA1C03
321
322     w3_t[0] = rotl32 ((w2_t[1] ^ w1_t[0] ^ w3_t[2] ^ w3_t[0]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3_t[0]);
323     w3_t[1] = rotl32 ((w2_t[2] ^ w1_t[1] ^ w3_t[3] ^ w3_t[1]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w3_t[1]);
324     w3_t[2] = rotl32 ((w2_t[3] ^ w1_t[2] ^ w0_t[0] ^ w3_t[2]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t[2]);
325     w3_t[3] = rotl32 ((w3_t[0] ^ w1_t[3] ^ w0_t[1] ^ w3_t[3]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w3_t[3]);
326     w0_t[0] = rotl32 ((w3_t[1] ^ w2_t[0] ^ w0_t[2] ^ w0_t[0]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0_t[0]);
327     w0_t[1] = rotl32 ((w3_t[2] ^ w2_t[1] ^ w0_t[3] ^ w0_t[1]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w0_t[1]);
328     w0_t[2] = rotl32 ((w3_t[3] ^ w2_t[2] ^ w1_t[0] ^ w0_t[2]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w0_t[2]);
329     w0_t[3] = rotl32 ((w0_t[0] ^ w2_t[3] ^ w1_t[1] ^ w0_t[3]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0_t[3]);
330     w1_t[0] = rotl32 ((w0_t[1] ^ w3_t[0] ^ w1_t[2] ^ w1_t[0]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t[0]);
331     w1_t[1] = rotl32 ((w0_t[2] ^ w3_t[1] ^ w1_t[3] ^ w1_t[1]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w1_t[1]);
332     w1_t[2] = rotl32 ((w0_t[3] ^ w3_t[2] ^ w2_t[0] ^ w1_t[2]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1_t[2]);
333     w1_t[3] = rotl32 ((w1_t[0] ^ w3_t[3] ^ w2_t[1] ^ w1_t[3]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w1_t[3]);
334     w2_t[0] = rotl32 ((w1_t[1] ^ w0_t[0] ^ w2_t[2] ^ w2_t[0]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w2_t[0]);
335     w2_t[1] = rotl32 ((w1_t[2] ^ w0_t[1] ^ w2_t[3] ^ w2_t[1]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w2_t[1]);
336     w2_t[2] = rotl32 ((w1_t[3] ^ w0_t[2] ^ w3_t[0] ^ w2_t[2]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t[2]);
337     w2_t[3] = rotl32 ((w2_t[0] ^ w0_t[3] ^ w3_t[1] ^ w2_t[3]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w2_t[3]);
338     w3_t[0] = rotl32 ((w2_t[1] ^ w1_t[0] ^ w3_t[2] ^ w3_t[0]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w3_t[0]);
339     w3_t[1] = rotl32 ((w2_t[2] ^ w1_t[1] ^ w3_t[3] ^ w3_t[1]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t[1]);
340     w3_t[2] = rotl32 ((w2_t[3] ^ w1_t[2] ^ w0_t[0] ^ w3_t[2]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w3_t[2]);
341     w3_t[3] = rotl32 ((w3_t[0] ^ w1_t[3] ^ w0_t[1] ^ w3_t[3]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w3_t[3]);
342
343
344     const u32x r0 = d;
345     const u32x r1 = e;
346     const u32x r2 = c;
347     const u32x r3 = b;
348
349     #include VECT_COMPARE_M
350   }
351 }
352
353 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m00120_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)
354 {
355 }
356
357 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m00120_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)
358 {
359 }
360
361 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m00120_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)
362 {
363   /**
364    * modifier
365    */
366
367   const u32 lid = get_local_id (0);
368
369   /**
370    * base
371    */
372
373   const u32 gid = get_global_id (0);
374
375   if (gid >= gid_max) return;
376
377   u32x wordl0[4];
378
379   wordl0[0] = pws[gid].i[ 0];
380   wordl0[1] = pws[gid].i[ 1];
381   wordl0[2] = pws[gid].i[ 2];
382   wordl0[3] = pws[gid].i[ 3];
383
384   u32x wordl1[4];
385
386   wordl1[0] = pws[gid].i[ 4];
387   wordl1[1] = pws[gid].i[ 5];
388   wordl1[2] = pws[gid].i[ 6];
389   wordl1[3] = pws[gid].i[ 7];
390
391   u32x wordl2[4];
392
393   wordl2[0] = 0;
394   wordl2[1] = 0;
395   wordl2[2] = 0;
396   wordl2[3] = 0;
397
398   u32x wordl3[4];
399
400   wordl3[0] = 0;
401   wordl3[1] = 0;
402   wordl3[2] = 0;
403   wordl3[3] = 0;
404
405   const u32 pw_l_len = pws[gid].pw_len;
406
407   if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
408   {
409     switch_buffer_by_offset (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
410   }
411
412   /**
413    * salt
414    */
415
416   u32 salt_buf0[4];
417
418   salt_buf0[0] = salt_bufs[salt_pos].salt_buf[0];
419   salt_buf0[1] = salt_bufs[salt_pos].salt_buf[1];
420   salt_buf0[2] = salt_bufs[salt_pos].salt_buf[2];
421   salt_buf0[3] = salt_bufs[salt_pos].salt_buf[3];
422
423   u32 salt_buf1[4];
424
425   salt_buf1[0] = salt_bufs[salt_pos].salt_buf[4];
426   salt_buf1[1] = salt_bufs[salt_pos].salt_buf[5];
427   salt_buf1[2] = salt_bufs[salt_pos].salt_buf[6];
428   salt_buf1[3] = salt_bufs[salt_pos].salt_buf[7];
429
430   const u32 salt_len = salt_bufs[salt_pos].salt_len;
431
432   /**
433    * digest
434    */
435
436   const u32 search[4] =
437   {
438     digests_buf[digests_offset].digest_buf[DGST_R0],
439     digests_buf[digests_offset].digest_buf[DGST_R1],
440     digests_buf[digests_offset].digest_buf[DGST_R2],
441     digests_buf[digests_offset].digest_buf[DGST_R3]
442   };
443
444   /**
445    * reverse
446    */
447
448   const u32 e_rev = rotl32 (search[1], 2u);
449
450   /**
451    * loop
452    */
453
454   for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
455   {
456     const u32 pw_r_len = combs_buf[il_pos].pw_len;
457
458     const u32 pw_len = pw_l_len + pw_r_len;
459
460     u32 wordr0[4];
461     u32 wordr1[4];
462     u32 wordr2[4];
463     u32 wordr3[4];
464
465     wordr0[0] = combs_buf[il_pos].i[0];
466     wordr0[1] = combs_buf[il_pos].i[1];
467     wordr0[2] = combs_buf[il_pos].i[2];
468     wordr0[3] = combs_buf[il_pos].i[3];
469     wordr1[0] = combs_buf[il_pos].i[4];
470     wordr1[1] = combs_buf[il_pos].i[5];
471     wordr1[2] = combs_buf[il_pos].i[6];
472     wordr1[3] = combs_buf[il_pos].i[7];
473     wordr2[0] = 0;
474     wordr2[1] = 0;
475     wordr2[2] = 0;
476     wordr2[3] = 0;
477     wordr3[0] = 0;
478     wordr3[1] = 0;
479     wordr3[2] = 0;
480     wordr3[3] = 0;
481
482     if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
483     {
484       switch_buffer_by_offset (wordr0, wordr1, wordr2, wordr3, pw_l_len);
485     }
486
487     u32x w0[4];
488     u32x w1[4];
489     u32x w2[4];
490     u32x w3[4];
491
492     w0[0] = wordl0[0] | wordr0[0];
493     w0[1] = wordl0[1] | wordr0[1];
494     w0[2] = wordl0[2] | wordr0[2];
495     w0[3] = wordl0[3] | wordr0[3];
496     w1[0] = wordl1[0] | wordr1[0];
497     w1[1] = wordl1[1] | wordr1[1];
498     w1[2] = wordl1[2] | wordr1[2];
499     w1[3] = wordl1[3] | wordr1[3];
500     w2[0] = wordl2[0] | wordr2[0];
501     w2[1] = wordl2[1] | wordr2[1];
502     w2[2] = wordl2[2] | wordr2[2];
503     w2[3] = wordl2[3] | wordr2[3];
504     w3[0] = wordl3[0] | wordr3[0];
505     w3[1] = wordl3[1] | wordr3[1];
506     w3[2] = wordl3[2] | wordr3[2];
507     w3[3] = wordl3[3] | wordr3[3];
508
509     /**
510      * prepend salt
511      */
512
513     const u32 pw_salt_len = pw_len + salt_len;
514
515     u32x w0_t[4];
516     u32x w1_t[4];
517     u32x w2_t[4];
518     u32x w3_t[4];
519
520     w0_t[0] = w0[0];
521     w0_t[1] = w0[1];
522     w0_t[2] = w0[2];
523     w0_t[3] = w0[3];
524     w1_t[0] = w1[0];
525     w1_t[1] = w1[1];
526     w1_t[2] = w1[2];
527     w1_t[3] = w1[3];
528     w2_t[0] = w2[0];
529     w2_t[1] = w2[1];
530     w2_t[2] = w2[2];
531     w2_t[3] = w2[3];
532     w3_t[0] = w3[0];
533     w3_t[1] = w3[1];
534     w3_t[2] = w3[2];
535     w3_t[3] = w3[3];
536
537     switch_buffer_by_offset (w0_t, w1_t, w2_t, w3_t, salt_len);
538
539     w0_t[0] |= salt_buf0[0];
540     w0_t[1] |= salt_buf0[1];
541     w0_t[2] |= salt_buf0[2];
542     w0_t[3] |= salt_buf0[3];
543     w1_t[0] |= salt_buf1[0];
544     w1_t[1] |= salt_buf1[1];
545     w1_t[2] |= salt_buf1[2];
546     w1_t[3] |= salt_buf1[3];
547
548     append_0x80_4 (w0_t, w1_t, w2_t, w3_t, pw_salt_len);
549
550     w3_t[3] = pw_salt_len * 8;
551
552     /**
553      * sha1
554      */
555
556     w0_t[0] = swap_workaround (w0_t[0]);
557     w0_t[1] = swap_workaround (w0_t[1]);
558     w0_t[2] = swap_workaround (w0_t[2]);
559     w0_t[3] = swap_workaround (w0_t[3]);
560     w1_t[0] = swap_workaround (w1_t[0]);
561     w1_t[1] = swap_workaround (w1_t[1]);
562     w1_t[2] = swap_workaround (w1_t[2]);
563     w1_t[3] = swap_workaround (w1_t[3]);
564     w2_t[0] = swap_workaround (w2_t[0]);
565     w2_t[1] = swap_workaround (w2_t[1]);
566     w2_t[2] = swap_workaround (w2_t[2]);
567     w2_t[3] = swap_workaround (w2_t[3]);
568     w3_t[0] = swap_workaround (w3_t[0]);
569     w3_t[1] = swap_workaround (w3_t[1]);
570     //w3_t[2] = swap_workaround (w3_t[2]);
571     //w3_t[3] = swap_workaround (w3_t[3]);
572
573     u32x a = SHA1M_A;
574     u32x b = SHA1M_B;
575     u32x c = SHA1M_C;
576     u32x d = SHA1M_D;
577     u32x e = SHA1M_E;
578
579     #undef K
580     #define K SHA1C00
581
582     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0_t[0]);
583     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t[1]);
584     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w0_t[2]);
585     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w0_t[3]);
586     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w1_t[0]);
587     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w1_t[1]);
588     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1_t[2]);
589     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1_t[3]);
590     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2_t[0]);
591     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w2_t[1]);
592     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w2_t[2]);
593     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w2_t[3]);
594     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w3_t[0]);
595     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3_t[1]);
596     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3_t[2]);
597     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w3_t[3]);
598     w0_t[0] = rotl32 ((w3_t[1] ^ w2_t[0] ^ w0_t[2] ^ w0_t[0]), 1u); SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t[0]);
599     w0_t[1] = rotl32 ((w3_t[2] ^ w2_t[1] ^ w0_t[3] ^ w0_t[1]), 1u); SHA1_STEP (SHA1_F0o, d, e, a, b, c, w0_t[1]);
600     w0_t[2] = rotl32 ((w3_t[3] ^ w2_t[2] ^ w1_t[0] ^ w0_t[2]), 1u); SHA1_STEP (SHA1_F0o, c, d, e, a, b, w0_t[2]);
601     w0_t[3] = rotl32 ((w0_t[0] ^ w2_t[3] ^ w1_t[1] ^ w0_t[3]), 1u); SHA1_STEP (SHA1_F0o, b, c, d, e, a, w0_t[3]);
602
603     #undef K
604     #define K SHA1C01
605
606     w1_t[0] = rotl32 ((w0_t[1] ^ w3_t[0] ^ w1_t[2] ^ w1_t[0]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1_t[0]);
607     w1_t[1] = rotl32 ((w0_t[2] ^ w3_t[1] ^ w1_t[3] ^ w1_t[1]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w1_t[1]);
608     w1_t[2] = rotl32 ((w0_t[3] ^ w3_t[2] ^ w2_t[0] ^ w1_t[2]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w1_t[2]);
609     w1_t[3] = rotl32 ((w1_t[0] ^ w3_t[3] ^ w2_t[1] ^ w1_t[3]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t[3]);
610     w2_t[0] = rotl32 ((w1_t[1] ^ w0_t[0] ^ w2_t[2] ^ w2_t[0]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t[0]);
611     w2_t[1] = rotl32 ((w1_t[2] ^ w0_t[1] ^ w2_t[3] ^ w2_t[1]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w2_t[1]);
612     w2_t[2] = rotl32 ((w1_t[3] ^ w0_t[2] ^ w3_t[0] ^ w2_t[2]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w2_t[2]);
613     w2_t[3] = rotl32 ((w2_t[0] ^ w0_t[3] ^ w3_t[1] ^ w2_t[3]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w2_t[3]);
614     w3_t[0] = rotl32 ((w2_t[1] ^ w1_t[0] ^ w3_t[2] ^ w3_t[0]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w3_t[0]);
615     w3_t[1] = rotl32 ((w2_t[2] ^ w1_t[1] ^ w3_t[3] ^ w3_t[1]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w3_t[1]);
616     w3_t[2] = rotl32 ((w2_t[3] ^ w1_t[2] ^ w0_t[0] ^ w3_t[2]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3_t[2]);
617     w3_t[3] = rotl32 ((w3_t[0] ^ w1_t[3] ^ w0_t[1] ^ w3_t[3]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w3_t[3]);
618     w0_t[0] = rotl32 ((w3_t[1] ^ w2_t[0] ^ w0_t[2] ^ w0_t[0]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0_t[0]);
619     w0_t[1] = rotl32 ((w3_t[2] ^ w2_t[1] ^ w0_t[3] ^ w0_t[1]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w0_t[1]);
620     w0_t[2] = rotl32 ((w3_t[3] ^ w2_t[2] ^ w1_t[0] ^ w0_t[2]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0_t[2]);
621     w0_t[3] = rotl32 ((w0_t[0] ^ w2_t[3] ^ w1_t[1] ^ w0_t[3]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w0_t[3]);
622     w1_t[0] = rotl32 ((w0_t[1] ^ w3_t[0] ^ w1_t[2] ^ w1_t[0]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w1_t[0]);
623     w1_t[1] = rotl32 ((w0_t[2] ^ w3_t[1] ^ w1_t[3] ^ w1_t[1]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w1_t[1]);
624     w1_t[2] = rotl32 ((w0_t[3] ^ w3_t[2] ^ w2_t[0] ^ w1_t[2]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t[2]);
625     w1_t[3] = rotl32 ((w1_t[0] ^ w3_t[3] ^ w2_t[1] ^ w1_t[3]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w1_t[3]);
626
627     #undef K
628     #define K SHA1C02
629
630     w2_t[0] = rotl32 ((w1_t[1] ^ w0_t[0] ^ w2_t[2] ^ w2_t[0]), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w2_t[0]);
631     w2_t[1] = rotl32 ((w1_t[2] ^ w0_t[1] ^ w2_t[3] ^ w2_t[1]), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w2_t[1]);
632     w2_t[2] = rotl32 ((w1_t[3] ^ w0_t[2] ^ w3_t[0] ^ w2_t[2]), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w2_t[2]);
633     w2_t[3] = rotl32 ((w2_t[0] ^ w0_t[3] ^ w3_t[1] ^ w2_t[3]), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w2_t[3]);
634     w3_t[0] = rotl32 ((w2_t[1] ^ w1_t[0] ^ w3_t[2] ^ w3_t[0]), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w3_t[0]);
635     w3_t[1] = rotl32 ((w2_t[2] ^ w1_t[1] ^ w3_t[3] ^ w3_t[1]), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w3_t[1]);
636     w3_t[2] = rotl32 ((w2_t[3] ^ w1_t[2] ^ w0_t[0] ^ w3_t[2]), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w3_t[2]);
637     w3_t[3] = rotl32 ((w3_t[0] ^ w1_t[3] ^ w0_t[1] ^ w3_t[3]), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w3_t[3]);
638     w0_t[0] = rotl32 ((w3_t[1] ^ w2_t[0] ^ w0_t[2] ^ w0_t[0]), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w0_t[0]);
639     w0_t[1] = rotl32 ((w3_t[2] ^ w2_t[1] ^ w0_t[3] ^ w0_t[1]), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w0_t[1]);
640     w0_t[2] = rotl32 ((w3_t[3] ^ w2_t[2] ^ w1_t[0] ^ w0_t[2]), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w0_t[2]);
641     w0_t[3] = rotl32 ((w0_t[0] ^ w2_t[3] ^ w1_t[1] ^ w0_t[3]), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w0_t[3]);
642     w1_t[0] = rotl32 ((w0_t[1] ^ w3_t[0] ^ w1_t[2] ^ w1_t[0]), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w1_t[0]);
643     w1_t[1] = rotl32 ((w0_t[2] ^ w3_t[1] ^ w1_t[3] ^ w1_t[1]), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w1_t[1]);
644     w1_t[2] = rotl32 ((w0_t[3] ^ w3_t[2] ^ w2_t[0] ^ w1_t[2]), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w1_t[2]);
645     w1_t[3] = rotl32 ((w1_t[0] ^ w3_t[3] ^ w2_t[1] ^ w1_t[3]), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w1_t[3]);
646     w2_t[0] = rotl32 ((w1_t[1] ^ w0_t[0] ^ w2_t[2] ^ w2_t[0]), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w2_t[0]);
647     w2_t[1] = rotl32 ((w1_t[2] ^ w0_t[1] ^ w2_t[3] ^ w2_t[1]), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w2_t[1]);
648     w2_t[2] = rotl32 ((w1_t[3] ^ w0_t[2] ^ w3_t[0] ^ w2_t[2]), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w2_t[2]);
649     w2_t[3] = rotl32 ((w2_t[0] ^ w0_t[3] ^ w3_t[1] ^ w2_t[3]), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w2_t[3]);
650
651     #undef K
652     #define K SHA1C03
653
654     w3_t[0] = rotl32 ((w2_t[1] ^ w1_t[0] ^ w3_t[2] ^ w3_t[0]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3_t[0]);
655     w3_t[1] = rotl32 ((w2_t[2] ^ w1_t[1] ^ w3_t[3] ^ w3_t[1]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w3_t[1]);
656     w3_t[2] = rotl32 ((w2_t[3] ^ w1_t[2] ^ w0_t[0] ^ w3_t[2]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t[2]);
657     w3_t[3] = rotl32 ((w3_t[0] ^ w1_t[3] ^ w0_t[1] ^ w3_t[3]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w3_t[3]);
658     w0_t[0] = rotl32 ((w3_t[1] ^ w2_t[0] ^ w0_t[2] ^ w0_t[0]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0_t[0]);
659     w0_t[1] = rotl32 ((w3_t[2] ^ w2_t[1] ^ w0_t[3] ^ w0_t[1]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w0_t[1]);
660     w0_t[2] = rotl32 ((w3_t[3] ^ w2_t[2] ^ w1_t[0] ^ w0_t[2]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w0_t[2]);
661     w0_t[3] = rotl32 ((w0_t[0] ^ w2_t[3] ^ w1_t[1] ^ w0_t[3]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0_t[3]);
662     w1_t[0] = rotl32 ((w0_t[1] ^ w3_t[0] ^ w1_t[2] ^ w1_t[0]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t[0]);
663     w1_t[1] = rotl32 ((w0_t[2] ^ w3_t[1] ^ w1_t[3] ^ w1_t[1]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w1_t[1]);
664     w1_t[2] = rotl32 ((w0_t[3] ^ w3_t[2] ^ w2_t[0] ^ w1_t[2]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1_t[2]);
665     w1_t[3] = rotl32 ((w1_t[0] ^ w3_t[3] ^ w2_t[1] ^ w1_t[3]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w1_t[3]);
666     w2_t[0] = rotl32 ((w1_t[1] ^ w0_t[0] ^ w2_t[2] ^ w2_t[0]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w2_t[0]);
667     w2_t[1] = rotl32 ((w1_t[2] ^ w0_t[1] ^ w2_t[3] ^ w2_t[1]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w2_t[1]);
668     w2_t[2] = rotl32 ((w1_t[3] ^ w0_t[2] ^ w3_t[0] ^ w2_t[2]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t[2]);
669     w2_t[3] = rotl32 ((w2_t[0] ^ w0_t[3] ^ w3_t[1] ^ w2_t[3]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w2_t[3]);
670     w3_t[0] = rotl32 ((w2_t[1] ^ w1_t[0] ^ w3_t[2] ^ w3_t[0]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w3_t[0]);
671
672     if (allx (e != e_rev)) continue;
673
674     w3_t[1] = rotl32 ((w2_t[2] ^ w1_t[1] ^ w3_t[3] ^ w3_t[1]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t[1]);
675     w3_t[2] = rotl32 ((w2_t[3] ^ w1_t[2] ^ w0_t[0] ^ w3_t[2]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w3_t[2]);
676     w3_t[3] = rotl32 ((w3_t[0] ^ w1_t[3] ^ w0_t[1] ^ w3_t[3]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w3_t[3]);
677
678
679     const u32x r0 = d;
680     const u32x r1 = e;
681     const u32x r2 = c;
682     const u32x r3 = b;
683
684     #include VECT_COMPARE_S
685   }
686 }
687
688 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m00120_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)
689 {
690 }
691
692 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m00120_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)
693 {
694 }