Mercurial > dropbear
annotate src/headers/tomcrypt_custom.h @ 390:d8e44bef7917 libtomcrypt-dropbear
Replace // with /* */
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Thu, 11 Jan 2007 04:28:09 +0000 |
parents | 2c89a3a04104 |
children |
rev | line source |
---|---|
280
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
1 #ifndef TOMCRYPT_CUSTOM_H_ |
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
2 #define TOMCRYPT_CUSTOM_H_ |
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
3 |
281
997e6f7dc01e
Just import the Dropbear 0.47 libtomcrypt changes
Matt Johnston <matt@ucc.asn.au>
parents:
280
diff
changeset
|
4 /* this will sort out which stuff based on the user-config in options.h */ |
997e6f7dc01e
Just import the Dropbear 0.47 libtomcrypt changes
Matt Johnston <matt@ucc.asn.au>
parents:
280
diff
changeset
|
5 #include "options.h" |
997e6f7dc01e
Just import the Dropbear 0.47 libtomcrypt changes
Matt Johnston <matt@ucc.asn.au>
parents:
280
diff
changeset
|
6 |
280
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
7 /* macros for various libc functions you can change for embedded targets */ |
380 | 8 #ifndef XMALLOC |
9 #ifdef malloc | |
10 #define LTC_NO_PROTOTYPES | |
11 #endif | |
280
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
12 #define XMALLOC malloc |
380 | 13 #endif |
14 #ifndef XREALLOC | |
15 #ifdef realloc | |
16 #define LTC_NO_PROTOTYPES | |
17 #endif | |
280
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
18 #define XREALLOC realloc |
380 | 19 #endif |
20 #ifndef XCALLOC | |
21 #ifdef calloc | |
22 #define LTC_NO_PROTOTYPES | |
23 #endif | |
280
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
24 #define XCALLOC calloc |
380 | 25 #endif |
26 #ifndef XFREE | |
27 #ifdef free | |
28 #define LTC_NO_PROTOTYPES | |
29 #endif | |
280
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
30 #define XFREE free |
380 | 31 #endif |
32 | |
33 #ifndef XMEMSET | |
34 #ifdef memset | |
35 #define LTC_NO_PROTOTYPES | |
36 #endif | |
37 #define XMEMSET memset | |
38 #endif | |
39 #ifndef XMEMCPY | |
40 #ifdef memcpy | |
41 #define LTC_NO_PROTOTYPES | |
42 #endif | |
43 #define XMEMCPY memcpy | |
44 #endif | |
45 #ifndef XMEMCMP | |
46 #ifdef memcmp | |
47 #define LTC_NO_PROTOTYPES | |
48 #endif | |
49 #define XMEMCMP memcmp | |
50 #endif | |
51 #ifndef XSTRCMP | |
52 #ifdef strcmp | |
53 #define LTC_NO_PROTOTYPES | |
54 #endif | |
55 #define XSTRCMP strcmp | |
56 #endif | |
280
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
57 |
380 | 58 #ifndef XCLOCK |
59 #define XCLOCK clock | |
60 #endif | |
61 #ifndef XCLOCKS_PER_SEC | |
62 #define XCLOCKS_PER_SEC CLOCKS_PER_SEC | |
63 #endif | |
64 | |
381
999a5eb4ed10
propagate from branch 'au.asn.ucc.matt.ltc.orig' (head 52840647ac7f5c707c3bd158d119a15734a7ef28)
Matt Johnston <matt@ucc.asn.au>
diff
changeset
|
65 #define LTC_NO_PRNGS |
999a5eb4ed10
propagate from branch 'au.asn.ucc.matt.ltc.orig' (head 52840647ac7f5c707c3bd158d119a15734a7ef28)
Matt Johnston <matt@ucc.asn.au>
diff
changeset
|
66 #define LTC_NO_PK |
281
997e6f7dc01e
Just import the Dropbear 0.47 libtomcrypt changes
Matt Johnston <matt@ucc.asn.au>
parents:
280
diff
changeset
|
67 #ifdef DROPBEAR_SMALL_CODE |
997e6f7dc01e
Just import the Dropbear 0.47 libtomcrypt changes
Matt Johnston <matt@ucc.asn.au>
parents:
280
diff
changeset
|
68 #define LTC_SMALL_CODE |
380 | 69 #endif |
281
997e6f7dc01e
Just import the Dropbear 0.47 libtomcrypt changes
Matt Johnston <matt@ucc.asn.au>
parents:
280
diff
changeset
|
70 /* These spit out warnings etc */ |
997e6f7dc01e
Just import the Dropbear 0.47 libtomcrypt changes
Matt Johnston <matt@ucc.asn.au>
parents:
280
diff
changeset
|
71 #define LTC_NO_ROLC |
280
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
72 |
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
73 /* Enable self-test test vector checking */ |
281
997e6f7dc01e
Just import the Dropbear 0.47 libtomcrypt changes
Matt Johnston <matt@ucc.asn.au>
parents:
280
diff
changeset
|
74 /* Not for dropbear */ |
390 | 75 /*#define LTC_TEST*/ |
280
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
76 |
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
77 /* clean the stack of functions which put private information on stack */ |
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
78 /* #define LTC_CLEAN_STACK */ |
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
79 |
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
80 /* disable all file related functions */ |
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
81 /* #define LTC_NO_FILE */ |
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
82 |
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
83 /* disable all forms of ASM */ |
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
84 /* #define LTC_NO_ASM */ |
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
85 |
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
86 /* disable FAST mode */ |
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
87 /* #define LTC_NO_FAST */ |
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
88 |
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
89 /* disable BSWAP on x86 */ |
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
90 /* #define LTC_NO_BSWAP */ |
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
91 |
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
92 |
281
997e6f7dc01e
Just import the Dropbear 0.47 libtomcrypt changes
Matt Johnston <matt@ucc.asn.au>
parents:
280
diff
changeset
|
93 #ifdef DROPBEAR_BLOWFISH_CBC |
280
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
94 #define BLOWFISH |
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
95 #endif |
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
96 |
281
997e6f7dc01e
Just import the Dropbear 0.47 libtomcrypt changes
Matt Johnston <matt@ucc.asn.au>
parents:
280
diff
changeset
|
97 #ifdef DROPBEAR_AES_CBC |
280
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
98 #define RIJNDAEL |
380 | 99 #endif |
280
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
100 |
281
997e6f7dc01e
Just import the Dropbear 0.47 libtomcrypt changes
Matt Johnston <matt@ucc.asn.au>
parents:
280
diff
changeset
|
101 #ifdef DROPBEAR_TWOFISH_CBC |
280
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
102 #define TWOFISH |
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
103 |
281
997e6f7dc01e
Just import the Dropbear 0.47 libtomcrypt changes
Matt Johnston <matt@ucc.asn.au>
parents:
280
diff
changeset
|
104 /* enabling just TWOFISH_SMALL will make the binary ~1kB smaller, turning on |
997e6f7dc01e
Just import the Dropbear 0.47 libtomcrypt changes
Matt Johnston <matt@ucc.asn.au>
parents:
280
diff
changeset
|
105 * TWOFISH_TABLES will make it a few kB bigger, but perhaps reduces runtime |
997e6f7dc01e
Just import the Dropbear 0.47 libtomcrypt changes
Matt Johnston <matt@ucc.asn.au>
parents:
280
diff
changeset
|
106 * memory usage? */ |
997e6f7dc01e
Just import the Dropbear 0.47 libtomcrypt changes
Matt Johnston <matt@ucc.asn.au>
parents:
280
diff
changeset
|
107 #define TWOFISH_SMALL |
997e6f7dc01e
Just import the Dropbear 0.47 libtomcrypt changes
Matt Johnston <matt@ucc.asn.au>
parents:
280
diff
changeset
|
108 /*#define TWOFISH_TABLES*/ |
280
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
109 #endif |
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
110 |
281
997e6f7dc01e
Just import the Dropbear 0.47 libtomcrypt changes
Matt Johnston <matt@ucc.asn.au>
parents:
280
diff
changeset
|
111 #ifdef DROPBEAR_3DES_CBC |
997e6f7dc01e
Just import the Dropbear 0.47 libtomcrypt changes
Matt Johnston <matt@ucc.asn.au>
parents:
280
diff
changeset
|
112 #define DES |
997e6f7dc01e
Just import the Dropbear 0.47 libtomcrypt changes
Matt Johnston <matt@ucc.asn.au>
parents:
280
diff
changeset
|
113 #endif |
383
2c89a3a04104
Fix up some slight changes.
Matt Johnston <matt@ucc.asn.au>
parents:
381
diff
changeset
|
114 |
2c89a3a04104
Fix up some slight changes.
Matt Johnston <matt@ucc.asn.au>
parents:
381
diff
changeset
|
115 #define LTC_CBC_MODE |
280
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
116 |
281
997e6f7dc01e
Just import the Dropbear 0.47 libtomcrypt changes
Matt Johnston <matt@ucc.asn.au>
parents:
280
diff
changeset
|
117 #if defined(DROPBEAR_DSS) && defined(DSS_PROTOK) |
280
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
118 #define SHA512 |
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
119 #endif |
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
120 |
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
121 #define SHA1 |
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
122 |
281
997e6f7dc01e
Just import the Dropbear 0.47 libtomcrypt changes
Matt Johnston <matt@ucc.asn.au>
parents:
280
diff
changeset
|
123 #ifdef DROPBEAR_MD5_HMAC |
280
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
124 #define MD5 |
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
125 #endif |
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
126 |
383
2c89a3a04104
Fix up some slight changes.
Matt Johnston <matt@ucc.asn.au>
parents:
381
diff
changeset
|
127 #define LTC_HMAC |
280
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
128 |
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
129 /* Various tidbits of modern neatoness */ |
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
130 #define BASE64 |
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
131 |
383
2c89a3a04104
Fix up some slight changes.
Matt Johnston <matt@ucc.asn.au>
parents:
381
diff
changeset
|
132 /* default no pthread functions */ |
280
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
133 #define LTC_MUTEX_GLOBAL(x) |
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
134 #define LTC_MUTEX_PROTO(x) |
380 | 135 #define LTC_MUTEX_TYPE(x) |
136 #define LTC_MUTEX_INIT(x) | |
280
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
137 #define LTC_MUTEX_LOCK(x) |
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
138 #define LTC_MUTEX_UNLOCK(x) |
281
997e6f7dc01e
Just import the Dropbear 0.47 libtomcrypt changes
Matt Johnston <matt@ucc.asn.au>
parents:
280
diff
changeset
|
139 #define FORTUNA_POOLS 0 |
280
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
140 |
380 | 141 /* Debuggers */ |
142 | |
143 /* define this if you use Valgrind, note: it CHANGES the way SOBER-128 and RC4 work (see the code) */ | |
144 /* #define LTC_VALGRIND */ | |
145 | |
146 #endif | |
147 | |
148 | |
280
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
149 |
59400faa4b44
Re-import libtomcrypt 1.05 for cleaner propagating.
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
150 /* $Source: /cvs/libtom/libtomcrypt/src/headers/tomcrypt_custom.h,v $ */ |
380 | 151 /* $Revision: 1.66 $ */ |
152 /* $Date: 2006/12/04 02:50:11 $ */ |