2015-06-07 17:35:49 +08:00
|
|
|
/* config.h
|
2019-03-16 14:18:58 +08:00
|
|
|
* Greg Cook, 23/Feb/2019
|
2015-06-07 17:35:49 +08:00
|
|
|
*/
|
|
|
|
|
2016-08-22 02:51:29 +08:00
|
|
|
/* CRC RevEng: arbitrary-precision CRC calculator and algorithm finder
|
2019-03-16 14:18:58 +08:00
|
|
|
* Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018,
|
|
|
|
* 2019 Gregory Cook
|
2015-06-07 17:35:49 +08:00
|
|
|
*
|
|
|
|
* This file is part of CRC RevEng.
|
|
|
|
*
|
|
|
|
* CRC RevEng 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.
|
|
|
|
*
|
|
|
|
* CRC RevEng 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.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2016-08-22 02:51:29 +08:00
|
|
|
* along with CRC RevEng. If not, see <https://www.gnu.org/licenses/>.
|
2015-06-07 17:35:49 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef CONFIG_H
|
|
|
|
#define CONFIG_H 1
|
|
|
|
|
|
|
|
/*****************************************
|
2019-03-10 06:35:06 +08:00
|
|
|
* *
|
2015-06-07 17:35:49 +08:00
|
|
|
* Start of user configuration options *
|
2019-03-10 06:35:06 +08:00
|
|
|
* *
|
2015-06-07 17:35:49 +08:00
|
|
|
*****************************************/
|
|
|
|
|
|
|
|
/* A type to contain polynomial coefficient bitmaps.
|
|
|
|
* Can be changed to 'unsigned long long' for some extended compilers.
|
|
|
|
* Adjust BMP_C(), BMP_BIT and BMP_SUB below if this is changed.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define BMP_T unsigned long
|
|
|
|
|
|
|
|
/* Creates an appropriate numeric constant for bmp_t.
|
|
|
|
* If the underlying type is 'unsigned long long', change UL to ULL.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define BMP_C(n) (n##UL)
|
|
|
|
|
|
|
|
/* Define BMPMACRO to turn the definitions of the size of a bmp_t into
|
|
|
|
* compile-time constants. This improves efficiency but makes the code
|
|
|
|
* platform-specific.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* #define BMPMACRO 1 */
|
|
|
|
|
|
|
|
/* Some enterprise users may wish to disable the -F switch to minimise CPU
|
2018-07-29 13:37:23 +08:00
|
|
|
* usage. To do this, define the macro ALWPCK.
|
2015-06-07 17:35:49 +08:00
|
|
|
*/
|
|
|
|
|
2018-07-29 13:37:23 +08:00
|
|
|
/* #define ALWPCK 1 */
|
2015-06-07 17:35:49 +08:00
|
|
|
|
2019-08-15 03:52:20 +08:00
|
|
|
/* #define PRESETS 1
|
|
|
|
* Define PRESETS to compile CRC RevEng with the preset models from the
|
2015-06-07 17:35:49 +08:00
|
|
|
* CRC Catalogue. This implies BMPMACRO and so makes the code platform-
|
|
|
|
* specific.
|
|
|
|
*/
|
|
|
|
|
2019-08-15 03:52:20 +08:00
|
|
|
/* #define BMP_BIT 32
|
|
|
|
* Macros defining the size of a bmp_t.
|
2015-06-07 17:35:49 +08:00
|
|
|
* Their values only matter if PRESETS and/or BMPMACRO are defined, in
|
|
|
|
* which case edit the macros below to suit your architecture.
|
|
|
|
* Otherwise, BMP_BIT and BMP_SUB will be redefined as aliases of bmpbit
|
|
|
|
* and bmpsub, global objects initialised at run time.
|
|
|
|
*/
|
|
|
|
|
2019-08-15 03:52:20 +08:00
|
|
|
/* #define BMP_SUB 16
|
|
|
|
* The highest power of two that is strictly less than BMP_BIT.
|
2015-06-07 17:35:49 +08:00
|
|
|
* Initialises the index of a binary search for set bits in a bmp_t.
|
|
|
|
*/
|
|
|
|
|
2019-08-15 03:52:20 +08:00
|
|
|
|
2019-08-15 05:06:14 +08:00
|
|
|
#include <stdint.h>
|
2019-08-16 01:24:50 +08:00
|
|
|
#include <limits.h>
|
|
|
|
#if ULONG_MAX == UINT64_MAX
|
|
|
|
// most 64-bit platforms
|
2019-08-15 03:52:20 +08:00
|
|
|
#define PRESETS 1
|
|
|
|
#define BMP_BIT 64
|
|
|
|
#define BMP_SUB 32
|
|
|
|
|
2019-08-16 01:24:50 +08:00
|
|
|
#elif ULONG_MAX == UINT32_MAX
|
|
|
|
// 32-bit platforms and Mingw64
|
2019-08-15 03:52:20 +08:00
|
|
|
#define PRESETS 1
|
|
|
|
#define BMP_BIT 32
|
2015-06-07 17:35:49 +08:00
|
|
|
#define BMP_SUB 16
|
|
|
|
|
2019-08-15 03:52:20 +08:00
|
|
|
#else
|
|
|
|
#error Cannot determine automatically REVENG PRESETS Macros for your platform, you need to set them manually
|
|
|
|
#endif
|
|
|
|
|
2015-06-07 17:35:49 +08:00
|
|
|
/*****************************************
|
2019-03-10 06:35:06 +08:00
|
|
|
* *
|
2015-06-07 17:35:49 +08:00
|
|
|
* End of user configuration options *
|
2019-03-10 06:35:06 +08:00
|
|
|
* *
|
2015-06-07 17:35:49 +08:00
|
|
|
*****************************************/
|
|
|
|
|
2020-05-07 20:20:49 +08:00
|
|
|
// Proxmark3 stdout/stderr hooking
|
|
|
|
#include "ui.h"
|
|
|
|
#define fprintf(stream, ...) PrintAndLogEx(INFO, __VA_ARGS__)
|
|
|
|
#define fputs(s, stream) PrintAndLogEx(INFO, "%s", s)
|
|
|
|
#define puts(s) PrintAndLogEx(SUCCESS, "%s", s)
|
|
|
|
|
2015-06-07 17:35:49 +08:00
|
|
|
#endif /* CONFIG_H */
|