Function sha_crypt::sha512_crypt
source · pub fn sha512_crypt(
password: &[u8],
salt: &[u8],
params: &Sha512Params
) -> Result<[u8; 64], CryptError>
Expand description
The SHA512 crypt function returned as byte vector
If the provided hash is longer than defs::SALT_MAX_LEN character, it will be stripped down to defs::SALT_MAX_LEN characters.
Arguments
password
- The password to process as a byte vectorsalt
- The salt value to use as a byte vectorparams
- The Sha512Params to use WARNING: Make sure to compare this value in constant time!
Returns
Ok(())
if calculation was successfulErr(errors::CryptError)
otherwise