comparison libtomcrypt/src/misc/crypt/crypt.c @ 1435:f849a5ca2efc

update to libtomcrypt 1.17 (with Dropbear changes)
author Matt Johnston <matt@ucc.asn.au>
date Sat, 24 Jun 2017 17:50:50 +0800
parents 0cbe8f6dbf9e
children 6dba84798cd5
comparison
equal deleted inserted replaced
1434:27b9ddb06b09 1435:f849a5ca2efc
4 * algorithms in a highly modular and flexible manner. 4 * algorithms in a highly modular and flexible manner.
5 * 5 *
6 * The library is free for all purposes without any express 6 * The library is free for all purposes without any express
7 * guarantee it works. 7 * guarantee it works.
8 * 8 *
9 * Tom St Denis, [email protected], http://libtomcrypt.com 9 * Tom St Denis, [email protected], http://libtom.org
10 */ 10 */
11 #include "tomcrypt.h" 11 #include "tomcrypt.h"
12 12
13 /** 13 /**
14 @file crypt.c 14 @file crypt.c
43 "enabled\n" 43 "enabled\n"
44 #else 44 #else
45 "disabled\n" 45 "disabled\n"
46 #endif 46 #endif
47 "Ciphers built-in:\n" 47 "Ciphers built-in:\n"
48 #if defined(BLOWFISH) 48 #if defined(LTC_BLOWFISH)
49 " Blowfish\n" 49 " Blowfish\n"
50 #endif 50 #endif
51 #if defined(RC2) 51 #if defined(LTC_RC2)
52 " RC2\n" 52 " LTC_RC2\n"
53 #endif 53 #endif
54 #if defined(RC5) 54 #if defined(LTC_RC5)
55 " RC5\n" 55 " LTC_RC5\n"
56 #endif 56 #endif
57 #if defined(RC6) 57 #if defined(LTC_RC6)
58 " RC6\n" 58 " LTC_RC6\n"
59 #endif 59 #endif
60 #if defined(SAFERP) 60 #if defined(LTC_SAFERP)
61 " Safer+\n" 61 " Safer+\n"
62 #endif 62 #endif
63 #if defined(SAFER) 63 #if defined(LTC_SAFER)
64 " Safer\n" 64 " Safer\n"
65 #endif 65 #endif
66 #if defined(RIJNDAEL) 66 #if defined(LTC_RIJNDAEL)
67 " Rijndael\n" 67 " Rijndael\n"
68 #endif 68 #endif
69 #if defined(XTEA) 69 #if defined(LTC_XTEA)
70 " XTEA\n" 70 " LTC_XTEA\n"
71 #endif 71 #endif
72 #if defined(TWOFISH) 72 #if defined(LTC_TWOFISH)
73 " Twofish " 73 " Twofish "
74 #if defined(TWOFISH_SMALL) && defined(TWOFISH_TABLES) && defined(TWOFISH_ALL_TABLES) 74 #if defined(LTC_TWOFISH_SMALL) && defined(LTC_TWOFISH_TABLES) && defined(LTC_TWOFISH_ALL_TABLES)
75 "(small, tables, all_tables)\n" 75 "(small, tables, all_tables)\n"
76 #elif defined(TWOFISH_SMALL) && defined(TWOFISH_TABLES) 76 #elif defined(LTC_TWOFISH_SMALL) && defined(LTC_TWOFISH_TABLES)
77 "(small, tables)\n" 77 "(small, tables)\n"
78 #elif defined(TWOFISH_SMALL) && defined(TWOFISH_ALL_TABLES) 78 #elif defined(LTC_TWOFISH_SMALL) && defined(LTC_TWOFISH_ALL_TABLES)
79 "(small, all_tables)\n" 79 "(small, all_tables)\n"
80 #elif defined(TWOFISH_TABLES) && defined(TWOFISH_ALL_TABLES) 80 #elif defined(LTC_TWOFISH_TABLES) && defined(LTC_TWOFISH_ALL_TABLES)
81 "(tables, all_tables)\n" 81 "(tables, all_tables)\n"
82 #elif defined(TWOFISH_SMALL) 82 #elif defined(LTC_TWOFISH_SMALL)
83 "(small)\n" 83 "(small)\n"
84 #elif defined(TWOFISH_TABLES) 84 #elif defined(LTC_TWOFISH_TABLES)
85 "(tables)\n" 85 "(tables)\n"
86 #elif defined(TWOFISH_ALL_TABLES) 86 #elif defined(LTC_TWOFISH_ALL_TABLES)
87 "(all_tables)\n" 87 "(all_tables)\n"
88 #else 88 #else
89 "\n" 89 "\n"
90 #endif 90 #endif
91 #endif 91 #endif
92 #if defined(DES) 92 #if defined(LTC_DES)
93 " DES\n" 93 " LTC_DES\n"
94 #endif 94 #endif
95 #if defined(CAST5) 95 #if defined(LTC_CAST5)
96 " CAST5\n" 96 " LTC_CAST5\n"
97 #endif 97 #endif
98 #if defined(NOEKEON) 98 #if defined(LTC_NOEKEON)
99 " Noekeon\n" 99 " Noekeon\n"
100 #endif 100 #endif
101 #if defined(SKIPJACK) 101 #if defined(LTC_SKIPJACK)
102 " Skipjack\n" 102 " Skipjack\n"
103 #endif 103 #endif
104 #if defined(KHAZAD) 104 #if defined(LTC_KHAZAD)
105 " Khazad\n" 105 " Khazad\n"
106 #endif 106 #endif
107 #if defined(ANUBIS) 107 #if defined(LTC_ANUBIS)
108 " Anubis " 108 " Anubis "
109 #endif 109 #endif
110 #if defined(ANUBIS_TWEAK) 110 #if defined(LTC_ANUBIS_TWEAK)
111 " (tweaked)" 111 " (tweaked)"
112 #endif 112 #endif
113 "\n" 113 "\n"
114 #if defined(KSEED) 114 #if defined(LTC_KSEED)
115 " KSEED\n" 115 " LTC_KSEED\n"
116 #endif 116 #endif
117 #if defined(LTC_KASUMI) 117 #if defined(LTC_KASUMI)
118 " KASUMI\n" 118 " KASUMI\n"
119 #endif 119 #endif
120 120
121 "\nHashes built-in:\n" 121 "\nHashes built-in:\n"
122 #if defined(SHA512) 122 #if defined(LTC_SHA512)
123 " SHA-512\n" 123 " LTC_SHA-512\n"
124 #endif 124 #endif
125 #if defined(SHA384) 125 #if defined(LTC_SHA384)
126 " SHA-384\n" 126 " LTC_SHA-384\n"
127 #endif 127 #endif
128 #if defined(SHA256) 128 #if defined(LTC_SHA256)
129 " SHA-256\n" 129 " LTC_SHA-256\n"
130 #endif 130 #endif
131 #if defined(SHA224) 131 #if defined(LTC_SHA224)
132 " SHA-224\n" 132 " LTC_SHA-224\n"
133 #endif 133 #endif
134 #if defined(TIGER) 134 #if defined(LTC_TIGER)
135 " TIGER\n" 135 " LTC_TIGER\n"
136 #endif 136 #endif
137 #if defined(SHA1) 137 #if defined(LTC_SHA1)
138 " SHA1\n" 138 " LTC_SHA1\n"
139 #endif 139 #endif
140 #if defined(MD5) 140 #if defined(LTC_MD5)
141 " MD5\n" 141 " LTC_MD5\n"
142 #endif 142 #endif
143 #if defined(MD4) 143 #if defined(LTC_MD4)
144 " MD4\n" 144 " LTC_MD4\n"
145 #endif 145 #endif
146 #if defined(MD2) 146 #if defined(LTC_MD2)
147 " MD2\n" 147 " LTC_MD2\n"
148 #endif 148 #endif
149 #if defined(RIPEMD128) 149 #if defined(LTC_RIPEMD128)
150 " RIPEMD128\n" 150 " LTC_RIPEMD128\n"
151 #endif 151 #endif
152 #if defined(RIPEMD160) 152 #if defined(LTC_RIPEMD160)
153 " RIPEMD160\n" 153 " LTC_RIPEMD160\n"
154 #endif 154 #endif
155 #if defined(WHIRLPOOL) 155 #if defined(LTC_RIPEMD256)
156 " WHIRLPOOL\n" 156 " LTC_RIPEMD256\n"
157 #endif 157 #endif
158 #if defined(CHC_HASH) 158 #if defined(LTC_RIPEMD320)
159 " CHC_HASH \n" 159 " LTC_RIPEMD320\n"
160 #endif
161 #if defined(LTC_WHIRLPOOL)
162 " LTC_WHIRLPOOL\n"
163 #endif
164 #if defined(LTC_CHC_HASH)
165 " LTC_CHC_HASH \n"
160 #endif 166 #endif
161 167
162 "\nBlock Chaining Modes:\n" 168 "\nBlock Chaining Modes:\n"
163 #if defined(LTC_CFB_MODE) 169 #if defined(LTC_CFB_MODE)
164 " CFB\n" 170 " CFB\n"
187 "\n" 193 "\n"
188 #endif 194 #endif
189 #if defined(LTC_F8_MODE) 195 #if defined(LTC_F8_MODE)
190 " F8 MODE\n" 196 " F8 MODE\n"
191 #endif 197 #endif
198 #if defined(LTC_XTS_MODE)
199 " LTC_XTS_MODE\n"
200 #endif
192 201
193 "\nMACs:\n" 202 "\nMACs:\n"
194 #if defined(LTC_HMAC) 203 #if defined(LTC_HMAC)
195 " HMAC\n" 204 " LTC_HMAC\n"
196 #endif 205 #endif
197 #if defined(LTC_OMAC) 206 #if defined(LTC_OMAC)
198 " OMAC\n" 207 " LTC_OMAC\n"
199 #endif 208 #endif
200 #if defined(LTC_PMAC) 209 #if defined(LTC_PMAC)
201 " PMAC\n" 210 " PMAC\n"
202 #endif 211 #endif
203 #if defined(PELICAN) 212 #if defined(LTC_PELICAN)
204 " PELICAN\n" 213 " LTC_PELICAN\n"
205 #endif 214 #endif
206 #if defined(LTC_XCBC) 215 #if defined(LTC_XCBC)
207 " XCBC-MAC\n" 216 " XCBC-MAC\n"
208 #endif 217 #endif
209 #if defined(LTC_F9_MODE) 218 #if defined(LTC_F9_MODE)
210 " F9-MAC\n" 219 " F9-MAC\n"
211 #endif 220 #endif
212 221
213 "\nENC + AUTH modes:\n" 222 "\nENC + AUTH modes:\n"
214 #if defined(EAX_MODE) 223 #if defined(LTC_EAX_MODE)
215 " EAX_MODE\n" 224 " LTC_EAX_MODE\n"
216 #endif 225 #endif
217 #if defined(OCB_MODE) 226 #if defined(LTC_OCB_MODE)
218 " OCB_MODE\n" 227 " LTC_OCB_MODE\n"
219 #endif 228 #endif
220 #if defined(CCM_MODE) 229 #if defined(LTC_CCM_MODE)
221 " CCM_MODE\n" 230 " LTC_CCM_MODE\n"
222 #endif 231 #endif
223 #if defined(GCM_MODE) 232 #if defined(LTC_GCM_MODE)
224 " GCM_MODE " 233 " LTC_GCM_MODE "
225 #endif 234 #endif
226 #if defined(GCM_TABLES) 235 #if defined(LTC_GCM_TABLES)
227 " (GCM_TABLES) " 236 " (LTC_GCM_TABLES) "
228 #endif 237 #endif
229 "\n" 238 "\n"
230 239
231 "\nPRNG:\n" 240 "\nPRNG:\n"
232 #if defined(YARROW) 241 #if defined(LTC_YARROW)
233 " Yarrow\n" 242 " Yarrow\n"
234 #endif 243 #endif
235 #if defined(SPRNG) 244 #if defined(LTC_SPRNG)
236 " SPRNG\n" 245 " LTC_SPRNG\n"
237 #endif 246 #endif
238 #if defined(RC4) 247 #if defined(LTC_RC4)
239 " RC4\n" 248 " LTC_RC4\n"
240 #endif 249 #endif
241 #if defined(FORTUNA) 250 #if defined(LTC_FORTUNA)
242 " Fortuna\n" 251 " Fortuna\n"
243 #endif 252 #endif
244 #if defined(SOBER128) 253 #if defined(LTC_SOBER128)
245 " SOBER128\n" 254 " LTC_SOBER128\n"
246 #endif 255 #endif
247 256
248 "\nPK Algs:\n" 257 "\nPK Algs:\n"
249 #if defined(MRSA) 258 #if defined(LTC_MRSA)
250 " RSA \n" 259 " RSA \n"
251 #endif 260 #endif
252 #if defined(MECC) 261 #if defined(LTC_MECC)
253 " ECC\n" 262 " ECC\n"
254 #endif 263 #endif
255 #if defined(MDSA) 264 #if defined(LTC_MDSA)
256 " DSA\n" 265 " DSA\n"
257 #endif 266 #endif
258 #if defined(MKAT) 267 #if defined(MKAT)
259 " Katja\n" 268 " Katja\n"
260 #endif 269 #endif
284 #if defined(LTC_PPC32) 293 #if defined(LTC_PPC32)
285 " LTC_PPC32 defined \n" 294 " LTC_PPC32 defined \n"
286 #endif 295 #endif
287 296
288 "\nVarious others: " 297 "\nVarious others: "
289 #if defined(BASE64) 298 #if defined(LTC_BASE64)
290 " BASE64 " 299 " LTC_BASE64 "
291 #endif 300 #endif
292 #if defined(MPI) 301 #if defined(MPI)
293 " MPI " 302 " MPI "
294 #endif 303 #endif
295 #if defined(TRY_UNRANDOM_FIRST) 304 #if defined(TRY_UNRANDOM_FIRST)
296 " TRY_UNRANDOM_FIRST " 305 " TRY_UNRANDOM_FIRST "
297 #endif 306 #endif
298 #if defined(LTC_TEST) 307 #if defined(LTC_TEST)
299 " LTC_TEST " 308 " LTC_TEST "
300 #endif 309 #endif
301 #if defined(PKCS_1) 310 #if defined(LTC_PKCS_1)
302 " PKCS#1 " 311 " LTC_PKCS#1 "
303 #endif 312 #endif
304 #if defined(PKCS_5) 313 #if defined(LTC_PKCS_5)
305 " PKCS#5 " 314 " LTC_PKCS#5 "
306 #endif 315 #endif
307 #if defined(LTC_SMALL_CODE) 316 #if defined(LTC_SMALL_CODE)
308 " LTC_SMALL_CODE " 317 " LTC_SMALL_CODE "
309 #endif 318 #endif
310 #if defined(LTC_NO_FILE) 319 #if defined(LTC_NO_FILE)
332 " LTC_NO_TABLES " 341 " LTC_NO_TABLES "
333 #endif 342 #endif
334 #if defined(LTC_PTHREAD) 343 #if defined(LTC_PTHREAD)
335 " LTC_PTHREAD " 344 " LTC_PTHREAD "
336 #endif 345 #endif
337 #if defined(LTM_DESC) 346 #if defined(LTM_LTC_DESC)
338 " LTM_DESC " 347 " LTM_DESC "
339 #endif 348 #endif
340 #if defined(TFM_DESC) 349 #if defined(TFM_LTC_DESC)
341 " TFM_DESC " 350 " TFM_DESC "
342 #endif 351 #endif
343 #if defined(MECC_ACCEL) 352 #if defined(LTC_MECC_ACCEL)
344 " MECC_ACCEL " 353 " LTC_MECC_ACCEL "
345 #endif 354 #endif
346 #if defined(GMP_DESC) 355 #if defined(GMP_LTC_DESC)
347 " GMP_DESC " 356 " GMP_DESC "
348 #endif 357 #endif
349 #if defined(LTC_EASY) 358 #if defined(LTC_EASY)
350 " (easy) " 359 " (easy) "
351 #endif 360 #endif
352 #if defined(MECC_FP) 361 #if defined(LTC_MECC_FP)
353 " MECC_FP " 362 " LTC_MECC_FP "
354 #endif 363 #endif
355 #if defined(LTC_ECC_SHAMIR) 364 #if defined(LTC_ECC_SHAMIR)
356 " LTC_ECC_SHAMIR " 365 " LTC_ECC_SHAMIR "
357 #endif 366 #endif
358 "\n" 367 "\n"
359 "\n\n\n" 368 "\n\n\n"
360 ; 369 ;
361 */ 370 */
362 371
363 372
364 /* $Source: /cvs/libtom/libtomcrypt/src/misc/crypt/crypt.c,v $ */ 373 /* $Source$ */
365 /* $Revision: 1.27 $ */ 374 /* $Revision$ */
366 /* $Date: 2006/12/03 03:50:45 $ */ 375 /* $Date$ */