2 * Greg Cook, 23/Feb/2019
5 /* CRC RevEng: arbitrary-precision CRC calculator and algorithm finder
6 * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018,
9 * This file is part of CRC RevEng.
11 * CRC RevEng is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation, either version 3 of the License, or
14 * (at your option) any later version.
16 * CRC RevEng is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with CRC RevEng. If not, see <https://www.gnu.org/licenses/>.
28 /*****************************************
30 * Start of user configuration options *
32 *****************************************/
34 /* A type to contain polynomial coefficient bitmaps.
35 * Can be changed to 'unsigned long long' for some extended compilers.
36 * Adjust BMP_C(), BMP_BIT and BMP_SUB below if this is changed.
39 #define BMP_T unsigned long
41 /* Creates an appropriate numeric constant for bmp_t.
42 * If the underlying type is 'unsigned long long', change UL to ULL.
45 #define BMP_C(n) (n##UL)
47 /* Define BMPMACRO to turn the definitions of the size of a bmp_t into
48 * compile-time constants. This improves efficiency but makes the code
52 /* #define BMPMACRO 1 */
54 /* Some enterprise users may wish to disable the -F switch to minimise CPU
55 * usage. To do this, define the macro ALWPCK.
58 /* #define ALWPCK 1 */
61 * Define PRESETS to compile CRC RevEng with the preset models from the
62 * CRC Catalogue. This implies BMPMACRO and so makes the code platform-
67 * Macros defining the size of a bmp_t.
68 * Their values only matter if PRESETS and/or BMPMACRO are defined, in
69 * which case edit the macros below to suit your architecture.
70 * Otherwise, BMP_BIT and BMP_SUB will be redefined as aliases of bmpbit
71 * and bmpsub, global objects initialised at run time.
75 * The highest power of two that is strictly less than BMP_BIT.
76 * Initialises the index of a binary search for set bits in a bmp_t.
82 #if ULONG_MAX == UINT64_MAX
83 // most 64-bit platforms
88 #elif ULONG_MAX == UINT32_MAX
89 // 32-bit platforms and Mingw64
95 #error Cannot determine automatically REVENG PRESETS Macros for your platform, you need to set them manually
98 /*****************************************
100 * End of user configuration options *
102 *****************************************/
104 // Proxmark3 stdout/stderr hooking
106 #define fprintf(stream, ...) PrintAndLogEx(INFO, __VA_ARGS__)
107 #define fputs(s, stream) PrintAndLogEx(INFO, "%s", s)
108 #define puts(s) PrintAndLogEx(SUCCESS, "%s", s)
110 #endif /* CONFIG_H */