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 | { |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 69 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 436b2ef | 2024-01-22 14:36:01 +0000 | [diff] [blame] | 70 | MBEDTLS_TEST_MEMORY_POISON(arg2_nonce, arg3_nonce_length); |
| 71 | MBEDTLS_TEST_MEMORY_POISON(arg4_additional_data, arg5_additional_data_length); |
| 72 | MBEDTLS_TEST_MEMORY_POISON(arg6_ciphertext, arg7_ciphertext_length); |
| 73 | MBEDTLS_TEST_MEMORY_POISON(arg8_plaintext, arg9_plaintext_size); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 74 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 75 | 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 Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 76 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 436b2ef | 2024-01-22 14:36:01 +0000 | [diff] [blame] | 77 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_nonce, arg3_nonce_length); |
| 78 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_additional_data, arg5_additional_data_length); |
| 79 | MBEDTLS_TEST_MEMORY_UNPOISON(arg6_ciphertext, arg7_ciphertext_length); |
| 80 | MBEDTLS_TEST_MEMORY_UNPOISON(arg8_plaintext, arg9_plaintext_size); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 81 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 82 | return status; |
| 83 | } |
| 84 | |
| 85 | /* Wrapper for psa_aead_encrypt */ |
| 86 | psa_status_t mbedtls_test_wrap_psa_aead_encrypt( |
| 87 | mbedtls_svc_key_id_t arg0_key, |
| 88 | psa_algorithm_t arg1_alg, |
| 89 | const uint8_t *arg2_nonce, |
| 90 | size_t arg3_nonce_length, |
| 91 | const uint8_t *arg4_additional_data, |
| 92 | size_t arg5_additional_data_length, |
| 93 | const uint8_t *arg6_plaintext, |
| 94 | size_t arg7_plaintext_length, |
| 95 | uint8_t *arg8_ciphertext, |
| 96 | size_t arg9_ciphertext_size, |
| 97 | size_t *arg10_ciphertext_length) |
| 98 | { |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 99 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 436b2ef | 2024-01-22 14:36:01 +0000 | [diff] [blame] | 100 | MBEDTLS_TEST_MEMORY_POISON(arg2_nonce, arg3_nonce_length); |
| 101 | MBEDTLS_TEST_MEMORY_POISON(arg4_additional_data, arg5_additional_data_length); |
| 102 | MBEDTLS_TEST_MEMORY_POISON(arg6_plaintext, arg7_plaintext_length); |
| 103 | MBEDTLS_TEST_MEMORY_POISON(arg8_ciphertext, arg9_ciphertext_size); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 104 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 105 | 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 Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 106 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 436b2ef | 2024-01-22 14:36:01 +0000 | [diff] [blame] | 107 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_nonce, arg3_nonce_length); |
| 108 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_additional_data, arg5_additional_data_length); |
| 109 | MBEDTLS_TEST_MEMORY_UNPOISON(arg6_plaintext, arg7_plaintext_length); |
| 110 | MBEDTLS_TEST_MEMORY_UNPOISON(arg8_ciphertext, arg9_ciphertext_size); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 111 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 112 | return status; |
| 113 | } |
| 114 | |
| 115 | /* Wrapper for psa_asymmetric_decrypt */ |
| 116 | psa_status_t mbedtls_test_wrap_psa_asymmetric_decrypt( |
| 117 | mbedtls_svc_key_id_t arg0_key, |
| 118 | psa_algorithm_t arg1_alg, |
| 119 | const uint8_t *arg2_input, |
| 120 | size_t arg3_input_length, |
| 121 | const uint8_t *arg4_salt, |
| 122 | size_t arg5_salt_length, |
| 123 | uint8_t *arg6_output, |
| 124 | size_t arg7_output_size, |
| 125 | size_t *arg8_output_length) |
| 126 | { |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 127 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | 2b614f9 | 2024-01-31 16:57:30 +0000 | [diff] [blame] | 128 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 129 | MBEDTLS_TEST_MEMORY_POISON(arg4_salt, arg5_salt_length); |
| 130 | MBEDTLS_TEST_MEMORY_POISON(arg6_output, arg7_output_size); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 131 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 132 | 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 Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 133 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | 2b614f9 | 2024-01-31 16:57:30 +0000 | [diff] [blame] | 134 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 135 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_salt, arg5_salt_length); |
| 136 | MBEDTLS_TEST_MEMORY_UNPOISON(arg6_output, arg7_output_size); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 137 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 138 | return status; |
| 139 | } |
| 140 | |
| 141 | /* Wrapper for psa_asymmetric_encrypt */ |
| 142 | psa_status_t mbedtls_test_wrap_psa_asymmetric_encrypt( |
| 143 | mbedtls_svc_key_id_t arg0_key, |
| 144 | psa_algorithm_t arg1_alg, |
| 145 | const uint8_t *arg2_input, |
| 146 | size_t arg3_input_length, |
| 147 | const uint8_t *arg4_salt, |
| 148 | size_t arg5_salt_length, |
| 149 | uint8_t *arg6_output, |
| 150 | size_t arg7_output_size, |
| 151 | size_t *arg8_output_length) |
| 152 | { |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 153 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | d8adccf | 2024-01-30 14:41:05 +0000 | [diff] [blame] | 154 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 155 | MBEDTLS_TEST_MEMORY_POISON(arg4_salt, arg5_salt_length); |
| 156 | MBEDTLS_TEST_MEMORY_POISON(arg6_output, arg7_output_size); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 157 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 158 | 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 Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 159 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | d8adccf | 2024-01-30 14:41:05 +0000 | [diff] [blame] | 160 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 161 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_salt, arg5_salt_length); |
| 162 | MBEDTLS_TEST_MEMORY_UNPOISON(arg6_output, arg7_output_size); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 163 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 164 | return status; |
| 165 | } |
| 166 | |
| 167 | /* Wrapper for psa_cipher_abort */ |
| 168 | psa_status_t mbedtls_test_wrap_psa_cipher_abort( |
| 169 | psa_cipher_operation_t *arg0_operation) |
| 170 | { |
| 171 | psa_status_t status = (psa_cipher_abort)(arg0_operation); |
| 172 | return status; |
| 173 | } |
| 174 | |
| 175 | /* Wrapper for psa_cipher_decrypt */ |
| 176 | psa_status_t mbedtls_test_wrap_psa_cipher_decrypt( |
| 177 | mbedtls_svc_key_id_t arg0_key, |
| 178 | psa_algorithm_t arg1_alg, |
| 179 | const uint8_t *arg2_input, |
| 180 | size_t arg3_input_length, |
| 181 | uint8_t *arg4_output, |
| 182 | size_t arg5_output_size, |
| 183 | size_t *arg6_output_length) |
| 184 | { |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 185 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Gabor Mezei | 143864c | 2024-01-24 16:58:40 +0100 | [diff] [blame] | 186 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 187 | MBEDTLS_TEST_MEMORY_POISON(arg4_output, arg5_output_size); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 188 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 189 | 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 Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 190 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Gabor Mezei | 143864c | 2024-01-24 16:58:40 +0100 | [diff] [blame] | 191 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 192 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_output, arg5_output_size); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 193 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 194 | return status; |
| 195 | } |
| 196 | |
| 197 | /* Wrapper for psa_cipher_decrypt_setup */ |
| 198 | psa_status_t mbedtls_test_wrap_psa_cipher_decrypt_setup( |
| 199 | psa_cipher_operation_t *arg0_operation, |
| 200 | mbedtls_svc_key_id_t arg1_key, |
| 201 | psa_algorithm_t arg2_alg) |
| 202 | { |
| 203 | psa_status_t status = (psa_cipher_decrypt_setup)(arg0_operation, arg1_key, arg2_alg); |
| 204 | return status; |
| 205 | } |
| 206 | |
| 207 | /* Wrapper for psa_cipher_encrypt */ |
| 208 | psa_status_t mbedtls_test_wrap_psa_cipher_encrypt( |
| 209 | mbedtls_svc_key_id_t arg0_key, |
| 210 | psa_algorithm_t arg1_alg, |
| 211 | const uint8_t *arg2_input, |
| 212 | size_t arg3_input_length, |
| 213 | uint8_t *arg4_output, |
| 214 | size_t arg5_output_size, |
| 215 | size_t *arg6_output_length) |
| 216 | { |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 217 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Ryan Everett | 810421c | 2024-01-25 12:09:09 +0000 | [diff] [blame] | 218 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 219 | MBEDTLS_TEST_MEMORY_POISON(arg4_output, arg5_output_size); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 220 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 221 | 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 Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 222 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Ryan Everett | 810421c | 2024-01-25 12:09:09 +0000 | [diff] [blame] | 223 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 224 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_output, arg5_output_size); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 225 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 226 | return status; |
| 227 | } |
| 228 | |
| 229 | /* Wrapper for psa_cipher_encrypt_setup */ |
| 230 | psa_status_t mbedtls_test_wrap_psa_cipher_encrypt_setup( |
| 231 | psa_cipher_operation_t *arg0_operation, |
| 232 | mbedtls_svc_key_id_t arg1_key, |
| 233 | psa_algorithm_t arg2_alg) |
| 234 | { |
| 235 | psa_status_t status = (psa_cipher_encrypt_setup)(arg0_operation, arg1_key, arg2_alg); |
| 236 | return status; |
| 237 | } |
| 238 | |
| 239 | /* Wrapper for psa_cipher_finish */ |
| 240 | psa_status_t mbedtls_test_wrap_psa_cipher_finish( |
| 241 | psa_cipher_operation_t *arg0_operation, |
| 242 | uint8_t *arg1_output, |
| 243 | size_t arg2_output_size, |
| 244 | size_t *arg3_output_length) |
| 245 | { |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 246 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Gabor Mezei | 143864c | 2024-01-24 16:58:40 +0100 | [diff] [blame] | 247 | MBEDTLS_TEST_MEMORY_POISON(arg1_output, arg2_output_size); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 248 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 249 | psa_status_t status = (psa_cipher_finish)(arg0_operation, arg1_output, arg2_output_size, arg3_output_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 250 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Gabor Mezei | 143864c | 2024-01-24 16:58:40 +0100 | [diff] [blame] | 251 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_output, arg2_output_size); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 252 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 253 | return status; |
| 254 | } |
| 255 | |
| 256 | /* Wrapper for psa_cipher_generate_iv */ |
| 257 | psa_status_t mbedtls_test_wrap_psa_cipher_generate_iv( |
| 258 | psa_cipher_operation_t *arg0_operation, |
| 259 | uint8_t *arg1_iv, |
| 260 | size_t arg2_iv_size, |
| 261 | size_t *arg3_iv_length) |
| 262 | { |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 263 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Gabor Mezei | 50bcca2 | 2024-02-01 10:39:56 +0100 | [diff] [blame] | 264 | MBEDTLS_TEST_MEMORY_POISON(arg1_iv, arg2_iv_size); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 265 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 266 | psa_status_t status = (psa_cipher_generate_iv)(arg0_operation, arg1_iv, arg2_iv_size, arg3_iv_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 267 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Gabor Mezei | 50bcca2 | 2024-02-01 10:39:56 +0100 | [diff] [blame] | 268 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_iv, arg2_iv_size); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 269 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 270 | return status; |
| 271 | } |
| 272 | |
| 273 | /* Wrapper for psa_cipher_set_iv */ |
| 274 | psa_status_t mbedtls_test_wrap_psa_cipher_set_iv( |
| 275 | psa_cipher_operation_t *arg0_operation, |
| 276 | const uint8_t *arg1_iv, |
| 277 | size_t arg2_iv_length) |
| 278 | { |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 279 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Gabor Mezei | 50bcca2 | 2024-02-01 10:39:56 +0100 | [diff] [blame] | 280 | MBEDTLS_TEST_MEMORY_POISON(arg1_iv, arg2_iv_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 281 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 282 | psa_status_t status = (psa_cipher_set_iv)(arg0_operation, arg1_iv, arg2_iv_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 283 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Gabor Mezei | 50bcca2 | 2024-02-01 10:39:56 +0100 | [diff] [blame] | 284 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_iv, arg2_iv_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 285 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 286 | return status; |
| 287 | } |
| 288 | |
| 289 | /* Wrapper for psa_cipher_update */ |
| 290 | psa_status_t mbedtls_test_wrap_psa_cipher_update( |
| 291 | psa_cipher_operation_t *arg0_operation, |
| 292 | const uint8_t *arg1_input, |
| 293 | size_t arg2_input_length, |
| 294 | uint8_t *arg3_output, |
| 295 | size_t arg4_output_size, |
| 296 | size_t *arg5_output_length) |
| 297 | { |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 298 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Gabor Mezei | 143864c | 2024-01-24 16:58:40 +0100 | [diff] [blame] | 299 | MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length); |
| 300 | MBEDTLS_TEST_MEMORY_POISON(arg3_output, arg4_output_size); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 301 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 302 | psa_status_t status = (psa_cipher_update)(arg0_operation, arg1_input, arg2_input_length, arg3_output, arg4_output_size, arg5_output_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 303 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Gabor Mezei | 143864c | 2024-01-24 16:58:40 +0100 | [diff] [blame] | 304 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length); |
| 305 | MBEDTLS_TEST_MEMORY_UNPOISON(arg3_output, arg4_output_size); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 306 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 307 | return status; |
| 308 | } |
| 309 | |
| 310 | /* Wrapper for psa_copy_key */ |
| 311 | psa_status_t mbedtls_test_wrap_psa_copy_key( |
| 312 | mbedtls_svc_key_id_t arg0_source_key, |
| 313 | const psa_key_attributes_t *arg1_attributes, |
| 314 | mbedtls_svc_key_id_t *arg2_target_key) |
| 315 | { |
| 316 | psa_status_t status = (psa_copy_key)(arg0_source_key, arg1_attributes, arg2_target_key); |
| 317 | return status; |
| 318 | } |
| 319 | |
| 320 | /* Wrapper for psa_crypto_init */ |
| 321 | psa_status_t mbedtls_test_wrap_psa_crypto_init(void) |
| 322 | { |
| 323 | psa_status_t status = (psa_crypto_init)(); |
| 324 | return status; |
| 325 | } |
| 326 | |
| 327 | /* Wrapper for psa_destroy_key */ |
| 328 | psa_status_t mbedtls_test_wrap_psa_destroy_key( |
| 329 | mbedtls_svc_key_id_t arg0_key) |
| 330 | { |
| 331 | psa_status_t status = (psa_destroy_key)(arg0_key); |
| 332 | return status; |
| 333 | } |
| 334 | |
| 335 | /* Wrapper for psa_export_key */ |
| 336 | psa_status_t mbedtls_test_wrap_psa_export_key( |
| 337 | mbedtls_svc_key_id_t arg0_key, |
| 338 | uint8_t *arg1_data, |
| 339 | size_t arg2_data_size, |
| 340 | size_t *arg3_data_length) |
| 341 | { |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 342 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Ryan Everett | dcbc1d3 | 2024-01-25 11:04:48 +0000 | [diff] [blame] | 343 | MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_size); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 344 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 345 | psa_status_t status = (psa_export_key)(arg0_key, arg1_data, arg2_data_size, arg3_data_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 346 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Ryan Everett | dcbc1d3 | 2024-01-25 11:04:48 +0000 | [diff] [blame] | 347 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_size); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 348 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 349 | return status; |
| 350 | } |
| 351 | |
| 352 | /* Wrapper for psa_export_public_key */ |
| 353 | psa_status_t mbedtls_test_wrap_psa_export_public_key( |
| 354 | mbedtls_svc_key_id_t arg0_key, |
| 355 | uint8_t *arg1_data, |
| 356 | size_t arg2_data_size, |
| 357 | size_t *arg3_data_length) |
| 358 | { |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 359 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Ryan Everett | dcbc1d3 | 2024-01-25 11:04:48 +0000 | [diff] [blame] | 360 | MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_size); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 361 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 362 | psa_status_t status = (psa_export_public_key)(arg0_key, arg1_data, arg2_data_size, arg3_data_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 363 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Ryan Everett | dcbc1d3 | 2024-01-25 11:04:48 +0000 | [diff] [blame] | 364 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_size); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 365 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 366 | return status; |
| 367 | } |
| 368 | |
| 369 | /* Wrapper for psa_generate_key */ |
| 370 | psa_status_t mbedtls_test_wrap_psa_generate_key( |
| 371 | const psa_key_attributes_t *arg0_attributes, |
| 372 | mbedtls_svc_key_id_t *arg1_key) |
| 373 | { |
| 374 | psa_status_t status = (psa_generate_key)(arg0_attributes, arg1_key); |
| 375 | return status; |
| 376 | } |
| 377 | |
| 378 | /* Wrapper for psa_generate_random */ |
| 379 | psa_status_t mbedtls_test_wrap_psa_generate_random( |
| 380 | uint8_t *arg0_output, |
| 381 | size_t arg1_output_size) |
| 382 | { |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 383 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 4e82150 | 2024-02-06 15:44:08 +0000 | [diff] [blame] | 384 | MBEDTLS_TEST_MEMORY_POISON(arg0_output, arg1_output_size); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 385 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 386 | psa_status_t status = (psa_generate_random)(arg0_output, arg1_output_size); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 387 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 4e82150 | 2024-02-06 15:44:08 +0000 | [diff] [blame] | 388 | MBEDTLS_TEST_MEMORY_UNPOISON(arg0_output, arg1_output_size); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 389 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 390 | return status; |
| 391 | } |
| 392 | |
| 393 | /* Wrapper for psa_get_key_attributes */ |
| 394 | psa_status_t mbedtls_test_wrap_psa_get_key_attributes( |
| 395 | mbedtls_svc_key_id_t arg0_key, |
| 396 | psa_key_attributes_t *arg1_attributes) |
| 397 | { |
| 398 | psa_status_t status = (psa_get_key_attributes)(arg0_key, arg1_attributes); |
| 399 | return status; |
| 400 | } |
| 401 | |
| 402 | /* Wrapper for psa_hash_abort */ |
| 403 | psa_status_t mbedtls_test_wrap_psa_hash_abort( |
| 404 | psa_hash_operation_t *arg0_operation) |
| 405 | { |
| 406 | psa_status_t status = (psa_hash_abort)(arg0_operation); |
| 407 | return status; |
| 408 | } |
| 409 | |
| 410 | /* Wrapper for psa_hash_clone */ |
| 411 | psa_status_t mbedtls_test_wrap_psa_hash_clone( |
| 412 | const psa_hash_operation_t *arg0_source_operation, |
| 413 | psa_hash_operation_t *arg1_target_operation) |
| 414 | { |
| 415 | psa_status_t status = (psa_hash_clone)(arg0_source_operation, arg1_target_operation); |
| 416 | return status; |
| 417 | } |
| 418 | |
| 419 | /* Wrapper for psa_hash_compare */ |
| 420 | psa_status_t mbedtls_test_wrap_psa_hash_compare( |
| 421 | psa_algorithm_t arg0_alg, |
| 422 | const uint8_t *arg1_input, |
| 423 | size_t arg2_input_length, |
| 424 | const uint8_t *arg3_hash, |
| 425 | size_t arg4_hash_length) |
| 426 | { |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 427 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | ebf9329 | 2024-01-25 17:09:10 +0000 | [diff] [blame] | 428 | MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length); |
| 429 | MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 430 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 431 | psa_status_t status = (psa_hash_compare)(arg0_alg, arg1_input, arg2_input_length, arg3_hash, arg4_hash_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 432 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | ebf9329 | 2024-01-25 17:09:10 +0000 | [diff] [blame] | 433 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length); |
| 434 | MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 435 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 436 | return status; |
| 437 | } |
| 438 | |
| 439 | /* Wrapper for psa_hash_compute */ |
| 440 | psa_status_t mbedtls_test_wrap_psa_hash_compute( |
| 441 | psa_algorithm_t arg0_alg, |
| 442 | const uint8_t *arg1_input, |
| 443 | size_t arg2_input_length, |
| 444 | uint8_t *arg3_hash, |
| 445 | size_t arg4_hash_size, |
| 446 | size_t *arg5_hash_length) |
| 447 | { |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 448 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | ebf9329 | 2024-01-25 17:09:10 +0000 | [diff] [blame] | 449 | MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length); |
| 450 | MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_size); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 451 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 452 | psa_status_t status = (psa_hash_compute)(arg0_alg, arg1_input, arg2_input_length, arg3_hash, arg4_hash_size, arg5_hash_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 453 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | ebf9329 | 2024-01-25 17:09:10 +0000 | [diff] [blame] | 454 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length); |
| 455 | MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_size); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 456 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 457 | return status; |
| 458 | } |
| 459 | |
| 460 | /* Wrapper for psa_hash_finish */ |
| 461 | psa_status_t mbedtls_test_wrap_psa_hash_finish( |
| 462 | psa_hash_operation_t *arg0_operation, |
| 463 | uint8_t *arg1_hash, |
| 464 | size_t arg2_hash_size, |
| 465 | size_t *arg3_hash_length) |
| 466 | { |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 467 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | ebf9329 | 2024-01-25 17:09:10 +0000 | [diff] [blame] | 468 | MBEDTLS_TEST_MEMORY_POISON(arg1_hash, arg2_hash_size); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 469 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 470 | psa_status_t status = (psa_hash_finish)(arg0_operation, arg1_hash, arg2_hash_size, arg3_hash_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 471 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | ebf9329 | 2024-01-25 17:09:10 +0000 | [diff] [blame] | 472 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_hash, arg2_hash_size); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 473 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 474 | return status; |
| 475 | } |
| 476 | |
| 477 | /* Wrapper for psa_hash_setup */ |
| 478 | psa_status_t mbedtls_test_wrap_psa_hash_setup( |
| 479 | psa_hash_operation_t *arg0_operation, |
| 480 | psa_algorithm_t arg1_alg) |
| 481 | { |
| 482 | psa_status_t status = (psa_hash_setup)(arg0_operation, arg1_alg); |
| 483 | return status; |
| 484 | } |
| 485 | |
| 486 | /* Wrapper for psa_hash_update */ |
| 487 | psa_status_t mbedtls_test_wrap_psa_hash_update( |
| 488 | psa_hash_operation_t *arg0_operation, |
| 489 | const uint8_t *arg1_input, |
| 490 | size_t arg2_input_length) |
| 491 | { |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 492 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | ebf9329 | 2024-01-25 17:09:10 +0000 | [diff] [blame] | 493 | MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 494 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 495 | psa_status_t status = (psa_hash_update)(arg0_operation, arg1_input, arg2_input_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 496 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | ebf9329 | 2024-01-25 17:09:10 +0000 | [diff] [blame] | 497 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 498 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 499 | return status; |
| 500 | } |
| 501 | |
| 502 | /* Wrapper for psa_hash_verify */ |
| 503 | psa_status_t mbedtls_test_wrap_psa_hash_verify( |
| 504 | psa_hash_operation_t *arg0_operation, |
| 505 | const uint8_t *arg1_hash, |
| 506 | size_t arg2_hash_length) |
| 507 | { |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 508 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | ebf9329 | 2024-01-25 17:09:10 +0000 | [diff] [blame] | 509 | MBEDTLS_TEST_MEMORY_POISON(arg1_hash, arg2_hash_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 510 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 511 | psa_status_t status = (psa_hash_verify)(arg0_operation, arg1_hash, arg2_hash_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 512 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | ebf9329 | 2024-01-25 17:09:10 +0000 | [diff] [blame] | 513 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_hash, arg2_hash_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 514 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 515 | return status; |
| 516 | } |
| 517 | |
| 518 | /* Wrapper for psa_import_key */ |
| 519 | psa_status_t mbedtls_test_wrap_psa_import_key( |
| 520 | const psa_key_attributes_t *arg0_attributes, |
| 521 | const uint8_t *arg1_data, |
| 522 | size_t arg2_data_length, |
| 523 | mbedtls_svc_key_id_t *arg3_key) |
| 524 | { |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 525 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Ryan Everett | dcbc1d3 | 2024-01-25 11:04:48 +0000 | [diff] [blame] | 526 | MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 527 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 528 | psa_status_t status = (psa_import_key)(arg0_attributes, arg1_data, arg2_data_length, arg3_key); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 529 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Ryan Everett | dcbc1d3 | 2024-01-25 11:04:48 +0000 | [diff] [blame] | 530 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 531 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 532 | return status; |
| 533 | } |
| 534 | |
| 535 | /* Wrapper for psa_key_derivation_abort */ |
| 536 | psa_status_t mbedtls_test_wrap_psa_key_derivation_abort( |
| 537 | psa_key_derivation_operation_t *arg0_operation) |
| 538 | { |
| 539 | psa_status_t status = (psa_key_derivation_abort)(arg0_operation); |
| 540 | return status; |
| 541 | } |
| 542 | |
| 543 | /* Wrapper for psa_key_derivation_get_capacity */ |
| 544 | psa_status_t mbedtls_test_wrap_psa_key_derivation_get_capacity( |
| 545 | const psa_key_derivation_operation_t *arg0_operation, |
| 546 | size_t *arg1_capacity) |
| 547 | { |
| 548 | psa_status_t status = (psa_key_derivation_get_capacity)(arg0_operation, arg1_capacity); |
| 549 | return status; |
| 550 | } |
| 551 | |
| 552 | /* Wrapper for psa_key_derivation_input_bytes */ |
| 553 | psa_status_t mbedtls_test_wrap_psa_key_derivation_input_bytes( |
| 554 | psa_key_derivation_operation_t *arg0_operation, |
| 555 | psa_key_derivation_step_t arg1_step, |
| 556 | const uint8_t *arg2_data, |
| 557 | size_t arg3_data_length) |
| 558 | { |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 559 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Ryan Everett | 6c9e69d | 2024-02-09 16:23:25 +0000 | [diff] [blame] | 560 | MBEDTLS_TEST_MEMORY_POISON(arg2_data, arg3_data_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 561 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 562 | psa_status_t status = (psa_key_derivation_input_bytes)(arg0_operation, arg1_step, arg2_data, arg3_data_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 563 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Ryan Everett | 6c9e69d | 2024-02-09 16:23:25 +0000 | [diff] [blame] | 564 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_data, arg3_data_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 565 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 566 | return status; |
| 567 | } |
| 568 | |
| 569 | /* Wrapper for psa_key_derivation_input_key */ |
| 570 | psa_status_t mbedtls_test_wrap_psa_key_derivation_input_key( |
| 571 | psa_key_derivation_operation_t *arg0_operation, |
| 572 | psa_key_derivation_step_t arg1_step, |
| 573 | mbedtls_svc_key_id_t arg2_key) |
| 574 | { |
| 575 | psa_status_t status = (psa_key_derivation_input_key)(arg0_operation, arg1_step, arg2_key); |
| 576 | return status; |
| 577 | } |
| 578 | |
| 579 | /* Wrapper for psa_key_derivation_key_agreement */ |
| 580 | psa_status_t mbedtls_test_wrap_psa_key_derivation_key_agreement( |
| 581 | psa_key_derivation_operation_t *arg0_operation, |
| 582 | psa_key_derivation_step_t arg1_step, |
| 583 | mbedtls_svc_key_id_t arg2_private_key, |
| 584 | const uint8_t *arg3_peer_key, |
| 585 | size_t arg4_peer_key_length) |
| 586 | { |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 587 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | db5d607 | 2024-02-15 14:18:02 +0000 | [diff] [blame] | 588 | MBEDTLS_TEST_MEMORY_POISON(arg3_peer_key, arg4_peer_key_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 589 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 590 | psa_status_t status = (psa_key_derivation_key_agreement)(arg0_operation, arg1_step, arg2_private_key, arg3_peer_key, arg4_peer_key_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 591 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | db5d607 | 2024-02-15 14:18:02 +0000 | [diff] [blame] | 592 | MBEDTLS_TEST_MEMORY_UNPOISON(arg3_peer_key, arg4_peer_key_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 593 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 594 | return status; |
| 595 | } |
| 596 | |
| 597 | /* Wrapper for psa_key_derivation_output_bytes */ |
| 598 | psa_status_t mbedtls_test_wrap_psa_key_derivation_output_bytes( |
| 599 | psa_key_derivation_operation_t *arg0_operation, |
| 600 | uint8_t *arg1_output, |
| 601 | size_t arg2_output_length) |
| 602 | { |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 603 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Ryan Everett | 6c9e69d | 2024-02-09 16:23:25 +0000 | [diff] [blame] | 604 | MBEDTLS_TEST_MEMORY_POISON(arg1_output, arg2_output_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 605 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 606 | psa_status_t status = (psa_key_derivation_output_bytes)(arg0_operation, arg1_output, arg2_output_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 607 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Ryan Everett | 6c9e69d | 2024-02-09 16:23:25 +0000 | [diff] [blame] | 608 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_output, arg2_output_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 609 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 610 | return status; |
| 611 | } |
| 612 | |
| 613 | /* Wrapper for psa_key_derivation_output_key */ |
| 614 | psa_status_t mbedtls_test_wrap_psa_key_derivation_output_key( |
| 615 | const psa_key_attributes_t *arg0_attributes, |
| 616 | psa_key_derivation_operation_t *arg1_operation, |
| 617 | mbedtls_svc_key_id_t *arg2_key) |
| 618 | { |
| 619 | psa_status_t status = (psa_key_derivation_output_key)(arg0_attributes, arg1_operation, arg2_key); |
| 620 | return status; |
| 621 | } |
| 622 | |
| 623 | /* Wrapper for psa_key_derivation_set_capacity */ |
| 624 | psa_status_t mbedtls_test_wrap_psa_key_derivation_set_capacity( |
| 625 | psa_key_derivation_operation_t *arg0_operation, |
| 626 | size_t arg1_capacity) |
| 627 | { |
| 628 | psa_status_t status = (psa_key_derivation_set_capacity)(arg0_operation, arg1_capacity); |
| 629 | return status; |
| 630 | } |
| 631 | |
| 632 | /* Wrapper for psa_key_derivation_setup */ |
| 633 | psa_status_t mbedtls_test_wrap_psa_key_derivation_setup( |
| 634 | psa_key_derivation_operation_t *arg0_operation, |
| 635 | psa_algorithm_t arg1_alg) |
| 636 | { |
| 637 | psa_status_t status = (psa_key_derivation_setup)(arg0_operation, arg1_alg); |
| 638 | return status; |
| 639 | } |
| 640 | |
| 641 | /* Wrapper for psa_mac_abort */ |
| 642 | psa_status_t mbedtls_test_wrap_psa_mac_abort( |
| 643 | psa_mac_operation_t *arg0_operation) |
| 644 | { |
| 645 | psa_status_t status = (psa_mac_abort)(arg0_operation); |
| 646 | return status; |
| 647 | } |
| 648 | |
| 649 | /* Wrapper for psa_mac_compute */ |
| 650 | psa_status_t mbedtls_test_wrap_psa_mac_compute( |
| 651 | mbedtls_svc_key_id_t arg0_key, |
| 652 | psa_algorithm_t arg1_alg, |
| 653 | const uint8_t *arg2_input, |
| 654 | size_t arg3_input_length, |
| 655 | uint8_t *arg4_mac, |
| 656 | size_t arg5_mac_size, |
| 657 | size_t *arg6_mac_length) |
| 658 | { |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 659 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | 6b91503 | 2024-01-30 12:07:38 +0000 | [diff] [blame] | 660 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 661 | MBEDTLS_TEST_MEMORY_POISON(arg4_mac, arg5_mac_size); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 662 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 663 | 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 Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 664 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | 6b91503 | 2024-01-30 12:07:38 +0000 | [diff] [blame] | 665 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 666 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_mac, arg5_mac_size); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 667 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 668 | return status; |
| 669 | } |
| 670 | |
| 671 | /* Wrapper for psa_mac_sign_finish */ |
| 672 | psa_status_t mbedtls_test_wrap_psa_mac_sign_finish( |
| 673 | psa_mac_operation_t *arg0_operation, |
| 674 | uint8_t *arg1_mac, |
| 675 | size_t arg2_mac_size, |
| 676 | size_t *arg3_mac_length) |
| 677 | { |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 678 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | 6b91503 | 2024-01-30 12:07:38 +0000 | [diff] [blame] | 679 | MBEDTLS_TEST_MEMORY_POISON(arg1_mac, arg2_mac_size); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 680 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 681 | psa_status_t status = (psa_mac_sign_finish)(arg0_operation, arg1_mac, arg2_mac_size, arg3_mac_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 682 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | 6b91503 | 2024-01-30 12:07:38 +0000 | [diff] [blame] | 683 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_mac, arg2_mac_size); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 684 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 685 | return status; |
| 686 | } |
| 687 | |
| 688 | /* Wrapper for psa_mac_sign_setup */ |
| 689 | psa_status_t mbedtls_test_wrap_psa_mac_sign_setup( |
| 690 | psa_mac_operation_t *arg0_operation, |
| 691 | mbedtls_svc_key_id_t arg1_key, |
| 692 | psa_algorithm_t arg2_alg) |
| 693 | { |
| 694 | psa_status_t status = (psa_mac_sign_setup)(arg0_operation, arg1_key, arg2_alg); |
| 695 | return status; |
| 696 | } |
| 697 | |
| 698 | /* Wrapper for psa_mac_update */ |
| 699 | psa_status_t mbedtls_test_wrap_psa_mac_update( |
| 700 | psa_mac_operation_t *arg0_operation, |
| 701 | const uint8_t *arg1_input, |
| 702 | size_t arg2_input_length) |
| 703 | { |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 704 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | 6b91503 | 2024-01-30 12:07:38 +0000 | [diff] [blame] | 705 | MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 706 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 707 | psa_status_t status = (psa_mac_update)(arg0_operation, arg1_input, arg2_input_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 708 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | 6b91503 | 2024-01-30 12:07:38 +0000 | [diff] [blame] | 709 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 710 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 711 | return status; |
| 712 | } |
| 713 | |
| 714 | /* Wrapper for psa_mac_verify */ |
| 715 | psa_status_t mbedtls_test_wrap_psa_mac_verify( |
| 716 | mbedtls_svc_key_id_t arg0_key, |
| 717 | psa_algorithm_t arg1_alg, |
| 718 | const uint8_t *arg2_input, |
| 719 | size_t arg3_input_length, |
| 720 | const uint8_t *arg4_mac, |
| 721 | size_t arg5_mac_length) |
| 722 | { |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 723 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | 6b91503 | 2024-01-30 12:07:38 +0000 | [diff] [blame] | 724 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 725 | MBEDTLS_TEST_MEMORY_POISON(arg4_mac, arg5_mac_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 726 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 727 | psa_status_t status = (psa_mac_verify)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_mac, arg5_mac_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 728 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | 6b91503 | 2024-01-30 12:07:38 +0000 | [diff] [blame] | 729 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 730 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_mac, arg5_mac_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 731 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 732 | return status; |
| 733 | } |
| 734 | |
| 735 | /* Wrapper for psa_mac_verify_finish */ |
| 736 | psa_status_t mbedtls_test_wrap_psa_mac_verify_finish( |
| 737 | psa_mac_operation_t *arg0_operation, |
| 738 | const uint8_t *arg1_mac, |
| 739 | size_t arg2_mac_length) |
| 740 | { |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 741 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | 6b91503 | 2024-01-30 12:07:38 +0000 | [diff] [blame] | 742 | MBEDTLS_TEST_MEMORY_POISON(arg1_mac, arg2_mac_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 743 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 744 | psa_status_t status = (psa_mac_verify_finish)(arg0_operation, arg1_mac, arg2_mac_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 745 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | 6b91503 | 2024-01-30 12:07:38 +0000 | [diff] [blame] | 746 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_mac, arg2_mac_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 747 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 748 | return status; |
| 749 | } |
| 750 | |
| 751 | /* Wrapper for psa_mac_verify_setup */ |
| 752 | psa_status_t mbedtls_test_wrap_psa_mac_verify_setup( |
| 753 | psa_mac_operation_t *arg0_operation, |
| 754 | mbedtls_svc_key_id_t arg1_key, |
| 755 | psa_algorithm_t arg2_alg) |
| 756 | { |
| 757 | psa_status_t status = (psa_mac_verify_setup)(arg0_operation, arg1_key, arg2_alg); |
| 758 | return status; |
| 759 | } |
| 760 | |
| 761 | /* Wrapper for psa_purge_key */ |
| 762 | psa_status_t mbedtls_test_wrap_psa_purge_key( |
| 763 | mbedtls_svc_key_id_t arg0_key) |
| 764 | { |
| 765 | psa_status_t status = (psa_purge_key)(arg0_key); |
| 766 | return status; |
| 767 | } |
| 768 | |
| 769 | /* Wrapper for psa_raw_key_agreement */ |
| 770 | psa_status_t mbedtls_test_wrap_psa_raw_key_agreement( |
| 771 | psa_algorithm_t arg0_alg, |
| 772 | mbedtls_svc_key_id_t arg1_private_key, |
| 773 | const uint8_t *arg2_peer_key, |
| 774 | size_t arg3_peer_key_length, |
| 775 | uint8_t *arg4_output, |
| 776 | size_t arg5_output_size, |
| 777 | size_t *arg6_output_length) |
| 778 | { |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 779 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | db5d607 | 2024-02-15 14:18:02 +0000 | [diff] [blame] | 780 | MBEDTLS_TEST_MEMORY_POISON(arg2_peer_key, arg3_peer_key_length); |
| 781 | MBEDTLS_TEST_MEMORY_POISON(arg4_output, arg5_output_size); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 782 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 783 | 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 Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 784 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | db5d607 | 2024-02-15 14:18:02 +0000 | [diff] [blame] | 785 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_peer_key, arg3_peer_key_length); |
| 786 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_output, arg5_output_size); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 787 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 788 | return status; |
| 789 | } |
| 790 | |
| 791 | /* Wrapper for psa_sign_hash */ |
| 792 | psa_status_t mbedtls_test_wrap_psa_sign_hash( |
| 793 | mbedtls_svc_key_id_t arg0_key, |
| 794 | psa_algorithm_t arg1_alg, |
| 795 | const uint8_t *arg2_hash, |
| 796 | size_t arg3_hash_length, |
| 797 | uint8_t *arg4_signature, |
| 798 | size_t arg5_signature_size, |
| 799 | size_t *arg6_signature_length) |
| 800 | { |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 801 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | c63e31a | 2024-01-30 13:33:14 +0000 | [diff] [blame] | 802 | MBEDTLS_TEST_MEMORY_POISON(arg2_hash, arg3_hash_length); |
| 803 | MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_size); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 804 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 805 | 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 Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 806 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | c63e31a | 2024-01-30 13:33:14 +0000 | [diff] [blame] | 807 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_hash, arg3_hash_length); |
| 808 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_size); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 809 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 810 | return status; |
| 811 | } |
| 812 | |
| 813 | /* Wrapper for psa_sign_message */ |
| 814 | psa_status_t mbedtls_test_wrap_psa_sign_message( |
| 815 | mbedtls_svc_key_id_t arg0_key, |
| 816 | psa_algorithm_t arg1_alg, |
| 817 | const uint8_t *arg2_input, |
| 818 | size_t arg3_input_length, |
| 819 | uint8_t *arg4_signature, |
| 820 | size_t arg5_signature_size, |
| 821 | size_t *arg6_signature_length) |
| 822 | { |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 823 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | c63e31a | 2024-01-30 13:33:14 +0000 | [diff] [blame] | 824 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 825 | MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_size); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 826 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 827 | 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 Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 828 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | c63e31a | 2024-01-30 13:33:14 +0000 | [diff] [blame] | 829 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 830 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_size); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 831 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 832 | return status; |
| 833 | } |
| 834 | |
| 835 | /* Wrapper for psa_verify_hash */ |
| 836 | psa_status_t mbedtls_test_wrap_psa_verify_hash( |
| 837 | mbedtls_svc_key_id_t arg0_key, |
| 838 | psa_algorithm_t arg1_alg, |
| 839 | const uint8_t *arg2_hash, |
| 840 | size_t arg3_hash_length, |
| 841 | const uint8_t *arg4_signature, |
| 842 | size_t arg5_signature_length) |
| 843 | { |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 844 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | c63e31a | 2024-01-30 13:33:14 +0000 | [diff] [blame] | 845 | MBEDTLS_TEST_MEMORY_POISON(arg2_hash, arg3_hash_length); |
| 846 | MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 847 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 848 | psa_status_t status = (psa_verify_hash)(arg0_key, arg1_alg, arg2_hash, arg3_hash_length, arg4_signature, arg5_signature_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 849 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | c63e31a | 2024-01-30 13:33:14 +0000 | [diff] [blame] | 850 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_hash, arg3_hash_length); |
| 851 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 852 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 853 | return status; |
| 854 | } |
| 855 | |
| 856 | /* Wrapper for psa_verify_message */ |
| 857 | psa_status_t mbedtls_test_wrap_psa_verify_message( |
| 858 | mbedtls_svc_key_id_t arg0_key, |
| 859 | psa_algorithm_t arg1_alg, |
| 860 | const uint8_t *arg2_input, |
| 861 | size_t arg3_input_length, |
| 862 | const uint8_t *arg4_signature, |
| 863 | size_t arg5_signature_length) |
| 864 | { |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 865 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | c63e31a | 2024-01-30 13:33:14 +0000 | [diff] [blame] | 866 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 867 | MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 868 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 869 | psa_status_t status = (psa_verify_message)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_signature, arg5_signature_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 870 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | c63e31a | 2024-01-30 13:33:14 +0000 | [diff] [blame] | 871 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 872 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_length); |
David Horstmann | 43c128d | 2024-03-13 15:57:46 +0000 | [diff] [blame^] | 873 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 874 | return status; |
| 875 | } |
| 876 | |
Gilles Peskine | a980aa0 | 2024-01-04 20:51:38 +0100 | [diff] [blame] | 877 | #endif /* defined(MBEDTLS_PSA_CRYPTO_C) && defined(MBEDTLS_TEST_HOOKS) && \ |
| 878 | !defined(RECORD_PSA_STATUS_COVERAGE_LOG) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 879 | |
| 880 | /* End of automatically generated file. */ |