Skip to content

Add more ECC dispatch to a driver testing#613

Merged
davidhorstmann-arm merged 15 commits intoMbed-TLS:developmentfrom
ronald-cron-arm:test-driver-3
Jan 28, 2026
Merged

Add more ECC dispatch to a driver testing#613
davidhorstmann-arm merged 15 commits intoMbed-TLS:developmentfrom
ronald-cron-arm:test-driver-3

Conversation

@ronald-cron-arm
Copy link
Copy Markdown
Contributor

@ronald-cron-arm ronald-cron-arm commented Dec 17, 2025

Description

This PR progresses #62.
Depends on: #612

PR checklist

  • changelog not required because: additional testing
  • framework PR not required
  • mbedtls development PR not required because: TF-PSA-Crypto only work
  • mbedtls 3.6 PR not required because: TF-PSA-Crypto only work
  • tests provided: additional crypto tests

@ronald-cron-arm ronald-cron-arm added enhancement New feature or request needs-preceding-pr Requires another PR to be merged first priority-high High priority - will be reviewed soon needs-ci Needs to pass CI tests labels Dec 17, 2025
@ronald-cron-arm ronald-cron-arm added needs-review Every commit must be reviewed by at least two team members needs-reviewer This PR needs someone to pick it up for review and removed needs-ci Needs to pass CI tests labels Dec 18, 2025
@ronald-cron-arm ronald-cron-arm moved this from In Development to In Review in Roadmap pull requests (new board) Dec 18, 2025
@ronald-cron-arm
Copy link
Copy Markdown
Contributor Author

Only the 10 last commits belong to this PRs. The eleven first belong to #612

@bjwtaylor bjwtaylor requested review from bjwtaylor and removed request for bjwtaylor December 23, 2025 15:30
@davidhorstmann-arm davidhorstmann-arm self-requested a review January 13, 2026 10:44
@gilles-peskine-arm gilles-peskine-arm removed the needs-reviewer This PR needs someone to pick it up for review label Jan 13, 2026
@ronald-cron-arm ronald-cron-arm added needs-ci Needs to pass CI tests and removed needs-preceding-pr Requires another PR to be merged first labels Jan 19, 2026
@ronald-cron-arm ronald-cron-arm force-pushed the test-driver-3 branch 2 times, most recently from ef1335f to d273b49 Compare January 21, 2026 13:00
@ronald-cron-arm ronald-cron-arm moved this from In Review to In Development in Roadmap pull requests (new board) Jan 21, 2026
@ronald-cron-arm ronald-cron-arm removed the needs-ci Needs to pass CI tests label Jan 21, 2026
@ronald-cron-arm ronald-cron-arm moved this from In Development to In Review in Roadmap pull requests (new board) Jan 21, 2026
Copy link
Copy Markdown
Contributor

@minosgalanakis minosgalanakis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good but will need to rebase and flix the conflicts now.

I have manually confirmed the configuration used in the component migration and the inclusion of the tests/configs/user-config-accel-ecc.h <-- 'user-config-test-driver-extension.h' against the old MbedTLS macros e.g config_psa_crypto_config_ecp_light_only.

I can confirm there is feature parity, with only two exceptions which I commented bellow and are as intended.

Will approve if we get a green CI.

Comment thread tests/scripts/components-configuration-crypto.sh
Copy link
Copy Markdown
Contributor

@davidhorstmann-arm davidhorstmann-arm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few small comments and questions. Anything marked 'nit' I consider optional.

Comment thread drivers/builtin/src/psa_crypto_pake.c
Comment thread tests/configs/user-config-accel-ecc-ffdh.h Outdated
Comment thread tests/configs/user-config-accel-ecc-ffdh.h Outdated
Comment thread tests/configs/user-config-accel-ecc.h Outdated
Comment thread tests/configs/user-config-accel-ecc.h Outdated
Comment thread tests/scripts/components-configuration-crypto.sh Outdated
Comment thread tests/scripts/components-configuration-crypto.sh
Comment thread tests/scripts/components-configuration-crypto.sh Outdated
@github-project-automation github-project-automation Bot moved this from In Review to In Development in Roadmap pull requests (new board) Jan 27, 2026
…er.h

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
Instead of using legacy error codes and translating
them with `mbedtls_to_psa_error()` to PSA
error codes, use the PSA error codes directly.
Do not replace the legacy macros, only change
their value. This is intended to avoid complicating
backports to 3.6.

