mbed TLS Build

Dependents:   Encypting_Funcional

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers config-suite-b.h Source File

config-suite-b.h

00001 /*
00002  *  Minimal configuration for TLS NSA Suite B Profile (RFC 6460)
00003  *
00004  *  Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
00005  *  SPDX-License-Identifier: Apache-2.0
00006  *
00007  *  Licensed under the Apache License, Version 2.0 (the "License"); you may
00008  *  not use this file except in compliance with the License.
00009  *  You may obtain a copy of the License at
00010  *
00011  *  http://www.apache.org/licenses/LICENSE-2.0
00012  *
00013  *  Unless required by applicable law or agreed to in writing, software
00014  *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
00015  *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00016  *  See the License for the specific language governing permissions and
00017  *  limitations under the License.
00018  *
00019  *  This file is part of mbed TLS (https://tls.mbed.org)
00020  */
00021 /*
00022  * Minimal configuration for TLS NSA Suite B Profile (RFC 6460)
00023  *
00024  * Distinguishing features:
00025  * - no RSA or classic DH, fully based on ECC
00026  * - optimized for low RAM usage
00027  *
00028  * Possible improvements:
00029  * - if 128-bit security is enough, disable secp384r1 and SHA-512
00030  * - use embedded certs in DER format and disable PEM_PARSE_C and BASE64_C
00031  *
00032  * See README.txt for usage instructions.
00033  */
00034 
00035 #ifndef MBEDTLS_CONFIG_H
00036 #define MBEDTLS_CONFIG_H
00037 
00038 /* System support */
00039 #define MBEDTLS_HAVE_ASM
00040 #define MBEDTLS_HAVE_TIME
00041 
00042 /* mbed TLS feature support */
00043 #define MBEDTLS_ECP_DP_SECP256R1_ENABLED
00044 #define MBEDTLS_ECP_DP_SECP384R1_ENABLED
00045 #define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
00046 #define MBEDTLS_SSL_PROTO_TLS1_2
00047 
00048 /* mbed TLS modules */
00049 #define MBEDTLS_AES_C
00050 #define MBEDTLS_ASN1_PARSE_C
00051 #define MBEDTLS_ASN1_WRITE_C
00052 #define MBEDTLS_BIGNUM_C
00053 #define MBEDTLS_CIPHER_C
00054 #define MBEDTLS_CTR_DRBG_C
00055 #define MBEDTLS_ECDH_C
00056 #define MBEDTLS_ECDSA_C
00057 #define MBEDTLS_ECP_C
00058 #define MBEDTLS_ENTROPY_C
00059 #define MBEDTLS_GCM_C
00060 #define MBEDTLS_MD_C
00061 #define MBEDTLS_NET_C
00062 #define MBEDTLS_OID_C
00063 #define MBEDTLS_PK_C
00064 #define MBEDTLS_PK_PARSE_C
00065 #define MBEDTLS_SHA256_C
00066 #define MBEDTLS_SHA512_C
00067 #define MBEDTLS_SSL_CLI_C
00068 #define MBEDTLS_SSL_SRV_C
00069 #define MBEDTLS_SSL_TLS_C
00070 #define MBEDTLS_X509_CRT_PARSE_C
00071 #define MBEDTLS_X509_USE_C
00072 
00073 /* For test certificates */
00074 #define MBEDTLS_BASE64_C
00075 #define MBEDTLS_CERTS_C
00076 #define MBEDTLS_PEM_PARSE_C
00077 
00078 /* Save RAM at the expense of ROM */
00079 #define MBEDTLS_AES_ROM_TABLES
00080 
00081 /* Save RAM by adjusting to our exact needs */
00082 #define MBEDTLS_ECP_MAX_BITS   384
00083 #define MBEDTLS_MPI_MAX_SIZE    48 // 384 bits is 48 bytes
00084 
00085 /* Save RAM at the expense of speed, see ecp.h */
00086 #define MBEDTLS_ECP_WINDOW_SIZE        2
00087 #define MBEDTLS_ECP_FIXED_POINT_OPTIM  0
00088 
00089 /* Significant speed benefit at the expense of some ROM */
00090 #define MBEDTLS_ECP_NIST_OPTIM
00091 
00092 /*
00093  * You should adjust this to the exact number of sources you're using: default
00094  * is the "mbedtls_platform_entropy_poll" source, but you may want to add other ones.
00095  * Minimum is 2 for the entropy test suite.
00096  */
00097 #define MBEDTLS_ENTROPY_MAX_SOURCES 2
00098 
00099 /* Save ROM and a few bytes of RAM by specifying our own ciphersuite list */
00100 #define MBEDTLS_SSL_CIPHERSUITES                        \
00101     MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,    \
00102     MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
00103 
00104 /*
00105  * Save RAM at the expense of interoperability: do this only if you control
00106  * both ends of the connection!  (See coments in "mbedtls/ssl.h".)
00107  * The minimum size here depends on the certificate chain used as well as the
00108  * typical size of records.
00109  */
00110 #define MBEDTLS_SSL_MAX_CONTENT_LEN             1024
00111 
00112 #include "mbedtls/check_config.h"
00113 
00114 #endif /* MBEDTLS_CONFIG_H */