aboutsummaryrefslogtreecommitdiff
path: root/srp
diff options
context:
space:
mode:
Diffstat (limited to 'srp')
-rw-r--r--srp/Cargo.toml6
-rw-r--r--srp/README.md73
-rw-r--r--srp/src/lib.rs18
-rw-r--r--srp/src/types.rs2
-rw-r--r--srp/tests/srp.rs (renamed from srp/tests/mod.rs)1
5 files changed, 82 insertions, 18 deletions
diff --git a/srp/Cargo.toml b/srp/Cargo.toml
index 92748e3..9230f8e 100644
--- a/srp/Cargo.toml
+++ b/srp/Cargo.toml
@@ -1,7 +1,6 @@
[package]
name = "srp"
-version = "0.5.0"
-edition = "2018"
+version = "0.6.0-pre"
authors = ["RustCrypto Developers"]
license = "MIT OR Apache-2.0"
description = "Secure Remote Password (SRP) protocol implementation"
@@ -9,6 +8,9 @@ documentation = "https://docs.rs/srp"
repository = "https://github.com/RustCrypto/PAKEs"
keywords = ["crypto", "pake", "authentication"]
categories = ["cryptography", "authentication"]
+readme = "README.md"
+edition = "2018"
+rust-version = "1.56"
[dependencies]
num-bigint = "0.4"
diff --git a/srp/README.md b/srp/README.md
new file mode 100644
index 0000000..3aa7583
--- /dev/null
+++ b/srp/README.md
@@ -0,0 +1,73 @@
+# [RustCrypto]: SRP
+
+[![crate][crate-image]][crate-link]
+[![Docs][docs-image]][docs-link]
+![Apache2/MIT licensed][license-image]
+![Rust Version][rustc-image]
+[![Project Chat][chat-image]][chat-link]
+[![Build Status][build-image]][build-link]
+
+Pure Rust implementation of the [Secure Remote Password] password-authenticated
+key-exchange algorithm.
+
+[Documentation][docs-link]
+
+## About
+
+This implementation is generic over hash functions using the [`Digest`] trait,
+so you will need to choose a hash function, e.g. `Sha256` from [`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 has not yet been tested.
+
+## ⚠️ Security Warning
+
+This crate has never received an independent third party audit for security and
+correctness.
+
+USE AT YOUR OWN RISK!
+
+## Minimum Supported Rust Version
+
+Rust **1.56** or higher.
+
+Minimum supported Rust version can be changed in the future, but it will be
+done with a minor version bump.
+
+## License
+
+Licensed under either of:
+
+ * [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0)
+ * [MIT license](http://opensource.org/licenses/MIT)
+
+at your option.
+
+### Contribution
+
+Unless you explicitly state otherwise, any contribution intentionally submitted
+for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
+dual licensed as above, without any additional terms or conditions.
+
+[//]: # (badges)
+
+[crate-image]: https://img.shields.io/crates/v/srp.svg
+[crate-link]: https://crates.io/crates/srp
+[docs-image]: https://docs.rs/srp/badge.svg
+[docs-link]: https://docs.rs/srp/
+[license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg
+[rustc-image]: https://img.shields.io/badge/rustc-1.56+-blue.svg
+[chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg
+[chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260045-PAKEs
+[build-image]: https://github.com/RustCrypto/PAKEs/actions/workflows/srp.yml/badge.svg
+[build-link]: https://github.com/RustCrypto/PAKEs/actions/workflows/srp.yml
+
+[//]: # (general links)
+
+[RustCrypto]: https://github.com/RustCrypto
+[Secure Remote Password]: https://en.wikipedia.org/wiki/Secure_Remote_Password_protocol
+[`Digest`]: https://docs.rs/digest
+[`sha2`]: https://crates.io/crates/sha2
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
diff --git a/srp/tests/mod.rs b/srp/tests/srp.rs
index 58bfa0f..bf6c30f 100644
--- a/srp/tests/mod.rs
+++ b/srp/tests/srp.rs
@@ -1,4 +1,3 @@
-use rand;
use rand::RngCore;
use sha2::Sha256;