Commit graph

4 commits

Author SHA1 Message Date
Valerio Setti
08bd9c72bd mbedtls: use CSPRNG whenever possible as PSA random source
The main problem of MBEDTLS_PSA_CRYPTO_LEGACY_RNG is that it
brings in some legacy modules (entropy + ctr_drbg/hmac_drbg)
which means extra ROM/RAM footprint.
MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG instead simply calls to the
CSPRNG which makes it definitely smaller.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-11-20 15:59:40 -05:00
Valerio Setti
7fadfeec7c mbedtls: do not set PSA_WANT_KEY_TYPE_[RSA/ECC]_KEY_PAIR_BASIC
Mbed TLS automatically sets PSA_WANT_KEY_TYPE_[RSA/ECC]_KEY_PAIR_BASIC
whenever "_IMPORT || _EXPORT || _GENERATE || _DERIVE" operations
are set. Therefore we just set the proper actions where required.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-09-12 10:02:40 +02:00
Tomi Fontanilles
50c03e9bbe modules: mbedtls: fix MBEDTLS_PSA_P256M_DRIVER_RAW Kconfig option
Make it depend on MBEDTLS_PSA_P256M_DRIVER_ENABLED instead of
selecting it.

This fixes the build of
tests/crypto/secp256r1/crypto.secp256r1.p256-m_raw on filtered-out
platforms since PR #75441 (83cd9f5a01).

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-07-15 10:36:58 -04:00
Valerio Setti
e8e7579c93 test: Add an MbedTLS vs TinyCrypt comparison on secp256r1
Add a simple test to compare the footprint of MbedTLS vs
TinyCrypt for the secp256r1 curve. On the MbedTLS side
the test uses the P256M driver developed by the MbedTLS
team. This is an optimized implementation which targets
the secp256r1 curve.

The example itself is pretty easy:
- generate 2 EC keys
- perform key agreement

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-06-12 01:53:58 -07:00