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