blob: 71ea09c44f9079af188052d519d7404b42eed4b9 [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{
Thomas Daubney54e6b412024-01-31 16:56:17 +0000274#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
275 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
276 MBEDTLS_TEST_MEMORY_POISON(arg4_salt, arg5_salt_length);
277 MBEDTLS_TEST_MEMORY_POISON(arg6_output, arg7_output_size);
278#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100279 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);
Thomas Daubney54e6b412024-01-31 16:56:17 +0000280#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
281 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
282 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_salt, arg5_salt_length);
283 MBEDTLS_TEST_MEMORY_UNPOISON(arg6_output, arg7_output_size);
284#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100285 return status;
286}
287
288/* Wrapper for psa_asymmetric_encrypt */
289psa_status_t mbedtls_test_wrap_psa_asymmetric_encrypt(
290 mbedtls_svc_key_id_t arg0_key,
291 psa_algorithm_t arg1_alg,
292 const uint8_t *arg2_input,
293 size_t arg3_input_length,
294 const uint8_t *arg4_salt,
295 size_t arg5_salt_length,
296 uint8_t *arg6_output,
297 size_t arg7_output_size,
298 size_t *arg8_output_length)
299{
Thomas Daubney27b48a32024-01-30 14:04:47 +0000300#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
301 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
302 MBEDTLS_TEST_MEMORY_POISON(arg4_salt, arg5_salt_length);
303 MBEDTLS_TEST_MEMORY_POISON(arg6_output, arg7_output_size);
304#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100305 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);
Thomas Daubney27b48a32024-01-30 14:04:47 +0000306#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
307 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
308 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_salt, arg5_salt_length);
309 MBEDTLS_TEST_MEMORY_UNPOISON(arg6_output, arg7_output_size);
310#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100311 return status;
312}
313
314/* Wrapper for psa_cipher_abort */
315psa_status_t mbedtls_test_wrap_psa_cipher_abort(
316 psa_cipher_operation_t *arg0_operation)
317{
318 psa_status_t status = (psa_cipher_abort)(arg0_operation);
319 return status;
320}
321
322/* Wrapper for psa_cipher_decrypt */
323psa_status_t mbedtls_test_wrap_psa_cipher_decrypt(
324 mbedtls_svc_key_id_t arg0_key,
325 psa_algorithm_t arg1_alg,
326 const uint8_t *arg2_input,
327 size_t arg3_input_length,
328 uint8_t *arg4_output,
329 size_t arg5_output_size,
330 size_t *arg6_output_length)
331{
Gabor Mezeib8f97a12024-01-24 16:58:40 +0100332#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
333 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
334 MBEDTLS_TEST_MEMORY_POISON(arg4_output, arg5_output_size);
335#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100336 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 +0100337#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
338 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
339 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_output, arg5_output_size);
340#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100341 return status;
342}
343
344/* Wrapper for psa_cipher_decrypt_setup */
345psa_status_t mbedtls_test_wrap_psa_cipher_decrypt_setup(
346 psa_cipher_operation_t *arg0_operation,
347 mbedtls_svc_key_id_t arg1_key,
348 psa_algorithm_t arg2_alg)
349{
350 psa_status_t status = (psa_cipher_decrypt_setup)(arg0_operation, arg1_key, arg2_alg);
351 return status;
352}
353
354/* Wrapper for psa_cipher_encrypt */
355psa_status_t mbedtls_test_wrap_psa_cipher_encrypt(
356 mbedtls_svc_key_id_t arg0_key,
357 psa_algorithm_t arg1_alg,
358 const uint8_t *arg2_input,
359 size_t arg3_input_length,
360 uint8_t *arg4_output,
361 size_t arg5_output_size,
362 size_t *arg6_output_length)
363{
Gilles Peskine88385c22024-01-04 20:33:29 +0100364#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
Gilles Peskine90d14d72024-01-04 16:59:28 +0100365 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
366 MBEDTLS_TEST_MEMORY_POISON(arg4_output, arg5_output_size);
Gilles Peskine88385c22024-01-04 20:33:29 +0100367#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100368 psa_status_t status = (psa_cipher_encrypt)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_output, arg5_output_size, arg6_output_length);
Gilles Peskine88385c22024-01-04 20:33:29 +0100369#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
Gilles Peskine90d14d72024-01-04 16:59:28 +0100370 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
371 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_output, arg5_output_size);
Gilles Peskine88385c22024-01-04 20:33:29 +0100372#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100373 return status;
374}
375
376/* Wrapper for psa_cipher_encrypt_setup */
377psa_status_t mbedtls_test_wrap_psa_cipher_encrypt_setup(
378 psa_cipher_operation_t *arg0_operation,
379 mbedtls_svc_key_id_t arg1_key,
380 psa_algorithm_t arg2_alg)
381{
382 psa_status_t status = (psa_cipher_encrypt_setup)(arg0_operation, arg1_key, arg2_alg);
383 return status;
384}
385
386/* Wrapper for psa_cipher_finish */
387psa_status_t mbedtls_test_wrap_psa_cipher_finish(
388 psa_cipher_operation_t *arg0_operation,
389 uint8_t *arg1_output,
390 size_t arg2_output_size,
391 size_t *arg3_output_length)
392{
Gabor Mezeib8f97a12024-01-24 16:58:40 +0100393#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
394 MBEDTLS_TEST_MEMORY_POISON(arg1_output, arg2_output_size);
395#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100396 psa_status_t status = (psa_cipher_finish)(arg0_operation, arg1_output, arg2_output_size, arg3_output_length);
Gabor Mezeib8f97a12024-01-24 16:58:40 +0100397#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
398 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_output, arg2_output_size);
399#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100400 return status;
401}
402
403/* Wrapper for psa_cipher_generate_iv */
404psa_status_t mbedtls_test_wrap_psa_cipher_generate_iv(
405 psa_cipher_operation_t *arg0_operation,
406 uint8_t *arg1_iv,
407 size_t arg2_iv_size,
408 size_t *arg3_iv_length)
409{
Gabor Mezeib74ac662024-02-01 10:39:56 +0100410#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
411 MBEDTLS_TEST_MEMORY_POISON(arg1_iv, arg2_iv_size);
412#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100413 psa_status_t status = (psa_cipher_generate_iv)(arg0_operation, arg1_iv, arg2_iv_size, arg3_iv_length);
Gabor Mezeib74ac662024-02-01 10:39:56 +0100414#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
415 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_iv, arg2_iv_size);
416#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100417 return status;
418}
419
420/* Wrapper for psa_cipher_set_iv */
421psa_status_t mbedtls_test_wrap_psa_cipher_set_iv(
422 psa_cipher_operation_t *arg0_operation,
423 const uint8_t *arg1_iv,
424 size_t arg2_iv_length)
425{
Gabor Mezeib74ac662024-02-01 10:39:56 +0100426#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
427 MBEDTLS_TEST_MEMORY_POISON(arg1_iv, arg2_iv_length);
428#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100429 psa_status_t status = (psa_cipher_set_iv)(arg0_operation, arg1_iv, arg2_iv_length);
Gabor Mezeib74ac662024-02-01 10:39:56 +0100430#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
431 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_iv, arg2_iv_length);
432#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100433 return status;
434}
435
436/* Wrapper for psa_cipher_update */
437psa_status_t mbedtls_test_wrap_psa_cipher_update(
438 psa_cipher_operation_t *arg0_operation,
439 const uint8_t *arg1_input,
440 size_t arg2_input_length,
441 uint8_t *arg3_output,
442 size_t arg4_output_size,
443 size_t *arg5_output_length)
444{
Gabor Mezeib8f97a12024-01-24 16:58:40 +0100445#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
446 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
447 MBEDTLS_TEST_MEMORY_POISON(arg3_output, arg4_output_size);
448#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100449 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 +0100450#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
451 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
452 MBEDTLS_TEST_MEMORY_UNPOISON(arg3_output, arg4_output_size);
453#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100454 return status;
455}
456
457/* Wrapper for psa_copy_key */
458psa_status_t mbedtls_test_wrap_psa_copy_key(
459 mbedtls_svc_key_id_t arg0_source_key,
460 const psa_key_attributes_t *arg1_attributes,
461 mbedtls_svc_key_id_t *arg2_target_key)
462{
463 psa_status_t status = (psa_copy_key)(arg0_source_key, arg1_attributes, arg2_target_key);
464 return status;
465}
466
467/* Wrapper for psa_crypto_driver_pake_get_cipher_suite */
468psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_cipher_suite(
469 const psa_crypto_driver_pake_inputs_t *arg0_inputs,
470 psa_pake_cipher_suite_t *arg1_cipher_suite)
471{
472 psa_status_t status = (psa_crypto_driver_pake_get_cipher_suite)(arg0_inputs, arg1_cipher_suite);
473 return status;
474}
475
476/* Wrapper for psa_crypto_driver_pake_get_password */
477psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_password(
478 const psa_crypto_driver_pake_inputs_t *arg0_inputs,
479 uint8_t *arg1_buffer,
480 size_t arg2_buffer_size,
481 size_t *arg3_buffer_length)
482{
483 psa_status_t status = (psa_crypto_driver_pake_get_password)(arg0_inputs, arg1_buffer, arg2_buffer_size, arg3_buffer_length);
484 return status;
485}
486
487/* Wrapper for psa_crypto_driver_pake_get_password_len */
488psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_password_len(
489 const psa_crypto_driver_pake_inputs_t *arg0_inputs,
490 size_t *arg1_password_len)
491{
492 psa_status_t status = (psa_crypto_driver_pake_get_password_len)(arg0_inputs, arg1_password_len);
493 return status;
494}
495
496/* Wrapper for psa_crypto_driver_pake_get_peer */
497psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_peer(
498 const psa_crypto_driver_pake_inputs_t *arg0_inputs,
499 uint8_t *arg1_peer_id,
500 size_t arg2_peer_id_size,
501 size_t *arg3_peer_id_length)
502{
503 psa_status_t status = (psa_crypto_driver_pake_get_peer)(arg0_inputs, arg1_peer_id, arg2_peer_id_size, arg3_peer_id_length);
504 return status;
505}
506
507/* Wrapper for psa_crypto_driver_pake_get_peer_len */
508psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_peer_len(
509 const psa_crypto_driver_pake_inputs_t *arg0_inputs,
510 size_t *arg1_peer_len)
511{
512 psa_status_t status = (psa_crypto_driver_pake_get_peer_len)(arg0_inputs, arg1_peer_len);
513 return status;
514}
515
516/* Wrapper for psa_crypto_driver_pake_get_user */
517psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_user(
518 const psa_crypto_driver_pake_inputs_t *arg0_inputs,
519 uint8_t *arg1_user_id,
520 size_t arg2_user_id_size,
521 size_t *arg3_user_id_len)
522{
523 psa_status_t status = (psa_crypto_driver_pake_get_user)(arg0_inputs, arg1_user_id, arg2_user_id_size, arg3_user_id_len);
524 return status;
525}
526
527/* Wrapper for psa_crypto_driver_pake_get_user_len */
528psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_user_len(
529 const psa_crypto_driver_pake_inputs_t *arg0_inputs,
530 size_t *arg1_user_len)
531{
532 psa_status_t status = (psa_crypto_driver_pake_get_user_len)(arg0_inputs, arg1_user_len);
533 return status;
534}
535
536/* Wrapper for psa_crypto_init */
537psa_status_t mbedtls_test_wrap_psa_crypto_init(void)
538{
539 psa_status_t status = (psa_crypto_init)();
540 return status;
541}
542
543/* Wrapper for psa_destroy_key */
544psa_status_t mbedtls_test_wrap_psa_destroy_key(
545 mbedtls_svc_key_id_t arg0_key)
546{
547 psa_status_t status = (psa_destroy_key)(arg0_key);
548 return status;
549}
550
551/* Wrapper for psa_export_key */
552psa_status_t mbedtls_test_wrap_psa_export_key(
553 mbedtls_svc_key_id_t arg0_key,
554 uint8_t *arg1_data,
555 size_t arg2_data_size,
556 size_t *arg3_data_length)
557{
Ryan Everett77b91e32024-01-25 10:58:06 +0000558#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
559 MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_size);
560#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100561 psa_status_t status = (psa_export_key)(arg0_key, arg1_data, arg2_data_size, arg3_data_length);
Ryan Everett77b91e32024-01-25 10:58:06 +0000562#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
563 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_size);
564#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100565 return status;
566}
567
568/* Wrapper for psa_export_public_key */
569psa_status_t mbedtls_test_wrap_psa_export_public_key(
570 mbedtls_svc_key_id_t arg0_key,
571 uint8_t *arg1_data,
572 size_t arg2_data_size,
573 size_t *arg3_data_length)
574{
Ryan Everett77b91e32024-01-25 10:58:06 +0000575#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
576 MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_size);
577#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100578 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 +0000579#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
580 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_size);
581#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100582 return status;
583}
584
585/* Wrapper for psa_generate_key */
586psa_status_t mbedtls_test_wrap_psa_generate_key(
587 const psa_key_attributes_t *arg0_attributes,
588 mbedtls_svc_key_id_t *arg1_key)
589{
590 psa_status_t status = (psa_generate_key)(arg0_attributes, arg1_key);
591 return status;
592}
593
594/* Wrapper for psa_generate_random */
595psa_status_t mbedtls_test_wrap_psa_generate_random(
596 uint8_t *arg0_output,
597 size_t arg1_output_size)
598{
David Horstmann075c5fb2024-02-06 15:44:08 +0000599#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
600 MBEDTLS_TEST_MEMORY_POISON(arg0_output, arg1_output_size);
601#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100602 psa_status_t status = (psa_generate_random)(arg0_output, arg1_output_size);
David Horstmann075c5fb2024-02-06 15:44:08 +0000603#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
604 MBEDTLS_TEST_MEMORY_UNPOISON(arg0_output, arg1_output_size);
605#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100606 return status;
607}
608
609/* Wrapper for psa_get_key_attributes */
610psa_status_t mbedtls_test_wrap_psa_get_key_attributes(
611 mbedtls_svc_key_id_t arg0_key,
612 psa_key_attributes_t *arg1_attributes)
613{
614 psa_status_t status = (psa_get_key_attributes)(arg0_key, arg1_attributes);
615 return status;
616}
617
618/* Wrapper for psa_hash_abort */
619psa_status_t mbedtls_test_wrap_psa_hash_abort(
620 psa_hash_operation_t *arg0_operation)
621{
622 psa_status_t status = (psa_hash_abort)(arg0_operation);
623 return status;
624}
625
626/* Wrapper for psa_hash_clone */
627psa_status_t mbedtls_test_wrap_psa_hash_clone(
628 const psa_hash_operation_t *arg0_source_operation,
629 psa_hash_operation_t *arg1_target_operation)
630{
631 psa_status_t status = (psa_hash_clone)(arg0_source_operation, arg1_target_operation);
632 return status;
633}
634
635/* Wrapper for psa_hash_compare */
636psa_status_t mbedtls_test_wrap_psa_hash_compare(
637 psa_algorithm_t arg0_alg,
638 const uint8_t *arg1_input,
639 size_t arg2_input_length,
640 const uint8_t *arg3_hash,
641 size_t arg4_hash_length)
642{
Thomas Daubney45c85862024-01-25 16:48:09 +0000643#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
644 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
645 MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_length);
646#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100647 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 +0000648#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
649 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
650 MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_length);
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_compute */
656psa_status_t mbedtls_test_wrap_psa_hash_compute(
657 psa_algorithm_t arg0_alg,
658 const uint8_t *arg1_input,
659 size_t arg2_input_length,
660 uint8_t *arg3_hash,
661 size_t arg4_hash_size,
662 size_t *arg5_hash_length)
663{
Thomas Daubney45c85862024-01-25 16:48:09 +0000664#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
665 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
666 MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_size);
667#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100668 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 +0000669#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
670 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
671 MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_size);
672#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100673 return status;
674}
675
676/* Wrapper for psa_hash_finish */
677psa_status_t mbedtls_test_wrap_psa_hash_finish(
678 psa_hash_operation_t *arg0_operation,
679 uint8_t *arg1_hash,
680 size_t arg2_hash_size,
681 size_t *arg3_hash_length)
682{
Thomas Daubney45c85862024-01-25 16:48:09 +0000683#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
684 MBEDTLS_TEST_MEMORY_POISON(arg1_hash, arg2_hash_size);
685#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100686 psa_status_t status = (psa_hash_finish)(arg0_operation, arg1_hash, arg2_hash_size, arg3_hash_length);
Thomas Daubney45c85862024-01-25 16:48:09 +0000687#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
688 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_hash, arg2_hash_size);
689#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100690 return status;
691}
692
693/* Wrapper for psa_hash_setup */
694psa_status_t mbedtls_test_wrap_psa_hash_setup(
695 psa_hash_operation_t *arg0_operation,
696 psa_algorithm_t arg1_alg)
697{
698 psa_status_t status = (psa_hash_setup)(arg0_operation, arg1_alg);
699 return status;
700}
701
702/* Wrapper for psa_hash_update */
703psa_status_t mbedtls_test_wrap_psa_hash_update(
704 psa_hash_operation_t *arg0_operation,
705 const uint8_t *arg1_input,
706 size_t arg2_input_length)
707{
Thomas Daubney45c85862024-01-25 16:48:09 +0000708#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
709 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
710#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100711 psa_status_t status = (psa_hash_update)(arg0_operation, arg1_input, arg2_input_length);
Thomas Daubney45c85862024-01-25 16:48:09 +0000712#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
713 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
714#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100715 return status;
716}
717
718/* Wrapper for psa_hash_verify */
719psa_status_t mbedtls_test_wrap_psa_hash_verify(
720 psa_hash_operation_t *arg0_operation,
721 const uint8_t *arg1_hash,
722 size_t arg2_hash_length)
723{
Thomas Daubney45c85862024-01-25 16:48:09 +0000724#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
725 MBEDTLS_TEST_MEMORY_POISON(arg1_hash, arg2_hash_length);
726#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100727 psa_status_t status = (psa_hash_verify)(arg0_operation, arg1_hash, arg2_hash_length);
Thomas Daubney45c85862024-01-25 16:48:09 +0000728#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
729 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_hash, arg2_hash_length);
730#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100731 return status;
732}
733
734/* Wrapper for psa_import_key */
735psa_status_t mbedtls_test_wrap_psa_import_key(
736 const psa_key_attributes_t *arg0_attributes,
737 const uint8_t *arg1_data,
738 size_t arg2_data_length,
739 mbedtls_svc_key_id_t *arg3_key)
740{
Ryan Everett77b91e32024-01-25 10:58:06 +0000741#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
742 MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_length);
743#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100744 psa_status_t status = (psa_import_key)(arg0_attributes, arg1_data, arg2_data_length, arg3_key);
Ryan Everett77b91e32024-01-25 10:58:06 +0000745#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
746 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_length);
747#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100748 return status;
749}
750
751/* Wrapper for psa_key_derivation_abort */
752psa_status_t mbedtls_test_wrap_psa_key_derivation_abort(
753 psa_key_derivation_operation_t *arg0_operation)
754{
755 psa_status_t status = (psa_key_derivation_abort)(arg0_operation);
756 return status;
757}
758
759/* Wrapper for psa_key_derivation_get_capacity */
760psa_status_t mbedtls_test_wrap_psa_key_derivation_get_capacity(
761 const psa_key_derivation_operation_t *arg0_operation,
762 size_t *arg1_capacity)
763{
764 psa_status_t status = (psa_key_derivation_get_capacity)(arg0_operation, arg1_capacity);
765 return status;
766}
767
768/* Wrapper for psa_key_derivation_input_bytes */
769psa_status_t mbedtls_test_wrap_psa_key_derivation_input_bytes(
770 psa_key_derivation_operation_t *arg0_operation,
771 psa_key_derivation_step_t arg1_step,
772 const uint8_t *arg2_data,
773 size_t arg3_data_length)
774{
Ryan Everett198a4d92024-01-25 11:44:56 +0000775#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
776 MBEDTLS_TEST_MEMORY_POISON(arg2_data, arg3_data_length);
777#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100778 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 +0000779#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
780 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_data, arg3_data_length);
781#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100782 return status;
783}
784
785/* Wrapper for psa_key_derivation_input_integer */
786psa_status_t mbedtls_test_wrap_psa_key_derivation_input_integer(
787 psa_key_derivation_operation_t *arg0_operation,
788 psa_key_derivation_step_t arg1_step,
789 uint64_t arg2_value)
790{
791 psa_status_t status = (psa_key_derivation_input_integer)(arg0_operation, arg1_step, arg2_value);
792 return status;
793}
794
795/* Wrapper for psa_key_derivation_input_key */
796psa_status_t mbedtls_test_wrap_psa_key_derivation_input_key(
797 psa_key_derivation_operation_t *arg0_operation,
798 psa_key_derivation_step_t arg1_step,
799 mbedtls_svc_key_id_t arg2_key)
800{
801 psa_status_t status = (psa_key_derivation_input_key)(arg0_operation, arg1_step, arg2_key);
802 return status;
803}
804
805/* Wrapper for psa_key_derivation_key_agreement */
806psa_status_t mbedtls_test_wrap_psa_key_derivation_key_agreement(
807 psa_key_derivation_operation_t *arg0_operation,
808 psa_key_derivation_step_t arg1_step,
809 mbedtls_svc_key_id_t arg2_private_key,
810 const uint8_t *arg3_peer_key,
811 size_t arg4_peer_key_length)
812{
Thomas Daubneyfe2bda32024-02-15 13:35:06 +0000813#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
814 MBEDTLS_TEST_MEMORY_POISON(arg3_peer_key, arg4_peer_key_length);
815#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100816 psa_status_t status = (psa_key_derivation_key_agreement)(arg0_operation, arg1_step, arg2_private_key, arg3_peer_key, arg4_peer_key_length);
Thomas Daubneyfe2bda32024-02-15 13:35:06 +0000817#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
818 MBEDTLS_TEST_MEMORY_UNPOISON(arg3_peer_key, arg4_peer_key_length);
819#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100820 return status;
821}
822
823/* Wrapper for psa_key_derivation_output_bytes */
824psa_status_t mbedtls_test_wrap_psa_key_derivation_output_bytes(
825 psa_key_derivation_operation_t *arg0_operation,
826 uint8_t *arg1_output,
827 size_t arg2_output_length)
828{
Ryan Everett198a4d92024-01-25 11:44:56 +0000829#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
830 MBEDTLS_TEST_MEMORY_POISON(arg1_output, arg2_output_length);
831#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100832 psa_status_t status = (psa_key_derivation_output_bytes)(arg0_operation, arg1_output, arg2_output_length);
Ryan Everett198a4d92024-01-25 11:44:56 +0000833#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
834 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_output, arg2_output_length);
835#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100836 return status;
837}
838
839/* Wrapper for psa_key_derivation_output_key */
840psa_status_t mbedtls_test_wrap_psa_key_derivation_output_key(
841 const psa_key_attributes_t *arg0_attributes,
842 psa_key_derivation_operation_t *arg1_operation,
843 mbedtls_svc_key_id_t *arg2_key)
844{
845 psa_status_t status = (psa_key_derivation_output_key)(arg0_attributes, arg1_operation, arg2_key);
846 return status;
847}
848
849/* Wrapper for psa_key_derivation_set_capacity */
850psa_status_t mbedtls_test_wrap_psa_key_derivation_set_capacity(
851 psa_key_derivation_operation_t *arg0_operation,
852 size_t arg1_capacity)
853{
854 psa_status_t status = (psa_key_derivation_set_capacity)(arg0_operation, arg1_capacity);
855 return status;
856}
857
858/* Wrapper for psa_key_derivation_setup */
859psa_status_t mbedtls_test_wrap_psa_key_derivation_setup(
860 psa_key_derivation_operation_t *arg0_operation,
861 psa_algorithm_t arg1_alg)
862{
863 psa_status_t status = (psa_key_derivation_setup)(arg0_operation, arg1_alg);
864 return status;
865}
866
867/* Wrapper for psa_mac_abort */
868psa_status_t mbedtls_test_wrap_psa_mac_abort(
869 psa_mac_operation_t *arg0_operation)
870{
871 psa_status_t status = (psa_mac_abort)(arg0_operation);
872 return status;
873}
874
875/* Wrapper for psa_mac_compute */
876psa_status_t mbedtls_test_wrap_psa_mac_compute(
877 mbedtls_svc_key_id_t arg0_key,
878 psa_algorithm_t arg1_alg,
879 const uint8_t *arg2_input,
880 size_t arg3_input_length,
881 uint8_t *arg4_mac,
882 size_t arg5_mac_size,
883 size_t *arg6_mac_length)
884{
Thomas Daubneya1cf1012024-01-30 11:18:54 +0000885#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
886 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
887 MBEDTLS_TEST_MEMORY_POISON(arg4_mac, arg5_mac_size);
888#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100889 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 +0000890#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
891 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
892 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_mac, arg5_mac_size);
893#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100894 return status;
895}
896
897/* Wrapper for psa_mac_sign_finish */
898psa_status_t mbedtls_test_wrap_psa_mac_sign_finish(
899 psa_mac_operation_t *arg0_operation,
900 uint8_t *arg1_mac,
901 size_t arg2_mac_size,
902 size_t *arg3_mac_length)
903{
Thomas Daubneya1cf1012024-01-30 11:18:54 +0000904#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
905 MBEDTLS_TEST_MEMORY_POISON(arg1_mac, arg2_mac_size);
906#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100907 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 +0000908#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
909 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_mac, arg2_mac_size);
910#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100911 return status;
912}
913
914/* Wrapper for psa_mac_sign_setup */
915psa_status_t mbedtls_test_wrap_psa_mac_sign_setup(
916 psa_mac_operation_t *arg0_operation,
917 mbedtls_svc_key_id_t arg1_key,
918 psa_algorithm_t arg2_alg)
919{
920 psa_status_t status = (psa_mac_sign_setup)(arg0_operation, arg1_key, arg2_alg);
921 return status;
922}
923
924/* Wrapper for psa_mac_update */
925psa_status_t mbedtls_test_wrap_psa_mac_update(
926 psa_mac_operation_t *arg0_operation,
927 const uint8_t *arg1_input,
928 size_t arg2_input_length)
929{
Thomas Daubneya1cf1012024-01-30 11:18:54 +0000930#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
931 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
932#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100933 psa_status_t status = (psa_mac_update)(arg0_operation, arg1_input, arg2_input_length);
Thomas Daubneya1cf1012024-01-30 11:18:54 +0000934#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
935 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
936#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100937 return status;
938}
939
940/* Wrapper for psa_mac_verify */
941psa_status_t mbedtls_test_wrap_psa_mac_verify(
942 mbedtls_svc_key_id_t arg0_key,
943 psa_algorithm_t arg1_alg,
944 const uint8_t *arg2_input,
945 size_t arg3_input_length,
946 const uint8_t *arg4_mac,
947 size_t arg5_mac_length)
948{
Thomas Daubneya1cf1012024-01-30 11:18:54 +0000949#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
950 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
951 MBEDTLS_TEST_MEMORY_POISON(arg4_mac, arg5_mac_length);
952#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100953 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 +0000954#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
955 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
956 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_mac, arg5_mac_length);
957#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100958 return status;
959}
960
961/* Wrapper for psa_mac_verify_finish */
962psa_status_t mbedtls_test_wrap_psa_mac_verify_finish(
963 psa_mac_operation_t *arg0_operation,
964 const uint8_t *arg1_mac,
965 size_t arg2_mac_length)
966{
Thomas Daubneya1cf1012024-01-30 11:18:54 +0000967#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
968 MBEDTLS_TEST_MEMORY_POISON(arg1_mac, arg2_mac_length);
969#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100970 psa_status_t status = (psa_mac_verify_finish)(arg0_operation, arg1_mac, arg2_mac_length);
Thomas Daubneya1cf1012024-01-30 11:18:54 +0000971#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
972 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_mac, arg2_mac_length);
973#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100974 return status;
975}
976
977/* Wrapper for psa_mac_verify_setup */
978psa_status_t mbedtls_test_wrap_psa_mac_verify_setup(
979 psa_mac_operation_t *arg0_operation,
980 mbedtls_svc_key_id_t arg1_key,
981 psa_algorithm_t arg2_alg)
982{
983 psa_status_t status = (psa_mac_verify_setup)(arg0_operation, arg1_key, arg2_alg);
984 return status;
985}
986
987/* Wrapper for psa_pake_abort */
988psa_status_t mbedtls_test_wrap_psa_pake_abort(
989 psa_pake_operation_t *arg0_operation)
990{
991 psa_status_t status = (psa_pake_abort)(arg0_operation);
992 return status;
993}
994
995/* Wrapper for psa_pake_get_implicit_key */
996psa_status_t mbedtls_test_wrap_psa_pake_get_implicit_key(
997 psa_pake_operation_t *arg0_operation,
998 psa_key_derivation_operation_t *arg1_output)
999{
1000 psa_status_t status = (psa_pake_get_implicit_key)(arg0_operation, arg1_output);
1001 return status;
1002}
1003
1004/* Wrapper for psa_pake_input */
1005psa_status_t mbedtls_test_wrap_psa_pake_input(
1006 psa_pake_operation_t *arg0_operation,
1007 psa_pake_step_t arg1_step,
1008 const uint8_t *arg2_input,
1009 size_t arg3_input_length)
1010{
David Horstmann6076fe42024-01-23 15:28:51 +00001011#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
1012 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
1013#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001014 psa_status_t status = (psa_pake_input)(arg0_operation, arg1_step, arg2_input, arg3_input_length);
David Horstmann6076fe42024-01-23 15:28:51 +00001015#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
1016 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
1017#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001018 return status;
1019}
1020
1021/* Wrapper for psa_pake_output */
1022psa_status_t mbedtls_test_wrap_psa_pake_output(
1023 psa_pake_operation_t *arg0_operation,
1024 psa_pake_step_t arg1_step,
1025 uint8_t *arg2_output,
1026 size_t arg3_output_size,
1027 size_t *arg4_output_length)
1028{
David Horstmann6076fe42024-01-23 15:28:51 +00001029#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
1030 MBEDTLS_TEST_MEMORY_POISON(arg2_output, arg3_output_size);
1031#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001032 psa_status_t status = (psa_pake_output)(arg0_operation, arg1_step, arg2_output, arg3_output_size, arg4_output_length);
David Horstmann6076fe42024-01-23 15:28:51 +00001033#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
1034 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_output, arg3_output_size);
1035#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001036 return status;
1037}
1038
1039/* Wrapper for psa_pake_set_password_key */
1040psa_status_t mbedtls_test_wrap_psa_pake_set_password_key(
1041 psa_pake_operation_t *arg0_operation,
1042 mbedtls_svc_key_id_t arg1_password)
1043{
1044 psa_status_t status = (psa_pake_set_password_key)(arg0_operation, arg1_password);
1045 return status;
1046}
1047
1048/* Wrapper for psa_pake_set_peer */
1049psa_status_t mbedtls_test_wrap_psa_pake_set_peer(
1050 psa_pake_operation_t *arg0_operation,
1051 const uint8_t *arg1_peer_id,
1052 size_t arg2_peer_id_len)
1053{
David Horstmann6076fe42024-01-23 15:28:51 +00001054#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
1055 MBEDTLS_TEST_MEMORY_POISON(arg1_peer_id, arg2_peer_id_len);
1056#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001057 psa_status_t status = (psa_pake_set_peer)(arg0_operation, arg1_peer_id, arg2_peer_id_len);
David Horstmann6076fe42024-01-23 15:28:51 +00001058#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
1059 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_peer_id, arg2_peer_id_len);
1060#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001061 return status;
1062}
1063
1064/* Wrapper for psa_pake_set_role */
1065psa_status_t mbedtls_test_wrap_psa_pake_set_role(
1066 psa_pake_operation_t *arg0_operation,
1067 psa_pake_role_t arg1_role)
1068{
1069 psa_status_t status = (psa_pake_set_role)(arg0_operation, arg1_role);
1070 return status;
1071}
1072
1073/* Wrapper for psa_pake_set_user */
1074psa_status_t mbedtls_test_wrap_psa_pake_set_user(
1075 psa_pake_operation_t *arg0_operation,
1076 const uint8_t *arg1_user_id,
1077 size_t arg2_user_id_len)
1078{
David Horstmann6076fe42024-01-23 15:28:51 +00001079#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
1080 MBEDTLS_TEST_MEMORY_POISON(arg1_user_id, arg2_user_id_len);
1081#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001082 psa_status_t status = (psa_pake_set_user)(arg0_operation, arg1_user_id, arg2_user_id_len);
David Horstmann6076fe42024-01-23 15:28:51 +00001083#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
1084 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_user_id, arg2_user_id_len);
1085#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001086 return status;
1087}
1088
1089/* Wrapper for psa_pake_setup */
1090psa_status_t mbedtls_test_wrap_psa_pake_setup(
1091 psa_pake_operation_t *arg0_operation,
1092 const psa_pake_cipher_suite_t *arg1_cipher_suite)
1093{
1094 psa_status_t status = (psa_pake_setup)(arg0_operation, arg1_cipher_suite);
1095 return status;
1096}
1097
1098/* Wrapper for psa_purge_key */
1099psa_status_t mbedtls_test_wrap_psa_purge_key(
1100 mbedtls_svc_key_id_t arg0_key)
1101{
1102 psa_status_t status = (psa_purge_key)(arg0_key);
1103 return status;
1104}
1105
1106/* Wrapper for psa_raw_key_agreement */
1107psa_status_t mbedtls_test_wrap_psa_raw_key_agreement(
1108 psa_algorithm_t arg0_alg,
1109 mbedtls_svc_key_id_t arg1_private_key,
1110 const uint8_t *arg2_peer_key,
1111 size_t arg3_peer_key_length,
1112 uint8_t *arg4_output,
1113 size_t arg5_output_size,
1114 size_t *arg6_output_length)
1115{
Thomas Daubneyfe2bda32024-02-15 13:35:06 +00001116#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
1117 MBEDTLS_TEST_MEMORY_POISON(arg2_peer_key, arg3_peer_key_length);
1118 MBEDTLS_TEST_MEMORY_POISON(arg4_output, arg5_output_size);
1119#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001120 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);
Thomas Daubneyfe2bda32024-02-15 13:35:06 +00001121#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
1122 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_peer_key, arg3_peer_key_length);
1123 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_output, arg5_output_size);
1124#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001125 return status;
1126}
1127
1128/* Wrapper for psa_sign_hash */
1129psa_status_t mbedtls_test_wrap_psa_sign_hash(
1130 mbedtls_svc_key_id_t arg0_key,
1131 psa_algorithm_t arg1_alg,
1132 const uint8_t *arg2_hash,
1133 size_t arg3_hash_length,
1134 uint8_t *arg4_signature,
1135 size_t arg5_signature_size,
1136 size_t *arg6_signature_length)
1137{
Thomas Daubneyf430f472024-01-30 12:25:35 +00001138#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
1139 MBEDTLS_TEST_MEMORY_POISON(arg2_hash, arg3_hash_length);
1140 MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_size);
1141#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001142 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 +00001143#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
1144 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_hash, arg3_hash_length);
1145 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_size);
1146#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001147 return status;
1148}
1149
1150/* Wrapper for psa_sign_hash_abort */
1151psa_status_t mbedtls_test_wrap_psa_sign_hash_abort(
1152 psa_sign_hash_interruptible_operation_t *arg0_operation)
1153{
1154 psa_status_t status = (psa_sign_hash_abort)(arg0_operation);
1155 return status;
1156}
1157
1158/* Wrapper for psa_sign_hash_complete */
1159psa_status_t mbedtls_test_wrap_psa_sign_hash_complete(
1160 psa_sign_hash_interruptible_operation_t *arg0_operation,
1161 uint8_t *arg1_signature,
1162 size_t arg2_signature_size,
1163 size_t *arg3_signature_length)
1164{
1165 psa_status_t status = (psa_sign_hash_complete)(arg0_operation, arg1_signature, arg2_signature_size, arg3_signature_length);
1166 return status;
1167}
1168
1169/* Wrapper for psa_sign_hash_start */
1170psa_status_t mbedtls_test_wrap_psa_sign_hash_start(
1171 psa_sign_hash_interruptible_operation_t *arg0_operation,
1172 mbedtls_svc_key_id_t arg1_key,
1173 psa_algorithm_t arg2_alg,
1174 const uint8_t *arg3_hash,
1175 size_t arg4_hash_length)
1176{
1177 psa_status_t status = (psa_sign_hash_start)(arg0_operation, arg1_key, arg2_alg, arg3_hash, arg4_hash_length);
1178 return status;
1179}
1180
1181/* Wrapper for psa_sign_message */
1182psa_status_t mbedtls_test_wrap_psa_sign_message(
1183 mbedtls_svc_key_id_t arg0_key,
1184 psa_algorithm_t arg1_alg,
1185 const uint8_t *arg2_input,
1186 size_t arg3_input_length,
1187 uint8_t *arg4_signature,
1188 size_t arg5_signature_size,
1189 size_t *arg6_signature_length)
1190{
Thomas Daubneyf430f472024-01-30 12:25:35 +00001191#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
1192 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
1193 MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_size);
1194#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001195 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 +00001196#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
1197 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
1198 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_size);
1199#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001200 return status;
1201}
1202
1203/* Wrapper for psa_verify_hash */
1204psa_status_t mbedtls_test_wrap_psa_verify_hash(
1205 mbedtls_svc_key_id_t arg0_key,
1206 psa_algorithm_t arg1_alg,
1207 const uint8_t *arg2_hash,
1208 size_t arg3_hash_length,
1209 const uint8_t *arg4_signature,
1210 size_t arg5_signature_length)
1211{
Thomas Daubneyf430f472024-01-30 12:25:35 +00001212#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
1213 MBEDTLS_TEST_MEMORY_POISON(arg2_hash, arg3_hash_length);
1214 MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_length);
1215#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001216 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 +00001217#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
1218 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_hash, arg3_hash_length);
1219 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_length);
1220#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001221 return status;
1222}
1223
1224/* Wrapper for psa_verify_hash_abort */
1225psa_status_t mbedtls_test_wrap_psa_verify_hash_abort(
1226 psa_verify_hash_interruptible_operation_t *arg0_operation)
1227{
1228 psa_status_t status = (psa_verify_hash_abort)(arg0_operation);
1229 return status;
1230}
1231
1232/* Wrapper for psa_verify_hash_complete */
1233psa_status_t mbedtls_test_wrap_psa_verify_hash_complete(
1234 psa_verify_hash_interruptible_operation_t *arg0_operation)
1235{
1236 psa_status_t status = (psa_verify_hash_complete)(arg0_operation);
1237 return status;
1238}
1239
1240/* Wrapper for psa_verify_hash_start */
1241psa_status_t mbedtls_test_wrap_psa_verify_hash_start(
1242 psa_verify_hash_interruptible_operation_t *arg0_operation,
1243 mbedtls_svc_key_id_t arg1_key,
1244 psa_algorithm_t arg2_alg,
1245 const uint8_t *arg3_hash,
1246 size_t arg4_hash_length,
1247 const uint8_t *arg5_signature,
1248 size_t arg6_signature_length)
1249{
1250 psa_status_t status = (psa_verify_hash_start)(arg0_operation, arg1_key, arg2_alg, arg3_hash, arg4_hash_length, arg5_signature, arg6_signature_length);
1251 return status;
1252}
1253
1254/* Wrapper for psa_verify_message */
1255psa_status_t mbedtls_test_wrap_psa_verify_message(
1256 mbedtls_svc_key_id_t arg0_key,
1257 psa_algorithm_t arg1_alg,
1258 const uint8_t *arg2_input,
1259 size_t arg3_input_length,
1260 const uint8_t *arg4_signature,
1261 size_t arg5_signature_length)
1262{
Thomas Daubneyf430f472024-01-30 12:25:35 +00001263#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
1264 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
1265 MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_length);
1266#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001267 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 +00001268#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
1269 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
1270 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_length);
1271#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001272 return status;
1273}
1274
Gilles Peskine4411c9c2024-01-04 20:51:38 +01001275#endif /* defined(MBEDTLS_PSA_CRYPTO_C) && defined(MBEDTLS_TEST_HOOKS) && \
1276 !defined(RECORD_PSA_STATUS_COVERAGE_LOG) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001277
1278/* End of automatically generated file. */