blob: 1efa1bb6a6e18ca5fee6bcf24fc0f6d335dfa09d [file] [log] [blame]
Gilles Peskined5e5e6d2024-01-04 16:42:40 +01001/* Automatically generated by generate_psa_wrappers.py, do not edit! */
2
3/* Copyright The Mbed TLS Contributors
4 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
5 */
6
7#if !defined(MBEDTLS_CONFIG_FILE)
8#include "mbedtls/config.h"
9#else
10#include MBEDTLS_CONFIG_FILE
11#endif
12
Gilles Peskinea980aa02024-01-04 20:51:38 +010013#if defined(MBEDTLS_PSA_CRYPTO_C) && defined(MBEDTLS_TEST_HOOKS) && \
14 !defined(RECORD_PSA_STATUS_COVERAGE_LOG)
Gilles Peskined5e5e6d2024-01-04 16:42:40 +010015
16#include <psa/crypto.h>
17
Gilles Peskine42fa8ea2024-01-04 16:59:28 +010018#include <test/memory.h>
Gilles Peskined5e5e6d2024-01-04 16:42:40 +010019#include <test/psa_crypto_helpers.h>
20#include <test/psa_test_wrappers.h>
21
22/* Wrapper for mbedtls_psa_inject_entropy */
23#if defined(MBEDTLS_PSA_INJECT_ENTROPY)
24psa_status_t mbedtls_test_wrap_mbedtls_psa_inject_entropy(
25 const uint8_t *arg0_seed,
26 size_t arg1_seed_size)
27{
28 psa_status_t status = (mbedtls_psa_inject_entropy)(arg0_seed, arg1_seed_size);
29 return status;
30}
31#endif /* defined(MBEDTLS_PSA_INJECT_ENTROPY) */
32
33/* Wrapper for mbedtls_psa_platform_get_builtin_key */
34#if defined(MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS)
35psa_status_t mbedtls_test_wrap_mbedtls_psa_platform_get_builtin_key(
36 mbedtls_svc_key_id_t arg0_key_id,
37 psa_key_lifetime_t *arg1_lifetime,
38 psa_drv_slot_number_t *arg2_slot_number)
39{
40 psa_status_t status = (mbedtls_psa_platform_get_builtin_key)(arg0_key_id, arg1_lifetime, arg2_slot_number);
41 return status;
42}
43#endif /* defined(MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS) */
44
45/* Wrapper for mbedtls_psa_register_se_key */
46#if defined(MBEDTLS_PSA_CRYPTO_SE_C)
47psa_status_t mbedtls_test_wrap_mbedtls_psa_register_se_key(
48 const psa_key_attributes_t *arg0_attributes)
49{
50 psa_status_t status = (mbedtls_psa_register_se_key)(arg0_attributes);
51 return status;
52}
53#endif /* defined(MBEDTLS_PSA_CRYPTO_SE_C) */
54
55/* Wrapper for psa_aead_decrypt */
56psa_status_t mbedtls_test_wrap_psa_aead_decrypt(
57 mbedtls_svc_key_id_t arg0_key,
58 psa_algorithm_t arg1_alg,
59 const uint8_t *arg2_nonce,
60 size_t arg3_nonce_length,
61 const uint8_t *arg4_additional_data,
62 size_t arg5_additional_data_length,
63 const uint8_t *arg6_ciphertext,
64 size_t arg7_ciphertext_length,
65 uint8_t *arg8_plaintext,
66 size_t arg9_plaintext_size,
67 size_t *arg10_plaintext_length)
68{
David Horstmann436b2ef2024-01-22 14:36:01 +000069#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
70 MBEDTLS_TEST_MEMORY_POISON(arg2_nonce, arg3_nonce_length);
71 MBEDTLS_TEST_MEMORY_POISON(arg4_additional_data, arg5_additional_data_length);
72 MBEDTLS_TEST_MEMORY_POISON(arg6_ciphertext, arg7_ciphertext_length);
73 MBEDTLS_TEST_MEMORY_POISON(arg8_plaintext, arg9_plaintext_size);
74#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +010075 psa_status_t status = (psa_aead_decrypt)(arg0_key, arg1_alg, arg2_nonce, arg3_nonce_length, arg4_additional_data, arg5_additional_data_length, arg6_ciphertext, arg7_ciphertext_length, arg8_plaintext, arg9_plaintext_size, arg10_plaintext_length);
David Horstmann436b2ef2024-01-22 14:36:01 +000076#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
77 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_nonce, arg3_nonce_length);
78 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_additional_data, arg5_additional_data_length);
79 MBEDTLS_TEST_MEMORY_UNPOISON(arg6_ciphertext, arg7_ciphertext_length);
80 MBEDTLS_TEST_MEMORY_UNPOISON(arg8_plaintext, arg9_plaintext_size);
81#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +010082 return status;
83}
84
85/* Wrapper for psa_aead_encrypt */
86psa_status_t mbedtls_test_wrap_psa_aead_encrypt(
87 mbedtls_svc_key_id_t arg0_key,
88 psa_algorithm_t arg1_alg,
89 const uint8_t *arg2_nonce,
90 size_t arg3_nonce_length,
91 const uint8_t *arg4_additional_data,
92 size_t arg5_additional_data_length,
93 const uint8_t *arg6_plaintext,
94 size_t arg7_plaintext_length,
95 uint8_t *arg8_ciphertext,
96 size_t arg9_ciphertext_size,
97 size_t *arg10_ciphertext_length)
98{
David Horstmann436b2ef2024-01-22 14:36:01 +000099#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
100 MBEDTLS_TEST_MEMORY_POISON(arg2_nonce, arg3_nonce_length);
101 MBEDTLS_TEST_MEMORY_POISON(arg4_additional_data, arg5_additional_data_length);
102 MBEDTLS_TEST_MEMORY_POISON(arg6_plaintext, arg7_plaintext_length);
103 MBEDTLS_TEST_MEMORY_POISON(arg8_ciphertext, arg9_ciphertext_size);
104#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100105 psa_status_t status = (psa_aead_encrypt)(arg0_key, arg1_alg, arg2_nonce, arg3_nonce_length, arg4_additional_data, arg5_additional_data_length, arg6_plaintext, arg7_plaintext_length, arg8_ciphertext, arg9_ciphertext_size, arg10_ciphertext_length);
David Horstmann436b2ef2024-01-22 14:36:01 +0000106#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
107 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_nonce, arg3_nonce_length);
108 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_additional_data, arg5_additional_data_length);
109 MBEDTLS_TEST_MEMORY_UNPOISON(arg6_plaintext, arg7_plaintext_length);
110 MBEDTLS_TEST_MEMORY_UNPOISON(arg8_ciphertext, arg9_ciphertext_size);
111#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100112 return status;
113}
114
115/* Wrapper for psa_asymmetric_decrypt */
116psa_status_t mbedtls_test_wrap_psa_asymmetric_decrypt(
117 mbedtls_svc_key_id_t arg0_key,
118 psa_algorithm_t arg1_alg,
119 const uint8_t *arg2_input,
120 size_t arg3_input_length,
121 const uint8_t *arg4_salt,
122 size_t arg5_salt_length,
123 uint8_t *arg6_output,
124 size_t arg7_output_size,
125 size_t *arg8_output_length)
126{
127 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);
128 return status;
129}
130
131/* Wrapper for psa_asymmetric_encrypt */
132psa_status_t mbedtls_test_wrap_psa_asymmetric_encrypt(
133 mbedtls_svc_key_id_t arg0_key,
134 psa_algorithm_t arg1_alg,
135 const uint8_t *arg2_input,
136 size_t arg3_input_length,
137 const uint8_t *arg4_salt,
138 size_t arg5_salt_length,
139 uint8_t *arg6_output,
140 size_t arg7_output_size,
141 size_t *arg8_output_length)
142{
143 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);
144 return status;
145}
146
147/* Wrapper for psa_cipher_abort */
148psa_status_t mbedtls_test_wrap_psa_cipher_abort(
149 psa_cipher_operation_t *arg0_operation)
150{
151 psa_status_t status = (psa_cipher_abort)(arg0_operation);
152 return status;
153}
154
155/* Wrapper for psa_cipher_decrypt */
156psa_status_t mbedtls_test_wrap_psa_cipher_decrypt(
157 mbedtls_svc_key_id_t arg0_key,
158 psa_algorithm_t arg1_alg,
159 const uint8_t *arg2_input,
160 size_t arg3_input_length,
161 uint8_t *arg4_output,
162 size_t arg5_output_size,
163 size_t *arg6_output_length)
164{
165 psa_status_t status = (psa_cipher_decrypt)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_output, arg5_output_size, arg6_output_length);
166 return status;
167}
168
169/* Wrapper for psa_cipher_decrypt_setup */
170psa_status_t mbedtls_test_wrap_psa_cipher_decrypt_setup(
171 psa_cipher_operation_t *arg0_operation,
172 mbedtls_svc_key_id_t arg1_key,
173 psa_algorithm_t arg2_alg)
174{
175 psa_status_t status = (psa_cipher_decrypt_setup)(arg0_operation, arg1_key, arg2_alg);
176 return status;
177}
178
179/* Wrapper for psa_cipher_encrypt */
180psa_status_t mbedtls_test_wrap_psa_cipher_encrypt(
181 mbedtls_svc_key_id_t arg0_key,
182 psa_algorithm_t arg1_alg,
183 const uint8_t *arg2_input,
184 size_t arg3_input_length,
185 uint8_t *arg4_output,
186 size_t arg5_output_size,
187 size_t *arg6_output_length)
188{
Ryan Everett810421c2024-01-25 12:09:09 +0000189#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
190 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
191 MBEDTLS_TEST_MEMORY_POISON(arg4_output, arg5_output_size);
192#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100193 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 Everett810421c2024-01-25 12:09:09 +0000194#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
195 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
196 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_output, arg5_output_size);
197#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100198 return status;
199}
200
201/* Wrapper for psa_cipher_encrypt_setup */
202psa_status_t mbedtls_test_wrap_psa_cipher_encrypt_setup(
203 psa_cipher_operation_t *arg0_operation,
204 mbedtls_svc_key_id_t arg1_key,
205 psa_algorithm_t arg2_alg)
206{
207 psa_status_t status = (psa_cipher_encrypt_setup)(arg0_operation, arg1_key, arg2_alg);
208 return status;
209}
210
211/* Wrapper for psa_cipher_finish */
212psa_status_t mbedtls_test_wrap_psa_cipher_finish(
213 psa_cipher_operation_t *arg0_operation,
214 uint8_t *arg1_output,
215 size_t arg2_output_size,
216 size_t *arg3_output_length)
217{
218 psa_status_t status = (psa_cipher_finish)(arg0_operation, arg1_output, arg2_output_size, arg3_output_length);
219 return status;
220}
221
222/* Wrapper for psa_cipher_generate_iv */
223psa_status_t mbedtls_test_wrap_psa_cipher_generate_iv(
224 psa_cipher_operation_t *arg0_operation,
225 uint8_t *arg1_iv,
226 size_t arg2_iv_size,
227 size_t *arg3_iv_length)
228{
229 psa_status_t status = (psa_cipher_generate_iv)(arg0_operation, arg1_iv, arg2_iv_size, arg3_iv_length);
230 return status;
231}
232
233/* Wrapper for psa_cipher_set_iv */
234psa_status_t mbedtls_test_wrap_psa_cipher_set_iv(
235 psa_cipher_operation_t *arg0_operation,
236 const uint8_t *arg1_iv,
237 size_t arg2_iv_length)
238{
239 psa_status_t status = (psa_cipher_set_iv)(arg0_operation, arg1_iv, arg2_iv_length);
240 return status;
241}
242
243/* Wrapper for psa_cipher_update */
244psa_status_t mbedtls_test_wrap_psa_cipher_update(
245 psa_cipher_operation_t *arg0_operation,
246 const uint8_t *arg1_input,
247 size_t arg2_input_length,
248 uint8_t *arg3_output,
249 size_t arg4_output_size,
250 size_t *arg5_output_length)
251{
252 psa_status_t status = (psa_cipher_update)(arg0_operation, arg1_input, arg2_input_length, arg3_output, arg4_output_size, arg5_output_length);
253 return status;
254}
255
256/* Wrapper for psa_copy_key */
257psa_status_t mbedtls_test_wrap_psa_copy_key(
258 mbedtls_svc_key_id_t arg0_source_key,
259 const psa_key_attributes_t *arg1_attributes,
260 mbedtls_svc_key_id_t *arg2_target_key)
261{
262 psa_status_t status = (psa_copy_key)(arg0_source_key, arg1_attributes, arg2_target_key);
263 return status;
264}
265
266/* Wrapper for psa_crypto_init */
267psa_status_t mbedtls_test_wrap_psa_crypto_init(void)
268{
269 psa_status_t status = (psa_crypto_init)();
270 return status;
271}
272
273/* Wrapper for psa_destroy_key */
274psa_status_t mbedtls_test_wrap_psa_destroy_key(
275 mbedtls_svc_key_id_t arg0_key)
276{
277 psa_status_t status = (psa_destroy_key)(arg0_key);
278 return status;
279}
280
281/* Wrapper for psa_export_key */
282psa_status_t mbedtls_test_wrap_psa_export_key(
283 mbedtls_svc_key_id_t arg0_key,
284 uint8_t *arg1_data,
285 size_t arg2_data_size,
286 size_t *arg3_data_length)
287{
Ryan Everettdcbc1d32024-01-25 11:04:48 +0000288#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
289 MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_size);
290#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100291 psa_status_t status = (psa_export_key)(arg0_key, arg1_data, arg2_data_size, arg3_data_length);
Ryan Everettdcbc1d32024-01-25 11:04:48 +0000292#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
293 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_size);
294#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100295 return status;
296}
297
298/* Wrapper for psa_export_public_key */
299psa_status_t mbedtls_test_wrap_psa_export_public_key(
300 mbedtls_svc_key_id_t arg0_key,
301 uint8_t *arg1_data,
302 size_t arg2_data_size,
303 size_t *arg3_data_length)
304{
Ryan Everettdcbc1d32024-01-25 11:04:48 +0000305#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
306 MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_size);
307#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100308 psa_status_t status = (psa_export_public_key)(arg0_key, arg1_data, arg2_data_size, arg3_data_length);
Ryan Everettdcbc1d32024-01-25 11:04:48 +0000309#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
310 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_size);
311#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100312 return status;
313}
314
315/* Wrapper for psa_generate_key */
316psa_status_t mbedtls_test_wrap_psa_generate_key(
317 const psa_key_attributes_t *arg0_attributes,
318 mbedtls_svc_key_id_t *arg1_key)
319{
320 psa_status_t status = (psa_generate_key)(arg0_attributes, arg1_key);
321 return status;
322}
323
324/* Wrapper for psa_generate_random */
325psa_status_t mbedtls_test_wrap_psa_generate_random(
326 uint8_t *arg0_output,
327 size_t arg1_output_size)
328{
David Horstmann4e821502024-02-06 15:44:08 +0000329#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
330 MBEDTLS_TEST_MEMORY_POISON(arg0_output, arg1_output_size);
331#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100332 psa_status_t status = (psa_generate_random)(arg0_output, arg1_output_size);
David Horstmann4e821502024-02-06 15:44:08 +0000333#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
334 MBEDTLS_TEST_MEMORY_UNPOISON(arg0_output, arg1_output_size);
335#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100336 return status;
337}
338
339/* Wrapper for psa_get_key_attributes */
340psa_status_t mbedtls_test_wrap_psa_get_key_attributes(
341 mbedtls_svc_key_id_t arg0_key,
342 psa_key_attributes_t *arg1_attributes)
343{
344 psa_status_t status = (psa_get_key_attributes)(arg0_key, arg1_attributes);
345 return status;
346}
347
348/* Wrapper for psa_hash_abort */
349psa_status_t mbedtls_test_wrap_psa_hash_abort(
350 psa_hash_operation_t *arg0_operation)
351{
352 psa_status_t status = (psa_hash_abort)(arg0_operation);
353 return status;
354}
355
356/* Wrapper for psa_hash_clone */
357psa_status_t mbedtls_test_wrap_psa_hash_clone(
358 const psa_hash_operation_t *arg0_source_operation,
359 psa_hash_operation_t *arg1_target_operation)
360{
361 psa_status_t status = (psa_hash_clone)(arg0_source_operation, arg1_target_operation);
362 return status;
363}
364
365/* Wrapper for psa_hash_compare */
366psa_status_t mbedtls_test_wrap_psa_hash_compare(
367 psa_algorithm_t arg0_alg,
368 const uint8_t *arg1_input,
369 size_t arg2_input_length,
370 const uint8_t *arg3_hash,
371 size_t arg4_hash_length)
372{
Thomas Daubneyebf93292024-01-25 17:09:10 +0000373#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
374 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
375 MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_length);
376#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100377 psa_status_t status = (psa_hash_compare)(arg0_alg, arg1_input, arg2_input_length, arg3_hash, arg4_hash_length);
Thomas Daubneyebf93292024-01-25 17:09:10 +0000378#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
379 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
380 MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_length);
381#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100382 return status;
383}
384
385/* Wrapper for psa_hash_compute */
386psa_status_t mbedtls_test_wrap_psa_hash_compute(
387 psa_algorithm_t arg0_alg,
388 const uint8_t *arg1_input,
389 size_t arg2_input_length,
390 uint8_t *arg3_hash,
391 size_t arg4_hash_size,
392 size_t *arg5_hash_length)
393{
Thomas Daubneyebf93292024-01-25 17:09:10 +0000394#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
395 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
396 MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_size);
397#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100398 psa_status_t status = (psa_hash_compute)(arg0_alg, arg1_input, arg2_input_length, arg3_hash, arg4_hash_size, arg5_hash_length);
Thomas Daubneyebf93292024-01-25 17:09:10 +0000399#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
400 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
401 MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_size);
402#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100403 return status;
404}
405
406/* Wrapper for psa_hash_finish */
407psa_status_t mbedtls_test_wrap_psa_hash_finish(
408 psa_hash_operation_t *arg0_operation,
409 uint8_t *arg1_hash,
410 size_t arg2_hash_size,
411 size_t *arg3_hash_length)
412{
Thomas Daubneyebf93292024-01-25 17:09:10 +0000413#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
414 MBEDTLS_TEST_MEMORY_POISON(arg1_hash, arg2_hash_size);
415#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100416 psa_status_t status = (psa_hash_finish)(arg0_operation, arg1_hash, arg2_hash_size, arg3_hash_length);
Thomas Daubneyebf93292024-01-25 17:09:10 +0000417#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
418 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_hash, arg2_hash_size);
419#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100420 return status;
421}
422
423/* Wrapper for psa_hash_setup */
424psa_status_t mbedtls_test_wrap_psa_hash_setup(
425 psa_hash_operation_t *arg0_operation,
426 psa_algorithm_t arg1_alg)
427{
428 psa_status_t status = (psa_hash_setup)(arg0_operation, arg1_alg);
429 return status;
430}
431
432/* Wrapper for psa_hash_update */
433psa_status_t mbedtls_test_wrap_psa_hash_update(
434 psa_hash_operation_t *arg0_operation,
435 const uint8_t *arg1_input,
436 size_t arg2_input_length)
437{
Thomas Daubneyebf93292024-01-25 17:09:10 +0000438#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
439 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
440#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100441 psa_status_t status = (psa_hash_update)(arg0_operation, arg1_input, arg2_input_length);
Thomas Daubneyebf93292024-01-25 17:09:10 +0000442#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
443 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
444#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100445 return status;
446}
447
448/* Wrapper for psa_hash_verify */
449psa_status_t mbedtls_test_wrap_psa_hash_verify(
450 psa_hash_operation_t *arg0_operation,
451 const uint8_t *arg1_hash,
452 size_t arg2_hash_length)
453{
Thomas Daubneyebf93292024-01-25 17:09:10 +0000454#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
455 MBEDTLS_TEST_MEMORY_POISON(arg1_hash, arg2_hash_length);
456#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100457 psa_status_t status = (psa_hash_verify)(arg0_operation, arg1_hash, arg2_hash_length);
Thomas Daubneyebf93292024-01-25 17:09:10 +0000458#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
459 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_hash, arg2_hash_length);
460#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100461 return status;
462}
463
464/* Wrapper for psa_import_key */
465psa_status_t mbedtls_test_wrap_psa_import_key(
466 const psa_key_attributes_t *arg0_attributes,
467 const uint8_t *arg1_data,
468 size_t arg2_data_length,
469 mbedtls_svc_key_id_t *arg3_key)
470{
Ryan Everettdcbc1d32024-01-25 11:04:48 +0000471#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
472 MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_length);
473#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100474 psa_status_t status = (psa_import_key)(arg0_attributes, arg1_data, arg2_data_length, arg3_key);
Ryan Everettdcbc1d32024-01-25 11:04:48 +0000475#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
476 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_length);
477#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100478 return status;
479}
480
481/* Wrapper for psa_key_derivation_abort */
482psa_status_t mbedtls_test_wrap_psa_key_derivation_abort(
483 psa_key_derivation_operation_t *arg0_operation)
484{
485 psa_status_t status = (psa_key_derivation_abort)(arg0_operation);
486 return status;
487}
488
489/* Wrapper for psa_key_derivation_get_capacity */
490psa_status_t mbedtls_test_wrap_psa_key_derivation_get_capacity(
491 const psa_key_derivation_operation_t *arg0_operation,
492 size_t *arg1_capacity)
493{
494 psa_status_t status = (psa_key_derivation_get_capacity)(arg0_operation, arg1_capacity);
495 return status;
496}
497
498/* Wrapper for psa_key_derivation_input_bytes */
499psa_status_t mbedtls_test_wrap_psa_key_derivation_input_bytes(
500 psa_key_derivation_operation_t *arg0_operation,
501 psa_key_derivation_step_t arg1_step,
502 const uint8_t *arg2_data,
503 size_t arg3_data_length)
504{
Ryan Everett6c9e69d2024-02-09 16:23:25 +0000505#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
506 MBEDTLS_TEST_MEMORY_POISON(arg2_data, arg3_data_length);
507#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100508 psa_status_t status = (psa_key_derivation_input_bytes)(arg0_operation, arg1_step, arg2_data, arg3_data_length);
Ryan Everett6c9e69d2024-02-09 16:23:25 +0000509#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
510 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_data, arg3_data_length);
511#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100512 return status;
513}
514
515/* Wrapper for psa_key_derivation_input_key */
516psa_status_t mbedtls_test_wrap_psa_key_derivation_input_key(
517 psa_key_derivation_operation_t *arg0_operation,
518 psa_key_derivation_step_t arg1_step,
519 mbedtls_svc_key_id_t arg2_key)
520{
521 psa_status_t status = (psa_key_derivation_input_key)(arg0_operation, arg1_step, arg2_key);
522 return status;
523}
524
525/* Wrapper for psa_key_derivation_key_agreement */
526psa_status_t mbedtls_test_wrap_psa_key_derivation_key_agreement(
527 psa_key_derivation_operation_t *arg0_operation,
528 psa_key_derivation_step_t arg1_step,
529 mbedtls_svc_key_id_t arg2_private_key,
530 const uint8_t *arg3_peer_key,
531 size_t arg4_peer_key_length)
532{
533 psa_status_t status = (psa_key_derivation_key_agreement)(arg0_operation, arg1_step, arg2_private_key, arg3_peer_key, arg4_peer_key_length);
534 return status;
535}
536
537/* Wrapper for psa_key_derivation_output_bytes */
538psa_status_t mbedtls_test_wrap_psa_key_derivation_output_bytes(
539 psa_key_derivation_operation_t *arg0_operation,
540 uint8_t *arg1_output,
541 size_t arg2_output_length)
542{
Ryan Everett6c9e69d2024-02-09 16:23:25 +0000543#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
544 MBEDTLS_TEST_MEMORY_POISON(arg1_output, arg2_output_length);
545#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100546 psa_status_t status = (psa_key_derivation_output_bytes)(arg0_operation, arg1_output, arg2_output_length);
Ryan Everett6c9e69d2024-02-09 16:23:25 +0000547#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
548 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_output, arg2_output_length);
549#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100550 return status;
551}
552
553/* Wrapper for psa_key_derivation_output_key */
554psa_status_t mbedtls_test_wrap_psa_key_derivation_output_key(
555 const psa_key_attributes_t *arg0_attributes,
556 psa_key_derivation_operation_t *arg1_operation,
557 mbedtls_svc_key_id_t *arg2_key)
558{
559 psa_status_t status = (psa_key_derivation_output_key)(arg0_attributes, arg1_operation, arg2_key);
560 return status;
561}
562
563/* Wrapper for psa_key_derivation_set_capacity */
564psa_status_t mbedtls_test_wrap_psa_key_derivation_set_capacity(
565 psa_key_derivation_operation_t *arg0_operation,
566 size_t arg1_capacity)
567{
568 psa_status_t status = (psa_key_derivation_set_capacity)(arg0_operation, arg1_capacity);
569 return status;
570}
571
572/* Wrapper for psa_key_derivation_setup */
573psa_status_t mbedtls_test_wrap_psa_key_derivation_setup(
574 psa_key_derivation_operation_t *arg0_operation,
575 psa_algorithm_t arg1_alg)
576{
577 psa_status_t status = (psa_key_derivation_setup)(arg0_operation, arg1_alg);
578 return status;
579}
580
581/* Wrapper for psa_mac_abort */
582psa_status_t mbedtls_test_wrap_psa_mac_abort(
583 psa_mac_operation_t *arg0_operation)
584{
585 psa_status_t status = (psa_mac_abort)(arg0_operation);
586 return status;
587}
588
589/* Wrapper for psa_mac_compute */
590psa_status_t mbedtls_test_wrap_psa_mac_compute(
591 mbedtls_svc_key_id_t arg0_key,
592 psa_algorithm_t arg1_alg,
593 const uint8_t *arg2_input,
594 size_t arg3_input_length,
595 uint8_t *arg4_mac,
596 size_t arg5_mac_size,
597 size_t *arg6_mac_length)
598{
599 psa_status_t status = (psa_mac_compute)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_mac, arg5_mac_size, arg6_mac_length);
600 return status;
601}
602
603/* Wrapper for psa_mac_sign_finish */
604psa_status_t mbedtls_test_wrap_psa_mac_sign_finish(
605 psa_mac_operation_t *arg0_operation,
606 uint8_t *arg1_mac,
607 size_t arg2_mac_size,
608 size_t *arg3_mac_length)
609{
610 psa_status_t status = (psa_mac_sign_finish)(arg0_operation, arg1_mac, arg2_mac_size, arg3_mac_length);
611 return status;
612}
613
614/* Wrapper for psa_mac_sign_setup */
615psa_status_t mbedtls_test_wrap_psa_mac_sign_setup(
616 psa_mac_operation_t *arg0_operation,
617 mbedtls_svc_key_id_t arg1_key,
618 psa_algorithm_t arg2_alg)
619{
620 psa_status_t status = (psa_mac_sign_setup)(arg0_operation, arg1_key, arg2_alg);
621 return status;
622}
623
624/* Wrapper for psa_mac_update */
625psa_status_t mbedtls_test_wrap_psa_mac_update(
626 psa_mac_operation_t *arg0_operation,
627 const uint8_t *arg1_input,
628 size_t arg2_input_length)
629{
630 psa_status_t status = (psa_mac_update)(arg0_operation, arg1_input, arg2_input_length);
631 return status;
632}
633
634/* Wrapper for psa_mac_verify */
635psa_status_t mbedtls_test_wrap_psa_mac_verify(
636 mbedtls_svc_key_id_t arg0_key,
637 psa_algorithm_t arg1_alg,
638 const uint8_t *arg2_input,
639 size_t arg3_input_length,
640 const uint8_t *arg4_mac,
641 size_t arg5_mac_length)
642{
643 psa_status_t status = (psa_mac_verify)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_mac, arg5_mac_length);
644 return status;
645}
646
647/* Wrapper for psa_mac_verify_finish */
648psa_status_t mbedtls_test_wrap_psa_mac_verify_finish(
649 psa_mac_operation_t *arg0_operation,
650 const uint8_t *arg1_mac,
651 size_t arg2_mac_length)
652{
653 psa_status_t status = (psa_mac_verify_finish)(arg0_operation, arg1_mac, arg2_mac_length);
654 return status;
655}
656
657/* Wrapper for psa_mac_verify_setup */
658psa_status_t mbedtls_test_wrap_psa_mac_verify_setup(
659 psa_mac_operation_t *arg0_operation,
660 mbedtls_svc_key_id_t arg1_key,
661 psa_algorithm_t arg2_alg)
662{
663 psa_status_t status = (psa_mac_verify_setup)(arg0_operation, arg1_key, arg2_alg);
664 return status;
665}
666
667/* Wrapper for psa_purge_key */
668psa_status_t mbedtls_test_wrap_psa_purge_key(
669 mbedtls_svc_key_id_t arg0_key)
670{
671 psa_status_t status = (psa_purge_key)(arg0_key);
672 return status;
673}
674
675/* Wrapper for psa_raw_key_agreement */
676psa_status_t mbedtls_test_wrap_psa_raw_key_agreement(
677 psa_algorithm_t arg0_alg,
678 mbedtls_svc_key_id_t arg1_private_key,
679 const uint8_t *arg2_peer_key,
680 size_t arg3_peer_key_length,
681 uint8_t *arg4_output,
682 size_t arg5_output_size,
683 size_t *arg6_output_length)
684{
685 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);
686 return status;
687}
688
689/* Wrapper for psa_sign_hash */
690psa_status_t mbedtls_test_wrap_psa_sign_hash(
691 mbedtls_svc_key_id_t arg0_key,
692 psa_algorithm_t arg1_alg,
693 const uint8_t *arg2_hash,
694 size_t arg3_hash_length,
695 uint8_t *arg4_signature,
696 size_t arg5_signature_size,
697 size_t *arg6_signature_length)
698{
Thomas Daubneyc63e31a2024-01-30 13:33:14 +0000699#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
700 MBEDTLS_TEST_MEMORY_POISON(arg2_hash, arg3_hash_length);
701 MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_size);
702#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100703 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 Daubneyc63e31a2024-01-30 13:33:14 +0000704#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
705 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_hash, arg3_hash_length);
706 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_size);
707#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100708 return status;
709}
710
711/* Wrapper for psa_sign_message */
712psa_status_t mbedtls_test_wrap_psa_sign_message(
713 mbedtls_svc_key_id_t arg0_key,
714 psa_algorithm_t arg1_alg,
715 const uint8_t *arg2_input,
716 size_t arg3_input_length,
717 uint8_t *arg4_signature,
718 size_t arg5_signature_size,
719 size_t *arg6_signature_length)
720{
Thomas Daubneyc63e31a2024-01-30 13:33:14 +0000721#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
722 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
723 MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_size);
724#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100725 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 Daubneyc63e31a2024-01-30 13:33:14 +0000726#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
727 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
728 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_size);
729#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100730 return status;
731}
732
733/* Wrapper for psa_verify_hash */
734psa_status_t mbedtls_test_wrap_psa_verify_hash(
735 mbedtls_svc_key_id_t arg0_key,
736 psa_algorithm_t arg1_alg,
737 const uint8_t *arg2_hash,
738 size_t arg3_hash_length,
739 const uint8_t *arg4_signature,
740 size_t arg5_signature_length)
741{
Thomas Daubneyc63e31a2024-01-30 13:33:14 +0000742#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
743 MBEDTLS_TEST_MEMORY_POISON(arg2_hash, arg3_hash_length);
744 MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_length);
745#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100746 psa_status_t status = (psa_verify_hash)(arg0_key, arg1_alg, arg2_hash, arg3_hash_length, arg4_signature, arg5_signature_length);
Thomas Daubneyc63e31a2024-01-30 13:33:14 +0000747#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
748 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_hash, arg3_hash_length);
749 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_length);
750#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100751 return status;
752}
753
754/* Wrapper for psa_verify_message */
755psa_status_t mbedtls_test_wrap_psa_verify_message(
756 mbedtls_svc_key_id_t arg0_key,
757 psa_algorithm_t arg1_alg,
758 const uint8_t *arg2_input,
759 size_t arg3_input_length,
760 const uint8_t *arg4_signature,
761 size_t arg5_signature_length)
762{
Thomas Daubneyc63e31a2024-01-30 13:33:14 +0000763#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
764 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
765 MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_length);
766#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100767 psa_status_t status = (psa_verify_message)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_signature, arg5_signature_length);
Thomas Daubneyc63e31a2024-01-30 13:33:14 +0000768#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
769 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
770 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_length);
771#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100772 return status;
773}
774
Gilles Peskinea980aa02024-01-04 20:51:38 +0100775#endif /* defined(MBEDTLS_PSA_CRYPTO_C) && defined(MBEDTLS_TEST_HOOKS) && \
776 !defined(RECORD_PSA_STATUS_COVERAGE_LOG) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100777
778/* End of automatically generated file. */