blob: efb9f89cc1bfaca4ab54ea358c8b2938f38e8fe6 [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{
69 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);
70 return status;
71}
72
73/* Wrapper for psa_aead_encrypt */
74psa_status_t mbedtls_test_wrap_psa_aead_encrypt(
75 mbedtls_svc_key_id_t arg0_key,
76 psa_algorithm_t arg1_alg,
77 const uint8_t *arg2_nonce,
78 size_t arg3_nonce_length,
79 const uint8_t *arg4_additional_data,
80 size_t arg5_additional_data_length,
81 const uint8_t *arg6_plaintext,
82 size_t arg7_plaintext_length,
83 uint8_t *arg8_ciphertext,
84 size_t arg9_ciphertext_size,
85 size_t *arg10_ciphertext_length)
86{
87 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);
88 return status;
89}
90
91/* Wrapper for psa_asymmetric_decrypt */
92psa_status_t mbedtls_test_wrap_psa_asymmetric_decrypt(
93 mbedtls_svc_key_id_t arg0_key,
94 psa_algorithm_t arg1_alg,
95 const uint8_t *arg2_input,
96 size_t arg3_input_length,
97 const uint8_t *arg4_salt,
98 size_t arg5_salt_length,
99 uint8_t *arg6_output,
100 size_t arg7_output_size,
101 size_t *arg8_output_length)
102{
103 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);
104 return status;
105}
106
107/* Wrapper for psa_asymmetric_encrypt */
108psa_status_t mbedtls_test_wrap_psa_asymmetric_encrypt(
109 mbedtls_svc_key_id_t arg0_key,
110 psa_algorithm_t arg1_alg,
111 const uint8_t *arg2_input,
112 size_t arg3_input_length,
113 const uint8_t *arg4_salt,
114 size_t arg5_salt_length,
115 uint8_t *arg6_output,
116 size_t arg7_output_size,
117 size_t *arg8_output_length)
118{
119 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);
120 return status;
121}
122
123/* Wrapper for psa_cipher_abort */
124psa_status_t mbedtls_test_wrap_psa_cipher_abort(
125 psa_cipher_operation_t *arg0_operation)
126{
127 psa_status_t status = (psa_cipher_abort)(arg0_operation);
128 return status;
129}
130
131/* Wrapper for psa_cipher_decrypt */
132psa_status_t mbedtls_test_wrap_psa_cipher_decrypt(
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 uint8_t *arg4_output,
138 size_t arg5_output_size,
139 size_t *arg6_output_length)
140{
141 psa_status_t status = (psa_cipher_decrypt)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_output, arg5_output_size, arg6_output_length);
142 return status;
143}
144
145/* Wrapper for psa_cipher_decrypt_setup */
146psa_status_t mbedtls_test_wrap_psa_cipher_decrypt_setup(
147 psa_cipher_operation_t *arg0_operation,
148 mbedtls_svc_key_id_t arg1_key,
149 psa_algorithm_t arg2_alg)
150{
151 psa_status_t status = (psa_cipher_decrypt_setup)(arg0_operation, arg1_key, arg2_alg);
152 return status;
153}
154
155/* Wrapper for psa_cipher_encrypt */
156psa_status_t mbedtls_test_wrap_psa_cipher_encrypt(
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{
Ryan Everett810421c2024-01-25 12:09:09 +0000165#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
166 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
167 MBEDTLS_TEST_MEMORY_POISON(arg4_output, arg5_output_size);
168#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100169 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 +0000170#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
171 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
172 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_output, arg5_output_size);
173#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100174 return status;
175}
176
177/* Wrapper for psa_cipher_encrypt_setup */
178psa_status_t mbedtls_test_wrap_psa_cipher_encrypt_setup(
179 psa_cipher_operation_t *arg0_operation,
180 mbedtls_svc_key_id_t arg1_key,
181 psa_algorithm_t arg2_alg)
182{
183 psa_status_t status = (psa_cipher_encrypt_setup)(arg0_operation, arg1_key, arg2_alg);
184 return status;
185}
186
187/* Wrapper for psa_cipher_finish */
188psa_status_t mbedtls_test_wrap_psa_cipher_finish(
189 psa_cipher_operation_t *arg0_operation,
190 uint8_t *arg1_output,
191 size_t arg2_output_size,
192 size_t *arg3_output_length)
193{
194 psa_status_t status = (psa_cipher_finish)(arg0_operation, arg1_output, arg2_output_size, arg3_output_length);
195 return status;
196}
197
198/* Wrapper for psa_cipher_generate_iv */
199psa_status_t mbedtls_test_wrap_psa_cipher_generate_iv(
200 psa_cipher_operation_t *arg0_operation,
201 uint8_t *arg1_iv,
202 size_t arg2_iv_size,
203 size_t *arg3_iv_length)
204{
205 psa_status_t status = (psa_cipher_generate_iv)(arg0_operation, arg1_iv, arg2_iv_size, arg3_iv_length);
206 return status;
207}
208
209/* Wrapper for psa_cipher_set_iv */
210psa_status_t mbedtls_test_wrap_psa_cipher_set_iv(
211 psa_cipher_operation_t *arg0_operation,
212 const uint8_t *arg1_iv,
213 size_t arg2_iv_length)
214{
215 psa_status_t status = (psa_cipher_set_iv)(arg0_operation, arg1_iv, arg2_iv_length);
216 return status;
217}
218
219/* Wrapper for psa_cipher_update */
220psa_status_t mbedtls_test_wrap_psa_cipher_update(
221 psa_cipher_operation_t *arg0_operation,
222 const uint8_t *arg1_input,
223 size_t arg2_input_length,
224 uint8_t *arg3_output,
225 size_t arg4_output_size,
226 size_t *arg5_output_length)
227{
228 psa_status_t status = (psa_cipher_update)(arg0_operation, arg1_input, arg2_input_length, arg3_output, arg4_output_size, arg5_output_length);
229 return status;
230}
231
232/* Wrapper for psa_copy_key */
233psa_status_t mbedtls_test_wrap_psa_copy_key(
234 mbedtls_svc_key_id_t arg0_source_key,
235 const psa_key_attributes_t *arg1_attributes,
236 mbedtls_svc_key_id_t *arg2_target_key)
237{
238 psa_status_t status = (psa_copy_key)(arg0_source_key, arg1_attributes, arg2_target_key);
239 return status;
240}
241
242/* Wrapper for psa_crypto_init */
243psa_status_t mbedtls_test_wrap_psa_crypto_init(void)
244{
245 psa_status_t status = (psa_crypto_init)();
246 return status;
247}
248
249/* Wrapper for psa_destroy_key */
250psa_status_t mbedtls_test_wrap_psa_destroy_key(
251 mbedtls_svc_key_id_t arg0_key)
252{
253 psa_status_t status = (psa_destroy_key)(arg0_key);
254 return status;
255}
256
257/* Wrapper for psa_export_key */
258psa_status_t mbedtls_test_wrap_psa_export_key(
259 mbedtls_svc_key_id_t arg0_key,
260 uint8_t *arg1_data,
261 size_t arg2_data_size,
262 size_t *arg3_data_length)
263{
Ryan Everettdcbc1d32024-01-25 11:04:48 +0000264#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
265 MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_size);
266#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100267 psa_status_t status = (psa_export_key)(arg0_key, arg1_data, arg2_data_size, arg3_data_length);
Ryan Everettdcbc1d32024-01-25 11:04:48 +0000268#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
269 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_size);
270#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100271 return status;
272}
273
274/* Wrapper for psa_export_public_key */
275psa_status_t mbedtls_test_wrap_psa_export_public_key(
276 mbedtls_svc_key_id_t arg0_key,
277 uint8_t *arg1_data,
278 size_t arg2_data_size,
279 size_t *arg3_data_length)
280{
Ryan Everettdcbc1d32024-01-25 11:04:48 +0000281#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
282 MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_size);
283#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100284 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 +0000285#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
286 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_size);
287#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100288 return status;
289}
290
291/* Wrapper for psa_generate_key */
292psa_status_t mbedtls_test_wrap_psa_generate_key(
293 const psa_key_attributes_t *arg0_attributes,
294 mbedtls_svc_key_id_t *arg1_key)
295{
296 psa_status_t status = (psa_generate_key)(arg0_attributes, arg1_key);
297 return status;
298}
299
300/* Wrapper for psa_generate_random */
301psa_status_t mbedtls_test_wrap_psa_generate_random(
302 uint8_t *arg0_output,
303 size_t arg1_output_size)
304{
305 psa_status_t status = (psa_generate_random)(arg0_output, arg1_output_size);
306 return status;
307}
308
309/* Wrapper for psa_get_key_attributes */
310psa_status_t mbedtls_test_wrap_psa_get_key_attributes(
311 mbedtls_svc_key_id_t arg0_key,
312 psa_key_attributes_t *arg1_attributes)
313{
314 psa_status_t status = (psa_get_key_attributes)(arg0_key, arg1_attributes);
315 return status;
316}
317
318/* Wrapper for psa_hash_abort */
319psa_status_t mbedtls_test_wrap_psa_hash_abort(
320 psa_hash_operation_t *arg0_operation)
321{
322 psa_status_t status = (psa_hash_abort)(arg0_operation);
323 return status;
324}
325
326/* Wrapper for psa_hash_clone */
327psa_status_t mbedtls_test_wrap_psa_hash_clone(
328 const psa_hash_operation_t *arg0_source_operation,
329 psa_hash_operation_t *arg1_target_operation)
330{
331 psa_status_t status = (psa_hash_clone)(arg0_source_operation, arg1_target_operation);
332 return status;
333}
334
335/* Wrapper for psa_hash_compare */
336psa_status_t mbedtls_test_wrap_psa_hash_compare(
337 psa_algorithm_t arg0_alg,
338 const uint8_t *arg1_input,
339 size_t arg2_input_length,
340 const uint8_t *arg3_hash,
341 size_t arg4_hash_length)
342{
Thomas Daubneyebf93292024-01-25 17:09:10 +0000343#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
344 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
345 MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_length);
346#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100347 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 +0000348#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
349 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
350 MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_length);
351#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100352 return status;
353}
354
355/* Wrapper for psa_hash_compute */
356psa_status_t mbedtls_test_wrap_psa_hash_compute(
357 psa_algorithm_t arg0_alg,
358 const uint8_t *arg1_input,
359 size_t arg2_input_length,
360 uint8_t *arg3_hash,
361 size_t arg4_hash_size,
362 size_t *arg5_hash_length)
363{
Thomas Daubneyebf93292024-01-25 17:09:10 +0000364#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
365 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
366 MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_size);
367#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100368 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 +0000369#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
370 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
371 MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_size);
372#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100373 return status;
374}
375
376/* Wrapper for psa_hash_finish */
377psa_status_t mbedtls_test_wrap_psa_hash_finish(
378 psa_hash_operation_t *arg0_operation,
379 uint8_t *arg1_hash,
380 size_t arg2_hash_size,
381 size_t *arg3_hash_length)
382{
Thomas Daubneyebf93292024-01-25 17:09:10 +0000383#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
384 MBEDTLS_TEST_MEMORY_POISON(arg1_hash, arg2_hash_size);
385#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100386 psa_status_t status = (psa_hash_finish)(arg0_operation, arg1_hash, arg2_hash_size, arg3_hash_length);
Thomas Daubneyebf93292024-01-25 17:09:10 +0000387#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
388 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_hash, arg2_hash_size);
389#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100390 return status;
391}
392
393/* Wrapper for psa_hash_setup */
394psa_status_t mbedtls_test_wrap_psa_hash_setup(
395 psa_hash_operation_t *arg0_operation,
396 psa_algorithm_t arg1_alg)
397{
398 psa_status_t status = (psa_hash_setup)(arg0_operation, arg1_alg);
399 return status;
400}
401
402/* Wrapper for psa_hash_update */
403psa_status_t mbedtls_test_wrap_psa_hash_update(
404 psa_hash_operation_t *arg0_operation,
405 const uint8_t *arg1_input,
406 size_t arg2_input_length)
407{
Thomas Daubneyebf93292024-01-25 17:09:10 +0000408#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
409 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
410#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100411 psa_status_t status = (psa_hash_update)(arg0_operation, arg1_input, arg2_input_length);
Thomas Daubneyebf93292024-01-25 17:09:10 +0000412#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
413 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
414#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100415 return status;
416}
417
418/* Wrapper for psa_hash_verify */
419psa_status_t mbedtls_test_wrap_psa_hash_verify(
420 psa_hash_operation_t *arg0_operation,
421 const uint8_t *arg1_hash,
422 size_t arg2_hash_length)
423{
Thomas Daubneyebf93292024-01-25 17:09:10 +0000424#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
425 MBEDTLS_TEST_MEMORY_POISON(arg1_hash, arg2_hash_length);
426#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100427 psa_status_t status = (psa_hash_verify)(arg0_operation, arg1_hash, arg2_hash_length);
Thomas Daubneyebf93292024-01-25 17:09:10 +0000428#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
429 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_hash, arg2_hash_length);
430#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100431 return status;
432}
433
434/* Wrapper for psa_import_key */
435psa_status_t mbedtls_test_wrap_psa_import_key(
436 const psa_key_attributes_t *arg0_attributes,
437 const uint8_t *arg1_data,
438 size_t arg2_data_length,
439 mbedtls_svc_key_id_t *arg3_key)
440{
Ryan Everettdcbc1d32024-01-25 11:04:48 +0000441#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
442 MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_length);
443#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100444 psa_status_t status = (psa_import_key)(arg0_attributes, arg1_data, arg2_data_length, arg3_key);
Ryan Everettdcbc1d32024-01-25 11:04:48 +0000445#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
446 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_length);
447#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100448 return status;
449}
450
451/* Wrapper for psa_key_derivation_abort */
452psa_status_t mbedtls_test_wrap_psa_key_derivation_abort(
453 psa_key_derivation_operation_t *arg0_operation)
454{
455 psa_status_t status = (psa_key_derivation_abort)(arg0_operation);
456 return status;
457}
458
459/* Wrapper for psa_key_derivation_get_capacity */
460psa_status_t mbedtls_test_wrap_psa_key_derivation_get_capacity(
461 const psa_key_derivation_operation_t *arg0_operation,
462 size_t *arg1_capacity)
463{
464 psa_status_t status = (psa_key_derivation_get_capacity)(arg0_operation, arg1_capacity);
465 return status;
466}
467
468/* Wrapper for psa_key_derivation_input_bytes */
469psa_status_t mbedtls_test_wrap_psa_key_derivation_input_bytes(
470 psa_key_derivation_operation_t *arg0_operation,
471 psa_key_derivation_step_t arg1_step,
472 const uint8_t *arg2_data,
473 size_t arg3_data_length)
474{
Ryan Everett6c9e69d2024-02-09 16:23:25 +0000475#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
476 MBEDTLS_TEST_MEMORY_POISON(arg2_data, arg3_data_length);
477#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100478 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 +0000479#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
480 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_data, arg3_data_length);
481#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100482 return status;
483}
484
485/* Wrapper for psa_key_derivation_input_key */
486psa_status_t mbedtls_test_wrap_psa_key_derivation_input_key(
487 psa_key_derivation_operation_t *arg0_operation,
488 psa_key_derivation_step_t arg1_step,
489 mbedtls_svc_key_id_t arg2_key)
490{
491 psa_status_t status = (psa_key_derivation_input_key)(arg0_operation, arg1_step, arg2_key);
492 return status;
493}
494
495/* Wrapper for psa_key_derivation_key_agreement */
496psa_status_t mbedtls_test_wrap_psa_key_derivation_key_agreement(
497 psa_key_derivation_operation_t *arg0_operation,
498 psa_key_derivation_step_t arg1_step,
499 mbedtls_svc_key_id_t arg2_private_key,
500 const uint8_t *arg3_peer_key,
501 size_t arg4_peer_key_length)
502{
Thomas Daubneydb5d6072024-02-15 14:18:02 +0000503#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
504 MBEDTLS_TEST_MEMORY_POISON(arg3_peer_key, arg4_peer_key_length);
505#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100506 psa_status_t status = (psa_key_derivation_key_agreement)(arg0_operation, arg1_step, arg2_private_key, arg3_peer_key, arg4_peer_key_length);
Thomas Daubneydb5d6072024-02-15 14:18:02 +0000507#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
508 MBEDTLS_TEST_MEMORY_UNPOISON(arg3_peer_key, arg4_peer_key_length);
509#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100510 return status;
511}
512
513/* Wrapper for psa_key_derivation_output_bytes */
514psa_status_t mbedtls_test_wrap_psa_key_derivation_output_bytes(
515 psa_key_derivation_operation_t *arg0_operation,
516 uint8_t *arg1_output,
517 size_t arg2_output_length)
518{
Ryan Everett6c9e69d2024-02-09 16:23:25 +0000519#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
520 MBEDTLS_TEST_MEMORY_POISON(arg1_output, arg2_output_length);
521#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100522 psa_status_t status = (psa_key_derivation_output_bytes)(arg0_operation, arg1_output, arg2_output_length);
Ryan Everett6c9e69d2024-02-09 16:23:25 +0000523#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
524 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_output, arg2_output_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_output_key */
530psa_status_t mbedtls_test_wrap_psa_key_derivation_output_key(
531 const psa_key_attributes_t *arg0_attributes,
532 psa_key_derivation_operation_t *arg1_operation,
533 mbedtls_svc_key_id_t *arg2_key)
534{
535 psa_status_t status = (psa_key_derivation_output_key)(arg0_attributes, arg1_operation, arg2_key);
536 return status;
537}
538
539/* Wrapper for psa_key_derivation_set_capacity */
540psa_status_t mbedtls_test_wrap_psa_key_derivation_set_capacity(
541 psa_key_derivation_operation_t *arg0_operation,
542 size_t arg1_capacity)
543{
544 psa_status_t status = (psa_key_derivation_set_capacity)(arg0_operation, arg1_capacity);
545 return status;
546}
547
548/* Wrapper for psa_key_derivation_setup */
549psa_status_t mbedtls_test_wrap_psa_key_derivation_setup(
550 psa_key_derivation_operation_t *arg0_operation,
551 psa_algorithm_t arg1_alg)
552{
553 psa_status_t status = (psa_key_derivation_setup)(arg0_operation, arg1_alg);
554 return status;
555}
556
557/* Wrapper for psa_mac_abort */
558psa_status_t mbedtls_test_wrap_psa_mac_abort(
559 psa_mac_operation_t *arg0_operation)
560{
561 psa_status_t status = (psa_mac_abort)(arg0_operation);
562 return status;
563}
564
565/* Wrapper for psa_mac_compute */
566psa_status_t mbedtls_test_wrap_psa_mac_compute(
567 mbedtls_svc_key_id_t arg0_key,
568 psa_algorithm_t arg1_alg,
569 const uint8_t *arg2_input,
570 size_t arg3_input_length,
571 uint8_t *arg4_mac,
572 size_t arg5_mac_size,
573 size_t *arg6_mac_length)
574{
575 psa_status_t status = (psa_mac_compute)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_mac, arg5_mac_size, arg6_mac_length);
576 return status;
577}
578
579/* Wrapper for psa_mac_sign_finish */
580psa_status_t mbedtls_test_wrap_psa_mac_sign_finish(
581 psa_mac_operation_t *arg0_operation,
582 uint8_t *arg1_mac,
583 size_t arg2_mac_size,
584 size_t *arg3_mac_length)
585{
586 psa_status_t status = (psa_mac_sign_finish)(arg0_operation, arg1_mac, arg2_mac_size, arg3_mac_length);
587 return status;
588}
589
590/* Wrapper for psa_mac_sign_setup */
591psa_status_t mbedtls_test_wrap_psa_mac_sign_setup(
592 psa_mac_operation_t *arg0_operation,
593 mbedtls_svc_key_id_t arg1_key,
594 psa_algorithm_t arg2_alg)
595{
596 psa_status_t status = (psa_mac_sign_setup)(arg0_operation, arg1_key, arg2_alg);
597 return status;
598}
599
600/* Wrapper for psa_mac_update */
601psa_status_t mbedtls_test_wrap_psa_mac_update(
602 psa_mac_operation_t *arg0_operation,
603 const uint8_t *arg1_input,
604 size_t arg2_input_length)
605{
606 psa_status_t status = (psa_mac_update)(arg0_operation, arg1_input, arg2_input_length);
607 return status;
608}
609
610/* Wrapper for psa_mac_verify */
611psa_status_t mbedtls_test_wrap_psa_mac_verify(
612 mbedtls_svc_key_id_t arg0_key,
613 psa_algorithm_t arg1_alg,
614 const uint8_t *arg2_input,
615 size_t arg3_input_length,
616 const uint8_t *arg4_mac,
617 size_t arg5_mac_length)
618{
619 psa_status_t status = (psa_mac_verify)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_mac, arg5_mac_length);
620 return status;
621}
622
623/* Wrapper for psa_mac_verify_finish */
624psa_status_t mbedtls_test_wrap_psa_mac_verify_finish(
625 psa_mac_operation_t *arg0_operation,
626 const uint8_t *arg1_mac,
627 size_t arg2_mac_length)
628{
629 psa_status_t status = (psa_mac_verify_finish)(arg0_operation, arg1_mac, arg2_mac_length);
630 return status;
631}
632
633/* Wrapper for psa_mac_verify_setup */
634psa_status_t mbedtls_test_wrap_psa_mac_verify_setup(
635 psa_mac_operation_t *arg0_operation,
636 mbedtls_svc_key_id_t arg1_key,
637 psa_algorithm_t arg2_alg)
638{
639 psa_status_t status = (psa_mac_verify_setup)(arg0_operation, arg1_key, arg2_alg);
640 return status;
641}
642
643/* Wrapper for psa_purge_key */
644psa_status_t mbedtls_test_wrap_psa_purge_key(
645 mbedtls_svc_key_id_t arg0_key)
646{
647 psa_status_t status = (psa_purge_key)(arg0_key);
648 return status;
649}
650
651/* Wrapper for psa_raw_key_agreement */
652psa_status_t mbedtls_test_wrap_psa_raw_key_agreement(
653 psa_algorithm_t arg0_alg,
654 mbedtls_svc_key_id_t arg1_private_key,
655 const uint8_t *arg2_peer_key,
656 size_t arg3_peer_key_length,
657 uint8_t *arg4_output,
658 size_t arg5_output_size,
659 size_t *arg6_output_length)
660{
Thomas Daubneydb5d6072024-02-15 14:18:02 +0000661#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
662 MBEDTLS_TEST_MEMORY_POISON(arg2_peer_key, arg3_peer_key_length);
663 MBEDTLS_TEST_MEMORY_POISON(arg4_output, arg5_output_size);
664#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100665 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);
Thomas Daubneydb5d6072024-02-15 14:18:02 +0000666#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
667 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_peer_key, arg3_peer_key_length);
668 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_output, arg5_output_size);
669#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100670 return status;
671}
672
673/* Wrapper for psa_sign_hash */
674psa_status_t mbedtls_test_wrap_psa_sign_hash(
675 mbedtls_svc_key_id_t arg0_key,
676 psa_algorithm_t arg1_alg,
677 const uint8_t *arg2_hash,
678 size_t arg3_hash_length,
679 uint8_t *arg4_signature,
680 size_t arg5_signature_size,
681 size_t *arg6_signature_length)
682{
Thomas Daubneyc63e31a2024-01-30 13:33:14 +0000683#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
684 MBEDTLS_TEST_MEMORY_POISON(arg2_hash, arg3_hash_length);
685 MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_size);
686#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100687 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 +0000688#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
689 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_hash, arg3_hash_length);
690 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_size);
691#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100692 return status;
693}
694
695/* Wrapper for psa_sign_message */
696psa_status_t mbedtls_test_wrap_psa_sign_message(
697 mbedtls_svc_key_id_t arg0_key,
698 psa_algorithm_t arg1_alg,
699 const uint8_t *arg2_input,
700 size_t arg3_input_length,
701 uint8_t *arg4_signature,
702 size_t arg5_signature_size,
703 size_t *arg6_signature_length)
704{
Thomas Daubneyc63e31a2024-01-30 13:33:14 +0000705#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
706 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
707 MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_size);
708#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100709 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 +0000710#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
711 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
712 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_size);
713#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100714 return status;
715}
716
717/* Wrapper for psa_verify_hash */
718psa_status_t mbedtls_test_wrap_psa_verify_hash(
719 mbedtls_svc_key_id_t arg0_key,
720 psa_algorithm_t arg1_alg,
721 const uint8_t *arg2_hash,
722 size_t arg3_hash_length,
723 const uint8_t *arg4_signature,
724 size_t arg5_signature_length)
725{
Thomas Daubneyc63e31a2024-01-30 13:33:14 +0000726#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
727 MBEDTLS_TEST_MEMORY_POISON(arg2_hash, arg3_hash_length);
728 MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_length);
729#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100730 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 +0000731#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
732 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_hash, arg3_hash_length);
733 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_length);
734#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100735 return status;
736}
737
738/* Wrapper for psa_verify_message */
739psa_status_t mbedtls_test_wrap_psa_verify_message(
740 mbedtls_svc_key_id_t arg0_key,
741 psa_algorithm_t arg1_alg,
742 const uint8_t *arg2_input,
743 size_t arg3_input_length,
744 const uint8_t *arg4_signature,
745 size_t arg5_signature_length)
746{
Thomas Daubneyc63e31a2024-01-30 13:33:14 +0000747#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
748 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
749 MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_length);
750#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100751 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 +0000752#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
753 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
754 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_length);
755#endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100756 return status;
757}
758
Gilles Peskinea980aa02024-01-04 20:51:38 +0100759#endif /* defined(MBEDTLS_PSA_CRYPTO_C) && defined(MBEDTLS_TEST_HOOKS) && \
760 !defined(RECORD_PSA_STATUS_COVERAGE_LOG) */
Gilles Peskined5e5e6d2024-01-04 16:42:40 +0100761
762/* End of automatically generated file. */