pub fn write_iterations<W: Write>(
writer: &mut W,
iterations: u32,
version: u8,
) -> Result<(), AescryptError>Expand description
Writes the v3 PBKDF2 iteration count as 4 big-endian bytes.
§Format
iterations.to_be_bytes(), written immediately after the extensions block
and immediately before the public IV.
§Errors
AescryptError::UnsupportedVersion—version < 3(v0/v1/v2 do not carry an iteration count in the header).AescryptError::Header—iterationsis outsidePBKDF2_MIN_ITER..=PBKDF2_MAX_ITER.AescryptError::Io—writerreturned an error.
§Security
The iteration count gates PBKDF2 cost and is therefore the primary
password-cracking-resistance knob. Use
DEFAULT_PBKDF2_ITERATIONS
for new files unless you have measured your platform.