blob: e70ffb34af4601158c27d11534ff48e09c7866a3 [file] [log] [blame]
Gilles Peskined5e5e6d2024-01-04 16:42:40 +01001/* Automatically generated by generate_psa_wrappers.py, do not edit! */
2
3/* Copyright The Mbed TLS Contributors
4 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
5 */
6
7#if !defined(MBEDTLS_CONFIG_FILE)
8#include "mbedtls/config.h"
9#else
10#include MBEDTLS_CONFIG_FILE
11#endif
12
Gilles Peskinea980aa02024-01-04 20:51:38 +010013#if defined(MBEDTLS_PSA_CRYPTO_C) && defined(MBEDTLS_TEST_HOOKS) && \
14 !defined(RECORD_PSA_STATUS_COVERAGE_LOG)
Gilles Peskined5e5e6d2024-01-04 16:42:40 +010015
16#include <psa/crypto.h>
17
Gilles Peskine42fa8ea2024-01-04 16:59:28 +010018#include <test/memory.h>
Gilles Peskined5e5e6d2024-01-04 16:42:40 +010019#include <test/psa_crypto_helpers.h>
20#include <test/psa_test_wrappers.h>
21
22/* Wrapper for mbedtls_psa_inject_entropy */
23#if defined(MBEDTLS_PSA_INJECT_ENTROPY)
24psa_status_t mbedtls_test_wrap_mbedtls_psa_inject_entropy(
25 const uint8_t *arg0_seed,
26 size_t arg1_seed_size)
27{
28 psa_status_t status = (mbedtls_psa_inject_entropy)(arg0_seed, arg1_seed_size);
29 return status;
30}
31#endif /* defined(MBEDTLS_PSA_INJECT_ENTROPY) */
32
33/* Wrapper for mbedtls_psa_platform_get_builtin_key */
34#if defined(MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS)
35psa_status_t mbedtls_test_wrap_mbedtls_psa_platform_get_builtin_key(
36 mbedtls_svc_key_id_t arg0_key_id,
37 psa_key_lifetime_t *arg1_lifetime,
38 psa_drv_slot_number_t *arg2_slot_number)
39{
40 psa_status_t status = (mbedtls_psa_platform_get_builtin_key)(arg0_key_id, arg1_lifetime, arg2_slot_number);
41 return status;
42}
43#endif /* defined(MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS) */
44
45/* Wrapper for mbedtls_psa_register_se_key */
46#if defined(MBEDTLS_PSA_CRYPTO_SE_C)
47psa_status_t mbedtls_test_wrap_mbedtls_psa_register_se_key(
48 const psa_key_attributes_t *arg0_attributes)
49{
50 psa_status_t status = (mbedtls_psa_register_se_key)(arg0_attributes);
51 return status;
52}
53#endif /* defined(MBEDTLS_PSA_CRYPTO_SE_C) */
54
55/* Wrapper for psa_aead_decrypt */
56psa_status_t mbedtls_test_wrap_psa_aead_decrypt(
57 mbedtls_svc_key_id_t arg0_key,
58 psa_algorithm_t arg1_alg,
59 const uint8_t *arg2_nonce,
60 size_t arg3_nonce_length,
61 const uint8_t *arg4_additional_data,
62 size_t arg5_additional_data_length,
63 const uint8_t *arg6_ciphertext,
64 size_t arg7_ciphertext_length,
65 uint8_t *arg8_plaintext,
66 size_t arg9_plaintext_size,
67 size_t *arg10_plaintext_length)
68{
David Horstmann43c128d2024-03-13 15:57:46 +000069#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
David Horstmann436b2ef2024-01-22 14:36:01 +000070 MBEDTLS_TEST_MEMORY_POISON(arg2_nonce, arg3_nonce_length);
71 MBEDTLS_TEST_MEMORY_POISON(arg4_additional_data, arg5_additional_data_length);
72 MBEDTLS_TEST_MEMORY_POISON(arg6_ciphertext, arg7_ciphertext_length);
73 MBEDTLS_TEST_MEMORY_POISON(arg8_plaintext, arg9_plaintext_size);
David Horstmann43c128d2024-03-13 15:57:46 +000074#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +010075 psa_status_t status = (psa_aead_decrypt)(arg0_key, arg1_alg, arg2_nonce, arg3_nonce_length, arg4_additional_data, arg5_additional_data_length, arg6_ciphertext, arg7_ciphertext_length, arg8_plaintext, arg9_plaintext_size, arg10_plaintext_length);
David Horstmann43c128d2024-03-13 15:57:46 +000076#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
David Horstmann436b2ef2024-01-22 14:36:01 +000077 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_nonce, arg3_nonce_length);
78 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_additional_data, arg5_additional_data_length);
79 MBEDTLS_TEST_MEMORY_UNPOISON(arg6_ciphertext, arg7_ciphertext_length);
80 MBEDTLS_TEST_MEMORY_UNPOISON(arg8_plaintext, arg9_plaintext_size);
David Horstmann43c128d2024-03-13 15:57:46 +000081#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +010082 return status;
83}
84
85/* Wrapper for psa_aead_encrypt */
86psa_status_t mbedtls_test_wrap_psa_aead_encrypt(
87 mbedtls_svc_key_id_t arg0_key,
88 psa_algorithm_t arg1_alg,
89 const uint8_t *arg2_nonce,
90 size_t arg3_nonce_length,
91 const uint8_t *arg4_additional_data,
92 size_t arg5_additional_data_length,
93 const uint8_t *arg6_plaintext,
94 size_t arg7_plaintext_length,
95 uint8_t *arg8_ciphertext,
96 size_t arg9_ciphertext_size,
97 size_t *arg10_ciphertext_length)
98{
David Horstmann43c128d2024-03-13 15:57:46 +000099#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
David Horstmann436b2ef2024-01-22 14:36:01 +0000100 MBEDTLS_TEST_MEMORY_POISON(arg2_nonce, arg3_nonce_length);
101 MBEDTLS_TEST_MEMORY_POISON(arg4_additional_data, arg5_additional_data_length);
102 MBEDTLS_TEST_MEMORY_POISON(arg6_plaintext, arg7_plaintext_length);
103 MBEDTLS_TEST_MEMORY_POISON(arg8_ciphertext, arg9_ciphertext_size);
David Horstmann43c128d2024-03-13 15:57:46 +0000104#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100105 psa_status_t status = (psa_aead_encrypt)(arg0_key, arg1_alg, arg2_nonce, arg3_nonce_length, arg4_additional_data, arg5_additional_data_length, arg6_plaintext, arg7_plaintext_length, arg8_ciphertext, arg9_ciphertext_size, arg10_ciphertext_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000106#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
David Horstmann436b2ef2024-01-22 14:36:01 +0000107 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_nonce, arg3_nonce_length);
108 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_additional_data, arg5_additional_data_length);
109 MBEDTLS_TEST_MEMORY_UNPOISON(arg6_plaintext, arg7_plaintext_length);
110 MBEDTLS_TEST_MEMORY_UNPOISON(arg8_ciphertext, arg9_ciphertext_size);
David Horstmann43c128d2024-03-13 15:57:46 +0000111#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100112 return status;
113}
114
115/* Wrapper for psa_asymmetric_decrypt */
116psa_status_t mbedtls_test_wrap_psa_asymmetric_decrypt(
117 mbedtls_svc_key_id_t arg0_key,
118 psa_algorithm_t arg1_alg,
119 const uint8_t *arg2_input,
120 size_t arg3_input_length,
121 const uint8_t *arg4_salt,
122 size_t arg5_salt_length,
123 uint8_t *arg6_output,
124 size_t arg7_output_size,
125 size_t *arg8_output_length)
126{
David Horstmann43c128d2024-03-13 15:57:46 +0000127#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubney2b614f92024-01-31 16:57:30 +0000128 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
129 MBEDTLS_TEST_MEMORY_POISON(arg4_salt, arg5_salt_length);
130 MBEDTLS_TEST_MEMORY_POISON(arg6_output, arg7_output_size);
David Horstmann43c128d2024-03-13 15:57:46 +0000131#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100132 psa_status_t status = (psa_asymmetric_decrypt)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_salt, arg5_salt_length, arg6_output, arg7_output_size, arg8_output_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000133#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubney2b614f92024-01-31 16:57:30 +0000134 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
135 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_salt, arg5_salt_length);
136 MBEDTLS_TEST_MEMORY_UNPOISON(arg6_output, arg7_output_size);
David Horstmann43c128d2024-03-13 15:57:46 +0000137#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100138 return status;
139}
140
141/* Wrapper for psa_asymmetric_encrypt */
142psa_status_t mbedtls_test_wrap_psa_asymmetric_encrypt(
143 mbedtls_svc_key_id_t arg0_key,
144 psa_algorithm_t arg1_alg,
145 const uint8_t *arg2_input,
146 size_t arg3_input_length,
147 const uint8_t *arg4_salt,
148 size_t arg5_salt_length,
149 uint8_t *arg6_output,
150 size_t arg7_output_size,
151 size_t *arg8_output_length)
152{
David Horstmann43c128d2024-03-13 15:57:46 +0000153#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneyd8adccf2024-01-30 14:41:05 +0000154 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
155 MBEDTLS_TEST_MEMORY_POISON(arg4_salt, arg5_salt_length);
156 MBEDTLS_TEST_MEMORY_POISON(arg6_output, arg7_output_size);
David Horstmann43c128d2024-03-13 15:57:46 +0000157#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100158 psa_status_t status = (psa_asymmetric_encrypt)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_salt, arg5_salt_length, arg6_output, arg7_output_size, arg8_output_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000159#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneyd8adccf2024-01-30 14:41:05 +0000160 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
161 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_salt, arg5_salt_length);
162 MBEDTLS_TEST_MEMORY_UNPOISON(arg6_output, arg7_output_size);
David Horstmann43c128d2024-03-13 15:57:46 +0000163#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100164 return status;
165}
166
167/* Wrapper for psa_cipher_abort */
168psa_status_t mbedtls_test_wrap_psa_cipher_abort(
169 psa_cipher_operation_t *arg0_operation)
170{
171 psa_status_t status = (psa_cipher_abort)(arg0_operation);
172 return status;
173}
174
175/* Wrapper for psa_cipher_decrypt */
176psa_status_t mbedtls_test_wrap_psa_cipher_decrypt(
177 mbedtls_svc_key_id_t arg0_key,
178 psa_algorithm_t arg1_alg,
179 const uint8_t *arg2_input,
180 size_t arg3_input_length,
181 uint8_t *arg4_output,
182 size_t arg5_output_size,
183 size_t *arg6_output_length)
184{
David Horstmann43c128d2024-03-13 15:57:46 +0000185#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Gabor Mezei143864c2024-01-24 16:58:40 +0100186 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
187 MBEDTLS_TEST_MEMORY_POISON(arg4_output, arg5_output_size);
David Horstmann43c128d2024-03-13 15:57:46 +0000188#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100189 psa_status_t status = (psa_cipher_decrypt)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_output, arg5_output_size, arg6_output_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000190#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Gabor Mezei143864c2024-01-24 16:58:40 +0100191 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
192 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_output, arg5_output_size);
David Horstmann43c128d2024-03-13 15:57:46 +0000193#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100194 return status;
195}
196
197/* Wrapper for psa_cipher_decrypt_setup */
198psa_status_t mbedtls_test_wrap_psa_cipher_decrypt_setup(
199 psa_cipher_operation_t *arg0_operation,
200 mbedtls_svc_key_id_t arg1_key,
201 psa_algorithm_t arg2_alg)
202{
203 psa_status_t status = (psa_cipher_decrypt_setup)(arg0_operation, arg1_key, arg2_alg);
204 return status;
205}
206
207/* Wrapper for psa_cipher_encrypt */
208psa_status_t mbedtls_test_wrap_psa_cipher_encrypt(
209 mbedtls_svc_key_id_t arg0_key,
210 psa_algorithm_t arg1_alg,
211 const uint8_t *arg2_input,
212 size_t arg3_input_length,
213 uint8_t *arg4_output,
214 size_t arg5_output_size,
215 size_t *arg6_output_length)
216{
David Horstmann43c128d2024-03-13 15:57:46 +0000217#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Ryan Everett810421c2024-01-25 12:09:09 +0000218 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
219 MBEDTLS_TEST_MEMORY_POISON(arg4_output, arg5_output_size);
David Horstmann43c128d2024-03-13 15:57:46 +0000220#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100221 psa_status_t status = (psa_cipher_encrypt)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_output, arg5_output_size, arg6_output_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000222#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Ryan Everett810421c2024-01-25 12:09:09 +0000223 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
224 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_output, arg5_output_size);
David Horstmann43c128d2024-03-13 15:57:46 +0000225#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100226 return status;
227}
228
229/* Wrapper for psa_cipher_encrypt_setup */
230psa_status_t mbedtls_test_wrap_psa_cipher_encrypt_setup(
231 psa_cipher_operation_t *arg0_operation,
232 mbedtls_svc_key_id_t arg1_key,
233 psa_algorithm_t arg2_alg)
234{
235 psa_status_t status = (psa_cipher_encrypt_setup)(arg0_operation, arg1_key, arg2_alg);
236 return status;
237}
238
239/* Wrapper for psa_cipher_finish */
240psa_status_t mbedtls_test_wrap_psa_cipher_finish(
241 psa_cipher_operation_t *arg0_operation,
242 uint8_t *arg1_output,
243 size_t arg2_output_size,
244 size_t *arg3_output_length)
245{
David Horstmann43c128d2024-03-13 15:57:46 +0000246#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Gabor Mezei143864c2024-01-24 16:58:40 +0100247 MBEDTLS_TEST_MEMORY_POISON(arg1_output, arg2_output_size);
David Horstmann43c128d2024-03-13 15:57:46 +0000248#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100249 psa_status_t status = (psa_cipher_finish)(arg0_operation, arg1_output, arg2_output_size, arg3_output_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000250#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Gabor Mezei143864c2024-01-24 16:58:40 +0100251 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_output, arg2_output_size);
David Horstmann43c128d2024-03-13 15:57:46 +0000252#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100253 return status;
254}
255
256/* Wrapper for psa_cipher_generate_iv */
257psa_status_t mbedtls_test_wrap_psa_cipher_generate_iv(
258 psa_cipher_operation_t *arg0_operation,
259 uint8_t *arg1_iv,
260 size_t arg2_iv_size,
261 size_t *arg3_iv_length)
262{
David Horstmann43c128d2024-03-13 15:57:46 +0000263#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Gabor Mezei50bcca22024-02-01 10:39:56 +0100264 MBEDTLS_TEST_MEMORY_POISON(arg1_iv, arg2_iv_size);
David Horstmann43c128d2024-03-13 15:57:46 +0000265#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100266 psa_status_t status = (psa_cipher_generate_iv)(arg0_operation, arg1_iv, arg2_iv_size, arg3_iv_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000267#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Gabor Mezei50bcca22024-02-01 10:39:56 +0100268 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_iv, arg2_iv_size);
David Horstmann43c128d2024-03-13 15:57:46 +0000269#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100270 return status;
271}
272
273/* Wrapper for psa_cipher_set_iv */
274psa_status_t mbedtls_test_wrap_psa_cipher_set_iv(
275 psa_cipher_operation_t *arg0_operation,
276 const uint8_t *arg1_iv,
277 size_t arg2_iv_length)
278{
David Horstmann43c128d2024-03-13 15:57:46 +0000279#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Gabor Mezei50bcca22024-02-01 10:39:56 +0100280 MBEDTLS_TEST_MEMORY_POISON(arg1_iv, arg2_iv_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000281#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100282 psa_status_t status = (psa_cipher_set_iv)(arg0_operation, arg1_iv, arg2_iv_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000283#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Gabor Mezei50bcca22024-02-01 10:39:56 +0100284 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_iv, arg2_iv_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000285#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100286 return status;
287}
288
289/* Wrapper for psa_cipher_update */
290psa_status_t mbedtls_test_wrap_psa_cipher_update(
291 psa_cipher_operation_t *arg0_operation,
292 const uint8_t *arg1_input,
293 size_t arg2_input_length,
294 uint8_t *arg3_output,
295 size_t arg4_output_size,
296 size_t *arg5_output_length)
297{
David Horstmann43c128d2024-03-13 15:57:46 +0000298#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Gabor Mezei143864c2024-01-24 16:58:40 +0100299 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
300 MBEDTLS_TEST_MEMORY_POISON(arg3_output, arg4_output_size);
David Horstmann43c128d2024-03-13 15:57:46 +0000301#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100302 psa_status_t status = (psa_cipher_update)(arg0_operation, arg1_input, arg2_input_length, arg3_output, arg4_output_size, arg5_output_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000303#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Gabor Mezei143864c2024-01-24 16:58:40 +0100304 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
305 MBEDTLS_TEST_MEMORY_UNPOISON(arg3_output, arg4_output_size);
David Horstmann43c128d2024-03-13 15:57:46 +0000306#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100307 return status;
308}
309
310/* Wrapper for psa_copy_key */
311psa_status_t mbedtls_test_wrap_psa_copy_key(
312 mbedtls_svc_key_id_t arg0_source_key,
313 const psa_key_attributes_t *arg1_attributes,
314 mbedtls_svc_key_id_t *arg2_target_key)
315{
316 psa_status_t status = (psa_copy_key)(arg0_source_key, arg1_attributes, arg2_target_key);
317 return status;
318}
319
320/* Wrapper for psa_crypto_init */
321psa_status_t mbedtls_test_wrap_psa_crypto_init(void)
322{
323 psa_status_t status = (psa_crypto_init)();
324 return status;
325}
326
327/* Wrapper for psa_destroy_key */
328psa_status_t mbedtls_test_wrap_psa_destroy_key(
329 mbedtls_svc_key_id_t arg0_key)
330{
331 psa_status_t status = (psa_destroy_key)(arg0_key);
332 return status;
333}
334
335/* Wrapper for psa_export_key */
336psa_status_t mbedtls_test_wrap_psa_export_key(
337 mbedtls_svc_key_id_t arg0_key,
338 uint8_t *arg1_data,
339 size_t arg2_data_size,
340 size_t *arg3_data_length)
341{
David Horstmann43c128d2024-03-13 15:57:46 +0000342#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Ryan Everettdcbc1d32024-01-25 11:04:48 +0000343 MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_size);
David Horstmann43c128d2024-03-13 15:57:46 +0000344#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100345 psa_status_t status = (psa_export_key)(arg0_key, arg1_data, arg2_data_size, arg3_data_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000346#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Ryan Everettdcbc1d32024-01-25 11:04:48 +0000347 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_size);
David Horstmann43c128d2024-03-13 15:57:46 +0000348#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100349 return status;
350}
351
352/* Wrapper for psa_export_public_key */
353psa_status_t mbedtls_test_wrap_psa_export_public_key(
354 mbedtls_svc_key_id_t arg0_key,
355 uint8_t *arg1_data,
356 size_t arg2_data_size,
357 size_t *arg3_data_length)
358{
David Horstmann43c128d2024-03-13 15:57:46 +0000359#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Ryan Everettdcbc1d32024-01-25 11:04:48 +0000360 MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_size);
David Horstmann43c128d2024-03-13 15:57:46 +0000361#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100362 psa_status_t status = (psa_export_public_key)(arg0_key, arg1_data, arg2_data_size, arg3_data_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000363#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Ryan Everettdcbc1d32024-01-25 11:04:48 +0000364 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_size);
David Horstmann43c128d2024-03-13 15:57:46 +0000365#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100366 return status;
367}
368
369/* Wrapper for psa_generate_key */
370psa_status_t mbedtls_test_wrap_psa_generate_key(
371 const psa_key_attributes_t *arg0_attributes,
372 mbedtls_svc_key_id_t *arg1_key)
373{
374 psa_status_t status = (psa_generate_key)(arg0_attributes, arg1_key);
375 return status;
376}
377
378/* Wrapper for psa_generate_random */
379psa_status_t mbedtls_test_wrap_psa_generate_random(
380 uint8_t *arg0_output,
381 size_t arg1_output_size)
382{
David Horstmann43c128d2024-03-13 15:57:46 +0000383#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
David Horstmann4e821502024-02-06 15:44:08 +0000384 MBEDTLS_TEST_MEMORY_POISON(arg0_output, arg1_output_size);
David Horstmann43c128d2024-03-13 15:57:46 +0000385#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100386 psa_status_t status = (psa_generate_random)(arg0_output, arg1_output_size);
David Horstmann43c128d2024-03-13 15:57:46 +0000387#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
David Horstmann4e821502024-02-06 15:44:08 +0000388 MBEDTLS_TEST_MEMORY_UNPOISON(arg0_output, arg1_output_size);
David Horstmann43c128d2024-03-13 15:57:46 +0000389#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100390 return status;
391}
392
393/* Wrapper for psa_get_key_attributes */
394psa_status_t mbedtls_test_wrap_psa_get_key_attributes(
395 mbedtls_svc_key_id_t arg0_key,
396 psa_key_attributes_t *arg1_attributes)
397{
398 psa_status_t status = (psa_get_key_attributes)(arg0_key, arg1_attributes);
399 return status;
400}
401
402/* Wrapper for psa_hash_abort */
403psa_status_t mbedtls_test_wrap_psa_hash_abort(
404 psa_hash_operation_t *arg0_operation)
405{
406 psa_status_t status = (psa_hash_abort)(arg0_operation);
407 return status;
408}
409
410/* Wrapper for psa_hash_clone */
411psa_status_t mbedtls_test_wrap_psa_hash_clone(
412 const psa_hash_operation_t *arg0_source_operation,
413 psa_hash_operation_t *arg1_target_operation)
414{
415 psa_status_t status = (psa_hash_clone)(arg0_source_operation, arg1_target_operation);
416 return status;
417}
418
419/* Wrapper for psa_hash_compare */
420psa_status_t mbedtls_test_wrap_psa_hash_compare(
421 psa_algorithm_t arg0_alg,
422 const uint8_t *arg1_input,
423 size_t arg2_input_length,
424 const uint8_t *arg3_hash,
425 size_t arg4_hash_length)
426{
David Horstmann43c128d2024-03-13 15:57:46 +0000427#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneyebf93292024-01-25 17:09:10 +0000428 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
429 MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000430#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100431 psa_status_t status = (psa_hash_compare)(arg0_alg, arg1_input, arg2_input_length, arg3_hash, arg4_hash_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000432#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneyebf93292024-01-25 17:09:10 +0000433 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
434 MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000435#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100436 return status;
437}
438
439/* Wrapper for psa_hash_compute */
440psa_status_t mbedtls_test_wrap_psa_hash_compute(
441 psa_algorithm_t arg0_alg,
442 const uint8_t *arg1_input,
443 size_t arg2_input_length,
444 uint8_t *arg3_hash,
445 size_t arg4_hash_size,
446 size_t *arg5_hash_length)
447{
David Horstmann43c128d2024-03-13 15:57:46 +0000448#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneyebf93292024-01-25 17:09:10 +0000449 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
450 MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_size);
David Horstmann43c128d2024-03-13 15:57:46 +0000451#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100452 psa_status_t status = (psa_hash_compute)(arg0_alg, arg1_input, arg2_input_length, arg3_hash, arg4_hash_size, arg5_hash_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000453#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneyebf93292024-01-25 17:09:10 +0000454 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
455 MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_size);
David Horstmann43c128d2024-03-13 15:57:46 +0000456#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100457 return status;
458}
459
460/* Wrapper for psa_hash_finish */
461psa_status_t mbedtls_test_wrap_psa_hash_finish(
462 psa_hash_operation_t *arg0_operation,
463 uint8_t *arg1_hash,
464 size_t arg2_hash_size,
465 size_t *arg3_hash_length)
466{
David Horstmann43c128d2024-03-13 15:57:46 +0000467#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneyebf93292024-01-25 17:09:10 +0000468 MBEDTLS_TEST_MEMORY_POISON(arg1_hash, arg2_hash_size);
David Horstmann43c128d2024-03-13 15:57:46 +0000469#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100470 psa_status_t status = (psa_hash_finish)(arg0_operation, arg1_hash, arg2_hash_size, arg3_hash_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000471#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneyebf93292024-01-25 17:09:10 +0000472 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_hash, arg2_hash_size);
David Horstmann43c128d2024-03-13 15:57:46 +0000473#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100474 return status;
475}
476
477/* Wrapper for psa_hash_setup */
478psa_status_t mbedtls_test_wrap_psa_hash_setup(
479 psa_hash_operation_t *arg0_operation,
480 psa_algorithm_t arg1_alg)
481{
482 psa_status_t status = (psa_hash_setup)(arg0_operation, arg1_alg);
483 return status;
484}
485
486/* Wrapper for psa_hash_update */
487psa_status_t mbedtls_test_wrap_psa_hash_update(
488 psa_hash_operation_t *arg0_operation,
489 const uint8_t *arg1_input,
490 size_t arg2_input_length)
491{
David Horstmann43c128d2024-03-13 15:57:46 +0000492#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneyebf93292024-01-25 17:09:10 +0000493 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000494#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100495 psa_status_t status = (psa_hash_update)(arg0_operation, arg1_input, arg2_input_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000496#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneyebf93292024-01-25 17:09:10 +0000497 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000498#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100499 return status;
500}
501
502/* Wrapper for psa_hash_verify */
503psa_status_t mbedtls_test_wrap_psa_hash_verify(
504 psa_hash_operation_t *arg0_operation,
505 const uint8_t *arg1_hash,
506 size_t arg2_hash_length)
507{
David Horstmann43c128d2024-03-13 15:57:46 +0000508#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneyebf93292024-01-25 17:09:10 +0000509 MBEDTLS_TEST_MEMORY_POISON(arg1_hash, arg2_hash_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000510#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100511 psa_status_t status = (psa_hash_verify)(arg0_operation, arg1_hash, arg2_hash_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000512#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneyebf93292024-01-25 17:09:10 +0000513 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_hash, arg2_hash_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000514#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100515 return status;
516}
517
518/* Wrapper for psa_import_key */
519psa_status_t mbedtls_test_wrap_psa_import_key(
520 const psa_key_attributes_t *arg0_attributes,
521 const uint8_t *arg1_data,
522 size_t arg2_data_length,
523 mbedtls_svc_key_id_t *arg3_key)
524{
David Horstmann43c128d2024-03-13 15:57:46 +0000525#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Ryan Everettdcbc1d32024-01-25 11:04:48 +0000526 MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000527#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100528 psa_status_t status = (psa_import_key)(arg0_attributes, arg1_data, arg2_data_length, arg3_key);
David Horstmann43c128d2024-03-13 15:57:46 +0000529#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Ryan Everettdcbc1d32024-01-25 11:04:48 +0000530 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000531#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100532 return status;
533}
534
535/* Wrapper for psa_key_derivation_abort */
536psa_status_t mbedtls_test_wrap_psa_key_derivation_abort(
537 psa_key_derivation_operation_t *arg0_operation)
538{
539 psa_status_t status = (psa_key_derivation_abort)(arg0_operation);
540 return status;
541}
542
543/* Wrapper for psa_key_derivation_get_capacity */
544psa_status_t mbedtls_test_wrap_psa_key_derivation_get_capacity(
545 const psa_key_derivation_operation_t *arg0_operation,
546 size_t *arg1_capacity)
547{
548 psa_status_t status = (psa_key_derivation_get_capacity)(arg0_operation, arg1_capacity);
549 return status;
550}
551
552/* Wrapper for psa_key_derivation_input_bytes */
553psa_status_t mbedtls_test_wrap_psa_key_derivation_input_bytes(
554 psa_key_derivation_operation_t *arg0_operation,
555 psa_key_derivation_step_t arg1_step,
556 const uint8_t *arg2_data,
557 size_t arg3_data_length)
558{
David Horstmann43c128d2024-03-13 15:57:46 +0000559#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Ryan Everett6c9e69d2024-02-09 16:23:25 +0000560 MBEDTLS_TEST_MEMORY_POISON(arg2_data, arg3_data_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000561#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100562 psa_status_t status = (psa_key_derivation_input_bytes)(arg0_operation, arg1_step, arg2_data, arg3_data_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000563#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Ryan Everett6c9e69d2024-02-09 16:23:25 +0000564 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_data, arg3_data_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000565#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100566 return status;
567}
568
569/* Wrapper for psa_key_derivation_input_key */
570psa_status_t mbedtls_test_wrap_psa_key_derivation_input_key(
571 psa_key_derivation_operation_t *arg0_operation,
572 psa_key_derivation_step_t arg1_step,
573 mbedtls_svc_key_id_t arg2_key)
574{
575 psa_status_t status = (psa_key_derivation_input_key)(arg0_operation, arg1_step, arg2_key);
576 return status;
577}
578
579/* Wrapper for psa_key_derivation_key_agreement */
580psa_status_t mbedtls_test_wrap_psa_key_derivation_key_agreement(
581 psa_key_derivation_operation_t *arg0_operation,
582 psa_key_derivation_step_t arg1_step,
583 mbedtls_svc_key_id_t arg2_private_key,
584 const uint8_t *arg3_peer_key,
585 size_t arg4_peer_key_length)
586{
David Horstmann43c128d2024-03-13 15:57:46 +0000587#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneydb5d6072024-02-15 14:18:02 +0000588 MBEDTLS_TEST_MEMORY_POISON(arg3_peer_key, arg4_peer_key_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000589#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100590 psa_status_t status = (psa_key_derivation_key_agreement)(arg0_operation, arg1_step, arg2_private_key, arg3_peer_key, arg4_peer_key_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000591#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneydb5d6072024-02-15 14:18:02 +0000592 MBEDTLS_TEST_MEMORY_UNPOISON(arg3_peer_key, arg4_peer_key_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000593#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100594 return status;
595}
596
597/* Wrapper for psa_key_derivation_output_bytes */
598psa_status_t mbedtls_test_wrap_psa_key_derivation_output_bytes(
599 psa_key_derivation_operation_t *arg0_operation,
600 uint8_t *arg1_output,
601 size_t arg2_output_length)
602{
David Horstmann43c128d2024-03-13 15:57:46 +0000603#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Ryan Everett6c9e69d2024-02-09 16:23:25 +0000604 MBEDTLS_TEST_MEMORY_POISON(arg1_output, arg2_output_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000605#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100606 psa_status_t status = (psa_key_derivation_output_bytes)(arg0_operation, arg1_output, arg2_output_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000607#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Ryan Everett6c9e69d2024-02-09 16:23:25 +0000608 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_output, arg2_output_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000609#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100610 return status;
611}
612
613/* Wrapper for psa_key_derivation_output_key */
614psa_status_t mbedtls_test_wrap_psa_key_derivation_output_key(
615 const psa_key_attributes_t *arg0_attributes,
616 psa_key_derivation_operation_t *arg1_operation,
617 mbedtls_svc_key_id_t *arg2_key)
618{
619 psa_status_t status = (psa_key_derivation_output_key)(arg0_attributes, arg1_operation, arg2_key);
620 return status;
621}
622
623/* Wrapper for psa_key_derivation_set_capacity */
624psa_status_t mbedtls_test_wrap_psa_key_derivation_set_capacity(
625 psa_key_derivation_operation_t *arg0_operation,
626 size_t arg1_capacity)
627{
628 psa_status_t status = (psa_key_derivation_set_capacity)(arg0_operation, arg1_capacity);
629 return status;
630}
631
632/* Wrapper for psa_key_derivation_setup */
633psa_status_t mbedtls_test_wrap_psa_key_derivation_setup(
634 psa_key_derivation_operation_t *arg0_operation,
635 psa_algorithm_t arg1_alg)
636{
637 psa_status_t status = (psa_key_derivation_setup)(arg0_operation, arg1_alg);
638 return status;
639}
640
641/* Wrapper for psa_mac_abort */
642psa_status_t mbedtls_test_wrap_psa_mac_abort(
643 psa_mac_operation_t *arg0_operation)
644{
645 psa_status_t status = (psa_mac_abort)(arg0_operation);
646 return status;
647}
648
649/* Wrapper for psa_mac_compute */
650psa_status_t mbedtls_test_wrap_psa_mac_compute(
651 mbedtls_svc_key_id_t arg0_key,
652 psa_algorithm_t arg1_alg,
653 const uint8_t *arg2_input,
654 size_t arg3_input_length,
655 uint8_t *arg4_mac,
656 size_t arg5_mac_size,
657 size_t *arg6_mac_length)
658{
David Horstmann43c128d2024-03-13 15:57:46 +0000659#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubney6b915032024-01-30 12:07:38 +0000660 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
661 MBEDTLS_TEST_MEMORY_POISON(arg4_mac, arg5_mac_size);
David Horstmann43c128d2024-03-13 15:57:46 +0000662#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100663 psa_status_t status = (psa_mac_compute)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_mac, arg5_mac_size, arg6_mac_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000664#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubney6b915032024-01-30 12:07:38 +0000665 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
666 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_mac, arg5_mac_size);
David Horstmann43c128d2024-03-13 15:57:46 +0000667#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100668 return status;
669}
670
671/* Wrapper for psa_mac_sign_finish */
672psa_status_t mbedtls_test_wrap_psa_mac_sign_finish(
673 psa_mac_operation_t *arg0_operation,
674 uint8_t *arg1_mac,
675 size_t arg2_mac_size,
676 size_t *arg3_mac_length)
677{
David Horstmann43c128d2024-03-13 15:57:46 +0000678#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubney6b915032024-01-30 12:07:38 +0000679 MBEDTLS_TEST_MEMORY_POISON(arg1_mac, arg2_mac_size);
David Horstmann43c128d2024-03-13 15:57:46 +0000680#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100681 psa_status_t status = (psa_mac_sign_finish)(arg0_operation, arg1_mac, arg2_mac_size, arg3_mac_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000682#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubney6b915032024-01-30 12:07:38 +0000683 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_mac, arg2_mac_size);
David Horstmann43c128d2024-03-13 15:57:46 +0000684#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100685 return status;
686}
687
688/* Wrapper for psa_mac_sign_setup */
689psa_status_t mbedtls_test_wrap_psa_mac_sign_setup(
690 psa_mac_operation_t *arg0_operation,
691 mbedtls_svc_key_id_t arg1_key,
692 psa_algorithm_t arg2_alg)
693{
694 psa_status_t status = (psa_mac_sign_setup)(arg0_operation, arg1_key, arg2_alg);
695 return status;
696}
697
698/* Wrapper for psa_mac_update */
699psa_status_t mbedtls_test_wrap_psa_mac_update(
700 psa_mac_operation_t *arg0_operation,
701 const uint8_t *arg1_input,
702 size_t arg2_input_length)
703{
David Horstmann43c128d2024-03-13 15:57:46 +0000704#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubney6b915032024-01-30 12:07:38 +0000705 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000706#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100707 psa_status_t status = (psa_mac_update)(arg0_operation, arg1_input, arg2_input_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000708#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubney6b915032024-01-30 12:07:38 +0000709 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000710#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100711 return status;
712}
713
714/* Wrapper for psa_mac_verify */
715psa_status_t mbedtls_test_wrap_psa_mac_verify(
716 mbedtls_svc_key_id_t arg0_key,
717 psa_algorithm_t arg1_alg,
718 const uint8_t *arg2_input,
719 size_t arg3_input_length,
720 const uint8_t *arg4_mac,
721 size_t arg5_mac_length)
722{
David Horstmann43c128d2024-03-13 15:57:46 +0000723#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubney6b915032024-01-30 12:07:38 +0000724 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
725 MBEDTLS_TEST_MEMORY_POISON(arg4_mac, arg5_mac_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000726#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100727 psa_status_t status = (psa_mac_verify)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_mac, arg5_mac_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000728#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubney6b915032024-01-30 12:07:38 +0000729 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
730 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_mac, arg5_mac_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000731#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100732 return status;
733}
734
735/* Wrapper for psa_mac_verify_finish */
736psa_status_t mbedtls_test_wrap_psa_mac_verify_finish(
737 psa_mac_operation_t *arg0_operation,
738 const uint8_t *arg1_mac,
739 size_t arg2_mac_length)
740{
David Horstmann43c128d2024-03-13 15:57:46 +0000741#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubney6b915032024-01-30 12:07:38 +0000742 MBEDTLS_TEST_MEMORY_POISON(arg1_mac, arg2_mac_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000743#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100744 psa_status_t status = (psa_mac_verify_finish)(arg0_operation, arg1_mac, arg2_mac_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000745#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubney6b915032024-01-30 12:07:38 +0000746 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_mac, arg2_mac_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000747#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100748 return status;
749}
750
751/* Wrapper for psa_mac_verify_setup */
752psa_status_t mbedtls_test_wrap_psa_mac_verify_setup(
753 psa_mac_operation_t *arg0_operation,
754 mbedtls_svc_key_id_t arg1_key,
755 psa_algorithm_t arg2_alg)
756{
757 psa_status_t status = (psa_mac_verify_setup)(arg0_operation, arg1_key, arg2_alg);
758 return status;
759}
760
761/* Wrapper for psa_purge_key */
762psa_status_t mbedtls_test_wrap_psa_purge_key(
763 mbedtls_svc_key_id_t arg0_key)
764{
765 psa_status_t status = (psa_purge_key)(arg0_key);
766 return status;
767}
768
769/* Wrapper for psa_raw_key_agreement */
770psa_status_t mbedtls_test_wrap_psa_raw_key_agreement(
771 psa_algorithm_t arg0_alg,
772 mbedtls_svc_key_id_t arg1_private_key,
773 const uint8_t *arg2_peer_key,
774 size_t arg3_peer_key_length,
775 uint8_t *arg4_output,
776 size_t arg5_output_size,
777 size_t *arg6_output_length)
778{
David Horstmann43c128d2024-03-13 15:57:46 +0000779#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneydb5d6072024-02-15 14:18:02 +0000780 MBEDTLS_TEST_MEMORY_POISON(arg2_peer_key, arg3_peer_key_length);
781 MBEDTLS_TEST_MEMORY_POISON(arg4_output, arg5_output_size);
David Horstmann43c128d2024-03-13 15:57:46 +0000782#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100783 psa_status_t status = (psa_raw_key_agreement)(arg0_alg, arg1_private_key, arg2_peer_key, arg3_peer_key_length, arg4_output, arg5_output_size, arg6_output_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000784#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneydb5d6072024-02-15 14:18:02 +0000785 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_peer_key, arg3_peer_key_length);
786 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_output, arg5_output_size);
David Horstmann43c128d2024-03-13 15:57:46 +0000787#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100788 return status;
789}
790
791/* Wrapper for psa_sign_hash */
792psa_status_t mbedtls_test_wrap_psa_sign_hash(
793 mbedtls_svc_key_id_t arg0_key,
794 psa_algorithm_t arg1_alg,
795 const uint8_t *arg2_hash,
796 size_t arg3_hash_length,
797 uint8_t *arg4_signature,
798 size_t arg5_signature_size,
799 size_t *arg6_signature_length)
800{
David Horstmann43c128d2024-03-13 15:57:46 +0000801#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneyc63e31a2024-01-30 13:33:14 +0000802 MBEDTLS_TEST_MEMORY_POISON(arg2_hash, arg3_hash_length);
803 MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_size);
David Horstmann43c128d2024-03-13 15:57:46 +0000804#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100805 psa_status_t status = (psa_sign_hash)(arg0_key, arg1_alg, arg2_hash, arg3_hash_length, arg4_signature, arg5_signature_size, arg6_signature_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000806#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneyc63e31a2024-01-30 13:33:14 +0000807 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_hash, arg3_hash_length);
808 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_size);
David Horstmann43c128d2024-03-13 15:57:46 +0000809#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100810 return status;
811}
812
813/* Wrapper for psa_sign_message */
814psa_status_t mbedtls_test_wrap_psa_sign_message(
815 mbedtls_svc_key_id_t arg0_key,
816 psa_algorithm_t arg1_alg,
817 const uint8_t *arg2_input,
818 size_t arg3_input_length,
819 uint8_t *arg4_signature,
820 size_t arg5_signature_size,
821 size_t *arg6_signature_length)
822{
David Horstmann43c128d2024-03-13 15:57:46 +0000823#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneyc63e31a2024-01-30 13:33:14 +0000824 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
825 MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_size);
David Horstmann43c128d2024-03-13 15:57:46 +0000826#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100827 psa_status_t status = (psa_sign_message)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_signature, arg5_signature_size, arg6_signature_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000828#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneyc63e31a2024-01-30 13:33:14 +0000829 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
830 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_size);
David Horstmann43c128d2024-03-13 15:57:46 +0000831#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100832 return status;
833}
834
835/* Wrapper for psa_verify_hash */
836psa_status_t mbedtls_test_wrap_psa_verify_hash(
837 mbedtls_svc_key_id_t arg0_key,
838 psa_algorithm_t arg1_alg,
839 const uint8_t *arg2_hash,
840 size_t arg3_hash_length,
841 const uint8_t *arg4_signature,
842 size_t arg5_signature_length)
843{
David Horstmann43c128d2024-03-13 15:57:46 +0000844#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneyc63e31a2024-01-30 13:33:14 +0000845 MBEDTLS_TEST_MEMORY_POISON(arg2_hash, arg3_hash_length);
846 MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000847#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100848 psa_status_t status = (psa_verify_hash)(arg0_key, arg1_alg, arg2_hash, arg3_hash_length, arg4_signature, arg5_signature_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000849#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneyc63e31a2024-01-30 13:33:14 +0000850 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_hash, arg3_hash_length);
851 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000852#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100853 return status;
854}
855
856/* Wrapper for psa_verify_message */
857psa_status_t mbedtls_test_wrap_psa_verify_message(
858 mbedtls_svc_key_id_t arg0_key,
859 psa_algorithm_t arg1_alg,
860 const uint8_t *arg2_input,
861 size_t arg3_input_length,
862 const uint8_t *arg4_signature,
863 size_t arg5_signature_length)
864{
David Horstmann43c128d2024-03-13 15:57:46 +0000865#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneyc63e31a2024-01-30 13:33:14 +0000866 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
867 MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000868#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100869 psa_status_t status = (psa_verify_message)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_signature, arg5_signature_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000870#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneyc63e31a2024-01-30 13:33:14 +0000871 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
872 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_length);
David Horstmann43c128d2024-03-13 15:57:46 +0000873#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100874 return status;
875}
876
Gilles Peskinea980aa02024-01-04 20:51:38 +0100877#endif /* defined(MBEDTLS_PSA_CRYPTO_C) && defined(MBEDTLS_TEST_HOOKS) && \
878 !defined(RECORD_PSA_STATUS_COVERAGE_LOG) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100879
880/* End of automatically generated file. */