blob: 47d73da9d3c7ca3198d1cbbd76dfaf65b3405dc1 [file] [log] [blame]
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001/* Automatically generated by generate_psa_wrappers.py, do not edit! */
2
3/* Copyright The Mbed TLS Contributors
4 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
5 */
6
7#include <mbedtls/build_info.h>
8
Gilles Peskine4411c9c2024-01-04 20:51:38 +01009#if defined(MBEDTLS_PSA_CRYPTO_C) && defined(MBEDTLS_TEST_HOOKS) && \
10 !defined(RECORD_PSA_STATUS_COVERAGE_LOG)
Gilles Peskine6e4332c2024-01-04 16:42:40 +010011
12#include <psa/crypto.h>
Gilles Peskine90d14d72024-01-04 16:59:28 +010013#include <test/memory.h>
Gilles Peskine6e4332c2024-01-04 16:42:40 +010014#include <test/psa_crypto_helpers.h>
15#include <test/psa_test_wrappers.h>
16
17/* Wrapper for mbedtls_psa_inject_entropy */
18#if defined(MBEDTLS_PSA_INJECT_ENTROPY)
19psa_status_t mbedtls_test_wrap_mbedtls_psa_inject_entropy(
20 const uint8_t *arg0_seed,
21 size_t arg1_seed_size)
22{
23 psa_status_t status = (mbedtls_psa_inject_entropy)(arg0_seed, arg1_seed_size);
24 return status;
25}
26#endif /* defined(MBEDTLS_PSA_INJECT_ENTROPY) */
27
28/* Wrapper for mbedtls_psa_platform_get_builtin_key */
29#if defined(MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS)
30psa_status_t mbedtls_test_wrap_mbedtls_psa_platform_get_builtin_key(
31 mbedtls_svc_key_id_t arg0_key_id,
32 psa_key_lifetime_t *arg1_lifetime,
33 psa_drv_slot_number_t *arg2_slot_number)
34{
35 psa_status_t status = (mbedtls_psa_platform_get_builtin_key)(arg0_key_id, arg1_lifetime, arg2_slot_number);
36 return status;
37}
38#endif /* defined(MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS) */
39
40/* Wrapper for mbedtls_psa_register_se_key */
41#if defined(MBEDTLS_PSA_CRYPTO_SE_C)
42psa_status_t mbedtls_test_wrap_mbedtls_psa_register_se_key(
43 const psa_key_attributes_t *arg0_attributes)
44{
45 psa_status_t status = (mbedtls_psa_register_se_key)(arg0_attributes);
46 return status;
47}
48#endif /* defined(MBEDTLS_PSA_CRYPTO_SE_C) */
49
50/* Wrapper for psa_aead_abort */
51psa_status_t mbedtls_test_wrap_psa_aead_abort(
52 psa_aead_operation_t *arg0_operation)
53{
54 psa_status_t status = (psa_aead_abort)(arg0_operation);
55 return status;
56}
57
58/* Wrapper for psa_aead_decrypt */
59psa_status_t mbedtls_test_wrap_psa_aead_decrypt(
60 mbedtls_svc_key_id_t arg0_key,
61 psa_algorithm_t arg1_alg,
62 const uint8_t *arg2_nonce,
63 size_t arg3_nonce_length,
64 const uint8_t *arg4_additional_data,
65 size_t arg5_additional_data_length,
66 const uint8_t *arg6_ciphertext,
67 size_t arg7_ciphertext_length,
68 uint8_t *arg8_plaintext,
69 size_t arg9_plaintext_size,
70 size_t *arg10_plaintext_length)
71{
David Horstmann0a8abde2024-03-13 15:57:46 +000072#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
David Horstmann86e6fe02024-01-22 14:36:01 +000073 MBEDTLS_TEST_MEMORY_POISON(arg2_nonce, arg3_nonce_length);
74 MBEDTLS_TEST_MEMORY_POISON(arg4_additional_data, arg5_additional_data_length);
75 MBEDTLS_TEST_MEMORY_POISON(arg6_ciphertext, arg7_ciphertext_length);
76 MBEDTLS_TEST_MEMORY_POISON(arg8_plaintext, arg9_plaintext_size);
David Horstmann0a8abde2024-03-13 15:57:46 +000077#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +010078 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 Horstmann0a8abde2024-03-13 15:57:46 +000079#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
David Horstmann86e6fe02024-01-22 14:36:01 +000080 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_nonce, arg3_nonce_length);
81 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_additional_data, arg5_additional_data_length);
82 MBEDTLS_TEST_MEMORY_UNPOISON(arg6_ciphertext, arg7_ciphertext_length);
83 MBEDTLS_TEST_MEMORY_UNPOISON(arg8_plaintext, arg9_plaintext_size);
David Horstmann0a8abde2024-03-13 15:57:46 +000084#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +010085 return status;
86}
87
88/* Wrapper for psa_aead_decrypt_setup */
89psa_status_t mbedtls_test_wrap_psa_aead_decrypt_setup(
90 psa_aead_operation_t *arg0_operation,
91 mbedtls_svc_key_id_t arg1_key,
92 psa_algorithm_t arg2_alg)
93{
94 psa_status_t status = (psa_aead_decrypt_setup)(arg0_operation, arg1_key, arg2_alg);
95 return status;
96}
97
98/* Wrapper for psa_aead_encrypt */
99psa_status_t mbedtls_test_wrap_psa_aead_encrypt(
100 mbedtls_svc_key_id_t arg0_key,
101 psa_algorithm_t arg1_alg,
102 const uint8_t *arg2_nonce,
103 size_t arg3_nonce_length,
104 const uint8_t *arg4_additional_data,
105 size_t arg5_additional_data_length,
106 const uint8_t *arg6_plaintext,
107 size_t arg7_plaintext_length,
108 uint8_t *arg8_ciphertext,
109 size_t arg9_ciphertext_size,
110 size_t *arg10_ciphertext_length)
111{
David Horstmann0a8abde2024-03-13 15:57:46 +0000112#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
David Horstmann86e6fe02024-01-22 14:36:01 +0000113 MBEDTLS_TEST_MEMORY_POISON(arg2_nonce, arg3_nonce_length);
114 MBEDTLS_TEST_MEMORY_POISON(arg4_additional_data, arg5_additional_data_length);
115 MBEDTLS_TEST_MEMORY_POISON(arg6_plaintext, arg7_plaintext_length);
116 MBEDTLS_TEST_MEMORY_POISON(arg8_ciphertext, arg9_ciphertext_size);
David Horstmann0a8abde2024-03-13 15:57:46 +0000117#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100118 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 Horstmann0a8abde2024-03-13 15:57:46 +0000119#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
David Horstmann86e6fe02024-01-22 14:36:01 +0000120 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_nonce, arg3_nonce_length);
121 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_additional_data, arg5_additional_data_length);
122 MBEDTLS_TEST_MEMORY_UNPOISON(arg6_plaintext, arg7_plaintext_length);
123 MBEDTLS_TEST_MEMORY_UNPOISON(arg8_ciphertext, arg9_ciphertext_size);
David Horstmann0a8abde2024-03-13 15:57:46 +0000124#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100125 return status;
126}
127
128/* Wrapper for psa_aead_encrypt_setup */
129psa_status_t mbedtls_test_wrap_psa_aead_encrypt_setup(
130 psa_aead_operation_t *arg0_operation,
131 mbedtls_svc_key_id_t arg1_key,
132 psa_algorithm_t arg2_alg)
133{
134 psa_status_t status = (psa_aead_encrypt_setup)(arg0_operation, arg1_key, arg2_alg);
135 return status;
136}
137
138/* Wrapper for psa_aead_finish */
139psa_status_t mbedtls_test_wrap_psa_aead_finish(
140 psa_aead_operation_t *arg0_operation,
141 uint8_t *arg1_ciphertext,
142 size_t arg2_ciphertext_size,
143 size_t *arg3_ciphertext_length,
144 uint8_t *arg4_tag,
145 size_t arg5_tag_size,
146 size_t *arg6_tag_length)
147{
David Horstmann0a8abde2024-03-13 15:57:46 +0000148#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
David Horstmann86e6fe02024-01-22 14:36:01 +0000149 MBEDTLS_TEST_MEMORY_POISON(arg1_ciphertext, arg2_ciphertext_size);
150 MBEDTLS_TEST_MEMORY_POISON(arg4_tag, arg5_tag_size);
David Horstmann0a8abde2024-03-13 15:57:46 +0000151#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100152 psa_status_t status = (psa_aead_finish)(arg0_operation, arg1_ciphertext, arg2_ciphertext_size, arg3_ciphertext_length, arg4_tag, arg5_tag_size, arg6_tag_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000153#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
David Horstmann86e6fe02024-01-22 14:36:01 +0000154 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_ciphertext, arg2_ciphertext_size);
155 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_tag, arg5_tag_size);
David Horstmann0a8abde2024-03-13 15:57:46 +0000156#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100157 return status;
158}
159
160/* Wrapper for psa_aead_generate_nonce */
161psa_status_t mbedtls_test_wrap_psa_aead_generate_nonce(
162 psa_aead_operation_t *arg0_operation,
163 uint8_t *arg1_nonce,
164 size_t arg2_nonce_size,
165 size_t *arg3_nonce_length)
166{
David Horstmann0a8abde2024-03-13 15:57:46 +0000167#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
David Horstmann86e6fe02024-01-22 14:36:01 +0000168 MBEDTLS_TEST_MEMORY_POISON(arg1_nonce, arg2_nonce_size);
David Horstmann0a8abde2024-03-13 15:57:46 +0000169#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100170 psa_status_t status = (psa_aead_generate_nonce)(arg0_operation, arg1_nonce, arg2_nonce_size, arg3_nonce_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000171#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
David Horstmann86e6fe02024-01-22 14:36:01 +0000172 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_nonce, arg2_nonce_size);
David Horstmann0a8abde2024-03-13 15:57:46 +0000173#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100174 return status;
175}
176
177/* Wrapper for psa_aead_set_lengths */
178psa_status_t mbedtls_test_wrap_psa_aead_set_lengths(
179 psa_aead_operation_t *arg0_operation,
180 size_t arg1_ad_length,
181 size_t arg2_plaintext_length)
182{
183 psa_status_t status = (psa_aead_set_lengths)(arg0_operation, arg1_ad_length, arg2_plaintext_length);
184 return status;
185}
186
187/* Wrapper for psa_aead_set_nonce */
188psa_status_t mbedtls_test_wrap_psa_aead_set_nonce(
189 psa_aead_operation_t *arg0_operation,
190 const uint8_t *arg1_nonce,
191 size_t arg2_nonce_length)
192{
David Horstmann0a8abde2024-03-13 15:57:46 +0000193#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
David Horstmann86e6fe02024-01-22 14:36:01 +0000194 MBEDTLS_TEST_MEMORY_POISON(arg1_nonce, arg2_nonce_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000195#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100196 psa_status_t status = (psa_aead_set_nonce)(arg0_operation, arg1_nonce, arg2_nonce_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000197#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
David Horstmann86e6fe02024-01-22 14:36:01 +0000198 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_nonce, arg2_nonce_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000199#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100200 return status;
201}
202
203/* Wrapper for psa_aead_update */
204psa_status_t mbedtls_test_wrap_psa_aead_update(
205 psa_aead_operation_t *arg0_operation,
206 const uint8_t *arg1_input,
207 size_t arg2_input_length,
208 uint8_t *arg3_output,
209 size_t arg4_output_size,
210 size_t *arg5_output_length)
211{
David Horstmann0a8abde2024-03-13 15:57:46 +0000212#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
David Horstmann86e6fe02024-01-22 14:36:01 +0000213 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
214 MBEDTLS_TEST_MEMORY_POISON(arg3_output, arg4_output_size);
David Horstmann0a8abde2024-03-13 15:57:46 +0000215#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100216 psa_status_t status = (psa_aead_update)(arg0_operation, arg1_input, arg2_input_length, arg3_output, arg4_output_size, arg5_output_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000217#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
David Horstmann86e6fe02024-01-22 14:36:01 +0000218 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
219 MBEDTLS_TEST_MEMORY_UNPOISON(arg3_output, arg4_output_size);
David Horstmann0a8abde2024-03-13 15:57:46 +0000220#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100221 return status;
222}
223
224/* Wrapper for psa_aead_update_ad */
225psa_status_t mbedtls_test_wrap_psa_aead_update_ad(
226 psa_aead_operation_t *arg0_operation,
227 const uint8_t *arg1_input,
228 size_t arg2_input_length)
229{
David Horstmann0a8abde2024-03-13 15:57:46 +0000230#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
David Horstmann86e6fe02024-01-22 14:36:01 +0000231 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000232#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100233 psa_status_t status = (psa_aead_update_ad)(arg0_operation, arg1_input, arg2_input_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000234#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
David Horstmann86e6fe02024-01-22 14:36:01 +0000235 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000236#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100237 return status;
238}
239
240/* Wrapper for psa_aead_verify */
241psa_status_t mbedtls_test_wrap_psa_aead_verify(
242 psa_aead_operation_t *arg0_operation,
243 uint8_t *arg1_plaintext,
244 size_t arg2_plaintext_size,
245 size_t *arg3_plaintext_length,
246 const uint8_t *arg4_tag,
247 size_t arg5_tag_length)
248{
David Horstmann0a8abde2024-03-13 15:57:46 +0000249#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
David Horstmann86e6fe02024-01-22 14:36:01 +0000250 MBEDTLS_TEST_MEMORY_POISON(arg1_plaintext, arg2_plaintext_size);
251 MBEDTLS_TEST_MEMORY_POISON(arg4_tag, arg5_tag_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000252#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100253 psa_status_t status = (psa_aead_verify)(arg0_operation, arg1_plaintext, arg2_plaintext_size, arg3_plaintext_length, arg4_tag, arg5_tag_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000254#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
David Horstmann86e6fe02024-01-22 14:36:01 +0000255 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_plaintext, arg2_plaintext_size);
256 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_tag, arg5_tag_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000257#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100258 return status;
259}
260
261/* Wrapper for psa_asymmetric_decrypt */
262psa_status_t mbedtls_test_wrap_psa_asymmetric_decrypt(
263 mbedtls_svc_key_id_t arg0_key,
264 psa_algorithm_t arg1_alg,
265 const uint8_t *arg2_input,
266 size_t arg3_input_length,
267 const uint8_t *arg4_salt,
268 size_t arg5_salt_length,
269 uint8_t *arg6_output,
270 size_t arg7_output_size,
271 size_t *arg8_output_length)
272{
David Horstmann0a8abde2024-03-13 15:57:46 +0000273#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubney54e6b412024-01-31 16:56:17 +0000274 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
275 MBEDTLS_TEST_MEMORY_POISON(arg4_salt, arg5_salt_length);
276 MBEDTLS_TEST_MEMORY_POISON(arg6_output, arg7_output_size);
David Horstmann0a8abde2024-03-13 15:57:46 +0000277#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100278 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);
David Horstmann0a8abde2024-03-13 15:57:46 +0000279#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubney54e6b412024-01-31 16:56:17 +0000280 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
281 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_salt, arg5_salt_length);
282 MBEDTLS_TEST_MEMORY_UNPOISON(arg6_output, arg7_output_size);
David Horstmann0a8abde2024-03-13 15:57:46 +0000283#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100284 return status;
285}
286
287/* Wrapper for psa_asymmetric_encrypt */
288psa_status_t mbedtls_test_wrap_psa_asymmetric_encrypt(
289 mbedtls_svc_key_id_t arg0_key,
290 psa_algorithm_t arg1_alg,
291 const uint8_t *arg2_input,
292 size_t arg3_input_length,
293 const uint8_t *arg4_salt,
294 size_t arg5_salt_length,
295 uint8_t *arg6_output,
296 size_t arg7_output_size,
297 size_t *arg8_output_length)
298{
David Horstmann0a8abde2024-03-13 15:57:46 +0000299#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubney27b48a32024-01-30 14:04:47 +0000300 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
301 MBEDTLS_TEST_MEMORY_POISON(arg4_salt, arg5_salt_length);
302 MBEDTLS_TEST_MEMORY_POISON(arg6_output, arg7_output_size);
David Horstmann0a8abde2024-03-13 15:57:46 +0000303#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100304 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);
David Horstmann0a8abde2024-03-13 15:57:46 +0000305#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubney27b48a32024-01-30 14:04:47 +0000306 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
307 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_salt, arg5_salt_length);
308 MBEDTLS_TEST_MEMORY_UNPOISON(arg6_output, arg7_output_size);
David Horstmann0a8abde2024-03-13 15:57:46 +0000309#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100310 return status;
311}
312
313/* Wrapper for psa_cipher_abort */
314psa_status_t mbedtls_test_wrap_psa_cipher_abort(
315 psa_cipher_operation_t *arg0_operation)
316{
317 psa_status_t status = (psa_cipher_abort)(arg0_operation);
318 return status;
319}
320
321/* Wrapper for psa_cipher_decrypt */
322psa_status_t mbedtls_test_wrap_psa_cipher_decrypt(
323 mbedtls_svc_key_id_t arg0_key,
324 psa_algorithm_t arg1_alg,
325 const uint8_t *arg2_input,
326 size_t arg3_input_length,
327 uint8_t *arg4_output,
328 size_t arg5_output_size,
329 size_t *arg6_output_length)
330{
David Horstmann0a8abde2024-03-13 15:57:46 +0000331#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Gabor Mezeib8f97a12024-01-24 16:58:40 +0100332 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
333 MBEDTLS_TEST_MEMORY_POISON(arg4_output, arg5_output_size);
David Horstmann0a8abde2024-03-13 15:57:46 +0000334#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100335 psa_status_t status = (psa_cipher_decrypt)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_output, arg5_output_size, arg6_output_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000336#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Gabor Mezeib8f97a12024-01-24 16:58:40 +0100337 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
338 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_output, arg5_output_size);
David Horstmann0a8abde2024-03-13 15:57:46 +0000339#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100340 return status;
341}
342
343/* Wrapper for psa_cipher_decrypt_setup */
344psa_status_t mbedtls_test_wrap_psa_cipher_decrypt_setup(
345 psa_cipher_operation_t *arg0_operation,
346 mbedtls_svc_key_id_t arg1_key,
347 psa_algorithm_t arg2_alg)
348{
349 psa_status_t status = (psa_cipher_decrypt_setup)(arg0_operation, arg1_key, arg2_alg);
350 return status;
351}
352
353/* Wrapper for psa_cipher_encrypt */
354psa_status_t mbedtls_test_wrap_psa_cipher_encrypt(
355 mbedtls_svc_key_id_t arg0_key,
356 psa_algorithm_t arg1_alg,
357 const uint8_t *arg2_input,
358 size_t arg3_input_length,
359 uint8_t *arg4_output,
360 size_t arg5_output_size,
361 size_t *arg6_output_length)
362{
David Horstmann0a8abde2024-03-13 15:57:46 +0000363#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Gilles Peskine90d14d72024-01-04 16:59:28 +0100364 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
365 MBEDTLS_TEST_MEMORY_POISON(arg4_output, arg5_output_size);
David Horstmann0a8abde2024-03-13 15:57:46 +0000366#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100367 psa_status_t status = (psa_cipher_encrypt)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_output, arg5_output_size, arg6_output_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000368#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Gilles Peskine90d14d72024-01-04 16:59:28 +0100369 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
370 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_output, arg5_output_size);
David Horstmann0a8abde2024-03-13 15:57:46 +0000371#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100372 return status;
373}
374
375/* Wrapper for psa_cipher_encrypt_setup */
376psa_status_t mbedtls_test_wrap_psa_cipher_encrypt_setup(
377 psa_cipher_operation_t *arg0_operation,
378 mbedtls_svc_key_id_t arg1_key,
379 psa_algorithm_t arg2_alg)
380{
381 psa_status_t status = (psa_cipher_encrypt_setup)(arg0_operation, arg1_key, arg2_alg);
382 return status;
383}
384
385/* Wrapper for psa_cipher_finish */
386psa_status_t mbedtls_test_wrap_psa_cipher_finish(
387 psa_cipher_operation_t *arg0_operation,
388 uint8_t *arg1_output,
389 size_t arg2_output_size,
390 size_t *arg3_output_length)
391{
David Horstmann0a8abde2024-03-13 15:57:46 +0000392#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Gabor Mezeib8f97a12024-01-24 16:58:40 +0100393 MBEDTLS_TEST_MEMORY_POISON(arg1_output, arg2_output_size);
David Horstmann0a8abde2024-03-13 15:57:46 +0000394#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100395 psa_status_t status = (psa_cipher_finish)(arg0_operation, arg1_output, arg2_output_size, arg3_output_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000396#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Gabor Mezeib8f97a12024-01-24 16:58:40 +0100397 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_output, arg2_output_size);
David Horstmann0a8abde2024-03-13 15:57:46 +0000398#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100399 return status;
400}
401
402/* Wrapper for psa_cipher_generate_iv */
403psa_status_t mbedtls_test_wrap_psa_cipher_generate_iv(
404 psa_cipher_operation_t *arg0_operation,
405 uint8_t *arg1_iv,
406 size_t arg2_iv_size,
407 size_t *arg3_iv_length)
408{
David Horstmann0a8abde2024-03-13 15:57:46 +0000409#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Gabor Mezeib74ac662024-02-01 10:39:56 +0100410 MBEDTLS_TEST_MEMORY_POISON(arg1_iv, arg2_iv_size);
David Horstmann0a8abde2024-03-13 15:57:46 +0000411#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100412 psa_status_t status = (psa_cipher_generate_iv)(arg0_operation, arg1_iv, arg2_iv_size, arg3_iv_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000413#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Gabor Mezeib74ac662024-02-01 10:39:56 +0100414 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_iv, arg2_iv_size);
David Horstmann0a8abde2024-03-13 15:57:46 +0000415#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100416 return status;
417}
418
419/* Wrapper for psa_cipher_set_iv */
420psa_status_t mbedtls_test_wrap_psa_cipher_set_iv(
421 psa_cipher_operation_t *arg0_operation,
422 const uint8_t *arg1_iv,
423 size_t arg2_iv_length)
424{
David Horstmann0a8abde2024-03-13 15:57:46 +0000425#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Gabor Mezeib74ac662024-02-01 10:39:56 +0100426 MBEDTLS_TEST_MEMORY_POISON(arg1_iv, arg2_iv_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000427#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100428 psa_status_t status = (psa_cipher_set_iv)(arg0_operation, arg1_iv, arg2_iv_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000429#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Gabor Mezeib74ac662024-02-01 10:39:56 +0100430 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_iv, arg2_iv_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000431#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100432 return status;
433}
434
435/* Wrapper for psa_cipher_update */
436psa_status_t mbedtls_test_wrap_psa_cipher_update(
437 psa_cipher_operation_t *arg0_operation,
438 const uint8_t *arg1_input,
439 size_t arg2_input_length,
440 uint8_t *arg3_output,
441 size_t arg4_output_size,
442 size_t *arg5_output_length)
443{
David Horstmann0a8abde2024-03-13 15:57:46 +0000444#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Gabor Mezeib8f97a12024-01-24 16:58:40 +0100445 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
446 MBEDTLS_TEST_MEMORY_POISON(arg3_output, arg4_output_size);
David Horstmann0a8abde2024-03-13 15:57:46 +0000447#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100448 psa_status_t status = (psa_cipher_update)(arg0_operation, arg1_input, arg2_input_length, arg3_output, arg4_output_size, arg5_output_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000449#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Gabor Mezeib8f97a12024-01-24 16:58:40 +0100450 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
451 MBEDTLS_TEST_MEMORY_UNPOISON(arg3_output, arg4_output_size);
David Horstmann0a8abde2024-03-13 15:57:46 +0000452#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100453 return status;
454}
455
456/* Wrapper for psa_copy_key */
457psa_status_t mbedtls_test_wrap_psa_copy_key(
458 mbedtls_svc_key_id_t arg0_source_key,
459 const psa_key_attributes_t *arg1_attributes,
460 mbedtls_svc_key_id_t *arg2_target_key)
461{
462 psa_status_t status = (psa_copy_key)(arg0_source_key, arg1_attributes, arg2_target_key);
463 return status;
464}
465
466/* Wrapper for psa_crypto_driver_pake_get_cipher_suite */
Ronald Cron7062d3d2024-05-24 10:28:15 +0200467#if defined(PSA_WANT_ALG_SOME_PAKE)
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100468psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_cipher_suite(
469 const psa_crypto_driver_pake_inputs_t *arg0_inputs,
470 psa_pake_cipher_suite_t *arg1_cipher_suite)
471{
472 psa_status_t status = (psa_crypto_driver_pake_get_cipher_suite)(arg0_inputs, arg1_cipher_suite);
473 return status;
474}
Ronald Cron7062d3d2024-05-24 10:28:15 +0200475#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100476
477/* Wrapper for psa_crypto_driver_pake_get_password */
Ronald Cron7062d3d2024-05-24 10:28:15 +0200478#if defined(PSA_WANT_ALG_SOME_PAKE)
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100479psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_password(
480 const psa_crypto_driver_pake_inputs_t *arg0_inputs,
481 uint8_t *arg1_buffer,
482 size_t arg2_buffer_size,
483 size_t *arg3_buffer_length)
484{
485 psa_status_t status = (psa_crypto_driver_pake_get_password)(arg0_inputs, arg1_buffer, arg2_buffer_size, arg3_buffer_length);
486 return status;
487}
Ronald Cron7062d3d2024-05-24 10:28:15 +0200488#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100489
490/* Wrapper for psa_crypto_driver_pake_get_password_len */
Ronald Cron7062d3d2024-05-24 10:28:15 +0200491#if defined(PSA_WANT_ALG_SOME_PAKE)
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100492psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_password_len(
493 const psa_crypto_driver_pake_inputs_t *arg0_inputs,
494 size_t *arg1_password_len)
495{
496 psa_status_t status = (psa_crypto_driver_pake_get_password_len)(arg0_inputs, arg1_password_len);
497 return status;
498}
Ronald Cron7062d3d2024-05-24 10:28:15 +0200499#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100500
501/* Wrapper for psa_crypto_driver_pake_get_peer */
Ronald Cron7062d3d2024-05-24 10:28:15 +0200502#if defined(PSA_WANT_ALG_SOME_PAKE)
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100503psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_peer(
504 const psa_crypto_driver_pake_inputs_t *arg0_inputs,
505 uint8_t *arg1_peer_id,
506 size_t arg2_peer_id_size,
507 size_t *arg3_peer_id_length)
508{
509 psa_status_t status = (psa_crypto_driver_pake_get_peer)(arg0_inputs, arg1_peer_id, arg2_peer_id_size, arg3_peer_id_length);
510 return status;
511}
Ronald Cron7062d3d2024-05-24 10:28:15 +0200512#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100513
514/* Wrapper for psa_crypto_driver_pake_get_peer_len */
Ronald Cron7062d3d2024-05-24 10:28:15 +0200515#if defined(PSA_WANT_ALG_SOME_PAKE)
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100516psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_peer_len(
517 const psa_crypto_driver_pake_inputs_t *arg0_inputs,
518 size_t *arg1_peer_len)
519{
520 psa_status_t status = (psa_crypto_driver_pake_get_peer_len)(arg0_inputs, arg1_peer_len);
521 return status;
522}
Ronald Cron7062d3d2024-05-24 10:28:15 +0200523#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100524
525/* Wrapper for psa_crypto_driver_pake_get_user */
Ronald Cron7062d3d2024-05-24 10:28:15 +0200526#if defined(PSA_WANT_ALG_SOME_PAKE)
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100527psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_user(
528 const psa_crypto_driver_pake_inputs_t *arg0_inputs,
529 uint8_t *arg1_user_id,
530 size_t arg2_user_id_size,
531 size_t *arg3_user_id_len)
532{
533 psa_status_t status = (psa_crypto_driver_pake_get_user)(arg0_inputs, arg1_user_id, arg2_user_id_size, arg3_user_id_len);
534 return status;
535}
Ronald Cron7062d3d2024-05-24 10:28:15 +0200536#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100537
538/* Wrapper for psa_crypto_driver_pake_get_user_len */
Ronald Cron7062d3d2024-05-24 10:28:15 +0200539#if defined(PSA_WANT_ALG_SOME_PAKE)
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100540psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_user_len(
541 const psa_crypto_driver_pake_inputs_t *arg0_inputs,
542 size_t *arg1_user_len)
543{
544 psa_status_t status = (psa_crypto_driver_pake_get_user_len)(arg0_inputs, arg1_user_len);
545 return status;
546}
Ronald Cron7062d3d2024-05-24 10:28:15 +0200547#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100548
549/* Wrapper for psa_crypto_init */
550psa_status_t mbedtls_test_wrap_psa_crypto_init(void)
551{
552 psa_status_t status = (psa_crypto_init)();
553 return status;
554}
555
556/* Wrapper for psa_destroy_key */
557psa_status_t mbedtls_test_wrap_psa_destroy_key(
558 mbedtls_svc_key_id_t arg0_key)
559{
560 psa_status_t status = (psa_destroy_key)(arg0_key);
561 return status;
562}
563
564/* Wrapper for psa_export_key */
565psa_status_t mbedtls_test_wrap_psa_export_key(
566 mbedtls_svc_key_id_t arg0_key,
567 uint8_t *arg1_data,
568 size_t arg2_data_size,
569 size_t *arg3_data_length)
570{
David Horstmann0a8abde2024-03-13 15:57:46 +0000571#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Ryan Everett77b91e32024-01-25 10:58:06 +0000572 MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_size);
David Horstmann0a8abde2024-03-13 15:57:46 +0000573#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100574 psa_status_t status = (psa_export_key)(arg0_key, arg1_data, arg2_data_size, arg3_data_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000575#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Ryan Everett77b91e32024-01-25 10:58:06 +0000576 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_size);
David Horstmann0a8abde2024-03-13 15:57:46 +0000577#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100578 return status;
579}
580
581/* Wrapper for psa_export_public_key */
582psa_status_t mbedtls_test_wrap_psa_export_public_key(
583 mbedtls_svc_key_id_t arg0_key,
584 uint8_t *arg1_data,
585 size_t arg2_data_size,
586 size_t *arg3_data_length)
587{
David Horstmann0a8abde2024-03-13 15:57:46 +0000588#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Ryan Everett77b91e32024-01-25 10:58:06 +0000589 MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_size);
David Horstmann0a8abde2024-03-13 15:57:46 +0000590#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100591 psa_status_t status = (psa_export_public_key)(arg0_key, arg1_data, arg2_data_size, arg3_data_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000592#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Ryan Everett77b91e32024-01-25 10:58:06 +0000593 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_size);
David Horstmann0a8abde2024-03-13 15:57:46 +0000594#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100595 return status;
596}
597
598/* Wrapper for psa_generate_key */
599psa_status_t mbedtls_test_wrap_psa_generate_key(
600 const psa_key_attributes_t *arg0_attributes,
601 mbedtls_svc_key_id_t *arg1_key)
602{
603 psa_status_t status = (psa_generate_key)(arg0_attributes, arg1_key);
604 return status;
605}
606
Gilles Peskineb45af2f2024-06-07 08:29:44 +0200607/* Wrapper for psa_generate_key_custom */
608psa_status_t mbedtls_test_wrap_psa_generate_key_custom(
609 const psa_key_attributes_t *arg0_attributes,
610 const psa_custom_key_parameters_t *arg1_custom,
611 const uint8_t *arg2_custom_data,
612 size_t arg3_custom_data_length,
613 mbedtls_svc_key_id_t *arg4_key)
614{
615#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
616 MBEDTLS_TEST_MEMORY_POISON(arg2_custom_data, arg3_custom_data_length);
617#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
618 psa_status_t status = (psa_generate_key_custom)(arg0_attributes, arg1_custom, arg2_custom_data, arg3_custom_data_length, arg4_key);
619#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
620 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_custom_data, arg3_custom_data_length);
621#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
622 return status;
623}
624
Paul Elliott2dc5fa32024-07-19 17:32:42 +0100625/* Wrapper for psa_generate_key_iop_abort */
626psa_status_t mbedtls_test_wrap_psa_generate_key_iop_abort(
627 psa_generate_key_iop_t *arg0_operation)
628{
629 psa_status_t status = (psa_generate_key_iop_abort)(arg0_operation);
630 return status;
631}
632
633/* Wrapper for psa_generate_key_iop_complete */
634psa_status_t mbedtls_test_wrap_psa_generate_key_iop_complete(
635 psa_generate_key_iop_t *arg0_operation,
Paul Elliottd118cd22024-11-14 12:49:20 +0000636 mbedtls_svc_key_id_t *arg1_key)
Paul Elliott2dc5fa32024-07-19 17:32:42 +0100637{
638 psa_status_t status = (psa_generate_key_iop_complete)(arg0_operation, arg1_key);
639 return status;
640}
641
642/* Wrapper for psa_generate_key_iop_setup */
643psa_status_t mbedtls_test_wrap_psa_generate_key_iop_setup(
644 psa_generate_key_iop_t *arg0_operation,
645 const psa_key_attributes_t *arg1_attributes)
646{
647 psa_status_t status = (psa_generate_key_iop_setup)(arg0_operation, arg1_attributes);
648 return status;
649}
650
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100651/* Wrapper for psa_generate_random */
652psa_status_t mbedtls_test_wrap_psa_generate_random(
653 uint8_t *arg0_output,
654 size_t arg1_output_size)
655{
David Horstmann0a8abde2024-03-13 15:57:46 +0000656#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
David Horstmann075c5fb2024-02-06 15:44:08 +0000657 MBEDTLS_TEST_MEMORY_POISON(arg0_output, arg1_output_size);
David Horstmann0a8abde2024-03-13 15:57:46 +0000658#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100659 psa_status_t status = (psa_generate_random)(arg0_output, arg1_output_size);
David Horstmann0a8abde2024-03-13 15:57:46 +0000660#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
David Horstmann075c5fb2024-02-06 15:44:08 +0000661 MBEDTLS_TEST_MEMORY_UNPOISON(arg0_output, arg1_output_size);
David Horstmann0a8abde2024-03-13 15:57:46 +0000662#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100663 return status;
664}
665
666/* Wrapper for psa_get_key_attributes */
667psa_status_t mbedtls_test_wrap_psa_get_key_attributes(
668 mbedtls_svc_key_id_t arg0_key,
669 psa_key_attributes_t *arg1_attributes)
670{
671 psa_status_t status = (psa_get_key_attributes)(arg0_key, arg1_attributes);
672 return status;
673}
674
675/* Wrapper for psa_hash_abort */
676psa_status_t mbedtls_test_wrap_psa_hash_abort(
677 psa_hash_operation_t *arg0_operation)
678{
679 psa_status_t status = (psa_hash_abort)(arg0_operation);
680 return status;
681}
682
683/* Wrapper for psa_hash_clone */
684psa_status_t mbedtls_test_wrap_psa_hash_clone(
685 const psa_hash_operation_t *arg0_source_operation,
686 psa_hash_operation_t *arg1_target_operation)
687{
688 psa_status_t status = (psa_hash_clone)(arg0_source_operation, arg1_target_operation);
689 return status;
690}
691
692/* Wrapper for psa_hash_compare */
693psa_status_t mbedtls_test_wrap_psa_hash_compare(
694 psa_algorithm_t arg0_alg,
695 const uint8_t *arg1_input,
696 size_t arg2_input_length,
697 const uint8_t *arg3_hash,
698 size_t arg4_hash_length)
699{
David Horstmann0a8abde2024-03-13 15:57:46 +0000700#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubney45c85862024-01-25 16:48:09 +0000701 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
702 MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000703#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100704 psa_status_t status = (psa_hash_compare)(arg0_alg, arg1_input, arg2_input_length, arg3_hash, arg4_hash_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000705#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubney45c85862024-01-25 16:48:09 +0000706 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
707 MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000708#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100709 return status;
710}
711
712/* Wrapper for psa_hash_compute */
713psa_status_t mbedtls_test_wrap_psa_hash_compute(
714 psa_algorithm_t arg0_alg,
715 const uint8_t *arg1_input,
716 size_t arg2_input_length,
717 uint8_t *arg3_hash,
718 size_t arg4_hash_size,
719 size_t *arg5_hash_length)
720{
David Horstmann0a8abde2024-03-13 15:57:46 +0000721#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubney45c85862024-01-25 16:48:09 +0000722 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
723 MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_size);
David Horstmann0a8abde2024-03-13 15:57:46 +0000724#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100725 psa_status_t status = (psa_hash_compute)(arg0_alg, arg1_input, arg2_input_length, arg3_hash, arg4_hash_size, arg5_hash_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000726#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubney45c85862024-01-25 16:48:09 +0000727 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
728 MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_size);
David Horstmann0a8abde2024-03-13 15:57:46 +0000729#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100730 return status;
731}
732
733/* Wrapper for psa_hash_finish */
734psa_status_t mbedtls_test_wrap_psa_hash_finish(
735 psa_hash_operation_t *arg0_operation,
736 uint8_t *arg1_hash,
737 size_t arg2_hash_size,
738 size_t *arg3_hash_length)
739{
David Horstmann0a8abde2024-03-13 15:57:46 +0000740#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubney45c85862024-01-25 16:48:09 +0000741 MBEDTLS_TEST_MEMORY_POISON(arg1_hash, arg2_hash_size);
David Horstmann0a8abde2024-03-13 15:57:46 +0000742#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100743 psa_status_t status = (psa_hash_finish)(arg0_operation, arg1_hash, arg2_hash_size, arg3_hash_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000744#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubney45c85862024-01-25 16:48:09 +0000745 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_hash, arg2_hash_size);
David Horstmann0a8abde2024-03-13 15:57:46 +0000746#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100747 return status;
748}
749
750/* Wrapper for psa_hash_setup */
751psa_status_t mbedtls_test_wrap_psa_hash_setup(
752 psa_hash_operation_t *arg0_operation,
753 psa_algorithm_t arg1_alg)
754{
755 psa_status_t status = (psa_hash_setup)(arg0_operation, arg1_alg);
756 return status;
757}
758
759/* Wrapper for psa_hash_update */
760psa_status_t mbedtls_test_wrap_psa_hash_update(
761 psa_hash_operation_t *arg0_operation,
762 const uint8_t *arg1_input,
763 size_t arg2_input_length)
764{
David Horstmann0a8abde2024-03-13 15:57:46 +0000765#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubney45c85862024-01-25 16:48:09 +0000766 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000767#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100768 psa_status_t status = (psa_hash_update)(arg0_operation, arg1_input, arg2_input_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000769#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubney45c85862024-01-25 16:48:09 +0000770 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000771#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100772 return status;
773}
774
775/* Wrapper for psa_hash_verify */
776psa_status_t mbedtls_test_wrap_psa_hash_verify(
777 psa_hash_operation_t *arg0_operation,
778 const uint8_t *arg1_hash,
779 size_t arg2_hash_length)
780{
David Horstmann0a8abde2024-03-13 15:57:46 +0000781#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubney45c85862024-01-25 16:48:09 +0000782 MBEDTLS_TEST_MEMORY_POISON(arg1_hash, arg2_hash_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000783#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100784 psa_status_t status = (psa_hash_verify)(arg0_operation, arg1_hash, arg2_hash_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000785#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubney45c85862024-01-25 16:48:09 +0000786 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_hash, arg2_hash_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000787#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100788 return status;
789}
790
791/* Wrapper for psa_import_key */
792psa_status_t mbedtls_test_wrap_psa_import_key(
793 const psa_key_attributes_t *arg0_attributes,
794 const uint8_t *arg1_data,
795 size_t arg2_data_length,
796 mbedtls_svc_key_id_t *arg3_key)
797{
David Horstmann0a8abde2024-03-13 15:57:46 +0000798#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Ryan Everett77b91e32024-01-25 10:58:06 +0000799 MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000800#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100801 psa_status_t status = (psa_import_key)(arg0_attributes, arg1_data, arg2_data_length, arg3_key);
David Horstmann0a8abde2024-03-13 15:57:46 +0000802#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Ryan Everett77b91e32024-01-25 10:58:06 +0000803 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000804#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100805 return status;
806}
807
Waleed Elmelegybdf2c982024-08-08 21:09:05 +0100808/* Wrapper for psa_key_agreement */
809psa_status_t mbedtls_test_wrap_psa_key_agreement(
810 mbedtls_svc_key_id_t arg0_private_key,
811 const uint8_t *arg1_peer_key,
812 size_t arg2_peer_key_length,
813 psa_algorithm_t arg3_alg,
814 const psa_key_attributes_t *arg4_attributes,
815 mbedtls_svc_key_id_t *arg5_key)
816{
817#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
818 MBEDTLS_TEST_MEMORY_POISON(arg1_peer_key, arg2_peer_key_length);
819#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
820 psa_status_t status = (psa_key_agreement)(arg0_private_key, arg1_peer_key, arg2_peer_key_length, arg3_alg, arg4_attributes, arg5_key);
821#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
822 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_peer_key, arg2_peer_key_length);
823#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
824 return status;
825}
826
Paul Elliottc884b292024-07-19 17:32:42 +0100827/* Wrapper for psa_key_agreement_iop_abort */
828psa_status_t mbedtls_test_wrap_psa_key_agreement_iop_abort(
829 psa_key_agreement_iop_t *arg0_operation)
830{
831 psa_status_t status = (psa_key_agreement_iop_abort)(arg0_operation);
832 return status;
833}
834
835/* Wrapper for psa_key_agreement_iop_complete */
836psa_status_t mbedtls_test_wrap_psa_key_agreement_iop_complete(
837 psa_key_agreement_iop_t *arg0_operation,
Waleed Elmelegya2891a92024-08-06 10:55:09 +0100838 mbedtls_svc_key_id_t *arg1_key)
Paul Elliottc884b292024-07-19 17:32:42 +0100839{
840 psa_status_t status = (psa_key_agreement_iop_complete)(arg0_operation, arg1_key);
841 return status;
842}
843
844/* Wrapper for psa_key_agreement_iop_setup */
845psa_status_t mbedtls_test_wrap_psa_key_agreement_iop_setup(
846 psa_key_agreement_iop_t *arg0_operation,
Waleed Elmelegya2891a92024-08-06 10:55:09 +0100847 mbedtls_svc_key_id_t arg1_private_key,
Paul Elliottc884b292024-07-19 17:32:42 +0100848 const uint8_t *arg2_peer_key,
849 size_t arg3_peer_key_length,
850 psa_algorithm_t arg4_alg,
851 const psa_key_attributes_t *arg5_attributes)
852{
853#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
854 MBEDTLS_TEST_MEMORY_POISON(arg2_peer_key, arg3_peer_key_length);
855#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
856 psa_status_t status = (psa_key_agreement_iop_setup)(arg0_operation, arg1_private_key, arg2_peer_key, arg3_peer_key_length, arg4_alg, arg5_attributes);
857#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
858 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_peer_key, arg3_peer_key_length);
859#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
860 return status;
861}
862
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100863/* Wrapper for psa_key_derivation_abort */
864psa_status_t mbedtls_test_wrap_psa_key_derivation_abort(
865 psa_key_derivation_operation_t *arg0_operation)
866{
867 psa_status_t status = (psa_key_derivation_abort)(arg0_operation);
868 return status;
869}
870
871/* Wrapper for psa_key_derivation_get_capacity */
872psa_status_t mbedtls_test_wrap_psa_key_derivation_get_capacity(
873 const psa_key_derivation_operation_t *arg0_operation,
874 size_t *arg1_capacity)
875{
876 psa_status_t status = (psa_key_derivation_get_capacity)(arg0_operation, arg1_capacity);
877 return status;
878}
879
880/* Wrapper for psa_key_derivation_input_bytes */
881psa_status_t mbedtls_test_wrap_psa_key_derivation_input_bytes(
882 psa_key_derivation_operation_t *arg0_operation,
883 psa_key_derivation_step_t arg1_step,
884 const uint8_t *arg2_data,
885 size_t arg3_data_length)
886{
David Horstmann0a8abde2024-03-13 15:57:46 +0000887#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Ryan Everett198a4d92024-01-25 11:44:56 +0000888 MBEDTLS_TEST_MEMORY_POISON(arg2_data, arg3_data_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000889#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100890 psa_status_t status = (psa_key_derivation_input_bytes)(arg0_operation, arg1_step, arg2_data, arg3_data_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000891#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Ryan Everett198a4d92024-01-25 11:44:56 +0000892 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_data, arg3_data_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000893#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100894 return status;
895}
896
897/* Wrapper for psa_key_derivation_input_integer */
898psa_status_t mbedtls_test_wrap_psa_key_derivation_input_integer(
899 psa_key_derivation_operation_t *arg0_operation,
900 psa_key_derivation_step_t arg1_step,
901 uint64_t arg2_value)
902{
903 psa_status_t status = (psa_key_derivation_input_integer)(arg0_operation, arg1_step, arg2_value);
904 return status;
905}
906
907/* Wrapper for psa_key_derivation_input_key */
908psa_status_t mbedtls_test_wrap_psa_key_derivation_input_key(
909 psa_key_derivation_operation_t *arg0_operation,
910 psa_key_derivation_step_t arg1_step,
911 mbedtls_svc_key_id_t arg2_key)
912{
913 psa_status_t status = (psa_key_derivation_input_key)(arg0_operation, arg1_step, arg2_key);
914 return status;
915}
916
917/* Wrapper for psa_key_derivation_key_agreement */
918psa_status_t mbedtls_test_wrap_psa_key_derivation_key_agreement(
919 psa_key_derivation_operation_t *arg0_operation,
920 psa_key_derivation_step_t arg1_step,
921 mbedtls_svc_key_id_t arg2_private_key,
922 const uint8_t *arg3_peer_key,
923 size_t arg4_peer_key_length)
924{
David Horstmann0a8abde2024-03-13 15:57:46 +0000925#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneyfe2bda32024-02-15 13:35:06 +0000926 MBEDTLS_TEST_MEMORY_POISON(arg3_peer_key, arg4_peer_key_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000927#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100928 psa_status_t status = (psa_key_derivation_key_agreement)(arg0_operation, arg1_step, arg2_private_key, arg3_peer_key, arg4_peer_key_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000929#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneyfe2bda32024-02-15 13:35:06 +0000930 MBEDTLS_TEST_MEMORY_UNPOISON(arg3_peer_key, arg4_peer_key_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000931#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100932 return status;
933}
934
935/* Wrapper for psa_key_derivation_output_bytes */
936psa_status_t mbedtls_test_wrap_psa_key_derivation_output_bytes(
937 psa_key_derivation_operation_t *arg0_operation,
938 uint8_t *arg1_output,
939 size_t arg2_output_length)
940{
David Horstmann0a8abde2024-03-13 15:57:46 +0000941#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Ryan Everett198a4d92024-01-25 11:44:56 +0000942 MBEDTLS_TEST_MEMORY_POISON(arg1_output, arg2_output_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000943#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100944 psa_status_t status = (psa_key_derivation_output_bytes)(arg0_operation, arg1_output, arg2_output_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000945#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Ryan Everett198a4d92024-01-25 11:44:56 +0000946 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_output, arg2_output_length);
David Horstmann0a8abde2024-03-13 15:57:46 +0000947#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100948 return status;
949}
950
951/* Wrapper for psa_key_derivation_output_key */
952psa_status_t mbedtls_test_wrap_psa_key_derivation_output_key(
953 const psa_key_attributes_t *arg0_attributes,
954 psa_key_derivation_operation_t *arg1_operation,
955 mbedtls_svc_key_id_t *arg2_key)
956{
957 psa_status_t status = (psa_key_derivation_output_key)(arg0_attributes, arg1_operation, arg2_key);
958 return status;
959}
960
Gilles Peskineb45af2f2024-06-07 08:29:44 +0200961/* Wrapper for psa_key_derivation_output_key_custom */
962psa_status_t mbedtls_test_wrap_psa_key_derivation_output_key_custom(
963 const psa_key_attributes_t *arg0_attributes,
964 psa_key_derivation_operation_t *arg1_operation,
965 const psa_custom_key_parameters_t *arg2_custom,
966 const uint8_t *arg3_custom_data,
967 size_t arg4_custom_data_length,
968 mbedtls_svc_key_id_t *arg5_key)
969{
970#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
971 MBEDTLS_TEST_MEMORY_POISON(arg3_custom_data, arg4_custom_data_length);
972#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
973 psa_status_t status = (psa_key_derivation_output_key_custom)(arg0_attributes, arg1_operation, arg2_custom, arg3_custom_data, arg4_custom_data_length, arg5_key);
974#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
975 MBEDTLS_TEST_MEMORY_UNPOISON(arg3_custom_data, arg4_custom_data_length);
976#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
977 return status;
978}
979
Gilles Peskine6e4332c2024-01-04 16:42:40 +0100980/* Wrapper for psa_key_derivation_set_capacity */
981psa_status_t mbedtls_test_wrap_psa_key_derivation_set_capacity(
982 psa_key_derivation_operation_t *arg0_operation,
983 size_t arg1_capacity)
984{
985 psa_status_t status = (psa_key_derivation_set_capacity)(arg0_operation, arg1_capacity);
986 return status;
987}
988
989/* Wrapper for psa_key_derivation_setup */
990psa_status_t mbedtls_test_wrap_psa_key_derivation_setup(
991 psa_key_derivation_operation_t *arg0_operation,
992 psa_algorithm_t arg1_alg)
993{
994 psa_status_t status = (psa_key_derivation_setup)(arg0_operation, arg1_alg);
995 return status;
996}
997
998/* Wrapper for psa_mac_abort */
999psa_status_t mbedtls_test_wrap_psa_mac_abort(
1000 psa_mac_operation_t *arg0_operation)
1001{
1002 psa_status_t status = (psa_mac_abort)(arg0_operation);
1003 return status;
1004}
1005
1006/* Wrapper for psa_mac_compute */
1007psa_status_t mbedtls_test_wrap_psa_mac_compute(
1008 mbedtls_svc_key_id_t arg0_key,
1009 psa_algorithm_t arg1_alg,
1010 const uint8_t *arg2_input,
1011 size_t arg3_input_length,
1012 uint8_t *arg4_mac,
1013 size_t arg5_mac_size,
1014 size_t *arg6_mac_length)
1015{
David Horstmann0a8abde2024-03-13 15:57:46 +00001016#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneya1cf1012024-01-30 11:18:54 +00001017 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
1018 MBEDTLS_TEST_MEMORY_POISON(arg4_mac, arg5_mac_size);
David Horstmann0a8abde2024-03-13 15:57:46 +00001019#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001020 psa_status_t status = (psa_mac_compute)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_mac, arg5_mac_size, arg6_mac_length);
David Horstmann0a8abde2024-03-13 15:57:46 +00001021#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneya1cf1012024-01-30 11:18:54 +00001022 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
1023 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_mac, arg5_mac_size);
David Horstmann0a8abde2024-03-13 15:57:46 +00001024#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001025 return status;
1026}
1027
1028/* Wrapper for psa_mac_sign_finish */
1029psa_status_t mbedtls_test_wrap_psa_mac_sign_finish(
1030 psa_mac_operation_t *arg0_operation,
1031 uint8_t *arg1_mac,
1032 size_t arg2_mac_size,
1033 size_t *arg3_mac_length)
1034{
David Horstmann0a8abde2024-03-13 15:57:46 +00001035#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneya1cf1012024-01-30 11:18:54 +00001036 MBEDTLS_TEST_MEMORY_POISON(arg1_mac, arg2_mac_size);
David Horstmann0a8abde2024-03-13 15:57:46 +00001037#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001038 psa_status_t status = (psa_mac_sign_finish)(arg0_operation, arg1_mac, arg2_mac_size, arg3_mac_length);
David Horstmann0a8abde2024-03-13 15:57:46 +00001039#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneya1cf1012024-01-30 11:18:54 +00001040 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_mac, arg2_mac_size);
David Horstmann0a8abde2024-03-13 15:57:46 +00001041#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001042 return status;
1043}
1044
1045/* Wrapper for psa_mac_sign_setup */
1046psa_status_t mbedtls_test_wrap_psa_mac_sign_setup(
1047 psa_mac_operation_t *arg0_operation,
1048 mbedtls_svc_key_id_t arg1_key,
1049 psa_algorithm_t arg2_alg)
1050{
1051 psa_status_t status = (psa_mac_sign_setup)(arg0_operation, arg1_key, arg2_alg);
1052 return status;
1053}
1054
1055/* Wrapper for psa_mac_update */
1056psa_status_t mbedtls_test_wrap_psa_mac_update(
1057 psa_mac_operation_t *arg0_operation,
1058 const uint8_t *arg1_input,
1059 size_t arg2_input_length)
1060{
David Horstmann0a8abde2024-03-13 15:57:46 +00001061#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneya1cf1012024-01-30 11:18:54 +00001062 MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length);
David Horstmann0a8abde2024-03-13 15:57:46 +00001063#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001064 psa_status_t status = (psa_mac_update)(arg0_operation, arg1_input, arg2_input_length);
David Horstmann0a8abde2024-03-13 15:57:46 +00001065#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneya1cf1012024-01-30 11:18:54 +00001066 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length);
David Horstmann0a8abde2024-03-13 15:57:46 +00001067#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001068 return status;
1069}
1070
1071/* Wrapper for psa_mac_verify */
1072psa_status_t mbedtls_test_wrap_psa_mac_verify(
1073 mbedtls_svc_key_id_t arg0_key,
1074 psa_algorithm_t arg1_alg,
1075 const uint8_t *arg2_input,
1076 size_t arg3_input_length,
1077 const uint8_t *arg4_mac,
1078 size_t arg5_mac_length)
1079{
David Horstmann0a8abde2024-03-13 15:57:46 +00001080#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneya1cf1012024-01-30 11:18:54 +00001081 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
1082 MBEDTLS_TEST_MEMORY_POISON(arg4_mac, arg5_mac_length);
David Horstmann0a8abde2024-03-13 15:57:46 +00001083#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001084 psa_status_t status = (psa_mac_verify)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_mac, arg5_mac_length);
David Horstmann0a8abde2024-03-13 15:57:46 +00001085#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneya1cf1012024-01-30 11:18:54 +00001086 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
1087 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_mac, arg5_mac_length);
David Horstmann0a8abde2024-03-13 15:57:46 +00001088#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001089 return status;
1090}
1091
1092/* Wrapper for psa_mac_verify_finish */
1093psa_status_t mbedtls_test_wrap_psa_mac_verify_finish(
1094 psa_mac_operation_t *arg0_operation,
1095 const uint8_t *arg1_mac,
1096 size_t arg2_mac_length)
1097{
David Horstmann0a8abde2024-03-13 15:57:46 +00001098#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneya1cf1012024-01-30 11:18:54 +00001099 MBEDTLS_TEST_MEMORY_POISON(arg1_mac, arg2_mac_length);
David Horstmann0a8abde2024-03-13 15:57:46 +00001100#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001101 psa_status_t status = (psa_mac_verify_finish)(arg0_operation, arg1_mac, arg2_mac_length);
David Horstmann0a8abde2024-03-13 15:57:46 +00001102#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneya1cf1012024-01-30 11:18:54 +00001103 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_mac, arg2_mac_length);
David Horstmann0a8abde2024-03-13 15:57:46 +00001104#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001105 return status;
1106}
1107
1108/* Wrapper for psa_mac_verify_setup */
1109psa_status_t mbedtls_test_wrap_psa_mac_verify_setup(
1110 psa_mac_operation_t *arg0_operation,
1111 mbedtls_svc_key_id_t arg1_key,
1112 psa_algorithm_t arg2_alg)
1113{
1114 psa_status_t status = (psa_mac_verify_setup)(arg0_operation, arg1_key, arg2_alg);
1115 return status;
1116}
1117
1118/* Wrapper for psa_pake_abort */
Ronald Cron7062d3d2024-05-24 10:28:15 +02001119#if defined(PSA_WANT_ALG_SOME_PAKE)
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001120psa_status_t mbedtls_test_wrap_psa_pake_abort(
1121 psa_pake_operation_t *arg0_operation)
1122{
1123 psa_status_t status = (psa_pake_abort)(arg0_operation);
1124 return status;
1125}
Ronald Cron7062d3d2024-05-24 10:28:15 +02001126#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001127
1128/* Wrapper for psa_pake_get_implicit_key */
Ronald Cron7062d3d2024-05-24 10:28:15 +02001129#if defined(PSA_WANT_ALG_SOME_PAKE)
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001130psa_status_t mbedtls_test_wrap_psa_pake_get_implicit_key(
1131 psa_pake_operation_t *arg0_operation,
1132 psa_key_derivation_operation_t *arg1_output)
1133{
1134 psa_status_t status = (psa_pake_get_implicit_key)(arg0_operation, arg1_output);
1135 return status;
1136}
Ronald Cron7062d3d2024-05-24 10:28:15 +02001137#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001138
1139/* Wrapper for psa_pake_input */
Ronald Cron7062d3d2024-05-24 10:28:15 +02001140#if defined(PSA_WANT_ALG_SOME_PAKE)
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001141psa_status_t mbedtls_test_wrap_psa_pake_input(
1142 psa_pake_operation_t *arg0_operation,
1143 psa_pake_step_t arg1_step,
1144 const uint8_t *arg2_input,
1145 size_t arg3_input_length)
1146{
David Horstmann0a8abde2024-03-13 15:57:46 +00001147#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
David Horstmann6076fe42024-01-23 15:28:51 +00001148 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
David Horstmann0a8abde2024-03-13 15:57:46 +00001149#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001150 psa_status_t status = (psa_pake_input)(arg0_operation, arg1_step, arg2_input, arg3_input_length);
David Horstmann0a8abde2024-03-13 15:57:46 +00001151#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
David Horstmann6076fe42024-01-23 15:28:51 +00001152 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
David Horstmann0a8abde2024-03-13 15:57:46 +00001153#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001154 return status;
1155}
Ronald Cron7062d3d2024-05-24 10:28:15 +02001156#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001157
1158/* Wrapper for psa_pake_output */
Ronald Cron7062d3d2024-05-24 10:28:15 +02001159#if defined(PSA_WANT_ALG_SOME_PAKE)
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001160psa_status_t mbedtls_test_wrap_psa_pake_output(
1161 psa_pake_operation_t *arg0_operation,
1162 psa_pake_step_t arg1_step,
1163 uint8_t *arg2_output,
1164 size_t arg3_output_size,
1165 size_t *arg4_output_length)
1166{
David Horstmann0a8abde2024-03-13 15:57:46 +00001167#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
David Horstmann6076fe42024-01-23 15:28:51 +00001168 MBEDTLS_TEST_MEMORY_POISON(arg2_output, arg3_output_size);
David Horstmann0a8abde2024-03-13 15:57:46 +00001169#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001170 psa_status_t status = (psa_pake_output)(arg0_operation, arg1_step, arg2_output, arg3_output_size, arg4_output_length);
David Horstmann0a8abde2024-03-13 15:57:46 +00001171#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
David Horstmann6076fe42024-01-23 15:28:51 +00001172 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_output, arg3_output_size);
David Horstmann0a8abde2024-03-13 15:57:46 +00001173#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001174 return status;
1175}
Ronald Cron7062d3d2024-05-24 10:28:15 +02001176#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001177
1178/* Wrapper for psa_pake_set_password_key */
Ronald Cron7062d3d2024-05-24 10:28:15 +02001179#if defined(PSA_WANT_ALG_SOME_PAKE)
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001180psa_status_t mbedtls_test_wrap_psa_pake_set_password_key(
1181 psa_pake_operation_t *arg0_operation,
1182 mbedtls_svc_key_id_t arg1_password)
1183{
1184 psa_status_t status = (psa_pake_set_password_key)(arg0_operation, arg1_password);
1185 return status;
1186}
Ronald Cron7062d3d2024-05-24 10:28:15 +02001187#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001188
1189/* Wrapper for psa_pake_set_peer */
Ronald Cron7062d3d2024-05-24 10:28:15 +02001190#if defined(PSA_WANT_ALG_SOME_PAKE)
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001191psa_status_t mbedtls_test_wrap_psa_pake_set_peer(
1192 psa_pake_operation_t *arg0_operation,
1193 const uint8_t *arg1_peer_id,
1194 size_t arg2_peer_id_len)
1195{
David Horstmann0a8abde2024-03-13 15:57:46 +00001196#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
David Horstmann6076fe42024-01-23 15:28:51 +00001197 MBEDTLS_TEST_MEMORY_POISON(arg1_peer_id, arg2_peer_id_len);
David Horstmann0a8abde2024-03-13 15:57:46 +00001198#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001199 psa_status_t status = (psa_pake_set_peer)(arg0_operation, arg1_peer_id, arg2_peer_id_len);
David Horstmann0a8abde2024-03-13 15:57:46 +00001200#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
David Horstmann6076fe42024-01-23 15:28:51 +00001201 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_peer_id, arg2_peer_id_len);
David Horstmann0a8abde2024-03-13 15:57:46 +00001202#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001203 return status;
1204}
Ronald Cron7062d3d2024-05-24 10:28:15 +02001205#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001206
1207/* Wrapper for psa_pake_set_role */
Ronald Cron7062d3d2024-05-24 10:28:15 +02001208#if defined(PSA_WANT_ALG_SOME_PAKE)
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001209psa_status_t mbedtls_test_wrap_psa_pake_set_role(
1210 psa_pake_operation_t *arg0_operation,
1211 psa_pake_role_t arg1_role)
1212{
1213 psa_status_t status = (psa_pake_set_role)(arg0_operation, arg1_role);
1214 return status;
1215}
Ronald Cron7062d3d2024-05-24 10:28:15 +02001216#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001217
1218/* Wrapper for psa_pake_set_user */
Ronald Cron7062d3d2024-05-24 10:28:15 +02001219#if defined(PSA_WANT_ALG_SOME_PAKE)
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001220psa_status_t mbedtls_test_wrap_psa_pake_set_user(
1221 psa_pake_operation_t *arg0_operation,
1222 const uint8_t *arg1_user_id,
1223 size_t arg2_user_id_len)
1224{
David Horstmann0a8abde2024-03-13 15:57:46 +00001225#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
David Horstmann6076fe42024-01-23 15:28:51 +00001226 MBEDTLS_TEST_MEMORY_POISON(arg1_user_id, arg2_user_id_len);
David Horstmann0a8abde2024-03-13 15:57:46 +00001227#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001228 psa_status_t status = (psa_pake_set_user)(arg0_operation, arg1_user_id, arg2_user_id_len);
David Horstmann0a8abde2024-03-13 15:57:46 +00001229#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
David Horstmann6076fe42024-01-23 15:28:51 +00001230 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_user_id, arg2_user_id_len);
David Horstmann0a8abde2024-03-13 15:57:46 +00001231#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001232 return status;
1233}
Ronald Cron7062d3d2024-05-24 10:28:15 +02001234#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001235
1236/* Wrapper for psa_pake_setup */
Ronald Cron7062d3d2024-05-24 10:28:15 +02001237#if defined(PSA_WANT_ALG_SOME_PAKE)
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001238psa_status_t mbedtls_test_wrap_psa_pake_setup(
1239 psa_pake_operation_t *arg0_operation,
1240 const psa_pake_cipher_suite_t *arg1_cipher_suite)
1241{
1242 psa_status_t status = (psa_pake_setup)(arg0_operation, arg1_cipher_suite);
1243 return status;
1244}
Ronald Cron7062d3d2024-05-24 10:28:15 +02001245#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001246
1247/* Wrapper for psa_purge_key */
1248psa_status_t mbedtls_test_wrap_psa_purge_key(
1249 mbedtls_svc_key_id_t arg0_key)
1250{
1251 psa_status_t status = (psa_purge_key)(arg0_key);
1252 return status;
1253}
1254
1255/* Wrapper for psa_raw_key_agreement */
1256psa_status_t mbedtls_test_wrap_psa_raw_key_agreement(
1257 psa_algorithm_t arg0_alg,
1258 mbedtls_svc_key_id_t arg1_private_key,
1259 const uint8_t *arg2_peer_key,
1260 size_t arg3_peer_key_length,
1261 uint8_t *arg4_output,
1262 size_t arg5_output_size,
1263 size_t *arg6_output_length)
1264{
David Horstmann0a8abde2024-03-13 15:57:46 +00001265#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneyfe2bda32024-02-15 13:35:06 +00001266 MBEDTLS_TEST_MEMORY_POISON(arg2_peer_key, arg3_peer_key_length);
1267 MBEDTLS_TEST_MEMORY_POISON(arg4_output, arg5_output_size);
David Horstmann0a8abde2024-03-13 15:57:46 +00001268#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001269 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);
David Horstmann0a8abde2024-03-13 15:57:46 +00001270#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneyfe2bda32024-02-15 13:35:06 +00001271 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_peer_key, arg3_peer_key_length);
1272 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_output, arg5_output_size);
David Horstmann0a8abde2024-03-13 15:57:46 +00001273#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001274 return status;
1275}
1276
1277/* Wrapper for psa_sign_hash */
1278psa_status_t mbedtls_test_wrap_psa_sign_hash(
1279 mbedtls_svc_key_id_t arg0_key,
1280 psa_algorithm_t arg1_alg,
1281 const uint8_t *arg2_hash,
1282 size_t arg3_hash_length,
1283 uint8_t *arg4_signature,
1284 size_t arg5_signature_size,
1285 size_t *arg6_signature_length)
1286{
David Horstmann0a8abde2024-03-13 15:57:46 +00001287#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneyf430f472024-01-30 12:25:35 +00001288 MBEDTLS_TEST_MEMORY_POISON(arg2_hash, arg3_hash_length);
1289 MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_size);
David Horstmann0a8abde2024-03-13 15:57:46 +00001290#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001291 psa_status_t status = (psa_sign_hash)(arg0_key, arg1_alg, arg2_hash, arg3_hash_length, arg4_signature, arg5_signature_size, arg6_signature_length);
David Horstmann0a8abde2024-03-13 15:57:46 +00001292#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneyf430f472024-01-30 12:25:35 +00001293 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_hash, arg3_hash_length);
1294 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_size);
David Horstmann0a8abde2024-03-13 15:57:46 +00001295#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001296 return status;
1297}
1298
1299/* Wrapper for psa_sign_hash_abort */
1300psa_status_t mbedtls_test_wrap_psa_sign_hash_abort(
1301 psa_sign_hash_interruptible_operation_t *arg0_operation)
1302{
1303 psa_status_t status = (psa_sign_hash_abort)(arg0_operation);
1304 return status;
1305}
1306
1307/* Wrapper for psa_sign_hash_complete */
1308psa_status_t mbedtls_test_wrap_psa_sign_hash_complete(
1309 psa_sign_hash_interruptible_operation_t *arg0_operation,
1310 uint8_t *arg1_signature,
1311 size_t arg2_signature_size,
1312 size_t *arg3_signature_length)
1313{
David Horstmann0a8abde2024-03-13 15:57:46 +00001314#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
David Horstmann5d64c6a2024-03-11 13:58:07 +00001315 MBEDTLS_TEST_MEMORY_POISON(arg1_signature, arg2_signature_size);
David Horstmann0a8abde2024-03-13 15:57:46 +00001316#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001317 psa_status_t status = (psa_sign_hash_complete)(arg0_operation, arg1_signature, arg2_signature_size, arg3_signature_length);
David Horstmann0a8abde2024-03-13 15:57:46 +00001318#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
David Horstmann5d64c6a2024-03-11 13:58:07 +00001319 MBEDTLS_TEST_MEMORY_UNPOISON(arg1_signature, arg2_signature_size);
David Horstmann0a8abde2024-03-13 15:57:46 +00001320#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001321 return status;
1322}
1323
1324/* Wrapper for psa_sign_hash_start */
1325psa_status_t mbedtls_test_wrap_psa_sign_hash_start(
1326 psa_sign_hash_interruptible_operation_t *arg0_operation,
1327 mbedtls_svc_key_id_t arg1_key,
1328 psa_algorithm_t arg2_alg,
1329 const uint8_t *arg3_hash,
1330 size_t arg4_hash_length)
1331{
David Horstmann0a8abde2024-03-13 15:57:46 +00001332#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
David Horstmann5d64c6a2024-03-11 13:58:07 +00001333 MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_length);
David Horstmann0a8abde2024-03-13 15:57:46 +00001334#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001335 psa_status_t status = (psa_sign_hash_start)(arg0_operation, arg1_key, arg2_alg, arg3_hash, arg4_hash_length);
David Horstmann0a8abde2024-03-13 15:57:46 +00001336#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
David Horstmann5d64c6a2024-03-11 13:58:07 +00001337 MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_length);
David Horstmann0a8abde2024-03-13 15:57:46 +00001338#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001339 return status;
1340}
1341
1342/* Wrapper for psa_sign_message */
1343psa_status_t mbedtls_test_wrap_psa_sign_message(
1344 mbedtls_svc_key_id_t arg0_key,
1345 psa_algorithm_t arg1_alg,
1346 const uint8_t *arg2_input,
1347 size_t arg3_input_length,
1348 uint8_t *arg4_signature,
1349 size_t arg5_signature_size,
1350 size_t *arg6_signature_length)
1351{
David Horstmann0a8abde2024-03-13 15:57:46 +00001352#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneyf430f472024-01-30 12:25:35 +00001353 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
1354 MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_size);
David Horstmann0a8abde2024-03-13 15:57:46 +00001355#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001356 psa_status_t status = (psa_sign_message)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_signature, arg5_signature_size, arg6_signature_length);
David Horstmann0a8abde2024-03-13 15:57:46 +00001357#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneyf430f472024-01-30 12:25:35 +00001358 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
1359 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_size);
David Horstmann0a8abde2024-03-13 15:57:46 +00001360#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001361 return status;
1362}
1363
1364/* Wrapper for psa_verify_hash */
1365psa_status_t mbedtls_test_wrap_psa_verify_hash(
1366 mbedtls_svc_key_id_t arg0_key,
1367 psa_algorithm_t arg1_alg,
1368 const uint8_t *arg2_hash,
1369 size_t arg3_hash_length,
1370 const uint8_t *arg4_signature,
1371 size_t arg5_signature_length)
1372{
David Horstmann0a8abde2024-03-13 15:57:46 +00001373#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneyf430f472024-01-30 12:25:35 +00001374 MBEDTLS_TEST_MEMORY_POISON(arg2_hash, arg3_hash_length);
1375 MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_length);
David Horstmann0a8abde2024-03-13 15:57:46 +00001376#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001377 psa_status_t status = (psa_verify_hash)(arg0_key, arg1_alg, arg2_hash, arg3_hash_length, arg4_signature, arg5_signature_length);
David Horstmann0a8abde2024-03-13 15:57:46 +00001378#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneyf430f472024-01-30 12:25:35 +00001379 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_hash, arg3_hash_length);
1380 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_length);
David Horstmann0a8abde2024-03-13 15:57:46 +00001381#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001382 return status;
1383}
1384
1385/* Wrapper for psa_verify_hash_abort */
1386psa_status_t mbedtls_test_wrap_psa_verify_hash_abort(
1387 psa_verify_hash_interruptible_operation_t *arg0_operation)
1388{
1389 psa_status_t status = (psa_verify_hash_abort)(arg0_operation);
1390 return status;
1391}
1392
1393/* Wrapper for psa_verify_hash_complete */
1394psa_status_t mbedtls_test_wrap_psa_verify_hash_complete(
1395 psa_verify_hash_interruptible_operation_t *arg0_operation)
1396{
1397 psa_status_t status = (psa_verify_hash_complete)(arg0_operation);
1398 return status;
1399}
1400
1401/* Wrapper for psa_verify_hash_start */
1402psa_status_t mbedtls_test_wrap_psa_verify_hash_start(
1403 psa_verify_hash_interruptible_operation_t *arg0_operation,
1404 mbedtls_svc_key_id_t arg1_key,
1405 psa_algorithm_t arg2_alg,
1406 const uint8_t *arg3_hash,
1407 size_t arg4_hash_length,
1408 const uint8_t *arg5_signature,
1409 size_t arg6_signature_length)
1410{
David Horstmann0a8abde2024-03-13 15:57:46 +00001411#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
David Horstmann5d64c6a2024-03-11 13:58:07 +00001412 MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_length);
1413 MBEDTLS_TEST_MEMORY_POISON(arg5_signature, arg6_signature_length);
David Horstmann0a8abde2024-03-13 15:57:46 +00001414#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001415 psa_status_t status = (psa_verify_hash_start)(arg0_operation, arg1_key, arg2_alg, arg3_hash, arg4_hash_length, arg5_signature, arg6_signature_length);
David Horstmann0a8abde2024-03-13 15:57:46 +00001416#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
David Horstmann5d64c6a2024-03-11 13:58:07 +00001417 MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_length);
1418 MBEDTLS_TEST_MEMORY_UNPOISON(arg5_signature, arg6_signature_length);
David Horstmann0a8abde2024-03-13 15:57:46 +00001419#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001420 return status;
1421}
1422
1423/* Wrapper for psa_verify_message */
1424psa_status_t mbedtls_test_wrap_psa_verify_message(
1425 mbedtls_svc_key_id_t arg0_key,
1426 psa_algorithm_t arg1_alg,
1427 const uint8_t *arg2_input,
1428 size_t arg3_input_length,
1429 const uint8_t *arg4_signature,
1430 size_t arg5_signature_length)
1431{
David Horstmann0a8abde2024-03-13 15:57:46 +00001432#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneyf430f472024-01-30 12:25:35 +00001433 MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length);
1434 MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_length);
David Horstmann0a8abde2024-03-13 15:57:46 +00001435#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001436 psa_status_t status = (psa_verify_message)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_signature, arg5_signature_length);
David Horstmann0a8abde2024-03-13 15:57:46 +00001437#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
Thomas Daubneyf430f472024-01-30 12:25:35 +00001438 MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length);
1439 MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_length);
David Horstmann0a8abde2024-03-13 15:57:46 +00001440#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001441 return status;
1442}
1443
Gilles Peskine4411c9c2024-01-04 20:51:38 +01001444#endif /* defined(MBEDTLS_PSA_CRYPTO_C) && defined(MBEDTLS_TEST_HOOKS) && \
1445 !defined(RECORD_PSA_STATUS_COVERAGE_LOG) */
Gilles Peskine6e4332c2024-01-04 16:42:40 +01001446
1447/* End of automatically generated file. */