8000 Add support for P256 ECDSA signing to `ecdsa_sw` capsule by pqcfox · Pull Request #4451 · tock/tock · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add support for P256 ECDSA signing to ecdsa_sw capsule #4451

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

Merged
merged 7 commits into from
Jun 4, 2025

Conversation

pqcfox
Copy link
Contributor
@pqcfox pqcfox commented May 30, 2025

Pull Request Overview

This pull request adds signing support to ecdsa_sw for P256.

Testing Strategy

This pull request was tested by creating a capsule test TestEcdsaP256Sign and adding it to the nrf52840dk-test-kernel board definition as an additional test to run.

The signatures generated by EcdsaP256SignatureSigner in this PR use the RFC 6979 approach of deterministic nonce generation, so I was able to generate a known answer test (KAT) using PyCryptodome that signed the hash of "hello world" with the the private key from the EcdsaP256SignatureVerifier test.

The KAT values used for testing are in boards/configurations/nrf52840dk/nrf52840dk-test-kernel/src/test/ecdsa_p256_test.rs in this PR.

TODO or Help Wanted

It may be desirable as well to add a capsule test for EcdsaP256SignatureVerifier at some point; this is something I'd be happy to tackle as well post-MobiSys.

Documentation Updated

  • Updated the relevant files in /docs, or no updates are required.

Formatting

  • Ran make prepush.

@pqcfox pqcfox force-pushed the master branch 3 times, most recently from 5444be2 to 15f722f Compare May 30, 2025 22:46
@bradjc
Copy link
Contributor
bradjc commented Jun 3, 2025

Oh, I didn't realize that #4395 hasn't been merged. Hopefully that will be merged and then it probably makes sense to implement the SetKey HIL for the signer as well.

@pqcfox
Copy link
Contributor Author
pqcfox commented Jun 3, 2025

Ooh, perfect! Adding that this afternoon, thanks for heads up!

@pqcfox
Copy link
Contributor Author
pqcfox commented Jun 4, 2025

Rebasing now to implement SetKey HIL, apologies for noise!

… update latter to better parallel EcdsaP256SignatureVerifier
@pqcfox pqcfox marked this pull request as ready for review June 4, 2025 01:47
@pqcfox
Copy link
Contributor Author
pqcfox commented Jun 4, 2025

(Tests are passing, so marked open for full review!)

@@ -57,3 +57,54 @@ pub trait SignatureVerify<'a, const HL: usize, const SL: usize> {
signature: &'static mut [u8; SL],
) -> Result<(), (ErrorCode, &'static mut [u8; HL], &'static mut [u8; SL])>;
}

/// This trait provides callbacks for when the signing has completed.
pub trait ClientSign<const HL: usize, const SL: usize> {
Copy link
Member

Choose a reason for hiding this comment

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

Should probably be SignClient to align with naming in other HILs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, thank you! Okay if I also change ClientVerify -> VerifyClient as well above?

Copy link
Contributor

Choose a reason for hiding this comment

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

A lot of the cryto HILs (digest, entropy, verify) use ClientX naming. Might make sense to not change now and make a decision to do them all at once.

@ppannuto
Copy link
Member
ppannuto commented Jun 4, 2025

Status: Just needs the mechanical rename SignClient, then I think this is ready to merge.

@bradjc
Copy link
Contributor
bradjc commented Jun 4, 2025

This PR just uses the existing naming scheme, why change it just in this PR?

@ppannuto
Copy link
Member
ppannuto commented Jun 4, 2025

Nevermind, mis-understood the conversation above; thought we had an asymmetry where it made sense to just change one here for the moment. 🚢 ing it

@ppannuto ppannuto added this pull request to the merge queue Jun 4, 2025
Merged via the queue into tock:master with commit cb97307 Jun 4, 2025
11 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0