user_settings.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505
  1. /* Example custom user settings for wolfSSL and INtime RTOS port */
  2. #ifndef WOLFSSL_USER_SETTINGS_H
  3. #define WOLFSSL_USER_SETTINGS_H
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. /* ------------------------------------------------------------------------- */
  8. /* Port - Platform */
  9. /* ------------------------------------------------------------------------- */
  10. #undef INTIME_RTOS
  11. #define INTIME_RTOS
  12. #undef WOLF_EXAMPLES_STACK
  13. #define WOLF_EXAMPLES_STACK (1<<17)
  14. #undef WOLFSSL_GENERAL_ALIGNMENT
  15. #define WOLFSSL_GENERAL_ALIGNMENT 4
  16. /* platform already has min()/max() */
  17. #undef WOLFSSL_HAVE_MIN
  18. #define WOLFSSL_HAVE_MIN
  19. #undef WOLFSSL_HAVE_MAX
  20. #define WOLFSSL_HAVE_MAX
  21. /* disable directory support */
  22. #undef NO_WOLFSSL_DIR
  23. //#define NO_WOLFSSL_DIR
  24. /* disable writev */
  25. #undef NO_WRITEV
  26. #define NO_WRITEV
  27. /* we provide main entry point */
  28. #undef NO_MAIN_DRIVER
  29. #define NO_MAIN_DRIVER
  30. /* if using in single threaded mode */
  31. #undef SINGLE_THREADED
  32. //#define SINGLE_THREADED
  33. /* Note: HAVE_THREAD_LS is not support for INtime RTOS */
  34. /* reduces stack usage, by using malloc/free for stack variables over 100 bytes */
  35. #undef WOLFSSL_SMALL_STACK
  36. //#define WOLFSSL_SMALL_STACK
  37. /* ------------------------------------------------------------------------- */
  38. /* Math Configuration */
  39. /* ------------------------------------------------------------------------- */
  40. /* fast math uses stack and inline assembly to speed up math */
  41. #undef USE_FAST_MATH
  42. #define USE_FAST_MATH
  43. #ifdef USE_FAST_MATH
  44. /* timing resistance for side-channel attack protection */
  45. #undef TFM_TIMING_RESISTANT
  46. #define TFM_TIMING_RESISTANT
  47. #endif
  48. /* ------------------------------------------------------------------------- */
  49. /* Crypto */
  50. /* ------------------------------------------------------------------------- */
  51. /* ECC */
  52. #if 1
  53. #undef HAVE_ECC
  54. #define HAVE_ECC
  55. /* Support for custom curves */
  56. #define WOLFSSL_CUSTOM_CURVES
  57. /* Curve types */
  58. //#define NO_ECC_SECP
  59. #define HAVE_ECC_SECPR2
  60. #define HAVE_ECC_SECPR3
  61. #define HAVE_ECC_BRAINPOOL
  62. #define HAVE_ECC_KOBLITZ
  63. /* Curve sizes */
  64. #undef HAVE_ALL_CURVES
  65. //#define HAVE_ALL_CURVES
  66. #ifndef HAVE_ALL_CURVES
  67. /* allows enabling custom curve sizes */
  68. #undef ECC_USER_CURVES
  69. #define ECC_USER_CURVES
  70. //#define HAVE_ECC112
  71. //#define HAVE_ECC128
  72. //#define HAVE_ECC160
  73. #define HAVE_ECC192
  74. #define HAVE_ECC224
  75. //#define NO_ECC256
  76. #define HAVE_ECC384
  77. #define HAVE_ECC521
  78. #endif
  79. /* Fixed point cache (speeds repeated operations against same private key) */
  80. #undef FP_ECC
  81. #define FP_ECC
  82. #ifdef FP_ECC
  83. /* Bits / Entries */
  84. #undef FP_ENTRIES
  85. #define FP_ENTRIES 2
  86. #undef FP_LUT
  87. #define FP_LUT 4
  88. #endif
  89. /* Optional ECC calculation method */
  90. /* Note: doubles heap usage, but slightly faster */
  91. #undef ECC_SHAMIR
  92. #define ECC_SHAMIR
  93. /* Reduces heap usage, but slower */
  94. /* timing resistance for side-channel attack protection */
  95. #undef ECC_TIMING_RESISTANT
  96. #define ECC_TIMING_RESISTANT
  97. #ifdef USE_FAST_MATH
  98. /* use reduced size math buffers for ecc points */
  99. #undef ALT_ECC_SIZE
  100. #define ALT_ECC_SIZE
  101. /* Enable TFM optimizations for ECC */
  102. #if defined(HAVE_ECC192) || defined(HAVE_ALL_CURVES)
  103. #define TFM_ECC192
  104. #endif
  105. #if defined(HAVE_ECC224) || defined(HAVE_ALL_CURVES)
  106. #define TFM_ECC224
  107. #endif
  108. #if !defined(NO_ECC256) || defined(HAVE_ALL_CURVES)
  109. #define TFM_ECC256
  110. #endif
  111. #if defined(HAVE_ECC384) || defined(HAVE_ALL_CURVES)
  112. #define TFM_ECC384
  113. #endif
  114. #if defined(HAVE_ECC521) || defined(HAVE_ALL_CURVES)
  115. #define TFM_ECC521
  116. #endif
  117. #endif
  118. #endif
  119. /* RSA */
  120. #undef NO_RSA
  121. #if 1
  122. #ifdef USE_FAST_MATH
  123. /* Maximum math bits (Max RSA key bits * 2) */
  124. #undef FP_MAX_BITS
  125. #define FP_MAX_BITS 4096
  126. #endif
  127. /* half as much memory but twice as slow */
  128. #undef RSA_LOW_MEM
  129. //#define RSA_LOW_MEM
  130. /* RSA blinding countermeasures */
  131. #undef WC_RSA_BLINDING
  132. #define WC_RSA_BLINDING
  133. #else
  134. #define NO_RSA
  135. #endif
  136. /* AES */
  137. #undef NO_AES
  138. #if 1
  139. #undef HAVE_AESGCM
  140. #define HAVE_AESGCM
  141. #ifdef HAVE_AESGCM
  142. /* GCM Method: GCM_SMALL, GCM_WORD32 or GCM_TABLE */
  143. //#define GCM_SMALL
  144. #define GCM_TABLE
  145. #endif
  146. #undef WOLFSSL_AES_COUNTER
  147. #define WOLFSSL_AES_COUNTER
  148. #undef HAVE_AESCCM
  149. #define HAVE_AESCCM
  150. #undef WOLFSSL_AES_DIRECT
  151. #define WOLFSSL_AES_DIRECT
  152. #undef HAVE_AES_KEYWRAP
  153. #define HAVE_AES_KEYWRAP
  154. #else
  155. #define NO_AES
  156. #endif
  157. /* ChaCha20 / Poly1305 */
  158. #undef HAVE_CHACHA
  159. #undef HAVE_POLY1305
  160. #if 1
  161. #define HAVE_CHACHA
  162. #define HAVE_POLY1305
  163. /* Needed for Poly1305 */
  164. #undef HAVE_ONE_TIME_AUTH
  165. #define HAVE_ONE_TIME_AUTH
  166. #endif
  167. /* Ed25519 / Curve25519 */
  168. #undef HAVE_CURVE25519
  169. #undef HAVE_ED25519
  170. #if 1
  171. #define HAVE_CURVE25519
  172. #define HAVE_ED25519
  173. /* Optionally use small math (less flash usage, but much slower) */
  174. #if 0
  175. #define CURVED25519_SMALL
  176. #endif
  177. #endif
  178. /* ------------------------------------------------------------------------- */
  179. /* Hashing */
  180. /* ------------------------------------------------------------------------- */
  181. /* Sha */
  182. #undef NO_SHA
  183. #if 1
  184. /* 1k smaller, but 25% slower */
  185. //#define USE_SLOW_SHA
  186. #else
  187. #define NO_SHA
  188. #endif
  189. /* Sha256 */
  190. #undef NO_SHA256
  191. #if 1
  192. #else
  193. #define NO_SHA256
  194. #endif
  195. /* Sha512 */
  196. #undef WOLFSSL_SHA512
  197. #if 1
  198. #define WOLFSSL_SHA512
  199. /* Sha384 */
  200. #undef WOLFSSL_SHA384
  201. #if 1
  202. #define WOLFSSL_SHA384
  203. #endif
  204. /* over twice as small, but 50% slower */
  205. //#define USE_SLOW_SHA2
  206. #endif
  207. /* MD5 */
  208. #undef NO_MD5
  209. #if 1
  210. #else
  211. #define NO_MD5
  212. #endif
  213. /* ------------------------------------------------------------------------- */
  214. /* Enable Features */
  215. /* ------------------------------------------------------------------------- */
  216. #undef KEEP_PEER_CERT
  217. #define KEEP_PEER_CERT
  218. #undef HAVE_COMP_KEY
  219. #define HAVE_COMP_KEY
  220. #undef HAVE_ECC_ENCRYPT
  221. #define HAVE_ECC_ENCRYPT
  222. #undef HAVE_TLS_EXTENSIONS
  223. #define HAVE_TLS_EXTENSIONS
  224. #undef HAVE_SUPPORTED_CURVES
  225. #define HAVE_SUPPORTED_CURVES
  226. #undef HAVE_EXTENDED_MASTER
  227. #define HAVE_EXTENDED_MASTER
  228. #undef WOLFSSL_DTLS
  229. #define WOLFSSL_DTLS
  230. #undef OPENSSL_EXTRA
  231. #define OPENSSL_EXTRA
  232. #undef WOLFSSL_BASE64_ENCODE
  233. #define WOLFSSL_BASE64_ENCODE
  234. #undef HAVE_HKDF
  235. #define HAVE_HKDF
  236. #undef WOLFSSL_CMAC
  237. #define WOLFSSL_CMAC
  238. #undef WOLFSSL_KEY_GEN
  239. #define WOLFSSL_KEY_GEN
  240. #undef WOLFSSL_CERT_GEN
  241. #define WOLFSSL_CERT_GEN
  242. #undef WOLFSSL_CERT_REQ
  243. #define WOLFSSL_CERT_REQ
  244. #undef WOLFSSL_CERT_EXT
  245. #define WOLFSSL_CERT_EXT
  246. #undef HAVE_PK_CALLBACKS
  247. #define HAVE_PK_CALLBACKS
  248. #undef HAVE_ALPN
  249. #define HAVE_ALPN
  250. #undef HAVE_SNI
  251. #define HAVE_SNI
  252. #undef HAVE_MAX_FRAGMENT
  253. #define HAVE_MAX_FRAGMENT
  254. #undef HAVE_TRUNCATED_HMAC
  255. #define HAVE_TRUNCATED_HMAC
  256. #undef SESSION_CERTS
  257. #define SESSION_CERTS
  258. #undef HAVE_SESSION_TICKET
  259. #define HAVE_SESSION_TICKET
  260. #undef WOLFCRYPT_HAVE_SRP
  261. #define WOLFCRYPT_HAVE_SRP
  262. #undef WOLFSSL_HAVE_CERT_SERVICE
  263. #define WOLFSSL_HAVE_CERT_SERVICE
  264. #undef HAVE_PKCS7
  265. #define HAVE_PKCS7
  266. #undef HAVE_X963_KDF
  267. #define HAVE_X963_KDF
  268. #undef WOLFSSL_HAVE_WOLFSCEP
  269. #define WOLFSSL_HAVE_WOLFSCEP
  270. #undef WOLFSSL_ALWAYS_KEEP_SNI
  271. #define WOLFSSL_ALWAYS_KEEP_SNI
  272. #undef WOLFSSL_ALWAYS_VERIFY_CB
  273. #define WOLFSSL_ALWAYS_VERIFY_CB
  274. #undef WOLFSSL_SEP
  275. #define WOLFSSL_SEP
  276. #undef ATOMIC_USER
  277. #define ATOMIC_USER
  278. #undef HAVE_OCSP
  279. #define HAVE_OCSP
  280. #undef HAVE_CERTIFICATE_STATUS_REQUEST
  281. #define HAVE_CERTIFICATE_STATUS_REQUEST
  282. #undef HAVE_CERTIFICATE_STATUS_REQUEST_V2
  283. #define HAVE_CERTIFICATE_STATUS_REQUEST_V2
  284. #undef HAVE_CRL
  285. #define HAVE_CRL
  286. #undef PERSIST_CERT_CACHE
  287. //#define PERSIST_CERT_CACHE
  288. #undef PERSIST_SESSION_CACHE
  289. //#define PERSIST_SESSION_CACHE
  290. #undef WOLFSSL_DER_LOAD
  291. //#define WOLFSSL_DER_LOAD
  292. #undef WOLFSSL_DES_ECB
  293. //#define WOLFSSL_DES_ECB
  294. #undef HAVE_CAMELLIA
  295. //#define HAVE_CAMELLIA
  296. #undef HAVE_NULL_CIPHER
  297. //#define HAVE_NULL_CIPHER
  298. #undef WOLFSSL_RIPEMD
  299. //#define WOLFSSL_RIPEMD
  300. /* TLS Session Cache */
  301. #if 1
  302. #define SMALL_SESSION_CACHE
  303. //#define MEDIUM_SESSION_CACHE
  304. //#define BIG_SESSION_CACHE
  305. //#define HUGE_SESSION_CACHE
  306. #else
  307. #define NO_SESSION_CACHE
  308. #endif
  309. /* ------------------------------------------------------------------------- */
  310. /* Disable Features */
  311. /* ------------------------------------------------------------------------- */
  312. #undef NO_WOLFSSL_SERVER
  313. //#define NO_WOLFSSL_SERVER
  314. #undef NO_WOLFSSL_CLIENT
  315. //#define NO_WOLFSSL_CLIENT
  316. /* disables TLS 1.0/1.1 support */
  317. #undef NO_OLD_TLS
  318. //#define NO_OLD_TLS
  319. /* disable access to filesystem */
  320. #undef NO_FILESYSTEM
  321. //#define NO_FILESYSTEM
  322. #undef NO_RC4
  323. #define NO_RC4
  324. #undef NO_MD4
  325. #define NO_MD4
  326. /* Pre-shared keys */
  327. #undef NO_PSK
  328. //#define NO_PSK
  329. #undef NO_DSA
  330. //#define NO_DSA
  331. #undef NO_DH
  332. //#define NO_DH
  333. #undef NO_DES3
  334. //#define NO_DES3
  335. #undef NO_PWDBASED
  336. //#define NO_PWDBASED
  337. /* encoding/decoding support */
  338. #undef NO_CODING
  339. //#define NO_CODING
  340. /* memory wrappers and memory callbacks */
  341. #undef NO_WOLFSSL_MEMORY
  342. //#define NO_WOLFSSL_MEMORY
  343. /* In-lining of misc.c functions */
  344. /* If defined, must include wolfcrypt/src/misc.c in build */
  345. /* Slower, but about 1k smaller */
  346. #undef NO_INLINE
  347. //#define NO_INLINE
  348. /* ------------------------------------------------------------------------- */
  349. /* Benchmark / Test */
  350. /* ------------------------------------------------------------------------- */
  351. #undef NO_CRYPT_TEST
  352. //#define NO_CRYPT_TEST
  353. #undef NO_CRYPT_BENCHMARK
  354. //#define NO_CRYPT_BENCHMARK
  355. /* Use reduced benchmark / test sizes */
  356. #undef BENCH_EMBEDDED
  357. #define BENCH_EMBEDDED
  358. #undef USE_CERT_BUFFERS_2048
  359. #define USE_CERT_BUFFERS_2048
  360. #undef USE_CERT_BUFFERS_256
  361. #define USE_CERT_BUFFERS_256
  362. /* ------------------------------------------------------------------------- */
  363. /* Debugging */
  364. /* ------------------------------------------------------------------------- */
  365. #undef DEBUG_WOLFSSL
  366. //#define DEBUG_WOLFSSL
  367. #ifdef DEBUG_WOLFSSL
  368. /* Use this to measure / print heap usage */
  369. #if 0
  370. #undef USE_WOLFSSL_MEMORY
  371. #define USE_WOLFSSL_MEMORY
  372. #undef WOLFSSL_TRACK_MEMORY
  373. #define WOLFSSL_TRACK_MEMORY
  374. #endif
  375. /* Math debugging (adds support for mp_dump) */
  376. #undef WOLFSSL_DEBUG_MATH
  377. //#define WOLFSSL_DEBUG_MATH
  378. #else
  379. #undef NO_ERROR_STRINGS
  380. //#define NO_ERROR_STRINGS
  381. #endif
  382. #ifdef __cplusplus
  383. }
  384. #endif
  385. #endif /* WOLFSSL_USER_SETTINGS_H */