user_settings_stm32.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671
  1. /* wolfSSL_conf.h (example of generated wolfSSL.I-CUBE-wolfSSL_conf.h using
  2. * default_conf.ftl and STM32CubeIDE or STM32CubeMX tool)
  3. *
  4. * Copyright (C) 2006-2023 wolfSSL Inc.
  5. *
  6. * This file is part of wolfSSL.
  7. *
  8. * wolfSSL is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * wolfSSL is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
  21. */
  22. /* STM32 Cube Sample Configuration File
  23. * Generated automatically using `default_conf.ftl` template
  24. *
  25. * Included automatically when USE_HAL_DRIVER is defined
  26. * (and not WOLFSSL_USER_SETTINGS or HAVE_CONFIG_H).
  27. */
  28. #ifndef __WOLFSSL_I_CUBE_WOLFSSL_CONF_H__
  29. #define __WOLFSSL_I_CUBE_WOLFSSL_CONF_H__
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33. /*---------- WOLF_CONF_DEBUG -----------*/
  34. #define WOLF_CONF_DEBUG 0
  35. /*---------- WOLF_CONF_WOLFCRYPT_ONLY -----------*/
  36. #define WOLF_CONF_WOLFCRYPT_ONLY 0
  37. /*---------- WOLF_CONF_TLS13 -----------*/
  38. #define WOLF_CONF_TLS13 1
  39. /*---------- WOLF_CONF_TLS12 -----------*/
  40. #define WOLF_CONF_TLS12 1
  41. /*---------- WOLF_CONF_DTLS -----------*/
  42. #define WOLF_CONF_DTLS 0
  43. /*---------- WOLF_CONF_MATH -----------*/
  44. #define WOLF_CONF_MATH 4
  45. /*---------- WOLF_CONF_RTOS -----------*/
  46. #define WOLF_CONF_RTOS 2
  47. /*---------- WOLF_CONF_RNG -----------*/
  48. #define WOLF_CONF_RNG 1
  49. /*---------- WOLF_CONF_RSA -----------*/
  50. #define WOLF_CONF_RSA 1
  51. /*---------- WOLF_CONF_ECC -----------*/
  52. #define WOLF_CONF_ECC 1
  53. /*---------- WOLF_CONF_DH -----------*/
  54. #define WOLF_CONF_DH 1
  55. /*---------- WOLF_CONF_AESGCM -----------*/
  56. #define WOLF_CONF_AESGCM 1
  57. /*---------- WOLF_CONF_AESCBC -----------*/
  58. #define WOLF_CONF_AESCBC 0
  59. /*---------- WOLF_CONF_CHAPOLY -----------*/
  60. #define WOLF_CONF_CHAPOLY 1
  61. /*---------- WOLF_CONF_EDCURVE25519 -----------*/
  62. #define WOLF_CONF_EDCURVE25519 0
  63. /*---------- WOLF_CONF_MD5 -----------*/
  64. #define WOLF_CONF_MD5 0
  65. /*---------- WOLF_CONF_SHA1 -----------*/
  66. #define WOLF_CONF_SHA1 0
  67. /*---------- WOLF_CONF_SHA2_224 -----------*/
  68. #define WOLF_CONF_SHA2_224 0
  69. /*---------- WOLF_CONF_SHA2_256 -----------*/
  70. #define WOLF_CONF_SHA2_256 1
  71. /*---------- WOLF_CONF_SHA2_384 -----------*/
  72. #define WOLF_CONF_SHA2_384 0
  73. /*---------- WOLF_CONF_SHA2_512 -----------*/
  74. #define WOLF_CONF_SHA2_512 0
  75. /*---------- WOLF_CONF_SHA3 -----------*/
  76. #define WOLF_CONF_SHA3 0
  77. /*---------- WOLF_CONF_PSK -----------*/
  78. #define WOLF_CONF_PSK 0
  79. /*---------- WOLF_CONF_PWDBASED -----------*/
  80. #define WOLF_CONF_PWDBASED 0
  81. /*---------- WOLF_CONF_KEEP_PEER_CERT -----------*/
  82. #define WOLF_CONF_KEEP_PEER_CERT 0
  83. /*---------- WOLF_CONF_BASE64_ENCODE -----------*/
  84. #define WOLF_CONF_BASE64_ENCODE 0
  85. /*---------- WOLF_CONF_OPENSSL_EXTRA -----------*/
  86. #define WOLF_CONF_OPENSSL_EXTRA 0
  87. /*---------- WOLF_CONF_TEST -----------*/
  88. #define WOLF_CONF_TEST 1
  89. /*---------- WOLF_CONF_PQM4 -----------*/
  90. #define WOLF_CONF_PQM4 0
  91. /* ------------------------------------------------------------------------- */
  92. /* Hardware platform */
  93. /* ------------------------------------------------------------------------- */
  94. /* Setup default (No crypto hardware acceleration or TLS UART test).
  95. * Use undef in platform section to enable it.
  96. */
  97. #define NO_STM32_HASH
  98. #define NO_STM32_CRYPTO
  99. #define NO_TLS_UART_TEST
  100. #if defined(STM32WB55xx)
  101. #define WOLFSSL_STM32WB
  102. #define WOLFSSL_STM32_PKA
  103. #undef NO_STM32_CRYPTO
  104. #define HAL_CONSOLE_UART huart1
  105. #elif defined(STM32WL55xx)
  106. #define WOLFSSL_STM32WL
  107. #define WOLFSSL_STM32_PKA
  108. #undef NO_STM32_CRYPTO
  109. #define HAL_CONSOLE_UART huart2
  110. #elif defined(STM32F407xx)
  111. #define WOLFSSL_STM32F4
  112. #define HAL_CONSOLE_UART huart2
  113. #elif defined(STM32F437xx)
  114. #define WOLFSSL_STM32F4
  115. #undef NO_STM32_HASH
  116. #undef NO_STM32_CRYPTO
  117. #define STM32_HAL_V2
  118. #define HAL_CONSOLE_UART huart4
  119. #elif defined(STM32F777xx)
  120. #define WOLFSSL_STM32F7
  121. #undef NO_STM32_HASH
  122. #undef NO_STM32_CRYPTO
  123. #define STM32_HAL_V2
  124. #define HAL_CONSOLE_UART huart2
  125. #elif defined(STM32F756xx)
  126. #define WOLFSSL_STM32F7
  127. #undef NO_STM32_HASH
  128. #undef NO_STM32_CRYPTO
  129. #define STM32_HAL_V2
  130. #define HAL_CONSOLE_UART huart3
  131. #elif defined(STM32H753xx)
  132. #define WOLFSSL_STM32H7
  133. #undef NO_STM32_HASH
  134. #undef NO_STM32_CRYPTO
  135. #define HAL_CONSOLE_UART huart3
  136. #elif defined(STM32H723xx)
  137. #define WOLFSSL_STM32H7
  138. #define HAL_CONSOLE_UART huart3
  139. #elif defined(STM32L4A6xx)
  140. #define WOLFSSL_STM32L4
  141. #undef NO_STM32_HASH
  142. #undef NO_STM32_CRYPTO
  143. #define HAL_CONSOLE_UART hlpuart1
  144. #elif defined(STM32L475xx)
  145. #define WOLFSSL_STM32L4
  146. #define HAL_CONSOLE_UART huart1
  147. #elif defined(STM32L562xx)
  148. #define WOLFSSL_STM32L5
  149. #define WOLFSSL_STM32_PKA
  150. #undef NO_STM32_HASH
  151. #undef NO_STM32_CRYPTO
  152. #define HAL_CONSOLE_UART huart1
  153. #elif defined(STM32L552xx)
  154. #define WOLFSSL_STM32L5
  155. #undef NO_STM32_HASH
  156. #define HAL_CONSOLE_UART hlpuart1
  157. #elif defined(STM32F207xx)
  158. #define WOLFSSL_STM32F2
  159. #define HAL_CONSOLE_UART huart3
  160. #elif defined(STM32F217xx)
  161. #define WOLFSSL_STM32F2
  162. #define HAL_CONSOLE_UART huart2
  163. #elif defined(STM32F107xC)
  164. #define WOLFSSL_STM32F1
  165. #define HAL_CONSOLE_UART huart4
  166. #define NO_STM32_RNG
  167. #elif defined(STM32F401xE)
  168. #define WOLFSSL_STM32F4
  169. #define HAL_CONSOLE_UART huart2
  170. #define NO_STM32_RNG
  171. #define WOLFSSL_GENSEED_FORTEST /* no HW RNG is available use test seed */
  172. #elif defined(STM32G071xx)
  173. #define WOLFSSL_STM32G0
  174. #define HAL_CONSOLE_UART huart2
  175. #define NO_STM32_RNG
  176. #define WOLFSSL_GENSEED_FORTEST /* no HW RNG is available use test seed */
  177. #elif defined(STM32U575xx) || defined(STM32U585xx)
  178. #define HAL_CONSOLE_UART huart1
  179. #define WOLFSSL_STM32U5
  180. #define STM32_HAL_V2
  181. #ifdef STM32U585xx
  182. #undef NO_STM32_HASH
  183. #undef NO_STM32_CRYPTO
  184. #define WOLFSSL_STM32_PKA
  185. #endif
  186. #elif defined(STM32H563xx)
  187. #define WOLFSSL_STM32H5
  188. #define HAL_CONSOLE_UART huart3
  189. #define STM32_HAL_V2
  190. #undef NO_STM32_HASH
  191. #else
  192. #warning Please define a hardware platform!
  193. /* This means there is not a pre-defined platform for your board/CPU */
  194. /* You need to define a CPU type, HW crypto and debug UART */
  195. /* CPU Type: WOLFSSL_STM32F1, WOLFSSL_STM32F2, WOLFSSL_STM32F4,
  196. WOLFSSL_STM32F7, WOLFSSL_STM32H7, WOLFSSL_STM32L4, WOLFSSL_STM32L5,
  197. WOLFSSL_STM32G0, WOLFSSL_STM32WB and WOLFSSL_STM32U5 */
  198. #define WOLFSSL_STM32F4
  199. /* Debug UART used for printf */
  200. /* The UART interface number varies for each board/CPU */
  201. /* Typically this is the UART attached to the ST-Link USB CDC UART port */
  202. #define HAL_CONSOLE_UART huart4
  203. /* Hardware Crypto - uncomment as available on hardware */
  204. //#define WOLFSSL_STM32_PKA
  205. //#define NO_STM32_RNG
  206. //#undef NO_STM32_HASH
  207. //#undef NO_STM32_CRYPTO
  208. /* if no HW RNG is available use test seed */
  209. //#define WOLFSSL_GENSEED_FORTEST
  210. //#define STM32_HAL_V2
  211. #endif
  212. /* ------------------------------------------------------------------------- */
  213. /* Platform */
  214. /* ------------------------------------------------------------------------- */
  215. #define SIZEOF_LONG_LONG 8
  216. #define WOLFSSL_GENERAL_ALIGNMENT 4
  217. #define WOLFSSL_STM32_CUBEMX
  218. #define WOLFSSL_SMALL_STACK
  219. #define WOLFSSL_USER_IO
  220. #define WOLFSSL_NO_SOCK
  221. #define WOLFSSL_IGNORE_FILE_WARN
  222. /* ------------------------------------------------------------------------- */
  223. /* Operating System */
  224. /* ------------------------------------------------------------------------- */
  225. #if defined(WOLF_CONF_RTOS) && WOLF_CONF_RTOS == 2
  226. #define FREERTOS
  227. #else
  228. #define SINGLE_THREADED
  229. #endif
  230. /* ------------------------------------------------------------------------- */
  231. /* Math Configuration */
  232. /* ------------------------------------------------------------------------- */
  233. /* 1=Fast (stack)
  234. * 2=Normal (heap)
  235. * 3=Single Precision C (only common curves/key sizes)
  236. * 4=Single Precision ASM Cortex-M3+
  237. * 5=Single Precision ASM Cortex-M0 (Generic Thumb)
  238. * 6=Single Precision C all small
  239. * 7=Single Precision C all big
  240. */
  241. #if defined(WOLF_CONF_MATH) && WOLF_CONF_MATH == 1
  242. /* fast (stack) math - tfm.c */
  243. #define USE_FAST_MATH
  244. #define TFM_TIMING_RESISTANT
  245. /* Optimizations (TFM_ARM, TFM_ASM or none) */
  246. //#define TFM_NO_ASM
  247. //#define TFM_ASM
  248. #elif defined(WOLF_CONF_MATH) && WOLF_CONF_MATH == 2
  249. /* heap math - integer.c */
  250. #define USE_INTEGER_HEAP_MATH
  251. #elif defined(WOLF_CONF_MATH) && (WOLF_CONF_MATH >= 3)
  252. /* single precision only */
  253. #define WOLFSSL_SP
  254. #if WOLF_CONF_MATH != 7
  255. #define WOLFSSL_SP_SMALL /* use smaller version of code */
  256. #endif
  257. #if defined(WOLF_CONF_RSA) && WOLF_CONF_RSA == 1
  258. #define WOLFSSL_HAVE_SP_RSA
  259. #endif
  260. #if defined(WOLF_CONF_DH) && WOLF_CONF_DH == 1
  261. #define WOLFSSL_HAVE_SP_DH
  262. #endif
  263. #if defined(WOLF_CONF_ECC) && WOLF_CONF_ECC == 1
  264. #define WOLFSSL_HAVE_SP_ECC
  265. #endif
  266. #if WOLF_CONF_MATH == 6 || WOLF_CONF_MATH == 7
  267. #define WOLFSSL_SP_MATH_ALL /* use sp_int.c multi precision math */
  268. #else
  269. #define WOLFSSL_SP_MATH /* disable non-standard curves / key sizes */
  270. #endif
  271. #define SP_WORD_SIZE 32
  272. /* Enable to put all math on stack (no heap) */
  273. //#define WOLFSSL_SP_NO_MALLOC
  274. #if WOLF_CONF_MATH == 4 || WOLF_CONF_MATH == 5
  275. #define WOLFSSL_SP_ASM /* required if using the ASM versions */
  276. #if WOLF_CONF_MATH == 4
  277. /* ARM Cortex-M3+ */
  278. #define WOLFSSL_SP_ARM_CORTEX_M_ASM
  279. #endif
  280. #if WOLF_CONF_MATH == 5
  281. /* Generic ARM Thumb (Cortex-M0) Assembly */
  282. #define WOLFSSL_SP_ARM_THUMB_ASM
  283. #endif
  284. #endif
  285. #endif
  286. /* ------------------------------------------------------------------------- */
  287. /* Enable Features */
  288. /* ------------------------------------------------------------------------- */
  289. /* Required for TLS */
  290. #define HAVE_TLS_EXTENSIONS
  291. #define HAVE_SUPPORTED_CURVES
  292. #define HAVE_ENCRYPT_THEN_MAC
  293. #define HAVE_EXTENDED_MASTER
  294. #if defined(WOLF_CONF_TLS13) && WOLF_CONF_TLS13 == 1
  295. #define WOLFSSL_TLS13
  296. #define HAVE_HKDF
  297. #endif
  298. #if defined(WOLF_CONF_DTLS) && WOLF_CONF_DTLS == 1
  299. #define WOLFSSL_DTLS
  300. #endif
  301. #if defined(WOLF_CONF_PSK) && WOLF_CONF_PSK == 0
  302. #define NO_PSK
  303. #endif
  304. #if defined(WOLF_CONF_PWDBASED) && WOLF_CONF_PWDBASED == 0
  305. #define NO_PWDBASED
  306. #endif
  307. #if defined(WOLF_CONF_KEEP_PEER_CERT) && WOLF_CONF_KEEP_PEER_CERT == 1
  308. #define KEEP_PEER_CERT
  309. #endif
  310. #if defined(WOLF_CONF_BASE64_ENCODE) && WOLF_CONF_BASE64_ENCODE == 1
  311. #define WOLFSSL_BASE64_ENCODE
  312. #endif
  313. #if defined(WOLF_CONF_OPENSSL_EXTRA) && WOLF_CONF_OPENSSL_EXTRA >= 1
  314. #define OPENSSL_EXTRA
  315. #if !defined(INT_MAX)
  316. #include <limits.h>
  317. #endif
  318. #endif
  319. #if defined(WOLF_CONF_OPENSSL_EXTRA) && WOLF_CONF_OPENSSL_EXTRA >= 2
  320. #define OPENSSL_ALL
  321. #endif
  322. /* TLS Session Cache */
  323. #if 0
  324. #define SMALL_SESSION_CACHE
  325. #else
  326. #define NO_SESSION_CACHE
  327. #endif
  328. /* Post Quantum
  329. * Note: PQM4 is compatible with STM32. The project can be found at:
  330. * https://github.com/mupq/pqm4
  331. */
  332. #if defined(WOLF_CONF_PQM4) && WOLF_CONF_PQM4 == 1
  333. #define HAVE_PQM4
  334. #endif
  335. /* ------------------------------------------------------------------------- */
  336. /* Crypto */
  337. /* ------------------------------------------------------------------------- */
  338. /* RSA */
  339. #undef NO_RSA
  340. #if defined(WOLF_CONF_RSA) && WOLF_CONF_RSA == 1
  341. #ifdef USE_FAST_MATH
  342. /* Maximum math bits (Max RSA key bits * 2) */
  343. #undef FP_MAX_BITS
  344. #define FP_MAX_BITS 4096
  345. #endif
  346. /* half as much memory but twice as slow */
  347. #undef RSA_LOW_MEM
  348. //#define RSA_LOW_MEM
  349. /* Enables blinding mode, to prevent timing attacks */
  350. #undef WC_RSA_BLINDING
  351. #define WC_RSA_BLINDING
  352. /* RSA PSS Support (required for TLS v1.3) */
  353. #ifdef WOLFSSL_TLS13
  354. #define WC_RSA_PSS
  355. #endif
  356. #else
  357. #define NO_RSA
  358. #endif
  359. /* ECC */
  360. #undef HAVE_ECC
  361. #if defined(WOLF_CONF_ECC) && WOLF_CONF_ECC == 1
  362. #define HAVE_ECC
  363. /* Manually define enabled curves */
  364. #define ECC_USER_CURVES
  365. //#define HAVE_ECC192
  366. //#define HAVE_ECC224
  367. #undef NO_ECC256
  368. //#define HAVE_ECC384
  369. //#define HAVE_ECC521
  370. /* Fixed point cache (speeds repeated operations against same private key) */
  371. #undef FP_ECC
  372. //#define FP_ECC
  373. #ifdef FP_ECC
  374. /* Bits / Entries */
  375. #undef FP_ENTRIES
  376. #define FP_ENTRIES 2
  377. #undef FP_LUT
  378. #define FP_LUT 4
  379. #endif
  380. /* Optional ECC calculation method */
  381. /* Note: doubles heap usage, but slightly faster */
  382. #undef ECC_SHAMIR
  383. #define ECC_SHAMIR
  384. /* Reduces heap usage, but slower */
  385. #define ECC_TIMING_RESISTANT
  386. /* Compressed ECC key support */
  387. //#define HAVE_COMP_KEY
  388. #ifdef USE_FAST_MATH
  389. #ifdef NO_RSA
  390. /* Custom fastmath size if not using RSA */
  391. /* MAX = ROUND32(ECC BITS) * 2 */
  392. #define FP_MAX_BITS (256 * 2)
  393. #else
  394. #define ALT_ECC_SIZE
  395. #endif
  396. /* Enable TFM optimizations for ECC */
  397. //#define TFM_ECC192
  398. //#define TFM_ECC224
  399. //#define TFM_ECC256
  400. //#define TFM_ECC384
  401. //#define TFM_ECC521
  402. #endif
  403. #endif
  404. /* DH */
  405. #undef NO_DH
  406. #if defined(WOLF_CONF_DH) && WOLF_CONF_DH == 1
  407. #define HAVE_DH /* freeRTOS settings.h requires this */
  408. #define HAVE_FFDHE_2048
  409. #define HAVE_DH_DEFAULT_PARAMS
  410. #else
  411. #define NO_DH
  412. #endif
  413. /* AES */
  414. #if defined(WOLF_CONF_AESGCM) && WOLF_CONF_AESGCM == 1
  415. #define HAVE_AESGCM
  416. /* GCM Method: GCM_SMALL, GCM_WORD32, GCM_TABLE or GCM_TABLE_4BIT */
  417. /* GCM_TABLE is about 4K larger and 3x faster for GHASH */
  418. #define GCM_SMALL
  419. #define HAVE_AES_DECRYPT
  420. #endif
  421. #if defined(WOLF_CONF_AESCBC) && WOLF_CONF_AESCBC == 1
  422. #define HAVE_AES_CBC
  423. #define HAVE_AES_DECRYPT
  424. #endif
  425. /* Other possible AES modes */
  426. //#define WOLFSSL_AES_COUNTER
  427. //#define HAVE_AESCCM
  428. //#define WOLFSSL_AES_XTS
  429. //#define WOLFSSL_AES_DIRECT
  430. //#define HAVE_AES_ECB
  431. //#define HAVE_AES_KEYWRAP
  432. //#define AES_MAX_KEY_SIZE 256
  433. /* ChaCha20 / Poly1305 */
  434. #undef HAVE_CHACHA
  435. #undef HAVE_POLY1305
  436. #if defined(WOLF_CONF_CHAPOLY) && WOLF_CONF_CHAPOLY == 1
  437. #define HAVE_CHACHA
  438. #define HAVE_POLY1305
  439. /* Needed for Poly1305 */
  440. #undef HAVE_ONE_TIME_AUTH
  441. #define HAVE_ONE_TIME_AUTH
  442. #endif
  443. /* Ed25519 / Curve25519 */
  444. #undef HAVE_CURVE25519
  445. #undef HAVE_ED25519
  446. #if defined(WOLF_CONF_EDCURVE25519) && WOLF_CONF_EDCURVE25519 == 1
  447. #define HAVE_CURVE25519
  448. #define HAVE_ED25519
  449. /* Optionally use small math (less flash usage, but much slower) */
  450. #define CURVED25519_SMALL
  451. #endif
  452. /* ------------------------------------------------------------------------- */
  453. /* Hashing */
  454. /* ------------------------------------------------------------------------- */
  455. /* Sha1 */
  456. #undef NO_SHA
  457. #if defined(WOLF_CONF_SHA1) && WOLF_CONF_SHA1 == 1
  458. /* 1k smaller, but 25% slower */
  459. //#define USE_SLOW_SHA
  460. #else
  461. #define NO_SHA
  462. #endif
  463. /* Sha2-256 */
  464. #undef NO_SHA256
  465. #if defined(WOLF_CONF_SHA2_256) && WOLF_CONF_SHA2_256 == 1
  466. /* not unrolled - ~2k smaller and ~25% slower */
  467. //#define USE_SLOW_SHA256
  468. //#define WOLFSSL_SHAKE256
  469. /* Sha2-224 */
  470. #if defined(WOLF_CONF_SHA2_224) && WOLF_CONF_SHA2_224 == 1
  471. #define WOLFSSL_SHA224
  472. #endif
  473. #else
  474. #define NO_SHA256
  475. #endif
  476. /* Sha2-512 */
  477. #undef WOLFSSL_SHA512
  478. #if defined(WOLF_CONF_SHA2_512) && WOLF_CONF_SHA2_512 == 1
  479. /* over twice as small, but 50% slower */
  480. //#define USE_SLOW_SHA512
  481. #define WOLFSSL_SHA512
  482. #define HAVE_SHA512 /* freeRTOS settings.h requires this */
  483. #endif
  484. /* Sha2-384 */
  485. #undef WOLFSSL_SHA384
  486. #if defined(WOLF_CONF_SHA2_384) && WOLF_CONF_SHA2_384 == 1
  487. #define WOLFSSL_SHA384
  488. #endif
  489. /* Sha3 */
  490. #undef WOLFSSL_SHA3
  491. #if defined(WOLF_CONF_SHA3) && WOLF_CONF_SHA3 == 1
  492. #define WOLFSSL_SHA3
  493. #endif
  494. /* MD5 */
  495. #if defined(WOLF_CONF_MD5) && WOLF_CONF_MD5 == 1
  496. /* enabled */
  497. #else
  498. #define NO_MD5
  499. #endif
  500. /* ------------------------------------------------------------------------- */
  501. /* Benchmark / Test */
  502. /* ------------------------------------------------------------------------- */
  503. /* Use reduced benchmark / test sizes */
  504. #define BENCH_EMBEDDED
  505. #define USE_CERT_BUFFERS_2048
  506. #define USE_CERT_BUFFERS_256
  507. /* ------------------------------------------------------------------------- */
  508. /* Debugging */
  509. /* ------------------------------------------------------------------------- */
  510. #if defined(WOLF_CONF_DEBUG) && WOLF_CONF_DEBUG == 1
  511. #define DEBUG_WOLFSSL
  512. /* Use this to measure / print heap usage */
  513. #if 0
  514. #define USE_WOLFSSL_MEMORY
  515. #define WOLFSSL_TRACK_MEMORY
  516. #define WOLFSSL_DEBUG_MEMORY
  517. #define WOLFSSL_DEBUG_MEMORY_PRINT
  518. #endif
  519. #else
  520. //#define NO_WOLFSSL_MEMORY
  521. //#define NO_ERROR_STRINGS
  522. #endif
  523. /* ------------------------------------------------------------------------- */
  524. /* Port */
  525. /* ------------------------------------------------------------------------- */
  526. /* Override Current Time */
  527. /* Allows custom "custom_time()" function to be used for benchmark */
  528. #define WOLFSSL_USER_CURRTIME
  529. /* ------------------------------------------------------------------------- */
  530. /* RNG */
  531. /* ------------------------------------------------------------------------- */
  532. #define NO_OLD_RNGNAME /* conflicts with STM RNG macro */
  533. #if !defined(WOLF_CONF_RNG) || WOLF_CONF_RNG == 1
  534. /* default is enabled */
  535. #define HAVE_HASHDRBG
  536. #else /* WOLF_CONF_RNG == 0 */
  537. #define WC_NO_HASHDRBG
  538. #define WC_NO_RNG
  539. #endif
  540. /* ------------------------------------------------------------------------- */
  541. /* Disable Features */
  542. /* ------------------------------------------------------------------------- */
  543. #if defined(WOLF_CONF_TLS12) && WOLF_CONF_TLS12 == 0
  544. #define WOLFSSL_NO_TLS12
  545. #endif
  546. #if defined(WOLF_CONF_WOLFCRYPT_ONLY) && WOLF_CONF_WOLFCRYPT_ONLY == 1
  547. #define WOLFCRYPT_ONLY
  548. #endif
  549. //#define NO_WOLFSSL_SERVER
  550. //#define NO_WOLFSSL_CLIENT
  551. #if defined(WOLF_CONF_TEST) && WOLF_CONF_TEST == 0
  552. #define NO_CRYPT_TEST
  553. #define NO_CRYPT_BENCHMARK
  554. #endif
  555. #define NO_FILESYSTEM
  556. #define NO_WRITEV
  557. #define NO_MAIN_DRIVER
  558. #define NO_DEV_RANDOM
  559. #define NO_OLD_TLS
  560. #define WOLFSSL_NO_CLIENT_AUTH /* disable client auth for Ed25519/Ed448 */
  561. #define NO_DSA
  562. #define NO_RC4
  563. #define NO_MD4
  564. #define NO_DES3
  565. /* In-lining of misc.c functions */
  566. /* If defined, must include wolfcrypt/src/misc.c in build */
  567. /* Slower, but about 1k smaller */
  568. //#define NO_INLINE
  569. /* Base16 / Base64 encoding */
  570. //#define NO_CODING
  571. /* bypass certificate date checking, due to lack of properly configured RTC source */
  572. #ifndef HAL_RTC_MODULE_ENABLED
  573. #define NO_ASN_TIME
  574. #endif
  575. #ifdef __cplusplus
  576. }
  577. #endif
  578. #endif /* __WOLFSSL_I_CUBE_WOLFSSL_CONF_H__ */