A metronome using the FRDM K64F board

Committer:
ram54288
Date:
Sun May 14 18:40:18 2017 +0000
Revision:
0:a7a43371b306
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ram54288 0:a7a43371b306 1 /**
ram54288 0:a7a43371b306 2 * Minimal configuration for using mbedtls as part of mbed-client
ram54288 0:a7a43371b306 3 *
ram54288 0:a7a43371b306 4 * NOTE! This is an optimized, minimal configuration for mbed Client.
ram54288 0:a7a43371b306 5 * We know it works with mbed Client but if you want to add more
ram54288 0:a7a43371b306 6 * services/communications to the application yourself - please ensure
ram54288 0:a7a43371b306 7 * you update this configuration accordingly. The default configuration
ram54288 0:a7a43371b306 8 * can be found from mbedTLS Github:
ram54288 0:a7a43371b306 9 *
ram54288 0:a7a43371b306 10 * https://github.com/ARMmbed/mbedtls/blob/development/include/mbedtls/config.h
ram54288 0:a7a43371b306 11 *
ram54288 0:a7a43371b306 12 *
ram54288 0:a7a43371b306 13 * Copyright (C) 2006-2016, ARM Limited, All Rights Reserved
ram54288 0:a7a43371b306 14 * SPDX-License-Identifier: Apache-2.0
ram54288 0:a7a43371b306 15 *
ram54288 0:a7a43371b306 16 * Licensed under the Apache License, Version 2.0 (the "License"); you may
ram54288 0:a7a43371b306 17 * not use this file except in compliance with the License.
ram54288 0:a7a43371b306 18 * You may obtain a copy of the License at
ram54288 0:a7a43371b306 19 *
ram54288 0:a7a43371b306 20 * http://www.apache.org/licenses/LICENSE-2.0
ram54288 0:a7a43371b306 21 *
ram54288 0:a7a43371b306 22 * Unless required by applicable law or agreed to in writing, software
ram54288 0:a7a43371b306 23 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
ram54288 0:a7a43371b306 24 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
ram54288 0:a7a43371b306 25 * See the License for the specific language governing permissions and
ram54288 0:a7a43371b306 26 * limitations under the License.
ram54288 0:a7a43371b306 27 *
ram54288 0:a7a43371b306 28 * This file is part of mbed TLS (https://tls.mbed.org)
ram54288 0:a7a43371b306 29 */
ram54288 0:a7a43371b306 30
ram54288 0:a7a43371b306 31
ram54288 0:a7a43371b306 32 #ifndef MBEDTLS_CUSTOM_CONFIG_H
ram54288 0:a7a43371b306 33 #define MBEDTLS_CUSTOM_CONFIG_H
ram54288 0:a7a43371b306 34
ram54288 0:a7a43371b306 35 /* System support */
ram54288 0:a7a43371b306 36 #define MBEDTLS_HAVE_ASM
ram54288 0:a7a43371b306 37
ram54288 0:a7a43371b306 38 /* mbed TLS feature support */
ram54288 0:a7a43371b306 39 #define MBEDTLS_ECP_DP_SECP256R1_ENABLED
ram54288 0:a7a43371b306 40 #define MBEDTLS_ECP_NIST_OPTIM
ram54288 0:a7a43371b306 41 #define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
ram54288 0:a7a43371b306 42 #define MBEDTLS_SSL_PROTO_TLS1_2
ram54288 0:a7a43371b306 43 #define MBEDTLS_SSL_PROTO_DTLS
ram54288 0:a7a43371b306 44 #define MBEDTLS_SSL_DTLS_ANTI_REPLAY
ram54288 0:a7a43371b306 45 #define MBEDTLS_SSL_DTLS_HELLO_VERIFY
ram54288 0:a7a43371b306 46 #define MBEDTLS_SSL_EXPORT_KEYS
ram54288 0:a7a43371b306 47
ram54288 0:a7a43371b306 48 /* mbed TLS modules */
ram54288 0:a7a43371b306 49 #define MBEDTLS_AES_C
ram54288 0:a7a43371b306 50 #define MBEDTLS_ASN1_PARSE_C
ram54288 0:a7a43371b306 51 #define MBEDTLS_ASN1_WRITE_C
ram54288 0:a7a43371b306 52 #define MBEDTLS_BIGNUM_C
ram54288 0:a7a43371b306 53 #define MBEDTLS_CIPHER_C
ram54288 0:a7a43371b306 54 #define MBEDTLS_CTR_DRBG_C
ram54288 0:a7a43371b306 55 #define MBEDTLS_ECP_C
ram54288 0:a7a43371b306 56 #define MBEDTLS_ENTROPY_C
ram54288 0:a7a43371b306 57 #define MBEDTLS_MD_C
ram54288 0:a7a43371b306 58 #define MBEDTLS_OID_C
ram54288 0:a7a43371b306 59 #define MBEDTLS_PK_C
ram54288 0:a7a43371b306 60 #define MBEDTLS_PK_PARSE_C
ram54288 0:a7a43371b306 61 #define MBEDTLS_SHA256_C
ram54288 0:a7a43371b306 62 #define MBEDTLS_SSL_COOKIE_C
ram54288 0:a7a43371b306 63 #define MBEDTLS_SSL_CLI_C
ram54288 0:a7a43371b306 64 #define MBEDTLS_SSL_SRV_C
ram54288 0:a7a43371b306 65 #define MBEDTLS_SSL_TLS_C
ram54288 0:a7a43371b306 66
ram54288 0:a7a43371b306 67 // XXX mbedclient needs these: mbedtls_x509_crt_free, mbedtls_x509_crt_init, mbedtls_x509_crt_parse
ram54288 0:a7a43371b306 68 #define MBEDTLS_X509_USE_C
ram54288 0:a7a43371b306 69 #define MBEDTLS_X509_CRT_PARSE_C
ram54288 0:a7a43371b306 70
ram54288 0:a7a43371b306 71 // XXX: clean these up!!
ram54288 0:a7a43371b306 72 #define MBEDTLS_SHA512_C
ram54288 0:a7a43371b306 73 #define MBEDTLS_ECDH_C
ram54288 0:a7a43371b306 74 #define MBEDTLS_GCM_C
ram54288 0:a7a43371b306 75
ram54288 0:a7a43371b306 76 #define MBEDTLS_ECDH_C
ram54288 0:a7a43371b306 77 #define MBEDTLS_ECDSA_C
ram54288 0:a7a43371b306 78 #define MBEDTLS_X509_CRT_PARSE_C
ram54288 0:a7a43371b306 79
ram54288 0:a7a43371b306 80 // Remove RSA, save 20KB at total
ram54288 0:a7a43371b306 81 #undef MBEDTLS_RSA_C
ram54288 0:a7a43371b306 82 #undef MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
ram54288 0:a7a43371b306 83
ram54288 0:a7a43371b306 84 // Remove error messages, save 10KB of ROM
ram54288 0:a7a43371b306 85 #undef MBEDTLS_ERROR_C
ram54288 0:a7a43371b306 86
ram54288 0:a7a43371b306 87 // Remove selftesting and save 11KB of ROM
ram54288 0:a7a43371b306 88 #undef MBEDTLS_SELF_TEST
ram54288 0:a7a43371b306 89
ram54288 0:a7a43371b306 90 // Reduces ROM size by 30 kB
ram54288 0:a7a43371b306 91 #undef MBEDTLS_ERROR_STRERROR_DUMMY
ram54288 0:a7a43371b306 92 #undef MBEDTLS_VERSION_FEATURES
ram54288 0:a7a43371b306 93 #undef MBEDTLS_DEBUG_C
ram54288 0:a7a43371b306 94
ram54288 0:a7a43371b306 95 // needed for parsing the certificates
ram54288 0:a7a43371b306 96 #define MBEDTLS_PEM_PARSE_C
ram54288 0:a7a43371b306 97 // dep of the previous
ram54288 0:a7a43371b306 98 #define MBEDTLS_BASE64_C
ram54288 0:a7a43371b306 99
ram54288 0:a7a43371b306 100 // Reduce IO buffer to save RAM, default is 16KB
ram54288 0:a7a43371b306 101 #define MBEDTLS_SSL_MAX_CONTENT_LEN 2048
ram54288 0:a7a43371b306 102
ram54288 0:a7a43371b306 103 // define to save 8KB RAM at the expense of ROM
ram54288 0:a7a43371b306 104 #undef MBEDTLS_AES_ROM_TABLES
ram54288 0:a7a43371b306 105
ram54288 0:a7a43371b306 106 // Save ROM and a few bytes of RAM by specifying our own ciphersuite list
ram54288 0:a7a43371b306 107 #define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
ram54288 0:a7a43371b306 108
ram54288 0:a7a43371b306 109 #include "mbedtls/check_config.h"
ram54288 0:a7a43371b306 110
ram54288 0:a7a43371b306 111 #endif /* MBEDTLS_CUSTOM_CONFIG_H */