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