Improve documentation slightly
This commit is contained in:
parent
5c049caac2
commit
a34b2f621b
|
@ -1,11 +1,11 @@
|
||||||
[package]
|
[package]
|
||||||
name = "brute-force"
|
name = "brute-force"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
authors = ["Lee Bousfield <ljbousfield@gmail.com>"]
|
authors = ["Lee Bousfield <ljbousfield@gmail.com>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
description = "A library for brute forcing arbitrary computations"
|
description = "A library for brute forcing arbitrary computations"
|
||||||
respository = "https://github.com/PlasmaPower/brute-force"
|
repository = "https://github.com/PlasmaPower/brute-force"
|
||||||
documentation = "https://docs.rs/brute-force"
|
documentation = "https://docs.rs/brute-force"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
@ -23,3 +23,6 @@ curve25519 = ["curve25519-dalek", "rand"]
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
blake2 = "0.9.1"
|
blake2 = "0.9.1"
|
||||||
hex = "0.4.2"
|
hex = "0.4.2"
|
||||||
|
|
||||||
|
[package.metadata.docs.rs]
|
||||||
|
rustc-args = ["--features", "curve25519"]
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
|
//! A library for brute forcing arbitrary computations.
|
||||||
|
//! Check out the main entrypoint, [brute_force], or the various [adaptors] you
|
||||||
|
//! can use to write simpler checking functions.
|
||||||
|
//! For complete examples, look at
|
||||||
|
//! [the tests directory](https://github.com/PlasmaPower/brute-force/tree/master/src/tests).
|
||||||
|
|
||||||
use log::warn;
|
use log::warn;
|
||||||
use std::{
|
use std::{
|
||||||
sync::atomic::{self, AtomicBool},
|
sync::atomic::{self, AtomicBool},
|
||||||
|
|
|
@ -50,6 +50,20 @@ 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")]
|
||||||
|
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")]
|
||||||
|
impl Advance for curve25519_dalek::scalar::Scalar {
|
||||||
|
fn advance(&mut self) {
|
||||||
|
*self += curve25519_dalek::scalar::Scalar::one();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
macro_rules! impl_for_bytes {
|
macro_rules! impl_for_bytes {
|
||||||
($n:tt, $($t:tt)*) => {
|
($n:tt, $($t:tt)*) => {
|
||||||
impl<$($t)*> Start for [u8; $n] {
|
impl<$($t)*> Start for [u8; $n] {
|
||||||
|
@ -122,17 +136,3 @@ mod impl_bytes {
|
||||||
impl_for_bytes!(128,);
|
impl_for_bytes!(128,);
|
||||||
impl_for_bytes!(256,);
|
impl_for_bytes!(256,);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "curve25519-dalek")]
|
|
||||||
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")]
|
|
||||||
impl Advance for curve25519_dalek::scalar::Scalar {
|
|
||||||
fn advance(&mut self) {
|
|
||||||
*self += curve25519_dalek::scalar::Scalar::one();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue