From 689dc0ab6af950b027b4bab96f73c427d2c42d6e Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Mon, 20 Dec 2021 18:46:23 -0700 Subject: 2021 edition bump + doc improvements; MSRV 1.56 (#80) - Bumps both `spake2` and `srp` to Rust 2021 edition - Uses the new `doc = include_str!(...)` attribute to include README.md files in the rustdoc - Improves the README.md files, adding an initial one for `srp` - clippy fixes for Rust 1.56 --- srp/src/lib.rs | 18 ++++-------------- srp/src/types.rs | 2 +- 2 files changed, 5 insertions(+), 15 deletions(-) (limited to 'srp/src') diff --git a/srp/src/lib.rs b/srp/src/lib.rs index ada3b8c..375dfb3 100644 --- a/srp/src/lib.rs +++ b/srp/src/lib.rs @@ -1,14 +1,7 @@ -//! [Secure Remote Password][1] (SRP) protocol implementation. -//! -//! This implementation is generic over hash functions using -//! [`Digest`](https://docs.rs/digest) trait, so you will need to choose a hash -//! function, e.g. `Sha256` from [`sha2`](https://crates.io/crates/sha2) crate. -//! Additionally this crate allows to use a specialized password hashing -//! algorithm for private key computation instead of method described in the -//! SRP literature. -//! -//! Compatibility with other implementations was not yet tested. -//! +#![allow(clippy::many_single_char_names)] +#![doc(html_logo_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo_small.png")] +#![doc = include_str!("../README.md")] + //! # Usage //! Add `srp` dependency to your `Cargo.toml`: //! @@ -63,9 +56,6 @@ //! [1]: https://en.wikipedia.org/wiki/Secure_Remote_Password_protocol //! [2]: https://tools.ietf.org/html/rfc5054 -#![allow(clippy::many_single_char_names)] -#![doc(html_logo_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo_small.png")] - pub mod client; pub mod groups; pub mod server; diff --git a/srp/src/types.rs b/srp/src/types.rs index 41742d5..a23954e 100644 --- a/srp/src/types.rs +++ b/srp/src/types.rs @@ -46,7 +46,7 @@ impl SrpGroup { let mut d = D::new(); d.update(&n); d.update(&buf); - BigUint::from_bytes_be(&d.finalize().as_slice()) + BigUint::from_bytes_be(d.finalize().as_slice()) } /// Compute `Hash(N) xor Hash(g)` with given hash function and return SRP parameters -- cgit v1.2.3