Manuel Pégourié-Gonnard | 0bc1f23 | 2014-04-30 11:53:50 +0200 | [diff] [blame] | 1 | This directory contains example configuration files. |
| 2 | |
Ronald Cron | 0f2ef4a | 2025-09-30 18:30:32 +0200 | [diff] [blame] | 3 | The examples are generally focused on a particular use case (eg, support for |
| 4 | a restricted set of ciphersuites) and aim to minimize resource usage for |
| 5 | the target. They can be used as a basis for custom configurations. |
Manuel Pégourié-Gonnard | 0bc1f23 | 2014-04-30 11:53:50 +0200 | [diff] [blame] | 6 | |
Ronald Cron | 0f2ef4a | 2025-09-30 18:30:32 +0200 | [diff] [blame] | 7 | These files come in pairs and are complete replacements for the default |
| 8 | mbedtls_config.h and crypto_config.h. The two files of a pair share the same or |
| 9 | very similar name, with the crypto file prefixed by "crypto-". Note |
| 10 | that some of the cryptography configuration files may be located in |
| 11 | tf-psa-crypto/configs. |
Manuel Pégourié-Gonnard | 0bc1f23 | 2014-04-30 11:53:50 +0200 | [diff] [blame] | 12 | |
Ronald Cron | 0f2ef4a | 2025-09-30 18:30:32 +0200 | [diff] [blame] | 13 | To use one of these pairs, you can pick one of the following methods: |
Manuel Pégourié-Gonnard | 0bc1f23 | 2014-04-30 11:53:50 +0200 | [diff] [blame] | 14 | |
Ronald Cron | 0f2ef4a | 2025-09-30 18:30:32 +0200 | [diff] [blame] | 15 | 1. Replace the default files include/mbedtls/mbedtls_config.h and |
| 16 | tf-psa-crypto/include/psa/crypto_config.h with the chosen ones. |
Manuel Pégourié-Gonnard | 0bc1f23 | 2014-04-30 11:53:50 +0200 | [diff] [blame] | 17 | |
Ronald Cron | e943bd7 | 2025-10-05 16:46:20 +0200 | [diff] [blame] | 18 | 2. Use the MBEDTLS_CONFIG_FILE and TF_PSA_CRYPTO_CONFIG_FILE CMake options. For |
| 19 | example, to build out-of-tree with the config-ccm-psk-tls1_2.h and |
| 20 | crypto-config-ccm-psk-tls1_2.h configuration pair: |
Manuel Pégourié-Gonnard | 0bc1f23 | 2014-04-30 11:53:50 +0200 | [diff] [blame] | 21 | |
Ronald Cron | e943bd7 | 2025-10-05 16:46:20 +0200 | [diff] [blame] | 22 | cmake -DMBEDTLS_CONFIG_FILE="configs/config-ccm-psk-tls1_2.h" \ |
| 23 | -DTF_PSA_CRYPTO_CONFIG_FILE="configs/crypto-config-ccm-psk-tls1_2.h" |
| 24 | -B build-psktls12 . |
| 25 | cmake --build build-psktls12 |
Manuel Pégourié-Gonnard | 0bc1f23 | 2014-04-30 11:53:50 +0200 | [diff] [blame] | 26 | |
Ronald Cron | 0f2ef4a | 2025-09-30 18:30:32 +0200 | [diff] [blame] | 27 | The second method also works if you want to keep your custom configuration |
| 28 | files outside the Mbed TLS tree. |