blob: 4824e3806e6d63319226d2a1a1a014d458a41a3c [file] [log] [blame]
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001/* Automatically generated by generate_psa_wrappers.py, do not edit! */
2
3/* Copyright The Mbed TLS Contributors
4 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
5 */
6
7#include <mbedtls/build_info.h>
8
Gilles Peskine4411c9c2024-01-04 20:51:38 +01009#if defined(MBEDTLS_PSA_CRYPTO_C) && defined(MBEDTLS_TEST_HOOKS) && \
10 !defined(RECORD_PSA_STATUS_COVERAGE_LOG)
Gilles Peskine6e4332c2024-01-04 16:42:40 +010011
12#include <psa/crypto.h>
13
Gilles Peskine90d14d72024-01-04 16:59:28 +010014#include <test/memory.h>
Gilles Peskine6e4332c2024-01-04 16:42:40 +010015#include <test/psa_crypto_helpers.h>
16#include <test/psa_test_wrappers.h>
17
18/* Wrapper for mbedtls_psa_inject_entropy */
19#if defined(MBEDTLS_PSA_INJECT_ENTROPY)
20psa_status_t mbedtls_test_wrap_mbedtls_psa_inject_entropy(
21 const uint8_t *arg0_seed,
22 size_t arg1_seed_size)
23{
24 psa_status_t status = (mbedtls_psa_inject_entropy)(arg0_seed, arg1_seed_size);
25 return status;
26}
27#endif /* defined(MBEDTLS_PSA_INJECT_ENTROPY) */
28
29/* Wrapper for mbedtls_psa_platform_get_builtin_key */
30#if defined(MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS)
31psa_status_t mbedtls_test_wrap_mbedtls_psa_platform_get_builtin_key(
32 mbedtls_svc_key_id_t arg0_key_id,
33 psa_key_lifetime_t *arg1_lifetime,
34 psa_drv_slot_number_t *arg2_slot_number)
35{
36 psa_status_t status = (mbedtls_psa_platform_get_builtin_key)(arg0_key_id, arg1_lifetime, arg2_slot_number);
37 return status;
38}
39#endif /* defined(MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS) */
40
41/* Wrapper for mbedtls_psa_register_se_key */
42#if defined(MBEDTLS_PSA_CRYPTO_SE_C)
43psa_status_t mbedtls_test_wrap_mbedtls_psa_register_se_key(
44 const psa_key_attributes_t *arg0_attributes)
45{
46 psa_status_t status = (mbedtls_psa_register_se_key)(arg0_attributes);
47 return status;
48}
49#endif /* defined(MBEDTLS_PSA_CRYPTO_SE_C) */
50
51/* Wrapper for psa_aead_abort */
52psa_status_t mbedtls_test_wrap_psa_aead_abort(
53 psa_aead_operation_t *arg0_operation)
54{
55 psa_status_t status = (psa_aead_abort)(arg0_operation);
56 return status;
57}
58
59/* Wrapper for psa_aead_decrypt */
60psa_status_t mbedtls_test_wrap_psa_aead_decrypt(
61 mbedtls_svc_key_id_t arg0_key,
62 psa_algorithm_t arg1_alg,
63 const uint8_t *arg2_nonce,
64 size_t arg3_nonce_length,
65 const uint8_t *arg4_additional_data,
66 size_t arg5_additional_data_length,
67 const uint8_t *arg6_ciphertext,
68 size_t arg7_ciphertext_length,
69 uint8_t *arg8_plaintext,
70 size_t arg9_plaintext_size,
71 size_t *arg10_plaintext_length)
72{
David Horstmann86e6fe02024-01-22 14:36:01 +000073#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
74 MBEDTLS_TEST_MEMORY_POISON(arg2_nonce, arg3_nonce_length);
75 MBEDTLS_TEST_MEMORY_POISON(arg4_additional_data, arg5_additional_data_length);
76 MBEDTLS_TEST_MEMORY_POISON(arg6_ciphertext, arg7_ciphertext_length);
77 MBEDTLS_TEST_MEMORY_POISON(arg8_plaintext, arg9_plaintext_size);
78#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +010079 psa_status_t status = (psa_aead_decrypt)(arg0_key, arg1_alg, arg2_nonce, arg3_nonce_length, arg4_additional_data, arg5_additional_data_length, arg6_ciphertext, arg7_ciphertext_length, arg8_plaintext, arg9_plaintext_size, arg10_plaintext_length);
David Horstmann86e6fe02024-01-22 14:36:01 +000080#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
81 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_nonce, arg3_nonce_length);
82 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_additional_data, arg5_additional_data_length);
83 MBEDTLS_TEST_MEMORY_UNPOISON(arg6_ciphertext, arg7_ciphertext_length);
84 MBEDTLS_TEST_MEMORY_UNPOISON(arg8_plaintext, arg9_plaintext_size);
85#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +010086 return status;
87}
88
89/* Wrapper for psa_aead_decrypt_setup */
90psa_status_t mbedtls_test_wrap_psa_aead_decrypt_setup(
91 psa_aead_operation_t *arg0_operation,
92 mbedtls_svc_key_id_t arg1_key,
93 psa_algorithm_t arg2_alg)
94{
95 psa_status_t status = (psa_aead_decrypt_setup)(arg0_operation, arg1_key, arg2_alg);
96 return status;
97}
98
99/* Wrapper for psa_aead_encrypt */
100psa_status_t mbedtls_test_wrap_psa_aead_encrypt(
101 mbedtls_svc_key_id_t arg0_key,
102 psa_algorithm_t arg1_alg,
103 const uint8_t *arg2_nonce,
104 size_t arg3_nonce_length,
105 const uint8_t *arg4_additional_data,
106 size_t arg5_additional_data_length,
107 const uint8_t *arg6_plaintext,
108 size_t arg7_plaintext_length,
109 uint8_t *arg8_ciphertext,
110 size_t arg9_ciphertext_size,
111 size_t *arg10_ciphertext_length)
112{
David Horstmann86e6fe02024-01-22 14:36:01 +0000113#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
114 MBEDTLS_TEST_MEMORY_POISON(arg2_nonce, arg3_nonce_length);
115 MBEDTLS_TEST_MEMORY_POISON(arg4_additional_data, arg5_additional_data_length);
116 MBEDTLS_TEST_MEMORY_POISON(arg6_plaintext, arg7_plaintext_length);
117 MBEDTLS_TEST_MEMORY_POISON(arg8_ciphertext, arg9_ciphertext_size);
118#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100119 psa_status_t status = (psa_aead_encrypt)(arg0_key, arg1_alg, arg2_nonce, arg3_nonce_length, arg4_additional_data, arg5_additional_data_length, arg6_plaintext, arg7_plaintext_length, arg8_ciphertext, arg9_ciphertext_size, arg10_ciphertext_length);
David Horstmann86e6fe02024-01-22 14:36:01 +0000120#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
121 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_nonce, arg3_nonce_length);
122 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_additional_data, arg5_additional_data_length);
123 MBEDTLS_TEST_MEMORY_UNPOISON(arg6_plaintext, arg7_plaintext_length);
124 MBEDTLS_TEST_MEMORY_UNPOISON(arg8_ciphertext, arg9_ciphertext_size);
125#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100126 return status;
127}
128
129/* Wrapper for psa_aead_encrypt_setup */
130psa_status_t mbedtls_test_wrap_psa_aead_encrypt_setup(
131 psa_aead_operation_t *arg0_operation,
132 mbedtls_svc_key_id_t arg1_key,
133 psa_algorithm_t arg2_alg)
134{
135 psa_status_t status = (psa_aead_encrypt_setup)(arg0_operation, arg1_key, arg2_alg);
136 return status;
137}
138
139/* Wrapper for psa_aead_finish */
140psa_status_t mbedtls_test_wrap_psa_aead_finish(
141 psa_aead_operation_t *arg0_operation,
142 uint8_t *arg1_ciphertext,
143 size_t arg2_ciphertext_size,
144 size_t *arg3_ciphertext_length,
145 uint8_t *arg4_tag,
146 size_t arg5_tag_size,
147 size_t *arg6_tag_length)
148{
David Horstmann86e6fe02024-01-22 14:36:01 +0000149#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
150 MBEDTLS_TEST_MEMORY_POISON(arg1_ciphertext, arg2_ciphertext_size);
151 MBEDTLS_TEST_MEMORY_POISON(arg4_tag, arg5_tag_size);
152#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100153 psa_status_t status = (psa_aead_finish)(arg0_operation, arg1_ciphertext, arg2_ciphertext_size, arg3_ciphertext_length, arg4_tag, arg5_tag_size, arg6_tag_length);
David Horstmann86e6fe02024-01-22 14:36:01 +0000154#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
155 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_ciphertext, arg2_ciphertext_size);
156 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_tag, arg5_tag_size);
157#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100158 return status;
159}
160
161/* Wrapper for psa_aead_generate_nonce */
162psa_status_t mbedtls_test_wrap_psa_aead_generate_nonce(
163 psa_aead_operation_t *arg0_operation,
164 uint8_t *arg1_nonce,
165 size_t arg2_nonce_size,
166 size_t *arg3_nonce_length)
167{
David Horstmann86e6fe02024-01-22 14:36:01 +0000168#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
169 MBEDTLS_TEST_MEMORY_POISON(arg1_nonce, arg2_nonce_size);
170#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100171 psa_status_t status = (psa_aead_generate_nonce)(arg0_operation, arg1_nonce, arg2_nonce_size, arg3_nonce_length);
David Horstmann86e6fe02024-01-22 14:36:01 +0000172#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
173 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_nonce, arg2_nonce_size);
174#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100175 return status;
176}
177
178/* Wrapper for psa_aead_set_lengths */
179psa_status_t mbedtls_test_wrap_psa_aead_set_lengths(
180 psa_aead_operation_t *arg0_operation,
181 size_t arg1_ad_length,
182 size_t arg2_plaintext_length)
183{
184 psa_status_t status = (psa_aead_set_lengths)(arg0_operation, arg1_ad_length, arg2_plaintext_length);
185 return status;
186}
187
188/* Wrapper for psa_aead_set_nonce */
189psa_status_t mbedtls_test_wrap_psa_aead_set_nonce(
190 psa_aead_operation_t *arg0_operation,
191 const uint8_t *arg1_nonce,
192 size_t arg2_nonce_length)
193{
David Horstmann86e6fe02024-01-22 14:36:01 +0000194#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
195 MBEDTLS_TEST_MEMORY_POISON(arg1_nonce, arg2_nonce_length);
196#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100197 psa_status_t status = (psa_aead_set_nonce)(arg0_operation, arg1_nonce, arg2_nonce_length);
David Horstmann86e6fe02024-01-22 14:36:01 +0000198#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
199 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_nonce, arg2_nonce_length);
200#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100201 return status;
202}
203
204/* Wrapper for psa_aead_update */
205psa_status_t mbedtls_test_wrap_psa_aead_update(
206 psa_aead_operation_t *arg0_operation,
207 const uint8_t *arg1_input,
208 size_t arg2_input_length,
209 uint8_t *arg3_output,
210 size_t arg4_output_size,
211 size_t *arg5_output_length)
212{
David Horstmann86e6fe02024-01-22 14:36:01 +0000213#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
214 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
215 MBEDTLS_TEST_MEMORY_POISON(arg3_output, arg4_output_size);
216#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100217 psa_status_t status = (psa_aead_update)(arg0_operation, arg1_input, arg2_input_length, arg3_output, arg4_output_size, arg5_output_length);
David Horstmann86e6fe02024-01-22 14:36:01 +0000218#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
219 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
220 MBEDTLS_TEST_MEMORY_UNPOISON(arg3_output, arg4_output_size);
221#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100222 return status;
223}
224
225/* Wrapper for psa_aead_update_ad */
226psa_status_t mbedtls_test_wrap_psa_aead_update_ad(
227 psa_aead_operation_t *arg0_operation,
228 const uint8_t *arg1_input,
229 size_t arg2_input_length)
230{
David Horstmann86e6fe02024-01-22 14:36:01 +0000231#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
232 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
233#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100234 psa_status_t status = (psa_aead_update_ad)(arg0_operation, arg1_input, arg2_input_length);
David Horstmann86e6fe02024-01-22 14:36:01 +0000235#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
236 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
237#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100238 return status;
239}
240
241/* Wrapper for psa_aead_verify */
242psa_status_t mbedtls_test_wrap_psa_aead_verify(
243 psa_aead_operation_t *arg0_operation,
244 uint8_t *arg1_plaintext,
245 size_t arg2_plaintext_size,
246 size_t *arg3_plaintext_length,
247 const uint8_t *arg4_tag,
248 size_t arg5_tag_length)
249{
David Horstmann86e6fe02024-01-22 14:36:01 +0000250#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
251 MBEDTLS_TEST_MEMORY_POISON(arg1_plaintext, arg2_plaintext_size);
252 MBEDTLS_TEST_MEMORY_POISON(arg4_tag, arg5_tag_length);
253#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100254 psa_status_t status = (psa_aead_verify)(arg0_operation, arg1_plaintext, arg2_plaintext_size, arg3_plaintext_length, arg4_tag, arg5_tag_length);
David Horstmann86e6fe02024-01-22 14:36:01 +0000255#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
256 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_plaintext, arg2_plaintext_size);
257 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_tag, arg5_tag_length);
258#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100259 return status;
260}
261
262/* Wrapper for psa_asymmetric_decrypt */
263psa_status_t mbedtls_test_wrap_psa_asymmetric_decrypt(
264 mbedtls_svc_key_id_t arg0_key,
265 psa_algorithm_t arg1_alg,
266 const uint8_t *arg2_input,
267 size_t arg3_input_length,
268 const uint8_t *arg4_salt,
269 size_t arg5_salt_length,
270 uint8_t *arg6_output,
271 size_t arg7_output_size,
272 size_t *arg8_output_length)
273{
274 psa_status_t status = (psa_asymmetric_decrypt)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_salt, arg5_salt_length, arg6_output, arg7_output_size, arg8_output_length);
275 return status;
276}
277
278/* Wrapper for psa_asymmetric_encrypt */
279psa_status_t mbedtls_test_wrap_psa_asymmetric_encrypt(
280 mbedtls_svc_key_id_t arg0_key,
281 psa_algorithm_t arg1_alg,
282 const uint8_t *arg2_input,
283 size_t arg3_input_length,
284 const uint8_t *arg4_salt,
285 size_t arg5_salt_length,
286 uint8_t *arg6_output,
287 size_t arg7_output_size,
288 size_t *arg8_output_length)
289{
290 psa_status_t status = (psa_asymmetric_encrypt)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_salt, arg5_salt_length, arg6_output, arg7_output_size, arg8_output_length);
291 return status;
292}
293
294/* Wrapper for psa_cipher_abort */
295psa_status_t mbedtls_test_wrap_psa_cipher_abort(
296 psa_cipher_operation_t *arg0_operation)
297{
298 psa_status_t status = (psa_cipher_abort)(arg0_operation);
299 return status;
300}
301
302/* Wrapper for psa_cipher_decrypt */
303psa_status_t mbedtls_test_wrap_psa_cipher_decrypt(
304 mbedtls_svc_key_id_t arg0_key,
305 psa_algorithm_t arg1_alg,
306 const uint8_t *arg2_input,
307 size_t arg3_input_length,
308 uint8_t *arg4_output,
309 size_t arg5_output_size,
310 size_t *arg6_output_length)
311{
312 psa_status_t status = (psa_cipher_decrypt)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_output, arg5_output_size, arg6_output_length);
313 return status;
314}
315
316/* Wrapper for psa_cipher_decrypt_setup */
317psa_status_t mbedtls_test_wrap_psa_cipher_decrypt_setup(
318 psa_cipher_operation_t *arg0_operation,
319 mbedtls_svc_key_id_t arg1_key,
320 psa_algorithm_t arg2_alg)
321{
322 psa_status_t status = (psa_cipher_decrypt_setup)(arg0_operation, arg1_key, arg2_alg);
323 return status;
324}
325
326/* Wrapper for psa_cipher_encrypt */
327psa_status_t mbedtls_test_wrap_psa_cipher_encrypt(
328 mbedtls_svc_key_id_t arg0_key,
329 psa_algorithm_t arg1_alg,
330 const uint8_t *arg2_input,
331 size_t arg3_input_length,
332 uint8_t *arg4_output,
333 size_t arg5_output_size,
334 size_t *arg6_output_length)
335{
Ryan Everett84a666d2024-01-25 12:00:02 +0000336#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
337 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
338 MBEDTLS_TEST_MEMORY_POISON(arg4_output, arg5_output_size);
339#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100340 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 +0000341#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
342 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
343 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_output, arg5_output_size);
344#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100345 return status;
346}
347
348/* Wrapper for psa_cipher_encrypt_setup */
349psa_status_t mbedtls_test_wrap_psa_cipher_encrypt_setup(
350 psa_cipher_operation_t *arg0_operation,
351 mbedtls_svc_key_id_t arg1_key,
352 psa_algorithm_t arg2_alg)
353{
354 psa_status_t status = (psa_cipher_encrypt_setup)(arg0_operation, arg1_key, arg2_alg);
355 return status;
356}
357
358/* Wrapper for psa_cipher_finish */
359psa_status_t mbedtls_test_wrap_psa_cipher_finish(
360 psa_cipher_operation_t *arg0_operation,
361 uint8_t *arg1_output,
362 size_t arg2_output_size,
363 size_t *arg3_output_length)
364{
365 psa_status_t status = (psa_cipher_finish)(arg0_operation, arg1_output, arg2_output_size, arg3_output_length);
366 return status;
367}
368
369/* Wrapper for psa_cipher_generate_iv */
370psa_status_t mbedtls_test_wrap_psa_cipher_generate_iv(
371 psa_cipher_operation_t *arg0_operation,
372 uint8_t *arg1_iv,
373 size_t arg2_iv_size,
374 size_t *arg3_iv_length)
375{
376 psa_status_t status = (psa_cipher_generate_iv)(arg0_operation, arg1_iv, arg2_iv_size, arg3_iv_length);
377 return status;
378}
379
380/* Wrapper for psa_cipher_set_iv */
381psa_status_t mbedtls_test_wrap_psa_cipher_set_iv(
382 psa_cipher_operation_t *arg0_operation,
383 const uint8_t *arg1_iv,
384 size_t arg2_iv_length)
385{
386 psa_status_t status = (psa_cipher_set_iv)(arg0_operation, arg1_iv, arg2_iv_length);
387 return status;
388}
389
390/* Wrapper for psa_cipher_update */
391psa_status_t mbedtls_test_wrap_psa_cipher_update(
392 psa_cipher_operation_t *arg0_operation,
393 const uint8_t *arg1_input,
394 size_t arg2_input_length,
395 uint8_t *arg3_output,
396 size_t arg4_output_size,
397 size_t *arg5_output_length)
398{
399 psa_status_t status = (psa_cipher_update)(arg0_operation, arg1_input, arg2_input_length, arg3_output, arg4_output_size, arg5_output_length);
400 return status;
401}
402
403/* Wrapper for psa_copy_key */
404psa_status_t mbedtls_test_wrap_psa_copy_key(
405 mbedtls_svc_key_id_t arg0_source_key,
406 const psa_key_attributes_t *arg1_attributes,
407 mbedtls_svc_key_id_t *arg2_target_key)
408{
409 psa_status_t status = (psa_copy_key)(arg0_source_key, arg1_attributes, arg2_target_key);
410 return status;
411}
412
413/* Wrapper for psa_crypto_driver_pake_get_cipher_suite */
414psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_cipher_suite(
415 const psa_crypto_driver_pake_inputs_t *arg0_inputs,
416 psa_pake_cipher_suite_t *arg1_cipher_suite)
417{
418 psa_status_t status = (psa_crypto_driver_pake_get_cipher_suite)(arg0_inputs, arg1_cipher_suite);
419 return status;
420}
421
422/* Wrapper for psa_crypto_driver_pake_get_password */
423psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_password(
424 const psa_crypto_driver_pake_inputs_t *arg0_inputs,
425 uint8_t *arg1_buffer,
426 size_t arg2_buffer_size,
427 size_t *arg3_buffer_length)
428{
429 psa_status_t status = (psa_crypto_driver_pake_get_password)(arg0_inputs, arg1_buffer, arg2_buffer_size, arg3_buffer_length);
430 return status;
431}
432
433/* Wrapper for psa_crypto_driver_pake_get_password_len */
434psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_password_len(
435 const psa_crypto_driver_pake_inputs_t *arg0_inputs,
436 size_t *arg1_password_len)
437{
438 psa_status_t status = (psa_crypto_driver_pake_get_password_len)(arg0_inputs, arg1_password_len);
439 return status;
440}
441
442/* Wrapper for psa_crypto_driver_pake_get_peer */
443psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_peer(
444 const psa_crypto_driver_pake_inputs_t *arg0_inputs,
445 uint8_t *arg1_peer_id,
446 size_t arg2_peer_id_size,
447 size_t *arg3_peer_id_length)
448{
449 psa_status_t status = (psa_crypto_driver_pake_get_peer)(arg0_inputs, arg1_peer_id, arg2_peer_id_size, arg3_peer_id_length);
450 return status;
451}
452
453/* Wrapper for psa_crypto_driver_pake_get_peer_len */
454psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_peer_len(
455 const psa_crypto_driver_pake_inputs_t *arg0_inputs,
456 size_t *arg1_peer_len)
457{
458 psa_status_t status = (psa_crypto_driver_pake_get_peer_len)(arg0_inputs, arg1_peer_len);
459 return status;
460}
461
462/* Wrapper for psa_crypto_driver_pake_get_user */
463psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_user(
464 const psa_crypto_driver_pake_inputs_t *arg0_inputs,
465 uint8_t *arg1_user_id,
466 size_t arg2_user_id_size,
467 size_t *arg3_user_id_len)
468{
469 psa_status_t status = (psa_crypto_driver_pake_get_user)(arg0_inputs, arg1_user_id, arg2_user_id_size, arg3_user_id_len);
470 return status;
471}
472
473/* Wrapper for psa_crypto_driver_pake_get_user_len */
474psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_user_len(
475 const psa_crypto_driver_pake_inputs_t *arg0_inputs,
476 size_t *arg1_user_len)
477{
478 psa_status_t status = (psa_crypto_driver_pake_get_user_len)(arg0_inputs, arg1_user_len);
479 return status;
480}
481
482/* Wrapper for psa_crypto_init */
483psa_status_t mbedtls_test_wrap_psa_crypto_init(void)
484{
485 psa_status_t status = (psa_crypto_init)();
486 return status;
487}
488
489/* Wrapper for psa_destroy_key */
490psa_status_t mbedtls_test_wrap_psa_destroy_key(
491 mbedtls_svc_key_id_t arg0_key)
492{
493 psa_status_t status = (psa_destroy_key)(arg0_key);
494 return status;
495}
496
497/* Wrapper for psa_export_key */
498psa_status_t mbedtls_test_wrap_psa_export_key(
499 mbedtls_svc_key_id_t arg0_key,
500 uint8_t *arg1_data,
501 size_t arg2_data_size,
502 size_t *arg3_data_length)
503{
Ryan Everett77b91e32024-01-25 10:58:06 +0000504#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
505 MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_size);
506#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100507 psa_status_t status = (psa_export_key)(arg0_key, arg1_data, arg2_data_size, arg3_data_length);
Ryan Everett77b91e32024-01-25 10:58:06 +0000508#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
509 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_size);
510#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100511 return status;
512}
513
514/* Wrapper for psa_export_public_key */
515psa_status_t mbedtls_test_wrap_psa_export_public_key(
516 mbedtls_svc_key_id_t arg0_key,
517 uint8_t *arg1_data,
518 size_t arg2_data_size,
519 size_t *arg3_data_length)
520{
Ryan Everett77b91e32024-01-25 10:58:06 +0000521#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
522 MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_size);
523#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100524 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 +0000525#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
526 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_size);
527#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100528 return status;
529}
530
531/* Wrapper for psa_generate_key */
532psa_status_t mbedtls_test_wrap_psa_generate_key(
533 const psa_key_attributes_t *arg0_attributes,
534 mbedtls_svc_key_id_t *arg1_key)
535{
536 psa_status_t status = (psa_generate_key)(arg0_attributes, arg1_key);
537 return status;
538}
539
540/* Wrapper for psa_generate_random */
541psa_status_t mbedtls_test_wrap_psa_generate_random(
542 uint8_t *arg0_output,
543 size_t arg1_output_size)
544{
545 psa_status_t status = (psa_generate_random)(arg0_output, arg1_output_size);
546 return status;
547}
548
549/* Wrapper for psa_get_key_attributes */
550psa_status_t mbedtls_test_wrap_psa_get_key_attributes(
551 mbedtls_svc_key_id_t arg0_key,
552 psa_key_attributes_t *arg1_attributes)
553{
554 psa_status_t status = (psa_get_key_attributes)(arg0_key, arg1_attributes);
555 return status;
556}
557
558/* Wrapper for psa_hash_abort */
559psa_status_t mbedtls_test_wrap_psa_hash_abort(
560 psa_hash_operation_t *arg0_operation)
561{
562 psa_status_t status = (psa_hash_abort)(arg0_operation);
563 return status;
564}
565
566/* Wrapper for psa_hash_clone */
567psa_status_t mbedtls_test_wrap_psa_hash_clone(
568 const psa_hash_operation_t *arg0_source_operation,
569 psa_hash_operation_t *arg1_target_operation)
570{
571 psa_status_t status = (psa_hash_clone)(arg0_source_operation, arg1_target_operation);
572 return status;
573}
574
575/* Wrapper for psa_hash_compare */
576psa_status_t mbedtls_test_wrap_psa_hash_compare(
577 psa_algorithm_t arg0_alg,
578 const uint8_t *arg1_input,
579 size_t arg2_input_length,
580 const uint8_t *arg3_hash,
581 size_t arg4_hash_length)
582{
Thomas Daubney45c85862024-01-25 16:48:09 +0000583#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
584 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
585 MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_length);
586#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100587 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 +0000588#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
589 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
590 MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_length);
591#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100592 return status;
593}
594
595/* Wrapper for psa_hash_compute */
596psa_status_t mbedtls_test_wrap_psa_hash_compute(
597 psa_algorithm_t arg0_alg,
598 const uint8_t *arg1_input,
599 size_t arg2_input_length,
600 uint8_t *arg3_hash,
601 size_t arg4_hash_size,
602 size_t *arg5_hash_length)
603{
Thomas Daubney45c85862024-01-25 16:48:09 +0000604#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
605 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
606 MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_size);
607#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100608 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 +0000609#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
610 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
611 MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_size);
612#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100613 return status;
614}
615
616/* Wrapper for psa_hash_finish */
617psa_status_t mbedtls_test_wrap_psa_hash_finish(
618 psa_hash_operation_t *arg0_operation,
619 uint8_t *arg1_hash,
620 size_t arg2_hash_size,
621 size_t *arg3_hash_length)
622{
Thomas Daubney45c85862024-01-25 16:48:09 +0000623#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
624 MBEDTLS_TEST_MEMORY_POISON(arg1_hash, arg2_hash_size);
625#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100626 psa_status_t status = (psa_hash_finish)(arg0_operation, arg1_hash, arg2_hash_size, arg3_hash_length);
Thomas Daubney45c85862024-01-25 16:48:09 +0000627#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
628 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_hash, arg2_hash_size);
629#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100630 return status;
631}
632
633/* Wrapper for psa_hash_setup */
634psa_status_t mbedtls_test_wrap_psa_hash_setup(
635 psa_hash_operation_t *arg0_operation,
636 psa_algorithm_t arg1_alg)
637{
638 psa_status_t status = (psa_hash_setup)(arg0_operation, arg1_alg);
639 return status;
640}
641
642/* Wrapper for psa_hash_update */
643psa_status_t mbedtls_test_wrap_psa_hash_update(
644 psa_hash_operation_t *arg0_operation,
645 const uint8_t *arg1_input,
646 size_t arg2_input_length)
647{
Thomas Daubney45c85862024-01-25 16:48:09 +0000648#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
649 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
650#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100651 psa_status_t status = (psa_hash_update)(arg0_operation, arg1_input, arg2_input_length);
Thomas Daubney45c85862024-01-25 16:48:09 +0000652#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
653 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
654#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100655 return status;
656}
657
658/* Wrapper for psa_hash_verify */
659psa_status_t mbedtls_test_wrap_psa_hash_verify(
660 psa_hash_operation_t *arg0_operation,
661 const uint8_t *arg1_hash,
662 size_t arg2_hash_length)
663{
Thomas Daubney45c85862024-01-25 16:48:09 +0000664#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
665 MBEDTLS_TEST_MEMORY_POISON(arg1_hash, arg2_hash_length);
666#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100667 psa_status_t status = (psa_hash_verify)(arg0_operation, arg1_hash, arg2_hash_length);
Thomas Daubney45c85862024-01-25 16:48:09 +0000668#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
669 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_hash, arg2_hash_length);
670#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100671 return status;
672}
673
674/* Wrapper for psa_import_key */
675psa_status_t mbedtls_test_wrap_psa_import_key(
676 const psa_key_attributes_t *arg0_attributes,
677 const uint8_t *arg1_data,
678 size_t arg2_data_length,
679 mbedtls_svc_key_id_t *arg3_key)
680{
Ryan Everett77b91e32024-01-25 10:58:06 +0000681#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
682 MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_length);
683#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100684 psa_status_t status = (psa_import_key)(arg0_attributes, arg1_data, arg2_data_length, arg3_key);
Ryan Everett77b91e32024-01-25 10:58:06 +0000685#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
686 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_length);
687#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100688 return status;
689}
690
691/* Wrapper for psa_key_derivation_abort */
692psa_status_t mbedtls_test_wrap_psa_key_derivation_abort(
693 psa_key_derivation_operation_t *arg0_operation)
694{
695 psa_status_t status = (psa_key_derivation_abort)(arg0_operation);
696 return status;
697}
698
699/* Wrapper for psa_key_derivation_get_capacity */
700psa_status_t mbedtls_test_wrap_psa_key_derivation_get_capacity(
701 const psa_key_derivation_operation_t *arg0_operation,
702 size_t *arg1_capacity)
703{
704 psa_status_t status = (psa_key_derivation_get_capacity)(arg0_operation, arg1_capacity);
705 return status;
706}
707
708/* Wrapper for psa_key_derivation_input_bytes */
709psa_status_t mbedtls_test_wrap_psa_key_derivation_input_bytes(
710 psa_key_derivation_operation_t *arg0_operation,
711 psa_key_derivation_step_t arg1_step,
712 const uint8_t *arg2_data,
713 size_t arg3_data_length)
714{
Ryan Everett198a4d92024-01-25 11:44:56 +0000715#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
716 MBEDTLS_TEST_MEMORY_POISON(arg2_data, arg3_data_length);
717#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100718 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 +0000719#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
720 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_data, arg3_data_length);
721#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100722 return status;
723}
724
725/* Wrapper for psa_key_derivation_input_integer */
726psa_status_t mbedtls_test_wrap_psa_key_derivation_input_integer(
727 psa_key_derivation_operation_t *arg0_operation,
728 psa_key_derivation_step_t arg1_step,
729 uint64_t arg2_value)
730{
731 psa_status_t status = (psa_key_derivation_input_integer)(arg0_operation, arg1_step, arg2_value);
732 return status;
733}
734
735/* Wrapper for psa_key_derivation_input_key */
736psa_status_t mbedtls_test_wrap_psa_key_derivation_input_key(
737 psa_key_derivation_operation_t *arg0_operation,
738 psa_key_derivation_step_t arg1_step,
739 mbedtls_svc_key_id_t arg2_key)
740{
741 psa_status_t status = (psa_key_derivation_input_key)(arg0_operation, arg1_step, arg2_key);
742 return status;
743}
744
745/* Wrapper for psa_key_derivation_key_agreement */
746psa_status_t mbedtls_test_wrap_psa_key_derivation_key_agreement(
747 psa_key_derivation_operation_t *arg0_operation,
748 psa_key_derivation_step_t arg1_step,
749 mbedtls_svc_key_id_t arg2_private_key,
750 const uint8_t *arg3_peer_key,
751 size_t arg4_peer_key_length)
752{
753 psa_status_t status = (psa_key_derivation_key_agreement)(arg0_operation, arg1_step, arg2_private_key, arg3_peer_key, arg4_peer_key_length);
754 return status;
755}
756
757/* Wrapper for psa_key_derivation_output_bytes */
758psa_status_t mbedtls_test_wrap_psa_key_derivation_output_bytes(
759 psa_key_derivation_operation_t *arg0_operation,
760 uint8_t *arg1_output,
761 size_t arg2_output_length)
762{
Ryan Everett198a4d92024-01-25 11:44:56 +0000763#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
764 MBEDTLS_TEST_MEMORY_POISON(arg1_output, arg2_output_length);
765#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100766 psa_status_t status = (psa_key_derivation_output_bytes)(arg0_operation, arg1_output, arg2_output_length);
Ryan Everett198a4d92024-01-25 11:44:56 +0000767#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
768 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_output, arg2_output_length);
769#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100770 return status;
771}
772
773/* Wrapper for psa_key_derivation_output_key */
774psa_status_t mbedtls_test_wrap_psa_key_derivation_output_key(
775 const psa_key_attributes_t *arg0_attributes,
776 psa_key_derivation_operation_t *arg1_operation,
777 mbedtls_svc_key_id_t *arg2_key)
778{
779 psa_status_t status = (psa_key_derivation_output_key)(arg0_attributes, arg1_operation, arg2_key);
780 return status;
781}
782
783/* Wrapper for psa_key_derivation_set_capacity */
784psa_status_t mbedtls_test_wrap_psa_key_derivation_set_capacity(
785 psa_key_derivation_operation_t *arg0_operation,
786 size_t arg1_capacity)
787{
788 psa_status_t status = (psa_key_derivation_set_capacity)(arg0_operation, arg1_capacity);
789 return status;
790}
791
792/* Wrapper for psa_key_derivation_setup */
793psa_status_t mbedtls_test_wrap_psa_key_derivation_setup(
794 psa_key_derivation_operation_t *arg0_operation,
795 psa_algorithm_t arg1_alg)
796{
797 psa_status_t status = (psa_key_derivation_setup)(arg0_operation, arg1_alg);
798 return status;
799}
800
801/* Wrapper for psa_mac_abort */
802psa_status_t mbedtls_test_wrap_psa_mac_abort(
803 psa_mac_operation_t *arg0_operation)
804{
805 psa_status_t status = (psa_mac_abort)(arg0_operation);
806 return status;
807}
808
809/* Wrapper for psa_mac_compute */
810psa_status_t mbedtls_test_wrap_psa_mac_compute(
811 mbedtls_svc_key_id_t arg0_key,
812 psa_algorithm_t arg1_alg,
813 const uint8_t *arg2_input,
814 size_t arg3_input_length,
815 uint8_t *arg4_mac,
816 size_t arg5_mac_size,
817 size_t *arg6_mac_length)
818{
Thomas Daubneya1cf1012024-01-30 11:18:54 +0000819#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
820 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
821 MBEDTLS_TEST_MEMORY_POISON(arg4_mac, arg5_mac_size);
822#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100823 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 +0000824#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
825 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
826 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_mac, arg5_mac_size);
827#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100828 return status;
829}
830
831/* Wrapper for psa_mac_sign_finish */
832psa_status_t mbedtls_test_wrap_psa_mac_sign_finish(
833 psa_mac_operation_t *arg0_operation,
834 uint8_t *arg1_mac,
835 size_t arg2_mac_size,
836 size_t *arg3_mac_length)
837{
Thomas Daubneya1cf1012024-01-30 11:18:54 +0000838#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
839 MBEDTLS_TEST_MEMORY_POISON(arg1_mac, arg2_mac_size);
840#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100841 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 +0000842#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
843 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_mac, arg2_mac_size);
844#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100845 return status;
846}
847
848/* Wrapper for psa_mac_sign_setup */
849psa_status_t mbedtls_test_wrap_psa_mac_sign_setup(
850 psa_mac_operation_t *arg0_operation,
851 mbedtls_svc_key_id_t arg1_key,
852 psa_algorithm_t arg2_alg)
853{
854 psa_status_t status = (psa_mac_sign_setup)(arg0_operation, arg1_key, arg2_alg);
855 return status;
856}
857
858/* Wrapper for psa_mac_update */
859psa_status_t mbedtls_test_wrap_psa_mac_update(
860 psa_mac_operation_t *arg0_operation,
861 const uint8_t *arg1_input,
862 size_t arg2_input_length)
863{
Thomas Daubneya1cf1012024-01-30 11:18:54 +0000864#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
865 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
866#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100867 psa_status_t status = (psa_mac_update)(arg0_operation, arg1_input, arg2_input_length);
Thomas Daubneya1cf1012024-01-30 11:18:54 +0000868#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
869 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
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_verify */
875psa_status_t mbedtls_test_wrap_psa_mac_verify(
876 mbedtls_svc_key_id_t arg0_key,
877 psa_algorithm_t arg1_alg,
878 const uint8_t *arg2_input,
879 size_t arg3_input_length,
880 const uint8_t *arg4_mac,
881 size_t arg5_mac_length)
882{
Thomas Daubneya1cf1012024-01-30 11:18:54 +0000883#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
884 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
885 MBEDTLS_TEST_MEMORY_POISON(arg4_mac, arg5_mac_length);
886#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100887 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 +0000888#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
889 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
890 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_mac, arg5_mac_length);
891#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100892 return status;
893}
894
895/* Wrapper for psa_mac_verify_finish */
896psa_status_t mbedtls_test_wrap_psa_mac_verify_finish(
897 psa_mac_operation_t *arg0_operation,
898 const uint8_t *arg1_mac,
899 size_t arg2_mac_length)
900{
Thomas Daubneya1cf1012024-01-30 11:18:54 +0000901#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
902 MBEDTLS_TEST_MEMORY_POISON(arg1_mac, arg2_mac_length);
903#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100904 psa_status_t status = (psa_mac_verify_finish)(arg0_operation, arg1_mac, arg2_mac_length);
Thomas Daubneya1cf1012024-01-30 11:18:54 +0000905#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
906 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_mac, arg2_mac_length);
907#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100908 return status;
909}
910
911/* Wrapper for psa_mac_verify_setup */
912psa_status_t mbedtls_test_wrap_psa_mac_verify_setup(
913 psa_mac_operation_t *arg0_operation,
914 mbedtls_svc_key_id_t arg1_key,
915 psa_algorithm_t arg2_alg)
916{
917 psa_status_t status = (psa_mac_verify_setup)(arg0_operation, arg1_key, arg2_alg);
918 return status;
919}
920
921/* Wrapper for psa_pake_abort */
922psa_status_t mbedtls_test_wrap_psa_pake_abort(
923 psa_pake_operation_t *arg0_operation)
924{
925 psa_status_t status = (psa_pake_abort)(arg0_operation);
926 return status;
927}
928
929/* Wrapper for psa_pake_get_implicit_key */
930psa_status_t mbedtls_test_wrap_psa_pake_get_implicit_key(
931 psa_pake_operation_t *arg0_operation,
932 psa_key_derivation_operation_t *arg1_output)
933{
934 psa_status_t status = (psa_pake_get_implicit_key)(arg0_operation, arg1_output);
935 return status;
936}
937
938/* Wrapper for psa_pake_input */
939psa_status_t mbedtls_test_wrap_psa_pake_input(
940 psa_pake_operation_t *arg0_operation,
941 psa_pake_step_t arg1_step,
942 const uint8_t *arg2_input,
943 size_t arg3_input_length)
944{
945 psa_status_t status = (psa_pake_input)(arg0_operation, arg1_step, arg2_input, arg3_input_length);
946 return status;
947}
948
949/* Wrapper for psa_pake_output */
950psa_status_t mbedtls_test_wrap_psa_pake_output(
951 psa_pake_operation_t *arg0_operation,
952 psa_pake_step_t arg1_step,
953 uint8_t *arg2_output,
954 size_t arg3_output_size,
955 size_t *arg4_output_length)
956{
957 psa_status_t status = (psa_pake_output)(arg0_operation, arg1_step, arg2_output, arg3_output_size, arg4_output_length);
958 return status;
959}
960
961/* Wrapper for psa_pake_set_password_key */
962psa_status_t mbedtls_test_wrap_psa_pake_set_password_key(
963 psa_pake_operation_t *arg0_operation,
964 mbedtls_svc_key_id_t arg1_password)
965{
966 psa_status_t status = (psa_pake_set_password_key)(arg0_operation, arg1_password);
967 return status;
968}
969
970/* Wrapper for psa_pake_set_peer */
971psa_status_t mbedtls_test_wrap_psa_pake_set_peer(
972 psa_pake_operation_t *arg0_operation,
973 const uint8_t *arg1_peer_id,
974 size_t arg2_peer_id_len)
975{
976 psa_status_t status = (psa_pake_set_peer)(arg0_operation, arg1_peer_id, arg2_peer_id_len);
977 return status;
978}
979
980/* Wrapper for psa_pake_set_role */
981psa_status_t mbedtls_test_wrap_psa_pake_set_role(
982 psa_pake_operation_t *arg0_operation,
983 psa_pake_role_t arg1_role)
984{
985 psa_status_t status = (psa_pake_set_role)(arg0_operation, arg1_role);
986 return status;
987}
988
989/* Wrapper for psa_pake_set_user */
990psa_status_t mbedtls_test_wrap_psa_pake_set_user(
991 psa_pake_operation_t *arg0_operation,
992 const uint8_t *arg1_user_id,
993 size_t arg2_user_id_len)
994{
995 psa_status_t status = (psa_pake_set_user)(arg0_operation, arg1_user_id, arg2_user_id_len);
996 return status;
997}
998
999/* Wrapper for psa_pake_setup */
1000psa_status_t mbedtls_test_wrap_psa_pake_setup(
1001 psa_pake_operation_t *arg0_operation,
1002 const psa_pake_cipher_suite_t *arg1_cipher_suite)
1003{
1004 psa_status_t status = (psa_pake_setup)(arg0_operation, arg1_cipher_suite);
1005 return status;
1006}
1007
1008/* Wrapper for psa_purge_key */
1009psa_status_t mbedtls_test_wrap_psa_purge_key(
1010 mbedtls_svc_key_id_t arg0_key)
1011{
1012 psa_status_t status = (psa_purge_key)(arg0_key);
1013 return status;
1014}
1015
1016/* Wrapper for psa_raw_key_agreement */
1017psa_status_t mbedtls_test_wrap_psa_raw_key_agreement(
1018 psa_algorithm_t arg0_alg,
1019 mbedtls_svc_key_id_t arg1_private_key,
1020 const uint8_t *arg2_peer_key,
1021 size_t arg3_peer_key_length,
1022 uint8_t *arg4_output,
1023 size_t arg5_output_size,
1024 size_t *arg6_output_length)
1025{
1026 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);
1027 return status;
1028}
1029
1030/* Wrapper for psa_sign_hash */
1031psa_status_t mbedtls_test_wrap_psa_sign_hash(
1032 mbedtls_svc_key_id_t arg0_key,
1033 psa_algorithm_t arg1_alg,
1034 const uint8_t *arg2_hash,
1035 size_t arg3_hash_length,
1036 uint8_t *arg4_signature,
1037 size_t arg5_signature_size,
1038 size_t *arg6_signature_length)
1039{
Thomas Daubneyf430f472024-01-30 12:25:35 +00001040#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
1041 MBEDTLS_TEST_MEMORY_POISON(arg2_hash, arg3_hash_length);
1042 MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_size);
1043#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001044 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 +00001045#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
1046 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_hash, arg3_hash_length);
1047 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_size);
1048#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001049 return status;
1050}
1051
1052/* Wrapper for psa_sign_hash_abort */
1053psa_status_t mbedtls_test_wrap_psa_sign_hash_abort(
1054 psa_sign_hash_interruptible_operation_t *arg0_operation)
1055{
1056 psa_status_t status = (psa_sign_hash_abort)(arg0_operation);
1057 return status;
1058}
1059
1060/* Wrapper for psa_sign_hash_complete */
1061psa_status_t mbedtls_test_wrap_psa_sign_hash_complete(
1062 psa_sign_hash_interruptible_operation_t *arg0_operation,
1063 uint8_t *arg1_signature,
1064 size_t arg2_signature_size,
1065 size_t *arg3_signature_length)
1066{
1067 psa_status_t status = (psa_sign_hash_complete)(arg0_operation, arg1_signature, arg2_signature_size, arg3_signature_length);
1068 return status;
1069}
1070
1071/* Wrapper for psa_sign_hash_start */
1072psa_status_t mbedtls_test_wrap_psa_sign_hash_start(
1073 psa_sign_hash_interruptible_operation_t *arg0_operation,
1074 mbedtls_svc_key_id_t arg1_key,
1075 psa_algorithm_t arg2_alg,
1076 const uint8_t *arg3_hash,
1077 size_t arg4_hash_length)
1078{
1079 psa_status_t status = (psa_sign_hash_start)(arg0_operation, arg1_key, arg2_alg, arg3_hash, arg4_hash_length);
1080 return status;
1081}
1082
1083/* Wrapper for psa_sign_message */
1084psa_status_t mbedtls_test_wrap_psa_sign_message(
1085 mbedtls_svc_key_id_t arg0_key,
1086 psa_algorithm_t arg1_alg,
1087 const uint8_t *arg2_input,
1088 size_t arg3_input_length,
1089 uint8_t *arg4_signature,
1090 size_t arg5_signature_size,
1091 size_t *arg6_signature_length)
1092{
Thomas Daubneyf430f472024-01-30 12:25:35 +00001093#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
1094 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
1095 MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_size);
1096#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001097 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 +00001098#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
1099 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
1100 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_size);
1101#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001102 return status;
1103}
1104
1105/* Wrapper for psa_verify_hash */
1106psa_status_t mbedtls_test_wrap_psa_verify_hash(
1107 mbedtls_svc_key_id_t arg0_key,
1108 psa_algorithm_t arg1_alg,
1109 const uint8_t *arg2_hash,
1110 size_t arg3_hash_length,
1111 const uint8_t *arg4_signature,
1112 size_t arg5_signature_length)
1113{
Thomas Daubneyf430f472024-01-30 12:25:35 +00001114#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
1115 MBEDTLS_TEST_MEMORY_POISON(arg2_hash, arg3_hash_length);
1116 MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_length);
1117#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001118 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 +00001119#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
1120 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_hash, arg3_hash_length);
1121 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_length);
1122#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001123 return status;
1124}
1125
1126/* Wrapper for psa_verify_hash_abort */
1127psa_status_t mbedtls_test_wrap_psa_verify_hash_abort(
1128 psa_verify_hash_interruptible_operation_t *arg0_operation)
1129{
1130 psa_status_t status = (psa_verify_hash_abort)(arg0_operation);
1131 return status;
1132}
1133
1134/* Wrapper for psa_verify_hash_complete */
1135psa_status_t mbedtls_test_wrap_psa_verify_hash_complete(
1136 psa_verify_hash_interruptible_operation_t *arg0_operation)
1137{
1138 psa_status_t status = (psa_verify_hash_complete)(arg0_operation);
1139 return status;
1140}
1141
1142/* Wrapper for psa_verify_hash_start */
1143psa_status_t mbedtls_test_wrap_psa_verify_hash_start(
1144 psa_verify_hash_interruptible_operation_t *arg0_operation,
1145 mbedtls_svc_key_id_t arg1_key,
1146 psa_algorithm_t arg2_alg,
1147 const uint8_t *arg3_hash,
1148 size_t arg4_hash_length,
1149 const uint8_t *arg5_signature,
1150 size_t arg6_signature_length)
1151{
1152 psa_status_t status = (psa_verify_hash_start)(arg0_operation, arg1_key, arg2_alg, arg3_hash, arg4_hash_length, arg5_signature, arg6_signature_length);
1153 return status;
1154}
1155
1156/* Wrapper for psa_verify_message */
1157psa_status_t mbedtls_test_wrap_psa_verify_message(
1158 mbedtls_svc_key_id_t arg0_key,
1159 psa_algorithm_t arg1_alg,
1160 const uint8_t *arg2_input,
1161 size_t arg3_input_length,
1162 const uint8_t *arg4_signature,
1163 size_t arg5_signature_length)
1164{
Thomas Daubneyf430f472024-01-30 12:25:35 +00001165#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
1166 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
1167 MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_length);
1168#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001169 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 +00001170#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
1171 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
1172 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_length);
1173#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001174 return status;
1175}
1176
Gilles Peskine4411c9c2024-01-04 20:51:38 +01001177#endif /* defined(MBEDTLS_PSA_CRYPTO_C) && defined(MBEDTLS_TEST_HOOKS) && \
1178 !defined(RECORD_PSA_STATUS_COVERAGE_LOG) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001179
1180/* End of automatically generated file. */