bitwarden-core 3.0.0

Internal crate for the bitwarden crate. Do not use.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use bitwarden_crypto::{CryptoError, HashPurpose, Kdf, MasterKey};
use bitwarden_encoding::B64;

pub(super) async fn hash_password(
    email: String,
    password: String,
    kdf_params: Kdf,
    purpose: HashPurpose,
) -> Result<B64, CryptoError> {
    let master_key = MasterKey::derive(&password, &email, &kdf_params)?;

    Ok(master_key.derive_master_key_hash(password.as_bytes(), purpose))
}