blob: 4a5de23834f6ecc852b9ecb27e005c590e54a7c9 [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{
332 psa_status_t status = (psa_cipher_decrypt)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_output, arg5_output_size, arg6_output_length);
333 return status;
334}
335
336/* Wrapper for psa_cipher_decrypt_setup */
337psa_status_t mbedtls_test_wrap_psa_cipher_decrypt_setup(
338 psa_cipher_operation_t *arg0_operation,
339 mbedtls_svc_key_id_t arg1_key,
340 psa_algorithm_t arg2_alg)
341{
342 psa_status_t status = (psa_cipher_decrypt_setup)(arg0_operation, arg1_key, arg2_alg);
343 return status;
344}
345
346/* Wrapper for psa_cipher_encrypt */
347psa_status_t mbedtls_test_wrap_psa_cipher_encrypt(
348 mbedtls_svc_key_id_t arg0_key,
349 psa_algorithm_t arg1_alg,
350 const uint8_t *arg2_input,
351 size_t arg3_input_length,
352 uint8_t *arg4_output,
353 size_t arg5_output_size,
354 size_t *arg6_output_length)
355{
Ryan Everett84a666d2024-01-25 12:00:02 +0000356#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
357 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
358 MBEDTLS_TEST_MEMORY_POISON(arg4_output, arg5_output_size);
359#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100360 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 +0000361#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
362 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
363 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_output, arg5_output_size);
364#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100365 return status;
366}
367
368/* Wrapper for psa_cipher_encrypt_setup */
369psa_status_t mbedtls_test_wrap_psa_cipher_encrypt_setup(
370 psa_cipher_operation_t *arg0_operation,
371 mbedtls_svc_key_id_t arg1_key,
372 psa_algorithm_t arg2_alg)
373{
374 psa_status_t status = (psa_cipher_encrypt_setup)(arg0_operation, arg1_key, arg2_alg);
375 return status;
376}
377
378/* Wrapper for psa_cipher_finish */
379psa_status_t mbedtls_test_wrap_psa_cipher_finish(
380 psa_cipher_operation_t *arg0_operation,
381 uint8_t *arg1_output,
382 size_t arg2_output_size,
383 size_t *arg3_output_length)
384{
385 psa_status_t status = (psa_cipher_finish)(arg0_operation, arg1_output, arg2_output_size, arg3_output_length);
386 return status;
387}
388
389/* Wrapper for psa_cipher_generate_iv */
390psa_status_t mbedtls_test_wrap_psa_cipher_generate_iv(
391 psa_cipher_operation_t *arg0_operation,
392 uint8_t *arg1_iv,
393 size_t arg2_iv_size,
394 size_t *arg3_iv_length)
395{
396 psa_status_t status = (psa_cipher_generate_iv)(arg0_operation, arg1_iv, arg2_iv_size, arg3_iv_length);
397 return status;
398}
399
400/* Wrapper for psa_cipher_set_iv */
401psa_status_t mbedtls_test_wrap_psa_cipher_set_iv(
402 psa_cipher_operation_t *arg0_operation,
403 const uint8_t *arg1_iv,
404 size_t arg2_iv_length)
405{
406 psa_status_t status = (psa_cipher_set_iv)(arg0_operation, arg1_iv, arg2_iv_length);
407 return status;
408}
409
410/* Wrapper for psa_cipher_update */
411psa_status_t mbedtls_test_wrap_psa_cipher_update(
412 psa_cipher_operation_t *arg0_operation,
413 const uint8_t *arg1_input,
414 size_t arg2_input_length,
415 uint8_t *arg3_output,
416 size_t arg4_output_size,
417 size_t *arg5_output_length)
418{
419 psa_status_t status = (psa_cipher_update)(arg0_operation, arg1_input, arg2_input_length, arg3_output, arg4_output_size, arg5_output_length);
420 return status;
421}
422
423/* Wrapper for psa_copy_key */
424psa_status_t mbedtls_test_wrap_psa_copy_key(
425 mbedtls_svc_key_id_t arg0_source_key,
426 const psa_key_attributes_t *arg1_attributes,
427 mbedtls_svc_key_id_t *arg2_target_key)
428{
429 psa_status_t status = (psa_copy_key)(arg0_source_key, arg1_attributes, arg2_target_key);
430 return status;
431}
432
433/* Wrapper for psa_crypto_driver_pake_get_cipher_suite */
434psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_cipher_suite(
435 const psa_crypto_driver_pake_inputs_t *arg0_inputs,
436 psa_pake_cipher_suite_t *arg1_cipher_suite)
437{
438 psa_status_t status = (psa_crypto_driver_pake_get_cipher_suite)(arg0_inputs, arg1_cipher_suite);
439 return status;
440}
441
442/* Wrapper for psa_crypto_driver_pake_get_password */
443psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_password(
444 const psa_crypto_driver_pake_inputs_t *arg0_inputs,
445 uint8_t *arg1_buffer,
446 size_t arg2_buffer_size,
447 size_t *arg3_buffer_length)
448{
449 psa_status_t status = (psa_crypto_driver_pake_get_password)(arg0_inputs, arg1_buffer, arg2_buffer_size, arg3_buffer_length);
450 return status;
451}
452
453/* Wrapper for psa_crypto_driver_pake_get_password_len */
454psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_password_len(
455 const psa_crypto_driver_pake_inputs_t *arg0_inputs,
456 size_t *arg1_password_len)
457{
458 psa_status_t status = (psa_crypto_driver_pake_get_password_len)(arg0_inputs, arg1_password_len);
459 return status;
460}
461
462/* Wrapper for psa_crypto_driver_pake_get_peer */
463psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_peer(
464 const psa_crypto_driver_pake_inputs_t *arg0_inputs,
465 uint8_t *arg1_peer_id,
466 size_t arg2_peer_id_size,
467 size_t *arg3_peer_id_length)
468{
469 psa_status_t status = (psa_crypto_driver_pake_get_peer)(arg0_inputs, arg1_peer_id, arg2_peer_id_size, arg3_peer_id_length);
470 return status;
471}
472
473/* Wrapper for psa_crypto_driver_pake_get_peer_len */
474psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_peer_len(
475 const psa_crypto_driver_pake_inputs_t *arg0_inputs,
476 size_t *arg1_peer_len)
477{
478 psa_status_t status = (psa_crypto_driver_pake_get_peer_len)(arg0_inputs, arg1_peer_len);
479 return status;
480}
481
482/* Wrapper for psa_crypto_driver_pake_get_user */
483psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_user(
484 const psa_crypto_driver_pake_inputs_t *arg0_inputs,
485 uint8_t *arg1_user_id,
486 size_t arg2_user_id_size,
487 size_t *arg3_user_id_len)
488{
489 psa_status_t status = (psa_crypto_driver_pake_get_user)(arg0_inputs, arg1_user_id, arg2_user_id_size, arg3_user_id_len);
490 return status;
491}
492
493/* Wrapper for psa_crypto_driver_pake_get_user_len */
494psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_user_len(
495 const psa_crypto_driver_pake_inputs_t *arg0_inputs,
496 size_t *arg1_user_len)
497{
498 psa_status_t status = (psa_crypto_driver_pake_get_user_len)(arg0_inputs, arg1_user_len);
499 return status;
500}
501
502/* Wrapper for psa_crypto_init */
503psa_status_t mbedtls_test_wrap_psa_crypto_init(void)
504{
505 psa_status_t status = (psa_crypto_init)();
506 return status;
507}
508
509/* Wrapper for psa_destroy_key */
510psa_status_t mbedtls_test_wrap_psa_destroy_key(
511 mbedtls_svc_key_id_t arg0_key)
512{
513 psa_status_t status = (psa_destroy_key)(arg0_key);
514 return status;
515}
516
517/* Wrapper for psa_export_key */
518psa_status_t mbedtls_test_wrap_psa_export_key(
519 mbedtls_svc_key_id_t arg0_key,
520 uint8_t *arg1_data,
521 size_t arg2_data_size,
522 size_t *arg3_data_length)
523{
Ryan Everett77b91e32024-01-25 10:58:06 +0000524#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
525 MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_size);
526#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100527 psa_status_t status = (psa_export_key)(arg0_key, arg1_data, arg2_data_size, arg3_data_length);
Ryan Everett77b91e32024-01-25 10:58:06 +0000528#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
529 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_size);
530#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100531 return status;
532}
533
534/* Wrapper for psa_export_public_key */
535psa_status_t mbedtls_test_wrap_psa_export_public_key(
536 mbedtls_svc_key_id_t arg0_key,
537 uint8_t *arg1_data,
538 size_t arg2_data_size,
539 size_t *arg3_data_length)
540{
Ryan Everett77b91e32024-01-25 10:58:06 +0000541#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
542 MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_size);
543#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100544 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 +0000545#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
546 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_size);
547#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100548 return status;
549}
550
551/* Wrapper for psa_generate_key */
552psa_status_t mbedtls_test_wrap_psa_generate_key(
553 const psa_key_attributes_t *arg0_attributes,
554 mbedtls_svc_key_id_t *arg1_key)
555{
556 psa_status_t status = (psa_generate_key)(arg0_attributes, arg1_key);
557 return status;
558}
559
560/* Wrapper for psa_generate_random */
561psa_status_t mbedtls_test_wrap_psa_generate_random(
562 uint8_t *arg0_output,
563 size_t arg1_output_size)
564{
David Horstmann075c5fb2024-02-06 15:44:08 +0000565#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
566 MBEDTLS_TEST_MEMORY_POISON(arg0_output, arg1_output_size);
567#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100568 psa_status_t status = (psa_generate_random)(arg0_output, arg1_output_size);
David Horstmann075c5fb2024-02-06 15:44:08 +0000569#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
570 MBEDTLS_TEST_MEMORY_UNPOISON(arg0_output, arg1_output_size);
571#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100572 return status;
573}
574
575/* Wrapper for psa_get_key_attributes */
576psa_status_t mbedtls_test_wrap_psa_get_key_attributes(
577 mbedtls_svc_key_id_t arg0_key,
578 psa_key_attributes_t *arg1_attributes)
579{
580 psa_status_t status = (psa_get_key_attributes)(arg0_key, arg1_attributes);
581 return status;
582}
583
584/* Wrapper for psa_hash_abort */
585psa_status_t mbedtls_test_wrap_psa_hash_abort(
586 psa_hash_operation_t *arg0_operation)
587{
588 psa_status_t status = (psa_hash_abort)(arg0_operation);
589 return status;
590}
591
592/* Wrapper for psa_hash_clone */
593psa_status_t mbedtls_test_wrap_psa_hash_clone(
594 const psa_hash_operation_t *arg0_source_operation,
595 psa_hash_operation_t *arg1_target_operation)
596{
597 psa_status_t status = (psa_hash_clone)(arg0_source_operation, arg1_target_operation);
598 return status;
599}
600
601/* Wrapper for psa_hash_compare */
602psa_status_t mbedtls_test_wrap_psa_hash_compare(
603 psa_algorithm_t arg0_alg,
604 const uint8_t *arg1_input,
605 size_t arg2_input_length,
606 const uint8_t *arg3_hash,
607 size_t arg4_hash_length)
608{
Thomas Daubney45c85862024-01-25 16:48:09 +0000609#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
610 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
611 MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_length);
612#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100613 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 +0000614#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
615 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
616 MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_length);
617#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100618 return status;
619}
620
621/* Wrapper for psa_hash_compute */
622psa_status_t mbedtls_test_wrap_psa_hash_compute(
623 psa_algorithm_t arg0_alg,
624 const uint8_t *arg1_input,
625 size_t arg2_input_length,
626 uint8_t *arg3_hash,
627 size_t arg4_hash_size,
628 size_t *arg5_hash_length)
629{
Thomas Daubney45c85862024-01-25 16:48:09 +0000630#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
631 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
632 MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_size);
633#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100634 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 +0000635#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
636 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
637 MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_size);
638#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100639 return status;
640}
641
642/* Wrapper for psa_hash_finish */
643psa_status_t mbedtls_test_wrap_psa_hash_finish(
644 psa_hash_operation_t *arg0_operation,
645 uint8_t *arg1_hash,
646 size_t arg2_hash_size,
647 size_t *arg3_hash_length)
648{
Thomas Daubney45c85862024-01-25 16:48:09 +0000649#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
650 MBEDTLS_TEST_MEMORY_POISON(arg1_hash, arg2_hash_size);
651#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100652 psa_status_t status = (psa_hash_finish)(arg0_operation, arg1_hash, arg2_hash_size, arg3_hash_length);
Thomas Daubney45c85862024-01-25 16:48:09 +0000653#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
654 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_hash, arg2_hash_size);
655#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100656 return status;
657}
658
659/* Wrapper for psa_hash_setup */
660psa_status_t mbedtls_test_wrap_psa_hash_setup(
661 psa_hash_operation_t *arg0_operation,
662 psa_algorithm_t arg1_alg)
663{
664 psa_status_t status = (psa_hash_setup)(arg0_operation, arg1_alg);
665 return status;
666}
667
668/* Wrapper for psa_hash_update */
669psa_status_t mbedtls_test_wrap_psa_hash_update(
670 psa_hash_operation_t *arg0_operation,
671 const uint8_t *arg1_input,
672 size_t arg2_input_length)
673{
Thomas Daubney45c85862024-01-25 16:48:09 +0000674#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
675 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
676#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100677 psa_status_t status = (psa_hash_update)(arg0_operation, arg1_input, arg2_input_length);
Thomas Daubney45c85862024-01-25 16:48:09 +0000678#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
679 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
680#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100681 return status;
682}
683
684/* Wrapper for psa_hash_verify */
685psa_status_t mbedtls_test_wrap_psa_hash_verify(
686 psa_hash_operation_t *arg0_operation,
687 const uint8_t *arg1_hash,
688 size_t arg2_hash_length)
689{
Thomas Daubney45c85862024-01-25 16:48:09 +0000690#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
691 MBEDTLS_TEST_MEMORY_POISON(arg1_hash, arg2_hash_length);
692#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100693 psa_status_t status = (psa_hash_verify)(arg0_operation, arg1_hash, arg2_hash_length);
Thomas Daubney45c85862024-01-25 16:48:09 +0000694#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
695 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_hash, arg2_hash_length);
696#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100697 return status;
698}
699
700/* Wrapper for psa_import_key */
701psa_status_t mbedtls_test_wrap_psa_import_key(
702 const psa_key_attributes_t *arg0_attributes,
703 const uint8_t *arg1_data,
704 size_t arg2_data_length,
705 mbedtls_svc_key_id_t *arg3_key)
706{
Ryan Everett77b91e32024-01-25 10:58:06 +0000707#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
708 MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_length);
709#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100710 psa_status_t status = (psa_import_key)(arg0_attributes, arg1_data, arg2_data_length, arg3_key);
Ryan Everett77b91e32024-01-25 10:58:06 +0000711#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
712 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_length);
713#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100714 return status;
715}
716
717/* Wrapper for psa_key_derivation_abort */
718psa_status_t mbedtls_test_wrap_psa_key_derivation_abort(
719 psa_key_derivation_operation_t *arg0_operation)
720{
721 psa_status_t status = (psa_key_derivation_abort)(arg0_operation);
722 return status;
723}
724
725/* Wrapper for psa_key_derivation_get_capacity */
726psa_status_t mbedtls_test_wrap_psa_key_derivation_get_capacity(
727 const psa_key_derivation_operation_t *arg0_operation,
728 size_t *arg1_capacity)
729{
730 psa_status_t status = (psa_key_derivation_get_capacity)(arg0_operation, arg1_capacity);
731 return status;
732}
733
734/* Wrapper for psa_key_derivation_input_bytes */
735psa_status_t mbedtls_test_wrap_psa_key_derivation_input_bytes(
736 psa_key_derivation_operation_t *arg0_operation,
737 psa_key_derivation_step_t arg1_step,
738 const uint8_t *arg2_data,
739 size_t arg3_data_length)
740{
Ryan Everett198a4d92024-01-25 11:44:56 +0000741#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
742 MBEDTLS_TEST_MEMORY_POISON(arg2_data, arg3_data_length);
743#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100744 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 +0000745#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
746 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_data, arg3_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_input_integer */
752psa_status_t mbedtls_test_wrap_psa_key_derivation_input_integer(
753 psa_key_derivation_operation_t *arg0_operation,
754 psa_key_derivation_step_t arg1_step,
755 uint64_t arg2_value)
756{
757 psa_status_t status = (psa_key_derivation_input_integer)(arg0_operation, arg1_step, arg2_value);
758 return status;
759}
760
761/* Wrapper for psa_key_derivation_input_key */
762psa_status_t mbedtls_test_wrap_psa_key_derivation_input_key(
763 psa_key_derivation_operation_t *arg0_operation,
764 psa_key_derivation_step_t arg1_step,
765 mbedtls_svc_key_id_t arg2_key)
766{
767 psa_status_t status = (psa_key_derivation_input_key)(arg0_operation, arg1_step, arg2_key);
768 return status;
769}
770
771/* Wrapper for psa_key_derivation_key_agreement */
772psa_status_t mbedtls_test_wrap_psa_key_derivation_key_agreement(
773 psa_key_derivation_operation_t *arg0_operation,
774 psa_key_derivation_step_t arg1_step,
775 mbedtls_svc_key_id_t arg2_private_key,
776 const uint8_t *arg3_peer_key,
777 size_t arg4_peer_key_length)
778{
779 psa_status_t status = (psa_key_derivation_key_agreement)(arg0_operation, arg1_step, arg2_private_key, arg3_peer_key, arg4_peer_key_length);
780 return status;
781}
782
783/* Wrapper for psa_key_derivation_output_bytes */
784psa_status_t mbedtls_test_wrap_psa_key_derivation_output_bytes(
785 psa_key_derivation_operation_t *arg0_operation,
786 uint8_t *arg1_output,
787 size_t arg2_output_length)
788{
Ryan Everett198a4d92024-01-25 11:44:56 +0000789#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
790 MBEDTLS_TEST_MEMORY_POISON(arg1_output, arg2_output_length);
791#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100792 psa_status_t status = (psa_key_derivation_output_bytes)(arg0_operation, arg1_output, arg2_output_length);
Ryan Everett198a4d92024-01-25 11:44:56 +0000793#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
794 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_output, arg2_output_length);
795#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100796 return status;
797}
798
799/* Wrapper for psa_key_derivation_output_key */
800psa_status_t mbedtls_test_wrap_psa_key_derivation_output_key(
801 const psa_key_attributes_t *arg0_attributes,
802 psa_key_derivation_operation_t *arg1_operation,
803 mbedtls_svc_key_id_t *arg2_key)
804{
805 psa_status_t status = (psa_key_derivation_output_key)(arg0_attributes, arg1_operation, arg2_key);
806 return status;
807}
808
809/* Wrapper for psa_key_derivation_set_capacity */
810psa_status_t mbedtls_test_wrap_psa_key_derivation_set_capacity(
811 psa_key_derivation_operation_t *arg0_operation,
812 size_t arg1_capacity)
813{
814 psa_status_t status = (psa_key_derivation_set_capacity)(arg0_operation, arg1_capacity);
815 return status;
816}
817
818/* Wrapper for psa_key_derivation_setup */
819psa_status_t mbedtls_test_wrap_psa_key_derivation_setup(
820 psa_key_derivation_operation_t *arg0_operation,
821 psa_algorithm_t arg1_alg)
822{
823 psa_status_t status = (psa_key_derivation_setup)(arg0_operation, arg1_alg);
824 return status;
825}
826
827/* Wrapper for psa_mac_abort */
828psa_status_t mbedtls_test_wrap_psa_mac_abort(
829 psa_mac_operation_t *arg0_operation)
830{
831 psa_status_t status = (psa_mac_abort)(arg0_operation);
832 return status;
833}
834
835/* Wrapper for psa_mac_compute */
836psa_status_t mbedtls_test_wrap_psa_mac_compute(
837 mbedtls_svc_key_id_t arg0_key,
838 psa_algorithm_t arg1_alg,
839 const uint8_t *arg2_input,
840 size_t arg3_input_length,
841 uint8_t *arg4_mac,
842 size_t arg5_mac_size,
843 size_t *arg6_mac_length)
844{
Thomas Daubneya1cf1012024-01-30 11:18:54 +0000845#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
846 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
847 MBEDTLS_TEST_MEMORY_POISON(arg4_mac, arg5_mac_size);
848#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100849 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 +0000850#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
851 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
852 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_mac, arg5_mac_size);
853#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100854 return status;
855}
856
857/* Wrapper for psa_mac_sign_finish */
858psa_status_t mbedtls_test_wrap_psa_mac_sign_finish(
859 psa_mac_operation_t *arg0_operation,
860 uint8_t *arg1_mac,
861 size_t arg2_mac_size,
862 size_t *arg3_mac_length)
863{
Thomas Daubneya1cf1012024-01-30 11:18:54 +0000864#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
865 MBEDTLS_TEST_MEMORY_POISON(arg1_mac, arg2_mac_size);
866#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100867 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 +0000868#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
869 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_mac, arg2_mac_size);
870#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100871 return status;
872}
873
874/* Wrapper for psa_mac_sign_setup */
875psa_status_t mbedtls_test_wrap_psa_mac_sign_setup(
876 psa_mac_operation_t *arg0_operation,
877 mbedtls_svc_key_id_t arg1_key,
878 psa_algorithm_t arg2_alg)
879{
880 psa_status_t status = (psa_mac_sign_setup)(arg0_operation, arg1_key, arg2_alg);
881 return status;
882}
883
884/* Wrapper for psa_mac_update */
885psa_status_t mbedtls_test_wrap_psa_mac_update(
886 psa_mac_operation_t *arg0_operation,
887 const uint8_t *arg1_input,
888 size_t arg2_input_length)
889{
Thomas Daubneya1cf1012024-01-30 11:18:54 +0000890#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
891 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
892#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100893 psa_status_t status = (psa_mac_update)(arg0_operation, arg1_input, arg2_input_length);
Thomas Daubneya1cf1012024-01-30 11:18:54 +0000894#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
895 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
896#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100897 return status;
898}
899
900/* Wrapper for psa_mac_verify */
901psa_status_t mbedtls_test_wrap_psa_mac_verify(
902 mbedtls_svc_key_id_t arg0_key,
903 psa_algorithm_t arg1_alg,
904 const uint8_t *arg2_input,
905 size_t arg3_input_length,
906 const uint8_t *arg4_mac,
907 size_t arg5_mac_length)
908{
Thomas Daubneya1cf1012024-01-30 11:18:54 +0000909#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
910 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
911 MBEDTLS_TEST_MEMORY_POISON(arg4_mac, arg5_mac_length);
912#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100913 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 +0000914#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
915 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
916 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_mac, arg5_mac_length);
917#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100918 return status;
919}
920
921/* Wrapper for psa_mac_verify_finish */
922psa_status_t mbedtls_test_wrap_psa_mac_verify_finish(
923 psa_mac_operation_t *arg0_operation,
924 const uint8_t *arg1_mac,
925 size_t arg2_mac_length)
926{
Thomas Daubneya1cf1012024-01-30 11:18:54 +0000927#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
928 MBEDTLS_TEST_MEMORY_POISON(arg1_mac, arg2_mac_length);
929#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100930 psa_status_t status = (psa_mac_verify_finish)(arg0_operation, arg1_mac, arg2_mac_length);
Thomas Daubneya1cf1012024-01-30 11:18:54 +0000931#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
932 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_mac, arg2_mac_length);
933#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100934 return status;
935}
936
937/* Wrapper for psa_mac_verify_setup */
938psa_status_t mbedtls_test_wrap_psa_mac_verify_setup(
939 psa_mac_operation_t *arg0_operation,
940 mbedtls_svc_key_id_t arg1_key,
941 psa_algorithm_t arg2_alg)
942{
943 psa_status_t status = (psa_mac_verify_setup)(arg0_operation, arg1_key, arg2_alg);
944 return status;
945}
946
947/* Wrapper for psa_pake_abort */
948psa_status_t mbedtls_test_wrap_psa_pake_abort(
949 psa_pake_operation_t *arg0_operation)
950{
951 psa_status_t status = (psa_pake_abort)(arg0_operation);
952 return status;
953}
954
955/* Wrapper for psa_pake_get_implicit_key */
956psa_status_t mbedtls_test_wrap_psa_pake_get_implicit_key(
957 psa_pake_operation_t *arg0_operation,
958 psa_key_derivation_operation_t *arg1_output)
959{
960 psa_status_t status = (psa_pake_get_implicit_key)(arg0_operation, arg1_output);
961 return status;
962}
963
964/* Wrapper for psa_pake_input */
965psa_status_t mbedtls_test_wrap_psa_pake_input(
966 psa_pake_operation_t *arg0_operation,
967 psa_pake_step_t arg1_step,
968 const uint8_t *arg2_input,
969 size_t arg3_input_length)
970{
971 psa_status_t status = (psa_pake_input)(arg0_operation, arg1_step, arg2_input, arg3_input_length);
972 return status;
973}
974
975/* Wrapper for psa_pake_output */
976psa_status_t mbedtls_test_wrap_psa_pake_output(
977 psa_pake_operation_t *arg0_operation,
978 psa_pake_step_t arg1_step,
979 uint8_t *arg2_output,
980 size_t arg3_output_size,
981 size_t *arg4_output_length)
982{
983 psa_status_t status = (psa_pake_output)(arg0_operation, arg1_step, arg2_output, arg3_output_size, arg4_output_length);
984 return status;
985}
986
987/* Wrapper for psa_pake_set_password_key */
988psa_status_t mbedtls_test_wrap_psa_pake_set_password_key(
989 psa_pake_operation_t *arg0_operation,
990 mbedtls_svc_key_id_t arg1_password)
991{
992 psa_status_t status = (psa_pake_set_password_key)(arg0_operation, arg1_password);
993 return status;
994}
995
996/* Wrapper for psa_pake_set_peer */
997psa_status_t mbedtls_test_wrap_psa_pake_set_peer(
998 psa_pake_operation_t *arg0_operation,
999 const uint8_t *arg1_peer_id,
1000 size_t arg2_peer_id_len)
1001{
1002 psa_status_t status = (psa_pake_set_peer)(arg0_operation, arg1_peer_id, arg2_peer_id_len);
1003 return status;
1004}
1005
1006/* Wrapper for psa_pake_set_role */
1007psa_status_t mbedtls_test_wrap_psa_pake_set_role(
1008 psa_pake_operation_t *arg0_operation,
1009 psa_pake_role_t arg1_role)
1010{
1011 psa_status_t status = (psa_pake_set_role)(arg0_operation, arg1_role);
1012 return status;
1013}
1014
1015/* Wrapper for psa_pake_set_user */
1016psa_status_t mbedtls_test_wrap_psa_pake_set_user(
1017 psa_pake_operation_t *arg0_operation,
1018 const uint8_t *arg1_user_id,
1019 size_t arg2_user_id_len)
1020{
1021 psa_status_t status = (psa_pake_set_user)(arg0_operation, arg1_user_id, arg2_user_id_len);
1022 return status;
1023}
1024
1025/* Wrapper for psa_pake_setup */
1026psa_status_t mbedtls_test_wrap_psa_pake_setup(
1027 psa_pake_operation_t *arg0_operation,
1028 const psa_pake_cipher_suite_t *arg1_cipher_suite)
1029{
1030 psa_status_t status = (psa_pake_setup)(arg0_operation, arg1_cipher_suite);
1031 return status;
1032}
1033
1034/* Wrapper for psa_purge_key */
1035psa_status_t mbedtls_test_wrap_psa_purge_key(
1036 mbedtls_svc_key_id_t arg0_key)
1037{
1038 psa_status_t status = (psa_purge_key)(arg0_key);
1039 return status;
1040}
1041
1042/* Wrapper for psa_raw_key_agreement */
1043psa_status_t mbedtls_test_wrap_psa_raw_key_agreement(
1044 psa_algorithm_t arg0_alg,
1045 mbedtls_svc_key_id_t arg1_private_key,
1046 const uint8_t *arg2_peer_key,
1047 size_t arg3_peer_key_length,
1048 uint8_t *arg4_output,
1049 size_t arg5_output_size,
1050 size_t *arg6_output_length)
1051{
1052 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);
1053 return status;
1054}
1055
1056/* Wrapper for psa_sign_hash */
1057psa_status_t mbedtls_test_wrap_psa_sign_hash(
1058 mbedtls_svc_key_id_t arg0_key,
1059 psa_algorithm_t arg1_alg,
1060 const uint8_t *arg2_hash,
1061 size_t arg3_hash_length,
1062 uint8_t *arg4_signature,
1063 size_t arg5_signature_size,
1064 size_t *arg6_signature_length)
1065{
Thomas Daubneyf430f472024-01-30 12:25:35 +00001066#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
1067 MBEDTLS_TEST_MEMORY_POISON(arg2_hash, arg3_hash_length);
1068 MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_size);
1069#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001070 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 +00001071#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
1072 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_hash, arg3_hash_length);
1073 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_size);
1074#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001075 return status;
1076}
1077
1078/* Wrapper for psa_sign_hash_abort */
1079psa_status_t mbedtls_test_wrap_psa_sign_hash_abort(
1080 psa_sign_hash_interruptible_operation_t *arg0_operation)
1081{
1082 psa_status_t status = (psa_sign_hash_abort)(arg0_operation);
1083 return status;
1084}
1085
1086/* Wrapper for psa_sign_hash_complete */
1087psa_status_t mbedtls_test_wrap_psa_sign_hash_complete(
1088 psa_sign_hash_interruptible_operation_t *arg0_operation,
1089 uint8_t *arg1_signature,
1090 size_t arg2_signature_size,
1091 size_t *arg3_signature_length)
1092{
1093 psa_status_t status = (psa_sign_hash_complete)(arg0_operation, arg1_signature, arg2_signature_size, arg3_signature_length);
1094 return status;
1095}
1096
1097/* Wrapper for psa_sign_hash_start */
1098psa_status_t mbedtls_test_wrap_psa_sign_hash_start(
1099 psa_sign_hash_interruptible_operation_t *arg0_operation,
1100 mbedtls_svc_key_id_t arg1_key,
1101 psa_algorithm_t arg2_alg,
1102 const uint8_t *arg3_hash,
1103 size_t arg4_hash_length)
1104{
1105 psa_status_t status = (psa_sign_hash_start)(arg0_operation, arg1_key, arg2_alg, arg3_hash, arg4_hash_length);
1106 return status;
1107}
1108
1109/* Wrapper for psa_sign_message */
1110psa_status_t mbedtls_test_wrap_psa_sign_message(
1111 mbedtls_svc_key_id_t arg0_key,
1112 psa_algorithm_t arg1_alg,
1113 const uint8_t *arg2_input,
1114 size_t arg3_input_length,
1115 uint8_t *arg4_signature,
1116 size_t arg5_signature_size,
1117 size_t *arg6_signature_length)
1118{
Thomas Daubneyf430f472024-01-30 12:25:35 +00001119#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
1120 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
1121 MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_size);
1122#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001123 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 +00001124#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
1125 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
1126 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_size);
1127#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001128 return status;
1129}
1130
1131/* Wrapper for psa_verify_hash */
1132psa_status_t mbedtls_test_wrap_psa_verify_hash(
1133 mbedtls_svc_key_id_t arg0_key,
1134 psa_algorithm_t arg1_alg,
1135 const uint8_t *arg2_hash,
1136 size_t arg3_hash_length,
1137 const uint8_t *arg4_signature,
1138 size_t arg5_signature_length)
1139{
Thomas Daubneyf430f472024-01-30 12:25:35 +00001140#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
1141 MBEDTLS_TEST_MEMORY_POISON(arg2_hash, arg3_hash_length);
1142 MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_length);
1143#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001144 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 +00001145#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
1146 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_hash, arg3_hash_length);
1147 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_length);
1148#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001149 return status;
1150}
1151
1152/* Wrapper for psa_verify_hash_abort */
1153psa_status_t mbedtls_test_wrap_psa_verify_hash_abort(
1154 psa_verify_hash_interruptible_operation_t *arg0_operation)
1155{
1156 psa_status_t status = (psa_verify_hash_abort)(arg0_operation);
1157 return status;
1158}
1159
1160/* Wrapper for psa_verify_hash_complete */
1161psa_status_t mbedtls_test_wrap_psa_verify_hash_complete(
1162 psa_verify_hash_interruptible_operation_t *arg0_operation)
1163{
1164 psa_status_t status = (psa_verify_hash_complete)(arg0_operation);
1165 return status;
1166}
1167
1168/* Wrapper for psa_verify_hash_start */
1169psa_status_t mbedtls_test_wrap_psa_verify_hash_start(
1170 psa_verify_hash_interruptible_operation_t *arg0_operation,
1171 mbedtls_svc_key_id_t arg1_key,
1172 psa_algorithm_t arg2_alg,
1173 const uint8_t *arg3_hash,
1174 size_t arg4_hash_length,
1175 const uint8_t *arg5_signature,
1176 size_t arg6_signature_length)
1177{
1178 psa_status_t status = (psa_verify_hash_start)(arg0_operation, arg1_key, arg2_alg, arg3_hash, arg4_hash_length, arg5_signature, arg6_signature_length);
1179 return status;
1180}
1181
1182/* Wrapper for psa_verify_message */
1183psa_status_t mbedtls_test_wrap_psa_verify_message(
1184 mbedtls_svc_key_id_t arg0_key,
1185 psa_algorithm_t arg1_alg,
1186 const uint8_t *arg2_input,
1187 size_t arg3_input_length,
1188 const uint8_t *arg4_signature,
1189 size_t arg5_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_length);
1194#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001195 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 +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_length);
1199#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001200 return status;
1201}
1202
Gilles Peskine4411c9c2024-01-04 20:51:38 +01001203#endif /* defined(MBEDTLS_PSA_CRYPTO_C) && defined(MBEDTLS_TEST_HOOKS) && \
1204 !defined(RECORD_PSA_STATUS_COVERAGE_LOG) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001205
1206/* End of automatically generated file. */