Function verify
pub fn verify(
algorithm: Algorithm,
iterations: NonZero<u32>,
salt: &[u8],
secret: &[u8],
previously_derived: &[u8],
) -> Result<(), Unspecified>Available on crate features
crypto and ring and std only.Expand description
Verifies that a previously-derived (e.g., using derive) PBKDF2 value
matches the PBKDF2 value derived from the other inputs.
The comparison is done in constant time to prevent timing attacks. The
comparison will fail if previously_derived is empty (has a length of
zero).
| Parameter | RFC 2898 Section 5.2 Term |
|---|---|
| digest_alg | PRF (HMAC with the given digest algorithm). |
iterations | c (iteration count) |
salt | S (salt) |
secret | P (password) |
previously_derived | dk (derived key) |
previously_derived.len() | dkLen (derived key length) |