Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions srp/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,16 @@
//! ```
//!

use std::marker::PhantomData;
use alloc::{borrow::ToOwned, vec::Vec};
use core::marker::PhantomData;

use digest::{Digest, Output};
use num_bigint::BigUint;
use subtle::ConstantTimeEq;

use crate::types::{SrpAuthError, SrpGroup};
use crate::utils::{
compute_hash, compute_k, compute_m1, compute_m1_rfc5054, compute_m2, compute_u,
use crate::{
types::{SrpAuthError, SrpGroup},
utils::{compute_hash, compute_k, compute_m1, compute_m1_rfc5054, compute_m2, compute_u},
};

/// SRP client state before handshake with the server.
Expand Down
13 changes: 10 additions & 3 deletions srp/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#![allow(clippy::many_single_char_names)]
#![doc(html_logo_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo_small.png")]
#![no_std]
#![doc = include_str!("../README.md")]
#![doc(
html_logo_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo.svg",
html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo.svg"
)]
#![allow(clippy::many_single_char_names)]

//! # Usage
//! Add `srp` dependency to your `Cargo.toml`:
Expand Down Expand Up @@ -35,7 +39,7 @@
//! - `I` — user identity (username)
//! - `P` — user password
//! - `H` — one-way hash function
//! - `PH` — password hashing algroithm, in the RFC 5054 described as
//! - `PH` — password hashing algorithm, in the RFC 5054 described as
//! `H(s ‖ H(I ‖ ":" ‖ P))`
//! - `^` — (modular) exponentiation
//! - `‖` — concatenation
Expand All @@ -50,6 +54,9 @@
//! [1]: https://en.wikipedia.org/wiki/Secure_Remote_Password_protocol
//! [2]: https://tools.ietf.org/html/rfc5054

#[macro_use]
extern crate alloc;

pub mod client;
pub mod groups;
pub mod server;
Expand Down
3 changes: 2 additions & 1 deletion srp/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@
//! send_proof(verifier.proof());
//! ```
//!
use std::marker::PhantomData;
use alloc::{borrow::ToOwned, vec::Vec};
use core::marker::PhantomData;

use digest::{Digest, Output};
use num_bigint::BigUint;
Expand Down
4 changes: 3 additions & 1 deletion srp/src/types.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
//! Additional SRP types.

use alloc::string::String;
use core::fmt;
use num_bigint::BigUint;
use std::fmt;

/// SRP authentication error.
#[derive(Debug, Clone, Eq, PartialEq)]
Expand Down
1 change: 1 addition & 0 deletions srp/src/utils.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use alloc::vec::Vec;
use digest::{Digest, Output};
use num_bigint::BigUint;

Expand Down