Function psa_crypto::operations::hash::hash_compute
source · pub fn hash_compute(
hash_alg: Hash,
input: &[u8],
hash: &mut [u8]
) -> Result<usize>
Expand description
Calculate hash of a message
Example
use psa_crypto::operations::hash::hash_compute;
use psa_crypto::types::algorithm::Hash;
psa_crypto::init().unwrap();
let hash_alg = Hash::Sha256;
let mut hash = vec![0; hash_alg.hash_length()];
let size = hash_compute(hash_alg,
&MESSAGE,
&mut hash).unwrap();