diff --git a/src/lib.rs b/src/lib.rs index 3e7719f..36d3d32 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,6 +4,12 @@ //! For complete examples, look at //! [the tests directory](https://github.com/PlasmaPower/brute-force/tree/master/src/tests). +#[cfg(feature = "curve25519-dalek")] +#[cfg(not(feature = "curve25519"))] +compile_error!( + "Enable brute-force curve25519 support via the `curve25519` feature, not `curve25519-dalek`", +); + use log::warn; use std::{ sync::atomic::{self, AtomicBool}, diff --git a/src/traits.rs b/src/traits.rs index f463b99..d33020d 100644 --- a/src/traits.rs +++ b/src/traits.rs @@ -50,14 +50,14 @@ impl_for_primitive!(u32, i32); impl_for_primitive!(u64, i64); impl_for_primitive!(u128, i128); -#[cfg(feature = "curve25519-dalek")] +#[cfg(feature = "curve25519")] impl Start for curve25519_dalek::scalar::Scalar { fn start_for_thread(_thread: usize, _thread_count: usize) -> Self { Self::random(&mut rand::rngs::OsRng) } } -#[cfg(feature = "curve25519-dalek")] +#[cfg(feature = "curve25519")] impl Advance for curve25519_dalek::scalar::Scalar { fn advance(&mut self) { *self += curve25519_dalek::scalar::Scalar::one();