blob: 5a7be9be8790259c036157a502f834f0df1c090f [file] [log] [blame]
Gilles Peskine6e4332c2024-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#include <mbedtls/build_info.h>
8
Gilles Peskine4411c9c2024-01-04 20:51:38 +01009#if defined(MBEDTLS_PSA_CRYPTO_C) && defined(MBEDTLS_TEST_HOOKS) && \
10 !defined(RECORD_PSA_STATUS_COVERAGE_LOG)
Gilles Peskine6e4332c2024-01-04 16:42:40 +010011
12#include <psa/crypto.h>
13
Gilles Peskine90d14d72024-01-04 16:59:28 +010014#include <test/memory.h>
Gilles Peskine6e4332c2024-01-04 16:42:40 +010015#include <test/psa_crypto_helpers.h>
16#include <test/psa_test_wrappers.h>
17
18/* Wrapper for mbedtls_psa_inject_entropy */
19#if defined(MBEDTLS_PSA_INJECT_ENTROPY)
20psa_status_t mbedtls_test_wrap_mbedtls_psa_inject_entropy(
21 const uint8_t *arg0_seed,
22 size_t arg1_seed_size)
23{
24 psa_status_t status = (mbedtls_psa_inject_entropy)(arg0_seed, arg1_seed_size);
25 return status;
26}
27#endif /* defined(MBEDTLS_PSA_INJECT_ENTROPY) */
28
29/* Wrapper for mbedtls_psa_platform_get_builtin_key */
30#if defined(MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS)
31psa_status_t mbedtls_test_wrap_mbedtls_psa_platform_get_builtin_key(
32 mbedtls_svc_key_id_t arg0_key_id,
33 psa_key_lifetime_t *arg1_lifetime,
34 psa_drv_slot_number_t *arg2_slot_number)
35{
36 psa_status_t status = (mbedtls_psa_platform_get_builtin_key)(arg0_key_id, arg1_lifetime, arg2_slot_number);
37 return status;
38}
39#endif /* defined(MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS) */
40
41/* Wrapper for mbedtls_psa_register_se_key */
42#if defined(MBEDTLS_PSA_CRYPTO_SE_C)
43psa_status_t mbedtls_test_wrap_mbedtls_psa_register_se_key(
44 const psa_key_attributes_t *arg0_attributes)
45{
46 psa_status_t status = (mbedtls_psa_register_se_key)(arg0_attributes);
47 return status;
48}
49#endif /* defined(MBEDTLS_PSA_CRYPTO_SE_C) */
50
51/* Wrapper for psa_aead_abort */
52psa_status_t mbedtls_test_wrap_psa_aead_abort(
53 psa_aead_operation_t *arg0_operation)
54{
55 psa_status_t status = (psa_aead_abort)(arg0_operation);
56 return status;
57}
58
59/* Wrapper for psa_aead_decrypt */
60psa_status_t mbedtls_test_wrap_psa_aead_decrypt(
61 mbedtls_svc_key_id_t arg0_key,
62 psa_algorithm_t arg1_alg,
63 const uint8_t *arg2_nonce,
64 size_t arg3_nonce_length,
65 const uint8_t *arg4_additional_data,
66 size_t arg5_additional_data_length,
67 const uint8_t *arg6_ciphertext,
68 size_t arg7_ciphertext_length,
69 uint8_t *arg8_plaintext,
70 size_t arg9_plaintext_size,
71 size_t *arg10_plaintext_length)
72{
David Horstmann86e6fe02024-01-22 14:36:01 +000073#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
74 MBEDTLS_TEST_MEMORY_POISON(arg2_nonce, arg3_nonce_length);
75 MBEDTLS_TEST_MEMORY_POISON(arg4_additional_data, arg5_additional_data_length);
76 MBEDTLS_TEST_MEMORY_POISON(arg6_ciphertext, arg7_ciphertext_length);
77 MBEDTLS_TEST_MEMORY_POISON(arg8_plaintext, arg9_plaintext_size);
78#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +010079 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 Horstmann86e6fe02024-01-22 14:36:01 +000080#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
81 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_nonce, arg3_nonce_length);
82 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_additional_data, arg5_additional_data_length);
83 MBEDTLS_TEST_MEMORY_UNPOISON(arg6_ciphertext, arg7_ciphertext_length);
84 MBEDTLS_TEST_MEMORY_UNPOISON(arg8_plaintext, arg9_plaintext_size);
85#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +010086 return status;
87}
88
89/* Wrapper for psa_aead_decrypt_setup */
90psa_status_t mbedtls_test_wrap_psa_aead_decrypt_setup(
91 psa_aead_operation_t *arg0_operation,
92 mbedtls_svc_key_id_t arg1_key,
93 psa_algorithm_t arg2_alg)
94{
95 psa_status_t status = (psa_aead_decrypt_setup)(arg0_operation, arg1_key, arg2_alg);
96 return status;
97}
98
99/* Wrapper for psa_aead_encrypt */
100psa_status_t mbedtls_test_wrap_psa_aead_encrypt(
101 mbedtls_svc_key_id_t arg0_key,
102 psa_algorithm_t arg1_alg,
103 const uint8_t *arg2_nonce,
104 size_t arg3_nonce_length,
105 const uint8_t *arg4_additional_data,
106 size_t arg5_additional_data_length,
107 const uint8_t *arg6_plaintext,
108 size_t arg7_plaintext_length,
109 uint8_t *arg8_ciphertext,
110 size_t arg9_ciphertext_size,
111 size_t *arg10_ciphertext_length)
112{
David Horstmann86e6fe02024-01-22 14:36:01 +0000113#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
114 MBEDTLS_TEST_MEMORY_POISON(arg2_nonce, arg3_nonce_length);
115 MBEDTLS_TEST_MEMORY_POISON(arg4_additional_data, arg5_additional_data_length);
116 MBEDTLS_TEST_MEMORY_POISON(arg6_plaintext, arg7_plaintext_length);
117 MBEDTLS_TEST_MEMORY_POISON(arg8_ciphertext, arg9_ciphertext_size);
118#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100119 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 Horstmann86e6fe02024-01-22 14:36:01 +0000120#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
121 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_nonce, arg3_nonce_length);
122 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_additional_data, arg5_additional_data_length);
123 MBEDTLS_TEST_MEMORY_UNPOISON(arg6_plaintext, arg7_plaintext_length);
124 MBEDTLS_TEST_MEMORY_UNPOISON(arg8_ciphertext, arg9_ciphertext_size);
125#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100126 return status;
127}
128
129/* Wrapper for psa_aead_encrypt_setup */
130psa_status_t mbedtls_test_wrap_psa_aead_encrypt_setup(
131 psa_aead_operation_t *arg0_operation,
132 mbedtls_svc_key_id_t arg1_key,
133 psa_algorithm_t arg2_alg)
134{
135 psa_status_t status = (psa_aead_encrypt_setup)(arg0_operation, arg1_key, arg2_alg);
136 return status;
137}
138
139/* Wrapper for psa_aead_finish */
140psa_status_t mbedtls_test_wrap_psa_aead_finish(
141 psa_aead_operation_t *arg0_operation,
142 uint8_t *arg1_ciphertext,
143 size_t arg2_ciphertext_size,
144 size_t *arg3_ciphertext_length,
145 uint8_t *arg4_tag,
146 size_t arg5_tag_size,
147 size_t *arg6_tag_length)
148{
David Horstmann86e6fe02024-01-22 14:36:01 +0000149#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
150 MBEDTLS_TEST_MEMORY_POISON(arg1_ciphertext, arg2_ciphertext_size);
151 MBEDTLS_TEST_MEMORY_POISON(arg4_tag, arg5_tag_size);
152#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100153 psa_status_t status = (psa_aead_finish)(arg0_operation, arg1_ciphertext, arg2_ciphertext_size, arg3_ciphertext_length, arg4_tag, arg5_tag_size, arg6_tag_length);
David Horstmann86e6fe02024-01-22 14:36:01 +0000154#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
155 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_ciphertext, arg2_ciphertext_size);
156 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_tag, arg5_tag_size);
157#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100158 return status;
159}
160
161/* Wrapper for psa_aead_generate_nonce */
162psa_status_t mbedtls_test_wrap_psa_aead_generate_nonce(
163 psa_aead_operation_t *arg0_operation,
164 uint8_t *arg1_nonce,
165 size_t arg2_nonce_size,
166 size_t *arg3_nonce_length)
167{
David Horstmann86e6fe02024-01-22 14:36:01 +0000168#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
169 MBEDTLS_TEST_MEMORY_POISON(arg1_nonce, arg2_nonce_size);
170#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100171 psa_status_t status = (psa_aead_generate_nonce)(arg0_operation, arg1_nonce, arg2_nonce_size, arg3_nonce_length);
David Horstmann86e6fe02024-01-22 14:36:01 +0000172#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
173 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_nonce, arg2_nonce_size);
174#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100175 return status;
176}
177
178/* Wrapper for psa_aead_set_lengths */
179psa_status_t mbedtls_test_wrap_psa_aead_set_lengths(
180 psa_aead_operation_t *arg0_operation,
181 size_t arg1_ad_length,
182 size_t arg2_plaintext_length)
183{
184 psa_status_t status = (psa_aead_set_lengths)(arg0_operation, arg1_ad_length, arg2_plaintext_length);
185 return status;
186}
187
188/* Wrapper for psa_aead_set_nonce */
189psa_status_t mbedtls_test_wrap_psa_aead_set_nonce(
190 psa_aead_operation_t *arg0_operation,
191 const uint8_t *arg1_nonce,
192 size_t arg2_nonce_length)
193{
David Horstmann86e6fe02024-01-22 14:36:01 +0000194#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
195 MBEDTLS_TEST_MEMORY_POISON(arg1_nonce, arg2_nonce_length);
196#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100197 psa_status_t status = (psa_aead_set_nonce)(arg0_operation, arg1_nonce, arg2_nonce_length);
David Horstmann86e6fe02024-01-22 14:36:01 +0000198#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
199 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_nonce, arg2_nonce_length);
200#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100201 return status;
202}
203
204/* Wrapper for psa_aead_update */
205psa_status_t mbedtls_test_wrap_psa_aead_update(
206 psa_aead_operation_t *arg0_operation,
207 const uint8_t *arg1_input,
208 size_t arg2_input_length,
209 uint8_t *arg3_output,
210 size_t arg4_output_size,
211 size_t *arg5_output_length)
212{
David Horstmann86e6fe02024-01-22 14:36:01 +0000213#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
214 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
215 MBEDTLS_TEST_MEMORY_POISON(arg3_output, arg4_output_size);
216#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100217 psa_status_t status = (psa_aead_update)(arg0_operation, arg1_input, arg2_input_length, arg3_output, arg4_output_size, arg5_output_length);
David Horstmann86e6fe02024-01-22 14:36:01 +0000218#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
219 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
220 MBEDTLS_TEST_MEMORY_UNPOISON(arg3_output, arg4_output_size);
221#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100222 return status;
223}
224
225/* Wrapper for psa_aead_update_ad */
226psa_status_t mbedtls_test_wrap_psa_aead_update_ad(
227 psa_aead_operation_t *arg0_operation,
228 const uint8_t *arg1_input,
229 size_t arg2_input_length)
230{
David Horstmann86e6fe02024-01-22 14:36:01 +0000231#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
232 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
233#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100234 psa_status_t status = (psa_aead_update_ad)(arg0_operation, arg1_input, arg2_input_length);
David Horstmann86e6fe02024-01-22 14:36:01 +0000235#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
236 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
237#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100238 return status;
239}
240
241/* Wrapper for psa_aead_verify */
242psa_status_t mbedtls_test_wrap_psa_aead_verify(
243 psa_aead_operation_t *arg0_operation,
244 uint8_t *arg1_plaintext,
245 size_t arg2_plaintext_size,
246 size_t *arg3_plaintext_length,
247 const uint8_t *arg4_tag,
248 size_t arg5_tag_length)
249{
David Horstmann86e6fe02024-01-22 14:36:01 +0000250#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
251 MBEDTLS_TEST_MEMORY_POISON(arg1_plaintext, arg2_plaintext_size);
252 MBEDTLS_TEST_MEMORY_POISON(arg4_tag, arg5_tag_length);
253#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100254 psa_status_t status = (psa_aead_verify)(arg0_operation, arg1_plaintext, arg2_plaintext_size, arg3_plaintext_length, arg4_tag, arg5_tag_length);
David Horstmann86e6fe02024-01-22 14:36:01 +0000255#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
256 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_plaintext, arg2_plaintext_size);
257 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_tag, arg5_tag_length);
258#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100259 return status;
260}
261
262/* Wrapper for psa_asymmetric_decrypt */
263psa_status_t mbedtls_test_wrap_psa_asymmetric_decrypt(
264 mbedtls_svc_key_id_t arg0_key,
265 psa_algorithm_t arg1_alg,
266 const uint8_t *arg2_input,
267 size_t arg3_input_length,
268 const uint8_t *arg4_salt,
269 size_t arg5_salt_length,
270 uint8_t *arg6_output,
271 size_t arg7_output_size,
272 size_t *arg8_output_length)
273{
274 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);
275 return status;
276}
277
278/* Wrapper for psa_asymmetric_encrypt */
279psa_status_t mbedtls_test_wrap_psa_asymmetric_encrypt(
280 mbedtls_svc_key_id_t arg0_key,
281 psa_algorithm_t arg1_alg,
282 const uint8_t *arg2_input,
283 size_t arg3_input_length,
284 const uint8_t *arg4_salt,
285 size_t arg5_salt_length,
286 uint8_t *arg6_output,
287 size_t arg7_output_size,
288 size_t *arg8_output_length)
289{
290 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);
291 return status;
292}
293
294/* Wrapper for psa_cipher_abort */
295psa_status_t mbedtls_test_wrap_psa_cipher_abort(
296 psa_cipher_operation_t *arg0_operation)
297{
298 psa_status_t status = (psa_cipher_abort)(arg0_operation);
299 return status;
300}
301
302/* Wrapper for psa_cipher_decrypt */
303psa_status_t mbedtls_test_wrap_psa_cipher_decrypt(
304 mbedtls_svc_key_id_t arg0_key,
305 psa_algorithm_t arg1_alg,
306 const uint8_t *arg2_input,
307 size_t arg3_input_length,
308 uint8_t *arg4_output,
309 size_t arg5_output_size,
310 size_t *arg6_output_length)
311{
Gabor Mezeib8f97a12024-01-24 16:58:40 +0100312#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
313 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
314 MBEDTLS_TEST_MEMORY_POISON(arg4_output, arg5_output_size);
315#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100316 psa_status_t status = (psa_cipher_decrypt)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_output, arg5_output_size, arg6_output_length);
Gabor Mezeib8f97a12024-01-24 16:58:40 +0100317#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
318 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
319 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_output, arg5_output_size);
320#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100321 return status;
322}
323
324/* Wrapper for psa_cipher_decrypt_setup */
325psa_status_t mbedtls_test_wrap_psa_cipher_decrypt_setup(
326 psa_cipher_operation_t *arg0_operation,
327 mbedtls_svc_key_id_t arg1_key,
328 psa_algorithm_t arg2_alg)
329{
330 psa_status_t status = (psa_cipher_decrypt_setup)(arg0_operation, arg1_key, arg2_alg);
331 return status;
332}
333
334/* Wrapper for psa_cipher_encrypt */
335psa_status_t mbedtls_test_wrap_psa_cipher_encrypt(
336 mbedtls_svc_key_id_t arg0_key,
337 psa_algorithm_t arg1_alg,
338 const uint8_t *arg2_input,
339 size_t arg3_input_length,
340 uint8_t *arg4_output,
341 size_t arg5_output_size,
342 size_t *arg6_output_length)
343{
Ryan Everett84a666d2024-01-25 12:00:02 +0000344#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
345 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
346 MBEDTLS_TEST_MEMORY_POISON(arg4_output, arg5_output_size);
347#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100348 psa_status_t status = (psa_cipher_encrypt)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_output, arg5_output_size, arg6_output_length);
Ryan Everett84a666d2024-01-25 12:00:02 +0000349#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
350 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
351 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_output, arg5_output_size);
352#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100353 return status;
354}
355
356/* Wrapper for psa_cipher_encrypt_setup */
357psa_status_t mbedtls_test_wrap_psa_cipher_encrypt_setup(
358 psa_cipher_operation_t *arg0_operation,
359 mbedtls_svc_key_id_t arg1_key,
360 psa_algorithm_t arg2_alg)
361{
362 psa_status_t status = (psa_cipher_encrypt_setup)(arg0_operation, arg1_key, arg2_alg);
363 return status;
364}
365
366/* Wrapper for psa_cipher_finish */
367psa_status_t mbedtls_test_wrap_psa_cipher_finish(
368 psa_cipher_operation_t *arg0_operation,
369 uint8_t *arg1_output,
370 size_t arg2_output_size,
371 size_t *arg3_output_length)
372{
Gabor Mezeib8f97a12024-01-24 16:58:40 +0100373#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
374 MBEDTLS_TEST_MEMORY_POISON(arg1_output, arg2_output_size);
375#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100376 psa_status_t status = (psa_cipher_finish)(arg0_operation, arg1_output, arg2_output_size, arg3_output_length);
Gabor Mezeib8f97a12024-01-24 16:58:40 +0100377#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
378 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_output, arg2_output_size);
379#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100380 return status;
381}
382
383/* Wrapper for psa_cipher_generate_iv */
384psa_status_t mbedtls_test_wrap_psa_cipher_generate_iv(
385 psa_cipher_operation_t *arg0_operation,
386 uint8_t *arg1_iv,
387 size_t arg2_iv_size,
388 size_t *arg3_iv_length)
389{
390 psa_status_t status = (psa_cipher_generate_iv)(arg0_operation, arg1_iv, arg2_iv_size, arg3_iv_length);
391 return status;
392}
393
394/* Wrapper for psa_cipher_set_iv */
395psa_status_t mbedtls_test_wrap_psa_cipher_set_iv(
396 psa_cipher_operation_t *arg0_operation,
397 const uint8_t *arg1_iv,
398 size_t arg2_iv_length)
399{
400 psa_status_t status = (psa_cipher_set_iv)(arg0_operation, arg1_iv, arg2_iv_length);
401 return status;
402}
403
404/* Wrapper for psa_cipher_update */
405psa_status_t mbedtls_test_wrap_psa_cipher_update(
406 psa_cipher_operation_t *arg0_operation,
407 const uint8_t *arg1_input,
408 size_t arg2_input_length,
409 uint8_t *arg3_output,
410 size_t arg4_output_size,
411 size_t *arg5_output_length)
412{
Gabor Mezeib8f97a12024-01-24 16:58:40 +0100413#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
414 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
415 MBEDTLS_TEST_MEMORY_POISON(arg3_output, arg4_output_size);
416#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100417 psa_status_t status = (psa_cipher_update)(arg0_operation, arg1_input, arg2_input_length, arg3_output, arg4_output_size, arg5_output_length);
Gabor Mezeib8f97a12024-01-24 16:58:40 +0100418#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
419 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
420 MBEDTLS_TEST_MEMORY_UNPOISON(arg3_output, arg4_output_size);
421#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100422 return status;
423}
424
425/* Wrapper for psa_copy_key */
426psa_status_t mbedtls_test_wrap_psa_copy_key(
427 mbedtls_svc_key_id_t arg0_source_key,
428 const psa_key_attributes_t *arg1_attributes,
429 mbedtls_svc_key_id_t *arg2_target_key)
430{
431 psa_status_t status = (psa_copy_key)(arg0_source_key, arg1_attributes, arg2_target_key);
432 return status;
433}
434
435/* Wrapper for psa_crypto_driver_pake_get_cipher_suite */
436psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_cipher_suite(
437 const psa_crypto_driver_pake_inputs_t *arg0_inputs,
438 psa_pake_cipher_suite_t *arg1_cipher_suite)
439{
440 psa_status_t status = (psa_crypto_driver_pake_get_cipher_suite)(arg0_inputs, arg1_cipher_suite);
441 return status;
442}
443
444/* Wrapper for psa_crypto_driver_pake_get_password */
445psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_password(
446 const psa_crypto_driver_pake_inputs_t *arg0_inputs,
447 uint8_t *arg1_buffer,
448 size_t arg2_buffer_size,
449 size_t *arg3_buffer_length)
450{
451 psa_status_t status = (psa_crypto_driver_pake_get_password)(arg0_inputs, arg1_buffer, arg2_buffer_size, arg3_buffer_length);
452 return status;
453}
454
455/* Wrapper for psa_crypto_driver_pake_get_password_len */
456psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_password_len(
457 const psa_crypto_driver_pake_inputs_t *arg0_inputs,
458 size_t *arg1_password_len)
459{
460 psa_status_t status = (psa_crypto_driver_pake_get_password_len)(arg0_inputs, arg1_password_len);
461 return status;
462}
463
464/* Wrapper for psa_crypto_driver_pake_get_peer */
465psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_peer(
466 const psa_crypto_driver_pake_inputs_t *arg0_inputs,
467 uint8_t *arg1_peer_id,
468 size_t arg2_peer_id_size,
469 size_t *arg3_peer_id_length)
470{
471 psa_status_t status = (psa_crypto_driver_pake_get_peer)(arg0_inputs, arg1_peer_id, arg2_peer_id_size, arg3_peer_id_length);
472 return status;
473}
474
475/* Wrapper for psa_crypto_driver_pake_get_peer_len */
476psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_peer_len(
477 const psa_crypto_driver_pake_inputs_t *arg0_inputs,
478 size_t *arg1_peer_len)
479{
480 psa_status_t status = (psa_crypto_driver_pake_get_peer_len)(arg0_inputs, arg1_peer_len);
481 return status;
482}
483
484/* Wrapper for psa_crypto_driver_pake_get_user */
485psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_user(
486 const psa_crypto_driver_pake_inputs_t *arg0_inputs,
487 uint8_t *arg1_user_id,
488 size_t arg2_user_id_size,
489 size_t *arg3_user_id_len)
490{
491 psa_status_t status = (psa_crypto_driver_pake_get_user)(arg0_inputs, arg1_user_id, arg2_user_id_size, arg3_user_id_len);
492 return status;
493}
494
495/* Wrapper for psa_crypto_driver_pake_get_user_len */
496psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_user_len(
497 const psa_crypto_driver_pake_inputs_t *arg0_inputs,
498 size_t *arg1_user_len)
499{
500 psa_status_t status = (psa_crypto_driver_pake_get_user_len)(arg0_inputs, arg1_user_len);
501 return status;
502}
503
504/* Wrapper for psa_crypto_init */
505psa_status_t mbedtls_test_wrap_psa_crypto_init(void)
506{
507 psa_status_t status = (psa_crypto_init)();
508 return status;
509}
510
511/* Wrapper for psa_destroy_key */
512psa_status_t mbedtls_test_wrap_psa_destroy_key(
513 mbedtls_svc_key_id_t arg0_key)
514{
515 psa_status_t status = (psa_destroy_key)(arg0_key);
516 return status;
517}
518
519/* Wrapper for psa_export_key */
520psa_status_t mbedtls_test_wrap_psa_export_key(
521 mbedtls_svc_key_id_t arg0_key,
522 uint8_t *arg1_data,
523 size_t arg2_data_size,
524 size_t *arg3_data_length)
525{
Ryan Everett77b91e32024-01-25 10:58:06 +0000526#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
527 MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_size);
528#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100529 psa_status_t status = (psa_export_key)(arg0_key, arg1_data, arg2_data_size, arg3_data_length);
Ryan Everett77b91e32024-01-25 10:58:06 +0000530#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
531 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_size);
532#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100533 return status;
534}
535
536/* Wrapper for psa_export_public_key */
537psa_status_t mbedtls_test_wrap_psa_export_public_key(
538 mbedtls_svc_key_id_t arg0_key,
539 uint8_t *arg1_data,
540 size_t arg2_data_size,
541 size_t *arg3_data_length)
542{
Ryan Everett77b91e32024-01-25 10:58:06 +0000543#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
544 MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_size);
545#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100546 psa_status_t status = (psa_export_public_key)(arg0_key, arg1_data, arg2_data_size, arg3_data_length);
Ryan Everett77b91e32024-01-25 10:58:06 +0000547#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
548 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_size);
549#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100550 return status;
551}
552
553/* Wrapper for psa_generate_key */
554psa_status_t mbedtls_test_wrap_psa_generate_key(
555 const psa_key_attributes_t *arg0_attributes,
556 mbedtls_svc_key_id_t *arg1_key)
557{
558 psa_status_t status = (psa_generate_key)(arg0_attributes, arg1_key);
559 return status;
560}
561
562/* Wrapper for psa_generate_random */
563psa_status_t mbedtls_test_wrap_psa_generate_random(
564 uint8_t *arg0_output,
565 size_t arg1_output_size)
566{
567 psa_status_t status = (psa_generate_random)(arg0_output, arg1_output_size);
568 return status;
569}
570
571/* Wrapper for psa_get_key_attributes */
572psa_status_t mbedtls_test_wrap_psa_get_key_attributes(
573 mbedtls_svc_key_id_t arg0_key,
574 psa_key_attributes_t *arg1_attributes)
575{
576 psa_status_t status = (psa_get_key_attributes)(arg0_key, arg1_attributes);
577 return status;
578}
579
580/* Wrapper for psa_hash_abort */
581psa_status_t mbedtls_test_wrap_psa_hash_abort(
582 psa_hash_operation_t *arg0_operation)
583{
584 psa_status_t status = (psa_hash_abort)(arg0_operation);
585 return status;
586}
587
588/* Wrapper for psa_hash_clone */
589psa_status_t mbedtls_test_wrap_psa_hash_clone(
590 const psa_hash_operation_t *arg0_source_operation,
591 psa_hash_operation_t *arg1_target_operation)
592{
593 psa_status_t status = (psa_hash_clone)(arg0_source_operation, arg1_target_operation);
594 return status;
595}
596
597/* Wrapper for psa_hash_compare */
598psa_status_t mbedtls_test_wrap_psa_hash_compare(
599 psa_algorithm_t arg0_alg,
600 const uint8_t *arg1_input,
601 size_t arg2_input_length,
602 const uint8_t *arg3_hash,
603 size_t arg4_hash_length)
604{
Thomas Daubney45c85862024-01-25 16:48:09 +0000605#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
606 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
607 MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_length);
608#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100609 psa_status_t status = (psa_hash_compare)(arg0_alg, arg1_input, arg2_input_length, arg3_hash, arg4_hash_length);
Thomas Daubney45c85862024-01-25 16:48:09 +0000610#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
611 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
612 MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_length);
613#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100614 return status;
615}
616
617/* Wrapper for psa_hash_compute */
618psa_status_t mbedtls_test_wrap_psa_hash_compute(
619 psa_algorithm_t arg0_alg,
620 const uint8_t *arg1_input,
621 size_t arg2_input_length,
622 uint8_t *arg3_hash,
623 size_t arg4_hash_size,
624 size_t *arg5_hash_length)
625{
Thomas Daubney45c85862024-01-25 16:48:09 +0000626#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
627 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
628 MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_size);
629#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100630 psa_status_t status = (psa_hash_compute)(arg0_alg, arg1_input, arg2_input_length, arg3_hash, arg4_hash_size, arg5_hash_length);
Thomas Daubney45c85862024-01-25 16:48:09 +0000631#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
632 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
633 MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_size);
634#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100635 return status;
636}
637
638/* Wrapper for psa_hash_finish */
639psa_status_t mbedtls_test_wrap_psa_hash_finish(
640 psa_hash_operation_t *arg0_operation,
641 uint8_t *arg1_hash,
642 size_t arg2_hash_size,
643 size_t *arg3_hash_length)
644{
Thomas Daubney45c85862024-01-25 16:48:09 +0000645#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
646 MBEDTLS_TEST_MEMORY_POISON(arg1_hash, arg2_hash_size);
647#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100648 psa_status_t status = (psa_hash_finish)(arg0_operation, arg1_hash, arg2_hash_size, arg3_hash_length);
Thomas Daubney45c85862024-01-25 16:48:09 +0000649#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
650 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_hash, arg2_hash_size);
651#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100652 return status;
653}
654
655/* Wrapper for psa_hash_setup */
656psa_status_t mbedtls_test_wrap_psa_hash_setup(
657 psa_hash_operation_t *arg0_operation,
658 psa_algorithm_t arg1_alg)
659{
660 psa_status_t status = (psa_hash_setup)(arg0_operation, arg1_alg);
661 return status;
662}
663
664/* Wrapper for psa_hash_update */
665psa_status_t mbedtls_test_wrap_psa_hash_update(
666 psa_hash_operation_t *arg0_operation,
667 const uint8_t *arg1_input,
668 size_t arg2_input_length)
669{
Thomas Daubney45c85862024-01-25 16:48:09 +0000670#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
671 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
672#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100673 psa_status_t status = (psa_hash_update)(arg0_operation, arg1_input, arg2_input_length);
Thomas Daubney45c85862024-01-25 16:48:09 +0000674#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
675 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
676#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100677 return status;
678}
679
680/* Wrapper for psa_hash_verify */
681psa_status_t mbedtls_test_wrap_psa_hash_verify(
682 psa_hash_operation_t *arg0_operation,
683 const uint8_t *arg1_hash,
684 size_t arg2_hash_length)
685{
Thomas Daubney45c85862024-01-25 16:48:09 +0000686#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
687 MBEDTLS_TEST_MEMORY_POISON(arg1_hash, arg2_hash_length);
688#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100689 psa_status_t status = (psa_hash_verify)(arg0_operation, arg1_hash, arg2_hash_length);
Thomas Daubney45c85862024-01-25 16:48:09 +0000690#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
691 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_hash, arg2_hash_length);
692#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100693 return status;
694}
695
696/* Wrapper for psa_import_key */
697psa_status_t mbedtls_test_wrap_psa_import_key(
698 const psa_key_attributes_t *arg0_attributes,
699 const uint8_t *arg1_data,
700 size_t arg2_data_length,
701 mbedtls_svc_key_id_t *arg3_key)
702{
Ryan Everett77b91e32024-01-25 10:58:06 +0000703#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
704 MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_length);
705#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100706 psa_status_t status = (psa_import_key)(arg0_attributes, arg1_data, arg2_data_length, arg3_key);
Ryan Everett77b91e32024-01-25 10:58:06 +0000707#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
708 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_length);
709#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100710 return status;
711}
712
713/* Wrapper for psa_key_derivation_abort */
714psa_status_t mbedtls_test_wrap_psa_key_derivation_abort(
715 psa_key_derivation_operation_t *arg0_operation)
716{
717 psa_status_t status = (psa_key_derivation_abort)(arg0_operation);
718 return status;
719}
720
721/* Wrapper for psa_key_derivation_get_capacity */
722psa_status_t mbedtls_test_wrap_psa_key_derivation_get_capacity(
723 const psa_key_derivation_operation_t *arg0_operation,
724 size_t *arg1_capacity)
725{
726 psa_status_t status = (psa_key_derivation_get_capacity)(arg0_operation, arg1_capacity);
727 return status;
728}
729
730/* Wrapper for psa_key_derivation_input_bytes */
731psa_status_t mbedtls_test_wrap_psa_key_derivation_input_bytes(
732 psa_key_derivation_operation_t *arg0_operation,
733 psa_key_derivation_step_t arg1_step,
734 const uint8_t *arg2_data,
735 size_t arg3_data_length)
736{
Ryan Everett198a4d92024-01-25 11:44:56 +0000737#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
738 MBEDTLS_TEST_MEMORY_POISON(arg2_data, arg3_data_length);
739#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100740 psa_status_t status = (psa_key_derivation_input_bytes)(arg0_operation, arg1_step, arg2_data, arg3_data_length);
Ryan Everett198a4d92024-01-25 11:44:56 +0000741#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
742 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_data, arg3_data_length);
743#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100744 return status;
745}
746
747/* Wrapper for psa_key_derivation_input_integer */
748psa_status_t mbedtls_test_wrap_psa_key_derivation_input_integer(
749 psa_key_derivation_operation_t *arg0_operation,
750 psa_key_derivation_step_t arg1_step,
751 uint64_t arg2_value)
752{
753 psa_status_t status = (psa_key_derivation_input_integer)(arg0_operation, arg1_step, arg2_value);
754 return status;
755}
756
757/* Wrapper for psa_key_derivation_input_key */
758psa_status_t mbedtls_test_wrap_psa_key_derivation_input_key(
759 psa_key_derivation_operation_t *arg0_operation,
760 psa_key_derivation_step_t arg1_step,
761 mbedtls_svc_key_id_t arg2_key)
762{
763 psa_status_t status = (psa_key_derivation_input_key)(arg0_operation, arg1_step, arg2_key);
764 return status;
765}
766
767/* Wrapper for psa_key_derivation_key_agreement */
768psa_status_t mbedtls_test_wrap_psa_key_derivation_key_agreement(
769 psa_key_derivation_operation_t *arg0_operation,
770 psa_key_derivation_step_t arg1_step,
771 mbedtls_svc_key_id_t arg2_private_key,
772 const uint8_t *arg3_peer_key,
773 size_t arg4_peer_key_length)
774{
775 psa_status_t status = (psa_key_derivation_key_agreement)(arg0_operation, arg1_step, arg2_private_key, arg3_peer_key, arg4_peer_key_length);
776 return status;
777}
778
779/* Wrapper for psa_key_derivation_output_bytes */
780psa_status_t mbedtls_test_wrap_psa_key_derivation_output_bytes(
781 psa_key_derivation_operation_t *arg0_operation,
782 uint8_t *arg1_output,
783 size_t arg2_output_length)
784{
Ryan Everett198a4d92024-01-25 11:44:56 +0000785#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
786 MBEDTLS_TEST_MEMORY_POISON(arg1_output, arg2_output_length);
787#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100788 psa_status_t status = (psa_key_derivation_output_bytes)(arg0_operation, arg1_output, arg2_output_length);
Ryan Everett198a4d92024-01-25 11:44:56 +0000789#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
790 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_output, arg2_output_length);
791#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100792 return status;
793}
794
795/* Wrapper for psa_key_derivation_output_key */
796psa_status_t mbedtls_test_wrap_psa_key_derivation_output_key(
797 const psa_key_attributes_t *arg0_attributes,
798 psa_key_derivation_operation_t *arg1_operation,
799 mbedtls_svc_key_id_t *arg2_key)
800{
801 psa_status_t status = (psa_key_derivation_output_key)(arg0_attributes, arg1_operation, arg2_key);
802 return status;
803}
804
805/* Wrapper for psa_key_derivation_set_capacity */
806psa_status_t mbedtls_test_wrap_psa_key_derivation_set_capacity(
807 psa_key_derivation_operation_t *arg0_operation,
808 size_t arg1_capacity)
809{
810 psa_status_t status = (psa_key_derivation_set_capacity)(arg0_operation, arg1_capacity);
811 return status;
812}
813
814/* Wrapper for psa_key_derivation_setup */
815psa_status_t mbedtls_test_wrap_psa_key_derivation_setup(
816 psa_key_derivation_operation_t *arg0_operation,
817 psa_algorithm_t arg1_alg)
818{
819 psa_status_t status = (psa_key_derivation_setup)(arg0_operation, arg1_alg);
820 return status;
821}
822
823/* Wrapper for psa_mac_abort */
824psa_status_t mbedtls_test_wrap_psa_mac_abort(
825 psa_mac_operation_t *arg0_operation)
826{
827 psa_status_t status = (psa_mac_abort)(arg0_operation);
828 return status;
829}
830
831/* Wrapper for psa_mac_compute */
832psa_status_t mbedtls_test_wrap_psa_mac_compute(
833 mbedtls_svc_key_id_t arg0_key,
834 psa_algorithm_t arg1_alg,
835 const uint8_t *arg2_input,
836 size_t arg3_input_length,
837 uint8_t *arg4_mac,
838 size_t arg5_mac_size,
839 size_t *arg6_mac_length)
840{
Thomas Daubneya1cf1012024-01-30 11:18:54 +0000841#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
842 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
843 MBEDTLS_TEST_MEMORY_POISON(arg4_mac, arg5_mac_size);
844#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100845 psa_status_t status = (psa_mac_compute)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_mac, arg5_mac_size, arg6_mac_length);
Thomas Daubneya1cf1012024-01-30 11:18:54 +0000846#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
847 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
848 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_mac, arg5_mac_size);
849#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100850 return status;
851}
852
853/* Wrapper for psa_mac_sign_finish */
854psa_status_t mbedtls_test_wrap_psa_mac_sign_finish(
855 psa_mac_operation_t *arg0_operation,
856 uint8_t *arg1_mac,
857 size_t arg2_mac_size,
858 size_t *arg3_mac_length)
859{
Thomas Daubneya1cf1012024-01-30 11:18:54 +0000860#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
861 MBEDTLS_TEST_MEMORY_POISON(arg1_mac, arg2_mac_size);
862#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100863 psa_status_t status = (psa_mac_sign_finish)(arg0_operation, arg1_mac, arg2_mac_size, arg3_mac_length);
Thomas Daubneya1cf1012024-01-30 11:18:54 +0000864#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
865 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_mac, arg2_mac_size);
866#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100867 return status;
868}
869
870/* Wrapper for psa_mac_sign_setup */
871psa_status_t mbedtls_test_wrap_psa_mac_sign_setup(
872 psa_mac_operation_t *arg0_operation,
873 mbedtls_svc_key_id_t arg1_key,
874 psa_algorithm_t arg2_alg)
875{
876 psa_status_t status = (psa_mac_sign_setup)(arg0_operation, arg1_key, arg2_alg);
877 return status;
878}
879
880/* Wrapper for psa_mac_update */
881psa_status_t mbedtls_test_wrap_psa_mac_update(
882 psa_mac_operation_t *arg0_operation,
883 const uint8_t *arg1_input,
884 size_t arg2_input_length)
885{
Thomas Daubneya1cf1012024-01-30 11:18:54 +0000886#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
887 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
888#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100889 psa_status_t status = (psa_mac_update)(arg0_operation, arg1_input, arg2_input_length);
Thomas Daubneya1cf1012024-01-30 11:18:54 +0000890#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
891 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
892#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100893 return status;
894}
895
896/* Wrapper for psa_mac_verify */
897psa_status_t mbedtls_test_wrap_psa_mac_verify(
898 mbedtls_svc_key_id_t arg0_key,
899 psa_algorithm_t arg1_alg,
900 const uint8_t *arg2_input,
901 size_t arg3_input_length,
902 const uint8_t *arg4_mac,
903 size_t arg5_mac_length)
904{
Thomas Daubneya1cf1012024-01-30 11:18:54 +0000905#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
906 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
907 MBEDTLS_TEST_MEMORY_POISON(arg4_mac, arg5_mac_length);
908#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100909 psa_status_t status = (psa_mac_verify)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_mac, arg5_mac_length);
Thomas Daubneya1cf1012024-01-30 11:18:54 +0000910#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
911 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
912 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_mac, arg5_mac_length);
913#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100914 return status;
915}
916
917/* Wrapper for psa_mac_verify_finish */
918psa_status_t mbedtls_test_wrap_psa_mac_verify_finish(
919 psa_mac_operation_t *arg0_operation,
920 const uint8_t *arg1_mac,
921 size_t arg2_mac_length)
922{
Thomas Daubneya1cf1012024-01-30 11:18:54 +0000923#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
924 MBEDTLS_TEST_MEMORY_POISON(arg1_mac, arg2_mac_length);
925#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100926 psa_status_t status = (psa_mac_verify_finish)(arg0_operation, arg1_mac, arg2_mac_length);
Thomas Daubneya1cf1012024-01-30 11:18:54 +0000927#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
928 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_mac, arg2_mac_length);
929#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100930 return status;
931}
932
933/* Wrapper for psa_mac_verify_setup */
934psa_status_t mbedtls_test_wrap_psa_mac_verify_setup(
935 psa_mac_operation_t *arg0_operation,
936 mbedtls_svc_key_id_t arg1_key,
937 psa_algorithm_t arg2_alg)
938{
939 psa_status_t status = (psa_mac_verify_setup)(arg0_operation, arg1_key, arg2_alg);
940 return status;
941}
942
943/* Wrapper for psa_pake_abort */
944psa_status_t mbedtls_test_wrap_psa_pake_abort(
945 psa_pake_operation_t *arg0_operation)
946{
947 psa_status_t status = (psa_pake_abort)(arg0_operation);
948 return status;
949}
950
951/* Wrapper for psa_pake_get_implicit_key */
952psa_status_t mbedtls_test_wrap_psa_pake_get_implicit_key(
953 psa_pake_operation_t *arg0_operation,
954 psa_key_derivation_operation_t *arg1_output)
955{
956 psa_status_t status = (psa_pake_get_implicit_key)(arg0_operation, arg1_output);
957 return status;
958}
959
960/* Wrapper for psa_pake_input */
961psa_status_t mbedtls_test_wrap_psa_pake_input(
962 psa_pake_operation_t *arg0_operation,
963 psa_pake_step_t arg1_step,
964 const uint8_t *arg2_input,
965 size_t arg3_input_length)
966{
967 psa_status_t status = (psa_pake_input)(arg0_operation, arg1_step, arg2_input, arg3_input_length);
968 return status;
969}
970
971/* Wrapper for psa_pake_output */
972psa_status_t mbedtls_test_wrap_psa_pake_output(
973 psa_pake_operation_t *arg0_operation,
974 psa_pake_step_t arg1_step,
975 uint8_t *arg2_output,
976 size_t arg3_output_size,
977 size_t *arg4_output_length)
978{
979 psa_status_t status = (psa_pake_output)(arg0_operation, arg1_step, arg2_output, arg3_output_size, arg4_output_length);
980 return status;
981}
982
983/* Wrapper for psa_pake_set_password_key */
984psa_status_t mbedtls_test_wrap_psa_pake_set_password_key(
985 psa_pake_operation_t *arg0_operation,
986 mbedtls_svc_key_id_t arg1_password)
987{
988 psa_status_t status = (psa_pake_set_password_key)(arg0_operation, arg1_password);
989 return status;
990}
991
992/* Wrapper for psa_pake_set_peer */
993psa_status_t mbedtls_test_wrap_psa_pake_set_peer(
994 psa_pake_operation_t *arg0_operation,
995 const uint8_t *arg1_peer_id,
996 size_t arg2_peer_id_len)
997{
998 psa_status_t status = (psa_pake_set_peer)(arg0_operation, arg1_peer_id, arg2_peer_id_len);
999 return status;
1000}
1001
1002/* Wrapper for psa_pake_set_role */
1003psa_status_t mbedtls_test_wrap_psa_pake_set_role(
1004 psa_pake_operation_t *arg0_operation,
1005 psa_pake_role_t arg1_role)
1006{
1007 psa_status_t status = (psa_pake_set_role)(arg0_operation, arg1_role);
1008 return status;
1009}
1010
1011/* Wrapper for psa_pake_set_user */
1012psa_status_t mbedtls_test_wrap_psa_pake_set_user(
1013 psa_pake_operation_t *arg0_operation,
1014 const uint8_t *arg1_user_id,
1015 size_t arg2_user_id_len)
1016{
1017 psa_status_t status = (psa_pake_set_user)(arg0_operation, arg1_user_id, arg2_user_id_len);
1018 return status;
1019}
1020
1021/* Wrapper for psa_pake_setup */
1022psa_status_t mbedtls_test_wrap_psa_pake_setup(
1023 psa_pake_operation_t *arg0_operation,
1024 const psa_pake_cipher_suite_t *arg1_cipher_suite)
1025{
1026 psa_status_t status = (psa_pake_setup)(arg0_operation, arg1_cipher_suite);
1027 return status;
1028}
1029
1030/* Wrapper for psa_purge_key */
1031psa_status_t mbedtls_test_wrap_psa_purge_key(
1032 mbedtls_svc_key_id_t arg0_key)
1033{
1034 psa_status_t status = (psa_purge_key)(arg0_key);
1035 return status;
1036}
1037
1038/* Wrapper for psa_raw_key_agreement */
1039psa_status_t mbedtls_test_wrap_psa_raw_key_agreement(
1040 psa_algorithm_t arg0_alg,
1041 mbedtls_svc_key_id_t arg1_private_key,
1042 const uint8_t *arg2_peer_key,
1043 size_t arg3_peer_key_length,
1044 uint8_t *arg4_output,
1045 size_t arg5_output_size,
1046 size_t *arg6_output_length)
1047{
1048 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);
1049 return status;
1050}
1051
1052/* Wrapper for psa_sign_hash */
1053psa_status_t mbedtls_test_wrap_psa_sign_hash(
1054 mbedtls_svc_key_id_t arg0_key,
1055 psa_algorithm_t arg1_alg,
1056 const uint8_t *arg2_hash,
1057 size_t arg3_hash_length,
1058 uint8_t *arg4_signature,
1059 size_t arg5_signature_size,
1060 size_t *arg6_signature_length)
1061{
Thomas Daubneyf430f472024-01-30 12:25:35 +00001062#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
1063 MBEDTLS_TEST_MEMORY_POISON(arg2_hash, arg3_hash_length);
1064 MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_size);
1065#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001066 psa_status_t status = (psa_sign_hash)(arg0_key, arg1_alg, arg2_hash, arg3_hash_length, arg4_signature, arg5_signature_size, arg6_signature_length);
Thomas Daubneyf430f472024-01-30 12:25:35 +00001067#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
1068 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_hash, arg3_hash_length);
1069 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_size);
1070#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001071 return status;
1072}
1073
1074/* Wrapper for psa_sign_hash_abort */
1075psa_status_t mbedtls_test_wrap_psa_sign_hash_abort(
1076 psa_sign_hash_interruptible_operation_t *arg0_operation)
1077{
1078 psa_status_t status = (psa_sign_hash_abort)(arg0_operation);
1079 return status;
1080}
1081
1082/* Wrapper for psa_sign_hash_complete */
1083psa_status_t mbedtls_test_wrap_psa_sign_hash_complete(
1084 psa_sign_hash_interruptible_operation_t *arg0_operation,
1085 uint8_t *arg1_signature,
1086 size_t arg2_signature_size,
1087 size_t *arg3_signature_length)
1088{
1089 psa_status_t status = (psa_sign_hash_complete)(arg0_operation, arg1_signature, arg2_signature_size, arg3_signature_length);
1090 return status;
1091}
1092
1093/* Wrapper for psa_sign_hash_start */
1094psa_status_t mbedtls_test_wrap_psa_sign_hash_start(
1095 psa_sign_hash_interruptible_operation_t *arg0_operation,
1096 mbedtls_svc_key_id_t arg1_key,
1097 psa_algorithm_t arg2_alg,
1098 const uint8_t *arg3_hash,
1099 size_t arg4_hash_length)
1100{
1101 psa_status_t status = (psa_sign_hash_start)(arg0_operation, arg1_key, arg2_alg, arg3_hash, arg4_hash_length);
1102 return status;
1103}
1104
1105/* Wrapper for psa_sign_message */
1106psa_status_t mbedtls_test_wrap_psa_sign_message(
1107 mbedtls_svc_key_id_t arg0_key,
1108 psa_algorithm_t arg1_alg,
1109 const uint8_t *arg2_input,
1110 size_t arg3_input_length,
1111 uint8_t *arg4_signature,
1112 size_t arg5_signature_size,
1113 size_t *arg6_signature_length)
1114{
Thomas Daubneyf430f472024-01-30 12:25:35 +00001115#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
1116 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
1117 MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_size);
1118#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001119 psa_status_t status = (psa_sign_message)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_signature, arg5_signature_size, arg6_signature_length);
Thomas Daubneyf430f472024-01-30 12:25:35 +00001120#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
1121 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
1122 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_size);
1123#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001124 return status;
1125}
1126
1127/* Wrapper for psa_verify_hash */
1128psa_status_t mbedtls_test_wrap_psa_verify_hash(
1129 mbedtls_svc_key_id_t arg0_key,
1130 psa_algorithm_t arg1_alg,
1131 const uint8_t *arg2_hash,
1132 size_t arg3_hash_length,
1133 const uint8_t *arg4_signature,
1134 size_t arg5_signature_length)
1135{
Thomas Daubneyf430f472024-01-30 12:25:35 +00001136#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
1137 MBEDTLS_TEST_MEMORY_POISON(arg2_hash, arg3_hash_length);
1138 MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_length);
1139#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001140 psa_status_t status = (psa_verify_hash)(arg0_key, arg1_alg, arg2_hash, arg3_hash_length, arg4_signature, arg5_signature_length);
Thomas Daubneyf430f472024-01-30 12:25:35 +00001141#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
1142 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_hash, arg3_hash_length);
1143 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_length);
1144#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001145 return status;
1146}
1147
1148/* Wrapper for psa_verify_hash_abort */
1149psa_status_t mbedtls_test_wrap_psa_verify_hash_abort(
1150 psa_verify_hash_interruptible_operation_t *arg0_operation)
1151{
1152 psa_status_t status = (psa_verify_hash_abort)(arg0_operation);
1153 return status;
1154}
1155
1156/* Wrapper for psa_verify_hash_complete */
1157psa_status_t mbedtls_test_wrap_psa_verify_hash_complete(
1158 psa_verify_hash_interruptible_operation_t *arg0_operation)
1159{
1160 psa_status_t status = (psa_verify_hash_complete)(arg0_operation);
1161 return status;
1162}
1163
1164/* Wrapper for psa_verify_hash_start */
1165psa_status_t mbedtls_test_wrap_psa_verify_hash_start(
1166 psa_verify_hash_interruptible_operation_t *arg0_operation,
1167 mbedtls_svc_key_id_t arg1_key,
1168 psa_algorithm_t arg2_alg,
1169 const uint8_t *arg3_hash,
1170 size_t arg4_hash_length,
1171 const uint8_t *arg5_signature,
1172 size_t arg6_signature_length)
1173{
1174 psa_status_t status = (psa_verify_hash_start)(arg0_operation, arg1_key, arg2_alg, arg3_hash, arg4_hash_length, arg5_signature, arg6_signature_length);
1175 return status;
1176}
1177
1178/* Wrapper for psa_verify_message */
1179psa_status_t mbedtls_test_wrap_psa_verify_message(
1180 mbedtls_svc_key_id_t arg0_key,
1181 psa_algorithm_t arg1_alg,
1182 const uint8_t *arg2_input,
1183 size_t arg3_input_length,
1184 const uint8_t *arg4_signature,
1185 size_t arg5_signature_length)
1186{
Thomas Daubneyf430f472024-01-30 12:25:35 +00001187#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
1188 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
1189 MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_length);
1190#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001191 psa_status_t status = (psa_verify_message)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_signature, arg5_signature_length);
Thomas Daubneyf430f472024-01-30 12:25:35 +00001192#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
1193 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
1194 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_length);
1195#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001196 return status;
1197}
1198
Gilles Peskine4411c9c2024-01-04 20:51:38 +01001199#endif /* defined(MBEDTLS_PSA_CRYPTO_C) && defined(MBEDTLS_TEST_HOOKS) && \
1200 !defined(RECORD_PSA_STATUS_COVERAGE_LOG) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001201
1202/* End of automatically generated file. */