Do not aplly this change for MBEDTLS_ERR_ECP_INVALID_KEY
for the time being as there is a tricky case in
`psa_crypto_pake.c` that requires non-trivial investigation.

The new value for MBEDTLS_ERR_ECP_INVALID_KEY would be
that of PSA_ERROR_INVALID_ARGUMENT but in `psa_crypto_pake.c`
it is also translated to PSA_ERROR_DATA_INVALID.

Moreover, we cannot simply translate PSA_ERROR_INVALID_ARGUMENT
to PSA_ERROR_DATA_INVALID in `psa_crypto_pake.c`, because
MBEDTLS_ERR_ECP_BAD_INPUT_DATA also maps to
PSA_ERROR_INVALID_ARGUMENT, and we do not want to translate
in that case to PSA_ERROR_DATA_INVALID.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
Remove guard for MBEDTLS_ERR_ECP_INVALID_KEY translation
so that it is also available for the generated test driver.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
Equivalent of test_psa_crypto_config_accel_ecc_no_ecp_at_all
in Mbed TLS.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
Equivalent of test_psa_crypto_config_accel_ecc_ecp_light_only
in Mbed TLS.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
Use user-config-accel-ecc.h instead of a specific
one to reduce the number of ECC related user config
files.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
Equivalent of test_psa_crypto_config_accel_pake
in Mbed TLS.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
Equivalent of test_psa_crypto_config_accel_ecc_some_key_types
in Mbed TLS.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
Equivalent of test_psa_crypto_config_accel_ecc_weierstrass_curves
and test_psa_crypto_config_accel_ecc_non_weierstrass_curves
in Mbed TLS

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
Move mbedtls_ct_mpi_uint_if* static inline
functions that are bignum specific to
bignum_internal.h.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
Equivalent of test_psa_crypto_config_accel_no_bignum
and test_psa_crypto_config_accel_ecc_ffdh_no_bignum
in Mbed TLS.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
Remove MBEDTLS_PSA_ACCEL_ECC_SECP_[K|R]1_192
as secp192[k|r]1 curves are not supported
anymore.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
In test_accel_ecc_some_key_types, start from no
builtin ECC at all. Then it is just the fact to
disable the acceleration of
KEY_TYPE_ECC_KEY_PAIR_GENERATE that enables
ecp.c.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
…tion

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
@ronald-cron-arm
Copy link
Copy Markdown
Contributor Author

ronald-cron-arm commented Jan 28, 2026

@minosgalanakis @davidhorstmann-arm I've pushed four new commits to address David's comments ending up at 5fa5162 and then rebased the 15 commits on top of development to address the conflict (only one comment line) that appeared when #672 was merged.

Copy link
Copy Markdown
Contributor

@minosgalanakis minosgalanakis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Contributor

@davidhorstmann-arm davidhorstmann-arm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@github-project-automation github-project-automation Bot moved this from In Review to Has Approval in Roadmap pull requests (new board) Jan 28, 2026
@davidhorstmann-arm davidhorstmann-arm added this pull request to the merge queue Jan 28, 2026
@davidhorstmann-arm davidhorstmann-arm added approved Design and code approved - may be waiting for CI or backports and removed needs-review Every commit must be reviewed by at least two team members labels Jan 28, 2026
Merged via the queue into Mbed-TLS:development with commit 5f7d526 Jan 28, 2026
2 checks passed
@github-project-automation github-project-automation Bot moved this from Has Approval to Done in Roadmap pull requests (new board) Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Design and code approved - may be waiting for CI or backports enhancement New feature or request priority-high High priority - will be reviewed soon

Development

Successfully merging this pull request may close these issues.

4 participants