blob: ff2a1d25f4144ca790d5e6a164fc46ab6f9adcf1 [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{
Thomas Daubney2b614f92024-01-31 16:57:30 +0000127#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
128 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
129 MBEDTLS_TEST_MEMORY_POISON(arg4_salt, arg5_salt_length);
130 MBEDTLS_TEST_MEMORY_POISON(arg6_output, arg7_output_size);
131#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100132 psa_status_t status = (psa_asymmetric_decrypt)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_salt, arg5_salt_length, arg6_output, arg7_output_size, arg8_output_length);
Thomas Daubney2b614f92024-01-31 16:57:30 +0000133#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
134 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
135 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_salt, arg5_salt_length);
136 MBEDTLS_TEST_MEMORY_UNPOISON(arg6_output, arg7_output_size);
137#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100138 return status;
139}
140
141/* Wrapper for psa_asymmetric_encrypt */
142psa_status_t mbedtls_test_wrap_psa_asymmetric_encrypt(
143 mbedtls_svc_key_id_t arg0_key,
144 psa_algorithm_t arg1_alg,
145 const uint8_t *arg2_input,
146 size_t arg3_input_length,
147 const uint8_t *arg4_salt,
148 size_t arg5_salt_length,
149 uint8_t *arg6_output,
150 size_t arg7_output_size,
151 size_t *arg8_output_length)
152{
Thomas Daubneyd8adccf2024-01-30 14:41:05 +0000153#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
154 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
155 MBEDTLS_TEST_MEMORY_POISON(arg4_salt, arg5_salt_length);
156 MBEDTLS_TEST_MEMORY_POISON(arg6_output, arg7_output_size);
157#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100158 psa_status_t status = (psa_asymmetric_encrypt)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_salt, arg5_salt_length, arg6_output, arg7_output_size, arg8_output_length);
Thomas Daubneyd8adccf2024-01-30 14:41:05 +0000159#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
160 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
161 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_salt, arg5_salt_length);
162 MBEDTLS_TEST_MEMORY_UNPOISON(arg6_output, arg7_output_size);
163#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100164 return status;
165}
166
167/* Wrapper for psa_cipher_abort */
168psa_status_t mbedtls_test_wrap_psa_cipher_abort(
169 psa_cipher_operation_t *arg0_operation)
170{
171 psa_status_t status = (psa_cipher_abort)(arg0_operation);
172 return status;
173}
174
175/* Wrapper for psa_cipher_decrypt */
176psa_status_t mbedtls_test_wrap_psa_cipher_decrypt(
177 mbedtls_svc_key_id_t arg0_key,
178 psa_algorithm_t arg1_alg,
179 const uint8_t *arg2_input,
180 size_t arg3_input_length,
181 uint8_t *arg4_output,
182 size_t arg5_output_size,
183 size_t *arg6_output_length)
184{
Gabor Mezei143864c2024-01-24 16:58:40 +0100185#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
186 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
187 MBEDTLS_TEST_MEMORY_POISON(arg4_output, arg5_output_size);
188#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100189 psa_status_t status = (psa_cipher_decrypt)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_output, arg5_output_size, arg6_output_length);
Gabor Mezei143864c2024-01-24 16:58:40 +0100190#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
191 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
192 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_output, arg5_output_size);
193#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100194 return status;
195}
196
197/* Wrapper for psa_cipher_decrypt_setup */
198psa_status_t mbedtls_test_wrap_psa_cipher_decrypt_setup(
199 psa_cipher_operation_t *arg0_operation,
200 mbedtls_svc_key_id_t arg1_key,
201 psa_algorithm_t arg2_alg)
202{
203 psa_status_t status = (psa_cipher_decrypt_setup)(arg0_operation, arg1_key, arg2_alg);
204 return status;
205}
206
207/* Wrapper for psa_cipher_encrypt */
208psa_status_t mbedtls_test_wrap_psa_cipher_encrypt(
209 mbedtls_svc_key_id_t arg0_key,
210 psa_algorithm_t arg1_alg,
211 const uint8_t *arg2_input,
212 size_t arg3_input_length,
213 uint8_t *arg4_output,
214 size_t arg5_output_size,
215 size_t *arg6_output_length)
216{
Ryan Everett810421c2024-01-25 12:09:09 +0000217#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
218 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
219 MBEDTLS_TEST_MEMORY_POISON(arg4_output, arg5_output_size);
220#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100221 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 +0000222#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
223 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
224 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_output, arg5_output_size);
225#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100226 return status;
227}
228
229/* Wrapper for psa_cipher_encrypt_setup */
230psa_status_t mbedtls_test_wrap_psa_cipher_encrypt_setup(
231 psa_cipher_operation_t *arg0_operation,
232 mbedtls_svc_key_id_t arg1_key,
233 psa_algorithm_t arg2_alg)
234{
235 psa_status_t status = (psa_cipher_encrypt_setup)(arg0_operation, arg1_key, arg2_alg);
236 return status;
237}
238
239/* Wrapper for psa_cipher_finish */
240psa_status_t mbedtls_test_wrap_psa_cipher_finish(
241 psa_cipher_operation_t *arg0_operation,
242 uint8_t *arg1_output,
243 size_t arg2_output_size,
244 size_t *arg3_output_length)
245{
Gabor Mezei143864c2024-01-24 16:58:40 +0100246#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
247 MBEDTLS_TEST_MEMORY_POISON(arg1_output, arg2_output_size);
248#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100249 psa_status_t status = (psa_cipher_finish)(arg0_operation, arg1_output, arg2_output_size, arg3_output_length);
Gabor Mezei143864c2024-01-24 16:58:40 +0100250#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
251 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_output, arg2_output_size);
252#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100253 return status;
254}
255
256/* Wrapper for psa_cipher_generate_iv */
257psa_status_t mbedtls_test_wrap_psa_cipher_generate_iv(
258 psa_cipher_operation_t *arg0_operation,
259 uint8_t *arg1_iv,
260 size_t arg2_iv_size,
261 size_t *arg3_iv_length)
262{
Gabor Mezei50bcca22024-02-01 10:39:56 +0100263#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
264 MBEDTLS_TEST_MEMORY_POISON(arg1_iv, arg2_iv_size);
265#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100266 psa_status_t status = (psa_cipher_generate_iv)(arg0_operation, arg1_iv, arg2_iv_size, arg3_iv_length);
Gabor Mezei50bcca22024-02-01 10:39:56 +0100267#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
268 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_iv, arg2_iv_size);
269#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100270 return status;
271}
272
273/* Wrapper for psa_cipher_set_iv */
274psa_status_t mbedtls_test_wrap_psa_cipher_set_iv(
275 psa_cipher_operation_t *arg0_operation,
276 const uint8_t *arg1_iv,
277 size_t arg2_iv_length)
278{
Gabor Mezei50bcca22024-02-01 10:39:56 +0100279#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
280 MBEDTLS_TEST_MEMORY_POISON(arg1_iv, arg2_iv_length);
281#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100282 psa_status_t status = (psa_cipher_set_iv)(arg0_operation, arg1_iv, arg2_iv_length);
Gabor Mezei50bcca22024-02-01 10:39:56 +0100283#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
284 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_iv, arg2_iv_length);
285#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100286 return status;
287}
288
289/* Wrapper for psa_cipher_update */
290psa_status_t mbedtls_test_wrap_psa_cipher_update(
291 psa_cipher_operation_t *arg0_operation,
292 const uint8_t *arg1_input,
293 size_t arg2_input_length,
294 uint8_t *arg3_output,
295 size_t arg4_output_size,
296 size_t *arg5_output_length)
297{
Gabor Mezei143864c2024-01-24 16:58:40 +0100298#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
299 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
300 MBEDTLS_TEST_MEMORY_POISON(arg3_output, arg4_output_size);
301#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100302 psa_status_t status = (psa_cipher_update)(arg0_operation, arg1_input, arg2_input_length, arg3_output, arg4_output_size, arg5_output_length);
Gabor Mezei143864c2024-01-24 16:58:40 +0100303#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
304 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
305 MBEDTLS_TEST_MEMORY_UNPOISON(arg3_output, arg4_output_size);
306#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100307 return status;
308}
309
310/* Wrapper for psa_copy_key */
311psa_status_t mbedtls_test_wrap_psa_copy_key(
312 mbedtls_svc_key_id_t arg0_source_key,
313 const psa_key_attributes_t *arg1_attributes,
314 mbedtls_svc_key_id_t *arg2_target_key)
315{
316 psa_status_t status = (psa_copy_key)(arg0_source_key, arg1_attributes, arg2_target_key);
317 return status;
318}
319
320/* Wrapper for psa_crypto_init */
321psa_status_t mbedtls_test_wrap_psa_crypto_init(void)
322{
323 psa_status_t status = (psa_crypto_init)();
324 return status;
325}
326
327/* Wrapper for psa_destroy_key */
328psa_status_t mbedtls_test_wrap_psa_destroy_key(
329 mbedtls_svc_key_id_t arg0_key)
330{
331 psa_status_t status = (psa_destroy_key)(arg0_key);
332 return status;
333}
334
335/* Wrapper for psa_export_key */
336psa_status_t mbedtls_test_wrap_psa_export_key(
337 mbedtls_svc_key_id_t arg0_key,
338 uint8_t *arg1_data,
339 size_t arg2_data_size,
340 size_t *arg3_data_length)
341{
Ryan Everettdcbc1d32024-01-25 11:04:48 +0000342#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
343 MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_size);
344#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100345 psa_status_t status = (psa_export_key)(arg0_key, arg1_data, arg2_data_size, arg3_data_length);
Ryan Everettdcbc1d32024-01-25 11:04:48 +0000346#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
347 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_size);
348#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100349 return status;
350}
351
352/* Wrapper for psa_export_public_key */
353psa_status_t mbedtls_test_wrap_psa_export_public_key(
354 mbedtls_svc_key_id_t arg0_key,
355 uint8_t *arg1_data,
356 size_t arg2_data_size,
357 size_t *arg3_data_length)
358{
Ryan Everettdcbc1d32024-01-25 11:04:48 +0000359#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
360 MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_size);
361#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100362 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 +0000363#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
364 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_size);
365#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100366 return status;
367}
368
369/* Wrapper for psa_generate_key */
370psa_status_t mbedtls_test_wrap_psa_generate_key(
371 const psa_key_attributes_t *arg0_attributes,
372 mbedtls_svc_key_id_t *arg1_key)
373{
374 psa_status_t status = (psa_generate_key)(arg0_attributes, arg1_key);
375 return status;
376}
377
378/* Wrapper for psa_generate_random */
379psa_status_t mbedtls_test_wrap_psa_generate_random(
380 uint8_t *arg0_output,
381 size_t arg1_output_size)
382{
383 psa_status_t status = (psa_generate_random)(arg0_output, arg1_output_size);
384 return status;
385}
386
387/* Wrapper for psa_get_key_attributes */
388psa_status_t mbedtls_test_wrap_psa_get_key_attributes(
389 mbedtls_svc_key_id_t arg0_key,
390 psa_key_attributes_t *arg1_attributes)
391{
392 psa_status_t status = (psa_get_key_attributes)(arg0_key, arg1_attributes);
393 return status;
394}
395
396/* Wrapper for psa_hash_abort */
397psa_status_t mbedtls_test_wrap_psa_hash_abort(
398 psa_hash_operation_t *arg0_operation)
399{
400 psa_status_t status = (psa_hash_abort)(arg0_operation);
401 return status;
402}
403
404/* Wrapper for psa_hash_clone */
405psa_status_t mbedtls_test_wrap_psa_hash_clone(
406 const psa_hash_operation_t *arg0_source_operation,
407 psa_hash_operation_t *arg1_target_operation)
408{
409 psa_status_t status = (psa_hash_clone)(arg0_source_operation, arg1_target_operation);
410 return status;
411}
412
413/* Wrapper for psa_hash_compare */
414psa_status_t mbedtls_test_wrap_psa_hash_compare(
415 psa_algorithm_t arg0_alg,
416 const uint8_t *arg1_input,
417 size_t arg2_input_length,
418 const uint8_t *arg3_hash,
419 size_t arg4_hash_length)
420{
Thomas Daubneyebf93292024-01-25 17:09:10 +0000421#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
422 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
423 MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_length);
424#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100425 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 +0000426#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
427 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
428 MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_length);
429#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100430 return status;
431}
432
433/* Wrapper for psa_hash_compute */
434psa_status_t mbedtls_test_wrap_psa_hash_compute(
435 psa_algorithm_t arg0_alg,
436 const uint8_t *arg1_input,
437 size_t arg2_input_length,
438 uint8_t *arg3_hash,
439 size_t arg4_hash_size,
440 size_t *arg5_hash_length)
441{
Thomas Daubneyebf93292024-01-25 17:09:10 +0000442#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
443 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
444 MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_size);
445#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100446 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 +0000447#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
448 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
449 MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_size);
450#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100451 return status;
452}
453
454/* Wrapper for psa_hash_finish */
455psa_status_t mbedtls_test_wrap_psa_hash_finish(
456 psa_hash_operation_t *arg0_operation,
457 uint8_t *arg1_hash,
458 size_t arg2_hash_size,
459 size_t *arg3_hash_length)
460{
Thomas Daubneyebf93292024-01-25 17:09:10 +0000461#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
462 MBEDTLS_TEST_MEMORY_POISON(arg1_hash, arg2_hash_size);
463#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100464 psa_status_t status = (psa_hash_finish)(arg0_operation, arg1_hash, arg2_hash_size, arg3_hash_length);
Thomas Daubneyebf93292024-01-25 17:09:10 +0000465#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
466 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_hash, arg2_hash_size);
467#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100468 return status;
469}
470
471/* Wrapper for psa_hash_setup */
472psa_status_t mbedtls_test_wrap_psa_hash_setup(
473 psa_hash_operation_t *arg0_operation,
474 psa_algorithm_t arg1_alg)
475{
476 psa_status_t status = (psa_hash_setup)(arg0_operation, arg1_alg);
477 return status;
478}
479
480/* Wrapper for psa_hash_update */
481psa_status_t mbedtls_test_wrap_psa_hash_update(
482 psa_hash_operation_t *arg0_operation,
483 const uint8_t *arg1_input,
484 size_t arg2_input_length)
485{
Thomas Daubneyebf93292024-01-25 17:09:10 +0000486#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
487 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
488#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100489 psa_status_t status = (psa_hash_update)(arg0_operation, arg1_input, arg2_input_length);
Thomas Daubneyebf93292024-01-25 17:09:10 +0000490#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
491 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
492#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100493 return status;
494}
495
496/* Wrapper for psa_hash_verify */
497psa_status_t mbedtls_test_wrap_psa_hash_verify(
498 psa_hash_operation_t *arg0_operation,
499 const uint8_t *arg1_hash,
500 size_t arg2_hash_length)
501{
Thomas Daubneyebf93292024-01-25 17:09:10 +0000502#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
503 MBEDTLS_TEST_MEMORY_POISON(arg1_hash, arg2_hash_length);
504#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100505 psa_status_t status = (psa_hash_verify)(arg0_operation, arg1_hash, arg2_hash_length);
Thomas Daubneyebf93292024-01-25 17:09:10 +0000506#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
507 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_hash, arg2_hash_length);
508#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100509 return status;
510}
511
512/* Wrapper for psa_import_key */
513psa_status_t mbedtls_test_wrap_psa_import_key(
514 const psa_key_attributes_t *arg0_attributes,
515 const uint8_t *arg1_data,
516 size_t arg2_data_length,
517 mbedtls_svc_key_id_t *arg3_key)
518{
Ryan Everettdcbc1d32024-01-25 11:04:48 +0000519#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
520 MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_length);
521#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100522 psa_status_t status = (psa_import_key)(arg0_attributes, arg1_data, arg2_data_length, arg3_key);
Ryan Everettdcbc1d32024-01-25 11:04:48 +0000523#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
524 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_length);
525#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100526 return status;
527}
528
529/* Wrapper for psa_key_derivation_abort */
530psa_status_t mbedtls_test_wrap_psa_key_derivation_abort(
531 psa_key_derivation_operation_t *arg0_operation)
532{
533 psa_status_t status = (psa_key_derivation_abort)(arg0_operation);
534 return status;
535}
536
537/* Wrapper for psa_key_derivation_get_capacity */
538psa_status_t mbedtls_test_wrap_psa_key_derivation_get_capacity(
539 const psa_key_derivation_operation_t *arg0_operation,
540 size_t *arg1_capacity)
541{
542 psa_status_t status = (psa_key_derivation_get_capacity)(arg0_operation, arg1_capacity);
543 return status;
544}
545
546/* Wrapper for psa_key_derivation_input_bytes */
547psa_status_t mbedtls_test_wrap_psa_key_derivation_input_bytes(
548 psa_key_derivation_operation_t *arg0_operation,
549 psa_key_derivation_step_t arg1_step,
550 const uint8_t *arg2_data,
551 size_t arg3_data_length)
552{
Ryan Everett6c9e69d2024-02-09 16:23:25 +0000553#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
554 MBEDTLS_TEST_MEMORY_POISON(arg2_data, arg3_data_length);
555#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100556 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 +0000557#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
558 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_data, arg3_data_length);
559#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100560 return status;
561}
562
563/* Wrapper for psa_key_derivation_input_key */
564psa_status_t mbedtls_test_wrap_psa_key_derivation_input_key(
565 psa_key_derivation_operation_t *arg0_operation,
566 psa_key_derivation_step_t arg1_step,
567 mbedtls_svc_key_id_t arg2_key)
568{
569 psa_status_t status = (psa_key_derivation_input_key)(arg0_operation, arg1_step, arg2_key);
570 return status;
571}
572
573/* Wrapper for psa_key_derivation_key_agreement */
574psa_status_t mbedtls_test_wrap_psa_key_derivation_key_agreement(
575 psa_key_derivation_operation_t *arg0_operation,
576 psa_key_derivation_step_t arg1_step,
577 mbedtls_svc_key_id_t arg2_private_key,
578 const uint8_t *arg3_peer_key,
579 size_t arg4_peer_key_length)
580{
581 psa_status_t status = (psa_key_derivation_key_agreement)(arg0_operation, arg1_step, arg2_private_key, arg3_peer_key, arg4_peer_key_length);
582 return status;
583}
584
585/* Wrapper for psa_key_derivation_output_bytes */
586psa_status_t mbedtls_test_wrap_psa_key_derivation_output_bytes(
587 psa_key_derivation_operation_t *arg0_operation,
588 uint8_t *arg1_output,
589 size_t arg2_output_length)
590{
Ryan Everett6c9e69d2024-02-09 16:23:25 +0000591#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
592 MBEDTLS_TEST_MEMORY_POISON(arg1_output, arg2_output_length);
593#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100594 psa_status_t status = (psa_key_derivation_output_bytes)(arg0_operation, arg1_output, arg2_output_length);
Ryan Everett6c9e69d2024-02-09 16:23:25 +0000595#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
596 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_output, arg2_output_length);
597#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100598 return status;
599}
600
601/* Wrapper for psa_key_derivation_output_key */
602psa_status_t mbedtls_test_wrap_psa_key_derivation_output_key(
603 const psa_key_attributes_t *arg0_attributes,
604 psa_key_derivation_operation_t *arg1_operation,
605 mbedtls_svc_key_id_t *arg2_key)
606{
607 psa_status_t status = (psa_key_derivation_output_key)(arg0_attributes, arg1_operation, arg2_key);
608 return status;
609}
610
611/* Wrapper for psa_key_derivation_set_capacity */
612psa_status_t mbedtls_test_wrap_psa_key_derivation_set_capacity(
613 psa_key_derivation_operation_t *arg0_operation,
614 size_t arg1_capacity)
615{
616 psa_status_t status = (psa_key_derivation_set_capacity)(arg0_operation, arg1_capacity);
617 return status;
618}
619
620/* Wrapper for psa_key_derivation_setup */
621psa_status_t mbedtls_test_wrap_psa_key_derivation_setup(
622 psa_key_derivation_operation_t *arg0_operation,
623 psa_algorithm_t arg1_alg)
624{
625 psa_status_t status = (psa_key_derivation_setup)(arg0_operation, arg1_alg);
626 return status;
627}
628
629/* Wrapper for psa_mac_abort */
630psa_status_t mbedtls_test_wrap_psa_mac_abort(
631 psa_mac_operation_t *arg0_operation)
632{
633 psa_status_t status = (psa_mac_abort)(arg0_operation);
634 return status;
635}
636
637/* Wrapper for psa_mac_compute */
638psa_status_t mbedtls_test_wrap_psa_mac_compute(
639 mbedtls_svc_key_id_t arg0_key,
640 psa_algorithm_t arg1_alg,
641 const uint8_t *arg2_input,
642 size_t arg3_input_length,
643 uint8_t *arg4_mac,
644 size_t arg5_mac_size,
645 size_t *arg6_mac_length)
646{
Thomas Daubney6b915032024-01-30 12:07:38 +0000647#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
648 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
649 MBEDTLS_TEST_MEMORY_POISON(arg4_mac, arg5_mac_size);
650#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100651 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 Daubney6b915032024-01-30 12:07:38 +0000652#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
653 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
654 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_mac, arg5_mac_size);
655#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100656 return status;
657}
658
659/* Wrapper for psa_mac_sign_finish */
660psa_status_t mbedtls_test_wrap_psa_mac_sign_finish(
661 psa_mac_operation_t *arg0_operation,
662 uint8_t *arg1_mac,
663 size_t arg2_mac_size,
664 size_t *arg3_mac_length)
665{
Thomas Daubney6b915032024-01-30 12:07:38 +0000666#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
667 MBEDTLS_TEST_MEMORY_POISON(arg1_mac, arg2_mac_size);
668#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100669 psa_status_t status = (psa_mac_sign_finish)(arg0_operation, arg1_mac, arg2_mac_size, arg3_mac_length);
Thomas Daubney6b915032024-01-30 12:07:38 +0000670#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
671 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_mac, arg2_mac_size);
672#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100673 return status;
674}
675
676/* Wrapper for psa_mac_sign_setup */
677psa_status_t mbedtls_test_wrap_psa_mac_sign_setup(
678 psa_mac_operation_t *arg0_operation,
679 mbedtls_svc_key_id_t arg1_key,
680 psa_algorithm_t arg2_alg)
681{
682 psa_status_t status = (psa_mac_sign_setup)(arg0_operation, arg1_key, arg2_alg);
683 return status;
684}
685
686/* Wrapper for psa_mac_update */
687psa_status_t mbedtls_test_wrap_psa_mac_update(
688 psa_mac_operation_t *arg0_operation,
689 const uint8_t *arg1_input,
690 size_t arg2_input_length)
691{
Thomas Daubney6b915032024-01-30 12:07:38 +0000692#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
693 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
694#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100695 psa_status_t status = (psa_mac_update)(arg0_operation, arg1_input, arg2_input_length);
Thomas Daubney6b915032024-01-30 12:07:38 +0000696#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
697 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
698#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100699 return status;
700}
701
702/* Wrapper for psa_mac_verify */
703psa_status_t mbedtls_test_wrap_psa_mac_verify(
704 mbedtls_svc_key_id_t arg0_key,
705 psa_algorithm_t arg1_alg,
706 const uint8_t *arg2_input,
707 size_t arg3_input_length,
708 const uint8_t *arg4_mac,
709 size_t arg5_mac_length)
710{
Thomas Daubney6b915032024-01-30 12:07:38 +0000711#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
712 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
713 MBEDTLS_TEST_MEMORY_POISON(arg4_mac, arg5_mac_length);
714#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100715 psa_status_t status = (psa_mac_verify)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_mac, arg5_mac_length);
Thomas Daubney6b915032024-01-30 12:07:38 +0000716#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
717 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
718 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_mac, arg5_mac_length);
719#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100720 return status;
721}
722
723/* Wrapper for psa_mac_verify_finish */
724psa_status_t mbedtls_test_wrap_psa_mac_verify_finish(
725 psa_mac_operation_t *arg0_operation,
726 const uint8_t *arg1_mac,
727 size_t arg2_mac_length)
728{
Thomas Daubney6b915032024-01-30 12:07:38 +0000729#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
730 MBEDTLS_TEST_MEMORY_POISON(arg1_mac, arg2_mac_length);
731#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100732 psa_status_t status = (psa_mac_verify_finish)(arg0_operation, arg1_mac, arg2_mac_length);
Thomas Daubney6b915032024-01-30 12:07:38 +0000733#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
734 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_mac, arg2_mac_length);
735#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100736 return status;
737}
738
739/* Wrapper for psa_mac_verify_setup */
740psa_status_t mbedtls_test_wrap_psa_mac_verify_setup(
741 psa_mac_operation_t *arg0_operation,
742 mbedtls_svc_key_id_t arg1_key,
743 psa_algorithm_t arg2_alg)
744{
745 psa_status_t status = (psa_mac_verify_setup)(arg0_operation, arg1_key, arg2_alg);
746 return status;
747}
748
749/* Wrapper for psa_purge_key */
750psa_status_t mbedtls_test_wrap_psa_purge_key(
751 mbedtls_svc_key_id_t arg0_key)
752{
753 psa_status_t status = (psa_purge_key)(arg0_key);
754 return status;
755}
756
757/* Wrapper for psa_raw_key_agreement */
758psa_status_t mbedtls_test_wrap_psa_raw_key_agreement(
759 psa_algorithm_t arg0_alg,
760 mbedtls_svc_key_id_t arg1_private_key,
761 const uint8_t *arg2_peer_key,
762 size_t arg3_peer_key_length,
763 uint8_t *arg4_output,
764 size_t arg5_output_size,
765 size_t *arg6_output_length)
766{
767 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);
768 return status;
769}
770
771/* Wrapper for psa_sign_hash */
772psa_status_t mbedtls_test_wrap_psa_sign_hash(
773 mbedtls_svc_key_id_t arg0_key,
774 psa_algorithm_t arg1_alg,
775 const uint8_t *arg2_hash,
776 size_t arg3_hash_length,
777 uint8_t *arg4_signature,
778 size_t arg5_signature_size,
779 size_t *arg6_signature_length)
780{
Thomas Daubneyc63e31a2024-01-30 13:33:14 +0000781#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
782 MBEDTLS_TEST_MEMORY_POISON(arg2_hash, arg3_hash_length);
783 MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_size);
784#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100785 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 +0000786#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
787 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_hash, arg3_hash_length);
788 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_size);
789#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100790 return status;
791}
792
793/* Wrapper for psa_sign_message */
794psa_status_t mbedtls_test_wrap_psa_sign_message(
795 mbedtls_svc_key_id_t arg0_key,
796 psa_algorithm_t arg1_alg,
797 const uint8_t *arg2_input,
798 size_t arg3_input_length,
799 uint8_t *arg4_signature,
800 size_t arg5_signature_size,
801 size_t *arg6_signature_length)
802{
Thomas Daubneyc63e31a2024-01-30 13:33:14 +0000803#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
804 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
805 MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_size);
806#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100807 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 +0000808#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
809 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
810 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_size);
811#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100812 return status;
813}
814
815/* Wrapper for psa_verify_hash */
816psa_status_t mbedtls_test_wrap_psa_verify_hash(
817 mbedtls_svc_key_id_t arg0_key,
818 psa_algorithm_t arg1_alg,
819 const uint8_t *arg2_hash,
820 size_t arg3_hash_length,
821 const uint8_t *arg4_signature,
822 size_t arg5_signature_length)
823{
Thomas Daubneyc63e31a2024-01-30 13:33:14 +0000824#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
825 MBEDTLS_TEST_MEMORY_POISON(arg2_hash, arg3_hash_length);
826 MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_length);
827#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100828 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 +0000829#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
830 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_hash, arg3_hash_length);
831 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_length);
832#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100833 return status;
834}
835
836/* Wrapper for psa_verify_message */
837psa_status_t mbedtls_test_wrap_psa_verify_message(
838 mbedtls_svc_key_id_t arg0_key,
839 psa_algorithm_t arg1_alg,
840 const uint8_t *arg2_input,
841 size_t arg3_input_length,
842 const uint8_t *arg4_signature,
843 size_t arg5_signature_length)
844{
Thomas Daubneyc63e31a2024-01-30 13:33:14 +0000845#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
846 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
847 MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_length);
848#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100849 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 +0000850#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
851 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
852 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_length);
853#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100854 return status;
855}
856
Gilles Peskinea980aa02024-01-04 20:51:38 +0100857#endif /* defined(MBEDTLS_PSA_CRYPTO_C) && defined(MBEDTLS_TEST_HOOKS) && \
858 !defined(RECORD_PSA_STATUS_COVERAGE_LOG) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100859
860/* End of automatically generated file. */