Mercurial > dropbear
comparison src/headers/tomcrypt_custom.h @ 191:1c15b283127b libtomcrypt-orig
Import of libtomcrypt 1.02 with manual path rename rearrangement etc
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Fri, 06 May 2005 13:23:02 +0000 |
parents | |
children | 9cc34777b479 39d5d58461d6 |
comparison
equal
deleted
inserted
replaced
143:5d99163f7e32 | 191:1c15b283127b |
---|---|
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 #ifndef TOMCRYPT_CUSTOM_H_ | |
5 #define TOMCRYPT_CUSTOM_H_ | |
6 | |
7 /* macros for various libc functions you can change for embedded targets */ | |
8 #define XMALLOC malloc | |
9 #define XREALLOC realloc | |
10 #define XCALLOC calloc | |
11 #define XFREE free | |
12 | |
13 #define XMEMSET memset | |
14 #define XMEMCPY memcpy | |
15 | |
16 #define XCLOCK clock | |
17 #define XCLOCKS_PER_SEC CLOCKS_PER_SEC | |
18 | |
19 /* Use small code where possible */ | |
20 /* #define LTC_SMALL_CODE */ | |
21 | |
22 /* Enable self-test test vector checking */ | |
23 #define LTC_TEST | |
24 | |
25 /* clean the stack of functions which put private information on stack */ | |
26 /* #define LTC_CLEAN_STACK */ | |
27 | |
28 /* disable all file related functions */ | |
29 /* #define LTC_NO_FILE */ | |
30 | |
31 /* disable all forms of ASM */ | |
32 /* #define LTC_NO_ASM */ | |
33 | |
34 /* disable FAST mode */ | |
35 /* #define LTC_NO_FAST */ | |
36 | |
37 /* disable BSWAP on x86 */ | |
38 /* #define LTC_NO_BSWAP */ | |
39 | |
40 /* ---> Symmetric Block Ciphers <--- */ | |
41 #define BLOWFISH | |
42 #define RC2 | |
43 #define RC5 | |
44 #define RC6 | |
45 #define SAFERP | |
46 #define RIJNDAEL | |
47 #define XTEA | |
48 /* _TABLES tells it to use tables during setup, _SMALL means to use the smaller scheduled key format | |
49 * (saves 4KB of ram), _ALL_TABLES enables all tables during setup */ | |
50 #define TWOFISH | |
51 #define TWOFISH_TABLES | |
52 /* #define TWOFISH_ALL_TABLES */ | |
53 /* #define TWOFISH_SMALL */ | |
54 /* DES includes EDE triple-DES */ | |
55 #define DES | |
56 #define CAST5 | |
57 #define NOEKEON | |
58 #define SKIPJACK | |
59 #define SAFER | |
60 #define KHAZAD | |
61 #define ANUBIS | |
62 #define ANUBIS_TWEAK | |
63 | |
64 | |
65 /* ---> Block Cipher Modes of Operation <--- */ | |
66 #define CFB | |
67 #define OFB | |
68 #define ECB | |
69 #define CBC | |
70 #define CTR | |
71 | |
72 /* ---> One-Way Hash Functions <--- */ | |
73 #define CHC_HASH | |
74 #define WHIRLPOOL | |
75 #define SHA512 | |
76 #define SHA384 | |
77 #define SHA256 | |
78 #define SHA224 | |
79 #define TIGER | |
80 #define SHA1 | |
81 #define MD5 | |
82 #define MD4 | |
83 #define MD2 | |
84 #define RIPEMD128 | |
85 #define RIPEMD160 | |
86 | |
87 /* ---> MAC functions <--- */ | |
88 #define HMAC | |
89 #define OMAC | |
90 #define PMAC | |
91 #define PELICAN | |
92 | |
93 #if defined(PELICAN) && !defined(RIJNDAEL) | |
94 #error Pelican-MAC requires RIJNDAEL | |
95 #endif | |
96 | |
97 /* ---> Encrypt + Authenticate Modes <--- */ | |
98 #define EAX_MODE | |
99 #if defined(EAX_MODE) && !(defined(CTR) && defined(OMAC)) | |
100 #error EAX_MODE requires CTR and OMAC mode | |
101 #endif | |
102 | |
103 #define OCB_MODE | |
104 #define CCM_MODE | |
105 | |
106 #define GCM_MODE | |
107 /* Use 64KiB tables */ | |
108 #define GCM_TABLES | |
109 | |
110 /* Various tidbits of modern neatoness */ | |
111 #define BASE64 | |
112 | |
113 /* --> Pseudo Random Number Generators <--- */ | |
114 /* Yarrow */ | |
115 #define YARROW | |
116 /* which descriptor of AES to use? */ | |
117 /* 0 = rijndael_enc 1 = aes_enc, 2 = rijndael [full], 3 = aes [full] */ | |
118 #define YARROW_AES 0 | |
119 | |
120 #if defined(YARROW) && !defined(CTR) | |
121 #error YARROW requires CTR chaining mode to be defined! | |
122 #endif | |
123 | |
124 /* a PRNG that simply reads from an available system source */ | |
125 #define SPRNG | |
126 | |
127 /* The RC4 stream cipher */ | |
128 #define RC4 | |
129 | |
130 /* Fortuna PRNG */ | |
131 #define FORTUNA | |
132 /* reseed every N calls to the read function */ | |
133 #define FORTUNA_WD 10 | |
134 /* number of pools (4..32) can save a bit of ram by lowering the count */ | |
135 #define FORTUNA_POOLS 32 | |
136 | |
137 /* Greg's SOBER128 PRNG ;-0 */ | |
138 #define SOBER128 | |
139 | |
140 /* the *nix style /dev/random device */ | |
141 #define DEVRANDOM | |
142 /* try /dev/urandom before trying /dev/random */ | |
143 #define TRY_URANDOM_FIRST | |
144 | |
145 /* ---> Public Key Crypto <--- */ | |
146 #define MRSA | |
147 | |
148 /* Digital Signature Algorithm */ | |
149 #define MDSA | |
150 /* Max diff between group and modulus size in bytes */ | |
151 #define MDSA_DELTA 512 | |
152 /* Max DSA group size in bytes (default allows 4k-bit groups) */ | |
153 #define MDSA_MAX_GROUP 512 | |
154 | |
155 /* Diffie-Hellman */ | |
156 #define MDH | |
157 /* Supported Key Sizes */ | |
158 #define DH768 | |
159 #define DH1024 | |
160 #define DH1280 | |
161 #define DH1536 | |
162 #define DH1792 | |
163 #define DH2048 | |
164 #define DH2560 | |
165 #define DH3072 | |
166 #define DH4096 | |
167 | |
168 /* ECC */ | |
169 #define MECC | |
170 /* Supported Key Sizes */ | |
171 #define ECC160 | |
172 #define ECC192 | |
173 #define ECC224 | |
174 #define ECC256 | |
175 #define ECC384 | |
176 #define ECC521 | |
177 | |
178 /* Include the MPI functionality? (required by the PK algorithms) */ | |
179 #define MPI | |
180 | |
181 /* PKCS #1 (RSA) and #5 (Password Handling) stuff */ | |
182 #define PKCS_1 | |
183 #define PKCS_5 | |
184 | |
185 /* Include ASN.1 DER (required by DSA/RSA) */ | |
186 #define LTC_DER | |
187 #if defined(LTC_DER) && !defined(MPI) | |
188 #error ASN.1 DER requires MPI functionality | |
189 #endif | |
190 | |
191 #if (defined(MDSA) || defined(MRSA)) && !defined(LTC_DER) | |
192 #error RSA/DSA requires ASN.1 DER functionality, make sure LTC_DER is enabled | |
193 #endif | |
194 | |
195 #endif | |
196 |