Skip to content

Commit

Permalink
Argon2: Fix docs about minimum value of m_cost (#459)
Browse files Browse the repository at this point in the history
  • Loading branch information
sorairolake authored Sep 5, 2023
1 parent 144b2e4 commit 7d22c17
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions argon2/src/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use password_hash::{ParamsString, PasswordHash};
/// These are parameters which can be encoded into a PHC hash string.
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct Params {
/// Memory size, expressed in kibibytes, between 8 and (2^32)-1.
/// Memory size, expressed in kibibytes, between 8\*`p_cost` and (2^32)-1.
///
/// Value is an integer in decimal (1 to 10 digits).
m_cost: u32,
Expand Down Expand Up @@ -100,7 +100,7 @@ impl Params {
/// Create new parameters.
///
/// # Arguments
/// - `m_cost`: memory size in 1 KiB blocks. Between 8 and (2^32)-1.
/// - `m_cost`: memory size in 1 KiB blocks. Between 8\*`p_cost` and (2^32)-1.
/// - `t_cost`: number of iterations. Between 1 and (2^32)-1.
/// - `p_cost`: degree of parallelism. Between 1 and (2^24)-1.
/// - `output_len`: size of the KDF output in bytes. Default 32.
Expand Down Expand Up @@ -154,7 +154,7 @@ impl Params {
})
}

/// Memory size, expressed in kibibytes. Between 8 and (2^32)-1.
/// Memory size, expressed in kibibytes. Between 8\*`p_cost` and (2^32)-1.
///
/// Value is an integer in decimal (1 to 10 digits).
pub const fn m_cost(&self) -> u32 {
Expand Down Expand Up @@ -432,7 +432,7 @@ impl ParamsBuilder {
Self::DEFAULT
}

/// Set memory size, expressed in kibibytes, between 8 and (2^32)-1.
/// Set memory size, expressed in kibibytes, between 8\*`p_cost` and (2^32)-1.
pub fn m_cost(&mut self, m_cost: u32) -> &mut Self {
self.m_cost = m_cost;
self
Expand Down

0 comments on commit 7d22c17

Please sign in to comment.