From 21e6a91db8e9cfe8ae382c5b0cd222a453899f8d Mon Sep 17 00:00:00 2001 From: rootkiller6788 Date: Thu, 20 Aug 2026 23:02:27 +0800 Subject: [PATCH] Make curve25519-dalek and ed25519-dalek required in akd_core 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. --- akd_core/Cargo.toml | 10 ++++++---- akd_core/src/verify/mod.rs | 3 --- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/akd_core/Cargo.toml b/akd_core/Cargo.toml index a4931ad0..07a28dda 100644 --- a/akd_core/Cargo.toml +++ b/akd_core/Cargo.toml @@ -21,8 +21,10 @@ nostd = [] # Supported configurations whatsapp_v1 = ["dep:blake3"] experimental = ["dep:blake3"] -# Include the VRF verification logic -vrf = ["ed25519-dalek", "curve25519-dalek"] +# (Deprecated) The VRF verification logic is always compiled in, so this +# feature no longer gates anything. Kept as an empty feature for backwards +# compatibility with crates that enable `akd_core/vrf`. +vrf = [] serde_serialization = ["dep:serde", "dep:serde_bytes", "ed25519-dalek/serde"] # Parallelize VRF calculations during publish parallel_vrf = ["tokio"] @@ -37,11 +39,11 @@ default = ["vrf", "experimental"] [dependencies] ## Required dependencies ## async-trait = "0.1" -curve25519-dalek = { version = "4", optional = true } +curve25519-dalek = { version = "4" } ed25519-dalek = { version = "2", features = [ "digest", "legacy_compatibility", -], optional = true } +] } hex = "0.4" zeroize = "1" diff --git a/akd_core/src/verify/mod.rs b/akd_core/src/verify/mod.rs index 549d0bc6..e0b77ced 100644 --- a/akd_core/src/verify/mod.rs +++ b/akd_core/src/verify/mod.rs @@ -30,7 +30,6 @@ pub enum VerificationError { /// Error verifying a history proof HistoryProof(String), /// Error verifying a VRF proof - #[cfg(feature = "vrf")] Vrf(crate::ecvrf::VrfError), /// Error converting protobuf types during verification #[cfg(feature = "protobuf")] @@ -46,7 +45,6 @@ impl core::fmt::Display for VerificationError { } VerificationError::LookupProof(err) => format!("(Lookup proof) - {err}"), VerificationError::HistoryProof(err) => format!("(History proof) - {err}"), - #[cfg(feature = "vrf")] VerificationError::Vrf(vrf) => vrf.to_string(), #[cfg(feature = "protobuf")] VerificationError::Serialization(proto) => proto.to_string(), @@ -55,7 +53,6 @@ impl core::fmt::Display for VerificationError { } } -#[cfg(feature = "vrf")] impl From for VerificationError { fn from(input: crate::ecvrf::VrfError) -> Self { VerificationError::Vrf(input)