fn derive_key_from_password(password: &[u8], salt: &pwhash::Salt) -> crate::Result<Key> {
    // empty key
    let mut key = [0; secretstream::KEYBYTES];

    // derive key from password and salt.
    match pwhash::derive_key(
        &mut key,
        password,
        &salt,
        pwhash::OPSLIMIT_INTERACTIVE,
        pwhash::MEMLIMIT_INTERACTIVE,
    ) {
        Ok(_) => Ok(Key(key)),
        Err(_) => Err(crate::Error::SnapshotError("Could not derive key from password".into())),
    }
}
/// derive key from salt and password.
derive key from salt and password.
derive key from salt and password .
fn derive_key_from_password(password: &[u8], salt: &pwhash::Salt) -> crate::Result<Key> {
    // empty key
    let mut key = [0; secretstream::KEYBYTES];
    // derive key from password and salt.
    match pwhash::derive_key(
        &mut key,
        password,
        &salt,
        pwhash::OPSLIMIT_INTERACTIVE,
        pwhash::MEMLIMIT_INTERACTIVE,
    ) {
        Ok(_) => Ok(Key(key)),
        Err(_) => Err(crate::Error::SnapshotError("Could not derive key from password".into())),
    }
}
fn derive_key_from_password ( password : & [ u8 ] , salt : & pwhash :: Salt ) -> crate :: Result < Key > { // empty key let mut key = [ 0 ; secretstream :: KEYBYTES ] ; // derive key from password and salt. match pwhash :: derive_key ( & mut key , password , & salt , pwhash :: OPSLIMIT_INTERACTIVE , pwhash :: MEMLIMIT_INTERACTIVE , ) { Ok ( _ ) => Ok ( Key ( key ) ) , Err ( _ ) => Err ( crate :: Error :: SnapshotError ( " " . into ( ) ) ) , } }
derive key from salt and password.
derive key from salt and password .
password
&[u8]
salt
&pwhash::Salt