1#ifndef TOMCRYPT_CUSTOM_H_
2#define TOMCRYPT_CUSTOM_H_
3
4/* this will sort out which stuff based on the user-config in options.h */
5#include "options.h"
6
7/* macros for various libc functions you can change for embedded targets */
8#ifndef XMALLOC
9   #ifdef malloc
10   #define LTC_NO_PROTOTYPES
11   #endif
12#define XMALLOC  malloc
13#endif
14#ifndef XREALLOC
15   #ifdef realloc
16   #define LTC_NO_PROTOTYPES
17   #endif
18#define XREALLOC realloc
19#endif
20#ifndef XCALLOC
21   #ifdef calloc
22   #define LTC_NO_PROTOTYPES
23   #endif
24#define XCALLOC  calloc
25#endif
26#ifndef XFREE
27   #ifdef free
28   #define LTC_NO_PROTOTYPES
29   #endif
30#define XFREE    free
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
57
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
65   #define LTC_NO_PRNGS
66   #define LTC_NO_PK
67#ifdef DROPBEAR_SMALL_CODE
68#define LTC_SMALL_CODE
69#endif
70/* These spit out warnings etc */
71#define LTC_NO_ROLC
72
73/* Enable self-test test vector checking */
74/* Not for dropbear */
75/*#define LTC_TEST*/
76
77/* clean the stack of functions which put private information on stack */
78/* #define LTC_CLEAN_STACK */
79
80/* disable all file related functions */
81/* #define LTC_NO_FILE */
82
83/* disable all forms of ASM */
84/* #define LTC_NO_ASM */
85
86/* disable FAST mode */
87/* #define LTC_NO_FAST */
88
89/* disable BSWAP on x86 */
90/* #define LTC_NO_BSWAP */
91
92
93#ifdef DROPBEAR_BLOWFISH_CBC
94#define BLOWFISH
95#endif
96
97#ifdef DROPBEAR_AES_CBC
98#define RIJNDAEL
99#endif
100
101#ifdef DROPBEAR_TWOFISH_CBC
102#define TWOFISH
103
104/* enabling just TWOFISH_SMALL will make the binary ~1kB smaller, turning on
105 * TWOFISH_TABLES will make it a few kB bigger, but perhaps reduces runtime
106 * memory usage? */
107#define TWOFISH_SMALL
108/*#define TWOFISH_TABLES*/
109#endif
110
111#ifdef DROPBEAR_3DES_CBC
112#define DES
113#endif
114
115#define LTC_CBC_MODE
116
117#if defined(DROPBEAR_DSS) && defined(DSS_PROTOK)
118#define SHA512
119#endif
120
121#define SHA1
122
123#ifdef DROPBEAR_MD5_HMAC
124#define MD5
125#endif
126
127#define LTC_HMAC
128
129/* Various tidbits of modern neatoness */
130#define BASE64
131
132/* default no pthread functions */
133#define LTC_MUTEX_GLOBAL(x)
134#define LTC_MUTEX_PROTO(x)
135#define LTC_MUTEX_TYPE(x)
136#define LTC_MUTEX_INIT(x)
137#define LTC_MUTEX_LOCK(x)
138#define LTC_MUTEX_UNLOCK(x)
139#define FORTUNA_POOLS 0
140
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
149
150/* $Source: /cvs/libtom/libtomcrypt/src/headers/tomcrypt_custom.h,v $ */
151/* $Revision: 1.66 $ */
152/* $Date: 2006/12/04 02:50:11 $ */
153