comparison mycrypt_custom.h @ 143:5d99163f7e32 libtomcrypt-orig

import of libtomcrypt 0.99
author Matt Johnston <matt@ucc.asn.au>
date Sun, 19 Dec 2004 11:34:45 +0000
parents 6362d3854bb4
children 7ed585a2c53b
comparison
equal deleted inserted replaced
15:6362d3854bb4 143:5d99163f7e32
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 7
8 #ifdef CRYPT 8 /* macros for various libc functions you can change for embedded targets */
9 #error mycrypt_custom.h should be included before mycrypt.h 9 #define XMALLOC malloc
10 #endif 10 #define XREALLOC realloc
11 #define XCALLOC calloc
12 #define XFREE free
11 13
12 /* macros for various libc functions */ 14 #define XMEMSET memset
13 #define XMALLOC malloc 15 #define XMEMCPY memcpy
14 #define XREALLOC realloc 16
15 #define XCALLOC calloc 17 #define XCLOCK clock
16 #define XFREE free
17 #define XCLOCK clock
18 #define XCLOCKS_PER_SEC CLOCKS_PER_SEC 18 #define XCLOCKS_PER_SEC CLOCKS_PER_SEC
19 19
20 /* Use small code where possible */ 20 /* Use small code where possible */
21 #define SMALL_CODE 21 // #define SMALL_CODE
22 22
23 /* Enable self-test test vector checking */ 23 /* Enable self-test test vector checking */
24 #define LTC_TEST 24 #define LTC_TEST
25 25
26 /* clean the stack of functions which put private information on stack */ 26 /* clean the stack of functions which put private information on stack */
27 //#define CLEAN_STACK 27 // #define CLEAN_STACK
28 28
29 /* disable all file related functions */ 29 /* disable all file related functions */
30 //#define NO_FILE 30 // #define NO_FILE
31 31
32 /* various ciphers */ 32 /* various ciphers */
33 #define BLOWFISH 33 #define BLOWFISH
34 #define RC2 34 #define RC2
35 #define RC5 35 #define RC5
36 #define RC6 36 #define RC6
37 #define SAFERP 37 #define SAFERP
38 #define RIJNDAEL 38 #define RIJNDAEL
39 #define XTEA 39 #define XTEA
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 */
40 #define TWOFISH 42 #define TWOFISH
41 #define TWOFISH_TABLES 43 #define TWOFISH_TABLES
42 //#define TWOFISH_ALL_TABLES 44 // #define TWOFISH_ALL_TABLES
43 //#define TWOFISH_SMALL 45 // #define TWOFISH_SMALL
46 /* DES includes EDE triple-DES */
44 #define DES 47 #define DES
45 #define CAST5 48 #define CAST5
46 #define NOEKEON 49 #define NOEKEON
47 #define SKIPJACK 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
48 55
49 /* modes of operation */ 56 /* block cipher modes of operation */
50 #define CFB 57 #define CFB
51 #define OFB 58 #define OFB
52 #define ECB 59 #define ECB
53 #define CBC 60 #define CBC
54 #define CTR 61 #define CTR
55 62
56 /* hash functions */ 63 /* hash functions */
64 #define CHC_HASH
57 #define WHIRLPOOL 65 #define WHIRLPOOL
58 #define SHA512 66 #define SHA512
59 #define SHA384 67 #define SHA384
60 #define SHA256 68 #define SHA256
61 #define SHA224 69 #define SHA224
76 #define EAX_MODE 84 #define EAX_MODE
77 #define OCB_MODE 85 #define OCB_MODE
78 86
79 /* Various tidbits of modern neatoness */ 87 /* Various tidbits of modern neatoness */
80 #define BASE64 88 #define BASE64
89
90 /* Yarrow */
81 #define YARROW 91 #define YARROW
82 // which descriptor of AES to use? 92 // which descriptor of AES to use?
83 // 0 = rijndael_enc 1 = aes_enc, 2 = rijndael [full], 3 = aes [full] 93 // 0 = rijndael_enc 1 = aes_enc, 2 = rijndael [full], 3 = aes [full]
84 #define YARROW_AES 0 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
85 #define SPRNG 100 #define SPRNG
86 #define RC4 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
87 #define DEVRANDOM 113 #define DEVRANDOM
88 #define TRY_URANDOM_FIRST 114 #define TRY_URANDOM_FIRST
89 115
90 /* Public Key Neatoness */ 116 /* Public Key Neatoness */
91 #define MRSA 117 #define MRSA
92 #define RSA_TIMING // enable RSA side channel timing prevention 118 /* enable RSA side channel timing prevention */
119 #define RSA_TIMING
120
121 /* Digital Signature Algorithm */
93 #define MDSA 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 */
94 #define MDH 129 #define MDH
95 #define MECC 130 /* Supported Key Sizes */
96 #define DH768 131 #define DH768
97 #define DH1024 132 #define DH1024
98 #define DH1280 133 #define DH1280
99 #define DH1536 134 #define DH1536
100 #define DH1792 135 #define DH1792
101 #define DH2048 136 #define DH2048
102 #define DH2560 137 #define DH2560
103 #define DH3072 138 #define DH3072
104 #define DH4096 139 #define DH4096
140
141 /* ECC */
142 #define MECC
143 /* Supported Key Sizes */
105 #define ECC160 144 #define ECC160
106 #define ECC192 145 #define ECC192
107 #define ECC224 146 #define ECC224
108 #define ECC256 147 #define ECC256
109 #define ECC384 148 #define ECC384
110 #define ECC521 149 #define ECC521
150
151 /* Include the MPI functionality? (required by the PK algorithms) */
111 #define MPI 152 #define MPI
112 153
113 /* PKCS #1 and 5 stuff */ 154 /* PKCS #1 (RSA) and #5 (Password Handling) stuff */
114 #define PKCS_1 155 #define PKCS_1
115 #define PKCS_5 156 #define PKCS_5
116 157
117 #include <mycrypt.h>
118
119 #endif 158 #endif
120 159