Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add various configuration components #151

Open
wants to merge 25 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
5cbc142
Bring over both necessary medium config files (regular and PSA style)…
aditya-deshpande-arm Apr 11, 2023
16347fe
configs: adapt to new symbols
valeriosetti Jun 26, 2023
d5c989b
Add change log and non-regression test
ronald-cron-arm Jul 10, 2023
5b7c077
Fix PSA crypto configuration file name
ronald-cron-arm Jul 20, 2023
2d53fff
crypto_config_profile_medium: add comment for new KEY_PAIR symbols
valeriosetti Aug 2, 2023
34d187b
configs: move TFM config to a subdirectory
Sep 6, 2023
98f726f
update headers
daverodgman Nov 2, 2023
c55c8bf
Update license and copyright in config files
daverodgman Nov 3, 2023
5a57f20
Use latest TF-M config with bare-minimum changes
daverodgman Nov 15, 2023
ed3a58a
Add supporting files to enable use of verbatim TF-M config
daverodgman Dec 8, 2023
3e610d5
Use verbatim TF-M configs from upstream
daverodgman Dec 8, 2023
ff9a21e
Mention copyright in the readme
daverodgman Dec 8, 2023
5e2033a
minor tidy-up
daverodgman Dec 8, 2023
5ae7a69
Add a crypto-config file for symmetric-only
Ryan-Everett-arm Apr 25, 2024
7910df1
Address symmetric-only comments
Ryan-Everett-arm Apr 30, 2024
933910b
Resolve some HMAC dependencies automatically
ronald-cron-arm May 15, 2024
21c822a
configs: Migrated config-symmetric-only
minosgalanakis Oct 22, 2024
15471f7
Adapt configs/ext/README.md
yanesca Dec 2, 2024
383e8f4
configs: Migrated config-tfm
minosgalanakis Nov 1, 2024
471cabe
configs: Removed references to MBEDTLS_USE_PSA_CRYPTO
minosgalanakis Dec 2, 2024
4e5f187
test suites: Refactored component_test_ccm_aes_sha256.
minosgalanakis Dec 2, 2024
c8d0234
Adapt TF-M configurations to config split
ronald-cron-arm Dec 5, 2024
5176589
Remove uses of secp244k1
gilles-peskine-arm Jan 2, 2025
63060b9
Update configs README
Harry-Ramsey Jan 23, 2025
c9df6f6
Add various configuration components
Harry-Ramsey Jan 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions configs/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
This directory contains example configuration files.

The examples are generally focused on a particular usage case (eg, support for
a restricted number of ciphersuites) and aim at minimizing resource usage for
this target. They can be used as a basis for custom configurations.

These files are complete replacements for the default crypto_config.h. To use one of
them, you can pick one of the following methods:

1. Replace the default file include/psa/crypto_config.h with the chosen one.

2. Define TF_PSA_CRYPTO_CONFIG_FILE and adjust the include path accordingly.
For example, using cmake:

find . -iname '*cmake*' -not -name CMakeLists.txt -exec rm -rf {} +
CFLAGS="-I$PWD/configs -DCRYPTO_CONFIG_FILE='<foo.h>'" cmake .
make

Note that the second method also works if you want to keep your custom
configuration file outside the TF-PSA-Crypto tree.
28 changes: 28 additions & 0 deletions configs/crypto-config-ccm-aes-sha256.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* \file configs/crypto-config-ccm-aes-sha256.h
*
* \brief PSA crypto configuration with only symmetric cryptography: CCM-AES,
* SHA-256 and key derivation (uses HMAC).
*/
/*
* Copyright The Mbed TLS Contributors
* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
*/

#ifndef PSA_CRYPTO_CONFIG_H
#define PSA_CRYPTO_CONFIG_H

#define PSA_WANT_ALG_CCM 1
#define PSA_WANT_ALG_SHA_256 1
#define PSA_WANT_ALG_TLS12_PRF 1
#define PSA_WANT_ALG_TLS12_PSK_TO_MS 1
#define PSA_WANT_KEY_TYPE_DERIVE 1
#define PSA_WANT_KEY_TYPE_AES 1
#define PSA_WANT_KEY_TYPE_RAW_DATA 1


#define MBEDTLS_PSA_CRYPTO_C
#define MBEDTLS_CTR_DRBG_C
#define MBEDTLS_ENTROPY_C

#endif /* PSA_CRYPTO_CONFIG_H */
91 changes: 91 additions & 0 deletions configs/crypto-config-symmetric-only.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
/**
* \file crypto-config-symmetric-only.h
*
* \brief Crypto configuration without any asymmetric cryptography.
*/
/*
* Copyright The Mbed TLS Contributors
* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
*/

/**
* To be used in conjunction with configs/config-symmetric-only.h. */

#ifndef PSA_CRYPTO_CONFIG_H
#define PSA_CRYPTO_CONFIG_H

