Add a better error message for bypassing the curve25519 feature
This commit is contained in:
parent
4172b9e9da
commit
bd082f2cda
|
@ -4,6 +4,12 @@
|
||||||
//! For complete examples, look at
|
//! For complete examples, look at
|
||||||
//! [the tests directory](https://github.com/PlasmaPower/brute-force/tree/master/src/tests).
|
//! [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 log::warn;
|
||||||
use std::{
|
use std::{
|
||||||
sync::atomic::{self, AtomicBool},
|
sync::atomic::{self, AtomicBool},
|
||||||
|
|
|
@ -50,14 +50,14 @@ impl_for_primitive!(u32, i32);
|
||||||
impl_for_primitive!(u64, i64);
|
impl_for_primitive!(u64, i64);
|
||||||
impl_for_primitive!(u128, i128);
|
impl_for_primitive!(u128, i128);
|
||||||
|
|
||||||
#[cfg(feature = "curve25519-dalek")]
|
#[cfg(feature = "curve25519")]
|
||||||
impl Start for curve25519_dalek::scalar::Scalar {
|
impl Start for curve25519_dalek::scalar::Scalar {
|
||||||
fn start_for_thread(_thread: usize, _thread_count: usize) -> Self {
|
fn start_for_thread(_thread: usize, _thread_count: usize) -> Self {
|
||||||
Self::random(&mut rand::rngs::OsRng)
|
Self::random(&mut rand::rngs::OsRng)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "curve25519-dalek")]
|
#[cfg(feature = "curve25519")]
|
||||||
impl Advance for curve25519_dalek::scalar::Scalar {
|
impl Advance for curve25519_dalek::scalar::Scalar {
|
||||||
fn advance(&mut self) {
|
fn advance(&mut self) {
|
||||||
*self += curve25519_dalek::scalar::Scalar::one();
|
*self += curve25519_dalek::scalar::Scalar::one();
|
||||||
|
|
Loading…
Reference in New Issue