blob: e2f27c55b753ab4d87fab23db6f1d469ced9216f [file] [log] [blame]
Louis Mayencourt7a36f782018-09-24 14:00:57 +01001/*
Maulik Patel28659c42021-01-06 14:09:22 +00002 * Copyright (c) 2019-2021, Arm Limited. All rights reserved.
Louis Mayencourt7a36f782018-09-24 14:00:57 +01003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
7
Jamie Fox0e54ebc2019-04-09 14:21:04 +01008#include <stddef.h>
9#include <stdint.h>
Louis Mayencourt7a36f782018-09-24 14:00:57 +010010
Jamie Fox0e54ebc2019-04-09 14:21:04 +010011#include "tfm_mbedcrypto_include.h"
Antonio de Angelis4743e672019-04-11 11:38:48 +010012
Jamie Fox0e54ebc2019-04-09 14:21:04 +010013#include "tfm_crypto_api.h"
14#include "tfm_crypto_defs.h"
Soby Mathewd8abdfd2020-10-14 10:28:01 +010015#include "tfm_crypto_private.h"
Louis Mayencourt7a36f782018-09-24 14:00:57 +010016
17/*!
18 * \defgroup public_psa Public functions, PSA
19 *
20 */
21
22/*!@{*/
Antonio de Angelisab85ccd2019-03-25 15:14:29 +000023psa_status_t tfm_crypto_mac_sign_setup(psa_invec in_vec[],
24 size_t in_len,
25 psa_outvec out_vec[],
26 size_t out_len)
Louis Mayencourt7a36f782018-09-24 14:00:57 +010027{
Kevin Peng96f802e2019-12-26 16:10:25 +080028#ifdef TFM_CRYPTO_MAC_MODULE_DISABLED
Antonio de Angelis7740b382019-07-16 10:59:25 +010029 return PSA_ERROR_NOT_SUPPORTED;
30#else
Antonio de Angelis4743e672019-04-11 11:38:48 +010031 psa_status_t status = PSA_SUCCESS;
Jamie Fox0e54ebc2019-04-09 14:21:04 +010032 psa_mac_operation_t *operation = NULL;
33
Soby Mathewd8abdfd2020-10-14 10:28:01 +010034 CRYPTO_IN_OUT_LEN_VALIDATE(in_len, 1, 1, out_len, 1, 1);
Antonio de Angelisab85ccd2019-03-25 15:14:29 +000035
Antonio de Angelis4743e672019-04-11 11:38:48 +010036 if ((out_vec[0].len != sizeof(uint32_t)) ||
37 (in_vec[0].len != sizeof(struct tfm_crypto_pack_iovec))) {
Soby Mathewc6e89362020-10-19 16:55:16 +010038 return PSA_ERROR_PROGRAMMER_ERROR;
Antonio de Angelisab85ccd2019-03-25 15:14:29 +000039 }
Antonio de Angelis4743e672019-04-11 11:38:48 +010040 const struct tfm_crypto_pack_iovec *iov = in_vec[0].base;
Jamie Fox0e54ebc2019-04-09 14:21:04 +010041 uint32_t handle = iov->op_handle;
Antonio de Angelis4743e672019-04-11 11:38:48 +010042 uint32_t *handle_out = out_vec[0].base;
Maulik Patel28659c42021-01-06 14:09:22 +000043 psa_key_id_t key_id = iov->key_id;
Antonio de Angelis4743e672019-04-11 11:38:48 +010044 psa_algorithm_t alg = iov->alg;
Maulik Patel28659c42021-01-06 14:09:22 +000045 mbedtls_svc_key_id_t encoded_key;
Antonio de Angelisab85ccd2019-03-25 15:14:29 +000046
Maulik Patel28659c42021-01-06 14:09:22 +000047 status = tfm_crypto_check_handle_owner(key_id, NULL);
Antonio de Angelis60a6fe62019-06-18 15:27:34 +010048 if (status != PSA_SUCCESS) {
49 return status;
50 }
51
Jamie Fox0e54ebc2019-04-09 14:21:04 +010052 /* Init the handle in the operation with the one passed from the iov */
53 *handle_out = iov->op_handle;
54
55 /* Allocate the operation context in the secure world */
56 status = tfm_crypto_operation_alloc(TFM_CRYPTO_MAC_OPERATION,
57 &handle,
58 (void **)&operation);
59 if (status != PSA_SUCCESS) {
60 return status;
Antonio de Angelis4743e672019-04-11 11:38:48 +010061 }
Jamie Fox0e54ebc2019-04-09 14:21:04 +010062
63 *handle_out = handle;
64
Maulik Patel28659c42021-01-06 14:09:22 +000065 status = tfm_crypto_encode_id_and_owner(key_id, &encoded_key);
66 if (status != PSA_SUCCESS) {
67 return status;
68 }
69
70 status = psa_mac_sign_setup(operation, encoded_key, alg);
Jamie Fox0e54ebc2019-04-09 14:21:04 +010071 if (status != PSA_SUCCESS) {
72 /* Release the operation context, ignore if the operation fails. */
73 (void)tfm_crypto_operation_release(handle_out);
74 return status;
75 }
76
77 return PSA_SUCCESS;
Antonio de Angelis7740b382019-07-16 10:59:25 +010078#endif /* TFM_CRYPTO_MAC_MODULE_DISABLED */
Louis Mayencourt7a36f782018-09-24 14:00:57 +010079}
80
Antonio de Angelisab85ccd2019-03-25 15:14:29 +000081psa_status_t tfm_crypto_mac_verify_setup(psa_invec in_vec[],
82 size_t in_len,
83 psa_outvec out_vec[],
84 size_t out_len)
Louis Mayencourt7a36f782018-09-24 14:00:57 +010085{
Kevin Peng96f802e2019-12-26 16:10:25 +080086#ifdef TFM_CRYPTO_MAC_MODULE_DISABLED
Antonio de Angelis7740b382019-07-16 10:59:25 +010087 return PSA_ERROR_NOT_SUPPORTED;
88#else
Antonio de Angelis4743e672019-04-11 11:38:48 +010089 psa_status_t status = PSA_SUCCESS;
Jamie Fox0e54ebc2019-04-09 14:21:04 +010090 psa_mac_operation_t *operation = NULL;
91
Soby Mathewd8abdfd2020-10-14 10:28:01 +010092 CRYPTO_IN_OUT_LEN_VALIDATE(in_len, 1, 1, out_len, 1, 1);
Antonio de Angelisab85ccd2019-03-25 15:14:29 +000093
Antonio de Angelis4743e672019-04-11 11:38:48 +010094 if ((out_vec[0].len != sizeof(uint32_t)) ||
95 (in_vec[0].len != sizeof(struct tfm_crypto_pack_iovec))) {
Soby Mathewc6e89362020-10-19 16:55:16 +010096 return PSA_ERROR_PROGRAMMER_ERROR;
Antonio de Angelisab85ccd2019-03-25 15:14:29 +000097 }
Antonio de Angelis4743e672019-04-11 11:38:48 +010098 const struct tfm_crypto_pack_iovec *iov = in_vec[0].base;
Jamie Fox0e54ebc2019-04-09 14:21:04 +010099 uint32_t handle = iov->op_handle;
Antonio de Angelis4743e672019-04-11 11:38:48 +0100100 uint32_t *handle_out = out_vec[0].base;
Maulik Patel28659c42021-01-06 14:09:22 +0000101 psa_key_id_t key_id = iov->key_id;
Antonio de Angelis4743e672019-04-11 11:38:48 +0100102 psa_algorithm_t alg = iov->alg;
Maulik Patel28659c42021-01-06 14:09:22 +0000103 mbedtls_svc_key_id_t encoded_key;
Antonio de Angelisab85ccd2019-03-25 15:14:29 +0000104
Maulik Patel28659c42021-01-06 14:09:22 +0000105 status = tfm_crypto_check_handle_owner(key_id, NULL);
Antonio de Angelis60a6fe62019-06-18 15:27:34 +0100106 if (status != PSA_SUCCESS) {
107 return status;
108 }
109
Jamie Fox0e54ebc2019-04-09 14:21:04 +0100110 /* Init the handle in the operation with the one passed from the iov */
111 *handle_out = iov->op_handle;
112
113 /* Allocate the operation context in the secure world */
114 status = tfm_crypto_operation_alloc(TFM_CRYPTO_MAC_OPERATION,
115 &handle,
116 (void **)&operation);
117 if (status != PSA_SUCCESS) {
118 return status;
Antonio de Angelis4743e672019-04-11 11:38:48 +0100119 }
Jamie Fox0e54ebc2019-04-09 14:21:04 +0100120
121 *handle_out = handle;
122
Maulik Patel28659c42021-01-06 14:09:22 +0000123 status = tfm_crypto_encode_id_and_owner(key_id, &encoded_key);
124 if (status != PSA_SUCCESS) {
125 return status;
126 }
127
128 status = psa_mac_verify_setup(operation, encoded_key, alg);
Jamie Fox0e54ebc2019-04-09 14:21:04 +0100129 if (status != PSA_SUCCESS) {
130 /* Release the operation context, ignore if the operation fails. */
131 (void)tfm_crypto_operation_release(handle_out);
132 return status;
133 }
134
135 return PSA_SUCCESS;
Antonio de Angelis7740b382019-07-16 10:59:25 +0100136#endif /* TFM_CRYPTO_MAC_MODULE_DISABLED */
Louis Mayencourt7a36f782018-09-24 14:00:57 +0100137}
138
Antonio de Angelisab85ccd2019-03-25 15:14:29 +0000139psa_status_t tfm_crypto_mac_update(psa_invec in_vec[],
140 size_t in_len,
141 psa_outvec out_vec[],
142 size_t out_len)
Louis Mayencourt7a36f782018-09-24 14:00:57 +0100143{
Kevin Peng96f802e2019-12-26 16:10:25 +0800144#ifdef TFM_CRYPTO_MAC_MODULE_DISABLED
Antonio de Angelis7740b382019-07-16 10:59:25 +0100145 return PSA_ERROR_NOT_SUPPORTED;
146#else
Antonio de Angelisab85ccd2019-03-25 15:14:29 +0000147 psa_status_t status = PSA_SUCCESS;
Jamie Fox0e54ebc2019-04-09 14:21:04 +0100148 psa_mac_operation_t *operation = NULL;
Louis Mayencourt7a36f782018-09-24 14:00:57 +0100149
Soby Mathewd8abdfd2020-10-14 10:28:01 +0100150 CRYPTO_IN_OUT_LEN_VALIDATE(in_len, 1, 2, out_len, 1, 1);
Louis Mayencourt7a36f782018-09-24 14:00:57 +0100151
Antonio de Angelis4743e672019-04-11 11:38:48 +0100152 if ((in_vec[0].len != sizeof(struct tfm_crypto_pack_iovec)) ||
153 (out_vec[0].len != sizeof(uint32_t))) {
Soby Mathewc6e89362020-10-19 16:55:16 +0100154 return PSA_ERROR_PROGRAMMER_ERROR;
Louis Mayencourt7a36f782018-09-24 14:00:57 +0100155 }
Antonio de Angelis4743e672019-04-11 11:38:48 +0100156 const struct tfm_crypto_pack_iovec *iov = in_vec[0].base;
Jamie Fox0e54ebc2019-04-09 14:21:04 +0100157 uint32_t handle = iov->op_handle;
Antonio de Angelis4743e672019-04-11 11:38:48 +0100158 uint32_t *handle_out = out_vec[0].base;
159 const uint8_t *input = in_vec[1].base;
160 size_t input_length = in_vec[1].len;
Louis Mayencourt7a36f782018-09-24 14:00:57 +0100161
Antonio de Angelis4743e672019-04-11 11:38:48 +0100162 /* Init the handle in the operation with the one passed from the iov */
Jamie Fox0e54ebc2019-04-09 14:21:04 +0100163 *handle_out = iov->op_handle;
Antonio de Angelisab85ccd2019-03-25 15:14:29 +0000164
Louis Mayencourt7a36f782018-09-24 14:00:57 +0100165 /* Look up the corresponding operation context */
Antonio de Angelisab85ccd2019-03-25 15:14:29 +0000166 status = tfm_crypto_operation_lookup(TFM_CRYPTO_MAC_OPERATION,
Antonio de Angelis4743e672019-04-11 11:38:48 +0100167 handle,
Jamie Fox0e54ebc2019-04-09 14:21:04 +0100168 (void **)&operation);
Antonio de Angelisab85ccd2019-03-25 15:14:29 +0000169 if (status != PSA_SUCCESS) {
170 return status;
Louis Mayencourt7a36f782018-09-24 14:00:57 +0100171 }
172
Jamie Fox0e54ebc2019-04-09 14:21:04 +0100173 status = psa_mac_update(operation, input, input_length);
174 if (status != PSA_SUCCESS) {
175 /* Release the operation context, ignore if the operation fails. */
176 (void)tfm_crypto_operation_release(handle_out);
177 return status;
Louis Mayencourt7a36f782018-09-24 14:00:57 +0100178 }
179
Antonio de Angelisab85ccd2019-03-25 15:14:29 +0000180 return PSA_SUCCESS;
Antonio de Angelis7740b382019-07-16 10:59:25 +0100181#endif /* TFM_CRYPTO_MAC_MODULE_DISABLED */
Louis Mayencourt7a36f782018-09-24 14:00:57 +0100182}
183
Antonio de Angelisab85ccd2019-03-25 15:14:29 +0000184psa_status_t tfm_crypto_mac_sign_finish(psa_invec in_vec[],
185 size_t in_len,
186 psa_outvec out_vec[],
187 size_t out_len)
Louis Mayencourt7a36f782018-09-24 14:00:57 +0100188{
Kevin Peng96f802e2019-12-26 16:10:25 +0800189#ifdef TFM_CRYPTO_MAC_MODULE_DISABLED
Antonio de Angelis7740b382019-07-16 10:59:25 +0100190 return PSA_ERROR_NOT_SUPPORTED;
191#else
Antonio de Angelisab85ccd2019-03-25 15:14:29 +0000192 psa_status_t status = PSA_SUCCESS;
Jamie Fox0e54ebc2019-04-09 14:21:04 +0100193 psa_mac_operation_t *operation = NULL;
Louis Mayencourt7a36f782018-09-24 14:00:57 +0100194
Soby Mathewd8abdfd2020-10-14 10:28:01 +0100195 CRYPTO_IN_OUT_LEN_VALIDATE(in_len, 1, 1, out_len, 1, 2);
Antonio de Angelisab85ccd2019-03-25 15:14:29 +0000196
Antonio de Angelis4743e672019-04-11 11:38:48 +0100197 if ((in_vec[0].len != sizeof(struct tfm_crypto_pack_iovec)) ||
198 (out_vec[0].len != sizeof(uint32_t))) {
Soby Mathewc6e89362020-10-19 16:55:16 +0100199 return PSA_ERROR_PROGRAMMER_ERROR;
Antonio de Angelisab85ccd2019-03-25 15:14:29 +0000200 }
Antonio de Angelis4743e672019-04-11 11:38:48 +0100201 const struct tfm_crypto_pack_iovec *iov = in_vec[0].base;
Jamie Fox0e54ebc2019-04-09 14:21:04 +0100202 uint32_t handle = iov->op_handle;
Antonio de Angelis4743e672019-04-11 11:38:48 +0100203 uint32_t *handle_out = out_vec[0].base;
Antonio de Angelisab85ccd2019-03-25 15:14:29 +0000204 uint8_t *mac = out_vec[1].base;
205 size_t mac_size = out_vec[1].len;
206
Antonio de Angelis4743e672019-04-11 11:38:48 +0100207 /* Init the handle in the operation with the one passed from the iov */
Jamie Fox0e54ebc2019-04-09 14:21:04 +0100208 *handle_out = iov->op_handle;
Antonio de Angelis4743e672019-04-11 11:38:48 +0100209
Antonio de Angelisab85ccd2019-03-25 15:14:29 +0000210 /* Initialise mac_length to zero */
211 out_vec[1].len = 0;
212
Louis Mayencourt7a36f782018-09-24 14:00:57 +0100213 /* Look up the corresponding operation context */
Antonio de Angelisab85ccd2019-03-25 15:14:29 +0000214 status = tfm_crypto_operation_lookup(TFM_CRYPTO_MAC_OPERATION,
Antonio de Angelis4743e672019-04-11 11:38:48 +0100215 handle,
Jamie Fox0e54ebc2019-04-09 14:21:04 +0100216 (void **)&operation);
Antonio de Angelisab85ccd2019-03-25 15:14:29 +0000217 if (status != PSA_SUCCESS) {
218 return status;
Louis Mayencourt7a36f782018-09-24 14:00:57 +0100219 }
220
Jamie Fox0e54ebc2019-04-09 14:21:04 +0100221 status = psa_mac_sign_finish(operation, mac, mac_size, &out_vec[1].len);
222 if (status != PSA_SUCCESS) {
223 /* Release the operation context, ignore if the operation fails. */
224 (void)tfm_crypto_operation_release(handle_out);
225 return status;
Louis Mayencourt7a36f782018-09-24 14:00:57 +0100226 }
227
Jamie Fox0e54ebc2019-04-09 14:21:04 +0100228 status = tfm_crypto_operation_release(handle_out);
229
Antonio de Angelis4743e672019-04-11 11:38:48 +0100230 return status;
Antonio de Angelis7740b382019-07-16 10:59:25 +0100231#endif /* TFM_CRYPTO_MAC_MODULE_DISABLED */
Louis Mayencourt7a36f782018-09-24 14:00:57 +0100232}
233
Antonio de Angelisab85ccd2019-03-25 15:14:29 +0000234psa_status_t tfm_crypto_mac_verify_finish(psa_invec in_vec[],
235 size_t in_len,
236 psa_outvec out_vec[],
237 size_t out_len)
Louis Mayencourt7a36f782018-09-24 14:00:57 +0100238{
Kevin Peng96f802e2019-12-26 16:10:25 +0800239#ifdef TFM_CRYPTO_MAC_MODULE_DISABLED
Antonio de Angelis7740b382019-07-16 10:59:25 +0100240 return PSA_ERROR_NOT_SUPPORTED;
241#else
Antonio de Angelisab85ccd2019-03-25 15:14:29 +0000242 psa_status_t status = PSA_SUCCESS;
Jamie Fox0e54ebc2019-04-09 14:21:04 +0100243 psa_mac_operation_t *operation = NULL;
Louis Mayencourt7a36f782018-09-24 14:00:57 +0100244
Soby Mathewd8abdfd2020-10-14 10:28:01 +0100245 CRYPTO_IN_OUT_LEN_VALIDATE(in_len, 1, 2, out_len, 1, 1);
Antonio de Angelisab85ccd2019-03-25 15:14:29 +0000246
Antonio de Angelis4743e672019-04-11 11:38:48 +0100247 if ((in_vec[0].len != sizeof(struct tfm_crypto_pack_iovec)) ||
248 (out_vec[0].len != sizeof(uint32_t))) {
Soby Mathewc6e89362020-10-19 16:55:16 +0100249 return PSA_ERROR_PROGRAMMER_ERROR;
Antonio de Angelisab85ccd2019-03-25 15:14:29 +0000250 }
Antonio de Angelis4743e672019-04-11 11:38:48 +0100251 const struct tfm_crypto_pack_iovec *iov = in_vec[0].base;
Jamie Fox0e54ebc2019-04-09 14:21:04 +0100252 uint32_t handle = iov->op_handle;
Antonio de Angelis4743e672019-04-11 11:38:48 +0100253 uint32_t *handle_out = out_vec[0].base;
254 const uint8_t *mac = in_vec[1].base;
255 size_t mac_length = in_vec[1].len;
Antonio de Angelisab85ccd2019-03-25 15:14:29 +0000256
Antonio de Angelis4743e672019-04-11 11:38:48 +0100257 /* Init the handle in the operation with the one passed from the iov */
Jamie Fox0e54ebc2019-04-09 14:21:04 +0100258 *handle_out = iov->op_handle;
Louis Mayencourt7a36f782018-09-24 14:00:57 +0100259
260 /* Look up the corresponding operation context */
Antonio de Angelisab85ccd2019-03-25 15:14:29 +0000261 status = tfm_crypto_operation_lookup(TFM_CRYPTO_MAC_OPERATION,
Antonio de Angelis4743e672019-04-11 11:38:48 +0100262 handle,
Jamie Fox0e54ebc2019-04-09 14:21:04 +0100263 (void **)&operation);
Antonio de Angelisab85ccd2019-03-25 15:14:29 +0000264 if (status != PSA_SUCCESS) {
265 return status;
Louis Mayencourt7a36f782018-09-24 14:00:57 +0100266 }
267
Jamie Fox0e54ebc2019-04-09 14:21:04 +0100268 status = psa_mac_verify_finish(operation, mac, mac_length);
269 if (status != PSA_SUCCESS) {
270 /* Release the operation context, ignore if the operation fails. */
271 (void)tfm_crypto_operation_release(handle_out);
272 return status;
Louis Mayencourt7a36f782018-09-24 14:00:57 +0100273 }
274
Jamie Fox0e54ebc2019-04-09 14:21:04 +0100275 status = tfm_crypto_operation_release(handle_out);
276
277 return status;
Antonio de Angelis7740b382019-07-16 10:59:25 +0100278#endif /* TFM_CRYPTO_MAC_MODULE_DISABLED */
Louis Mayencourt7a36f782018-09-24 14:00:57 +0100279}
280
Antonio de Angelisab85ccd2019-03-25 15:14:29 +0000281psa_status_t tfm_crypto_mac_abort(psa_invec in_vec[],
282 size_t in_len,
283 psa_outvec out_vec[],
284 size_t out_len)
Louis Mayencourt7a36f782018-09-24 14:00:57 +0100285{
Kevin Peng96f802e2019-12-26 16:10:25 +0800286#ifdef TFM_CRYPTO_MAC_MODULE_DISABLED
Antonio de Angelis7740b382019-07-16 10:59:25 +0100287 return PSA_ERROR_NOT_SUPPORTED;
288#else
Antonio de Angelisab85ccd2019-03-25 15:14:29 +0000289 psa_status_t status = PSA_SUCCESS;
Jamie Fox0e54ebc2019-04-09 14:21:04 +0100290 psa_mac_operation_t *operation = NULL;
Louis Mayencourt7a36f782018-09-24 14:00:57 +0100291
Soby Mathewd8abdfd2020-10-14 10:28:01 +0100292 CRYPTO_IN_OUT_LEN_VALIDATE(in_len, 1, 1, out_len, 1, 1);
Louis Mayencourt7a36f782018-09-24 14:00:57 +0100293
Antonio de Angelis4743e672019-04-11 11:38:48 +0100294 if ((in_vec[0].len != sizeof(struct tfm_crypto_pack_iovec)) ||
295 (out_vec[0].len != sizeof(uint32_t))) {
Soby Mathewc6e89362020-10-19 16:55:16 +0100296 return PSA_ERROR_PROGRAMMER_ERROR;
Antonio de Angelisab85ccd2019-03-25 15:14:29 +0000297 }
Antonio de Angelis4743e672019-04-11 11:38:48 +0100298 const struct tfm_crypto_pack_iovec *iov = in_vec[0].base;
Jamie Fox0e54ebc2019-04-09 14:21:04 +0100299 uint32_t handle = iov->op_handle;
Antonio de Angelis4743e672019-04-11 11:38:48 +0100300 uint32_t *handle_out = out_vec[0].base;
Antonio de Angelisab85ccd2019-03-25 15:14:29 +0000301
Antonio de Angelis4743e672019-04-11 11:38:48 +0100302 /* Init the handle in the operation with the one passed from the iov */
Jamie Fox0e54ebc2019-04-09 14:21:04 +0100303 *handle_out = iov->op_handle;
Antonio de Angelisab85ccd2019-03-25 15:14:29 +0000304
Louis Mayencourt7a36f782018-09-24 14:00:57 +0100305 /* Look up the corresponding operation context */
Antonio de Angelisab85ccd2019-03-25 15:14:29 +0000306 status = tfm_crypto_operation_lookup(TFM_CRYPTO_MAC_OPERATION,
Antonio de Angelis4743e672019-04-11 11:38:48 +0100307 handle,
Jamie Fox0e54ebc2019-04-09 14:21:04 +0100308 (void **)&operation);
Antonio de Angelisab85ccd2019-03-25 15:14:29 +0000309 if (status != PSA_SUCCESS) {
Antonio de Angelis25e2b2d2019-04-25 14:49:50 +0100310 /* Operation does not exist, so abort has no effect */
311 return PSA_SUCCESS;
Louis Mayencourt7a36f782018-09-24 14:00:57 +0100312 }
313
Jamie Fox0e54ebc2019-04-09 14:21:04 +0100314 status = psa_mac_abort(operation);
315
316 if (status != PSA_SUCCESS) {
317 /* Release the operation context, ignore if the operation fails. */
318 (void)tfm_crypto_operation_release(handle_out);
319 return status;
Louis Mayencourt7a36f782018-09-24 14:00:57 +0100320 }
321
Jamie Fox0e54ebc2019-04-09 14:21:04 +0100322 status = tfm_crypto_operation_release(handle_out);
323
Antonio de Angelis4743e672019-04-11 11:38:48 +0100324 return status;
Antonio de Angelis7740b382019-07-16 10:59:25 +0100325#endif /* TFM_CRYPTO_MAC_MODULE_DISABLED */
Louis Mayencourt7a36f782018-09-24 14:00:57 +0100326}
Antonio de Angelis04debbd2019-10-14 12:12:52 +0100327
328psa_status_t tfm_crypto_mac_compute(psa_invec in_vec[],
329 size_t in_len,
330 psa_outvec out_vec[],
331 size_t out_len)
332{
333 /* FixMe: To be implemented */
334 return PSA_ERROR_NOT_SUPPORTED;
335}
336
337psa_status_t tfm_crypto_mac_verify(psa_invec in_vec[],
338 size_t in_len,
339 psa_outvec out_vec[],
340 size_t out_len)
341{
342 /* FixMe: To be implemented */
343 return PSA_ERROR_NOT_SUPPORTED;
344}
Louis Mayencourt7a36f782018-09-24 14:00:57 +0100345/*!@}*/