3
|
1 /* This header is meant to be included before mycrypt.h in projects where |
|
2 * you don't want to throw all the defines in a makefile. |
|
3 */ |
|
4 |
|
5 #ifndef MYCRYPT_CUSTOM_H_ |
|
6 #define MYCRYPT_CUSTOM_H_ |
|
7 |
143
|
8 /* macros for various libc functions you can change for embedded targets */ |
|
9 #define XMALLOC malloc |
|
10 #define XREALLOC realloc |
|
11 #define XCALLOC calloc |
|
12 #define XFREE free |
3
|
13 |
143
|
14 #define XMEMSET memset |
|
15 #define XMEMCPY memcpy |
|
16 |
|
17 #define XCLOCK clock |
3
|
18 #define XCLOCKS_PER_SEC CLOCKS_PER_SEC |
15
|
19 |
|
20 /* Use small code where possible */ |
143
|
21 // #define SMALL_CODE |
15
|
22 |
|
23 /* Enable self-test test vector checking */ |
3
|
24 #define LTC_TEST |
15
|
25 |
|
26 /* clean the stack of functions which put private information on stack */ |
143
|
27 // #define CLEAN_STACK |
15
|
28 |
|
29 /* disable all file related functions */ |
143
|
30 // #define NO_FILE |
15
|
31 |
|
32 /* various ciphers */ |
3
|
33 #define BLOWFISH |
|
34 #define RC2 |
|
35 #define RC5 |
|
36 #define RC6 |
|
37 #define SAFERP |
|
38 #define RIJNDAEL |
|
39 #define XTEA |
143
|
40 /* _TABLES tells it to use tables during setup, _SMALL means to use the smaller scheduled key format |
|
41 * (saves 4KB of ram), _ALL_TABLES enables all tables during setup */ |
3
|
42 #define TWOFISH |
|
43 #define TWOFISH_TABLES |
143
|
44 // #define TWOFISH_ALL_TABLES |
|
45 // #define TWOFISH_SMALL |
|
46 /* DES includes EDE triple-DES */ |
3
|
47 #define DES |
|
48 #define CAST5 |
|
49 #define NOEKEON |
|
50 #define SKIPJACK |
143
|
51 /* SAFER code isn't public domain. It appears to be free to use |
|
52 * but has been disabled by default to avoid any such problems |
|
53 */ |
|
54 //#define SAFER |
15
|
55 |
143
|
56 /* block cipher modes of operation */ |
3
|
57 #define CFB |
|
58 #define OFB |
|
59 #define ECB |
|
60 #define CBC |
|
61 #define CTR |
15
|
62 |
|
63 /* hash functions */ |
143
|
64 #define CHC_HASH |
3
|
65 #define WHIRLPOOL |
|
66 #define SHA512 |
|
67 #define SHA384 |
|
68 #define SHA256 |
|
69 #define SHA224 |
|
70 #define TIGER |
|
71 #define SHA1 |
|
72 #define MD5 |
|
73 #define MD4 |
|
74 #define MD2 |
|
75 #define RIPEMD128 |
|
76 #define RIPEMD160 |
15
|
77 |
|
78 /* MAC functions */ |
3
|
79 #define HMAC |
|
80 #define OMAC |
|
81 #define PMAC |
15
|
82 |
|
83 /* Encrypt + Authenticate Modes */ |
3
|
84 #define EAX_MODE |
|
85 #define OCB_MODE |
15
|
86 |
|
87 /* Various tidbits of modern neatoness */ |
3
|
88 #define BASE64 |
143
|
89 |
|
90 /* Yarrow */ |
3
|
91 #define YARROW |
15
|
92 // which descriptor of AES to use? |
|
93 // 0 = rijndael_enc 1 = aes_enc, 2 = rijndael [full], 3 = aes [full] |
|
94 #define YARROW_AES 0 |
143
|
95 |
|
96 #if defined(YARROW) && !defined(CTR) |
|
97 #error YARROW requires CTR chaining mode to be defined! |
|
98 #endif |
|
99 |
3
|
100 #define SPRNG |
|
101 #define RC4 |
143
|
102 |
|
103 /* Fortuna PRNG */ |
|
104 #define FORTUNA |
|
105 /* reseed every N calls to the read function */ |
|
106 #define FORTUNA_WD 10 |
|
107 /* number of pools (4..32) can save a bit of ram by lowering the count */ |
|
108 #define FORTUNA_POOLS 32 |
|
109 |
|
110 /* Greg's SOBER128 PRNG ;-0 */ |
|
111 #define SOBER128 |
|
112 |
3
|
113 #define DEVRANDOM |
|
114 #define TRY_URANDOM_FIRST |
15
|
115 |
|
116 /* Public Key Neatoness */ |
3
|
117 #define MRSA |
143
|
118 /* enable RSA side channel timing prevention */ |
|
119 #define RSA_TIMING |
|
120 |
|
121 /* Digital Signature Algorithm */ |
3
|
122 #define MDSA |
143
|
123 /* Max diff between group and modulus size in bytes */ |
|
124 #define MDSA_DELTA 512 |
|
125 /* Max DSA group size in bytes (default allows 4k-bit groups) */ |
|
126 #define MDSA_MAX_GROUP 512 |
|
127 |
|
128 /* Diffie-Hellman */ |
3
|
129 #define MDH |
143
|
130 /* Supported Key Sizes */ |
3
|
131 #define DH768 |
|
132 #define DH1024 |
|
133 #define DH1280 |
|
134 #define DH1536 |
|
135 #define DH1792 |
|
136 #define DH2048 |
|
137 #define DH2560 |
|
138 #define DH3072 |
|
139 #define DH4096 |
143
|
140 |
|
141 /* ECC */ |
|
142 #define MECC |
|
143 /* Supported Key Sizes */ |
3
|
144 #define ECC160 |
|
145 #define ECC192 |
|
146 #define ECC224 |
|
147 #define ECC256 |
|
148 #define ECC384 |
|
149 #define ECC521 |
143
|
150 |
|
151 /* Include the MPI functionality? (required by the PK algorithms) */ |
3
|
152 #define MPI |
|
153 |
143
|
154 /* PKCS #1 (RSA) and #5 (Password Handling) stuff */ |
3
|
155 #define PKCS_1 |
|
156 #define PKCS_5 |
|
157 |
|
158 #endif |
|
159 |