Merge pull request #2672 from kitsunehunter/laundry-keys
[RRG-proxmark3.git] / client / deps / reveng / config.h
blob177df030e9d1fda14af26c258be4594b8d317614
1 /* config.h
2 * Greg Cook, 23/Feb/2019
3 */
5 /* CRC RevEng: arbitrary-precision CRC calculator and algorithm finder
6 * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018,
7 * 2019 Gregory Cook
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/>.
25 #ifndef CONFIG_H
26 #define CONFIG_H 1
28 /*****************************************
29 * *
30 * Start of user configuration options *
31 * *
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
49 * platform-specific.
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 */
60 /* #define PRESETS 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-
63 * specific.
66 /* #define BMP_BIT 32
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.
74 /* #define BMP_SUB 16
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.
80 #include <stdint.h>
81 #include <limits.h>
82 #if ULONG_MAX == UINT64_MAX
83 // most 64-bit platforms
84 #define PRESETS 1
85 #define BMP_BIT 64
86 #define BMP_SUB 32
88 #elif ULONG_MAX == UINT32_MAX
89 // 32-bit platforms and Mingw64
90 #define PRESETS 1
91 #define BMP_BIT 32
92 #define BMP_SUB 16
94 #else
95 #error Cannot determine automatically REVENG PRESETS Macros for your platform, you need to set them manually
96 #endif
98 /*****************************************
99 * *
100 * End of user configuration options *
102 *****************************************/
104 // Proxmark3 stdout/stderr hooking
105 #include "ui.h"
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 */