Make copy_key optional in fastcrypto-pq - #1008
Open
jonas-lj wants to merge 2 commits into
Open
Conversation
jonas-lj
marked this pull request as ready for review
August 24, 2026 11:07
jonas-lj
force-pushed
the
jonas/mldsa65-gate-copy-key
branch
from
August 24, 2026 11:08
25f6dc5 to
b3e7c45
Compare
jonas-lj
marked this pull request as draft
August 24, 2026 11:08
jonas-lj
marked this pull request as ready for review
August 24, 2026 11:16
fastcrypto-pq depended on fastcrypto with features = ["copy_key"] and implemented KeyPair::copy without the cfg gate the other schemes use. Because Cargo unifies features per build, that turned copy_key on for the whole dependency graph, making Ed25519KeyPair::copy and friends available in crates that deliberately built without it. Forward the feature instead and gate MLDSA65KeyPair::copy like ed25519 does. The two tests that only used copy() to reach the private key now build it from the keypair bytes, so they keep running without the feature.
jonas-lj
force-pushed
the
jonas/mldsa65-gate-copy-key
branch
from
August 24, 2026 12:35
b3e7c45 to
f1f0e43
Compare
jonas-lj
marked this pull request as draft
August 24, 2026 12:36
jonas-lj
marked this pull request as ready for review
August 24, 2026 12:37
this is bc failed with E0046 before this push
Collaborator
|
@jonas-lj Pushed a small fix on top: fastcrypto-cli was hardcoding |
mahdi-mysten
approved these changes
Sep 3, 2026
| [dependencies] | ||
| # copy_key is not optional here | ||
| fastcrypto = { path = "../fastcrypto", features = ["copy_key"] } | ||
| fastcrypto = { path = "../fastcrypto" } |
Collaborator
There was a problem hiding this comment.
cargo check --workspace fails on
fastcrypto/fastcrypto-pq/src/mldsa65/mod.rs
Line 167 in f1f0e43
with error:
error[E0046]: not all trait items implemented, missing: `copy`
--> fastcrypto-pq/src/mldsa65/mod.rs:179:1
the core issue I think is:
fastcrypto/fastcrypto-cli/Cargo.toml
Line 13 in f1f0e43
hardcodes features = ["copy_key"], so feature unification turns it on for the shared fastcrypto build.
| } | ||
|
|
||
| serialize_deserialize_with_to_from_bytes!(MLDSA65KeyPair, MLDSA65_KEYPAIR_LENGTH); | ||
|
|
Collaborator
There was a problem hiding this comment.
add #[cfg(feature = "copy_key")] here
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.