default_conf.ftl 20 KB

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