settings.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723
  1. /* settings.h
  2. *
  3. * Copyright (C) 2006-2020 wolfSSL Inc.
  4. *
  5. * This file is part of wolfSSL.
  6. *
  7. * wolfSSL is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * wolfSSL is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
  20. */
  21. /* Place OS specific preprocessor flags, defines, includes here, will be
  22. included into every file because types.h includes it */
  23. #ifndef CTAO_CRYPT_SETTINGS_H
  24. #define CTAO_CRYPT_SETTINGS_H
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28. /* Uncomment next line if using IPHONE */
  29. /* #define IPHONE */
  30. /* Uncomment next line if using ThreadX */
  31. /* #define THREADX */
  32. /* Uncomment next line if using Micrium ucOS */
  33. /* #define MICRIUM */
  34. /* Uncomment next line if using Mbed */
  35. /* #define MBED */
  36. /* Uncomment next line if using Microchip PIC32 ethernet starter kit */
  37. /* #define MICROCHIP_PIC32 */
  38. /* Uncomment next line if using Microchip TCP/IP stack, version 5 */
  39. /* #define MICROCHIP_TCPIP_V5 */
  40. /* Uncomment next line if using Microchip TCP/IP stack, version 6 or later */
  41. /* #define MICROCHIP_TCPIP */
  42. /* Uncomment next line if using PIC32MZ Crypto Engine */
  43. /* #define CYASSL_MICROCHIP_PIC32MZ */
  44. /* Uncomment next line if using FreeRTOS */
  45. /* #define FREERTOS */
  46. /* Uncomment next line if using FreeRTOS Windows Simulator */
  47. /* #define FREERTOS_WINSIM */
  48. /* Uncomment next line if using RTIP */
  49. /* #define EBSNET */
  50. /* Uncomment next line if using lwip */
  51. /* #define CYASSL_LWIP */
  52. /* Uncomment next line if building CyaSSL for a game console */
  53. /* #define CYASSL_GAME_BUILD */
  54. /* Uncomment next line if building CyaSSL for LSR */
  55. /* #define CYASSL_LSR */
  56. /* Uncomment next line if building CyaSSL for Freescale MQX/RTCS/MFS */
  57. /* #define FREESCALE_MQX */
  58. /* Uncomment next line if using STM32F2 */
  59. /* #define CYASSL_STM32F2 */
  60. /* Uncomment next line if using QL SEP settings */
  61. /* #define CYASSL_QL */
  62. /* Uncomment next line if building for EROAD */
  63. /* #define CYASSL_EROAD */
  64. /* Uncomment next line if building for IAR EWARM */
  65. /* #define CYASSL_IAR_ARM */
  66. /* Uncomment next line if using TI-RTOS settings */
  67. /* #define CYASSL_TIRTOS */
  68. /* Uncomment next line if building with PicoTCP */
  69. /* #define CYASSL_PICOTCP */
  70. /* Uncomment next line if building for PicoTCP demo bundle */
  71. /* #define CYASSL_PICOTCP_DEMO */
  72. #include <cyassl/ctaocrypt/visibility.h>
  73. #ifdef IPHONE
  74. #define SIZEOF_LONG_LONG 8
  75. #endif
  76. #ifdef CYASSL_USER_SETTINGS
  77. #include <user_settings.h>
  78. #endif
  79. /* for reverse compatibility after name change */
  80. #include <cyassl/ctaocrypt/settings_comp.h>
  81. #ifdef THREADX
  82. #define SIZEOF_LONG_LONG 8
  83. #endif
  84. #ifdef HAVE_NETX
  85. #include "nx_api.h"
  86. #endif
  87. #if defined(HAVE_LWIP_NATIVE) /* using LwIP native TCP socket */
  88. #define CYASSL_LWIP
  89. #define NO_WRITEV
  90. #define SINGLE_THREADED
  91. #define CYASSL_USER_IO
  92. #define NO_FILESYSTEM
  93. #endif
  94. #if defined(CYASSL_IAR_ARM)
  95. #define NO_MAIN_DRIVER
  96. #define SINGLE_THREADED
  97. #define USE_CERT_BUFFERS_1024
  98. #define BENCH_EMBEDDED
  99. #define NO_FILESYSTEM
  100. #define NO_WRITEV
  101. #define CYASSL_USER_IO
  102. #define BENCH_EMBEDDED
  103. #endif
  104. #ifdef MICROCHIP_PIC32
  105. /* #define CYASSL_MICROCHIP_PIC32MZ */
  106. #define SIZEOF_LONG_LONG 8
  107. #define SINGLE_THREADED
  108. #define CYASSL_USER_IO
  109. #define NO_WRITEV
  110. #define NO_DEV_RANDOM
  111. #define NO_FILESYSTEM
  112. #define USE_FAST_MATH
  113. #define TFM_TIMING_RESISTANT
  114. #endif
  115. #if defined(CYASSL_MICROCHIP_PIC32MZ) || defined(WOLFSSL_MICROCHIP_PIC32MZ)
  116. #ifndef NO_PIC32MZ_CRYPT
  117. #define WOLFSSL_PIC32MZ_CRYPT
  118. #endif
  119. #ifndef NO_PIC32MZ_RNG
  120. #define WOLFSSL_PIC32MZ_RNG
  121. #endif
  122. #ifndef NO_PIC32MZ_HASH
  123. #define WOLFSSL_PIC32MZ_HASH
  124. #endif
  125. #define CYASSL_AES_COUNTER
  126. #define HAVE_AESGCM
  127. #define NO_BIG_INT
  128. #endif
  129. #ifdef MICROCHIP_TCPIP_V5
  130. /* include timer functions */
  131. #include "TCPIP Stack/TCPIP.h"
  132. #endif
  133. #ifdef MICROCHIP_TCPIP
  134. /* include timer, NTP functions */
  135. #ifdef MICROCHIP_MPLAB_HARMONY
  136. #include "tcpip/tcpip.h"
  137. #else
  138. #include "system/system_services.h"
  139. #include "tcpip/sntp.h"
  140. #endif
  141. #endif
  142. #ifdef MBED
  143. #define CYASSL_USER_IO
  144. #define NO_FILESYSTEM
  145. #define NO_CERTS
  146. #define USE_CERT_BUFFERS_1024
  147. #define NO_WRITEV
  148. #define NO_DEV_RANDOM
  149. #define NO_SHA512
  150. #define NO_DH
  151. #define NO_DSA
  152. #define NO_HC128
  153. #define HAVE_ECC
  154. #define NO_SESSION_CACHE
  155. #define CYASSL_CMSIS_RTOS
  156. #endif
  157. #ifdef CYASSL_EROAD
  158. #define FREESCALE_MQX
  159. #define FREESCALE_MMCAU
  160. #define SINGLE_THREADED
  161. #define NO_STDIO_FILESYSTEM
  162. #define CYASSL_LEANPSK
  163. #define HAVE_NULL_CIPHER
  164. #define NO_OLD_TLS
  165. #define NO_ASN
  166. #define NO_BIG_INT
  167. #define NO_RSA
  168. #define NO_DSA
  169. #define NO_DH
  170. #define NO_CERTS
  171. #define NO_PWDBASED
  172. #define NO_DES3
  173. #define NO_MD4
  174. #define NO_RC4
  175. #define NO_MD5
  176. #define NO_SESSION_CACHE
  177. #define NO_MAIN_DRIVER
  178. #endif
  179. #ifdef CYASSL_PICOTCP
  180. #define errno pico_err
  181. #include "pico_defines.h"
  182. #include "pico_stack.h"
  183. #include "pico_constants.h"
  184. #define CUSTOM_RAND_GENERATE pico_rand
  185. #endif
  186. #ifdef CYASSL_PICOTCP_DEMO
  187. #define CYASSL_STM32
  188. #define USE_FAST_MATH
  189. #define TFM_TIMING_RESISTANT
  190. #define XMALLOC(s, h, type) PICO_ZALLOC((s))
  191. #define XFREE(p, h, type) PICO_FREE((p))
  192. #define SINGLE_THREADED
  193. #define NO_WRITEV
  194. #define CYASSL_USER_IO
  195. #define NO_DEV_RANDOM
  196. #define NO_FILESYSTEM
  197. #endif
  198. #ifdef FREERTOS_WINSIM
  199. #define FREERTOS
  200. #define USE_WINDOWS_API
  201. #endif
  202. /* Micrium will use Visual Studio for compilation but not the Win32 API */
  203. #if defined(_WIN32) && !defined(MICRIUM) && !defined(FREERTOS) \
  204. && !defined(EBSNET) && !defined(CYASSL_EROAD) && !defined(INTIME_RTOS)
  205. #define USE_WINDOWS_API
  206. #endif
  207. #if defined(CYASSL_LEANPSK) && !defined(XMALLOC_USER)
  208. #include <stdlib.h>
  209. #define XMALLOC(s, h, type) malloc((s))
  210. #define XFREE(p, h, type) free((p))
  211. #define XREALLOC(p, n, h, t) realloc((p), (n))
  212. #endif
  213. #if defined(XMALLOC_USER) && defined(SSN_BUILDING_LIBYASSL)
  214. #undef XMALLOC
  215. #define XMALLOC yaXMALLOC
  216. #undef XFREE
  217. #define XFREE yaXFREE
  218. #undef XREALLOC
  219. #define XREALLOC yaXREALLOC
  220. #endif
  221. #ifdef FREERTOS
  222. #ifndef NO_WRITEV
  223. #define NO_WRITEV
  224. #endif
  225. #ifndef NO_SHA512
  226. #define NO_SHA512
  227. #endif
  228. #ifndef NO_DH
  229. #define NO_DH
  230. #endif
  231. #ifndef NO_DSA
  232. #define NO_DSA
  233. #endif
  234. #ifndef NO_HC128
  235. #define NO_HC128
  236. #endif
  237. #ifndef SINGLE_THREADED
  238. #include "FreeRTOS.h"
  239. #include "semphr.h"
  240. #endif
  241. #endif
  242. #ifdef CYASSL_TIRTOS
  243. #define SIZEOF_LONG_LONG 8
  244. #define NO_WRITEV
  245. #define NO_CYASSL_DIR
  246. #define USE_FAST_MATH
  247. #define TFM_TIMING_RESISTANT
  248. #define NO_DEV_RANDOM
  249. #define NO_FILESYSTEM
  250. #define USE_CERT_BUFFERS_2048
  251. #define NO_ERROR_STRINGS
  252. #define USER_TIME
  253. #ifdef __IAR_SYSTEMS_ICC__
  254. #pragma diag_suppress=Pa089
  255. #elif !defined(__GNUC__)
  256. /* Suppress the sslpro warning */
  257. #pragma diag_suppress=11
  258. #endif
  259. #include <ti/ndk/nettools/mytime/mytime.h>
  260. #endif
  261. #ifdef EBSNET
  262. #include "rtip.h"
  263. /* #define DEBUG_CYASSL */
  264. #define NO_CYASSL_DIR /* tbd */
  265. #if (POLLOS)
  266. #define SINGLE_THREADED
  267. #endif
  268. #if (RTPLATFORM)
  269. #if (!RTP_LITTLE_ENDIAN)
  270. #define BIG_ENDIAN_ORDER
  271. #endif
  272. #else
  273. #if (!KS_LITTLE_ENDIAN)
  274. #define BIG_ENDIAN_ORDER
  275. #endif
  276. #endif
  277. #if (WINMSP3)
  278. #undef SIZEOF_LONG
  279. #define SIZEOF_LONG_LONG 8
  280. #else
  281. #sslpro: settings.h - please implement SIZEOF_LONG and SIZEOF_LONG_LONG
  282. #endif
  283. #define XMALLOC(s, h, type) ((void *)rtp_malloc((s), SSL_PRO_MALLOC))
  284. #define XFREE(p, h, type) (rtp_free(p))
  285. #define XREALLOC(p, n, h, t) realloc((p), (n))
  286. #endif /* EBSNET */
  287. #ifdef CYASSL_GAME_BUILD
  288. #define SIZEOF_LONG_LONG 8
  289. #if defined(__PPU) || defined(__XENON)
  290. #define BIG_ENDIAN_ORDER
  291. #endif
  292. #endif
  293. #ifdef CYASSL_LSR
  294. #define HAVE_WEBSERVER
  295. #define SIZEOF_LONG_LONG 8
  296. #define CYASSL_LOW_MEMORY
  297. #define NO_WRITEV
  298. #define NO_SHA512
  299. #define NO_DH
  300. #define NO_DSA
  301. #define NO_HC128
  302. #define NO_DEV_RANDOM
  303. #define NO_CYASSL_DIR
  304. #define NO_RABBIT
  305. #ifndef NO_FILESYSTEM
  306. #define LSR_FS
  307. #include "inc/hw_types.h"
  308. #include "fs.h"
  309. #endif
  310. #define CYASSL_LWIP
  311. #include <errno.h> /* for tcp errno */
  312. #define CYASSL_SAFERTOS
  313. #if defined(__IAR_SYSTEMS_ICC__)
  314. /* enum uses enum */
  315. #pragma diag_suppress=Pa089
  316. #endif
  317. #endif
  318. #ifdef CYASSL_SAFERTOS
  319. #ifndef SINGLE_THREADED
  320. #include "SafeRTOS/semphr.h"
  321. #endif
  322. #include "SafeRTOS/heap.h"
  323. #define XMALLOC(s, h, type) pvPortMalloc((s))
  324. #define XFREE(p, h, type) vPortFree((p))
  325. #define XREALLOC(p, n, h, t) pvPortRealloc((p), (n))
  326. #endif
  327. #ifdef CYASSL_LOW_MEMORY
  328. #undef RSA_LOW_MEM
  329. #define RSA_LOW_MEM
  330. #undef CYASSL_SMALL_STACK
  331. #define CYASSL_SMALL_STACK
  332. #undef TFM_TIMING_RESISTANT
  333. #define TFM_TIMING_RESISTANT
  334. #endif
  335. #ifdef FREESCALE_MQX
  336. #define SIZEOF_LONG_LONG 8
  337. #define NO_WRITEV
  338. #define NO_DEV_RANDOM
  339. #define NO_RABBIT
  340. #define NO_CYASSL_DIR
  341. #define USE_FAST_MATH
  342. #define TFM_TIMING_RESISTANT
  343. #define FREESCALE_K70_RNGA
  344. /* #define FREESCALE_K53_RNGB */
  345. #include "mqx.h"
  346. #ifndef NO_FILESYSTEM
  347. #include "mfs.h"
  348. #include "fio.h"
  349. #endif
  350. #ifndef SINGLE_THREADED
  351. #include "mutex.h"
  352. #endif
  353. #define XMALLOC(s, h, t) (void *)_mem_alloc_system((s))
  354. #define XFREE(p, h, t) {void* xp = (p); if ((xp)) _mem_free((xp));}
  355. /* Note: MQX has no realloc, using fastmath above */
  356. #endif
  357. #ifdef CYASSL_STM32F2
  358. #define SIZEOF_LONG_LONG 8
  359. #define NO_DEV_RANDOM
  360. #define NO_CYASSL_DIR
  361. #define NO_RABBIT
  362. #define STM32F2_RNG
  363. #define STM32F2_CRYPTO
  364. #define KEIL_INTRINSICS
  365. #endif
  366. #ifdef MICRIUM
  367. #include "stdlib.h"
  368. #include "net_cfg.h"
  369. #include "ssl_cfg.h"
  370. #include "net_secure_os.h"
  371. #define CYASSL_TYPES
  372. typedef CPU_INT08U byte;
  373. typedef CPU_INT16U word16;
  374. typedef CPU_INT32U word32;
  375. #if (NET_SECURE_MGR_CFG_WORD_SIZE == CPU_WORD_SIZE_32)
  376. #define SIZEOF_LONG 4
  377. #undef SIZEOF_LONG_LONG
  378. #else
  379. #undef SIZEOF_LONG
  380. #define SIZEOF_LONG_LONG 8
  381. #endif
  382. #define STRING_USER
  383. #define XSTRLEN(pstr) ((CPU_SIZE_T)Str_Len((CPU_CHAR *)(pstr)))
  384. #define XSTRNCPY(pstr_dest, pstr_src, len_max) \
  385. ((CPU_CHAR *)Str_Copy_N((CPU_CHAR *)(pstr_dest), \
  386. (CPU_CHAR *)(pstr_src), (CPU_SIZE_T)(len_max)))
  387. #define XSTRNCMP(pstr_1, pstr_2, len_max) \
  388. ((CPU_INT16S)Str_Cmp_N((CPU_CHAR *)(pstr_1), \
  389. (CPU_CHAR *)(pstr_2), (CPU_SIZE_T)(len_max)))
  390. #define XSTRSTR(pstr, pstr_srch) \
  391. ((CPU_CHAR *)Str_Str((CPU_CHAR *)(pstr), \
  392. (CPU_CHAR *)(pstr_srch)))
  393. #define XMEMSET(pmem, data_val, size) \
  394. ((void)Mem_Set((void *)(pmem), (CPU_INT08U) (data_val), \
  395. (CPU_SIZE_T)(size)))
  396. #define XMEMCPY(pdest, psrc, size) ((void)Mem_Copy((void *)(pdest), \
  397. (void *)(psrc), (CPU_SIZE_T)(size)))
  398. #define XMEMCMP(pmem_1, pmem_2, size) \
  399. (((CPU_BOOLEAN)Mem_Cmp((void *)(pmem_1), (void *)(pmem_2), \
  400. (CPU_SIZE_T)(size))) ? DEF_NO : DEF_YES)
  401. #define XMEMMOVE XMEMCPY
  402. #if (NET_SECURE_MGR_CFG_EN == DEF_ENABLED)
  403. #define MICRIUM_MALLOC
  404. #define XMALLOC(s, h, type) ((void *)NetSecure_BlkGet((CPU_INT08U)(type), \
  405. (CPU_SIZE_T)(s), (void *)0))
  406. #define XFREE(p, h, type) (NetSecure_BlkFree((CPU_INT08U)(type), \
  407. (p), (void *)0))
  408. #define XREALLOC(p, n, h, t) realloc((p), (n))
  409. #endif
  410. #if (NET_SECURE_MGR_CFG_FS_EN == DEF_ENABLED)
  411. #undef NO_FILESYSTEM
  412. #else
  413. #define NO_FILESYSTEM
  414. #endif
  415. #if (SSL_CFG_TRACE_LEVEL == CYASSL_TRACE_LEVEL_DBG)
  416. #define DEBUG_CYASSL
  417. #else
  418. #undef DEBUG_CYASSL
  419. #endif
  420. #if (SSL_CFG_OPENSSL_EN == DEF_ENABLED)
  421. #define OPENSSL_EXTRA
  422. #else
  423. #undef OPENSSL_EXTRA
  424. #endif
  425. #if (SSL_CFG_MULTI_THREAD_EN == DEF_ENABLED)
  426. #undef SINGLE_THREADED
  427. #else
  428. #define SINGLE_THREADED
  429. #endif
  430. #if (SSL_CFG_DH_EN == DEF_ENABLED)
  431. #undef NO_DH
  432. #else
  433. #define NO_DH
  434. #endif
  435. #if (SSL_CFG_DSA_EN == DEF_ENABLED)
  436. #undef NO_DSA
  437. #else
  438. #define NO_DSA
  439. #endif
  440. #if (SSL_CFG_PSK_EN == DEF_ENABLED)
  441. #undef NO_PSK
  442. #else
  443. #define NO_PSK
  444. #endif
  445. #if (SSL_CFG_3DES_EN == DEF_ENABLED)
  446. #undef NO_DES
  447. #else
  448. #define NO_DES
  449. #endif
  450. #if (SSL_CFG_AES_EN == DEF_ENABLED)
  451. #undef NO_AES
  452. #else
  453. #define NO_AES
  454. #endif
  455. #if (SSL_CFG_RC4_EN == DEF_ENABLED)
  456. #undef NO_RC4
  457. #else
  458. #define NO_RC4
  459. #endif
  460. #if (SSL_CFG_RABBIT_EN == DEF_ENABLED)
  461. #undef NO_RABBIT
  462. #else
  463. #define NO_RABBIT
  464. #endif
  465. #if (SSL_CFG_HC128_EN == DEF_ENABLED)
  466. #undef NO_HC128
  467. #else
  468. #define NO_HC128
  469. #endif
  470. #if (CPU_CFG_ENDIAN_TYPE == CPU_ENDIAN_TYPE_BIG)
  471. #define BIG_ENDIAN_ORDER
  472. #else
  473. #undef BIG_ENDIAN_ORDER
  474. #define LITTLE_ENDIAN_ORDER
  475. #endif
  476. #if (SSL_CFG_MD4_EN == DEF_ENABLED)
  477. #undef NO_MD4
  478. #else
  479. #define NO_MD4
  480. #endif
  481. #if (SSL_CFG_WRITEV_EN == DEF_ENABLED)
  482. #undef NO_WRITEV
  483. #else
  484. #define NO_WRITEV
  485. #endif
  486. #if (SSL_CFG_USER_RNG_SEED_EN == DEF_ENABLED)
  487. #define NO_DEV_RANDOM
  488. #else
  489. #undef NO_DEV_RANDOM
  490. #endif
  491. #if (SSL_CFG_USER_IO_EN == DEF_ENABLED)
  492. #define CYASSL_USER_IO
  493. #else
  494. #undef CYASSL_USER_IO
  495. #endif
  496. #if (SSL_CFG_DYNAMIC_BUFFERS_EN == DEF_ENABLED)
  497. #undef LARGE_STATIC_BUFFERS
  498. #undef STATIC_CHUNKS_ONLY
  499. #else
  500. #define LARGE_STATIC_BUFFERS
  501. #define STATIC_CHUNKS_ONLY
  502. #endif
  503. #if (SSL_CFG_DER_LOAD_EN == DEF_ENABLED)
  504. #define CYASSL_DER_LOAD
  505. #else
  506. #undef CYASSL_DER_LOAD
  507. #endif
  508. #if (SSL_CFG_DTLS_EN == DEF_ENABLED)
  509. #define CYASSL_DTLS
  510. #else
  511. #undef CYASSL_DTLS
  512. #endif
  513. #if (SSL_CFG_CALLBACKS_EN == DEF_ENABLED)
  514. #define CYASSL_CALLBACKS
  515. #else
  516. #undef CYASSL_CALLBACKS
  517. #endif
  518. #if (SSL_CFG_FAST_MATH_EN == DEF_ENABLED)
  519. #define USE_FAST_MATH
  520. #else
  521. #undef USE_FAST_MATH
  522. #endif
  523. #if (SSL_CFG_TFM_TIMING_RESISTANT_EN == DEF_ENABLED)
  524. #define TFM_TIMING_RESISTANT
  525. #else
  526. #undef TFM_TIMING_RESISTANT
  527. #endif
  528. #endif /* MICRIUM */
  529. #ifdef CYASSL_QL
  530. #ifndef CYASSL_SEP
  531. #define CYASSL_SEP
  532. #endif
  533. #ifndef OPENSSL_EXTRA
  534. #define OPENSSL_EXTRA
  535. #endif
  536. #ifndef SESSION_CERTS
  537. #define SESSION_CERTS
  538. #endif
  539. #ifndef HAVE_AESCCM
  540. #define HAVE_AESCCM
  541. #endif
  542. #ifndef ATOMIC_USER
  543. #define ATOMIC_USER
  544. #endif
  545. #ifndef CYASSL_DER_LOAD
  546. #define CYASSL_DER_LOAD
  547. #endif
  548. #ifndef KEEP_PEER_CERT
  549. #define KEEP_PEER_CERT
  550. #endif
  551. #ifndef HAVE_ECC
  552. #define HAVE_ECC
  553. #endif
  554. #ifndef SESSION_INDEX
  555. #define SESSION_INDEX
  556. #endif
  557. #endif /* CYASSL_QL */
  558. #if !defined(XMALLOC_USER) && !defined(MICRIUM_MALLOC) && \
  559. !defined(CYASSL_LEANPSK) && !defined(NO_CYASSL_MEMORY)
  560. #define USE_CYASSL_MEMORY
  561. #endif
  562. #if defined(OPENSSL_EXTRA) && !defined(NO_CERTS)
  563. #undef KEEP_PEER_CERT
  564. #define KEEP_PEER_CERT
  565. #endif
  566. /* stream ciphers except arc4 need 32bit alignment, intel ok without */
  567. #ifndef XSTREAM_ALIGNMENT
  568. #if defined(__x86_64__) || defined(__ia64__) || defined(__i386__)
  569. #define NO_XSTREAM_ALIGNMENT
  570. #else
  571. #define XSTREAM_ALIGNMENT
  572. #endif
  573. #endif
  574. /* FreeScale MMCAU hardware crypto has 4 byte alignment */
  575. #ifdef FREESCALE_MMCAU
  576. #define CYASSL_MMCAU_ALIGNMENT 4
  577. #endif
  578. /* if using hardware crypto and have alignment requirements, specify the
  579. requirement here. The record header of SSL/TLS will prvent easy alignment.
  580. This hint tries to help as much as possible. */
  581. #ifndef CYASSL_GENERAL_ALIGNMENT
  582. #ifdef CYASSL_AESNI
  583. #define CYASSL_GENERAL_ALIGNMENT 16
  584. #elif defined(XSTREAM_ALIGNMENT)
  585. #define CYASSL_GENERAL_ALIGNMENT 4
  586. #elif defined(FREESCALE_MMCAU)
  587. #define CYASSL_GENERAL_ALIGNMENT CYASSL_MMCAU_ALIGNMENT
  588. #else
  589. #define CYASSL_GENERAL_ALIGNMENT 0
  590. #endif
  591. #endif
  592. #ifdef __INTEL_COMPILER
  593. #pragma warning(disable:2259) /* explicit casts to smaller sizes, disable */
  594. #endif
  595. /* Place any other flags or defines here */
  596. #ifdef __cplusplus
  597. } /* extern "C" */
  598. #endif
  599. #endif /* CTAO_CRYPT_SETTINGS_H */