#define PSA_WANT_ALG_CBC_NO_PADDING 1
#define PSA_WANT_ALG_CBC_PKCS7 1
#define PSA_WANT_ALG_CCM 1
#define PSA_WANT_ALG_CCM_STAR_NO_TAG 1
#define PSA_WANT_ALG_CFB 1
#define PSA_WANT_ALG_CHACHA20_POLY1305 1
#define PSA_WANT_ALG_CMAC 1
#define PSA_WANT_ALG_CTR 1
#define PSA_WANT_ALG_ECB_NO_PADDING 1
#define PSA_WANT_ALG_GCM 1
#define PSA_WANT_ALG_HKDF 1
#define PSA_WANT_ALG_HKDF_EXTRACT 1
#define PSA_WANT_ALG_HKDF_EXPAND 1
#define PSA_WANT_ALG_HMAC 1
#define PSA_WANT_ALG_MD5 1
#define PSA_WANT_ALG_OFB 1
#define PSA_WANT_ALG_RIPEMD160 1
#define PSA_WANT_ALG_SHA_1 1
#define PSA_WANT_ALG_STREAM_CIPHER 1
#define PSA_WANT_ALG_SHA_224 1
#define PSA_WANT_ALG_SHA_256 1
#define PSA_WANT_ALG_SHA_384 1
#define PSA_WANT_ALG_SHA_512 1
#define PSA_WANT_ALG_SHA3_224 1
#define PSA_WANT_ALG_SHA3_256 1
#define PSA_WANT_ALG_SHA3_384 1
#define PSA_WANT_ALG_SHA3_512 1
#define PSA_WANT_ALG_TLS12_ECJPAKE_TO_PMS 1
#define PSA_WANT_ALG_TLS12_PRF 1
#define PSA_WANT_ALG_TLS12_PSK_TO_MS 1

/* XTS is not yet supported via the PSA API in Mbed TLS. */
//#define PSA_WANT_ALG_XTS 1

#define PSA_WANT_KEY_TYPE_AES 1
#define PSA_WANT_KEY_TYPE_ARIA 1
#define PSA_WANT_KEY_TYPE_CAMELLIA 1
#define PSA_WANT_KEY_TYPE_CHACHA20 1
#define PSA_WANT_KEY_TYPE_DES 1
#define PSA_WANT_KEY_TYPE_HMAC 1

#define MBEDTLS_SELF_TEST

#define MBEDTLS_PSA_CRYPTO_C

/* System support */
//#define MBEDTLS_HAVE_ASM
#define MBEDTLS_HAVE_TIME
#define MBEDTLS_HAVE_TIME_DATE

#define MBEDTLS_FS_IO
#define MBEDTLS_ENTROPY_NV_SEED

/* Mbed TLS modules */
#define MBEDTLS_ASN1_PARSE_C
#define MBEDTLS_ASN1_WRITE_C
#define MBEDTLS_BASE64_C
#define MBEDTLS_CTR_DRBG_C
#define MBEDTLS_ENTROPY_C
#define MBEDTLS_ERROR_C
#define MBEDTLS_HMAC_DRBG_C
#define MBEDTLS_NIST_KW_C
#define MBEDTLS_OID_C
#define MBEDTLS_PEM_PARSE_C
#define MBEDTLS_PEM_WRITE_C
#define MBEDTLS_PKCS5_C
#define MBEDTLS_PKCS12_C
#define MBEDTLS_PLATFORM_C
#define MBEDTLS_PSA_CRYPTO_SE_C
#define MBEDTLS_PSA_CRYPTO_STORAGE_C
#define MBEDTLS_PSA_ITS_FILE_C

//#define MBEDTLS_THREADING_C

#endif /* PSA_CRYPTO_CONFIG_H */
25 changes: 25 additions & 0 deletions configs/ext/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Summary
-------

The file:

* crypto_config_profile_medium.h

are copyright The Mbed TLS Contributors, and are distributed under the license normally
used by Mbed TLS: a dual Apache 2.0 or GPLv2-or-later license.

Background
----------

The file crypto_config_profile_medium.h is taken verbatim from the TF-M source
code here:

https://git.trustedfirmware.org/TF-M/trusted-firmware-m.git/tree/lib/ext/mbedcrypto/mbedcrypto_config

In TF-M, they are distributed under a 3-Clause BSD license, as noted at the top of the files.

In Mbed TLS, with permission from the TF-M project, they are distributed under a dual [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) OR [GPL-2.0-or-later](https://spdx.org/licenses/GPL-2.0-or-later.html) license, with copyright assigned to The Mbed TLS Contributors.

We only retain the note at the top of the files because the intent is to take these files verbatim,
for ease of maintenance. Currently however, they contain changes, showing how these configurations
will need to be adapted for 4.0.
Loading