annotate libtomcrypt/src/headers/tomcrypt_custom.h @ 1650:009d52ae26d3 DROPBEAR_2019.78

Bump to 2019.78
author Matt Johnston <matt@ucc.asn.au>
date Wed, 27 Mar 2019 21:47:34 +0800
parents d4efb7801fcd
children 1ff2a1034c52
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1471
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
2 *
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
3 * LibTomCrypt is a library that provides various cryptographic
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
4 * algorithms in a highly modular and flexible manner.
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
5 *
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
6 * The library is free for all purposes without any express
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
7 * guarantee it works.
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
8 */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
9
285
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
10 #ifndef TOMCRYPT_CUSTOM_H_
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
11 #define TOMCRYPT_CUSTOM_H_
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
12
1476
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
13 #include "tomcrypt_dropbear.h"
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
14
1571
d4efb7801fcd Attempt to fix m_free for libtomcrypt/libtommath
Matt Johnston <matt@ucc.asn.au>
parents: 1511
diff changeset
15 #include "dbmalloc.h"
1361
f9f930e1a516 add dbmalloc epoch cleanup
Matt Johnston <matt@ucc.asn.au>
parents: 1283
diff changeset
16 #define XMALLOC m_malloc
f9f930e1a516 add dbmalloc epoch cleanup
Matt Johnston <matt@ucc.asn.au>
parents: 1283
diff changeset
17 #define XFREE m_free_direct
f9f930e1a516 add dbmalloc epoch cleanup
Matt Johnston <matt@ucc.asn.au>
parents: 1283
diff changeset
18 #define XREALLOC m_realloc
f9f930e1a516 add dbmalloc epoch cleanup
Matt Johnston <matt@ucc.asn.au>
parents: 1283
diff changeset
19 #define XCALLOC m_calloc
f9f930e1a516 add dbmalloc epoch cleanup
Matt Johnston <matt@ucc.asn.au>
parents: 1283
diff changeset
20
285
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
21 /* macros for various libc functions you can change for embedded targets */
382
0cbe8f6dbf9e propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 2af22fb4e878750b88f80f90d439b316d229796f)
Matt Johnston <matt@ucc.asn.au>
parents: 285
diff changeset
22 #ifndef XMALLOC
285
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
23 #define XMALLOC malloc
382
0cbe8f6dbf9e propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 2af22fb4e878750b88f80f90d439b316d229796f)
Matt Johnston <matt@ucc.asn.au>
parents: 285
diff changeset
24 #endif
0cbe8f6dbf9e propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 2af22fb4e878750b88f80f90d439b316d229796f)
Matt Johnston <matt@ucc.asn.au>
parents: 285
diff changeset
25 #ifndef XREALLOC
285
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
26 #define XREALLOC realloc
382
0cbe8f6dbf9e propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 2af22fb4e878750b88f80f90d439b316d229796f)
Matt Johnston <matt@ucc.asn.au>
parents: 285
diff changeset
27 #endif
0cbe8f6dbf9e propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 2af22fb4e878750b88f80f90d439b316d229796f)
Matt Johnston <matt@ucc.asn.au>
parents: 285
diff changeset
28 #ifndef XCALLOC
285
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
29 #define XCALLOC calloc
382
0cbe8f6dbf9e propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 2af22fb4e878750b88f80f90d439b316d229796f)
Matt Johnston <matt@ucc.asn.au>
parents: 285
diff changeset
30 #endif
0cbe8f6dbf9e propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 2af22fb4e878750b88f80f90d439b316d229796f)
Matt Johnston <matt@ucc.asn.au>
parents: 285
diff changeset
31 #ifndef XFREE
285
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
32 #define XFREE free
382
0cbe8f6dbf9e propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 2af22fb4e878750b88f80f90d439b316d229796f)
Matt Johnston <matt@ucc.asn.au>
parents: 285
diff changeset
33 #endif
285
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
34
382
0cbe8f6dbf9e propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 2af22fb4e878750b88f80f90d439b316d229796f)
Matt Johnston <matt@ucc.asn.au>
parents: 285
diff changeset
35 #ifndef XMEMSET
285
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
36 #define XMEMSET memset
382
0cbe8f6dbf9e propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 2af22fb4e878750b88f80f90d439b316d229796f)
Matt Johnston <matt@ucc.asn.au>
parents: 285
diff changeset
37 #endif
0cbe8f6dbf9e propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 2af22fb4e878750b88f80f90d439b316d229796f)
Matt Johnston <matt@ucc.asn.au>
parents: 285
diff changeset
38 #ifndef XMEMCPY
285
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
39 #define XMEMCPY memcpy
382
0cbe8f6dbf9e propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 2af22fb4e878750b88f80f90d439b316d229796f)
Matt Johnston <matt@ucc.asn.au>
parents: 285
diff changeset
40 #endif
1471
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
41 #ifndef XMEMMOVE
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
42 #define XMEMMOVE memmove
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
43 #endif
382
0cbe8f6dbf9e propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 2af22fb4e878750b88f80f90d439b316d229796f)
Matt Johnston <matt@ucc.asn.au>
parents: 285
diff changeset
44 #ifndef XMEMCMP
0cbe8f6dbf9e propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 2af22fb4e878750b88f80f90d439b316d229796f)
Matt Johnston <matt@ucc.asn.au>
parents: 285
diff changeset
45 #define XMEMCMP memcmp
0cbe8f6dbf9e propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 2af22fb4e878750b88f80f90d439b316d229796f)
Matt Johnston <matt@ucc.asn.au>
parents: 285
diff changeset
46 #endif
1471
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
47 /* A memory compare function that has to run in constant time,
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
48 * c.f. mem_neq() API summary.
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
49 */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
50 #ifndef XMEM_NEQ
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
51 #define XMEM_NEQ mem_neq
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
52 #endif
382
0cbe8f6dbf9e propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 2af22fb4e878750b88f80f90d439b316d229796f)
Matt Johnston <matt@ucc.asn.au>
parents: 285
diff changeset
53 #ifndef XSTRCMP
0cbe8f6dbf9e propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 2af22fb4e878750b88f80f90d439b316d229796f)
Matt Johnston <matt@ucc.asn.au>
parents: 285
diff changeset
54 #define XSTRCMP strcmp
0cbe8f6dbf9e propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 2af22fb4e878750b88f80f90d439b316d229796f)
Matt Johnston <matt@ucc.asn.au>
parents: 285
diff changeset
55 #endif
285
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
56
382
0cbe8f6dbf9e propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 2af22fb4e878750b88f80f90d439b316d229796f)
Matt Johnston <matt@ucc.asn.au>
parents: 285
diff changeset
57 #ifndef XCLOCK
285
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
58 #define XCLOCK clock
382
0cbe8f6dbf9e propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 2af22fb4e878750b88f80f90d439b316d229796f)
Matt Johnston <matt@ucc.asn.au>
parents: 285
diff changeset
59 #endif
285
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
60
1435
f849a5ca2efc update to libtomcrypt 1.17 (with Dropbear changes)
Matt Johnston <matt@ucc.asn.au>
parents: 1283
diff changeset
61 #ifndef XQSORT
f849a5ca2efc update to libtomcrypt 1.17 (with Dropbear changes)
Matt Johnston <matt@ucc.asn.au>
parents: 1283
diff changeset
62 #define XQSORT qsort
f849a5ca2efc update to libtomcrypt 1.17 (with Dropbear changes)
Matt Johnston <matt@ucc.asn.au>
parents: 1283
diff changeset
63 #endif
f849a5ca2efc update to libtomcrypt 1.17 (with Dropbear changes)
Matt Johnston <matt@ucc.asn.au>
parents: 1283
diff changeset
64
1471
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
65 #if ( defined(malloc) || defined(realloc) || defined(calloc) || defined(free) || \
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
66 defined(memset) || defined(memcpy) || defined(memcmp) || defined(strcmp) || \
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
67 defined(clock) || defined(qsort) ) && !defined(LTC_NO_PROTOTYPES)
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
68 #define LTC_NO_PROTOTYPES
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
69 #endif
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
70
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
71 /* shortcut to disable automatic inclusion */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
72 #if defined LTC_NOTHING && !defined LTC_EASY
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
73 #define LTC_NO_CIPHERS
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
74 #define LTC_NO_MODES
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
75 #define LTC_NO_HASHES
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
76 #define LTC_NO_MACS
1499
2d450c1056e3 options: Complete the transition to numeric toggles (`#if')
Michael Witten <mfwitten@gmail.com>
parents: 1476
diff changeset
77 #define LTC_NO_PRNGS
2d450c1056e3 options: Complete the transition to numeric toggles (`#if')
Michael Witten <mfwitten@gmail.com>
parents: 1476
diff changeset
78 #define LTC_NO_PK
1471
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
79 #define LTC_NO_PKCS
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
80 #define LTC_NO_MISC
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
81 #endif /* LTC_NOTHING */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
82
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
83 /* Easy button? */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
84 #ifdef LTC_EASY
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
85 #define LTC_NO_CIPHERS
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
86 #define LTC_RIJNDAEL
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
87 #define LTC_BLOWFISH
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
88 #define LTC_DES
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
89 #define LTC_CAST5
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
90
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
91 #define LTC_NO_MODES
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
92 #define LTC_ECB_MODE
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
93 #define LTC_CBC_MODE
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
94 #define LTC_CTR_MODE
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
95
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
96 #define LTC_NO_HASHES
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
97 #define LTC_SHA1
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
98 #define LTC_SHA3
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
99 #define LTC_SHA512
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
100 #define LTC_SHA384
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
101 #define LTC_SHA256
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
102 #define LTC_SHA224
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
103 #define LTC_HASH_HELPERS
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
104
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
105 #define LTC_NO_MACS
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
106 #define LTC_HMAC
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
107 #define LTC_OMAC
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
108 #define LTC_CCM_MODE
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
109
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
110 #define LTC_NO_PRNGS
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
111 #define LTC_SPRNG
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
112 #define LTC_YARROW
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
113 #define LTC_DEVRANDOM
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
114 #define LTC_TRY_URANDOM_FIRST
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
115 #define LTC_RNG_GET_BYTES
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
116 #define LTC_RNG_MAKE_PRNG
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
117
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
118 #define LTC_NO_PK
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
119 #define LTC_MRSA
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
120 #define LTC_MECC
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
121
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
122 #define LTC_NO_MISC
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
123 #define LTC_BASE64
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
124 #endif
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
125
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
126 /* The minimal set of functionality to run the tests */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
127 #ifdef LTC_MINIMAL
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
128 #define LTC_RIJNDAEL
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
129 #define LTC_SHA256
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
130 #define LTC_YARROW
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
131 #define LTC_CTR_MODE
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
132
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
133 #define LTC_RNG_MAKE_PRNG
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
134 #define LTC_RNG_GET_BYTES
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
135 #define LTC_DEVRANDOM
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
136 #define LTC_TRY_URANDOM_FIRST
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
137
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
138 #undef LTC_NO_FILE
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
139 #endif
285
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
140
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
141 /* Enable self-test test vector checking */
1471
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
142 #ifndef LTC_NO_TEST
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
143 #define LTC_TEST
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
144 #endif
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
145 /* Enable extended self-tests */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
146 /* #define LTC_TEST_EXT */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
147
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
148 /* Use small code where possible */
1476
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
149 /* #define LTC_SMALL_CODE */
285
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
150
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
151 /* clean the stack of functions which put private information on stack */
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
152 /* #define LTC_CLEAN_STACK */
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
153
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
154 /* disable all file related functions */
1471
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
155 /* #define LTC_NO_FILE */
285
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
156
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
157 /* disable all forms of ASM */
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
158 /* #define LTC_NO_ASM */
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
159
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
160 /* disable FAST mode */
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
161 /* #define LTC_NO_FAST */
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
162
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
163 /* disable BSWAP on x86 */
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
164 /* #define LTC_NO_BSWAP */
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
165
1471
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
166 /* ---> math provider? <--- */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
167 #ifndef LTC_NO_MATH
285
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
168
1471
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
169 /* LibTomMath */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
170 /* #define LTM_DESC */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
171
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
172 /* TomsFastMath */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
173 /* #define TFM_DESC */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
174
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
175 /* GNU Multiple Precision Arithmetic Library */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
176 /* #define GMP_DESC */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
177
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
178 #endif /* LTC_NO_MATH */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
179
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
180 /* ---> Symmetric Block Ciphers <--- */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
181 #ifndef LTC_NO_CIPHERS
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
182
1435
f849a5ca2efc update to libtomcrypt 1.17 (with Dropbear changes)
Matt Johnston <matt@ucc.asn.au>
parents: 1283
diff changeset
183 #define LTC_BLOWFISH
1476
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
184 #define LTC_RC2
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
185 #define LTC_RC5
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
186 #define LTC_RC6
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
187 #define LTC_SAFERP
1435
f849a5ca2efc update to libtomcrypt 1.17 (with Dropbear changes)
Matt Johnston <matt@ucc.asn.au>
parents: 1283
diff changeset
188 #define LTC_RIJNDAEL
1476
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
189 #define LTC_XTEA
1471
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
190 /* _TABLES tells it to use tables during setup, _SMALL means to use the smaller scheduled key format
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
191 * (saves 4KB of ram), _ALL_TABLES enables all tables during setup */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
192 #define LTC_TWOFISH
1476
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
193 #ifndef LTC_NO_TABLES
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
194 #define LTC_TWOFISH_TABLES
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
195 /* #define LTC_TWOFISH_ALL_TABLES */
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
196 #else
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
197 #define LTC_TWOFISH_SMALL
1471
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
198 #endif
1476
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
199 /* #define LTC_TWOFISH_SMALL */
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
200 /* LTC_DES includes EDE triple-DES */
1435
f849a5ca2efc update to libtomcrypt 1.17 (with Dropbear changes)
Matt Johnston <matt@ucc.asn.au>
parents: 1283
diff changeset
201 #define LTC_DES
1476
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
202 #define LTC_CAST5
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
203 #define LTC_NOEKEON
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
204 #define LTC_SKIPJACK
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
205 #define LTC_SAFER
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
206 #define LTC_KHAZAD
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
207 #define LTC_ANUBIS
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
208 #define LTC_ANUBIS_TWEAK
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
209 #define LTC_KSEED
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
210 #define LTC_KASUMI
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
211 #define LTC_MULTI2
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
212 #define LTC_CAMELLIA
384
a05fb340a95d propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head ffd1015238ffcc959f6cd95176d96fcd0945a397)
Matt Johnston <matt@ucc.asn.au>
parents: 382
diff changeset
213
1471
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
214 /* stream ciphers */
1476
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
215 #define LTC_CHACHA
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
216 #define LTC_RC4_STREAM
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
217 #define LTC_SOBER128_STREAM
1471
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
218
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
219 #endif /* LTC_NO_CIPHERS */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
220
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
221
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
222 /* ---> Block Cipher Modes of Operation <--- */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
223 #ifndef LTC_NO_MODES
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
224
1476
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
225 #define LTC_CFB_MODE
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
226 #define LTC_OFB_MODE
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
227 #define LTC_ECB_MODE
384
a05fb340a95d propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head ffd1015238ffcc959f6cd95176d96fcd0945a397)
Matt Johnston <matt@ucc.asn.au>
parents: 382
diff changeset
228 #define LTC_CBC_MODE
1476
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
229 #define LTC_CTR_MODE
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
230
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
231 /* F8 chaining mode */
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
232 #define LTC_F8_MODE
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
233
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
234 /* LRW mode */
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
235 #define LTC_LRW_MODE
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
236 #ifndef LTC_NO_TABLES
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
237 /* like GCM mode this will enable 16 8x128 tables [64KB] that make
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
238 * seeking very fast.
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
239 */
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
240 #define LTC_LRW_TABLES
1471
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
241 #endif
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
242
1476
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
243 /* XTS mode */
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
244 #define LTC_XTS_MODE
285
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
245
1471
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
246 #endif /* LTC_NO_MODES */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
247
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
248 /* ---> One-Way Hash Functions <--- */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
249 #ifndef LTC_NO_HASHES
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
250
1476
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
251 #define LTC_CHC_HASH
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
252 #define LTC_WHIRLPOOL
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
253 #define LTC_SHA3
1471
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
254 #define LTC_SHA512
1476
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
255 #define LTC_SHA512_256
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
256 #define LTC_SHA512_224
1471
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
257 #define LTC_SHA384
1476
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
258 #define LTC_SHA256
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
259 #define LTC_SHA224
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
260 #define LTC_TIGER
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
261 #define LTC_SHA1
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
262 #define LTC_MD5
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
263 #define LTC_MD4
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
264 #define LTC_MD2
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
265 #define LTC_RIPEMD128
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
266 #define LTC_RIPEMD160
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
267 #define LTC_RIPEMD256
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
268 #define LTC_RIPEMD320
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
269 #define LTC_BLAKE2S
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
270 #define LTC_BLAKE2B
1471
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
271
1476
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
272 #define LTC_HASH_HELPERS
285
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
273
1471
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
274 #endif /* LTC_NO_HASHES */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
275
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
276
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
277 /* ---> MAC functions <--- */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
278 #ifndef LTC_NO_MACS
285
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
279
384
a05fb340a95d propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head ffd1015238ffcc959f6cd95176d96fcd0945a397)
Matt Johnston <matt@ucc.asn.au>
parents: 382
diff changeset
280 #define LTC_HMAC
1476
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
281 #define LTC_OMAC
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
282 #define LTC_PMAC
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
283 #define LTC_XCBC
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
284 #define LTC_F9_MODE
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
285 #define LTC_PELICAN
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
286 #define LTC_POLY1305
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
287 #define LTC_BLAKE2SMAC
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
288 #define LTC_BLAKE2BMAC
285
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
289
1471
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
290 /* ---> Encrypt + Authenticate Modes <--- */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
291
1476
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
292 #define LTC_EAX_MODE
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
293
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
294 #define LTC_OCB_MODE
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
295 #define LTC_OCB3_MODE
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
296 #define LTC_CCM_MODE
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
297 #define LTC_GCM_MODE
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
298 #define LTC_CHACHA20POLY1305_MODE
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
299
1471
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
300 /* Use 64KiB tables */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
301 #ifndef LTC_NO_TABLES
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
302 #define LTC_GCM_TABLES
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
303 #endif
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
304
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
305 /* USE SSE2? requires GCC works on x86_32 and x86_64*/
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
306 #ifdef LTC_GCM_TABLES
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
307 /* #define LTC_GCM_TABLES_SSE2 */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
308 #endif
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
309
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
310 #endif /* LTC_NO_MACS */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
311
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
312
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
313 /* --> Pseudo Random Number Generators <--- */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
314 #ifndef LTC_NO_PRNGS
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
315
1476
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
316 /* Yarrow */
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
317 #define LTC_YARROW
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
318
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
319 /* a PRNG that simply reads from an available system source */
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
320 #define LTC_SPRNG
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
321
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
322 /* The RC4 stream cipher based PRNG */
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
323 #define LTC_RC4
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
324
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
325 /* The ChaCha20 stream cipher based PRNG */
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
326 #define LTC_CHACHA20_PRNG
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
327
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
328 /* Fortuna PRNG */
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
329 #define LTC_FORTUNA
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
330
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
331 /* Greg's SOBER128 stream cipher based PRNG */
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
332 #define LTC_SOBER128
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
333
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
334 /* the *nix style /dev/random device */
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
335 #define LTC_DEVRANDOM
1471
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
336 /* try /dev/urandom before trying /dev/random
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
337 * are you sure you want to disable this? http://www.2uo.de/myths-about-urandom/ */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
338 #define LTC_TRY_URANDOM_FIRST
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
339 /* rng_get_bytes() */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
340 #define LTC_RNG_GET_BYTES
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
341 /* rng_make_prng() */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
342 #define LTC_RNG_MAKE_PRNG
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
343
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
344 /* enable the ltc_rng hook to integrate e.g. embedded hardware RNG's easily */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
345 /* #define LTC_PRNG_ENABLE_LTC_RNG */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
346
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
347 #endif /* LTC_NO_PRNGS */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
348
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
349 #ifdef LTC_YARROW
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
350
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
351 /* which descriptor of AES to use? */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
352 /* 0 = rijndael_enc 1 = aes_enc, 2 = rijndael [full], 3 = aes [full] */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
353 #ifdef ENCRYPT_ONLY
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
354 #define LTC_YARROW_AES 0
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
355 #else
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
356 #define LTC_YARROW_AES 2
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
357 #endif
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
358
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
359 #endif
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
360
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
361 #ifdef LTC_FORTUNA
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
362
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
363 #ifndef LTC_FORTUNA_WD
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
364 /* reseed every N calls to the read function */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
365 #define LTC_FORTUNA_WD 10
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
366 #endif
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
367
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
368 #ifndef LTC_FORTUNA_POOLS
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
369 /* number of pools (4..32) can save a bit of ram by lowering the count */
1476
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
370 #define LTC_FORTUNA_POOLS 32
1471
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
371 #endif
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
372
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
373 #endif /* LTC_FORTUNA */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
374
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
375
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
376 /* ---> Public Key Crypto <--- */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
377 #ifndef LTC_NO_PK
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
378
1476
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
379 /* Include RSA support */
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
380 #define LTC_MRSA
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
381
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
382 /* Include Diffie-Hellman support */
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
383 /* is_prime fails for GMP */
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
384 #define LTC_MDH
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
385 /* Supported Key Sizes */
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
386 #define LTC_DH768
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
387 #define LTC_DH1024
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
388 #define LTC_DH1536
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
389 #define LTC_DH2048
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
390
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
391 #ifndef TFM_DESC
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
392 /* tfm has a problem in fp_isprime for larger key sizes */
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
393 #define LTC_DH3072
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
394 #define LTC_DH4096
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
395 #define LTC_DH6144
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
396 #define LTC_DH8192
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
397 #endif
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
398
1471
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
399 /* Include Katja (a Rabin variant like RSA) */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
400 /* #define LTC_MKAT */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
401
1476
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
402 /* Digital Signature Algorithm */
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
403 #define LTC_MDSA
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
404
1471
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
405 /* ECC */
1435
f849a5ca2efc update to libtomcrypt 1.17 (with Dropbear changes)
Matt Johnston <matt@ucc.asn.au>
parents: 1283
diff changeset
406 #define LTC_MECC
1471
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
407
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
408 /* use Shamir's trick for point mul (speeds up signature verification) */
793
70625eed40c9 A bit of work on ecdsa for host/auth keys
Matt Johnston <matt@ucc.asn.au>
parents: 761
diff changeset
409 #define LTC_ECC_SHAMIR
1471
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
410
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
411 #if defined(TFM_DESC) && defined(LTC_MECC)
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
412 #define LTC_MECC_ACCEL
1476
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
413 #endif
1471
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
414
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
415 /* do we want fixed point ECC */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
416 /* #define LTC_MECC_FP */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
417
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
418 #endif /* LTC_NO_PK */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
419
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
420 #if defined(LTC_MRSA) && !defined(LTC_NO_RSA_BLINDING)
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
421 /* Enable RSA blinding when doing private key operations by default */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
422 #define LTC_RSA_BLINDING
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
423 #endif /* LTC_NO_RSA_BLINDING */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
424
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
425 #if defined(LTC_MRSA) && !defined(LTC_NO_RSA_CRT_HARDENING)
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
426 /* Enable RSA CRT hardening when doing private key operations by default */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
427 #define LTC_RSA_CRT_HARDENING
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
428 #endif /* LTC_NO_RSA_CRT_HARDENING */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
429
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
430 #if defined(LTC_MECC) && !defined(LTC_NO_ECC_TIMING_RESISTANT)
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
431 /* Enable ECC timing resistant version by default */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
432 #define LTC_ECC_TIMING_RESISTANT
756
bf9dc2d9c2b1 more bits on ecc branch
Matt Johnston <matt@ucc.asn.au>
parents: 755
diff changeset
433 #endif
755
b07eb3dc23ec refactor kexdh code a bit, start working on ecdh etc
Matt Johnston <matt@ucc.asn.au>
parents: 679
diff changeset
434
1471
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
435 /* PKCS #1 (RSA) and #5 (Password Handling) stuff */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
436 #ifndef LTC_NO_PKCS
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
437
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
438 #define LTC_PKCS_1
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
439 #define LTC_PKCS_5
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
440
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
441 /* Include ASN.1 DER (required by DSA/RSA) */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
442 #define LTC_DER
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
443
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
444 #endif /* LTC_NO_PKCS */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
445
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
446 /* misc stuff */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
447 #ifndef LTC_NO_MISC
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
448
285
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
449 /* Various tidbits of modern neatoness */
1435
f849a5ca2efc update to libtomcrypt 1.17 (with Dropbear changes)
Matt Johnston <matt@ucc.asn.au>
parents: 1283
diff changeset
450 #define LTC_BASE64
1476
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
451 /* ... and it's URL safe version */
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
452 #define LTC_BASE64_URL
285
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
453
1471
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
454 /* Keep LTC_NO_HKDF for compatibility reasons
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
455 * superseeded by LTC_NO_MISC*/
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
456 #ifndef LTC_NO_HKDF
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
457 /* HKDF Key Derivation/Expansion stuff */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
458 #define LTC_HKDF
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
459 #endif /* LTC_NO_HKDF */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
460
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
461 #define LTC_ADLER32
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
462
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
463 #define LTC_CRC32
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
464
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
465 #endif /* LTC_NO_MISC */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
466
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
467 /* cleanup */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
468
1476
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
469 #ifdef LTC_MECC
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
470 /* Supported ECC Key Sizes */
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
471 #ifndef LTC_NO_CURVES
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
472 #define LTC_ECC112
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
473 #define LTC_ECC128
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
474 #define LTC_ECC160
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
475 #define LTC_ECC192
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
476 #define LTC_ECC224
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
477 #define LTC_ECC256
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
478 #define LTC_ECC384
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
479 #define LTC_ECC521
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
480 #endif
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
481 #endif
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
482
1471
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
483 #if defined(LTC_MECC) || defined(LTC_MRSA) || defined(LTC_MDSA) || defined(LTC_MKAT)
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
484 /* Include the MPI functionality? (required by the PK algorithms) */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
485 #define LTC_MPI
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
486
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
487 #ifndef LTC_PK_MAX_RETRIES
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
488 /* iterations limit for retry-loops */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
489 #define LTC_PK_MAX_RETRIES 20
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
490 #endif
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
491 #endif
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
492
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
493 #ifdef LTC_MRSA
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
494 #define LTC_PKCS_1
1476
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
495 #endif
1471
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
496
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
497 #if defined(LTC_PELICAN) && !defined(LTC_RIJNDAEL)
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
498 #error Pelican-MAC requires LTC_RIJNDAEL
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
499 #endif
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
500
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
501 #if defined(LTC_EAX_MODE) && !(defined(LTC_CTR_MODE) && defined(LTC_OMAC))
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
502 #error LTC_EAX_MODE requires CTR and LTC_OMAC mode
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
503 #endif
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
504
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
505 #if defined(LTC_YARROW) && !defined(LTC_CTR_MODE)
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
506 #error LTC_YARROW requires LTC_CTR_MODE chaining mode to be defined!
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
507 #endif
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
508
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
509 #if defined(LTC_DER) && !defined(LTC_MPI)
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
510 #error ASN.1 DER requires MPI functionality
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
511 #endif
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
512
1476
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
513 /* Dropbear patched out LTC_MECC */
8305ebe45940 Put Dropbear config in a separate file
Matt Johnston <matt@ucc.asn.au>
parents: 1471
diff changeset
514 #if (defined(LTC_MDSA) || defined(LTC_MRSA) || /*defined(LTC_MECC) ||*/ defined(LTC_MKAT)) && !defined(LTC_DER)
1471
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
515 #error PK requires ASN.1 DER functionality, make sure LTC_DER is enabled
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
516 #endif
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
517
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
518 #if defined(LTC_CHACHA20POLY1305_MODE) && (!defined(LTC_CHACHA) || !defined(LTC_POLY1305))
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
519 #error LTC_CHACHA20POLY1305_MODE requires LTC_CHACHA + LTC_POLY1305
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
520 #endif
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
521
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
522 #if defined(LTC_CHACHA20_PRNG) && !defined(LTC_CHACHA)
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
523 #error LTC_CHACHA20_PRNG requires LTC_CHACHA
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
524 #endif
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
525
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
526 #if defined(LTC_RC4) && !defined(LTC_RC4_STREAM)
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
527 #error LTC_RC4 requires LTC_RC4_STREAM
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
528 #endif
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
529
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
530 #if defined(LTC_SOBER128) && !defined(LTC_SOBER128_STREAM)
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
531 #error LTC_SOBER128 requires LTC_SOBER128_STREAM
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
532 #endif
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
533
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
534 #if defined(LTC_BLAKE2SMAC) && !defined(LTC_BLAKE2S)
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
535 #error LTC_BLAKE2SMAC requires LTC_BLAKE2S
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
536 #endif
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
537
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
538 #if defined(LTC_BLAKE2BMAC) && !defined(LTC_BLAKE2B)
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
539 #error LTC_BLAKE2BMAC requires LTC_BLAKE2B
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
540 #endif
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
541
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
542 #if defined(LTC_SPRNG) && !defined(LTC_RNG_GET_BYTES)
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
543 #error LTC_SPRNG requires LTC_RNG_GET_BYTES
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
544 #endif
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
545
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
546 #if defined(LTC_NO_MATH) && (defined(LTM_DESC) || defined(TFM_DESC) || defined(GMP_DESC))
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
547 #error LTC_NO_MATH defined, but also a math descriptor
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
548 #endif
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
549
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
550 /* THREAD management */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
551 #ifdef LTC_PTHREAD
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
552
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
553 #include <pthread.h>
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
554
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
555 #define LTC_MUTEX_GLOBAL(x) pthread_mutex_t x = PTHREAD_MUTEX_INITIALIZER;
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
556 #define LTC_MUTEX_PROTO(x) extern pthread_mutex_t x;
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
557 #define LTC_MUTEX_TYPE(x) pthread_mutex_t x;
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
558 #define LTC_MUTEX_INIT(x) LTC_ARGCHK(pthread_mutex_init(x, NULL) == 0);
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
559 #define LTC_MUTEX_LOCK(x) LTC_ARGCHK(pthread_mutex_lock(x) == 0);
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
560 #define LTC_MUTEX_UNLOCK(x) LTC_ARGCHK(pthread_mutex_unlock(x) == 0);
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
561 #define LTC_MUTEX_DESTROY(x) LTC_ARGCHK(pthread_mutex_destroy(x) == 0);
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
562
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
563 #else
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
564
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
565 /* default no functions */
285
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
566 #define LTC_MUTEX_GLOBAL(x)
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
567 #define LTC_MUTEX_PROTO(x)
382
0cbe8f6dbf9e propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 2af22fb4e878750b88f80f90d439b316d229796f)
Matt Johnston <matt@ucc.asn.au>
parents: 285
diff changeset
568 #define LTC_MUTEX_TYPE(x)
0cbe8f6dbf9e propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 2af22fb4e878750b88f80f90d439b316d229796f)
Matt Johnston <matt@ucc.asn.au>
parents: 285
diff changeset
569 #define LTC_MUTEX_INIT(x)
285
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
570 #define LTC_MUTEX_LOCK(x)
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
571 #define LTC_MUTEX_UNLOCK(x)
1471
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
572 #define LTC_MUTEX_DESTROY(x)
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
573
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
574 #endif
285
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
575
382
0cbe8f6dbf9e propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 2af22fb4e878750b88f80f90d439b316d229796f)
Matt Johnston <matt@ucc.asn.au>
parents: 285
diff changeset
576 /* Debuggers */
0cbe8f6dbf9e propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 2af22fb4e878750b88f80f90d439b316d229796f)
Matt Johnston <matt@ucc.asn.au>
parents: 285
diff changeset
577
1471
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
578 /* define this if you use Valgrind, note: it CHANGES the way SOBER-128 and RC4 work (see the code) */
382
0cbe8f6dbf9e propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 2af22fb4e878750b88f80f90d439b316d229796f)
Matt Johnston <matt@ucc.asn.au>
parents: 285
diff changeset
579 /* #define LTC_VALGRIND */
0cbe8f6dbf9e propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 2af22fb4e878750b88f80f90d439b316d229796f)
Matt Johnston <matt@ucc.asn.au>
parents: 285
diff changeset
580
0cbe8f6dbf9e propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 2af22fb4e878750b88f80f90d439b316d229796f)
Matt Johnston <matt@ucc.asn.au>
parents: 285
diff changeset
581 #endif
0cbe8f6dbf9e propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 2af22fb4e878750b88f80f90d439b316d229796f)
Matt Johnston <matt@ucc.asn.au>
parents: 285
diff changeset
582
1471
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
583 #ifndef LTC_NO_FILE
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
584 /* buffer size for reading from a file via fread(..) */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
585 #ifndef LTC_FILE_READ_BUFSIZE
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
586 #define LTC_FILE_READ_BUFSIZE 8192
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
587 #endif
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
588 #endif
285
1b9e69c058d2 propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
589
1471
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
590 /* ref: $Format:%D$ */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
591 /* git commit: $Format:%H$ */
6dba84798cd5 Update to libtomcrypt 1.18.1, merged with Dropbear changes
Matt Johnston <matt@ucc.asn.au>
parents: 1435
diff changeset
592 /* commit time: $Format:%ai$ */