pub fn convert_hash_algorithm(hash: Hash) -> Result<psa_algorithm_t> {
    match hash {
        #[allow(deprecated)]
        Hash::Md2 => Ok(PSA_ALG_MD2),
        #[allow(deprecated)]
        Hash::Md4 => Ok(PSA_ALG_MD4),
        #[allow(deprecated)]
        Hash::Md5 => Ok(PSA_ALG_MD5),
        Hash::Ripemd160 => Ok(PSA_ALG_RIPEMD160),
        #[allow(deprecated)]
        Hash::Sha1 => Ok(PSA_ALG_SHA_1),
        Hash::Sha224 => Ok(PSA_ALG_SHA_224),
        Hash::Sha256 => Ok(PSA_ALG_SHA_256),
        Hash::Sha384 => Ok(PSA_ALG_SHA_384),
        Hash::Sha512 => Ok(PSA_ALG_SHA_512),
        Hash::Sha512_224 => Ok(PSA_ALG_SHA_512_224),
        Hash::Sha512_256 => Ok(PSA_ALG_SHA_512_256),
        Hash::Sha3_224 => Ok(PSA_ALG_SHA3_224),
        Hash::Sha3_256 => Ok(PSA_ALG_SHA3_256),
        Hash::Sha3_384 => Ok(PSA_ALG_SHA3_384),
        Hash::Sha3_512 => Ok(PSA_ALG_SHA3_512),
        _ => Err(ResponseStatus::PsaErrorNotSupported),
    }
}
/// Converts between native and Mbed Crypto hash algorithm values.
Converts between native and Mbed Crypto hash algorithm values.
Converts between native and Mbed Crypto hash algorithm values .
pub fn convert_hash_algorithm(hash: Hash) -> Result<psa_algorithm_t> {
    match hash {
        #[allow(deprecated)]
        Hash::Md2 => Ok(PSA_ALG_MD2),
        #[allow(deprecated)]
        Hash::Md4 => Ok(PSA_ALG_MD4),
        #[allow(deprecated)]
        Hash::Md5 => Ok(PSA_ALG_MD5),
        Hash::Ripemd160 => Ok(PSA_ALG_RIPEMD160),
        #[allow(deprecated)]
        Hash::Sha1 => Ok(PSA_ALG_SHA_1),
        Hash::Sha224 => Ok(PSA_ALG_SHA_224),
        Hash::Sha256 => Ok(PSA_ALG_SHA_256),
        Hash::Sha384 => Ok(PSA_ALG_SHA_384),
        Hash::Sha512 => Ok(PSA_ALG_SHA_512),
        Hash::Sha512_224 => Ok(PSA_ALG_SHA_512_224),
        Hash::Sha512_256 => Ok(PSA_ALG_SHA_512_256),
        Hash::Sha3_224 => Ok(PSA_ALG_SHA3_224),
        Hash::Sha3_256 => Ok(PSA_ALG_SHA3_256),
        Hash::Sha3_384 => Ok(PSA_ALG_SHA3_384),
        Hash::Sha3_512 => Ok(PSA_ALG_SHA3_512),
        _ => Err(ResponseStatus::PsaErrorNotSupported),
    }
}
pub fn convert_hash_algorithm ( hash : Hash ) -> Result < psa_algorithm_t > { match hash { # [ allow ( deprecated ) ] Hash :: Md2 => Ok ( PSA_ALG_MD2 ) , # [ allow ( deprecated ) ] Hash :: Md4 => Ok ( PSA_ALG_MD4 ) , # [ allow ( deprecated ) ] Hash :: Md5 => Ok ( PSA_ALG_MD5 ) , Hash :: Ripemd160 => Ok ( PSA_ALG_RIPEMD160 ) , # [ allow ( deprecated ) ] Hash :: Sha1 => Ok ( PSA_ALG_SHA_1 ) , Hash :: Sha224 => Ok ( PSA_ALG_SHA_224 ) , Hash :: Sha256 => Ok ( PSA_ALG_SHA_256 ) , Hash :: Sha384 => Ok ( PSA_ALG_SHA_384 ) , Hash :: Sha512 => Ok ( PSA_ALG_SHA_512 ) , Hash :: Sha512_224 => Ok ( PSA_ALG_SHA_512_224 ) , Hash :: Sha512_256 => Ok ( PSA_ALG_SHA_512_256 ) , Hash :: Sha3_224 => Ok ( PSA_ALG_SHA3_224 ) , Hash :: Sha3_256 => Ok ( PSA_ALG_SHA3_256 ) , Hash :: Sha3_384 => Ok ( PSA_ALG_SHA3_384 ) , Hash :: Sha3_512 => Ok ( PSA_ALG_SHA3_512 ) , _ => Err ( ResponseStatus :: PsaErrorNotSupported ) , } }
Converts between native and Mbed Crypto hash algorithm values.
Converts between native and Mbed Crypto hash algorithm values .
hash
Hash
hash
Hash