mirror of
https://github.com/Fishwaldo/bl_mcu_sdk.git
synced 2025-07-23 21:29:17 +00:00
[sync] sync code from internal
This commit is contained in:
parent
e70e482d21
commit
dd161b698b
302 changed files with 36006 additions and 27903 deletions
175
examples/mbedtls/mbedtls_sample_config.h
Normal file
175
examples/mbedtls/mbedtls_sample_config.h
Normal file
|
@ -0,0 +1,175 @@
|
|||
/**
|
||||
* \file config.h
|
||||
*
|
||||
* \brief Configuration options (set of defines)
|
||||
*
|
||||
* This set of compile-time options may be used to enable
|
||||
* or disable features selectively, and reduce the global
|
||||
* memory footprint.
|
||||
*/
|
||||
/*
|
||||
* Copyright The Mbed TLS Contributors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef MBEDTLS_CONFIG_H
|
||||
#define MBEDTLS_CONFIG_H
|
||||
|
||||
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
|
||||
#define _CRT_SECURE_NO_DEPRECATE 1
|
||||
#endif
|
||||
|
||||
#define MBEDTLS_PLATFORM_MEMORY
|
||||
#define MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
|
||||
|
||||
#define MBEDTLS_CIPHER_MODE_CBC
|
||||
#define MBEDTLS_CIPHER_MODE_CTR
|
||||
|
||||
#define MBEDTLS_CIPHER_PADDING_PKCS7
|
||||
#define MBEDTLS_CIPHER_PADDING_ZEROS
|
||||
#define MBEDTLS_REMOVE_ARC4_CIPHERSUITES
|
||||
#define MBEDTLS_REMOVE_3DES_CIPHERSUITES
|
||||
|
||||
#define MBEDTLS_ECDH_C
|
||||
#define MBEDTLS_ECDSA_C
|
||||
//#define MBEDTLS_ECP_DP_SECP192R1_ENABLED
|
||||
//#define MBEDTLS_ECP_DP_SECP224R1_ENABLED
|
||||
#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
|
||||
//#define MBEDTLS_ECP_DP_SECP384R1_ENABLED
|
||||
//#define MBEDTLS_ECP_DP_SECP521R1_ENABLED
|
||||
//#define MBEDTLS_ECP_DP_SECP192K1_ENABLED
|
||||
//#define MBEDTLS_ECP_DP_SECP224K1_ENABLED
|
||||
//#define MBEDTLS_ECP_DP_SECP256K1_ENABLED
|
||||
//#define MBEDTLS_ECP_DP_BP256R1_ENABLED
|
||||
//#define MBEDTLS_ECP_DP_BP384R1_ENABLED
|
||||
//#define MBEDTLS_ECP_DP_BP512R1_ENABLED
|
||||
//#define MBEDTLS_ECP_DP_CURVE25519_ENABLED
|
||||
//#define MBEDTLS_ECP_DP_CURVE448_ENABLED
|
||||
|
||||
#define MBEDTLS_ECP_NIST_OPTIM
|
||||
|
||||
#define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
|
||||
#define MBEDTLS_KEY_EXCHANGE_RSA_ENABLED
|
||||
#define MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED
|
||||
#define MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
|
||||
#define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
|
||||
#define MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED
|
||||
#define MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED
|
||||
|
||||
//XXX TODO remove bl606p
|
||||
#if defined(CFG_CHIP_BL606P) || defined(CFG_CHIP_BL808)
|
||||
#define MBEDTLS_PKCS5_C
|
||||
#endif
|
||||
#define MBEDTLS_PKCS1_V15
|
||||
#define MBEDTLS_PKCS1_V21
|
||||
|
||||
#define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
||||
#define MBEDTLS_SSL_PROTO_TLS1_2
|
||||
#define MBEDTLS_SSL_ALPN
|
||||
#define MBEDTLS_SSL_SESSION_TICKETS
|
||||
#define MBEDTLS_SSL_SERVER_NAME_INDICATION
|
||||
#define MBEDTLS_X509_CHECK_KEY_USAGE
|
||||
#define MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE
|
||||
|
||||
#define MBEDTLS_AES_C
|
||||
#define MBEDTLS_AES_ROM_TABLES
|
||||
#define MBEDTLS_BASE64_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_DEBUG_C
|
||||
#define MBEDTLS_ECP_C
|
||||
#define MBEDTLS_ENTROPY_C
|
||||
|
||||
#define MBEDTLS_ERROR_C
|
||||
#define MBEDTLS_GCM_C
|
||||
#define MBEDTLS_MD_C
|
||||
#define MBEDTLS_MD5_C
|
||||
#define MBEDTLS_OID_C
|
||||
#define MBEDTLS_PEM_PARSE_C
|
||||
#define MBEDTLS_PK_C
|
||||
#define MBEDTLS_PK_PARSE_C
|
||||
|
||||
#define MBEDTLS_PLATFORM_C
|
||||
#define MBEDTLS_GENPRIME
|
||||
#define MBEDTLS_RSA_C
|
||||
#define MBEDTLS_DHM_C
|
||||
#define MBEDTLS_SHA1_C
|
||||
#define MBEDTLS_SHA256_C
|
||||
#define MBEDTLS_SHA512_C
|
||||
|
||||
#define MBEDTLS_SSL_COOKIE_C
|
||||
#define MBEDTLS_SSL_CLI_C
|
||||
#define MBEDTLS_SSL_TLS_C
|
||||
#define MBEDTLS_X509_USE_C
|
||||
#define MBEDTLS_X509_CRT_PARSE_C
|
||||
|
||||
//#define MBEDTLS_NET_C
|
||||
|
||||
//#define MBEDTLS_FS_IO
|
||||
|
||||
#define MBEDTLS_NO_PLATFORM_ENTROPY
|
||||
#define MBEDTLS_ENTROPY_HARDWARE_ALT
|
||||
|
||||
#define MBEDTLS_PLATFORM_STD_MEM_HDR "mbedtls_port_bouffalo_sdk.h"
|
||||
|
||||
// Define BL_MPI_LARGE_NUM_SOFTWARE_MPI to allow operate on very big bignums
|
||||
/* #define BL_MPI_LARGE_NUM_SOFTWARE_MPI */
|
||||
|
||||
// Hash HW
|
||||
#ifdef CONFIG_MBEDTLS_SHA1_USE_HW
|
||||
#define MBEDTLS_SHA1_ALT
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_MBEDTLS_SHA256_USE_HW
|
||||
#define MBEDTLS_SHA256_ALT
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_MBEDTLS_SHA512_USE_HW
|
||||
#define MBEDTLS_SHA512_ALT
|
||||
#endif
|
||||
|
||||
// AES HW
|
||||
#ifdef CONFIG_MBEDTLS_AES_USE_HW
|
||||
#define MBEDTLS_AES_ALT
|
||||
#endif
|
||||
|
||||
// ECC HW
|
||||
#ifdef CONFIG_MBEDTLS_ECC_USE_HW
|
||||
#define MBEDTLS_ECP_ALT
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_MBEDTLS_ECC_USE_HW) && defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
#error "ECP Restartable is not implemented with ECP HW acceleration!"
|
||||
#endif
|
||||
|
||||
/* Target and application specific configurations
|
||||
*
|
||||
* Allow user to override any previous default.
|
||||
*
|
||||
*/
|
||||
#if defined(MBEDTLS_USER_CONFIG_FILE)
|
||||
#include MBEDTLS_USER_CONFIG_FILE
|
||||
#endif
|
||||
|
||||
#if defined(MBEDTLS_PSA_CRYPTO_CONFIG)
|
||||
#include "mbedtls/config_psa.h"
|
||||
#endif
|
||||
|
||||
#include "mbedtls/check_config.h"
|
||||
|
||||
#endif /* MBEDTLS_CONFIG_H */
|
Loading…
Add table
Add a link
Reference in a new issue