123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- /**
- *
- * Portions COPYRIGHT 2016 STMicroelectronics
- * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
- *
- ******************************************************************************
- * @file mbedtls_config.h
- * @author MCD Application Team
- * @version V1.1.0
- * @date 17-February-2017
- * @brief the mbedtls custom config header file.
- ******************************************************************************
- * @attention
- *
- * <h2><center>© COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- ******************************************************************************
- */
- #ifndef MBEDTLS_CONFIG_H
- #define MBEDTLS_CONFIG_H
- /* System support */
- #define MBEDTLS_HAVE_ASM
- #define MBEDTLS_HAVE_TIME
- /* mbed TLS feature support */
- #define MBEDTLS_ECP_DP_SECP256R1_ENABLED
- #define MBEDTLS_ECP_DP_SECP384R1_ENABLED
- #define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
- #define MBEDTLS_SSL_PROTO_TLS1_2
- /* mbed TLS modules */
- #define MBEDTLS_AES_C
- #define MBEDTLS_ASN1_PARSE_C
- #define MBEDTLS_ASN1_WRITE_C
- #define MBEDTLS_BIGNUM_C
- #define MBEDTLS_CIPHER_C
- #define MBEDTLS_CTR_DRBG_C
- #define MBEDTLS_ECDH_C
- #define MBEDTLS_ECDSA_C
- #define MBEDTLS_ECP_C
- #define MBEDTLS_ENTROPY_C
- #define MBEDTLS_GCM_C
- #define MBEDTLS_MD_C
- #define MBEDTLS_NET_C
- #define MBEDTLS_OID_C
- #define MBEDTLS_PK_C
- #define MBEDTLS_PK_PARSE_C
- #define MBEDTLS_SHA256_C
- #define MBEDTLS_SHA512_C
- #define MBEDTLS_SSL_CLI_C
- #define MBEDTLS_SSL_SRV_C
- #define MBEDTLS_SSL_TLS_C
- #define MBEDTLS_X509_CRT_PARSE_C
- #define MBEDTLS_X509_USE_C
- /* For test certificates */
- #define MBEDTLS_BASE64_C
- #define MBEDTLS_CERTS_C
- #define MBEDTLS_PEM_PARSE_C
- /* Save RAM at the expense of ROM */
- #define MBEDTLS_AES_ROM_TABLES
- /* Save RAM by adjusting to our exact needs */
- #define MBEDTLS_ECP_MAX_BITS 384
- #define MBEDTLS_MPI_MAX_SIZE 48 // 384 bits is 48 bytes
- /* Save RAM at the expense of speed, see ecp.h */
- #define MBEDTLS_ECP_WINDOW_SIZE 2
- #define MBEDTLS_ECP_FIXED_POINT_OPTIM 0
- /* Significant speed benefit at the expense of some ROM */
- #define MBEDTLS_ECP_NIST_OPTIM
- /*
- * You should adjust this to the exact number of sources you're using: default
- * is the "mbedtls_platform_entropy_poll" source, but you may want to add other ones.
- * Minimum is 2 for the entropy test suite.
- */
- #define MBEDTLS_ENTROPY_MAX_SOURCES 2
- /* Save ROM and a few bytes of RAM by specifying our own ciphersuite list */
- #define MBEDTLS_SSL_CIPHERSUITES \
- MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, \
- MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
- /*
- * Save RAM at the expense of interoperability: do this only if you control
- * both ends of the connection! (See coments in "mbedtls/ssl.h".)
- * The minimum size here depends on the certificate chain used as well as the
- * typical size of records.
- */
- #define MBEDTLS_SSL_MAX_CONTENT_LEN 2048
- #define MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE
- #define MBEDTLS_CAMELLIA_C
- #ifdef USE_LCD
- #include "lcd_log.h"
- #define MBEDTLS_PLATFORM_C
- #define MBEDTLS_PLATFORM_PRINTF_MACRO LCD_UsrLog
- #endif
- /* Customize the entropy data generation */
- #define MBEDTLS_NO_PLATFORM_ENTROPY
- #define MBEDTLS_ENTROPY_HARDWARE_ALT
- #include "mbedtls/check_config.h"
- #endif /* MBEDTLS_CONFIG_H */
|