pub fn hash_compare(hash_alg: Hash, input: &[u8], hash_to_compare: &[u8]) -> Result<()> {
    initialized()?;

    Status::from(unsafe {
        psa_crypto_sys::psa_hash_compare(
            hash_alg.into(),
            input.as_ptr(),
            input.len(),
            hash_to_compare.as_ptr(),
            hash_to_compare.len(),
        )
    })
    .to_result()
}
/// Calculate the hash of a message and compare it with a reference value
///
/// # Example
///
/// ```
/// use psa_crypto::operations::hash::{hash_compute, hash_compare};
/// use psa_crypto::types::algorithm::Hash;
/// # const MESSAGE: [u8; 3] = [0xb0, 0xbd, 0x69];
/// # const HASH: [u8; 32] = [0x40, 0x96, 0x80, 0x42, 0x21, 0x09, 0x3d, 0xdc, 0xcf, 0xbf, 0x46, 0x83, 0x14, 0x90, 0xea, 0x63, 0xe9, 0xe9, 0x94, 0x14, 0x85, 0x8f, 0x8d, 0x75, 0xff, 0x7f, 0x64, 0x2c, 0x7c, 0xa6, 0x18, 0x03];
/// psa_crypto::init().unwrap();
/// let hash_alg = Hash::Sha256;
/// hash_compare(hash_alg,
///                      &MESSAGE,
///                      &HASH).unwrap();
/// ```
Calculate the hash of a message and compare it with a reference value
Calculate the hash of a message and compare it with a reference value
pub fn hash_compare(hash_alg: Hash, input: &[u8], hash_to_compare: &[u8]) -> Result<()> {
    initialized()?;
    Status::from(unsafe {
        psa_crypto_sys::psa_hash_compare(
            hash_alg.into(),
            input.as_ptr(),
            input.len(),
            hash_to_compare.as_ptr(),
            hash_to_compare.len(),
        )
    })
    .to_result()
}
pub fn hash_compare ( hash_alg : Hash , input : & [ u8 ] , hash_to_compare : & [ u8 ] ) -> Result < ( ) > { initialized ( ) ? ; Status :: from ( unsafe { psa_crypto_sys :: psa_hash_compare ( hash_alg . into ( ) , input . as_ptr ( ) , input . len ( ) , hash_to_compare . as_ptr ( ) , hash_to_compare . len ( ) , ) } ) . to_result ( ) }
Calculate the hash of a message and compare it with a reference value
Calculate the hash of a message and compare it with a reference value
hash_alg
Hash
input
&[u8]
hash_to_compare
&[u8]
hash_alg
Hash
input
&[u8]
hash_to_compare
&[u8]
example
```
use psa_crypto::operations::hash::{hash_compute, hash_compare};
use psa_crypto::types::algorithm::Hash.
` ` ` use psa_crypto :: operations :: hash :: { hash_compute hash_compare } ; use psa_crypto :: types :: algorithm :: Hash .
const message: [u8; 3] = [0xb0, 0xbd, 0x69];
None
const hash: [u8; 32] = [0x40, 0x96, 0x80, 0x42, 0x21, 0x09, 0x3d, 0xdc, 0xcf, 0xbf, 0x46, 0x83, 0x14, 0x90, 0xea, 0x63, 0xe9, 0xe9, 0x94, 0x14, 0x85, 0x8f, 0x8d, 0x75, 0xff, 0x7f, 0x64, 0x2c, 0x7c, 0xa6, 0x18, 0x03];
:init().unwrap();
let hash_alg = Hash::Sha256;
hash_compare(hash_alg,
&MESSAGE,
&HASH).unwrap();
```
: init () . unwrap () ; let hash_alg = Hash :: Sha256 ; hash_compare ( hash_alg &MESSAGE &HASH ) . unwrap () ; ` ` `