Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1 | /* 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 Peskine | a980aa0 | 2024-01-04 20:51:38 +0100 | [diff] [blame] | 13 | #if defined(MBEDTLS_PSA_CRYPTO_C) && defined(MBEDTLS_TEST_HOOKS) && \ |
| 14 | !defined(RECORD_PSA_STATUS_COVERAGE_LOG) |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 15 | |
| 16 | #include <psa/crypto.h> |
| 17 | |
Gilles Peskine | 42fa8ea | 2024-01-04 16:59:28 +0100 | [diff] [blame] | 18 | #include <test/memory.h> |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 19 | #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) |
| 24 | psa_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) |
| 35 | psa_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) |
| 47 | psa_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 */ |
| 56 | psa_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 */ |
| 74 | psa_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 */ |
| 92 | psa_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 */ |
| 108 | psa_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 | { |
Thomas Daubney | d8adccf | 2024-01-30 14:41:05 +0000 | [diff] [blame^] | 119 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 120 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 121 | MBEDTLS_TEST_MEMORY_POISON(arg4_salt, arg5_salt_length); |
| 122 | MBEDTLS_TEST_MEMORY_POISON(arg6_output, arg7_output_size); |
| 123 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 124 | psa_status_t status = (psa_asymmetric_encrypt)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_salt, arg5_salt_length, arg6_output, arg7_output_size, arg8_output_length); |
Thomas Daubney | d8adccf | 2024-01-30 14:41:05 +0000 | [diff] [blame^] | 125 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 126 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 127 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_salt, arg5_salt_length); |
| 128 | MBEDTLS_TEST_MEMORY_UNPOISON(arg6_output, arg7_output_size); |
| 129 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 130 | return status; |
| 131 | } |
| 132 | |
| 133 | /* Wrapper for psa_cipher_abort */ |
| 134 | psa_status_t mbedtls_test_wrap_psa_cipher_abort( |
| 135 | psa_cipher_operation_t *arg0_operation) |
| 136 | { |
| 137 | psa_status_t status = (psa_cipher_abort)(arg0_operation); |
| 138 | return status; |
| 139 | } |
| 140 | |
| 141 | /* Wrapper for psa_cipher_decrypt */ |
| 142 | psa_status_t mbedtls_test_wrap_psa_cipher_decrypt( |
| 143 | mbedtls_svc_key_id_t arg0_key, |
| 144 | psa_algorithm_t arg1_alg, |
| 145 | const uint8_t *arg2_input, |
| 146 | size_t arg3_input_length, |
| 147 | uint8_t *arg4_output, |
| 148 | size_t arg5_output_size, |
| 149 | size_t *arg6_output_length) |
| 150 | { |
| 151 | psa_status_t status = (psa_cipher_decrypt)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_output, arg5_output_size, arg6_output_length); |
| 152 | return status; |
| 153 | } |
| 154 | |
| 155 | /* Wrapper for psa_cipher_decrypt_setup */ |
| 156 | psa_status_t mbedtls_test_wrap_psa_cipher_decrypt_setup( |
| 157 | psa_cipher_operation_t *arg0_operation, |
| 158 | mbedtls_svc_key_id_t arg1_key, |
| 159 | psa_algorithm_t arg2_alg) |
| 160 | { |
| 161 | psa_status_t status = (psa_cipher_decrypt_setup)(arg0_operation, arg1_key, arg2_alg); |
| 162 | return status; |
| 163 | } |
| 164 | |
| 165 | /* Wrapper for psa_cipher_encrypt */ |
| 166 | psa_status_t mbedtls_test_wrap_psa_cipher_encrypt( |
| 167 | mbedtls_svc_key_id_t arg0_key, |
| 168 | psa_algorithm_t arg1_alg, |
| 169 | const uint8_t *arg2_input, |
| 170 | size_t arg3_input_length, |
| 171 | uint8_t *arg4_output, |
| 172 | size_t arg5_output_size, |
| 173 | size_t *arg6_output_length) |
| 174 | { |
Ryan Everett | 810421c | 2024-01-25 12:09:09 +0000 | [diff] [blame] | 175 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 176 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 177 | MBEDTLS_TEST_MEMORY_POISON(arg4_output, arg5_output_size); |
| 178 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 179 | 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 Everett | 810421c | 2024-01-25 12:09:09 +0000 | [diff] [blame] | 180 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 181 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 182 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_output, arg5_output_size); |
| 183 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 184 | return status; |
| 185 | } |
| 186 | |
| 187 | /* Wrapper for psa_cipher_encrypt_setup */ |
| 188 | psa_status_t mbedtls_test_wrap_psa_cipher_encrypt_setup( |
| 189 | psa_cipher_operation_t *arg0_operation, |
| 190 | mbedtls_svc_key_id_t arg1_key, |
| 191 | psa_algorithm_t arg2_alg) |
| 192 | { |
| 193 | psa_status_t status = (psa_cipher_encrypt_setup)(arg0_operation, arg1_key, arg2_alg); |
| 194 | return status; |
| 195 | } |
| 196 | |
| 197 | /* Wrapper for psa_cipher_finish */ |
| 198 | psa_status_t mbedtls_test_wrap_psa_cipher_finish( |
| 199 | psa_cipher_operation_t *arg0_operation, |
| 200 | uint8_t *arg1_output, |
| 201 | size_t arg2_output_size, |
| 202 | size_t *arg3_output_length) |
| 203 | { |
| 204 | psa_status_t status = (psa_cipher_finish)(arg0_operation, arg1_output, arg2_output_size, arg3_output_length); |
| 205 | return status; |
| 206 | } |
| 207 | |
| 208 | /* Wrapper for psa_cipher_generate_iv */ |
| 209 | psa_status_t mbedtls_test_wrap_psa_cipher_generate_iv( |
| 210 | psa_cipher_operation_t *arg0_operation, |
| 211 | uint8_t *arg1_iv, |
| 212 | size_t arg2_iv_size, |
| 213 | size_t *arg3_iv_length) |
| 214 | { |
| 215 | psa_status_t status = (psa_cipher_generate_iv)(arg0_operation, arg1_iv, arg2_iv_size, arg3_iv_length); |
| 216 | return status; |
| 217 | } |
| 218 | |
| 219 | /* Wrapper for psa_cipher_set_iv */ |
| 220 | psa_status_t mbedtls_test_wrap_psa_cipher_set_iv( |
| 221 | psa_cipher_operation_t *arg0_operation, |
| 222 | const uint8_t *arg1_iv, |
| 223 | size_t arg2_iv_length) |
| 224 | { |
| 225 | psa_status_t status = (psa_cipher_set_iv)(arg0_operation, arg1_iv, arg2_iv_length); |
| 226 | return status; |
| 227 | } |
| 228 | |
| 229 | /* Wrapper for psa_cipher_update */ |
| 230 | psa_status_t mbedtls_test_wrap_psa_cipher_update( |
| 231 | psa_cipher_operation_t *arg0_operation, |
| 232 | const uint8_t *arg1_input, |
| 233 | size_t arg2_input_length, |
| 234 | uint8_t *arg3_output, |
| 235 | size_t arg4_output_size, |
| 236 | size_t *arg5_output_length) |
| 237 | { |
| 238 | psa_status_t status = (psa_cipher_update)(arg0_operation, arg1_input, arg2_input_length, arg3_output, arg4_output_size, arg5_output_length); |
| 239 | return status; |
| 240 | } |
| 241 | |
| 242 | /* Wrapper for psa_copy_key */ |
| 243 | psa_status_t mbedtls_test_wrap_psa_copy_key( |
| 244 | mbedtls_svc_key_id_t arg0_source_key, |
| 245 | const psa_key_attributes_t *arg1_attributes, |
| 246 | mbedtls_svc_key_id_t *arg2_target_key) |
| 247 | { |
| 248 | psa_status_t status = (psa_copy_key)(arg0_source_key, arg1_attributes, arg2_target_key); |
| 249 | return status; |
| 250 | } |
| 251 | |
| 252 | /* Wrapper for psa_crypto_init */ |
| 253 | psa_status_t mbedtls_test_wrap_psa_crypto_init(void) |
| 254 | { |
| 255 | psa_status_t status = (psa_crypto_init)(); |
| 256 | return status; |
| 257 | } |
| 258 | |
| 259 | /* Wrapper for psa_destroy_key */ |
| 260 | psa_status_t mbedtls_test_wrap_psa_destroy_key( |
| 261 | mbedtls_svc_key_id_t arg0_key) |
| 262 | { |
| 263 | psa_status_t status = (psa_destroy_key)(arg0_key); |
| 264 | return status; |
| 265 | } |
| 266 | |
| 267 | /* Wrapper for psa_export_key */ |
| 268 | psa_status_t mbedtls_test_wrap_psa_export_key( |
| 269 | mbedtls_svc_key_id_t arg0_key, |
| 270 | uint8_t *arg1_data, |
| 271 | size_t arg2_data_size, |
| 272 | size_t *arg3_data_length) |
| 273 | { |
Ryan Everett | dcbc1d3 | 2024-01-25 11:04:48 +0000 | [diff] [blame] | 274 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 275 | MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_size); |
| 276 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 277 | psa_status_t status = (psa_export_key)(arg0_key, arg1_data, arg2_data_size, arg3_data_length); |
Ryan Everett | dcbc1d3 | 2024-01-25 11:04:48 +0000 | [diff] [blame] | 278 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 279 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_size); |
| 280 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 281 | return status; |
| 282 | } |
| 283 | |
| 284 | /* Wrapper for psa_export_public_key */ |
| 285 | psa_status_t mbedtls_test_wrap_psa_export_public_key( |
| 286 | mbedtls_svc_key_id_t arg0_key, |
| 287 | uint8_t *arg1_data, |
| 288 | size_t arg2_data_size, |
| 289 | size_t *arg3_data_length) |
| 290 | { |
Ryan Everett | dcbc1d3 | 2024-01-25 11:04:48 +0000 | [diff] [blame] | 291 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 292 | MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_size); |
| 293 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 294 | psa_status_t status = (psa_export_public_key)(arg0_key, arg1_data, arg2_data_size, arg3_data_length); |
Ryan Everett | dcbc1d3 | 2024-01-25 11:04:48 +0000 | [diff] [blame] | 295 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 296 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_size); |
| 297 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 298 | return status; |
| 299 | } |
| 300 | |
| 301 | /* Wrapper for psa_generate_key */ |
| 302 | psa_status_t mbedtls_test_wrap_psa_generate_key( |
| 303 | const psa_key_attributes_t *arg0_attributes, |
| 304 | mbedtls_svc_key_id_t *arg1_key) |
| 305 | { |
| 306 | psa_status_t status = (psa_generate_key)(arg0_attributes, arg1_key); |
| 307 | return status; |
| 308 | } |
| 309 | |
| 310 | /* Wrapper for psa_generate_random */ |
| 311 | psa_status_t mbedtls_test_wrap_psa_generate_random( |
| 312 | uint8_t *arg0_output, |
| 313 | size_t arg1_output_size) |
| 314 | { |
| 315 | psa_status_t status = (psa_generate_random)(arg0_output, arg1_output_size); |
| 316 | return status; |
| 317 | } |
| 318 | |
| 319 | /* Wrapper for psa_get_key_attributes */ |
| 320 | psa_status_t mbedtls_test_wrap_psa_get_key_attributes( |
| 321 | mbedtls_svc_key_id_t arg0_key, |
| 322 | psa_key_attributes_t *arg1_attributes) |
| 323 | { |
| 324 | psa_status_t status = (psa_get_key_attributes)(arg0_key, arg1_attributes); |
| 325 | return status; |
| 326 | } |
| 327 | |
| 328 | /* Wrapper for psa_hash_abort */ |
| 329 | psa_status_t mbedtls_test_wrap_psa_hash_abort( |
| 330 | psa_hash_operation_t *arg0_operation) |
| 331 | { |
| 332 | psa_status_t status = (psa_hash_abort)(arg0_operation); |
| 333 | return status; |
| 334 | } |
| 335 | |
| 336 | /* Wrapper for psa_hash_clone */ |
| 337 | psa_status_t mbedtls_test_wrap_psa_hash_clone( |
| 338 | const psa_hash_operation_t *arg0_source_operation, |
| 339 | psa_hash_operation_t *arg1_target_operation) |
| 340 | { |
| 341 | psa_status_t status = (psa_hash_clone)(arg0_source_operation, arg1_target_operation); |
| 342 | return status; |
| 343 | } |
| 344 | |
| 345 | /* Wrapper for psa_hash_compare */ |
| 346 | psa_status_t mbedtls_test_wrap_psa_hash_compare( |
| 347 | psa_algorithm_t arg0_alg, |
| 348 | const uint8_t *arg1_input, |
| 349 | size_t arg2_input_length, |
| 350 | const uint8_t *arg3_hash, |
| 351 | size_t arg4_hash_length) |
| 352 | { |
| 353 | psa_status_t status = (psa_hash_compare)(arg0_alg, arg1_input, arg2_input_length, arg3_hash, arg4_hash_length); |
| 354 | return status; |
| 355 | } |
| 356 | |
| 357 | /* Wrapper for psa_hash_compute */ |
| 358 | psa_status_t mbedtls_test_wrap_psa_hash_compute( |
| 359 | psa_algorithm_t arg0_alg, |
| 360 | const uint8_t *arg1_input, |
| 361 | size_t arg2_input_length, |
| 362 | uint8_t *arg3_hash, |
| 363 | size_t arg4_hash_size, |
| 364 | size_t *arg5_hash_length) |
| 365 | { |
| 366 | psa_status_t status = (psa_hash_compute)(arg0_alg, arg1_input, arg2_input_length, arg3_hash, arg4_hash_size, arg5_hash_length); |
| 367 | return status; |
| 368 | } |
| 369 | |
| 370 | /* Wrapper for psa_hash_finish */ |
| 371 | psa_status_t mbedtls_test_wrap_psa_hash_finish( |
| 372 | psa_hash_operation_t *arg0_operation, |
| 373 | uint8_t *arg1_hash, |
| 374 | size_t arg2_hash_size, |
| 375 | size_t *arg3_hash_length) |
| 376 | { |
| 377 | psa_status_t status = (psa_hash_finish)(arg0_operation, arg1_hash, arg2_hash_size, arg3_hash_length); |
| 378 | return status; |
| 379 | } |
| 380 | |
| 381 | /* Wrapper for psa_hash_setup */ |
| 382 | psa_status_t mbedtls_test_wrap_psa_hash_setup( |
| 383 | psa_hash_operation_t *arg0_operation, |
| 384 | psa_algorithm_t arg1_alg) |
| 385 | { |
| 386 | psa_status_t status = (psa_hash_setup)(arg0_operation, arg1_alg); |
| 387 | return status; |
| 388 | } |
| 389 | |
| 390 | /* Wrapper for psa_hash_update */ |
| 391 | psa_status_t mbedtls_test_wrap_psa_hash_update( |
| 392 | psa_hash_operation_t *arg0_operation, |
| 393 | const uint8_t *arg1_input, |
| 394 | size_t arg2_input_length) |
| 395 | { |
| 396 | psa_status_t status = (psa_hash_update)(arg0_operation, arg1_input, arg2_input_length); |
| 397 | return status; |
| 398 | } |
| 399 | |
| 400 | /* Wrapper for psa_hash_verify */ |
| 401 | psa_status_t mbedtls_test_wrap_psa_hash_verify( |
| 402 | psa_hash_operation_t *arg0_operation, |
| 403 | const uint8_t *arg1_hash, |
| 404 | size_t arg2_hash_length) |
| 405 | { |
| 406 | psa_status_t status = (psa_hash_verify)(arg0_operation, arg1_hash, arg2_hash_length); |
| 407 | return status; |
| 408 | } |
| 409 | |
| 410 | /* Wrapper for psa_import_key */ |
| 411 | psa_status_t mbedtls_test_wrap_psa_import_key( |
| 412 | const psa_key_attributes_t *arg0_attributes, |
| 413 | const uint8_t *arg1_data, |
| 414 | size_t arg2_data_length, |
| 415 | mbedtls_svc_key_id_t *arg3_key) |
| 416 | { |
Ryan Everett | dcbc1d3 | 2024-01-25 11:04:48 +0000 | [diff] [blame] | 417 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 418 | MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_length); |
| 419 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 420 | psa_status_t status = (psa_import_key)(arg0_attributes, arg1_data, arg2_data_length, arg3_key); |
Ryan Everett | dcbc1d3 | 2024-01-25 11:04:48 +0000 | [diff] [blame] | 421 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 422 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_length); |
| 423 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 424 | return status; |
| 425 | } |
| 426 | |
| 427 | /* Wrapper for psa_key_derivation_abort */ |
| 428 | psa_status_t mbedtls_test_wrap_psa_key_derivation_abort( |
| 429 | psa_key_derivation_operation_t *arg0_operation) |
| 430 | { |
| 431 | psa_status_t status = (psa_key_derivation_abort)(arg0_operation); |
| 432 | return status; |
| 433 | } |
| 434 | |
| 435 | /* Wrapper for psa_key_derivation_get_capacity */ |
| 436 | psa_status_t mbedtls_test_wrap_psa_key_derivation_get_capacity( |
| 437 | const psa_key_derivation_operation_t *arg0_operation, |
| 438 | size_t *arg1_capacity) |
| 439 | { |
| 440 | psa_status_t status = (psa_key_derivation_get_capacity)(arg0_operation, arg1_capacity); |
| 441 | return status; |
| 442 | } |
| 443 | |
| 444 | /* Wrapper for psa_key_derivation_input_bytes */ |
| 445 | psa_status_t mbedtls_test_wrap_psa_key_derivation_input_bytes( |
| 446 | psa_key_derivation_operation_t *arg0_operation, |
| 447 | psa_key_derivation_step_t arg1_step, |
| 448 | const uint8_t *arg2_data, |
| 449 | size_t arg3_data_length) |
| 450 | { |
| 451 | psa_status_t status = (psa_key_derivation_input_bytes)(arg0_operation, arg1_step, arg2_data, arg3_data_length); |
| 452 | return status; |
| 453 | } |
| 454 | |
| 455 | /* Wrapper for psa_key_derivation_input_key */ |
| 456 | psa_status_t mbedtls_test_wrap_psa_key_derivation_input_key( |
| 457 | psa_key_derivation_operation_t *arg0_operation, |
| 458 | psa_key_derivation_step_t arg1_step, |
| 459 | mbedtls_svc_key_id_t arg2_key) |
| 460 | { |
| 461 | psa_status_t status = (psa_key_derivation_input_key)(arg0_operation, arg1_step, arg2_key); |
| 462 | return status; |
| 463 | } |
| 464 | |
| 465 | /* Wrapper for psa_key_derivation_key_agreement */ |
| 466 | psa_status_t mbedtls_test_wrap_psa_key_derivation_key_agreement( |
| 467 | psa_key_derivation_operation_t *arg0_operation, |
| 468 | psa_key_derivation_step_t arg1_step, |
| 469 | mbedtls_svc_key_id_t arg2_private_key, |
| 470 | const uint8_t *arg3_peer_key, |
| 471 | size_t arg4_peer_key_length) |
| 472 | { |
| 473 | psa_status_t status = (psa_key_derivation_key_agreement)(arg0_operation, arg1_step, arg2_private_key, arg3_peer_key, arg4_peer_key_length); |
| 474 | return status; |
| 475 | } |
| 476 | |
| 477 | /* Wrapper for psa_key_derivation_output_bytes */ |
| 478 | psa_status_t mbedtls_test_wrap_psa_key_derivation_output_bytes( |
| 479 | psa_key_derivation_operation_t *arg0_operation, |
| 480 | uint8_t *arg1_output, |
| 481 | size_t arg2_output_length) |
| 482 | { |
| 483 | psa_status_t status = (psa_key_derivation_output_bytes)(arg0_operation, arg1_output, arg2_output_length); |
| 484 | return status; |
| 485 | } |
| 486 | |
| 487 | /* Wrapper for psa_key_derivation_output_key */ |
| 488 | psa_status_t mbedtls_test_wrap_psa_key_derivation_output_key( |
| 489 | const psa_key_attributes_t *arg0_attributes, |
| 490 | psa_key_derivation_operation_t *arg1_operation, |
| 491 | mbedtls_svc_key_id_t *arg2_key) |
| 492 | { |
| 493 | psa_status_t status = (psa_key_derivation_output_key)(arg0_attributes, arg1_operation, arg2_key); |
| 494 | return status; |
| 495 | } |
| 496 | |
| 497 | /* Wrapper for psa_key_derivation_set_capacity */ |
| 498 | psa_status_t mbedtls_test_wrap_psa_key_derivation_set_capacity( |
| 499 | psa_key_derivation_operation_t *arg0_operation, |
| 500 | size_t arg1_capacity) |
| 501 | { |
| 502 | psa_status_t status = (psa_key_derivation_set_capacity)(arg0_operation, arg1_capacity); |
| 503 | return status; |
| 504 | } |
| 505 | |
| 506 | /* Wrapper for psa_key_derivation_setup */ |
| 507 | psa_status_t mbedtls_test_wrap_psa_key_derivation_setup( |
| 508 | psa_key_derivation_operation_t *arg0_operation, |
| 509 | psa_algorithm_t arg1_alg) |
| 510 | { |
| 511 | psa_status_t status = (psa_key_derivation_setup)(arg0_operation, arg1_alg); |
| 512 | return status; |
| 513 | } |
| 514 | |
| 515 | /* Wrapper for psa_mac_abort */ |
| 516 | psa_status_t mbedtls_test_wrap_psa_mac_abort( |
| 517 | psa_mac_operation_t *arg0_operation) |
| 518 | { |
| 519 | psa_status_t status = (psa_mac_abort)(arg0_operation); |
| 520 | return status; |
| 521 | } |
| 522 | |
| 523 | /* Wrapper for psa_mac_compute */ |
| 524 | psa_status_t mbedtls_test_wrap_psa_mac_compute( |
| 525 | mbedtls_svc_key_id_t arg0_key, |
| 526 | psa_algorithm_t arg1_alg, |
| 527 | const uint8_t *arg2_input, |
| 528 | size_t arg3_input_length, |
| 529 | uint8_t *arg4_mac, |
| 530 | size_t arg5_mac_size, |
| 531 | size_t *arg6_mac_length) |
| 532 | { |
| 533 | psa_status_t status = (psa_mac_compute)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_mac, arg5_mac_size, arg6_mac_length); |
| 534 | return status; |
| 535 | } |
| 536 | |
| 537 | /* Wrapper for psa_mac_sign_finish */ |
| 538 | psa_status_t mbedtls_test_wrap_psa_mac_sign_finish( |
| 539 | psa_mac_operation_t *arg0_operation, |
| 540 | uint8_t *arg1_mac, |
| 541 | size_t arg2_mac_size, |
| 542 | size_t *arg3_mac_length) |
| 543 | { |
| 544 | psa_status_t status = (psa_mac_sign_finish)(arg0_operation, arg1_mac, arg2_mac_size, arg3_mac_length); |
| 545 | return status; |
| 546 | } |
| 547 | |
| 548 | /* Wrapper for psa_mac_sign_setup */ |
| 549 | psa_status_t mbedtls_test_wrap_psa_mac_sign_setup( |
| 550 | psa_mac_operation_t *arg0_operation, |
| 551 | mbedtls_svc_key_id_t arg1_key, |
| 552 | psa_algorithm_t arg2_alg) |
| 553 | { |
| 554 | psa_status_t status = (psa_mac_sign_setup)(arg0_operation, arg1_key, arg2_alg); |
| 555 | return status; |
| 556 | } |
| 557 | |
| 558 | /* Wrapper for psa_mac_update */ |
| 559 | psa_status_t mbedtls_test_wrap_psa_mac_update( |
| 560 | psa_mac_operation_t *arg0_operation, |
| 561 | const uint8_t *arg1_input, |
| 562 | size_t arg2_input_length) |
| 563 | { |
| 564 | psa_status_t status = (psa_mac_update)(arg0_operation, arg1_input, arg2_input_length); |
| 565 | return status; |
| 566 | } |
| 567 | |
| 568 | /* Wrapper for psa_mac_verify */ |
| 569 | psa_status_t mbedtls_test_wrap_psa_mac_verify( |
| 570 | mbedtls_svc_key_id_t arg0_key, |
| 571 | psa_algorithm_t arg1_alg, |
| 572 | const uint8_t *arg2_input, |
| 573 | size_t arg3_input_length, |
| 574 | const uint8_t *arg4_mac, |
| 575 | size_t arg5_mac_length) |
| 576 | { |
| 577 | psa_status_t status = (psa_mac_verify)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_mac, arg5_mac_length); |
| 578 | return status; |
| 579 | } |
| 580 | |
| 581 | /* Wrapper for psa_mac_verify_finish */ |
| 582 | psa_status_t mbedtls_test_wrap_psa_mac_verify_finish( |
| 583 | psa_mac_operation_t *arg0_operation, |
| 584 | const uint8_t *arg1_mac, |
| 585 | size_t arg2_mac_length) |
| 586 | { |
| 587 | psa_status_t status = (psa_mac_verify_finish)(arg0_operation, arg1_mac, arg2_mac_length); |
| 588 | return status; |
| 589 | } |
| 590 | |
| 591 | /* Wrapper for psa_mac_verify_setup */ |
| 592 | psa_status_t mbedtls_test_wrap_psa_mac_verify_setup( |
| 593 | psa_mac_operation_t *arg0_operation, |
| 594 | mbedtls_svc_key_id_t arg1_key, |
| 595 | psa_algorithm_t arg2_alg) |
| 596 | { |
| 597 | psa_status_t status = (psa_mac_verify_setup)(arg0_operation, arg1_key, arg2_alg); |
| 598 | return status; |
| 599 | } |
| 600 | |
| 601 | /* Wrapper for psa_purge_key */ |
| 602 | psa_status_t mbedtls_test_wrap_psa_purge_key( |
| 603 | mbedtls_svc_key_id_t arg0_key) |
| 604 | { |
| 605 | psa_status_t status = (psa_purge_key)(arg0_key); |
| 606 | return status; |
| 607 | } |
| 608 | |
| 609 | /* Wrapper for psa_raw_key_agreement */ |
| 610 | psa_status_t mbedtls_test_wrap_psa_raw_key_agreement( |
| 611 | psa_algorithm_t arg0_alg, |
| 612 | mbedtls_svc_key_id_t arg1_private_key, |
| 613 | const uint8_t *arg2_peer_key, |
| 614 | size_t arg3_peer_key_length, |
| 615 | uint8_t *arg4_output, |
| 616 | size_t arg5_output_size, |
| 617 | size_t *arg6_output_length) |
| 618 | { |
| 619 | 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); |
| 620 | return status; |
| 621 | } |
| 622 | |
| 623 | /* Wrapper for psa_sign_hash */ |
| 624 | psa_status_t mbedtls_test_wrap_psa_sign_hash( |
| 625 | mbedtls_svc_key_id_t arg0_key, |
| 626 | psa_algorithm_t arg1_alg, |
| 627 | const uint8_t *arg2_hash, |
| 628 | size_t arg3_hash_length, |
| 629 | uint8_t *arg4_signature, |
| 630 | size_t arg5_signature_size, |
| 631 | size_t *arg6_signature_length) |
| 632 | { |
Thomas Daubney | c63e31a | 2024-01-30 13:33:14 +0000 | [diff] [blame] | 633 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 634 | MBEDTLS_TEST_MEMORY_POISON(arg2_hash, arg3_hash_length); |
| 635 | MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_size); |
| 636 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 637 | 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 Daubney | c63e31a | 2024-01-30 13:33:14 +0000 | [diff] [blame] | 638 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 639 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_hash, arg3_hash_length); |
| 640 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_size); |
| 641 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 642 | return status; |
| 643 | } |
| 644 | |
| 645 | /* Wrapper for psa_sign_message */ |
| 646 | psa_status_t mbedtls_test_wrap_psa_sign_message( |
| 647 | mbedtls_svc_key_id_t arg0_key, |
| 648 | psa_algorithm_t arg1_alg, |
| 649 | const uint8_t *arg2_input, |
| 650 | size_t arg3_input_length, |
| 651 | uint8_t *arg4_signature, |
| 652 | size_t arg5_signature_size, |
| 653 | size_t *arg6_signature_length) |
| 654 | { |
Thomas Daubney | c63e31a | 2024-01-30 13:33:14 +0000 | [diff] [blame] | 655 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 656 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 657 | MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_size); |
| 658 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 659 | 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 Daubney | c63e31a | 2024-01-30 13:33:14 +0000 | [diff] [blame] | 660 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 661 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 662 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_size); |
| 663 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 664 | return status; |
| 665 | } |
| 666 | |
| 667 | /* Wrapper for psa_verify_hash */ |
| 668 | psa_status_t mbedtls_test_wrap_psa_verify_hash( |
| 669 | mbedtls_svc_key_id_t arg0_key, |
| 670 | psa_algorithm_t arg1_alg, |
| 671 | const uint8_t *arg2_hash, |
| 672 | size_t arg3_hash_length, |
| 673 | const uint8_t *arg4_signature, |
| 674 | size_t arg5_signature_length) |
| 675 | { |
Thomas Daubney | c63e31a | 2024-01-30 13:33:14 +0000 | [diff] [blame] | 676 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 677 | MBEDTLS_TEST_MEMORY_POISON(arg2_hash, arg3_hash_length); |
| 678 | MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_length); |
| 679 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 680 | psa_status_t status = (psa_verify_hash)(arg0_key, arg1_alg, arg2_hash, arg3_hash_length, arg4_signature, arg5_signature_length); |
Thomas Daubney | c63e31a | 2024-01-30 13:33:14 +0000 | [diff] [blame] | 681 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 682 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_hash, arg3_hash_length); |
| 683 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_length); |
| 684 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 685 | return status; |
| 686 | } |
| 687 | |
| 688 | /* Wrapper for psa_verify_message */ |
| 689 | psa_status_t mbedtls_test_wrap_psa_verify_message( |
| 690 | mbedtls_svc_key_id_t arg0_key, |
| 691 | psa_algorithm_t arg1_alg, |
| 692 | const uint8_t *arg2_input, |
| 693 | size_t arg3_input_length, |
| 694 | const uint8_t *arg4_signature, |
| 695 | size_t arg5_signature_length) |
| 696 | { |
Thomas Daubney | c63e31a | 2024-01-30 13:33:14 +0000 | [diff] [blame] | 697 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 698 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 699 | MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_length); |
| 700 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 701 | psa_status_t status = (psa_verify_message)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_signature, arg5_signature_length); |
Thomas Daubney | c63e31a | 2024-01-30 13:33:14 +0000 | [diff] [blame] | 702 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 703 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 704 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_length); |
| 705 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 706 | return status; |
| 707 | } |
| 708 | |
Gilles Peskine | a980aa0 | 2024-01-04 20:51:38 +0100 | [diff] [blame] | 709 | #endif /* defined(MBEDTLS_PSA_CRYPTO_C) && defined(MBEDTLS_TEST_HOOKS) && \ |
| 710 | !defined(RECORD_PSA_STATUS_COVERAGE_LOG) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 711 | |
| 712 | /* End of automatically generated file. */ |