3
|
1 /* This is the build config file. |
|
2 * |
|
3 * With this you can setup what to inlcude/exclude automatically during any build. Just comment |
|
4 * out the line that #define's the word for the thing you want to remove. phew! |
|
5 */ |
|
6 |
|
7 #ifndef MYCRYPT_CFG_H |
|
8 #define MYCRYPT_CFG_H |
|
9 |
|
10 /* you can change how memory allocation works ... */ |
143
|
11 void *XMALLOC(size_t n); |
|
12 void *REALLOC(void *p, size_t n); |
|
13 void *XCALLOC(size_t n, size_t s); |
|
14 void XFREE(void *p); |
3
|
15 |
|
16 /* change the clock function too */ |
143
|
17 clock_t XCLOCK(void); |
3
|
18 |
143
|
19 /* various other functions */ |
|
20 void *XMEMCPY(void *dest, const void *src, size_t n); |
|
21 int XMEMCMP(const void *s1, const void *s2, size_t n); |
|
22 |
3
|
23 /* type of argument checking, 0=default, 1=fatal and 2=none */ |
|
24 #define ARGTYPE 0 |
|
25 |
143
|
26 /* Controls endianess and size of registers. Leave uncommented to get platform neutral [slower] code |
|
27 * |
|
28 * Note: in order to use the optimized macros your platform must support unaligned 32 and 64 bit read/writes. |
|
29 * The x86 platforms allow this but some others [ARM for instance] do not. On those platforms you **MUST** |
|
30 * use the portable [slower] macros. |
|
31 */ |
|
32 |
3
|
33 /* detect x86-32 machines somewhat */ |
|
34 #if defined(INTEL_CC) || (defined(_MSC_VER) && defined(WIN32)) || (defined(__GNUC__) && (defined(__DJGPP__) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__i386__))) |
|
35 #define ENDIAN_LITTLE |
|
36 #define ENDIAN_32BITWORD |
|
37 #endif |
|
38 |
|
39 /* detects MIPS R5900 processors (PS2) */ |
|
40 #if (defined(__R5900) || defined(R5900) || defined(__R5900__)) && (defined(_mips) || defined(__mips__) || defined(mips)) |
|
41 #define ENDIAN_LITTLE |
|
42 #define ENDIAN_64BITWORD |
|
43 #endif |
|
44 |
143
|
45 /* detect amd64 */ |
|
46 #if defined(__x86_64__) |
|
47 #define ENDIAN_LITTLE |
|
48 #define ENDIAN_64BITWORD |
|
49 #endif |
|
50 |
3
|
51 /* #define ENDIAN_LITTLE */ |
|
52 /* #define ENDIAN_BIG */ |
|
53 |
|
54 /* #define ENDIAN_32BITWORD */ |
|
55 /* #define ENDIAN_64BITWORD */ |
|
56 |
|
57 #if (defined(ENDIAN_BIG) || defined(ENDIAN_LITTLE)) && !(defined(ENDIAN_32BITWORD) || defined(ENDIAN_64BITWORD)) |
|
58 #error You must specify a word size as well as endianess in mycrypt_cfg.h |
|
59 #endif |
|
60 |
|
61 #if !(defined(ENDIAN_BIG) || defined(ENDIAN_LITTLE)) |
|
62 #define ENDIAN_NEUTRAL |
|
63 #endif |
|
64 |
|
65 /* packet code */ |
|
66 #if defined(MRSA) || defined(MDH) || defined(MECC) |
|
67 #define PACKET |
|
68 |
|
69 /* size of a packet header in bytes */ |
|
70 #define PACKET_SIZE 4 |
|
71 |
|
72 /* Section tags */ |
|
73 #define PACKET_SECT_RSA 0 |
|
74 #define PACKET_SECT_DH 1 |
|
75 #define PACKET_SECT_ECC 2 |
|
76 #define PACKET_SECT_DSA 3 |
|
77 |
|
78 /* Subsection Tags for the first three sections */ |
|
79 #define PACKET_SUB_KEY 0 |
|
80 #define PACKET_SUB_ENCRYPTED 1 |
|
81 #define PACKET_SUB_SIGNED 2 |
|
82 #define PACKET_SUB_ENC_KEY 3 |
|
83 #endif |
|
84 |
|
85 #endif /* MYCRYPT_CFG_H */ |
|
86 |