Initial commit
[hashcat.git] / amd / m08100_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_SIZE4
38 #define VECT_COMPARE_S "check_single_vect4_comp4.c"
39 #define VECT_COMPARE_M "check_multi_vect4_comp4.c"
40 #endif
41
42 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m08100_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)
43 {
44   /**
45    * modifier
46    */
47
48   const u32 lid = get_local_id (0);
49
50   /**
51    * base
52    */
53
54   const u32 gid = get_global_id (0);
55
56   if (gid >= gid_max) return;
57
58   u32x wordl0[4];
59
60   wordl0[0] = pws[gid].i[ 0];
61   wordl0[1] = pws[gid].i[ 1];
62   wordl0[2] = pws[gid].i[ 2];
63   wordl0[3] = pws[gid].i[ 3];
64
65   u32x wordl1[4];
66
67   wordl1[0] = pws[gid].i[ 4];
68   wordl1[1] = pws[gid].i[ 5];
69   wordl1[2] = pws[gid].i[ 6];
70   wordl1[3] = pws[gid].i[ 7];
71
72   u32x wordl2[4];
73
74   wordl2[0] = 0;
75   wordl2[1] = 0;
76   wordl2[2] = 0;
77   wordl2[3] = 0;
78
79   u32x wordl3[4];
80
81   wordl3[0] = 0;
82   wordl3[1] = 0;
83   wordl3[2] = 0;
84   wordl3[3] = 0;
85
86   const u32 pw_l_len = pws[gid].pw_len;
87
88   if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
89   {
90     switch_buffer_by_offset (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
91   }
92
93   /**
94    * salt
95    */
96
97   u32 salt_buf0[2];
98
99   salt_buf0[0] = swap_workaround (salt_bufs[salt_pos].salt_buf[0]);
100   salt_buf0[1] = swap_workaround (salt_bufs[salt_pos].salt_buf[1]);
101
102   const u32 salt_len = salt_bufs[salt_pos].salt_len;
103
104   /**
105    * loop
106    */
107
108   for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
109   {
110     const u32 pw_r_len = combs_buf[il_pos].pw_len;
111
112     const u32 pw_len = pw_l_len + pw_r_len;
113
114     u32 wordr0[4];
115     u32 wordr1[4];
116     u32 wordr2[4];
117     u32 wordr3[4];
118
119     wordr0[0] = combs_buf[il_pos].i[0];
120     wordr0[1] = combs_buf[il_pos].i[1];
121     wordr0[2] = combs_buf[il_pos].i[2];
122     wordr0[3] = combs_buf[il_pos].i[3];
123     wordr1[0] = combs_buf[il_pos].i[4];
124     wordr1[1] = combs_buf[il_pos].i[5];
125     wordr1[2] = combs_buf[il_pos].i[6];
126     wordr1[3] = combs_buf[il_pos].i[7];
127     wordr2[0] = 0;
128     wordr2[1] = 0;
129     wordr2[2] = 0;
130     wordr2[3] = 0;
131     wordr3[0] = 0;
132     wordr3[1] = 0;
133     wordr3[2] = 0;
134     wordr3[3] = 0;
135
136     if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
137     {
138       switch_buffer_by_offset (wordr0, wordr1, wordr2, wordr3, pw_l_len);
139     }
140
141     u32x w0[4];
142     u32x w1[4];
143     u32x w2[4];
144     u32x w3[4];
145
146     w0[0] = wordl0[0] | wordr0[0];
147     w0[1] = wordl0[1] | wordr0[1];
148     w0[2] = wordl0[2] | wordr0[2];
149     w0[3] = wordl0[3] | wordr0[3];
150     w1[0] = wordl1[0] | wordr1[0];
151     w1[1] = wordl1[1] | wordr1[1];
152     w1[2] = wordl1[2] | wordr1[2];
153     w1[3] = wordl1[3] | wordr1[3];
154     w2[0] = wordl2[0] | wordr2[0];
155     w2[1] = wordl2[1] | wordr2[1];
156     w2[2] = wordl2[2] | wordr2[2];
157     w2[3] = wordl2[3] | wordr2[3];
158     w3[0] = wordl3[0] | wordr3[0];
159     w3[1] = wordl3[1] | wordr3[1];
160     w3[2] = wordl3[2] | wordr3[2];
161     w3[3] = wordl3[3] | wordr3[3];
162
163     /**
164      * prepend salt
165      */
166
167     const u32 pw_salt_len = pw_len + salt_len;
168
169     u32x w0_t[4];
170     u32x w1_t[4];
171     u32x w2_t[4];
172     u32x w3_t[4];
173
174     w0_t[0] = salt_buf0[0];
175     w0_t[1] = salt_buf0[1];
176     w0_t[2] = w0[0];
177     w0_t[3] = w0[1];
178     w1_t[0] = w0[2];
179     w1_t[1] = w0[3];
180     w1_t[2] = w1[0];
181     w1_t[3] = w1[1];
182     w2_t[0] = w1[2];
183     w2_t[1] = w1[3];
184     w2_t[2] = w2[0];
185     w2_t[3] = w2[1];
186     w3_t[0] = w2[2];
187     w3_t[1] = w2[3];
188     w3_t[2] = 0;
189     w3_t[3] = (pw_salt_len + 1) * 8;
190
191     append_0x80_4 (w0_t, w1_t, w2_t, w3_t, pw_salt_len + 1);
192
193     /**
194      * sha1
195      */
196
197     w0_t[0] = swap_workaround (w0_t[0]);
198     w0_t[1] = swap_workaround (w0_t[1]);
199     w0_t[2] = swap_workaround (w0_t[2]);
200     w0_t[3] = swap_workaround (w0_t[3]);
201     w1_t[0] = swap_workaround (w1_t[0]);
202     w1_t[1] = swap_workaround (w1_t[1]);
203     w1_t[2] = swap_workaround (w1_t[2]);
204     w1_t[3] = swap_workaround (w1_t[3]);
205     w2_t[0] = swap_workaround (w2_t[0]);
206     w2_t[1] = swap_workaround (w2_t[1]);
207     w2_t[2] = swap_workaround (w2_t[2]);
208     w2_t[3] = swap_workaround (w2_t[3]);
209     w3_t[0] = swap_workaround (w3_t[0]);
210     w3_t[1] = swap_workaround (w3_t[1]);
211     //w3_t[2] = swap_workaround (w3_t[2]);
212     //w3_t[3] = swap_workaround (w3_t[3]);
213
214     u32x a = SHA1M_A;
215     u32x b = SHA1M_B;
216     u32x c = SHA1M_C;
217     u32x d = SHA1M_D;
218     u32x e = SHA1M_E;
219
220     #undef K
221     #define K SHA1C00
222
223     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0_t[0]);
224     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t[1]);
225     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w0_t[2]);
226     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w0_t[3]);
227     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w1_t[0]);
228     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w1_t[1]);
229     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1_t[2]);
230     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1_t[3]);
231     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2_t[0]);
232     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w2_t[1]);
233     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w2_t[2]);
234     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w2_t[3]);
235     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w3_t[0]);
236     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3_t[1]);
237     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3_t[2]);
238     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w3_t[3]);
239     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]);
240     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]);
241     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]);
242     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]);
243
244     #undef K
245     #define K SHA1C01
246
247     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]);
248     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]);
249     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]);
250     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]);
251     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]);
252     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]);
253     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]);
254     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]);
255     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]);
256     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]);
257     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]);
258     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]);
259     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]);
260     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]);
261     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]);
262     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]);
263     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]);
264     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]);
265     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]);
266     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]);
267
268     #undef K
269     #define K SHA1C02
270
271     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]);
272     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]);
273     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]);
274     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]);
275     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]);
276     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]);
277     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]);
278     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]);
279     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]);
280     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]);
281     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]);
282     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]);
283     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]);
284     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]);
285     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]);
286     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]);
287     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]);
288     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]);
289     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]);
290     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]);
291
292     #undef K
293     #define K SHA1C03
294
295     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]);
296     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]);
297     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]);
298     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]);
299     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]);
300     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]);
301     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]);
302     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]);
303     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]);
304     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]);
305     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]);
306     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]);
307     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]);
308     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]);
309     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]);
310     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]);
311     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]);
312     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]);
313     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]);
314     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]);
315
316     const u32x r0 = d;
317     const u32x r1 = e;
318     const u32x r2 = c;
319     const u32x r3 = b;
320
321     #include VECT_COMPARE_M
322   }
323 }
324
325 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m08100_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)
326 {
327 }
328
329 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m08100_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)
330 {
331 }
332
333 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m08100_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)
334 {
335   /**
336    * modifier
337    */
338
339   const u32 lid = get_local_id (0);
340
341   /**
342    * base
343    */
344
345   const u32 gid = get_global_id (0);
346
347   if (gid >= gid_max) return;
348
349   u32x wordl0[4];
350
351   wordl0[0] = pws[gid].i[ 0];
352   wordl0[1] = pws[gid].i[ 1];
353   wordl0[2] = pws[gid].i[ 2];
354   wordl0[3] = pws[gid].i[ 3];
355
356   u32x wordl1[4];
357
358   wordl1[0] = pws[gid].i[ 4];
359   wordl1[1] = pws[gid].i[ 5];
360   wordl1[2] = pws[gid].i[ 6];
361   wordl1[3] = pws[gid].i[ 7];
362
363   u32x wordl2[4];
364
365   wordl2[0] = 0;
366   wordl2[1] = 0;
367   wordl2[2] = 0;
368   wordl2[3] = 0;
369
370   u32x wordl3[4];
371
372   wordl3[0] = 0;
373   wordl3[1] = 0;
374   wordl3[2] = 0;
375   wordl3[3] = 0;
376
377   const u32 pw_l_len = pws[gid].pw_len;
378
379   if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
380   {
381     switch_buffer_by_offset (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
382   }
383
384   /**
385    * salt
386    */
387
388   u32 salt_buf0[2];
389
390   salt_buf0[0] = swap_workaround (salt_bufs[salt_pos].salt_buf[0]);
391   salt_buf0[1] = swap_workaround (salt_bufs[salt_pos].salt_buf[1]);
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    * reverse
409    */
410
411   const u32 e_rev = rotl32 (search[1], 2u);
412
413   /**
414    * loop
415    */
416
417   for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
418   {
419     const u32 pw_r_len = combs_buf[il_pos].pw_len;
420
421     const u32 pw_len = pw_l_len + pw_r_len;
422
423     u32 wordr0[4];
424     u32 wordr1[4];
425     u32 wordr2[4];
426     u32 wordr3[4];
427
428     wordr0[0] = combs_buf[il_pos].i[0];
429     wordr0[1] = combs_buf[il_pos].i[1];
430     wordr0[2] = combs_buf[il_pos].i[2];
431     wordr0[3] = combs_buf[il_pos].i[3];
432     wordr1[0] = combs_buf[il_pos].i[4];
433     wordr1[1] = combs_buf[il_pos].i[5];
434     wordr1[2] = combs_buf[il_pos].i[6];
435     wordr1[3] = combs_buf[il_pos].i[7];
436     wordr2[0] = 0;
437     wordr2[1] = 0;
438     wordr2[2] = 0;
439     wordr2[3] = 0;
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     u32x w0[4];
451     u32x w1[4];
452     u32x w2[4];
453     u32x w3[4];
454
455     w0[0] = wordl0[0] | wordr0[0];
456     w0[1] = wordl0[1] | wordr0[1];
457     w0[2] = wordl0[2] | wordr0[2];
458     w0[3] = wordl0[3] | wordr0[3];
459     w1[0] = wordl1[0] | wordr1[0];
460     w1[1] = wordl1[1] | wordr1[1];
461     w1[2] = wordl1[2] | wordr1[2];
462     w1[3] = wordl1[3] | wordr1[3];
463     w2[0] = wordl2[0] | wordr2[0];
464     w2[1] = wordl2[1] | wordr2[1];
465     w2[2] = wordl2[2] | wordr2[2];
466     w2[3] = wordl2[3] | wordr2[3];
467     w3[0] = wordl3[0] | wordr3[0];
468     w3[1] = wordl3[1] | wordr3[1];
469     w3[2] = wordl3[2] | wordr3[2];
470     w3[3] = wordl3[3] | wordr3[3];
471
472     /**
473      * prepend salt
474      */
475
476     const u32 pw_salt_len = pw_len + salt_len;
477
478     u32x w0_t[4];
479     u32x w1_t[4];
480     u32x w2_t[4];
481     u32x w3_t[4];
482
483     w0_t[0] = salt_buf0[0];
484     w0_t[1] = salt_buf0[1];
485     w0_t[2] = w0[0];
486     w0_t[3] = w0[1];
487     w1_t[0] = w0[2];
488     w1_t[1] = w0[3];
489     w1_t[2] = w1[0];
490     w1_t[3] = w1[1];
491     w2_t[0] = w1[2];
492     w2_t[1] = w1[3];
493     w2_t[2] = w2[0];
494     w2_t[3] = w2[1];
495     w3_t[0] = w2[2];
496     w3_t[1] = w2[3];
497     w3_t[2] = 0;
498     w3_t[3] = (pw_salt_len + 1) * 8;
499
500     append_0x80_4 (w0_t, w1_t, w2_t, w3_t, pw_salt_len + 1);
501
502     /**
503      * sha1
504      */
505
506     w0_t[0] = swap_workaround (w0_t[0]);
507     w0_t[1] = swap_workaround (w0_t[1]);
508     w0_t[2] = swap_workaround (w0_t[2]);
509     w0_t[3] = swap_workaround (w0_t[3]);
510     w1_t[0] = swap_workaround (w1_t[0]);
511     w1_t[1] = swap_workaround (w1_t[1]);
512     w1_t[2] = swap_workaround (w1_t[2]);
513     w1_t[3] = swap_workaround (w1_t[3]);
514     w2_t[0] = swap_workaround (w2_t[0]);
515     w2_t[1] = swap_workaround (w2_t[1]);
516     w2_t[2] = swap_workaround (w2_t[2]);
517     w2_t[3] = swap_workaround (w2_t[3]);
518     w3_t[0] = swap_workaround (w3_t[0]);
519     w3_t[1] = swap_workaround (w3_t[1]);
520     //w3_t[2] = swap_workaround (w3_t[2]);
521     //w3_t[3] = swap_workaround (w3_t[3]);
522
523     u32x a = SHA1M_A;
524     u32x b = SHA1M_B;
525     u32x c = SHA1M_C;
526     u32x d = SHA1M_D;
527     u32x e = SHA1M_E;
528
529     #undef K
530     #define K SHA1C00
531
532     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0_t[0]);
533     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t[1]);
534     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w0_t[2]);
535     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w0_t[3]);
536     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w1_t[0]);
537     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w1_t[1]);
538     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1_t[2]);
539     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1_t[3]);
540     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2_t[0]);
541     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w2_t[1]);
542     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w2_t[2]);
543     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w2_t[3]);
544     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w3_t[0]);
545     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3_t[1]);
546     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3_t[2]);
547     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w3_t[3]);
548     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]);
549     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]);
550     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]);
551     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]);
552
553     #undef K
554     #define K SHA1C01
555
556     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]);
557     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]);
558     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]);
559     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]);
560     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]);
561     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]);
562     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]);
563     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]);
564     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]);
565     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]);
566     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]);
567     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]);
568     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]);
569     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]);
570     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]);
571     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]);
572     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]);
573     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]);
574     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]);
575     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]);
576
577     #undef K
578     #define K SHA1C02
579
580     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]);
581     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]);
582     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]);
583     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]);
584     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]);
585     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]);
586     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]);
587     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]);
588     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]);
589     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]);
590     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]);
591     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]);
592     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]);
593     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]);
594     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]);
595     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]);
596     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]);
597     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]);
598     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]);
599     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]);
600
601     #undef K
602     #define K SHA1C03
603
604     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]);
605     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]);
606     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]);
607     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]);
608     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]);
609     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]);
610     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]);
611     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]);
612     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]);
613     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]);
614     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]);
615     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]);
616     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]);
617     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]);
618     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]);
619     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]);
620     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]);
621
622     if (allx (e != e_rev)) continue;
623
624     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]);
625     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]);
626     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]);
627
628     const u32x r0 = d;
629     const u32x r1 = e;
630     const u32x r2 = c;
631     const u32x r3 = b;
632
633     #include VECT_COMPARE_S
634   }
635 }
636
637 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m08100_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)
638 {
639 }
640
641 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m08100_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)
642 {
643 }