Improve documentation slightly

This commit is contained in:
Lee Bousfield 2021-02-03 21:44:54 -06:00
parent 5c049caac2
commit a34b2f621b
3 changed files with 25 additions and 16 deletions

View File

@ -1,11 +1,11 @@
[package]
name = "brute-force"
version = "0.1.0"
version = "0.1.1"
authors = ["Lee Bousfield <ljbousfield@gmail.com>"]
edition = "2018"
license = "MIT"
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"
[dependencies]
@ -23,3 +23,6 @@ curve25519 = ["curve25519-dalek", "rand"]
[dev-dependencies]
blake2 = "0.9.1"
hex = "0.4.2"
[package.metadata.docs.rs]
rustc-args = ["--features", "curve25519"]

View File

@ -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 std::{
sync::atomic::{self, AtomicBool},

View File

@ -50,6 +50,20 @@ impl_for_primitive!(u32, i32);
impl_for_primitive!(u64, i64);
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 {
($n:tt, $($t:tt)*) => {
impl<$($t)*> Start for [u8; $n] {
@ -122,17 +136,3 @@ mod impl_bytes {
impl_for_bytes!(128,);
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();
}
}