Skip to main content

verify_key

Function verify_key 

Source
pub fn verify_key(stored: &str, presented: &[u8]) -> bool
Expand description

Whether presented is the secret stored was made from, whatever algorithm stored names. A string that names no known algorithm is never a match.

The only branch is on the algorithm prefix of stored. Past it nothing returns early on where the values differ: SHA-256 digests are compared in constant time and Argon2id does its full work.