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

Driver-only ECC: all three top-level modules #7321

Merged
merged 14 commits into from
Mar 29, 2023

Conversation

valeriosetti
Copy link
Contributor

@valeriosetti valeriosetti commented Mar 20, 2023

This is the closing PR of the accelerated EC based algs: all 3 algorithms (ECDSA, ECDH, ECJPAKE) are accelerated at the same time.
Resolves #7272
Depends on #7312

Gatekeeper checklist

  • changelog not required: changelog for every single accelerated component was already added in previous PRs
  • backport not required: enhancement
  • tests provided

@valeriosetti valeriosetti added enhancement needs-review Every commit must be reviewed by at least two team members, needs-ci Needs to pass CI tests needs-reviewer This PR needs someone to pick it up for review size-s Estimated task size: small (~2d) labels Mar 20, 2023
@valeriosetti valeriosetti requested a review from mpg March 20, 2023 16:11
@valeriosetti valeriosetti self-assigned this Mar 20, 2023
@valeriosetti
Copy link
Contributor Author

@mpg As requested, I fixed also remaining comments of #7912, a part from this one, since it is not clear to me what we want to do here

@valeriosetti valeriosetti force-pushed the issue7272 branch 4 times, most recently from 283946c to a420b29 Compare March 21, 2023 11:44
@AndrzejKurek AndrzejKurek self-requested a review March 22, 2023 07:20
@mpg mpg removed the needs-ci Needs to pass CI tests label Mar 22, 2023
Copy link
Contributor

@mpg mpg left a comment

Choose a reason for hiding this comment

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

Just a first pass, making myself familiar with things.

@AndrzejKurek AndrzejKurek removed the needs-reviewer This PR needs someone to pick it up for review label Mar 22, 2023
@valeriosetti valeriosetti force-pushed the issue7272 branch 2 times, most recently from 1f2104e to 9979fe9 Compare March 23, 2023 10:43
@mpg mpg added the needs-work label Mar 28, 2023
Actually this adds both the accelerated test as well as the
reference. Both of them are used to evaluate the driver's
coverage with analyze_outcomes.py script.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
…ge analysis

All these EC based algs are now tested all at once in
test_psa_crypto_config_[accel/reference]_all_ec_algs_use_psa()
functions.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
We keep tests without USE_PSA for single accel components (i.e.
ECDH, ECDSA, ECJPAKE), but when testing for all 3 accelerated
at the same time we use USE_PSA for better test coverage.
However for this purpose there is already the:

component_test_psa_crypto_config_[reference/accel]_all_ec_algs_use_psa()

so we can delete this extra component.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
…e_psa()

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
@valeriosetti valeriosetti dismissed stale reviews from mpg and AndrzejKurek via 4642316 March 28, 2023 14:27
@valeriosetti valeriosetti added priority-high High priority - will be reviewed soon needs-review Every commit must be reviewed by at least two team members, and removed needs-work labels Mar 28, 2023
Copy link
Contributor

@AndrzejKurek AndrzejKurek 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, minor improvements (probably) for a separate PR suggested, thanks!

# Used by tests/scripts/analyze_outcomes.py for comparison purposes.
component_test_psa_crypto_config_reference_ecdh_use_psa () {
msg "test: MBEDTLS_PSA_CRYPTO_CONFIG with reference ECDH + USE_PSA"
# Make build-in fallback not available
Copy link
Contributor

Choose a reason for hiding this comment

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

Very minor:

Suggested change
# Make build-in fallback not available
# Make built-in fallback not available

# Algorithms and key types to accelerate
loc_accel_list="ALG_ECDH KEY_TYPE_ECC_KEY_PAIR KEY_TYPE_ECC_PUBLIC_KEY"
component_test_psa_crypto_config_accel_pake() {
msg "test: MBEDTLS_PSA_CRYPTO_CONFIG with accelerated PAKE"
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor, and pre-existing in other new test components related to acceleration:
The first message should rather be build, or make, not test, which is reserved for make test or ssl-opt.sh :)

# - component_test_psa_crypto_config_accel_all_ec_algs_use_psa;
# - component_test_psa_crypto_config_reference_all_ec_algs_use_psa.
# This supports comparing their test coverage with analyze_outcomes.py.
config_psa_crypto_config_all_ec_algs_use_psa () {
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: There's no mention of the input argument.

@valeriosetti
Copy link
Contributor Author

@AndrzejKurek thanks for the review and feedback!

minor improvements (probably) for a separate PR suggested

There is #7103 which is waiting for this one to be merged, so in case there is no other change required for this PR, I will apply your suggestions in that PR

Copy link
Contributor

@mpg mpg left a comment

Choose a reason for hiding this comment

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

Approving the rebase. I've double-checked that the 3 commits that have been removed had all landed development in the meantime.

@mpg mpg 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 Mar 29, 2023
@mpg mpg merged commit 77902df into Mbed-TLS:development Mar 29, 2023
@valeriosetti valeriosetti deleted the issue7272 branch December 6, 2024 06:01
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 priority-high High priority - will be reviewed soon size-s Estimated task size: small (~2d)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Driver-only ECC: all three top-level modules
3 participants