settings.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702
  1. /* settings.h
  2. *
  3. * Copyright (C) 2006-2021 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 HAVE_ECC
  153. #define NO_SESSION_CACHE
  154. #define CYASSL_CMSIS_RTOS
  155. #endif
  156. #ifdef CYASSL_EROAD
  157. #define FREESCALE_MQX
  158. #define FREESCALE_MMCAU
  159. #define SINGLE_THREADED
  160. #define NO_STDIO_FILESYSTEM
  161. #define CYASSL_LEANPSK
  162. #define HAVE_NULL_CIPHER
  163. #define NO_OLD_TLS
  164. #define NO_ASN
  165. #define NO_BIG_INT
  166. #define NO_RSA
  167. #define NO_DSA
  168. #define NO_DH
  169. #define NO_CERTS
  170. #define NO_PWDBASED
  171. #define NO_DES3
  172. #define NO_MD4
  173. #define NO_RC4
  174. #define NO_MD5
  175. #define NO_SESSION_CACHE
  176. #define NO_MAIN_DRIVER
  177. #endif
  178. #ifdef CYASSL_PICOTCP
  179. #define errno pico_err
  180. #include "pico_defines.h"
  181. #include "pico_stack.h"
  182. #include "pico_constants.h"
  183. #define CUSTOM_RAND_GENERATE pico_rand
  184. #endif
  185. #ifdef CYASSL_PICOTCP_DEMO
  186. #define CYASSL_STM32
  187. #define USE_FAST_MATH
  188. #define TFM_TIMING_RESISTANT
  189. #define XMALLOC(s, h, type) PICO_ZALLOC((s))
  190. #define XFREE(p, h, type) PICO_FREE((p))
  191. #define SINGLE_THREADED
  192. #define NO_WRITEV
  193. #define CYASSL_USER_IO
  194. #define NO_DEV_RANDOM
  195. #define NO_FILESYSTEM
  196. #endif
  197. #ifdef FREERTOS_WINSIM
  198. #define FREERTOS
  199. #define USE_WINDOWS_API
  200. #endif
  201. /* Micrium will use Visual Studio for compilation but not the Win32 API */
  202. #if defined(_WIN32) && !defined(MICRIUM) && !defined(FREERTOS) \
  203. && !defined(EBSNET) && !defined(CYASSL_EROAD) && !defined(INTIME_RTOS)
  204. #define USE_WINDOWS_API
  205. #endif
  206. #if defined(CYASSL_LEANPSK) && !defined(XMALLOC_USER)
  207. #include <stdlib.h>
  208. #define XMALLOC(s, h, type) malloc((s))
  209. #define XFREE(p, h, type) free((p))
  210. #define XREALLOC(p, n, h, t) realloc((p), (n))
  211. #endif
  212. #if defined(XMALLOC_USER) && defined(SSN_BUILDING_LIBYASSL)
  213. #undef XMALLOC
  214. #define XMALLOC yaXMALLOC
  215. #undef XFREE
  216. #define XFREE yaXFREE
  217. #undef XREALLOC
  218. #define XREALLOC yaXREALLOC
  219. #endif
  220. #ifdef FREERTOS
  221. #ifndef NO_WRITEV
  222. #define NO_WRITEV
  223. #endif
  224. #ifndef NO_SHA512
  225. #define NO_SHA512
  226. #endif
  227. #ifndef NO_DH
  228. #define NO_DH
  229. #endif
  230. #ifndef NO_DSA
  231. #define NO_DSA
  232. #endif
  233. #ifndef SINGLE_THREADED
  234. #include "FreeRTOS.h"
  235. #include "semphr.h"
  236. #endif
  237. #endif
  238. #ifdef CYASSL_TIRTOS
  239. #define SIZEOF_LONG_LONG 8
  240. #define NO_WRITEV
  241. #define NO_CYASSL_DIR
  242. #define USE_FAST_MATH
  243. #define TFM_TIMING_RESISTANT
  244. #define NO_DEV_RANDOM
  245. #define NO_FILESYSTEM
  246. #define USE_CERT_BUFFERS_2048
  247. #define NO_ERROR_STRINGS
  248. #define USER_TIME
  249. #ifdef __IAR_SYSTEMS_ICC__
  250. #pragma diag_suppress=Pa089
  251. #elif !defined(__GNUC__)
  252. /* Suppress the sslpro warning */
  253. #pragma diag_suppress=11
  254. #endif
  255. #include <ti/ndk/nettools/mytime/mytime.h>
  256. #endif
  257. #ifdef EBSNET
  258. #include "rtip.h"
  259. /* #define DEBUG_CYASSL */
  260. #define NO_CYASSL_DIR /* tbd */
  261. #if (POLLOS)
  262. #define SINGLE_THREADED
  263. #endif
  264. #if (RTPLATFORM)
  265. #if (!RTP_LITTLE_ENDIAN)
  266. #define BIG_ENDIAN_ORDER
  267. #endif
  268. #else
  269. #if (!KS_LITTLE_ENDIAN)
  270. #define BIG_ENDIAN_ORDER
  271. #endif
  272. #endif
  273. #if (WINMSP3)
  274. #undef SIZEOF_LONG
  275. #define SIZEOF_LONG_LONG 8
  276. #else
  277. #if !defined(SIZEOF_LONG) && !defined(SIZEOF_LONG_LONG)
  278. #error settings.h - please implement SIZEOF_LONG and SIZEOF_LONG_LONG
  279. #endif
  280. #endif
  281. #define XMALLOC(s, h, type) ((void *)rtp_malloc((s), SSL_PRO_MALLOC))
  282. #define XFREE(p, h, type) (rtp_free(p))
  283. #define XREALLOC(p, n, h, t) realloc((p), (n))
  284. #endif /* EBSNET */
  285. #ifdef CYASSL_GAME_BUILD
  286. #define SIZEOF_LONG_LONG 8
  287. #endif
  288. #ifdef CYASSL_LSR
  289. #define HAVE_WEBSERVER
  290. #define SIZEOF_LONG_LONG 8
  291. #define CYASSL_LOW_MEMORY
  292. #define NO_WRITEV
  293. #define NO_SHA512
  294. #define NO_DH
  295. #define NO_DSA
  296. #define NO_DEV_RANDOM
  297. #define NO_CYASSL_DIR
  298. #ifndef NO_FILESYSTEM
  299. #define LSR_FS
  300. #include "inc/hw_types.h"
  301. #include "fs.h"
  302. #endif
  303. #define CYASSL_LWIP
  304. #include <errno.h> /* for tcp errno */
  305. #define CYASSL_SAFERTOS
  306. #if defined(__IAR_SYSTEMS_ICC__)
  307. /* enum uses enum */
  308. #pragma diag_suppress=Pa089
  309. #endif
  310. #endif
  311. #ifdef CYASSL_SAFERTOS
  312. #ifndef SINGLE_THREADED
  313. #include "SafeRTOS/semphr.h"
  314. #endif
  315. #include "SafeRTOS/heap.h"
  316. #define XMALLOC(s, h, type) pvPortMalloc((s))
  317. #define XFREE(p, h, type) vPortFree((p))
  318. #define XREALLOC(p, n, h, t) pvPortRealloc((p), (n))
  319. #endif
  320. #ifdef CYASSL_LOW_MEMORY
  321. #undef RSA_LOW_MEM
  322. #define RSA_LOW_MEM
  323. #undef CYASSL_SMALL_STACK
  324. #define CYASSL_SMALL_STACK
  325. #undef TFM_TIMING_RESISTANT
  326. #define TFM_TIMING_RESISTANT
  327. #endif
  328. #ifdef FREESCALE_MQX
  329. #define SIZEOF_LONG_LONG 8
  330. #define NO_WRITEV
  331. #define NO_DEV_RANDOM
  332. #define NO_CYASSL_DIR
  333. #define USE_FAST_MATH
  334. #define TFM_TIMING_RESISTANT
  335. #define FREESCALE_K70_RNGA
  336. /* #define FREESCALE_K53_RNGB */
  337. #include "mqx.h"
  338. #ifndef NO_FILESYSTEM
  339. #include "mfs.h"
  340. #include "fio.h"
  341. #endif
  342. #ifndef SINGLE_THREADED
  343. #include "mutex.h"
  344. #endif
  345. #define XMALLOC(s, h, t) (void *)_mem_alloc_system((s))
  346. #define XFREE(p, h, t) {void* xp = (p); if ((xp)) _mem_free((xp));}
  347. /* Note: MQX has no realloc, using fastmath above */
  348. #endif
  349. #ifdef CYASSL_STM32F2
  350. #define SIZEOF_LONG_LONG 8
  351. #define NO_DEV_RANDOM
  352. #define NO_CYASSL_DIR
  353. #define STM32F2_RNG
  354. #define STM32F2_CRYPTO
  355. #define KEIL_INTRINSICS
  356. #endif
  357. #ifdef MICRIUM
  358. #include "stdlib.h"
  359. #include "net_cfg.h"
  360. #include "ssl_cfg.h"
  361. #include "net_secure_os.h"
  362. #define CYASSL_TYPES
  363. typedef CPU_INT08U byte;
  364. typedef CPU_INT16U word16;
  365. typedef CPU_INT32U word32;
  366. #if (NET_SECURE_MGR_CFG_WORD_SIZE == CPU_WORD_SIZE_32)
  367. #define SIZEOF_LONG 4
  368. #undef SIZEOF_LONG_LONG
  369. #else
  370. #undef SIZEOF_LONG
  371. #define SIZEOF_LONG_LONG 8
  372. #endif
  373. #define STRING_USER
  374. #define XSTRLEN(pstr) ((CPU_SIZE_T)Str_Len((CPU_CHAR *)(pstr)))
  375. #define XSTRNCPY(pstr_dest, pstr_src, len_max) \
  376. ((CPU_CHAR *)Str_Copy_N((CPU_CHAR *)(pstr_dest), \
  377. (CPU_CHAR *)(pstr_src), (CPU_SIZE_T)(len_max)))
  378. #define XSTRNCMP(pstr_1, pstr_2, len_max) \
  379. ((CPU_INT16S)Str_Cmp_N((CPU_CHAR *)(pstr_1), \
  380. (CPU_CHAR *)(pstr_2), (CPU_SIZE_T)(len_max)))
  381. #define XSTRSTR(pstr, pstr_srch) \
  382. ((CPU_CHAR *)Str_Str((CPU_CHAR *)(pstr), \
  383. (CPU_CHAR *)(pstr_srch)))
  384. #define XMEMSET(pmem, data_val, size) \
  385. ((void)Mem_Set((void *)(pmem), (CPU_INT08U) (data_val), \
  386. (CPU_SIZE_T)(size)))
  387. #define XMEMCPY(pdest, psrc, size) ((void)Mem_Copy((void *)(pdest), \
  388. (void *)(psrc), (CPU_SIZE_T)(size)))
  389. #define XMEMCMP(pmem_1, pmem_2, size) \
  390. (((CPU_BOOLEAN)Mem_Cmp((void *)(pmem_1), (void *)(pmem_2), \
  391. (CPU_SIZE_T)(size))) ? DEF_NO : DEF_YES)
  392. #define XMEMMOVE XMEMCPY
  393. #if (NET_SECURE_MGR_CFG_EN == DEF_ENABLED)
  394. #define MICRIUM_MALLOC
  395. #define XMALLOC(s, h, type) ((void *)NetSecure_BlkGet((CPU_INT08U)(type), \
  396. (CPU_SIZE_T)(s), (void *)0))
  397. #define XFREE(p, h, type) (NetSecure_BlkFree((CPU_INT08U)(type), \
  398. (p), (void *)0))
  399. #define XREALLOC(p, n, h, t) realloc((p), (n))
  400. #endif
  401. #if (NET_SECURE_MGR_CFG_FS_EN == DEF_ENABLED)
  402. #undef NO_FILESYSTEM
  403. #else
  404. #define NO_FILESYSTEM
  405. #endif
  406. #if (SSL_CFG_TRACE_LEVEL == CYASSL_TRACE_LEVEL_DBG)
  407. #define DEBUG_CYASSL
  408. #else
  409. #undef DEBUG_CYASSL
  410. #endif
  411. #if (SSL_CFG_OPENSSL_EN == DEF_ENABLED)
  412. #define OPENSSL_EXTRA
  413. #else
  414. #undef OPENSSL_EXTRA
  415. #endif
  416. #if (SSL_CFG_MULTI_THREAD_EN == DEF_ENABLED)
  417. #undef SINGLE_THREADED
  418. #else
  419. #define SINGLE_THREADED
  420. #endif
  421. #if (SSL_CFG_DH_EN == DEF_ENABLED)
  422. #undef NO_DH
  423. #else
  424. #define NO_DH
  425. #endif
  426. #if (SSL_CFG_DSA_EN == DEF_ENABLED)
  427. #undef NO_DSA
  428. #else
  429. #define NO_DSA
  430. #endif
  431. #if (SSL_CFG_PSK_EN == DEF_ENABLED)
  432. #undef NO_PSK
  433. #else
  434. #define NO_PSK
  435. #endif
  436. #if (SSL_CFG_3DES_EN == DEF_ENABLED)
  437. #undef NO_DES3
  438. #else
  439. #define NO_DES3
  440. #endif
  441. #if (SSL_CFG_AES_EN == DEF_ENABLED)
  442. #undef NO_AES
  443. #else
  444. #define NO_AES
  445. #endif
  446. #if (SSL_CFG_RC4_EN == DEF_ENABLED)
  447. #undef NO_RC4
  448. #else
  449. #define NO_RC4
  450. #endif
  451. #if (CPU_CFG_ENDIAN_TYPE == CPU_ENDIAN_TYPE_BIG)
  452. #define BIG_ENDIAN_ORDER
  453. #else
  454. #undef BIG_ENDIAN_ORDER
  455. #define LITTLE_ENDIAN_ORDER
  456. #endif
  457. #if (SSL_CFG_MD4_EN == DEF_ENABLED)
  458. #undef NO_MD4
  459. #else
  460. #define NO_MD4
  461. #endif
  462. #if (SSL_CFG_WRITEV_EN == DEF_ENABLED)
  463. #undef NO_WRITEV
  464. #else
  465. #define NO_WRITEV
  466. #endif
  467. #if (SSL_CFG_USER_RNG_SEED_EN == DEF_ENABLED)
  468. #define NO_DEV_RANDOM
  469. #else
  470. #undef NO_DEV_RANDOM
  471. #endif
  472. #if (SSL_CFG_USER_IO_EN == DEF_ENABLED)
  473. #define CYASSL_USER_IO
  474. #else
  475. #undef CYASSL_USER_IO
  476. #endif
  477. #if (SSL_CFG_DYNAMIC_BUFFERS_EN == DEF_ENABLED)
  478. #undef LARGE_STATIC_BUFFERS
  479. #undef STATIC_CHUNKS_ONLY
  480. #else
  481. #define LARGE_STATIC_BUFFERS
  482. #define STATIC_CHUNKS_ONLY
  483. #endif
  484. #if (SSL_CFG_DER_LOAD_EN == DEF_ENABLED)
  485. #define CYASSL_DER_LOAD
  486. #else
  487. #undef CYASSL_DER_LOAD
  488. #endif
  489. #if (SSL_CFG_DTLS_EN == DEF_ENABLED)
  490. #define CYASSL_DTLS
  491. #else
  492. #undef CYASSL_DTLS
  493. #endif
  494. #if (SSL_CFG_CALLBACKS_EN == DEF_ENABLED)
  495. #define CYASSL_CALLBACKS
  496. #else
  497. #undef CYASSL_CALLBACKS
  498. #endif
  499. #if (SSL_CFG_FAST_MATH_EN == DEF_ENABLED)
  500. #define USE_FAST_MATH
  501. #else
  502. #undef USE_FAST_MATH
  503. #endif
  504. #if (SSL_CFG_TFM_TIMING_RESISTANT_EN == DEF_ENABLED)
  505. #define TFM_TIMING_RESISTANT
  506. #else
  507. #undef TFM_TIMING_RESISTANT
  508. #endif
  509. #endif /* MICRIUM */
  510. #ifdef CYASSL_QL
  511. #ifndef CYASSL_SEP
  512. #define CYASSL_SEP
  513. #endif
  514. #ifndef OPENSSL_EXTRA
  515. #define OPENSSL_EXTRA
  516. #endif
  517. #ifndef SESSION_CERTS
  518. #define SESSION_CERTS
  519. #endif
  520. #ifndef HAVE_AESCCM
  521. #define HAVE_AESCCM
  522. #endif
  523. #ifndef ATOMIC_USER
  524. #define ATOMIC_USER
  525. #endif
  526. #ifndef CYASSL_DER_LOAD
  527. #define CYASSL_DER_LOAD
  528. #endif
  529. #ifndef KEEP_PEER_CERT
  530. #define KEEP_PEER_CERT
  531. #endif
  532. #ifndef HAVE_ECC
  533. #define HAVE_ECC
  534. #endif
  535. #ifndef SESSION_INDEX
  536. #define SESSION_INDEX
  537. #endif
  538. #endif /* CYASSL_QL */
  539. #if !defined(XMALLOC_USER) && !defined(MICRIUM_MALLOC) && \
  540. !defined(CYASSL_LEANPSK) && !defined(NO_CYASSL_MEMORY)
  541. #define USE_CYASSL_MEMORY
  542. #endif
  543. #if defined(OPENSSL_EXTRA) && !defined(NO_CERTS)
  544. #undef KEEP_PEER_CERT
  545. #define KEEP_PEER_CERT
  546. #endif
  547. /* stream ciphers except arc4 need 32bit alignment, intel ok without */
  548. #ifndef XSTREAM_ALIGNMENT
  549. #if defined(__x86_64__) || defined(__ia64__) || defined(__i386__)
  550. #define NO_XSTREAM_ALIGNMENT
  551. #else
  552. #define XSTREAM_ALIGNMENT
  553. #endif
  554. #endif
  555. /* FreeScale MMCAU hardware crypto has 4 byte alignment */
  556. #ifdef FREESCALE_MMCAU
  557. #define CYASSL_MMCAU_ALIGNMENT 4
  558. #endif
  559. /* if using hardware crypto and have alignment requirements, specify the
  560. requirement here. The record header of SSL/TLS will prvent easy alignment.
  561. This hint tries to help as much as possible. */
  562. #ifndef CYASSL_GENERAL_ALIGNMENT
  563. #ifdef CYASSL_AESNI
  564. #define CYASSL_GENERAL_ALIGNMENT 16
  565. #elif defined(XSTREAM_ALIGNMENT)
  566. #define CYASSL_GENERAL_ALIGNMENT 4
  567. #elif defined(FREESCALE_MMCAU)
  568. #define CYASSL_GENERAL_ALIGNMENT CYASSL_MMCAU_ALIGNMENT
  569. #else
  570. #define CYASSL_GENERAL_ALIGNMENT 0
  571. #endif
  572. #endif
  573. #ifdef __INTEL_COMPILER
  574. #pragma warning(disable:2259) /* explicit casts to smaller sizes, disable */
  575. #endif
  576. /* Place any other flags or defines here */
  577. #ifdef __cplusplus
  578. } /* extern "C" */
  579. #endif
  580. #endif /* CTAO_CRYPT_SETTINGS_H */