Skip to content
Merged
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
14 changes: 7 additions & 7 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 1 and (2^32)-1.
/// Memory size, expressed in kibibytes, between 8 and (2^32)-1.
///
/// Value is an integer in decimal (1 to 10 digits).
m_cost: u32,
Expand Down Expand Up @@ -100,9 +100,9 @@ impl Params {
/// Create new parameters.
///
/// # Arguments
/// - `m_cost`: memory size in 1 KiB blocks. Between 1 and (2^32)-1.
/// - `m_cost`: memory size in 1 KiB blocks. Between 8 and (2^32)-1.
/// - `t_cost`: number of iterations. Between 1 and (2^32)-1.
/// - `p_cost`: degree of parallelism. Between 1 and 255.
/// - `p_cost`: degree of parallelism. Between 1 and (2^24)-1.
/// - `output_len`: size of the KDF output in bytes. Default 32.
pub const fn new(
m_cost: u32,
Expand Down Expand Up @@ -154,7 +154,7 @@ impl Params {
})
}

/// Memory size, expressed in kibibytes. Between 1 and (2^32)-1.
/// Memory size, expressed in kibibytes. Between 8 and (2^32)-1.
///
/// Value is an integer in decimal (1 to 10 digits).
pub const fn m_cost(&self) -> u32 {
Expand All @@ -168,7 +168,7 @@ impl Params {
self.t_cost
}

/// Degree of parallelism. Between 1 and 255.
/// Degree of parallelism. Between 1 and (2^24)-1.
///
/// Value is an integer in decimal (1 to 3 digits).
pub const fn p_cost(&self) -> u32 {
Expand Down Expand Up @@ -432,7 +432,7 @@ impl ParamsBuilder {
Self::DEFAULT
}

/// Set memory size, expressed in kibibytes, between 1 and (2^32)-1.
/// Set memory size, expressed in kibibytes, between 8 and (2^32)-1.
pub fn m_cost(&mut self, m_cost: u32) -> &mut Self {
self.m_cost = m_cost;
self
Expand All @@ -444,7 +444,7 @@ impl ParamsBuilder {
self
}

/// Set degree of parallelism, between 1 and 255.
/// Set degree of parallelism, between 1 and (2^24)-1.
pub fn p_cost(&mut self, p_cost: u32) -> &mut Self {
self.p_cost = p_cost;
self
Expand Down