Function argon2::verify_raw [] [src]

pub fn verify_raw(variant: Variant,
                  version: Version,
                  mem_cost: u32,
                  time_cost: u32,
                  lanes: u32,
                  threads: u32,
                  pwd: &[u8],
                  salt: &[u8],
                  secret: &[u8],
                  ad: &[u8],
                  hash: &[u8])
                  -> Result<bool>

Verifies the password with the supplied settings.

Examples

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

let mem_cost = 4096;
let time_cost = 3;
let lanes = 1;
let threads = 1;
let pwd = b"password";
let salt = b"somesalt";
let secret = &[];
let ad = &[];
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(Variant::Argon2i,
                             Version::Version13,
                             mem_cost,
                             time_cost,
                             lanes,
                             threads,
                             pwd,
                             salt,
                             secret,
                             ad,
                             hash).unwrap();
assert!(res);