blob: 032df8d28bdd6b5fe4548ed76cd4a673bb733cf2 [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{
329 psa_status_t status = (psa_generate_random)(arg0_output, arg1_output_size);
330 return status;
331}
332
333/* Wrapper for psa_get_key_attributes */
334psa_status_t mbedtls_test_wrap_psa_get_key_attributes(
335 mbedtls_svc_key_id_t arg0_key,
336 psa_key_attributes_t *arg1_attributes)
337{
338 psa_status_t status = (psa_get_key_attributes)(arg0_key, arg1_attributes);
339 return status;
340}
341
342/* Wrapper for psa_hash_abort */
343psa_status_t mbedtls_test_wrap_psa_hash_abort(
344 psa_hash_operation_t *arg0_operation)
345{
346 psa_status_t status = (psa_hash_abort)(arg0_operation);
347 return status;
348}
349
350/* Wrapper for psa_hash_clone */
351psa_status_t mbedtls_test_wrap_psa_hash_clone(
352 const psa_hash_operation_t *arg0_source_operation,
353 psa_hash_operation_t *arg1_target_operation)
354{
355 psa_status_t status = (psa_hash_clone)(arg0_source_operation, arg1_target_operation);
356 return status;
357}
358
359/* Wrapper for psa_hash_compare */
360psa_status_t mbedtls_test_wrap_psa_hash_compare(
361 psa_algorithm_t arg0_alg,
362 const uint8_t *arg1_input,
363 size_t arg2_input_length,
364 const uint8_t *arg3_hash,
365 size_t arg4_hash_length)
366{
Thomas Daubneyebf93292024-01-25 17:09:10 +0000367#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
368 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
369 MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_length);
370#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100371 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 +0000372#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
373 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
374 MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_length);
375#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100376 return status;
377}
378
379/* Wrapper for psa_hash_compute */
380psa_status_t mbedtls_test_wrap_psa_hash_compute(
381 psa_algorithm_t arg0_alg,
382 const uint8_t *arg1_input,
383 size_t arg2_input_length,
384 uint8_t *arg3_hash,
385 size_t arg4_hash_size,
386 size_t *arg5_hash_length)
387{
Thomas Daubneyebf93292024-01-25 17:09:10 +0000388#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
389 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
390 MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_size);
391#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100392 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 +0000393#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
394 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
395 MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_size);
396#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100397 return status;
398}
399
400/* Wrapper for psa_hash_finish */
401psa_status_t mbedtls_test_wrap_psa_hash_finish(
402 psa_hash_operation_t *arg0_operation,
403 uint8_t *arg1_hash,
404 size_t arg2_hash_size,
405 size_t *arg3_hash_length)
406{
Thomas Daubneyebf93292024-01-25 17:09:10 +0000407#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
408 MBEDTLS_TEST_MEMORY_POISON(arg1_hash, arg2_hash_size);
409#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100410 psa_status_t status = (psa_hash_finish)(arg0_operation, arg1_hash, arg2_hash_size, arg3_hash_length);
Thomas Daubneyebf93292024-01-25 17:09:10 +0000411#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
412 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_hash, arg2_hash_size);
413#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100414 return status;
415}
416
417/* Wrapper for psa_hash_setup */
418psa_status_t mbedtls_test_wrap_psa_hash_setup(
419 psa_hash_operation_t *arg0_operation,
420 psa_algorithm_t arg1_alg)
421{
422 psa_status_t status = (psa_hash_setup)(arg0_operation, arg1_alg);
423 return status;
424}
425
426/* Wrapper for psa_hash_update */
427psa_status_t mbedtls_test_wrap_psa_hash_update(
428 psa_hash_operation_t *arg0_operation,
429 const uint8_t *arg1_input,
430 size_t arg2_input_length)
431{
Thomas Daubneyebf93292024-01-25 17:09:10 +0000432#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
433 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
434#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100435 psa_status_t status = (psa_hash_update)(arg0_operation, arg1_input, arg2_input_length);
Thomas Daubneyebf93292024-01-25 17:09:10 +0000436#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
437 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
438#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100439 return status;
440}
441
442/* Wrapper for psa_hash_verify */
443psa_status_t mbedtls_test_wrap_psa_hash_verify(
444 psa_hash_operation_t *arg0_operation,
445 const uint8_t *arg1_hash,
446 size_t arg2_hash_length)
447{
Thomas Daubneyebf93292024-01-25 17:09:10 +0000448#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
449 MBEDTLS_TEST_MEMORY_POISON(arg1_hash, arg2_hash_length);
450#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100451 psa_status_t status = (psa_hash_verify)(arg0_operation, arg1_hash, arg2_hash_length);
Thomas Daubneyebf93292024-01-25 17:09:10 +0000452#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
453 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_hash, arg2_hash_length);
454#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100455 return status;
456}
457
458/* Wrapper for psa_import_key */
459psa_status_t mbedtls_test_wrap_psa_import_key(
460 const psa_key_attributes_t *arg0_attributes,
461 const uint8_t *arg1_data,
462 size_t arg2_data_length,
463 mbedtls_svc_key_id_t *arg3_key)
464{
Ryan Everettdcbc1d32024-01-25 11:04:48 +0000465#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
466 MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_length);
467#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100468 psa_status_t status = (psa_import_key)(arg0_attributes, arg1_data, arg2_data_length, arg3_key);
Ryan Everettdcbc1d32024-01-25 11:04:48 +0000469#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
470 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_length);
471#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100472 return status;
473}
474
475/* Wrapper for psa_key_derivation_abort */
476psa_status_t mbedtls_test_wrap_psa_key_derivation_abort(
477 psa_key_derivation_operation_t *arg0_operation)
478{
479 psa_status_t status = (psa_key_derivation_abort)(arg0_operation);
480 return status;
481}
482
483/* Wrapper for psa_key_derivation_get_capacity */
484psa_status_t mbedtls_test_wrap_psa_key_derivation_get_capacity(
485 const psa_key_derivation_operation_t *arg0_operation,
486 size_t *arg1_capacity)
487{
488 psa_status_t status = (psa_key_derivation_get_capacity)(arg0_operation, arg1_capacity);
489 return status;
490}
491
492/* Wrapper for psa_key_derivation_input_bytes */
493psa_status_t mbedtls_test_wrap_psa_key_derivation_input_bytes(
494 psa_key_derivation_operation_t *arg0_operation,
495 psa_key_derivation_step_t arg1_step,
496 const uint8_t *arg2_data,
497 size_t arg3_data_length)
498{
Ryan Everett6c9e69d2024-02-09 16:23:25 +0000499#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
500 MBEDTLS_TEST_MEMORY_POISON(arg2_data, arg3_data_length);
501#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100502 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 +0000503#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
504 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_data, arg3_data_length);
505#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100506 return status;
507}
508
509/* Wrapper for psa_key_derivation_input_key */
510psa_status_t mbedtls_test_wrap_psa_key_derivation_input_key(
511 psa_key_derivation_operation_t *arg0_operation,
512 psa_key_derivation_step_t arg1_step,
513 mbedtls_svc_key_id_t arg2_key)
514{
515 psa_status_t status = (psa_key_derivation_input_key)(arg0_operation, arg1_step, arg2_key);
516 return status;
517}
518
519/* Wrapper for psa_key_derivation_key_agreement */
520psa_status_t mbedtls_test_wrap_psa_key_derivation_key_agreement(
521 psa_key_derivation_operation_t *arg0_operation,
522 psa_key_derivation_step_t arg1_step,
523 mbedtls_svc_key_id_t arg2_private_key,
524 const uint8_t *arg3_peer_key,
525 size_t arg4_peer_key_length)
526{
527 psa_status_t status = (psa_key_derivation_key_agreement)(arg0_operation, arg1_step, arg2_private_key, arg3_peer_key, arg4_peer_key_length);
528 return status;
529}
530
531/* Wrapper for psa_key_derivation_output_bytes */
532psa_status_t mbedtls_test_wrap_psa_key_derivation_output_bytes(
533 psa_key_derivation_operation_t *arg0_operation,
534 uint8_t *arg1_output,
535 size_t arg2_output_length)
536{
Ryan Everett6c9e69d2024-02-09 16:23:25 +0000537#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
538 MBEDTLS_TEST_MEMORY_POISON(arg1_output, arg2_output_length);
539#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100540 psa_status_t status = (psa_key_derivation_output_bytes)(arg0_operation, arg1_output, arg2_output_length);
Ryan Everett6c9e69d2024-02-09 16:23:25 +0000541#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
542 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_output, arg2_output_length);
543#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100544 return status;
545}
546
547/* Wrapper for psa_key_derivation_output_key */
548psa_status_t mbedtls_test_wrap_psa_key_derivation_output_key(
549 const psa_key_attributes_t *arg0_attributes,
550 psa_key_derivation_operation_t *arg1_operation,
551 mbedtls_svc_key_id_t *arg2_key)
552{
553 psa_status_t status = (psa_key_derivation_output_key)(arg0_attributes, arg1_operation, arg2_key);
554 return status;
555}
556
557/* Wrapper for psa_key_derivation_set_capacity */
558psa_status_t mbedtls_test_wrap_psa_key_derivation_set_capacity(
559 psa_key_derivation_operation_t *arg0_operation,
560 size_t arg1_capacity)
561{
562 psa_status_t status = (psa_key_derivation_set_capacity)(arg0_operation, arg1_capacity);
563 return status;
564}
565
566/* Wrapper for psa_key_derivation_setup */
567psa_status_t mbedtls_test_wrap_psa_key_derivation_setup(
568 psa_key_derivation_operation_t *arg0_operation,
569 psa_algorithm_t arg1_alg)
570{
571 psa_status_t status = (psa_key_derivation_setup)(arg0_operation, arg1_alg);
572 return status;
573}
574
575/* Wrapper for psa_mac_abort */
576psa_status_t mbedtls_test_wrap_psa_mac_abort(
577 psa_mac_operation_t *arg0_operation)
578{
579 psa_status_t status = (psa_mac_abort)(arg0_operation);
580 return status;
581}
582
583/* Wrapper for psa_mac_compute */
584psa_status_t mbedtls_test_wrap_psa_mac_compute(
585 mbedtls_svc_key_id_t arg0_key,
586 psa_algorithm_t arg1_alg,
587 const uint8_t *arg2_input,
588 size_t arg3_input_length,
589 uint8_t *arg4_mac,
590 size_t arg5_mac_size,
591 size_t *arg6_mac_length)
592{
593 psa_status_t status = (psa_mac_compute)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_mac, arg5_mac_size, arg6_mac_length);
594 return status;
595}
596
597/* Wrapper for psa_mac_sign_finish */
598psa_status_t mbedtls_test_wrap_psa_mac_sign_finish(
599 psa_mac_operation_t *arg0_operation,
600 uint8_t *arg1_mac,
601 size_t arg2_mac_size,
602 size_t *arg3_mac_length)
603{
604 psa_status_t status = (psa_mac_sign_finish)(arg0_operation, arg1_mac, arg2_mac_size, arg3_mac_length);
605 return status;
606}
607
608/* Wrapper for psa_mac_sign_setup */
609psa_status_t mbedtls_test_wrap_psa_mac_sign_setup(
610 psa_mac_operation_t *arg0_operation,
611 mbedtls_svc_key_id_t arg1_key,
612 psa_algorithm_t arg2_alg)
613{
614 psa_status_t status = (psa_mac_sign_setup)(arg0_operation, arg1_key, arg2_alg);
615 return status;
616}
617
618/* Wrapper for psa_mac_update */
619psa_status_t mbedtls_test_wrap_psa_mac_update(
620 psa_mac_operation_t *arg0_operation,
621 const uint8_t *arg1_input,
622 size_t arg2_input_length)
623{
624 psa_status_t status = (psa_mac_update)(arg0_operation, arg1_input, arg2_input_length);
625 return status;
626}
627
628/* Wrapper for psa_mac_verify */
629psa_status_t mbedtls_test_wrap_psa_mac_verify(
630 mbedtls_svc_key_id_t arg0_key,
631 psa_algorithm_t arg1_alg,
632 const uint8_t *arg2_input,
633 size_t arg3_input_length,
634 const uint8_t *arg4_mac,
635 size_t arg5_mac_length)
636{
637 psa_status_t status = (psa_mac_verify)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_mac, arg5_mac_length);
638 return status;
639}
640
641/* Wrapper for psa_mac_verify_finish */
642psa_status_t mbedtls_test_wrap_psa_mac_verify_finish(
643 psa_mac_operation_t *arg0_operation,
644 const uint8_t *arg1_mac,
645 size_t arg2_mac_length)
646{
647 psa_status_t status = (psa_mac_verify_finish)(arg0_operation, arg1_mac, arg2_mac_length);
648 return status;
649}
650
651/* Wrapper for psa_mac_verify_setup */
652psa_status_t mbedtls_test_wrap_psa_mac_verify_setup(
653 psa_mac_operation_t *arg0_operation,
654 mbedtls_svc_key_id_t arg1_key,
655 psa_algorithm_t arg2_alg)
656{
657 psa_status_t status = (psa_mac_verify_setup)(arg0_operation, arg1_key, arg2_alg);
658 return status;
659}
660
661/* Wrapper for psa_purge_key */
662psa_status_t mbedtls_test_wrap_psa_purge_key(
663 mbedtls_svc_key_id_t arg0_key)
664{
665 psa_status_t status = (psa_purge_key)(arg0_key);
666 return status;
667}
668
669/* Wrapper for psa_raw_key_agreement */
670psa_status_t mbedtls_test_wrap_psa_raw_key_agreement(
671 psa_algorithm_t arg0_alg,
672 mbedtls_svc_key_id_t arg1_private_key,
673 const uint8_t *arg2_peer_key,
674 size_t arg3_peer_key_length,
675 uint8_t *arg4_output,
676 size_t arg5_output_size,
677 size_t *arg6_output_length)
678{
679 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);
680 return status;
681}
682
683/* Wrapper for psa_sign_hash */
684psa_status_t mbedtls_test_wrap_psa_sign_hash(
685 mbedtls_svc_key_id_t arg0_key,
686 psa_algorithm_t arg1_alg,
687 const uint8_t *arg2_hash,
688 size_t arg3_hash_length,
689 uint8_t *arg4_signature,
690 size_t arg5_signature_size,
691 size_t *arg6_signature_length)
692{
Thomas Daubneyc63e31a2024-01-30 13:33:14 +0000693#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
694 MBEDTLS_TEST_MEMORY_POISON(arg2_hash, arg3_hash_length);
695 MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_size);
696#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100697 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 +0000698#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
699 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_hash, arg3_hash_length);
700 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_size);
701#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100702 return status;
703}
704
705/* Wrapper for psa_sign_message */
706psa_status_t mbedtls_test_wrap_psa_sign_message(
707 mbedtls_svc_key_id_t arg0_key,
708 psa_algorithm_t arg1_alg,
709 const uint8_t *arg2_input,
710 size_t arg3_input_length,
711 uint8_t *arg4_signature,
712 size_t arg5_signature_size,
713 size_t *arg6_signature_length)
714{
Thomas Daubneyc63e31a2024-01-30 13:33:14 +0000715#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
716 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
717 MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_size);
718#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100719 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 +0000720#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
721 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
722 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_size);
723#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100724 return status;
725}
726
727/* Wrapper for psa_verify_hash */
728psa_status_t mbedtls_test_wrap_psa_verify_hash(
729 mbedtls_svc_key_id_t arg0_key,
730 psa_algorithm_t arg1_alg,
731 const uint8_t *arg2_hash,
732 size_t arg3_hash_length,
733 const uint8_t *arg4_signature,
734 size_t arg5_signature_length)
735{
Thomas Daubneyc63e31a2024-01-30 13:33:14 +0000736#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
737 MBEDTLS_TEST_MEMORY_POISON(arg2_hash, arg3_hash_length);
738 MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_length);
739#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100740 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 +0000741#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
742 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_hash, arg3_hash_length);
743 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_length);
744#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100745 return status;
746}
747
748/* Wrapper for psa_verify_message */
749psa_status_t mbedtls_test_wrap_psa_verify_message(
750 mbedtls_svc_key_id_t arg0_key,
751 psa_algorithm_t arg1_alg,
752 const uint8_t *arg2_input,
753 size_t arg3_input_length,
754 const uint8_t *arg4_signature,
755 size_t arg5_signature_length)
756{
Thomas Daubneyc63e31a2024-01-30 13:33:14 +0000757#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
758 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
759 MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_length);
760#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100761 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 +0000762#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
763 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
764 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_length);
765#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100766 return status;
767}
768
Gilles Peskinea980aa02024-01-04 20:51:38 +0100769#endif /* defined(MBEDTLS_PSA_CRYPTO_C) && defined(MBEDTLS_TEST_HOOKS) && \
770 !defined(RECORD_PSA_STATUS_COVERAGE_LOG) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100771
772/* End of automatically generated file. */