comparison mycrypt_custom.h @ 144:7ed585a2c53b libtomcrypt

propagate of 3f8f752126017cbe7d93c4086c27a91550df745f and 747ebf284d40a15b338e5a5c7730ecec6eade3d7 from branch 'au.asn.ucc.matt.ltc-orig' to 'au.asn.ucc.matt.ltc-db'
author Matt Johnston <matt@ucc.asn.au>
date Sun, 19 Dec 2004 11:47:33 +0000
parents 5d99163f7e32 09ab3354aa21
children c2b93763dac9
comparison
equal deleted inserted replaced
143:5d99163f7e32 144:7ed585a2c53b
2 * you don't want to throw all the defines in a makefile. 2 * you don't want to throw all the defines in a makefile.
3 */ 3 */
4 4
5 #ifndef MYCRYPT_CUSTOM_H_ 5 #ifndef MYCRYPT_CUSTOM_H_
6 #define MYCRYPT_CUSTOM_H_ 6 #define MYCRYPT_CUSTOM_H_
7
8 /* this will sort out which stuff based on the user-config in options.h */
9 #include "../options.h"
7 10
8 /* macros for various libc functions you can change for embedded targets */ 11 /* macros for various libc functions you can change for embedded targets */
9 #define XMALLOC malloc 12 #define XMALLOC malloc
10 #define XREALLOC realloc 13 #define XREALLOC realloc
11 #define XCALLOC calloc 14 #define XCALLOC calloc
15 #define XMEMCPY memcpy 18 #define XMEMCPY memcpy
16 19
17 #define XCLOCK clock 20 #define XCLOCK clock
18 #define XCLOCKS_PER_SEC CLOCKS_PER_SEC 21 #define XCLOCKS_PER_SEC CLOCKS_PER_SEC
19 22
20 /* Use small code where possible */ 23 #ifdef DROPBEAR_SMALL_CODE
21 // #define SMALL_CODE 24 #define SMALL_CODE
25 #endif
22 26
23 /* Enable self-test test vector checking */ 27 /* Enable self-test test vector checking */
24 #define LTC_TEST 28 /* Not for dropbear */
29 //#define LTC_TEST
25 30
26 /* clean the stack of functions which put private information on stack */ 31 /* clean the stack of functions which put private information on stack */
27 // #define CLEAN_STACK 32 // #define CLEAN_STACK
28 33
29 /* disable all file related functions */ 34 /* disable all file related functions */
30 // #define NO_FILE 35 // #define NO_FILE
31 36
32 /* various ciphers */ 37 #define CLEAN_STACK
38
39 #ifdef DROPBEAR_BLOWFISH_CBC
33 #define BLOWFISH 40 #define BLOWFISH
34 #define RC2 41 #endif
35 #define RC5 42
36 #define RC6 43 #ifdef DROPBEAR_AES128_CBC
37 #define SAFERP
38 #define RIJNDAEL 44 #define RIJNDAEL
39 #define XTEA 45 #endif
40 /* _TABLES tells it to use tables during setup, _SMALL means to use the smaller scheduled key format 46
41 * (saves 4KB of ram), _ALL_TABLES enables all tables during setup */ 47 #ifdef DROPBEAR_TWOFISH128_CBC
42 #define TWOFISH 48 #define TWOFISH
43 #define TWOFISH_TABLES 49
44 // #define TWOFISH_ALL_TABLES 50 /* enabling just TWOFISH_SMALL will make the binary ~1kB smaller, turning on
45 // #define TWOFISH_SMALL 51 * TWOFISH_TABLES will make it a few kB bigger, but perhaps reduces runtime
46 /* DES includes EDE triple-DES */ 52 * memory usage? */
53 #define TWOFISH_SMALL
54 /*#define TWOFISH_TABLES*/
55 #endif
56
57 #ifdef DROPBEAR_3DES_CBC
47 #define DES 58 #define DES
48 #define CAST5 59 #endif
49 #define NOEKEON 60 #define CBC
50 #define SKIPJACK
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
55 61
56 /* block cipher modes of operation */ 62 #if defined(DROPBEAR_DSS) && defined(DSS_PROTOK)
57 #define CFB 63 #define SHA512
58 #define OFB 64 #endif
59 #define ECB
60 #define CBC
61 #define CTR
62 65
63 /* hash functions */
64 #define CHC_HASH
65 #define WHIRLPOOL
66 #define SHA512
67 #define SHA384
68 #define SHA256
69 #define SHA224
70 #define TIGER
71 #define SHA1 66 #define SHA1
67
68 #ifdef DROPBEAR_MD5_HMAC
72 #define MD5 69 #define MD5
73 #define MD4 70 #endif
74 #define MD2
75 #define RIPEMD128
76 #define RIPEMD160
77 71
78 /* MAC functions */
79 #define HMAC 72 #define HMAC
80 #define OMAC
81 #define PMAC
82
83 /* Encrypt + Authenticate Modes */
84 #define EAX_MODE
85 #define OCB_MODE
86 73
87 /* Various tidbits of modern neatoness */ 74 /* Various tidbits of modern neatoness */
88 #define BASE64 75 #define BASE64
89 76
90 /* Yarrow */
91 #define YARROW
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
95
96 #if defined(YARROW) && !defined(CTR)
97 #error YARROW requires CTR chaining mode to be defined!
98 #endif
99
100 #define SPRNG
101 #define RC4
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
113 #define DEVRANDOM
114 #define TRY_URANDOM_FIRST
115
116 /* Public Key Neatoness */
117 #define MRSA
118 /* enable RSA side channel timing prevention */
119 #define RSA_TIMING
120
121 /* Digital Signature Algorithm */
122 #define MDSA
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 */
129 #define MDH
130 /* Supported Key Sizes */
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
140
141 /* ECC */
142 #define MECC
143 /* Supported Key Sizes */
144 #define ECC160
145 #define ECC192
146 #define ECC224
147 #define ECC256
148 #define ECC384
149 #define ECC521
150
151 /* Include the MPI functionality? (required by the PK algorithms) */
152 #define MPI
153
154 /* PKCS #1 (RSA) and #5 (Password Handling) stuff */
155 #define PKCS_1
156 #define PKCS_5
157 77
158 #endif 78 #endif
159 79