pub struct KdfParams {
pub m_cost: u32,
pub t_cost: u32,
pub p_cost: u32,
}Expand description
Argon2id cost parameters. Stored (unencrypted) in the file header so the KEK can be re-derived on open.
Fields§
§m_cost: u32Memory cost in KiB.
t_cost: u32Time cost (number of iterations).
p_cost: u32Parallelism (lanes).
Implementations§
Source§impl KdfParams
impl KdfParams
Sourcepub fn raw_key() -> Self
pub fn raw_key() -> Self
PERF-1 step 7 (R-004.5): the Argon2id floor (8 KiB, one pass), for
databases unlocked by a raw random 256-bit key
(Mnemo::create_with_key). A uniformly random key has full entropy
already, so stretching it buys nothing; these are recorded in the
header so the normal open path runs in microseconds. Never use
them with a human passphrase.
Source§impl KdfParams
impl KdfParams
Sourcepub fn for_passphrase(self) -> Self
pub fn for_passphrase(self) -> Self
12.3: the parameters a passphrase gets when a file had self: for
each cost, the larger of self’s and KdfParams::secure’s. Every
surface that rekeys to a passphrase uses it, so a passphrase never
lands on weaker parameters than a file already had, nor below
secure().
Sourcepub fn below_passphrase_floor(&self) -> bool
pub fn below_passphrase_floor(&self) -> bool
12.3: whether these are raw-key parameters, too light for a human
passphrase (KdfParams::raw_key is; KdfParams::fast isn’t).
The engine refuses a passphrase with them, and a file a passphrase
opens with them is reported.
Sourcepub fn is_test_grade(&self) -> bool
pub fn is_test_grade(&self) -> bool
12.3: at or above the floor but below KdfParams::secure’s memory
cost: test-grade parameters, such as KdfParams::fast.