parsec_interface/operations/
psa_hash_compute.rs

1// Copyright 2020 Contributors to the Parsec project.
2// SPDX-License-Identifier: Apache-2.0
3//! # PsaHashCompute operation
4//!
5//! Compute the hash value of a message.
6
7use crate::operations::psa_algorithm::Hash;
8use derivative::Derivative;
9
10/// Native object for hash compute 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}
20
21/// Native object for hash compute result.
22#[derive(Derivative)]
23#[derivative(Debug)]
24pub struct Result {
25    /// The `hash` field contains the hash of the message.
26    #[derivative(Debug = "ignore")]
27    pub hash: zeroize::Zeroizing<Vec<u8>>,
28}