Skip to content

Conversation

romen
Copy link
Contributor

@romen romen commented Jun 30, 2025

Introduce a utility method to derive a VerifyingKey from a SigningKey, even when the original seed or precomputed public key is unavailable. This aids in scenarios where private keys are imported from external sources lacking associated public key data.

@tarcieri
Copy link
Member

tarcieri commented Jul 2, 2025

It would be good to add an impl of the signature::Keypair trait: https://docs.rs/signature/3.0.0-rc.1/signature/trait.Keypair.html

You can keep the inherent method too so it still works with the trait out-of-scope

eferollo and others added 2 commits July 27, 2025 22:27
Introduce a utility method to derive a VerifyingKey from a SigningKey,
even when the original seed or precomputed public key is unavailable.
This aids in scenarios where private keys are imported from external
sources lacking associated public key data.

References:
- https://github.com/RustCrypto/signatures/blob/6cc40e5c10b04dae44d91500d5a1afc4a3ff2b49/ml-dsa/src/lib.rs#L856

Co-authored-by: Nicola Tuveri <[email protected]>
Signed-off-by: Francesco Rollo <[email protected]>
Change-Id: I6a6a6964ee2d466e43dc65bf07cfb6d5b4bfa6c4
…_key() method

Implement the `signature::Keypair` trait for `SigningKey`, enabling
derivation of a `VerifyingKey` from a bare signing key. Refactor the
inherent `verifying_key` method to act as a convenience shim around the
trait implementation, ensuring a single source of logic and improving
interoperability.
@romen romen force-pushed the nt/mldsa_derive_public branch from 2fa345d to d57bfe0 Compare July 27, 2025 20:46
@romen
Copy link
Contributor Author

romen commented Jul 27, 2025

@tarcieri sorry, it took some time.

I rebased this PR on latest master, and added the trait implementation.

The inherent method is now just a convenience shim around calling the trait implementation.

@tarcieri tarcieri merged commit 289c868 into RustCrypto:master Jul 28, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants