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

Enable Curve448 support via the PSA API #4626

Merged
merged 6 commits into from
Jul 20, 2021

Conversation

silabs-ArchanaM
Copy link
Contributor

@silabs-ArchanaM silabs-ArchanaM commented Jun 8, 2021

Description

Enabled Curve448 support via the PSA API fixing #4249.
Added missing support for validating Curve448 keys fixing #3399.

Status

READY

Requires Backporting

NO

Migrations

NO

Todos

  • Tests
  • Changelog updated

@gilles-peskine-arm gilles-peskine-arm added component-crypto Crypto primitives and low-level interfaces component-psa PSA keystore/dispatch layer (storage, drivers, …) 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 Community labels Jun 8, 2021
@ronald-cron-arm ronald-cron-arm self-requested a review July 6, 2021 13:17
mbedtls_ecp_read_key and mbedtls_ecp_write_key are updated to include
support for Curve448 as prescribed by RFC 7748 §5.

Test suites have been updated to validate curve448 under Montgomery
curves.

Signed-off-by: Archana <[email protected]>
Enable Curve448 support
Add test vectors to evaluate
* RFC 7748
* a known-answer public key export test.
* a known-answer ECDH (X448) test.

Signed-off-by: Archana <[email protected]>
Signed-off-by: Archana <[email protected]>
Copy link
Contributor

@TRodziewicz TRodziewicz left a comment

Choose a reason for hiding this comment

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

I think having a changelog file would be good here.

Copy link
Contributor

@ronald-cron-arm ronald-cron-arm left a comment

Choose a reason for hiding this comment

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

That looks almost good to me, thanks. I have only minor comments. I would also suggest to add a "PSA generate key: ECC, Curve448, good" test similar to the "PSA generate key: ECC, Curve25519, good" one to complete the alignment of curve 25519 and curve 448 testing in test_suite_psa_crypto. Otherwise, the PR needs rebasing now.

Improve the description of some curve 448 tests

Signed-off-by: Archana <[email protected]>
* Add tests to validate MSB not ok for Curve25519 and
  Curve448.
* Add a test to generate key for for Curve448.

Signed-off-by: Archana <[email protected]>
Copy link
Contributor

@ronald-cron-arm ronald-cron-arm left a comment

Choose a reason for hiding this comment

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

Thanks for addressing my comments so quickly. There are a few things that we use to do differently though:

  1. when a PR is in review and it has some conflicts with the branch it is targeted to we prefer to rebase the PR rather than merge the targeted branch (development in the case of this PR). Thus, could you please remove the last merge commit and rather rebase the PR commits on top of the development branch. Feel free to ask if you have some doubt on how to do that.
  2. concerning review conversation we let the reviewer not the PR author resolve the conversations. The PR author usually just uses the rocket icon to indicate to the reviewer that a comment has been addressed.
  3. when you create new commits to address review comments please make commit message that explain what the commit does and group in one commit similar changes. For example, here a possibility is to have one commit to address the style issues with a commit message like "Fix coding style issue" (it would a squash of your three "Update library/ecp.c" commits. Then we could have one commit "test: psa: Improve the description of some curve 448 tests" ...

silabs-ArchanaM referenced this pull request in SiliconLabs/mbedtls Jul 13, 2021
Copy link
Contributor

@ronald-cron-arm ronald-cron-arm left a comment

Choose a reason for hiding this comment

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

Thanks for the changes. Almost good to me, please my last comments below.

silabs-ArchanaM referenced this pull request in SiliconLabs/mbedtls Jul 13, 2021
silabs-ArchanaM referenced this pull request in SiliconLabs/mbedtls Jul 13, 2021
Copy link
Contributor

@ronald-cron-arm ronald-cron-arm left a comment

Choose a reason for hiding this comment

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

Thanks for the changes. You have some trailing spaces in the change log and the CI is not happy. Otherwise LGTM.

Copy link
Contributor

@ronald-cron-arm ronald-cron-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.

@silabs-ArchanaM silabs-ArchanaM removed the needs-reviewer This PR needs someone to pick it up for review label Jul 19, 2021
@gilles-peskine-arm gilles-peskine-arm removed the needs-review Every commit must be reviewed by at least two team members, label Jul 20, 2021
@gilles-peskine-arm gilles-peskine-arm merged commit a1c9fbe into Mbed-TLS:development Jul 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component-crypto Crypto primitives and low-level interfaces component-psa PSA keystore/dispatch layer (storage, drivers, …)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants