diff --git a/curve25519-dalek/Cargo.toml b/curve25519-dalek/Cargo.toml index f0896ba..c4fb28a 100644 --- a/curve25519-dalek/Cargo.toml +++ b/curve25519-dalek/Cargo.toml @@ -51,7 +51,7 @@ ff = { version = "0.13", default-features = false, optional = true } group = { version = "0.13", default-features = false, optional = true } rand_core = { version = "0.6.4", default-features = false, optional = true } digest = { version = "0.10", default-features = false, optional = true } -subtle = { version = "2.6.0", default-features = false } +subtle = { version = "2.6.0", default-features = false, features = ["const-generics"]} serde = { version = "1.0", default-features = false, optional = true, features = ["derive"] } zeroize = { version = "1", default-features = false, optional = true } diff --git a/curve25519-dalek/src/montgomery.rs b/curve25519-dalek/src/montgomery.rs index 2be35cd..cb5e2fb 100644 --- a/curve25519-dalek/src/montgomery.rs +++ b/curve25519-dalek/src/montgomery.rs @@ -84,6 +84,12 @@ impl ConstantTimeEq for MontgomeryPoint { } } +impl ConditionallySelectable for MontgomeryPoint { + fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self { + Self(<[u8; 32]>::conditional_select(&a.0, &b.0, choice)) + } +} + impl PartialEq for MontgomeryPoint { fn eq(&self, other: &MontgomeryPoint) -> bool { self.ct_eq(other).into()