blob: c3379627e861ce928119f69798f7c125c36a2301 [file] [log] [blame]
Antonio de Angelis8908f472018-08-31 15:44:25 +01001/*
2 * Copyright (c) 2018, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
7
8#ifndef __CRYPTO_PSA_WRAPPERS_H__
9#define __CRYPTO_PSA_WRAPPERS_H__
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15/*!
16 * \struct psa_cipher_update_input
17 *
18 * \brief Input structure for the tfm_crypto_cipher_update_wrapper function
19 *
20 */
21struct psa_cipher_update_input {
22 const uint8_t *input; /*!< Input data to the cipher */
23 size_t input_length; /*!< Size of the input data */
24};
25
26/*!
27 * \struct psa_cipher_update_output
28 *
29 * \brief Output structure for the tfm_crypto_cipher_update_wrapper function
30 *
31 */
32struct psa_cipher_update_output {
33 unsigned char *output; /*!< Buffer to hold the output data from the cipher*/
34 size_t output_size; /*!< Size of the output buffer */
35 size_t *output_length; /*!< Size of the output data from the cipher */
36};
37
38/*!
39 * \brief This function is a TF-M compatible wrapper for the
40 * \ref tfm_crypto_cipher_update implemented in the Crypto service
41 *
42 * \param[in] input_s Pointer to the structure containing input parameters
43 * associated with \ref psa_cipher_update_input
44 * \param[out] output_s Pointer to the structure containing output parameters
45 * associated with \ref psa_cipher_update_output
46 *
47 */
48enum tfm_crypto_err_t tfm_crypto_cipher_update_wrapper(
49 psa_cipher_operation_t *operation,
50 struct psa_cipher_update_input *input_s,
51 struct psa_cipher_update_output *output_s);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif /* __CRYPTO_PSA_WRAPPERS_H__ */