2022-01-07 08:58:03 +08:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
|
|
|
|
//
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// See LICENSE.txt for the text of the license.
|
|
|
|
//-----------------------------------------------------------------------------
|
2016-02-10 20:09:33 +08:00
|
|
|
#ifndef BUCKETSORT_H__
|
|
|
|
#define BUCKETSORT_H__
|
2016-07-29 03:41:44 +08:00
|
|
|
|
2019-08-08 22:57:33 +08:00
|
|
|
#include "common.h"
|
2016-07-29 03:41:44 +08:00
|
|
|
|
2016-02-10 20:09:33 +08:00
|
|
|
typedef struct bucket {
|
2019-03-10 02:19:50 +08:00
|
|
|
uint32_t *head;
|
|
|
|
uint32_t *bp;
|
2016-02-10 20:09:33 +08:00
|
|
|
} bucket_t;
|
|
|
|
|
|
|
|
typedef bucket_t bucket_array_t[2][0x100];
|
|
|
|
|
|
|
|
typedef struct bucket_info {
|
2019-03-10 02:19:50 +08:00
|
|
|
struct {
|
|
|
|
uint32_t *head, *tail;
|
2019-03-10 07:00:59 +08:00
|
|
|
} bucket_info[2][0x100];
|
|
|
|
uint32_t numbuckets;
|
2016-02-10 20:09:33 +08:00
|
|
|
} bucket_info_t;
|
|
|
|
|
2019-03-10 07:00:59 +08:00
|
|
|
void bucket_sort_intersect(uint32_t *const estart, uint32_t *const estop,
|
|
|
|
uint32_t *const ostart, uint32_t *const ostop,
|
|
|
|
bucket_info_t *bucket_info, bucket_array_t bucket);
|
2019-08-08 22:57:33 +08:00
|
|
|
|
2019-03-12 07:12:26 +08:00
|
|
|
#endif
|