2 * Author......: Jens Steube <jens.steube@gmail.com>
8 #include "include/constants.h"
9 #include "include/kernel_vendor.h"
28 #include "include/kernel_functions.c"
29 #include "types_amd.c"
30 #include "common_amd.c"
31 #include "include/rp_gpu.h"
35 #define VECT_COMPARE_S "check_single_vect1_comp4.c"
36 #define VECT_COMPARE_M "check_multi_vect1_comp4.c"
40 #define VECT_COMPARE_S "check_single_vect2_comp4.c"
41 #define VECT_COMPARE_M "check_multi_vect2_comp4.c"
45 #define VECT_COMPARE_S "check_single_vect4_comp4.c"
46 #define VECT_COMPARE_M "check_multi_vect4_comp4.c"
49 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m04800_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 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
55 const u32 lid = get_local_id (0);
61 const u32 gid = get_global_id (0);
63 if (gid >= gid_max) return;
67 pw_buf0[0] = pws[gid].i[ 0];
68 pw_buf0[1] = pws[gid].i[ 1];
69 pw_buf0[2] = pws[gid].i[ 2];
70 pw_buf0[3] = pws[gid].i[ 3];
74 pw_buf1[0] = pws[gid].i[ 4];
75 pw_buf1[1] = pws[gid].i[ 5];
76 pw_buf1[2] = pws[gid].i[ 6];
77 pw_buf1[3] = pws[gid].i[ 7];
79 const u32 pw_len = pws[gid].pw_len;
87 salt_buf[0] = salt_bufs[salt_pos].salt_buf[0];
88 salt_buf[1] = salt_bufs[salt_pos].salt_buf[1];
89 salt_buf[2] = salt_bufs[salt_pos].salt_buf[2];
90 salt_buf[3] = salt_bufs[salt_pos].salt_buf[3];
91 salt_buf[4] = salt_bufs[salt_pos].salt_buf[4];
93 const u32 salt_len = salt_bufs[salt_pos].salt_len;
99 for (u32 il_pos = 0; il_pos < rules_cnt; il_pos++)
129 const u32 out_len = apply_rules (rules_buf[il_pos].cmds, w0, w1, pw_len);
131 u32 pw_salt_len = out_len + salt_len;
165 switch_buffer_by_offset (s0, s1, s2, s3, out_len);
191 switch_buffer_by_offset (w0, w1, w2, w3, 1);
193 w0[0] |= salt_buf[4];
195 w3[2] = pw_salt_len * 8;
206 MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
207 MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
208 MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
209 MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
210 MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
211 MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
212 MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
213 MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
214 MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
215 MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
216 MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
217 MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
218 MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
219 MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
220 MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
221 MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
223 MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
224 MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
225 MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
226 MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
227 MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
228 MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
229 MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
230 MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
231 MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
232 MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
233 MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
234 MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
235 MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
236 MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
237 MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
238 MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
240 MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
241 MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
242 MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
243 MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
244 MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
245 MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
246 MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
247 MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
248 MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
249 MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
250 MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
251 MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
252 MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
253 MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
254 MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
255 MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
257 MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
258 MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
259 MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
260 MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
261 MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
262 MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
263 MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
264 MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
265 MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
266 MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
267 MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
268 MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
269 MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
270 MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
271 MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
272 MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
279 #include VECT_COMPARE_M
283 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m04800_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 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
287 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m04800_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 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
291 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m04800_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 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
297 const u32 lid = get_local_id (0);
303 const u32 gid = get_global_id (0);
305 if (gid >= gid_max) return;
309 pw_buf0[0] = pws[gid].i[ 0];
310 pw_buf0[1] = pws[gid].i[ 1];
311 pw_buf0[2] = pws[gid].i[ 2];
312 pw_buf0[3] = pws[gid].i[ 3];
316 pw_buf1[0] = pws[gid].i[ 4];
317 pw_buf1[1] = pws[gid].i[ 5];
318 pw_buf1[2] = pws[gid].i[ 6];
319 pw_buf1[3] = pws[gid].i[ 7];
321 const u32 pw_len = pws[gid].pw_len;
329 salt_buf[0] = salt_bufs[salt_pos].salt_buf[0];
330 salt_buf[1] = salt_bufs[salt_pos].salt_buf[1];
331 salt_buf[2] = salt_bufs[salt_pos].salt_buf[2];
332 salt_buf[3] = salt_bufs[salt_pos].salt_buf[3];
333 salt_buf[4] = salt_bufs[salt_pos].salt_buf[4];
335 const u32 salt_len = salt_bufs[salt_pos].salt_len;
341 const u32 search[4] =
343 digests_buf[digests_offset].digest_buf[DGST_R0],
344 digests_buf[digests_offset].digest_buf[DGST_R1],
345 digests_buf[digests_offset].digest_buf[DGST_R2],
346 digests_buf[digests_offset].digest_buf[DGST_R3]
353 for (u32 il_pos = 0; il_pos < rules_cnt; il_pos++)
383 const u32 out_len = apply_rules (rules_buf[il_pos].cmds, w0, w1, pw_len);
385 u32 pw_salt_len = out_len + salt_len;
419 switch_buffer_by_offset (s0, s1, s2, s3, out_len);
445 switch_buffer_by_offset (w0, w1, w2, w3, 1);
447 w0[0] |= salt_buf[4];
449 w3[2] = pw_salt_len * 8;
460 MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
461 MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
462 MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
463 MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
464 MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
465 MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
466 MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
467 MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
468 MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
469 MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
470 MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
471 MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
472 MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
473 MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
474 MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
475 MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
477 MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
478 MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
479 MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
480 MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
481 MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
482 MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
483 MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
484 MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
485 MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
486 MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
487 MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
488 MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
489 MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
490 MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
491 MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
492 MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
494 MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
495 MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
496 MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
497 MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
498 MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
499 MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
500 MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
501 MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
502 MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
503 MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
504 MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
505 MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
506 MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
507 MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
508 MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
509 MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
511 MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
512 MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
513 MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
514 MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
515 MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
516 MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
517 MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
518 MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
519 MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
520 MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
521 MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
522 MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
523 MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
525 bool q_cond = allx (search[0] != a);
527 if (q_cond) continue;
529 MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
530 MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
531 MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
538 #include VECT_COMPARE_S
542 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m04800_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 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
546 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m04800_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 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)