parsec_interface/operations/
psa_hash_compare.rs

1// Copyright 2020 Contributors to the Parsec project.
2// SPDX-License-Identifier: Apache-2.0
3//! # PsaHashCompare operation
4//!
5//! Compute the hash value of a message and compare it with a reference value.
6
7use crate::operations::psa_algorithm::Hash;
8use derivative::Derivative;
9
10/// Native object for hash compare operations.
11#[derive(Derivative)]
12#[derivative(Debug)]
13pub struct Operation {
14    /// The hash algorithm to compute.
15    pub alg: Hash,
16    /// The input to hash.
17    #[derivative(Debug = "ignore")]
18    pub input: zeroize::Zeroizing<Vec<u8>>,
19    /// The reference hash value.
20    #[derivative(Debug = "ignore")]
21    pub hash: zeroize::Zeroizing<Vec<u8>>,
22}
23
24/// Native object for hash compare result.
25#[derive(Debug, Default, Copy, Clone)]
26pub struct Result;