Skip to content

Make curve25519-dalek and ed25519-dalek required in akd_core - #497

Draft
rootkiller6788 wants to merge 1 commit into
facebook:mainfrom
rootkiller6788:fix/akd-core-non-optional-deps
Draft

Make curve25519-dalek and ed25519-dalek required in akd_core#497
rootkiller6788 wants to merge 1 commit into
facebook:mainfrom
rootkiller6788:fix/akd-core-non-optional-deps

Conversation

@rootkiller6788

Copy link
Copy Markdown

Summary

Fixes #493.

curve25519-dalek and ed25519-dalek are marked optional = true in akd_core/Cargo.toml, enabled only by the vrf feature. However, the ecvrf module is declared unconditionally in lib.rs (pub mod ecvrf;) and verify/base.rs uses VRF types unconditionally, so no code path actually gates the use of these crates.

Because vrf is not part of --no-default-features, the crate does not compile in that configuration:

error[E0433]: failed to resolve: use of unresolved module or unlinked crate `curve25519_dalek`
error[E0432]: unresolved import `ed25519_dalek`
error[E0599]: no variant or associated item named `Vrf` found for enum `VerificationError`

Changes

  • akd_core/Cargo.toml: make curve25519-dalek and ed25519-dalek required dependencies. The vrf feature becomes an empty no-op kept for backwards compatibility with crates that enable akd_core/vrf (e.g. the akd crate).
  • akd_core/src/verify/mod.rs: un-gate the VerificationError::Vrf variant and its From<VrfError> impl, which the verification code always uses.

Testing

Verified locally:

  • cargo check -p akd_core --no-default-features (previously failed, now passes)
  • cargo check -p akd_core (default features)
  • cargo check -p akd_core --features nostd
  • cargo check -p akd_core --features protobuf,serde_serialization
  • cargo check -p akd_core --no-default-features --features nostd
  • cargo check -p akd
  • cargo clippy -p akd_core
  • cargo test -p akd_core (42 passed)
  • cargo test -p akd --lib (106 passed)

The ecvrf module and the VRF verification path in verify/base.rs use
these crates unconditionally, but they were marked optional and gated
behind the vrf feature. Since vrf is not part of the default feature
set, akd_core fails to compile with --no-default-features:

  error[E0433]: failed to resolve: use of unresolved module or unlinked
  crate `curve25519_dalek`

Fix by making both dependencies required, turning the vrf feature into
an empty backwards-compatible no-op, and un-gating the Vrf error
plumbing in VerificationError that the verification code always uses.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Non-optional dependency marked as optional

1 participant