Function argon2::verify_raw_std [] [src]

pub fn verify_raw_std(variant: Variant,
                      version: Version,
                      mem_cost: u32,
                      time_cost: u32,
                      parallelism: u32,
                      pwd: &[u8],
                      salt: &[u8],
                      hash: &[u8])
                      -> Result<bool>

Verifies the password with the supplied settings (standard).

Examples

use argon2::{self, Variant, Version};

let mem_cost = 4096;
let time_cost = 3;
let parallelism = 1;
let pwd = b"password";
let salt = b"somesalt";
let hash = &[137, 104, 116, 234, 240, 252, 23, 45, 187, 193, 255, 103, 166,
             126, 133, 93, 104, 130, 95, 130, 186, 165, 110, 148, 123, 80,
             103, 207, 61, 59, 103, 192];
let res = argon2::verify_raw_std(Variant::Argon2i,
                                 Version::Version13,
                                 mem_cost,
                                 time_cost,
                                 parallelism,
                                 pwd,
                                 salt,
                                 hash).unwrap();
assert!(res);