Gilles Peskine | 6e4332c | 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 | #include <mbedtls/build_info.h> |
| 8 | |
Gilles Peskine | 4411c9c | 2024-01-04 20:51:38 +0100 | [diff] [blame] | 9 | #if defined(MBEDTLS_PSA_CRYPTO_C) && defined(MBEDTLS_TEST_HOOKS) && \ |
| 10 | !defined(RECORD_PSA_STATUS_COVERAGE_LOG) |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 11 | |
| 12 | #include <psa/crypto.h> |
| 13 | |
Gilles Peskine | 90d14d7 | 2024-01-04 16:59:28 +0100 | [diff] [blame] | 14 | #include <test/memory.h> |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 15 | #include <test/psa_crypto_helpers.h> |
| 16 | #include <test/psa_test_wrappers.h> |
| 17 | |
| 18 | /* Wrapper for mbedtls_psa_inject_entropy */ |
| 19 | #if defined(MBEDTLS_PSA_INJECT_ENTROPY) |
| 20 | psa_status_t mbedtls_test_wrap_mbedtls_psa_inject_entropy( |
| 21 | const uint8_t *arg0_seed, |
| 22 | size_t arg1_seed_size) |
| 23 | { |
| 24 | psa_status_t status = (mbedtls_psa_inject_entropy)(arg0_seed, arg1_seed_size); |
| 25 | return status; |
| 26 | } |
| 27 | #endif /* defined(MBEDTLS_PSA_INJECT_ENTROPY) */ |
| 28 | |
| 29 | /* Wrapper for mbedtls_psa_platform_get_builtin_key */ |
| 30 | #if defined(MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS) |
| 31 | psa_status_t mbedtls_test_wrap_mbedtls_psa_platform_get_builtin_key( |
| 32 | mbedtls_svc_key_id_t arg0_key_id, |
| 33 | psa_key_lifetime_t *arg1_lifetime, |
| 34 | psa_drv_slot_number_t *arg2_slot_number) |
| 35 | { |
| 36 | psa_status_t status = (mbedtls_psa_platform_get_builtin_key)(arg0_key_id, arg1_lifetime, arg2_slot_number); |
| 37 | return status; |
| 38 | } |
| 39 | #endif /* defined(MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS) */ |
| 40 | |
| 41 | /* Wrapper for mbedtls_psa_register_se_key */ |
| 42 | #if defined(MBEDTLS_PSA_CRYPTO_SE_C) |
| 43 | psa_status_t mbedtls_test_wrap_mbedtls_psa_register_se_key( |
| 44 | const psa_key_attributes_t *arg0_attributes) |
| 45 | { |
| 46 | psa_status_t status = (mbedtls_psa_register_se_key)(arg0_attributes); |
| 47 | return status; |
| 48 | } |
| 49 | #endif /* defined(MBEDTLS_PSA_CRYPTO_SE_C) */ |
| 50 | |
| 51 | /* Wrapper for psa_aead_abort */ |
| 52 | psa_status_t mbedtls_test_wrap_psa_aead_abort( |
| 53 | psa_aead_operation_t *arg0_operation) |
| 54 | { |
| 55 | psa_status_t status = (psa_aead_abort)(arg0_operation); |
| 56 | return status; |
| 57 | } |
| 58 | |
| 59 | /* Wrapper for psa_aead_decrypt */ |
| 60 | psa_status_t mbedtls_test_wrap_psa_aead_decrypt( |
| 61 | mbedtls_svc_key_id_t arg0_key, |
| 62 | psa_algorithm_t arg1_alg, |
| 63 | const uint8_t *arg2_nonce, |
| 64 | size_t arg3_nonce_length, |
| 65 | const uint8_t *arg4_additional_data, |
| 66 | size_t arg5_additional_data_length, |
| 67 | const uint8_t *arg6_ciphertext, |
| 68 | size_t arg7_ciphertext_length, |
| 69 | uint8_t *arg8_plaintext, |
| 70 | size_t arg9_plaintext_size, |
| 71 | size_t *arg10_plaintext_length) |
| 72 | { |
David Horstmann | 86e6fe0 | 2024-01-22 14:36:01 +0000 | [diff] [blame^] | 73 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 74 | MBEDTLS_TEST_MEMORY_POISON(arg2_nonce, arg3_nonce_length); |
| 75 | MBEDTLS_TEST_MEMORY_POISON(arg4_additional_data, arg5_additional_data_length); |
| 76 | MBEDTLS_TEST_MEMORY_POISON(arg6_ciphertext, arg7_ciphertext_length); |
| 77 | MBEDTLS_TEST_MEMORY_POISON(arg8_plaintext, arg9_plaintext_size); |
| 78 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 79 | 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 | 86e6fe0 | 2024-01-22 14:36:01 +0000 | [diff] [blame^] | 80 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 81 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_nonce, arg3_nonce_length); |
| 82 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_additional_data, arg5_additional_data_length); |
| 83 | MBEDTLS_TEST_MEMORY_UNPOISON(arg6_ciphertext, arg7_ciphertext_length); |
| 84 | MBEDTLS_TEST_MEMORY_UNPOISON(arg8_plaintext, arg9_plaintext_size); |
| 85 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 86 | return status; |
| 87 | } |
| 88 | |
| 89 | /* Wrapper for psa_aead_decrypt_setup */ |
| 90 | psa_status_t mbedtls_test_wrap_psa_aead_decrypt_setup( |
| 91 | psa_aead_operation_t *arg0_operation, |
| 92 | mbedtls_svc_key_id_t arg1_key, |
| 93 | psa_algorithm_t arg2_alg) |
| 94 | { |
| 95 | psa_status_t status = (psa_aead_decrypt_setup)(arg0_operation, arg1_key, arg2_alg); |
| 96 | return status; |
| 97 | } |
| 98 | |
| 99 | /* Wrapper for psa_aead_encrypt */ |
| 100 | psa_status_t mbedtls_test_wrap_psa_aead_encrypt( |
| 101 | mbedtls_svc_key_id_t arg0_key, |
| 102 | psa_algorithm_t arg1_alg, |
| 103 | const uint8_t *arg2_nonce, |
| 104 | size_t arg3_nonce_length, |
| 105 | const uint8_t *arg4_additional_data, |
| 106 | size_t arg5_additional_data_length, |
| 107 | const uint8_t *arg6_plaintext, |
| 108 | size_t arg7_plaintext_length, |
| 109 | uint8_t *arg8_ciphertext, |
| 110 | size_t arg9_ciphertext_size, |
| 111 | size_t *arg10_ciphertext_length) |
| 112 | { |
David Horstmann | 86e6fe0 | 2024-01-22 14:36:01 +0000 | [diff] [blame^] | 113 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 114 | MBEDTLS_TEST_MEMORY_POISON(arg2_nonce, arg3_nonce_length); |
| 115 | MBEDTLS_TEST_MEMORY_POISON(arg4_additional_data, arg5_additional_data_length); |
| 116 | MBEDTLS_TEST_MEMORY_POISON(arg6_plaintext, arg7_plaintext_length); |
| 117 | MBEDTLS_TEST_MEMORY_POISON(arg8_ciphertext, arg9_ciphertext_size); |
| 118 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 119 | 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 | 86e6fe0 | 2024-01-22 14:36:01 +0000 | [diff] [blame^] | 120 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 121 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_nonce, arg3_nonce_length); |
| 122 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_additional_data, arg5_additional_data_length); |
| 123 | MBEDTLS_TEST_MEMORY_UNPOISON(arg6_plaintext, arg7_plaintext_length); |
| 124 | MBEDTLS_TEST_MEMORY_UNPOISON(arg8_ciphertext, arg9_ciphertext_size); |
| 125 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 126 | return status; |
| 127 | } |
| 128 | |
| 129 | /* Wrapper for psa_aead_encrypt_setup */ |
| 130 | psa_status_t mbedtls_test_wrap_psa_aead_encrypt_setup( |
| 131 | psa_aead_operation_t *arg0_operation, |
| 132 | mbedtls_svc_key_id_t arg1_key, |
| 133 | psa_algorithm_t arg2_alg) |
| 134 | { |
| 135 | psa_status_t status = (psa_aead_encrypt_setup)(arg0_operation, arg1_key, arg2_alg); |
| 136 | return status; |
| 137 | } |
| 138 | |
| 139 | /* Wrapper for psa_aead_finish */ |
| 140 | psa_status_t mbedtls_test_wrap_psa_aead_finish( |
| 141 | psa_aead_operation_t *arg0_operation, |
| 142 | uint8_t *arg1_ciphertext, |
| 143 | size_t arg2_ciphertext_size, |
| 144 | size_t *arg3_ciphertext_length, |
| 145 | uint8_t *arg4_tag, |
| 146 | size_t arg5_tag_size, |
| 147 | size_t *arg6_tag_length) |
| 148 | { |
David Horstmann | 86e6fe0 | 2024-01-22 14:36:01 +0000 | [diff] [blame^] | 149 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 150 | MBEDTLS_TEST_MEMORY_POISON(arg1_ciphertext, arg2_ciphertext_size); |
| 151 | MBEDTLS_TEST_MEMORY_POISON(arg4_tag, arg5_tag_size); |
| 152 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 153 | psa_status_t status = (psa_aead_finish)(arg0_operation, arg1_ciphertext, arg2_ciphertext_size, arg3_ciphertext_length, arg4_tag, arg5_tag_size, arg6_tag_length); |
David Horstmann | 86e6fe0 | 2024-01-22 14:36:01 +0000 | [diff] [blame^] | 154 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 155 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_ciphertext, arg2_ciphertext_size); |
| 156 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_tag, arg5_tag_size); |
| 157 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 158 | return status; |
| 159 | } |
| 160 | |
| 161 | /* Wrapper for psa_aead_generate_nonce */ |
| 162 | psa_status_t mbedtls_test_wrap_psa_aead_generate_nonce( |
| 163 | psa_aead_operation_t *arg0_operation, |
| 164 | uint8_t *arg1_nonce, |
| 165 | size_t arg2_nonce_size, |
| 166 | size_t *arg3_nonce_length) |
| 167 | { |
David Horstmann | 86e6fe0 | 2024-01-22 14:36:01 +0000 | [diff] [blame^] | 168 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 169 | MBEDTLS_TEST_MEMORY_POISON(arg1_nonce, arg2_nonce_size); |
| 170 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 171 | psa_status_t status = (psa_aead_generate_nonce)(arg0_operation, arg1_nonce, arg2_nonce_size, arg3_nonce_length); |
David Horstmann | 86e6fe0 | 2024-01-22 14:36:01 +0000 | [diff] [blame^] | 172 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 173 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_nonce, arg2_nonce_size); |
| 174 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 175 | return status; |
| 176 | } |
| 177 | |
| 178 | /* Wrapper for psa_aead_set_lengths */ |
| 179 | psa_status_t mbedtls_test_wrap_psa_aead_set_lengths( |
| 180 | psa_aead_operation_t *arg0_operation, |
| 181 | size_t arg1_ad_length, |
| 182 | size_t arg2_plaintext_length) |
| 183 | { |
| 184 | psa_status_t status = (psa_aead_set_lengths)(arg0_operation, arg1_ad_length, arg2_plaintext_length); |
| 185 | return status; |
| 186 | } |
| 187 | |
| 188 | /* Wrapper for psa_aead_set_nonce */ |
| 189 | psa_status_t mbedtls_test_wrap_psa_aead_set_nonce( |
| 190 | psa_aead_operation_t *arg0_operation, |
| 191 | const uint8_t *arg1_nonce, |
| 192 | size_t arg2_nonce_length) |
| 193 | { |
David Horstmann | 86e6fe0 | 2024-01-22 14:36:01 +0000 | [diff] [blame^] | 194 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 195 | MBEDTLS_TEST_MEMORY_POISON(arg1_nonce, arg2_nonce_length); |
| 196 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 197 | psa_status_t status = (psa_aead_set_nonce)(arg0_operation, arg1_nonce, arg2_nonce_length); |
David Horstmann | 86e6fe0 | 2024-01-22 14:36:01 +0000 | [diff] [blame^] | 198 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 199 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_nonce, arg2_nonce_length); |
| 200 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 201 | return status; |
| 202 | } |
| 203 | |
| 204 | /* Wrapper for psa_aead_update */ |
| 205 | psa_status_t mbedtls_test_wrap_psa_aead_update( |
| 206 | psa_aead_operation_t *arg0_operation, |
| 207 | const uint8_t *arg1_input, |
| 208 | size_t arg2_input_length, |
| 209 | uint8_t *arg3_output, |
| 210 | size_t arg4_output_size, |
| 211 | size_t *arg5_output_length) |
| 212 | { |
David Horstmann | 86e6fe0 | 2024-01-22 14:36:01 +0000 | [diff] [blame^] | 213 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 214 | MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length); |
| 215 | MBEDTLS_TEST_MEMORY_POISON(arg3_output, arg4_output_size); |
| 216 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 217 | psa_status_t status = (psa_aead_update)(arg0_operation, arg1_input, arg2_input_length, arg3_output, arg4_output_size, arg5_output_length); |
David Horstmann | 86e6fe0 | 2024-01-22 14:36:01 +0000 | [diff] [blame^] | 218 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 219 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length); |
| 220 | MBEDTLS_TEST_MEMORY_UNPOISON(arg3_output, arg4_output_size); |
| 221 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 222 | return status; |
| 223 | } |
| 224 | |
| 225 | /* Wrapper for psa_aead_update_ad */ |
| 226 | psa_status_t mbedtls_test_wrap_psa_aead_update_ad( |
| 227 | psa_aead_operation_t *arg0_operation, |
| 228 | const uint8_t *arg1_input, |
| 229 | size_t arg2_input_length) |
| 230 | { |
David Horstmann | 86e6fe0 | 2024-01-22 14:36:01 +0000 | [diff] [blame^] | 231 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 232 | MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length); |
| 233 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 234 | psa_status_t status = (psa_aead_update_ad)(arg0_operation, arg1_input, arg2_input_length); |
David Horstmann | 86e6fe0 | 2024-01-22 14:36:01 +0000 | [diff] [blame^] | 235 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 236 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length); |
| 237 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 238 | return status; |
| 239 | } |
| 240 | |
| 241 | /* Wrapper for psa_aead_verify */ |
| 242 | psa_status_t mbedtls_test_wrap_psa_aead_verify( |
| 243 | psa_aead_operation_t *arg0_operation, |
| 244 | uint8_t *arg1_plaintext, |
| 245 | size_t arg2_plaintext_size, |
| 246 | size_t *arg3_plaintext_length, |
| 247 | const uint8_t *arg4_tag, |
| 248 | size_t arg5_tag_length) |
| 249 | { |
David Horstmann | 86e6fe0 | 2024-01-22 14:36:01 +0000 | [diff] [blame^] | 250 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 251 | MBEDTLS_TEST_MEMORY_POISON(arg1_plaintext, arg2_plaintext_size); |
| 252 | MBEDTLS_TEST_MEMORY_POISON(arg4_tag, arg5_tag_length); |
| 253 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 254 | psa_status_t status = (psa_aead_verify)(arg0_operation, arg1_plaintext, arg2_plaintext_size, arg3_plaintext_length, arg4_tag, arg5_tag_length); |
David Horstmann | 86e6fe0 | 2024-01-22 14:36:01 +0000 | [diff] [blame^] | 255 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 256 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_plaintext, arg2_plaintext_size); |
| 257 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_tag, arg5_tag_length); |
| 258 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 259 | return status; |
| 260 | } |
| 261 | |
| 262 | /* Wrapper for psa_asymmetric_decrypt */ |
| 263 | psa_status_t mbedtls_test_wrap_psa_asymmetric_decrypt( |
| 264 | mbedtls_svc_key_id_t arg0_key, |
| 265 | psa_algorithm_t arg1_alg, |
| 266 | const uint8_t *arg2_input, |
| 267 | size_t arg3_input_length, |
| 268 | const uint8_t *arg4_salt, |
| 269 | size_t arg5_salt_length, |
| 270 | uint8_t *arg6_output, |
| 271 | size_t arg7_output_size, |
| 272 | size_t *arg8_output_length) |
| 273 | { |
| 274 | 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); |
| 275 | return status; |
| 276 | } |
| 277 | |
| 278 | /* Wrapper for psa_asymmetric_encrypt */ |
| 279 | psa_status_t mbedtls_test_wrap_psa_asymmetric_encrypt( |
| 280 | mbedtls_svc_key_id_t arg0_key, |
| 281 | psa_algorithm_t arg1_alg, |
| 282 | const uint8_t *arg2_input, |
| 283 | size_t arg3_input_length, |
| 284 | const uint8_t *arg4_salt, |
| 285 | size_t arg5_salt_length, |
| 286 | uint8_t *arg6_output, |
| 287 | size_t arg7_output_size, |
| 288 | size_t *arg8_output_length) |
| 289 | { |
| 290 | 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); |
| 291 | return status; |
| 292 | } |
| 293 | |
| 294 | /* Wrapper for psa_cipher_abort */ |
| 295 | psa_status_t mbedtls_test_wrap_psa_cipher_abort( |
| 296 | psa_cipher_operation_t *arg0_operation) |
| 297 | { |
| 298 | psa_status_t status = (psa_cipher_abort)(arg0_operation); |
| 299 | return status; |
| 300 | } |
| 301 | |
| 302 | /* Wrapper for psa_cipher_decrypt */ |
| 303 | psa_status_t mbedtls_test_wrap_psa_cipher_decrypt( |
| 304 | mbedtls_svc_key_id_t arg0_key, |
| 305 | psa_algorithm_t arg1_alg, |
| 306 | const uint8_t *arg2_input, |
| 307 | size_t arg3_input_length, |
| 308 | uint8_t *arg4_output, |
| 309 | size_t arg5_output_size, |
| 310 | size_t *arg6_output_length) |
| 311 | { |
| 312 | psa_status_t status = (psa_cipher_decrypt)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_output, arg5_output_size, arg6_output_length); |
| 313 | return status; |
| 314 | } |
| 315 | |
| 316 | /* Wrapper for psa_cipher_decrypt_setup */ |
| 317 | psa_status_t mbedtls_test_wrap_psa_cipher_decrypt_setup( |
| 318 | psa_cipher_operation_t *arg0_operation, |
| 319 | mbedtls_svc_key_id_t arg1_key, |
| 320 | psa_algorithm_t arg2_alg) |
| 321 | { |
| 322 | psa_status_t status = (psa_cipher_decrypt_setup)(arg0_operation, arg1_key, arg2_alg); |
| 323 | return status; |
| 324 | } |
| 325 | |
| 326 | /* Wrapper for psa_cipher_encrypt */ |
| 327 | psa_status_t mbedtls_test_wrap_psa_cipher_encrypt( |
| 328 | mbedtls_svc_key_id_t arg0_key, |
| 329 | psa_algorithm_t arg1_alg, |
| 330 | const uint8_t *arg2_input, |
| 331 | size_t arg3_input_length, |
| 332 | uint8_t *arg4_output, |
| 333 | size_t arg5_output_size, |
| 334 | size_t *arg6_output_length) |
| 335 | { |
Ryan Everett | 84a666d | 2024-01-25 12:00:02 +0000 | [diff] [blame] | 336 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 337 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 338 | MBEDTLS_TEST_MEMORY_POISON(arg4_output, arg5_output_size); |
| 339 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 340 | 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 | 84a666d | 2024-01-25 12:00:02 +0000 | [diff] [blame] | 341 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 342 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 343 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_output, arg5_output_size); |
| 344 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 345 | return status; |
| 346 | } |
| 347 | |
| 348 | /* Wrapper for psa_cipher_encrypt_setup */ |
| 349 | psa_status_t mbedtls_test_wrap_psa_cipher_encrypt_setup( |
| 350 | psa_cipher_operation_t *arg0_operation, |
| 351 | mbedtls_svc_key_id_t arg1_key, |
| 352 | psa_algorithm_t arg2_alg) |
| 353 | { |
| 354 | psa_status_t status = (psa_cipher_encrypt_setup)(arg0_operation, arg1_key, arg2_alg); |
| 355 | return status; |
| 356 | } |
| 357 | |
| 358 | /* Wrapper for psa_cipher_finish */ |
| 359 | psa_status_t mbedtls_test_wrap_psa_cipher_finish( |
| 360 | psa_cipher_operation_t *arg0_operation, |
| 361 | uint8_t *arg1_output, |
| 362 | size_t arg2_output_size, |
| 363 | size_t *arg3_output_length) |
| 364 | { |
| 365 | psa_status_t status = (psa_cipher_finish)(arg0_operation, arg1_output, arg2_output_size, arg3_output_length); |
| 366 | return status; |
| 367 | } |
| 368 | |
| 369 | /* Wrapper for psa_cipher_generate_iv */ |
| 370 | psa_status_t mbedtls_test_wrap_psa_cipher_generate_iv( |
| 371 | psa_cipher_operation_t *arg0_operation, |
| 372 | uint8_t *arg1_iv, |
| 373 | size_t arg2_iv_size, |
| 374 | size_t *arg3_iv_length) |
| 375 | { |
| 376 | psa_status_t status = (psa_cipher_generate_iv)(arg0_operation, arg1_iv, arg2_iv_size, arg3_iv_length); |
| 377 | return status; |
| 378 | } |
| 379 | |
| 380 | /* Wrapper for psa_cipher_set_iv */ |
| 381 | psa_status_t mbedtls_test_wrap_psa_cipher_set_iv( |
| 382 | psa_cipher_operation_t *arg0_operation, |
| 383 | const uint8_t *arg1_iv, |
| 384 | size_t arg2_iv_length) |
| 385 | { |
| 386 | psa_status_t status = (psa_cipher_set_iv)(arg0_operation, arg1_iv, arg2_iv_length); |
| 387 | return status; |
| 388 | } |
| 389 | |
| 390 | /* Wrapper for psa_cipher_update */ |
| 391 | psa_status_t mbedtls_test_wrap_psa_cipher_update( |
| 392 | psa_cipher_operation_t *arg0_operation, |
| 393 | const uint8_t *arg1_input, |
| 394 | size_t arg2_input_length, |
| 395 | uint8_t *arg3_output, |
| 396 | size_t arg4_output_size, |
| 397 | size_t *arg5_output_length) |
| 398 | { |
| 399 | psa_status_t status = (psa_cipher_update)(arg0_operation, arg1_input, arg2_input_length, arg3_output, arg4_output_size, arg5_output_length); |
| 400 | return status; |
| 401 | } |
| 402 | |
| 403 | /* Wrapper for psa_copy_key */ |
| 404 | psa_status_t mbedtls_test_wrap_psa_copy_key( |
| 405 | mbedtls_svc_key_id_t arg0_source_key, |
| 406 | const psa_key_attributes_t *arg1_attributes, |
| 407 | mbedtls_svc_key_id_t *arg2_target_key) |
| 408 | { |
| 409 | psa_status_t status = (psa_copy_key)(arg0_source_key, arg1_attributes, arg2_target_key); |
| 410 | return status; |
| 411 | } |
| 412 | |
| 413 | /* Wrapper for psa_crypto_driver_pake_get_cipher_suite */ |
| 414 | psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_cipher_suite( |
| 415 | const psa_crypto_driver_pake_inputs_t *arg0_inputs, |
| 416 | psa_pake_cipher_suite_t *arg1_cipher_suite) |
| 417 | { |
| 418 | psa_status_t status = (psa_crypto_driver_pake_get_cipher_suite)(arg0_inputs, arg1_cipher_suite); |
| 419 | return status; |
| 420 | } |
| 421 | |
| 422 | /* Wrapper for psa_crypto_driver_pake_get_password */ |
| 423 | psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_password( |
| 424 | const psa_crypto_driver_pake_inputs_t *arg0_inputs, |
| 425 | uint8_t *arg1_buffer, |
| 426 | size_t arg2_buffer_size, |
| 427 | size_t *arg3_buffer_length) |
| 428 | { |
| 429 | psa_status_t status = (psa_crypto_driver_pake_get_password)(arg0_inputs, arg1_buffer, arg2_buffer_size, arg3_buffer_length); |
| 430 | return status; |
| 431 | } |
| 432 | |
| 433 | /* Wrapper for psa_crypto_driver_pake_get_password_len */ |
| 434 | psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_password_len( |
| 435 | const psa_crypto_driver_pake_inputs_t *arg0_inputs, |
| 436 | size_t *arg1_password_len) |
| 437 | { |
| 438 | psa_status_t status = (psa_crypto_driver_pake_get_password_len)(arg0_inputs, arg1_password_len); |
| 439 | return status; |
| 440 | } |
| 441 | |
| 442 | /* Wrapper for psa_crypto_driver_pake_get_peer */ |
| 443 | psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_peer( |
| 444 | const psa_crypto_driver_pake_inputs_t *arg0_inputs, |
| 445 | uint8_t *arg1_peer_id, |
| 446 | size_t arg2_peer_id_size, |
| 447 | size_t *arg3_peer_id_length) |
| 448 | { |
| 449 | psa_status_t status = (psa_crypto_driver_pake_get_peer)(arg0_inputs, arg1_peer_id, arg2_peer_id_size, arg3_peer_id_length); |
| 450 | return status; |
| 451 | } |
| 452 | |
| 453 | /* Wrapper for psa_crypto_driver_pake_get_peer_len */ |
| 454 | psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_peer_len( |
| 455 | const psa_crypto_driver_pake_inputs_t *arg0_inputs, |
| 456 | size_t *arg1_peer_len) |
| 457 | { |
| 458 | psa_status_t status = (psa_crypto_driver_pake_get_peer_len)(arg0_inputs, arg1_peer_len); |
| 459 | return status; |
| 460 | } |
| 461 | |
| 462 | /* Wrapper for psa_crypto_driver_pake_get_user */ |
| 463 | psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_user( |
| 464 | const psa_crypto_driver_pake_inputs_t *arg0_inputs, |
| 465 | uint8_t *arg1_user_id, |
| 466 | size_t arg2_user_id_size, |
| 467 | size_t *arg3_user_id_len) |
| 468 | { |
| 469 | psa_status_t status = (psa_crypto_driver_pake_get_user)(arg0_inputs, arg1_user_id, arg2_user_id_size, arg3_user_id_len); |
| 470 | return status; |
| 471 | } |
| 472 | |
| 473 | /* Wrapper for psa_crypto_driver_pake_get_user_len */ |
| 474 | psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_user_len( |
| 475 | const psa_crypto_driver_pake_inputs_t *arg0_inputs, |
| 476 | size_t *arg1_user_len) |
| 477 | { |
| 478 | psa_status_t status = (psa_crypto_driver_pake_get_user_len)(arg0_inputs, arg1_user_len); |
| 479 | return status; |
| 480 | } |
| 481 | |
| 482 | /* Wrapper for psa_crypto_init */ |
| 483 | psa_status_t mbedtls_test_wrap_psa_crypto_init(void) |
| 484 | { |
| 485 | psa_status_t status = (psa_crypto_init)(); |
| 486 | return status; |
| 487 | } |
| 488 | |
| 489 | /* Wrapper for psa_destroy_key */ |
| 490 | psa_status_t mbedtls_test_wrap_psa_destroy_key( |
| 491 | mbedtls_svc_key_id_t arg0_key) |
| 492 | { |
| 493 | psa_status_t status = (psa_destroy_key)(arg0_key); |
| 494 | return status; |
| 495 | } |
| 496 | |
| 497 | /* Wrapper for psa_export_key */ |
| 498 | psa_status_t mbedtls_test_wrap_psa_export_key( |
| 499 | mbedtls_svc_key_id_t arg0_key, |
| 500 | uint8_t *arg1_data, |
| 501 | size_t arg2_data_size, |
| 502 | size_t *arg3_data_length) |
| 503 | { |
Ryan Everett | 77b91e3 | 2024-01-25 10:58:06 +0000 | [diff] [blame] | 504 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 505 | MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_size); |
| 506 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 507 | psa_status_t status = (psa_export_key)(arg0_key, arg1_data, arg2_data_size, arg3_data_length); |
Ryan Everett | 77b91e3 | 2024-01-25 10:58:06 +0000 | [diff] [blame] | 508 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 509 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_size); |
| 510 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 511 | return status; |
| 512 | } |
| 513 | |
| 514 | /* Wrapper for psa_export_public_key */ |
| 515 | psa_status_t mbedtls_test_wrap_psa_export_public_key( |
| 516 | mbedtls_svc_key_id_t arg0_key, |
| 517 | uint8_t *arg1_data, |
| 518 | size_t arg2_data_size, |
| 519 | size_t *arg3_data_length) |
| 520 | { |
Ryan Everett | 77b91e3 | 2024-01-25 10:58:06 +0000 | [diff] [blame] | 521 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 522 | MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_size); |
| 523 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 524 | psa_status_t status = (psa_export_public_key)(arg0_key, arg1_data, arg2_data_size, arg3_data_length); |
Ryan Everett | 77b91e3 | 2024-01-25 10:58:06 +0000 | [diff] [blame] | 525 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 526 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_size); |
| 527 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 528 | return status; |
| 529 | } |
| 530 | |
| 531 | /* Wrapper for psa_generate_key */ |
| 532 | psa_status_t mbedtls_test_wrap_psa_generate_key( |
| 533 | const psa_key_attributes_t *arg0_attributes, |
| 534 | mbedtls_svc_key_id_t *arg1_key) |
| 535 | { |
| 536 | psa_status_t status = (psa_generate_key)(arg0_attributes, arg1_key); |
| 537 | return status; |
| 538 | } |
| 539 | |
| 540 | /* Wrapper for psa_generate_random */ |
| 541 | psa_status_t mbedtls_test_wrap_psa_generate_random( |
| 542 | uint8_t *arg0_output, |
| 543 | size_t arg1_output_size) |
| 544 | { |
| 545 | psa_status_t status = (psa_generate_random)(arg0_output, arg1_output_size); |
| 546 | return status; |
| 547 | } |
| 548 | |
| 549 | /* Wrapper for psa_get_key_attributes */ |
| 550 | psa_status_t mbedtls_test_wrap_psa_get_key_attributes( |
| 551 | mbedtls_svc_key_id_t arg0_key, |
| 552 | psa_key_attributes_t *arg1_attributes) |
| 553 | { |
| 554 | psa_status_t status = (psa_get_key_attributes)(arg0_key, arg1_attributes); |
| 555 | return status; |
| 556 | } |
| 557 | |
| 558 | /* Wrapper for psa_hash_abort */ |
| 559 | psa_status_t mbedtls_test_wrap_psa_hash_abort( |
| 560 | psa_hash_operation_t *arg0_operation) |
| 561 | { |
| 562 | psa_status_t status = (psa_hash_abort)(arg0_operation); |
| 563 | return status; |
| 564 | } |
| 565 | |
| 566 | /* Wrapper for psa_hash_clone */ |
| 567 | psa_status_t mbedtls_test_wrap_psa_hash_clone( |
| 568 | const psa_hash_operation_t *arg0_source_operation, |
| 569 | psa_hash_operation_t *arg1_target_operation) |
| 570 | { |
| 571 | psa_status_t status = (psa_hash_clone)(arg0_source_operation, arg1_target_operation); |
| 572 | return status; |
| 573 | } |
| 574 | |
| 575 | /* Wrapper for psa_hash_compare */ |
| 576 | psa_status_t mbedtls_test_wrap_psa_hash_compare( |
| 577 | psa_algorithm_t arg0_alg, |
| 578 | const uint8_t *arg1_input, |
| 579 | size_t arg2_input_length, |
| 580 | const uint8_t *arg3_hash, |
| 581 | size_t arg4_hash_length) |
| 582 | { |
| 583 | psa_status_t status = (psa_hash_compare)(arg0_alg, arg1_input, arg2_input_length, arg3_hash, arg4_hash_length); |
| 584 | return status; |
| 585 | } |
| 586 | |
| 587 | /* Wrapper for psa_hash_compute */ |
| 588 | psa_status_t mbedtls_test_wrap_psa_hash_compute( |
| 589 | psa_algorithm_t arg0_alg, |
| 590 | const uint8_t *arg1_input, |
| 591 | size_t arg2_input_length, |
| 592 | uint8_t *arg3_hash, |
| 593 | size_t arg4_hash_size, |
| 594 | size_t *arg5_hash_length) |
| 595 | { |
| 596 | psa_status_t status = (psa_hash_compute)(arg0_alg, arg1_input, arg2_input_length, arg3_hash, arg4_hash_size, arg5_hash_length); |
| 597 | return status; |
| 598 | } |
| 599 | |
| 600 | /* Wrapper for psa_hash_finish */ |
| 601 | psa_status_t mbedtls_test_wrap_psa_hash_finish( |
| 602 | psa_hash_operation_t *arg0_operation, |
| 603 | uint8_t *arg1_hash, |
| 604 | size_t arg2_hash_size, |
| 605 | size_t *arg3_hash_length) |
| 606 | { |
| 607 | psa_status_t status = (psa_hash_finish)(arg0_operation, arg1_hash, arg2_hash_size, arg3_hash_length); |
| 608 | return status; |
| 609 | } |
| 610 | |
| 611 | /* Wrapper for psa_hash_setup */ |
| 612 | psa_status_t mbedtls_test_wrap_psa_hash_setup( |
| 613 | psa_hash_operation_t *arg0_operation, |
| 614 | psa_algorithm_t arg1_alg) |
| 615 | { |
| 616 | psa_status_t status = (psa_hash_setup)(arg0_operation, arg1_alg); |
| 617 | return status; |
| 618 | } |
| 619 | |
| 620 | /* Wrapper for psa_hash_update */ |
| 621 | psa_status_t mbedtls_test_wrap_psa_hash_update( |
| 622 | psa_hash_operation_t *arg0_operation, |
| 623 | const uint8_t *arg1_input, |
| 624 | size_t arg2_input_length) |
| 625 | { |
| 626 | psa_status_t status = (psa_hash_update)(arg0_operation, arg1_input, arg2_input_length); |
| 627 | return status; |
| 628 | } |
| 629 | |
| 630 | /* Wrapper for psa_hash_verify */ |
| 631 | psa_status_t mbedtls_test_wrap_psa_hash_verify( |
| 632 | psa_hash_operation_t *arg0_operation, |
| 633 | const uint8_t *arg1_hash, |
| 634 | size_t arg2_hash_length) |
| 635 | { |
| 636 | psa_status_t status = (psa_hash_verify)(arg0_operation, arg1_hash, arg2_hash_length); |
| 637 | return status; |
| 638 | } |
| 639 | |
| 640 | /* Wrapper for psa_import_key */ |
| 641 | psa_status_t mbedtls_test_wrap_psa_import_key( |
| 642 | const psa_key_attributes_t *arg0_attributes, |
| 643 | const uint8_t *arg1_data, |
| 644 | size_t arg2_data_length, |
| 645 | mbedtls_svc_key_id_t *arg3_key) |
| 646 | { |
Ryan Everett | 77b91e3 | 2024-01-25 10:58:06 +0000 | [diff] [blame] | 647 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 648 | MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_length); |
| 649 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 650 | psa_status_t status = (psa_import_key)(arg0_attributes, arg1_data, arg2_data_length, arg3_key); |
Ryan Everett | 77b91e3 | 2024-01-25 10:58:06 +0000 | [diff] [blame] | 651 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 652 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_length); |
| 653 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 654 | return status; |
| 655 | } |
| 656 | |
| 657 | /* Wrapper for psa_key_derivation_abort */ |
| 658 | psa_status_t mbedtls_test_wrap_psa_key_derivation_abort( |
| 659 | psa_key_derivation_operation_t *arg0_operation) |
| 660 | { |
| 661 | psa_status_t status = (psa_key_derivation_abort)(arg0_operation); |
| 662 | return status; |
| 663 | } |
| 664 | |
| 665 | /* Wrapper for psa_key_derivation_get_capacity */ |
| 666 | psa_status_t mbedtls_test_wrap_psa_key_derivation_get_capacity( |
| 667 | const psa_key_derivation_operation_t *arg0_operation, |
| 668 | size_t *arg1_capacity) |
| 669 | { |
| 670 | psa_status_t status = (psa_key_derivation_get_capacity)(arg0_operation, arg1_capacity); |
| 671 | return status; |
| 672 | } |
| 673 | |
| 674 | /* Wrapper for psa_key_derivation_input_bytes */ |
| 675 | psa_status_t mbedtls_test_wrap_psa_key_derivation_input_bytes( |
| 676 | psa_key_derivation_operation_t *arg0_operation, |
| 677 | psa_key_derivation_step_t arg1_step, |
| 678 | const uint8_t *arg2_data, |
| 679 | size_t arg3_data_length) |
| 680 | { |
| 681 | psa_status_t status = (psa_key_derivation_input_bytes)(arg0_operation, arg1_step, arg2_data, arg3_data_length); |
| 682 | return status; |
| 683 | } |
| 684 | |
| 685 | /* Wrapper for psa_key_derivation_input_integer */ |
| 686 | psa_status_t mbedtls_test_wrap_psa_key_derivation_input_integer( |
| 687 | psa_key_derivation_operation_t *arg0_operation, |
| 688 | psa_key_derivation_step_t arg1_step, |
| 689 | uint64_t arg2_value) |
| 690 | { |
| 691 | psa_status_t status = (psa_key_derivation_input_integer)(arg0_operation, arg1_step, arg2_value); |
| 692 | return status; |
| 693 | } |
| 694 | |
| 695 | /* Wrapper for psa_key_derivation_input_key */ |
| 696 | psa_status_t mbedtls_test_wrap_psa_key_derivation_input_key( |
| 697 | psa_key_derivation_operation_t *arg0_operation, |
| 698 | psa_key_derivation_step_t arg1_step, |
| 699 | mbedtls_svc_key_id_t arg2_key) |
| 700 | { |
| 701 | psa_status_t status = (psa_key_derivation_input_key)(arg0_operation, arg1_step, arg2_key); |
| 702 | return status; |
| 703 | } |
| 704 | |
| 705 | /* Wrapper for psa_key_derivation_key_agreement */ |
| 706 | psa_status_t mbedtls_test_wrap_psa_key_derivation_key_agreement( |
| 707 | psa_key_derivation_operation_t *arg0_operation, |
| 708 | psa_key_derivation_step_t arg1_step, |
| 709 | mbedtls_svc_key_id_t arg2_private_key, |
| 710 | const uint8_t *arg3_peer_key, |
| 711 | size_t arg4_peer_key_length) |
| 712 | { |
| 713 | psa_status_t status = (psa_key_derivation_key_agreement)(arg0_operation, arg1_step, arg2_private_key, arg3_peer_key, arg4_peer_key_length); |
| 714 | return status; |
| 715 | } |
| 716 | |
| 717 | /* Wrapper for psa_key_derivation_output_bytes */ |
| 718 | psa_status_t mbedtls_test_wrap_psa_key_derivation_output_bytes( |
| 719 | psa_key_derivation_operation_t *arg0_operation, |
| 720 | uint8_t *arg1_output, |
| 721 | size_t arg2_output_length) |
| 722 | { |
| 723 | psa_status_t status = (psa_key_derivation_output_bytes)(arg0_operation, arg1_output, arg2_output_length); |
| 724 | return status; |
| 725 | } |
| 726 | |
| 727 | /* Wrapper for psa_key_derivation_output_key */ |
| 728 | psa_status_t mbedtls_test_wrap_psa_key_derivation_output_key( |
| 729 | const psa_key_attributes_t *arg0_attributes, |
| 730 | psa_key_derivation_operation_t *arg1_operation, |
| 731 | mbedtls_svc_key_id_t *arg2_key) |
| 732 | { |
| 733 | psa_status_t status = (psa_key_derivation_output_key)(arg0_attributes, arg1_operation, arg2_key); |
| 734 | return status; |
| 735 | } |
| 736 | |
| 737 | /* Wrapper for psa_key_derivation_set_capacity */ |
| 738 | psa_status_t mbedtls_test_wrap_psa_key_derivation_set_capacity( |
| 739 | psa_key_derivation_operation_t *arg0_operation, |
| 740 | size_t arg1_capacity) |
| 741 | { |
| 742 | psa_status_t status = (psa_key_derivation_set_capacity)(arg0_operation, arg1_capacity); |
| 743 | return status; |
| 744 | } |
| 745 | |
| 746 | /* Wrapper for psa_key_derivation_setup */ |
| 747 | psa_status_t mbedtls_test_wrap_psa_key_derivation_setup( |
| 748 | psa_key_derivation_operation_t *arg0_operation, |
| 749 | psa_algorithm_t arg1_alg) |
| 750 | { |
| 751 | psa_status_t status = (psa_key_derivation_setup)(arg0_operation, arg1_alg); |
| 752 | return status; |
| 753 | } |
| 754 | |
| 755 | /* Wrapper for psa_mac_abort */ |
| 756 | psa_status_t mbedtls_test_wrap_psa_mac_abort( |
| 757 | psa_mac_operation_t *arg0_operation) |
| 758 | { |
| 759 | psa_status_t status = (psa_mac_abort)(arg0_operation); |
| 760 | return status; |
| 761 | } |
| 762 | |
| 763 | /* Wrapper for psa_mac_compute */ |
| 764 | psa_status_t mbedtls_test_wrap_psa_mac_compute( |
| 765 | mbedtls_svc_key_id_t arg0_key, |
| 766 | psa_algorithm_t arg1_alg, |
| 767 | const uint8_t *arg2_input, |
| 768 | size_t arg3_input_length, |
| 769 | uint8_t *arg4_mac, |
| 770 | size_t arg5_mac_size, |
| 771 | size_t *arg6_mac_length) |
| 772 | { |
| 773 | psa_status_t status = (psa_mac_compute)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_mac, arg5_mac_size, arg6_mac_length); |
| 774 | return status; |
| 775 | } |
| 776 | |
| 777 | /* Wrapper for psa_mac_sign_finish */ |
| 778 | psa_status_t mbedtls_test_wrap_psa_mac_sign_finish( |
| 779 | psa_mac_operation_t *arg0_operation, |
| 780 | uint8_t *arg1_mac, |
| 781 | size_t arg2_mac_size, |
| 782 | size_t *arg3_mac_length) |
| 783 | { |
| 784 | psa_status_t status = (psa_mac_sign_finish)(arg0_operation, arg1_mac, arg2_mac_size, arg3_mac_length); |
| 785 | return status; |
| 786 | } |
| 787 | |
| 788 | /* Wrapper for psa_mac_sign_setup */ |
| 789 | psa_status_t mbedtls_test_wrap_psa_mac_sign_setup( |
| 790 | psa_mac_operation_t *arg0_operation, |
| 791 | mbedtls_svc_key_id_t arg1_key, |
| 792 | psa_algorithm_t arg2_alg) |
| 793 | { |
| 794 | psa_status_t status = (psa_mac_sign_setup)(arg0_operation, arg1_key, arg2_alg); |
| 795 | return status; |
| 796 | } |
| 797 | |
| 798 | /* Wrapper for psa_mac_update */ |
| 799 | psa_status_t mbedtls_test_wrap_psa_mac_update( |
| 800 | psa_mac_operation_t *arg0_operation, |
| 801 | const uint8_t *arg1_input, |
| 802 | size_t arg2_input_length) |
| 803 | { |
| 804 | psa_status_t status = (psa_mac_update)(arg0_operation, arg1_input, arg2_input_length); |
| 805 | return status; |
| 806 | } |
| 807 | |
| 808 | /* Wrapper for psa_mac_verify */ |
| 809 | psa_status_t mbedtls_test_wrap_psa_mac_verify( |
| 810 | mbedtls_svc_key_id_t arg0_key, |
| 811 | psa_algorithm_t arg1_alg, |
| 812 | const uint8_t *arg2_input, |
| 813 | size_t arg3_input_length, |
| 814 | const uint8_t *arg4_mac, |
| 815 | size_t arg5_mac_length) |
| 816 | { |
| 817 | psa_status_t status = (psa_mac_verify)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_mac, arg5_mac_length); |
| 818 | return status; |
| 819 | } |
| 820 | |
| 821 | /* Wrapper for psa_mac_verify_finish */ |
| 822 | psa_status_t mbedtls_test_wrap_psa_mac_verify_finish( |
| 823 | psa_mac_operation_t *arg0_operation, |
| 824 | const uint8_t *arg1_mac, |
| 825 | size_t arg2_mac_length) |
| 826 | { |
| 827 | psa_status_t status = (psa_mac_verify_finish)(arg0_operation, arg1_mac, arg2_mac_length); |
| 828 | return status; |
| 829 | } |
| 830 | |
| 831 | /* Wrapper for psa_mac_verify_setup */ |
| 832 | psa_status_t mbedtls_test_wrap_psa_mac_verify_setup( |
| 833 | psa_mac_operation_t *arg0_operation, |
| 834 | mbedtls_svc_key_id_t arg1_key, |
| 835 | psa_algorithm_t arg2_alg) |
| 836 | { |
| 837 | psa_status_t status = (psa_mac_verify_setup)(arg0_operation, arg1_key, arg2_alg); |
| 838 | return status; |
| 839 | } |
| 840 | |
| 841 | /* Wrapper for psa_pake_abort */ |
| 842 | psa_status_t mbedtls_test_wrap_psa_pake_abort( |
| 843 | psa_pake_operation_t *arg0_operation) |
| 844 | { |
| 845 | psa_status_t status = (psa_pake_abort)(arg0_operation); |
| 846 | return status; |
| 847 | } |
| 848 | |
| 849 | /* Wrapper for psa_pake_get_implicit_key */ |
| 850 | psa_status_t mbedtls_test_wrap_psa_pake_get_implicit_key( |
| 851 | psa_pake_operation_t *arg0_operation, |
| 852 | psa_key_derivation_operation_t *arg1_output) |
| 853 | { |
| 854 | psa_status_t status = (psa_pake_get_implicit_key)(arg0_operation, arg1_output); |
| 855 | return status; |
| 856 | } |
| 857 | |
| 858 | /* Wrapper for psa_pake_input */ |
| 859 | psa_status_t mbedtls_test_wrap_psa_pake_input( |
| 860 | psa_pake_operation_t *arg0_operation, |
| 861 | psa_pake_step_t arg1_step, |
| 862 | const uint8_t *arg2_input, |
| 863 | size_t arg3_input_length) |
| 864 | { |
| 865 | psa_status_t status = (psa_pake_input)(arg0_operation, arg1_step, arg2_input, arg3_input_length); |
| 866 | return status; |
| 867 | } |
| 868 | |
| 869 | /* Wrapper for psa_pake_output */ |
| 870 | psa_status_t mbedtls_test_wrap_psa_pake_output( |
| 871 | psa_pake_operation_t *arg0_operation, |
| 872 | psa_pake_step_t arg1_step, |
| 873 | uint8_t *arg2_output, |
| 874 | size_t arg3_output_size, |
| 875 | size_t *arg4_output_length) |
| 876 | { |
| 877 | psa_status_t status = (psa_pake_output)(arg0_operation, arg1_step, arg2_output, arg3_output_size, arg4_output_length); |
| 878 | return status; |
| 879 | } |
| 880 | |
| 881 | /* Wrapper for psa_pake_set_password_key */ |
| 882 | psa_status_t mbedtls_test_wrap_psa_pake_set_password_key( |
| 883 | psa_pake_operation_t *arg0_operation, |
| 884 | mbedtls_svc_key_id_t arg1_password) |
| 885 | { |
| 886 | psa_status_t status = (psa_pake_set_password_key)(arg0_operation, arg1_password); |
| 887 | return status; |
| 888 | } |
| 889 | |
| 890 | /* Wrapper for psa_pake_set_peer */ |
| 891 | psa_status_t mbedtls_test_wrap_psa_pake_set_peer( |
| 892 | psa_pake_operation_t *arg0_operation, |
| 893 | const uint8_t *arg1_peer_id, |
| 894 | size_t arg2_peer_id_len) |
| 895 | { |
| 896 | psa_status_t status = (psa_pake_set_peer)(arg0_operation, arg1_peer_id, arg2_peer_id_len); |
| 897 | return status; |
| 898 | } |
| 899 | |
| 900 | /* Wrapper for psa_pake_set_role */ |
| 901 | psa_status_t mbedtls_test_wrap_psa_pake_set_role( |
| 902 | psa_pake_operation_t *arg0_operation, |
| 903 | psa_pake_role_t arg1_role) |
| 904 | { |
| 905 | psa_status_t status = (psa_pake_set_role)(arg0_operation, arg1_role); |
| 906 | return status; |
| 907 | } |
| 908 | |
| 909 | /* Wrapper for psa_pake_set_user */ |
| 910 | psa_status_t mbedtls_test_wrap_psa_pake_set_user( |
| 911 | psa_pake_operation_t *arg0_operation, |
| 912 | const uint8_t *arg1_user_id, |
| 913 | size_t arg2_user_id_len) |
| 914 | { |
| 915 | psa_status_t status = (psa_pake_set_user)(arg0_operation, arg1_user_id, arg2_user_id_len); |
| 916 | return status; |
| 917 | } |
| 918 | |
| 919 | /* Wrapper for psa_pake_setup */ |
| 920 | psa_status_t mbedtls_test_wrap_psa_pake_setup( |
| 921 | psa_pake_operation_t *arg0_operation, |
| 922 | const psa_pake_cipher_suite_t *arg1_cipher_suite) |
| 923 | { |
| 924 | psa_status_t status = (psa_pake_setup)(arg0_operation, arg1_cipher_suite); |
| 925 | return status; |
| 926 | } |
| 927 | |
| 928 | /* Wrapper for psa_purge_key */ |
| 929 | psa_status_t mbedtls_test_wrap_psa_purge_key( |
| 930 | mbedtls_svc_key_id_t arg0_key) |
| 931 | { |
| 932 | psa_status_t status = (psa_purge_key)(arg0_key); |
| 933 | return status; |
| 934 | } |
| 935 | |
| 936 | /* Wrapper for psa_raw_key_agreement */ |
| 937 | psa_status_t mbedtls_test_wrap_psa_raw_key_agreement( |
| 938 | psa_algorithm_t arg0_alg, |
| 939 | mbedtls_svc_key_id_t arg1_private_key, |
| 940 | const uint8_t *arg2_peer_key, |
| 941 | size_t arg3_peer_key_length, |
| 942 | uint8_t *arg4_output, |
| 943 | size_t arg5_output_size, |
| 944 | size_t *arg6_output_length) |
| 945 | { |
| 946 | 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); |
| 947 | return status; |
| 948 | } |
| 949 | |
| 950 | /* Wrapper for psa_sign_hash */ |
| 951 | psa_status_t mbedtls_test_wrap_psa_sign_hash( |
| 952 | mbedtls_svc_key_id_t arg0_key, |
| 953 | psa_algorithm_t arg1_alg, |
| 954 | const uint8_t *arg2_hash, |
| 955 | size_t arg3_hash_length, |
| 956 | uint8_t *arg4_signature, |
| 957 | size_t arg5_signature_size, |
| 958 | size_t *arg6_signature_length) |
| 959 | { |
Thomas Daubney | f430f47 | 2024-01-30 12:25:35 +0000 | [diff] [blame] | 960 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 961 | MBEDTLS_TEST_MEMORY_POISON(arg2_hash, arg3_hash_length); |
| 962 | MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_size); |
| 963 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 964 | 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 | f430f47 | 2024-01-30 12:25:35 +0000 | [diff] [blame] | 965 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 966 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_hash, arg3_hash_length); |
| 967 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_size); |
| 968 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 969 | return status; |
| 970 | } |
| 971 | |
| 972 | /* Wrapper for psa_sign_hash_abort */ |
| 973 | psa_status_t mbedtls_test_wrap_psa_sign_hash_abort( |
| 974 | psa_sign_hash_interruptible_operation_t *arg0_operation) |
| 975 | { |
| 976 | psa_status_t status = (psa_sign_hash_abort)(arg0_operation); |
| 977 | return status; |
| 978 | } |
| 979 | |
| 980 | /* Wrapper for psa_sign_hash_complete */ |
| 981 | psa_status_t mbedtls_test_wrap_psa_sign_hash_complete( |
| 982 | psa_sign_hash_interruptible_operation_t *arg0_operation, |
| 983 | uint8_t *arg1_signature, |
| 984 | size_t arg2_signature_size, |
| 985 | size_t *arg3_signature_length) |
| 986 | { |
| 987 | psa_status_t status = (psa_sign_hash_complete)(arg0_operation, arg1_signature, arg2_signature_size, arg3_signature_length); |
| 988 | return status; |
| 989 | } |
| 990 | |
| 991 | /* Wrapper for psa_sign_hash_start */ |
| 992 | psa_status_t mbedtls_test_wrap_psa_sign_hash_start( |
| 993 | psa_sign_hash_interruptible_operation_t *arg0_operation, |
| 994 | mbedtls_svc_key_id_t arg1_key, |
| 995 | psa_algorithm_t arg2_alg, |
| 996 | const uint8_t *arg3_hash, |
| 997 | size_t arg4_hash_length) |
| 998 | { |
| 999 | psa_status_t status = (psa_sign_hash_start)(arg0_operation, arg1_key, arg2_alg, arg3_hash, arg4_hash_length); |
| 1000 | return status; |
| 1001 | } |
| 1002 | |
| 1003 | /* Wrapper for psa_sign_message */ |
| 1004 | psa_status_t mbedtls_test_wrap_psa_sign_message( |
| 1005 | mbedtls_svc_key_id_t arg0_key, |
| 1006 | psa_algorithm_t arg1_alg, |
| 1007 | const uint8_t *arg2_input, |
| 1008 | size_t arg3_input_length, |
| 1009 | uint8_t *arg4_signature, |
| 1010 | size_t arg5_signature_size, |
| 1011 | size_t *arg6_signature_length) |
| 1012 | { |
Thomas Daubney | f430f47 | 2024-01-30 12:25:35 +0000 | [diff] [blame] | 1013 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 1014 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 1015 | MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_size); |
| 1016 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1017 | 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 | f430f47 | 2024-01-30 12:25:35 +0000 | [diff] [blame] | 1018 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 1019 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 1020 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_size); |
| 1021 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1022 | return status; |
| 1023 | } |
| 1024 | |
| 1025 | /* Wrapper for psa_verify_hash */ |
| 1026 | psa_status_t mbedtls_test_wrap_psa_verify_hash( |
| 1027 | mbedtls_svc_key_id_t arg0_key, |
| 1028 | psa_algorithm_t arg1_alg, |
| 1029 | const uint8_t *arg2_hash, |
| 1030 | size_t arg3_hash_length, |
| 1031 | const uint8_t *arg4_signature, |
| 1032 | size_t arg5_signature_length) |
| 1033 | { |
Thomas Daubney | f430f47 | 2024-01-30 12:25:35 +0000 | [diff] [blame] | 1034 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 1035 | MBEDTLS_TEST_MEMORY_POISON(arg2_hash, arg3_hash_length); |
| 1036 | MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_length); |
| 1037 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1038 | psa_status_t status = (psa_verify_hash)(arg0_key, arg1_alg, arg2_hash, arg3_hash_length, arg4_signature, arg5_signature_length); |
Thomas Daubney | f430f47 | 2024-01-30 12:25:35 +0000 | [diff] [blame] | 1039 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 1040 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_hash, arg3_hash_length); |
| 1041 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_length); |
| 1042 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1043 | return status; |
| 1044 | } |
| 1045 | |
| 1046 | /* Wrapper for psa_verify_hash_abort */ |
| 1047 | psa_status_t mbedtls_test_wrap_psa_verify_hash_abort( |
| 1048 | psa_verify_hash_interruptible_operation_t *arg0_operation) |
| 1049 | { |
| 1050 | psa_status_t status = (psa_verify_hash_abort)(arg0_operation); |
| 1051 | return status; |
| 1052 | } |
| 1053 | |
| 1054 | /* Wrapper for psa_verify_hash_complete */ |
| 1055 | psa_status_t mbedtls_test_wrap_psa_verify_hash_complete( |
| 1056 | psa_verify_hash_interruptible_operation_t *arg0_operation) |
| 1057 | { |
| 1058 | psa_status_t status = (psa_verify_hash_complete)(arg0_operation); |
| 1059 | return status; |
| 1060 | } |
| 1061 | |
| 1062 | /* Wrapper for psa_verify_hash_start */ |
| 1063 | psa_status_t mbedtls_test_wrap_psa_verify_hash_start( |
| 1064 | psa_verify_hash_interruptible_operation_t *arg0_operation, |
| 1065 | mbedtls_svc_key_id_t arg1_key, |
| 1066 | psa_algorithm_t arg2_alg, |
| 1067 | const uint8_t *arg3_hash, |
| 1068 | size_t arg4_hash_length, |
| 1069 | const uint8_t *arg5_signature, |
| 1070 | size_t arg6_signature_length) |
| 1071 | { |
| 1072 | psa_status_t status = (psa_verify_hash_start)(arg0_operation, arg1_key, arg2_alg, arg3_hash, arg4_hash_length, arg5_signature, arg6_signature_length); |
| 1073 | return status; |
| 1074 | } |
| 1075 | |
| 1076 | /* Wrapper for psa_verify_message */ |
| 1077 | psa_status_t mbedtls_test_wrap_psa_verify_message( |
| 1078 | mbedtls_svc_key_id_t arg0_key, |
| 1079 | psa_algorithm_t arg1_alg, |
| 1080 | const uint8_t *arg2_input, |
| 1081 | size_t arg3_input_length, |
| 1082 | const uint8_t *arg4_signature, |
| 1083 | size_t arg5_signature_length) |
| 1084 | { |
Thomas Daubney | f430f47 | 2024-01-30 12:25:35 +0000 | [diff] [blame] | 1085 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 1086 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 1087 | MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_length); |
| 1088 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1089 | psa_status_t status = (psa_verify_message)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_signature, arg5_signature_length); |
Thomas Daubney | f430f47 | 2024-01-30 12:25:35 +0000 | [diff] [blame] | 1090 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 1091 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 1092 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_length); |
| 1093 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1094 | return status; |
| 1095 | } |
| 1096 | |
Gilles Peskine | 4411c9c | 2024-01-04 20:51:38 +0100 | [diff] [blame] | 1097 | #endif /* defined(MBEDTLS_PSA_CRYPTO_C) && defined(MBEDTLS_TEST_HOOKS) && \ |
| 1098 | !defined(RECORD_PSA_STATUS_COVERAGE_LOG) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1099 | |
| 1100 | /* End of automatically generated file. */ |