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 | { |
Thomas Daubney | 54e6b41 | 2024-01-31 16:56:17 +0000 | [diff] [blame] | 274 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 275 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 276 | MBEDTLS_TEST_MEMORY_POISON(arg4_salt, arg5_salt_length); |
| 277 | MBEDTLS_TEST_MEMORY_POISON(arg6_output, arg7_output_size); |
| 278 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 279 | 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); |
Thomas Daubney | 54e6b41 | 2024-01-31 16:56:17 +0000 | [diff] [blame] | 280 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 281 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 282 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_salt, arg5_salt_length); |
| 283 | MBEDTLS_TEST_MEMORY_UNPOISON(arg6_output, arg7_output_size); |
| 284 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 285 | return status; |
| 286 | } |
| 287 | |
| 288 | /* Wrapper for psa_asymmetric_encrypt */ |
| 289 | psa_status_t mbedtls_test_wrap_psa_asymmetric_encrypt( |
| 290 | mbedtls_svc_key_id_t arg0_key, |
| 291 | psa_algorithm_t arg1_alg, |
| 292 | const uint8_t *arg2_input, |
| 293 | size_t arg3_input_length, |
| 294 | const uint8_t *arg4_salt, |
| 295 | size_t arg5_salt_length, |
| 296 | uint8_t *arg6_output, |
| 297 | size_t arg7_output_size, |
| 298 | size_t *arg8_output_length) |
| 299 | { |
Thomas Daubney | 27b48a3 | 2024-01-30 14:04:47 +0000 | [diff] [blame] | 300 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 301 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 302 | MBEDTLS_TEST_MEMORY_POISON(arg4_salt, arg5_salt_length); |
| 303 | MBEDTLS_TEST_MEMORY_POISON(arg6_output, arg7_output_size); |
| 304 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 305 | psa_status_t status = (psa_asymmetric_encrypt)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_salt, arg5_salt_length, arg6_output, arg7_output_size, arg8_output_length); |
Thomas Daubney | 27b48a3 | 2024-01-30 14:04:47 +0000 | [diff] [blame] | 306 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 307 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 308 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_salt, arg5_salt_length); |
| 309 | MBEDTLS_TEST_MEMORY_UNPOISON(arg6_output, arg7_output_size); |
| 310 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 311 | return status; |
| 312 | } |
| 313 | |
| 314 | /* Wrapper for psa_cipher_abort */ |
| 315 | psa_status_t mbedtls_test_wrap_psa_cipher_abort( |
| 316 | psa_cipher_operation_t *arg0_operation) |
| 317 | { |
| 318 | psa_status_t status = (psa_cipher_abort)(arg0_operation); |
| 319 | return status; |
| 320 | } |
| 321 | |
| 322 | /* Wrapper for psa_cipher_decrypt */ |
| 323 | psa_status_t mbedtls_test_wrap_psa_cipher_decrypt( |
| 324 | mbedtls_svc_key_id_t arg0_key, |
| 325 | psa_algorithm_t arg1_alg, |
| 326 | const uint8_t *arg2_input, |
| 327 | size_t arg3_input_length, |
| 328 | uint8_t *arg4_output, |
| 329 | size_t arg5_output_size, |
| 330 | size_t *arg6_output_length) |
| 331 | { |
Gabor Mezei | b8f97a1 | 2024-01-24 16:58:40 +0100 | [diff] [blame] | 332 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 333 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 334 | MBEDTLS_TEST_MEMORY_POISON(arg4_output, arg5_output_size); |
| 335 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 336 | psa_status_t status = (psa_cipher_decrypt)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_output, arg5_output_size, arg6_output_length); |
Gabor Mezei | b8f97a1 | 2024-01-24 16:58:40 +0100 | [diff] [blame] | 337 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 338 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 339 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_output, arg5_output_size); |
| 340 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 341 | return status; |
| 342 | } |
| 343 | |
| 344 | /* Wrapper for psa_cipher_decrypt_setup */ |
| 345 | psa_status_t mbedtls_test_wrap_psa_cipher_decrypt_setup( |
| 346 | psa_cipher_operation_t *arg0_operation, |
| 347 | mbedtls_svc_key_id_t arg1_key, |
| 348 | psa_algorithm_t arg2_alg) |
| 349 | { |
| 350 | psa_status_t status = (psa_cipher_decrypt_setup)(arg0_operation, arg1_key, arg2_alg); |
| 351 | return status; |
| 352 | } |
| 353 | |
| 354 | /* Wrapper for psa_cipher_encrypt */ |
| 355 | psa_status_t mbedtls_test_wrap_psa_cipher_encrypt( |
| 356 | mbedtls_svc_key_id_t arg0_key, |
| 357 | psa_algorithm_t arg1_alg, |
| 358 | const uint8_t *arg2_input, |
| 359 | size_t arg3_input_length, |
| 360 | uint8_t *arg4_output, |
| 361 | size_t arg5_output_size, |
| 362 | size_t *arg6_output_length) |
| 363 | { |
Gilles Peskine | 88385c2 | 2024-01-04 20:33:29 +0100 | [diff] [blame] | 364 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
Gilles Peskine | 90d14d7 | 2024-01-04 16:59:28 +0100 | [diff] [blame] | 365 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 366 | MBEDTLS_TEST_MEMORY_POISON(arg4_output, arg5_output_size); |
Gilles Peskine | 88385c2 | 2024-01-04 20:33:29 +0100 | [diff] [blame] | 367 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 368 | psa_status_t status = (psa_cipher_encrypt)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_output, arg5_output_size, arg6_output_length); |
Gilles Peskine | 88385c2 | 2024-01-04 20:33:29 +0100 | [diff] [blame] | 369 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
Gilles Peskine | 90d14d7 | 2024-01-04 16:59:28 +0100 | [diff] [blame] | 370 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 371 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_output, arg5_output_size); |
Gilles Peskine | 88385c2 | 2024-01-04 20:33:29 +0100 | [diff] [blame] | 372 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 373 | return status; |
| 374 | } |
| 375 | |
| 376 | /* Wrapper for psa_cipher_encrypt_setup */ |
| 377 | psa_status_t mbedtls_test_wrap_psa_cipher_encrypt_setup( |
| 378 | psa_cipher_operation_t *arg0_operation, |
| 379 | mbedtls_svc_key_id_t arg1_key, |
| 380 | psa_algorithm_t arg2_alg) |
| 381 | { |
| 382 | psa_status_t status = (psa_cipher_encrypt_setup)(arg0_operation, arg1_key, arg2_alg); |
| 383 | return status; |
| 384 | } |
| 385 | |
| 386 | /* Wrapper for psa_cipher_finish */ |
| 387 | psa_status_t mbedtls_test_wrap_psa_cipher_finish( |
| 388 | psa_cipher_operation_t *arg0_operation, |
| 389 | uint8_t *arg1_output, |
| 390 | size_t arg2_output_size, |
| 391 | size_t *arg3_output_length) |
| 392 | { |
Gabor Mezei | b8f97a1 | 2024-01-24 16:58:40 +0100 | [diff] [blame] | 393 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 394 | MBEDTLS_TEST_MEMORY_POISON(arg1_output, arg2_output_size); |
| 395 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 396 | psa_status_t status = (psa_cipher_finish)(arg0_operation, arg1_output, arg2_output_size, arg3_output_length); |
Gabor Mezei | b8f97a1 | 2024-01-24 16:58:40 +0100 | [diff] [blame] | 397 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 398 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_output, arg2_output_size); |
| 399 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 400 | return status; |
| 401 | } |
| 402 | |
| 403 | /* Wrapper for psa_cipher_generate_iv */ |
| 404 | psa_status_t mbedtls_test_wrap_psa_cipher_generate_iv( |
| 405 | psa_cipher_operation_t *arg0_operation, |
| 406 | uint8_t *arg1_iv, |
| 407 | size_t arg2_iv_size, |
| 408 | size_t *arg3_iv_length) |
| 409 | { |
Gabor Mezei | b74ac66 | 2024-02-01 10:39:56 +0100 | [diff] [blame] | 410 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 411 | MBEDTLS_TEST_MEMORY_POISON(arg1_iv, arg2_iv_size); |
| 412 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 413 | psa_status_t status = (psa_cipher_generate_iv)(arg0_operation, arg1_iv, arg2_iv_size, arg3_iv_length); |
Gabor Mezei | b74ac66 | 2024-02-01 10:39:56 +0100 | [diff] [blame] | 414 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 415 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_iv, arg2_iv_size); |
| 416 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 417 | return status; |
| 418 | } |
| 419 | |
| 420 | /* Wrapper for psa_cipher_set_iv */ |
| 421 | psa_status_t mbedtls_test_wrap_psa_cipher_set_iv( |
| 422 | psa_cipher_operation_t *arg0_operation, |
| 423 | const uint8_t *arg1_iv, |
| 424 | size_t arg2_iv_length) |
| 425 | { |
Gabor Mezei | b74ac66 | 2024-02-01 10:39:56 +0100 | [diff] [blame] | 426 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 427 | MBEDTLS_TEST_MEMORY_POISON(arg1_iv, arg2_iv_length); |
| 428 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 429 | psa_status_t status = (psa_cipher_set_iv)(arg0_operation, arg1_iv, arg2_iv_length); |
Gabor Mezei | b74ac66 | 2024-02-01 10:39:56 +0100 | [diff] [blame] | 430 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 431 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_iv, arg2_iv_length); |
| 432 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 433 | return status; |
| 434 | } |
| 435 | |
| 436 | /* Wrapper for psa_cipher_update */ |
| 437 | psa_status_t mbedtls_test_wrap_psa_cipher_update( |
| 438 | psa_cipher_operation_t *arg0_operation, |
| 439 | const uint8_t *arg1_input, |
| 440 | size_t arg2_input_length, |
| 441 | uint8_t *arg3_output, |
| 442 | size_t arg4_output_size, |
| 443 | size_t *arg5_output_length) |
| 444 | { |
Gabor Mezei | b8f97a1 | 2024-01-24 16:58:40 +0100 | [diff] [blame] | 445 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 446 | MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length); |
| 447 | MBEDTLS_TEST_MEMORY_POISON(arg3_output, arg4_output_size); |
| 448 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 449 | psa_status_t status = (psa_cipher_update)(arg0_operation, arg1_input, arg2_input_length, arg3_output, arg4_output_size, arg5_output_length); |
Gabor Mezei | b8f97a1 | 2024-01-24 16:58:40 +0100 | [diff] [blame] | 450 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 451 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length); |
| 452 | MBEDTLS_TEST_MEMORY_UNPOISON(arg3_output, arg4_output_size); |
| 453 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 454 | return status; |
| 455 | } |
| 456 | |
| 457 | /* Wrapper for psa_copy_key */ |
| 458 | psa_status_t mbedtls_test_wrap_psa_copy_key( |
| 459 | mbedtls_svc_key_id_t arg0_source_key, |
| 460 | const psa_key_attributes_t *arg1_attributes, |
| 461 | mbedtls_svc_key_id_t *arg2_target_key) |
| 462 | { |
| 463 | psa_status_t status = (psa_copy_key)(arg0_source_key, arg1_attributes, arg2_target_key); |
| 464 | return status; |
| 465 | } |
| 466 | |
| 467 | /* Wrapper for psa_crypto_driver_pake_get_cipher_suite */ |
| 468 | psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_cipher_suite( |
| 469 | const psa_crypto_driver_pake_inputs_t *arg0_inputs, |
| 470 | psa_pake_cipher_suite_t *arg1_cipher_suite) |
| 471 | { |
| 472 | psa_status_t status = (psa_crypto_driver_pake_get_cipher_suite)(arg0_inputs, arg1_cipher_suite); |
| 473 | return status; |
| 474 | } |
| 475 | |
| 476 | /* Wrapper for psa_crypto_driver_pake_get_password */ |
| 477 | psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_password( |
| 478 | const psa_crypto_driver_pake_inputs_t *arg0_inputs, |
| 479 | uint8_t *arg1_buffer, |
| 480 | size_t arg2_buffer_size, |
| 481 | size_t *arg3_buffer_length) |
| 482 | { |
| 483 | psa_status_t status = (psa_crypto_driver_pake_get_password)(arg0_inputs, arg1_buffer, arg2_buffer_size, arg3_buffer_length); |
| 484 | return status; |
| 485 | } |
| 486 | |
| 487 | /* Wrapper for psa_crypto_driver_pake_get_password_len */ |
| 488 | psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_password_len( |
| 489 | const psa_crypto_driver_pake_inputs_t *arg0_inputs, |
| 490 | size_t *arg1_password_len) |
| 491 | { |
| 492 | psa_status_t status = (psa_crypto_driver_pake_get_password_len)(arg0_inputs, arg1_password_len); |
| 493 | return status; |
| 494 | } |
| 495 | |
| 496 | /* Wrapper for psa_crypto_driver_pake_get_peer */ |
| 497 | psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_peer( |
| 498 | const psa_crypto_driver_pake_inputs_t *arg0_inputs, |
| 499 | uint8_t *arg1_peer_id, |
| 500 | size_t arg2_peer_id_size, |
| 501 | size_t *arg3_peer_id_length) |
| 502 | { |
| 503 | psa_status_t status = (psa_crypto_driver_pake_get_peer)(arg0_inputs, arg1_peer_id, arg2_peer_id_size, arg3_peer_id_length); |
| 504 | return status; |
| 505 | } |
| 506 | |
| 507 | /* Wrapper for psa_crypto_driver_pake_get_peer_len */ |
| 508 | psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_peer_len( |
| 509 | const psa_crypto_driver_pake_inputs_t *arg0_inputs, |
| 510 | size_t *arg1_peer_len) |
| 511 | { |
| 512 | psa_status_t status = (psa_crypto_driver_pake_get_peer_len)(arg0_inputs, arg1_peer_len); |
| 513 | return status; |
| 514 | } |
| 515 | |
| 516 | /* Wrapper for psa_crypto_driver_pake_get_user */ |
| 517 | psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_user( |
| 518 | const psa_crypto_driver_pake_inputs_t *arg0_inputs, |
| 519 | uint8_t *arg1_user_id, |
| 520 | size_t arg2_user_id_size, |
| 521 | size_t *arg3_user_id_len) |
| 522 | { |
| 523 | psa_status_t status = (psa_crypto_driver_pake_get_user)(arg0_inputs, arg1_user_id, arg2_user_id_size, arg3_user_id_len); |
| 524 | return status; |
| 525 | } |
| 526 | |
| 527 | /* Wrapper for psa_crypto_driver_pake_get_user_len */ |
| 528 | psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_user_len( |
| 529 | const psa_crypto_driver_pake_inputs_t *arg0_inputs, |
| 530 | size_t *arg1_user_len) |
| 531 | { |
| 532 | psa_status_t status = (psa_crypto_driver_pake_get_user_len)(arg0_inputs, arg1_user_len); |
| 533 | return status; |
| 534 | } |
| 535 | |
| 536 | /* Wrapper for psa_crypto_init */ |
| 537 | psa_status_t mbedtls_test_wrap_psa_crypto_init(void) |
| 538 | { |
| 539 | psa_status_t status = (psa_crypto_init)(); |
| 540 | return status; |
| 541 | } |
| 542 | |
| 543 | /* Wrapper for psa_destroy_key */ |
| 544 | psa_status_t mbedtls_test_wrap_psa_destroy_key( |
| 545 | mbedtls_svc_key_id_t arg0_key) |
| 546 | { |
| 547 | psa_status_t status = (psa_destroy_key)(arg0_key); |
| 548 | return status; |
| 549 | } |
| 550 | |
| 551 | /* Wrapper for psa_export_key */ |
| 552 | psa_status_t mbedtls_test_wrap_psa_export_key( |
| 553 | mbedtls_svc_key_id_t arg0_key, |
| 554 | uint8_t *arg1_data, |
| 555 | size_t arg2_data_size, |
| 556 | size_t *arg3_data_length) |
| 557 | { |
Ryan Everett | 77b91e3 | 2024-01-25 10:58:06 +0000 | [diff] [blame] | 558 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 559 | MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_size); |
| 560 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 561 | 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] | 562 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 563 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_size); |
| 564 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 565 | return status; |
| 566 | } |
| 567 | |
| 568 | /* Wrapper for psa_export_public_key */ |
| 569 | psa_status_t mbedtls_test_wrap_psa_export_public_key( |
| 570 | mbedtls_svc_key_id_t arg0_key, |
| 571 | uint8_t *arg1_data, |
| 572 | size_t arg2_data_size, |
| 573 | size_t *arg3_data_length) |
| 574 | { |
Ryan Everett | 77b91e3 | 2024-01-25 10:58:06 +0000 | [diff] [blame] | 575 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 576 | MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_size); |
| 577 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 578 | 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] | 579 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 580 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_size); |
| 581 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 582 | return status; |
| 583 | } |
| 584 | |
| 585 | /* Wrapper for psa_generate_key */ |
| 586 | psa_status_t mbedtls_test_wrap_psa_generate_key( |
| 587 | const psa_key_attributes_t *arg0_attributes, |
| 588 | mbedtls_svc_key_id_t *arg1_key) |
| 589 | { |
| 590 | psa_status_t status = (psa_generate_key)(arg0_attributes, arg1_key); |
| 591 | return status; |
| 592 | } |
| 593 | |
David Horstmann | 80a5dbd | 2024-03-12 17:02:48 +0000 | [diff] [blame] | 594 | /* Wrapper for psa_generate_key_ext */ |
| 595 | psa_status_t mbedtls_test_wrap_psa_generate_key_ext( |
| 596 | const psa_key_attributes_t *arg0_attributes, |
| 597 | const psa_key_production_parameters_t *arg1_params, |
| 598 | size_t arg2_params_data_length, |
| 599 | mbedtls_svc_key_id_t *arg3_key) |
| 600 | { |
| 601 | psa_status_t status = (psa_generate_key_ext)(arg0_attributes, arg1_params, arg2_params_data_length, arg3_key); |
| 602 | return status; |
| 603 | } |
| 604 | |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 605 | /* Wrapper for psa_generate_random */ |
| 606 | psa_status_t mbedtls_test_wrap_psa_generate_random( |
| 607 | uint8_t *arg0_output, |
| 608 | size_t arg1_output_size) |
| 609 | { |
David Horstmann | 075c5fb | 2024-02-06 15:44:08 +0000 | [diff] [blame] | 610 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 611 | MBEDTLS_TEST_MEMORY_POISON(arg0_output, arg1_output_size); |
| 612 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 613 | psa_status_t status = (psa_generate_random)(arg0_output, arg1_output_size); |
David Horstmann | 075c5fb | 2024-02-06 15:44:08 +0000 | [diff] [blame] | 614 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 615 | MBEDTLS_TEST_MEMORY_UNPOISON(arg0_output, arg1_output_size); |
| 616 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 617 | return status; |
| 618 | } |
| 619 | |
| 620 | /* Wrapper for psa_get_key_attributes */ |
| 621 | psa_status_t mbedtls_test_wrap_psa_get_key_attributes( |
| 622 | mbedtls_svc_key_id_t arg0_key, |
| 623 | psa_key_attributes_t *arg1_attributes) |
| 624 | { |
| 625 | psa_status_t status = (psa_get_key_attributes)(arg0_key, arg1_attributes); |
| 626 | return status; |
| 627 | } |
| 628 | |
| 629 | /* Wrapper for psa_hash_abort */ |
| 630 | psa_status_t mbedtls_test_wrap_psa_hash_abort( |
| 631 | psa_hash_operation_t *arg0_operation) |
| 632 | { |
| 633 | psa_status_t status = (psa_hash_abort)(arg0_operation); |
| 634 | return status; |
| 635 | } |
| 636 | |
| 637 | /* Wrapper for psa_hash_clone */ |
| 638 | psa_status_t mbedtls_test_wrap_psa_hash_clone( |
| 639 | const psa_hash_operation_t *arg0_source_operation, |
| 640 | psa_hash_operation_t *arg1_target_operation) |
| 641 | { |
| 642 | psa_status_t status = (psa_hash_clone)(arg0_source_operation, arg1_target_operation); |
| 643 | return status; |
| 644 | } |
| 645 | |
| 646 | /* Wrapper for psa_hash_compare */ |
| 647 | psa_status_t mbedtls_test_wrap_psa_hash_compare( |
| 648 | psa_algorithm_t arg0_alg, |
| 649 | const uint8_t *arg1_input, |
| 650 | size_t arg2_input_length, |
| 651 | const uint8_t *arg3_hash, |
| 652 | size_t arg4_hash_length) |
| 653 | { |
Thomas Daubney | 45c8586 | 2024-01-25 16:48:09 +0000 | [diff] [blame] | 654 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 655 | MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length); |
| 656 | MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_length); |
| 657 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 658 | psa_status_t status = (psa_hash_compare)(arg0_alg, arg1_input, arg2_input_length, arg3_hash, arg4_hash_length); |
Thomas Daubney | 45c8586 | 2024-01-25 16:48:09 +0000 | [diff] [blame] | 659 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 660 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length); |
| 661 | MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_length); |
| 662 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 663 | return status; |
| 664 | } |
| 665 | |
| 666 | /* Wrapper for psa_hash_compute */ |
| 667 | psa_status_t mbedtls_test_wrap_psa_hash_compute( |
| 668 | psa_algorithm_t arg0_alg, |
| 669 | const uint8_t *arg1_input, |
| 670 | size_t arg2_input_length, |
| 671 | uint8_t *arg3_hash, |
| 672 | size_t arg4_hash_size, |
| 673 | size_t *arg5_hash_length) |
| 674 | { |
Thomas Daubney | 45c8586 | 2024-01-25 16:48:09 +0000 | [diff] [blame] | 675 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 676 | MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length); |
| 677 | MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_size); |
| 678 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 679 | psa_status_t status = (psa_hash_compute)(arg0_alg, arg1_input, arg2_input_length, arg3_hash, arg4_hash_size, arg5_hash_length); |
Thomas Daubney | 45c8586 | 2024-01-25 16:48:09 +0000 | [diff] [blame] | 680 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 681 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length); |
| 682 | MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_size); |
| 683 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 684 | return status; |
| 685 | } |
| 686 | |
| 687 | /* Wrapper for psa_hash_finish */ |
| 688 | psa_status_t mbedtls_test_wrap_psa_hash_finish( |
| 689 | psa_hash_operation_t *arg0_operation, |
| 690 | uint8_t *arg1_hash, |
| 691 | size_t arg2_hash_size, |
| 692 | size_t *arg3_hash_length) |
| 693 | { |
Thomas Daubney | 45c8586 | 2024-01-25 16:48:09 +0000 | [diff] [blame] | 694 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 695 | MBEDTLS_TEST_MEMORY_POISON(arg1_hash, arg2_hash_size); |
| 696 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 697 | psa_status_t status = (psa_hash_finish)(arg0_operation, arg1_hash, arg2_hash_size, arg3_hash_length); |
Thomas Daubney | 45c8586 | 2024-01-25 16:48:09 +0000 | [diff] [blame] | 698 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 699 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_hash, arg2_hash_size); |
| 700 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 701 | return status; |
| 702 | } |
| 703 | |
| 704 | /* Wrapper for psa_hash_setup */ |
| 705 | psa_status_t mbedtls_test_wrap_psa_hash_setup( |
| 706 | psa_hash_operation_t *arg0_operation, |
| 707 | psa_algorithm_t arg1_alg) |
| 708 | { |
| 709 | psa_status_t status = (psa_hash_setup)(arg0_operation, arg1_alg); |
| 710 | return status; |
| 711 | } |
| 712 | |
| 713 | /* Wrapper for psa_hash_update */ |
| 714 | psa_status_t mbedtls_test_wrap_psa_hash_update( |
| 715 | psa_hash_operation_t *arg0_operation, |
| 716 | const uint8_t *arg1_input, |
| 717 | size_t arg2_input_length) |
| 718 | { |
Thomas Daubney | 45c8586 | 2024-01-25 16:48:09 +0000 | [diff] [blame] | 719 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 720 | MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length); |
| 721 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 722 | psa_status_t status = (psa_hash_update)(arg0_operation, arg1_input, arg2_input_length); |
Thomas Daubney | 45c8586 | 2024-01-25 16:48:09 +0000 | [diff] [blame] | 723 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 724 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length); |
| 725 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 726 | return status; |
| 727 | } |
| 728 | |
| 729 | /* Wrapper for psa_hash_verify */ |
| 730 | psa_status_t mbedtls_test_wrap_psa_hash_verify( |
| 731 | psa_hash_operation_t *arg0_operation, |
| 732 | const uint8_t *arg1_hash, |
| 733 | size_t arg2_hash_length) |
| 734 | { |
Thomas Daubney | 45c8586 | 2024-01-25 16:48:09 +0000 | [diff] [blame] | 735 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 736 | MBEDTLS_TEST_MEMORY_POISON(arg1_hash, arg2_hash_length); |
| 737 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 738 | psa_status_t status = (psa_hash_verify)(arg0_operation, arg1_hash, arg2_hash_length); |
Thomas Daubney | 45c8586 | 2024-01-25 16:48:09 +0000 | [diff] [blame] | 739 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 740 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_hash, arg2_hash_length); |
| 741 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 742 | return status; |
| 743 | } |
| 744 | |
| 745 | /* Wrapper for psa_import_key */ |
| 746 | psa_status_t mbedtls_test_wrap_psa_import_key( |
| 747 | const psa_key_attributes_t *arg0_attributes, |
| 748 | const uint8_t *arg1_data, |
| 749 | size_t arg2_data_length, |
| 750 | mbedtls_svc_key_id_t *arg3_key) |
| 751 | { |
Ryan Everett | 77b91e3 | 2024-01-25 10:58:06 +0000 | [diff] [blame] | 752 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 753 | MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_length); |
| 754 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 755 | 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] | 756 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 757 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_length); |
| 758 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 759 | return status; |
| 760 | } |
| 761 | |
| 762 | /* Wrapper for psa_key_derivation_abort */ |
| 763 | psa_status_t mbedtls_test_wrap_psa_key_derivation_abort( |
| 764 | psa_key_derivation_operation_t *arg0_operation) |
| 765 | { |
| 766 | psa_status_t status = (psa_key_derivation_abort)(arg0_operation); |
| 767 | return status; |
| 768 | } |
| 769 | |
| 770 | /* Wrapper for psa_key_derivation_get_capacity */ |
| 771 | psa_status_t mbedtls_test_wrap_psa_key_derivation_get_capacity( |
| 772 | const psa_key_derivation_operation_t *arg0_operation, |
| 773 | size_t *arg1_capacity) |
| 774 | { |
| 775 | psa_status_t status = (psa_key_derivation_get_capacity)(arg0_operation, arg1_capacity); |
| 776 | return status; |
| 777 | } |
| 778 | |
| 779 | /* Wrapper for psa_key_derivation_input_bytes */ |
| 780 | psa_status_t mbedtls_test_wrap_psa_key_derivation_input_bytes( |
| 781 | psa_key_derivation_operation_t *arg0_operation, |
| 782 | psa_key_derivation_step_t arg1_step, |
| 783 | const uint8_t *arg2_data, |
| 784 | size_t arg3_data_length) |
| 785 | { |
Ryan Everett | 198a4d9 | 2024-01-25 11:44:56 +0000 | [diff] [blame] | 786 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 787 | MBEDTLS_TEST_MEMORY_POISON(arg2_data, arg3_data_length); |
| 788 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 789 | psa_status_t status = (psa_key_derivation_input_bytes)(arg0_operation, arg1_step, arg2_data, arg3_data_length); |
Ryan Everett | 198a4d9 | 2024-01-25 11:44:56 +0000 | [diff] [blame] | 790 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 791 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_data, arg3_data_length); |
| 792 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 793 | return status; |
| 794 | } |
| 795 | |
| 796 | /* Wrapper for psa_key_derivation_input_integer */ |
| 797 | psa_status_t mbedtls_test_wrap_psa_key_derivation_input_integer( |
| 798 | psa_key_derivation_operation_t *arg0_operation, |
| 799 | psa_key_derivation_step_t arg1_step, |
| 800 | uint64_t arg2_value) |
| 801 | { |
| 802 | psa_status_t status = (psa_key_derivation_input_integer)(arg0_operation, arg1_step, arg2_value); |
| 803 | return status; |
| 804 | } |
| 805 | |
| 806 | /* Wrapper for psa_key_derivation_input_key */ |
| 807 | psa_status_t mbedtls_test_wrap_psa_key_derivation_input_key( |
| 808 | psa_key_derivation_operation_t *arg0_operation, |
| 809 | psa_key_derivation_step_t arg1_step, |
| 810 | mbedtls_svc_key_id_t arg2_key) |
| 811 | { |
| 812 | psa_status_t status = (psa_key_derivation_input_key)(arg0_operation, arg1_step, arg2_key); |
| 813 | return status; |
| 814 | } |
| 815 | |
| 816 | /* Wrapper for psa_key_derivation_key_agreement */ |
| 817 | psa_status_t mbedtls_test_wrap_psa_key_derivation_key_agreement( |
| 818 | psa_key_derivation_operation_t *arg0_operation, |
| 819 | psa_key_derivation_step_t arg1_step, |
| 820 | mbedtls_svc_key_id_t arg2_private_key, |
| 821 | const uint8_t *arg3_peer_key, |
| 822 | size_t arg4_peer_key_length) |
| 823 | { |
Thomas Daubney | fe2bda3 | 2024-02-15 13:35:06 +0000 | [diff] [blame] | 824 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 825 | MBEDTLS_TEST_MEMORY_POISON(arg3_peer_key, arg4_peer_key_length); |
| 826 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 827 | psa_status_t status = (psa_key_derivation_key_agreement)(arg0_operation, arg1_step, arg2_private_key, arg3_peer_key, arg4_peer_key_length); |
Thomas Daubney | fe2bda3 | 2024-02-15 13:35:06 +0000 | [diff] [blame] | 828 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 829 | MBEDTLS_TEST_MEMORY_UNPOISON(arg3_peer_key, arg4_peer_key_length); |
| 830 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 831 | return status; |
| 832 | } |
| 833 | |
| 834 | /* Wrapper for psa_key_derivation_output_bytes */ |
| 835 | psa_status_t mbedtls_test_wrap_psa_key_derivation_output_bytes( |
| 836 | psa_key_derivation_operation_t *arg0_operation, |
| 837 | uint8_t *arg1_output, |
| 838 | size_t arg2_output_length) |
| 839 | { |
Ryan Everett | 198a4d9 | 2024-01-25 11:44:56 +0000 | [diff] [blame] | 840 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 841 | MBEDTLS_TEST_MEMORY_POISON(arg1_output, arg2_output_length); |
| 842 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 843 | psa_status_t status = (psa_key_derivation_output_bytes)(arg0_operation, arg1_output, arg2_output_length); |
Ryan Everett | 198a4d9 | 2024-01-25 11:44:56 +0000 | [diff] [blame] | 844 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 845 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_output, arg2_output_length); |
| 846 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 847 | return status; |
| 848 | } |
| 849 | |
| 850 | /* Wrapper for psa_key_derivation_output_key */ |
| 851 | psa_status_t mbedtls_test_wrap_psa_key_derivation_output_key( |
| 852 | const psa_key_attributes_t *arg0_attributes, |
| 853 | psa_key_derivation_operation_t *arg1_operation, |
| 854 | mbedtls_svc_key_id_t *arg2_key) |
| 855 | { |
| 856 | psa_status_t status = (psa_key_derivation_output_key)(arg0_attributes, arg1_operation, arg2_key); |
| 857 | return status; |
| 858 | } |
| 859 | |
David Horstmann | 80a5dbd | 2024-03-12 17:02:48 +0000 | [diff] [blame] | 860 | /* Wrapper for psa_key_derivation_output_key_ext */ |
| 861 | psa_status_t mbedtls_test_wrap_psa_key_derivation_output_key_ext( |
| 862 | const psa_key_attributes_t *arg0_attributes, |
| 863 | psa_key_derivation_operation_t *arg1_operation, |
| 864 | const psa_key_production_parameters_t *arg2_params, |
| 865 | size_t arg3_params_data_length, |
| 866 | mbedtls_svc_key_id_t *arg4_key) |
| 867 | { |
| 868 | psa_status_t status = (psa_key_derivation_output_key_ext)(arg0_attributes, arg1_operation, arg2_params, arg3_params_data_length, arg4_key); |
| 869 | return status; |
| 870 | } |
| 871 | |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 872 | /* Wrapper for psa_key_derivation_set_capacity */ |
| 873 | psa_status_t mbedtls_test_wrap_psa_key_derivation_set_capacity( |
| 874 | psa_key_derivation_operation_t *arg0_operation, |
| 875 | size_t arg1_capacity) |
| 876 | { |
| 877 | psa_status_t status = (psa_key_derivation_set_capacity)(arg0_operation, arg1_capacity); |
| 878 | return status; |
| 879 | } |
| 880 | |
| 881 | /* Wrapper for psa_key_derivation_setup */ |
| 882 | psa_status_t mbedtls_test_wrap_psa_key_derivation_setup( |
| 883 | psa_key_derivation_operation_t *arg0_operation, |
| 884 | psa_algorithm_t arg1_alg) |
| 885 | { |
| 886 | psa_status_t status = (psa_key_derivation_setup)(arg0_operation, arg1_alg); |
| 887 | return status; |
| 888 | } |
| 889 | |
| 890 | /* Wrapper for psa_mac_abort */ |
| 891 | psa_status_t mbedtls_test_wrap_psa_mac_abort( |
| 892 | psa_mac_operation_t *arg0_operation) |
| 893 | { |
| 894 | psa_status_t status = (psa_mac_abort)(arg0_operation); |
| 895 | return status; |
| 896 | } |
| 897 | |
| 898 | /* Wrapper for psa_mac_compute */ |
| 899 | psa_status_t mbedtls_test_wrap_psa_mac_compute( |
| 900 | mbedtls_svc_key_id_t arg0_key, |
| 901 | psa_algorithm_t arg1_alg, |
| 902 | const uint8_t *arg2_input, |
| 903 | size_t arg3_input_length, |
| 904 | uint8_t *arg4_mac, |
| 905 | size_t arg5_mac_size, |
| 906 | size_t *arg6_mac_length) |
| 907 | { |
Thomas Daubney | a1cf101 | 2024-01-30 11:18:54 +0000 | [diff] [blame] | 908 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 909 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 910 | MBEDTLS_TEST_MEMORY_POISON(arg4_mac, arg5_mac_size); |
| 911 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 912 | psa_status_t status = (psa_mac_compute)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_mac, arg5_mac_size, arg6_mac_length); |
Thomas Daubney | a1cf101 | 2024-01-30 11:18:54 +0000 | [diff] [blame] | 913 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 914 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 915 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_mac, arg5_mac_size); |
| 916 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 917 | return status; |
| 918 | } |
| 919 | |
| 920 | /* Wrapper for psa_mac_sign_finish */ |
| 921 | psa_status_t mbedtls_test_wrap_psa_mac_sign_finish( |
| 922 | psa_mac_operation_t *arg0_operation, |
| 923 | uint8_t *arg1_mac, |
| 924 | size_t arg2_mac_size, |
| 925 | size_t *arg3_mac_length) |
| 926 | { |
Thomas Daubney | a1cf101 | 2024-01-30 11:18:54 +0000 | [diff] [blame] | 927 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 928 | MBEDTLS_TEST_MEMORY_POISON(arg1_mac, arg2_mac_size); |
| 929 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 930 | psa_status_t status = (psa_mac_sign_finish)(arg0_operation, arg1_mac, arg2_mac_size, arg3_mac_length); |
Thomas Daubney | a1cf101 | 2024-01-30 11:18:54 +0000 | [diff] [blame] | 931 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 932 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_mac, arg2_mac_size); |
| 933 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 934 | return status; |
| 935 | } |
| 936 | |
| 937 | /* Wrapper for psa_mac_sign_setup */ |
| 938 | psa_status_t mbedtls_test_wrap_psa_mac_sign_setup( |
| 939 | psa_mac_operation_t *arg0_operation, |
| 940 | mbedtls_svc_key_id_t arg1_key, |
| 941 | psa_algorithm_t arg2_alg) |
| 942 | { |
| 943 | psa_status_t status = (psa_mac_sign_setup)(arg0_operation, arg1_key, arg2_alg); |
| 944 | return status; |
| 945 | } |
| 946 | |
| 947 | /* Wrapper for psa_mac_update */ |
| 948 | psa_status_t mbedtls_test_wrap_psa_mac_update( |
| 949 | psa_mac_operation_t *arg0_operation, |
| 950 | const uint8_t *arg1_input, |
| 951 | size_t arg2_input_length) |
| 952 | { |
Thomas Daubney | a1cf101 | 2024-01-30 11:18:54 +0000 | [diff] [blame] | 953 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 954 | MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length); |
| 955 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 956 | psa_status_t status = (psa_mac_update)(arg0_operation, arg1_input, arg2_input_length); |
Thomas Daubney | a1cf101 | 2024-01-30 11:18:54 +0000 | [diff] [blame] | 957 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 958 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length); |
| 959 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 960 | return status; |
| 961 | } |
| 962 | |
| 963 | /* Wrapper for psa_mac_verify */ |
| 964 | psa_status_t mbedtls_test_wrap_psa_mac_verify( |
| 965 | mbedtls_svc_key_id_t arg0_key, |
| 966 | psa_algorithm_t arg1_alg, |
| 967 | const uint8_t *arg2_input, |
| 968 | size_t arg3_input_length, |
| 969 | const uint8_t *arg4_mac, |
| 970 | size_t arg5_mac_length) |
| 971 | { |
Thomas Daubney | a1cf101 | 2024-01-30 11:18:54 +0000 | [diff] [blame] | 972 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 973 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 974 | MBEDTLS_TEST_MEMORY_POISON(arg4_mac, arg5_mac_length); |
| 975 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 976 | psa_status_t status = (psa_mac_verify)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_mac, arg5_mac_length); |
Thomas Daubney | a1cf101 | 2024-01-30 11:18:54 +0000 | [diff] [blame] | 977 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 978 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 979 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_mac, arg5_mac_length); |
| 980 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 981 | return status; |
| 982 | } |
| 983 | |
| 984 | /* Wrapper for psa_mac_verify_finish */ |
| 985 | psa_status_t mbedtls_test_wrap_psa_mac_verify_finish( |
| 986 | psa_mac_operation_t *arg0_operation, |
| 987 | const uint8_t *arg1_mac, |
| 988 | size_t arg2_mac_length) |
| 989 | { |
Thomas Daubney | a1cf101 | 2024-01-30 11:18:54 +0000 | [diff] [blame] | 990 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 991 | MBEDTLS_TEST_MEMORY_POISON(arg1_mac, arg2_mac_length); |
| 992 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 993 | psa_status_t status = (psa_mac_verify_finish)(arg0_operation, arg1_mac, arg2_mac_length); |
Thomas Daubney | a1cf101 | 2024-01-30 11:18:54 +0000 | [diff] [blame] | 994 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 995 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_mac, arg2_mac_length); |
| 996 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 997 | return status; |
| 998 | } |
| 999 | |
| 1000 | /* Wrapper for psa_mac_verify_setup */ |
| 1001 | psa_status_t mbedtls_test_wrap_psa_mac_verify_setup( |
| 1002 | psa_mac_operation_t *arg0_operation, |
| 1003 | mbedtls_svc_key_id_t arg1_key, |
| 1004 | psa_algorithm_t arg2_alg) |
| 1005 | { |
| 1006 | psa_status_t status = (psa_mac_verify_setup)(arg0_operation, arg1_key, arg2_alg); |
| 1007 | return status; |
| 1008 | } |
| 1009 | |
| 1010 | /* Wrapper for psa_pake_abort */ |
| 1011 | psa_status_t mbedtls_test_wrap_psa_pake_abort( |
| 1012 | psa_pake_operation_t *arg0_operation) |
| 1013 | { |
| 1014 | psa_status_t status = (psa_pake_abort)(arg0_operation); |
| 1015 | return status; |
| 1016 | } |
| 1017 | |
| 1018 | /* Wrapper for psa_pake_get_implicit_key */ |
| 1019 | psa_status_t mbedtls_test_wrap_psa_pake_get_implicit_key( |
| 1020 | psa_pake_operation_t *arg0_operation, |
| 1021 | psa_key_derivation_operation_t *arg1_output) |
| 1022 | { |
| 1023 | psa_status_t status = (psa_pake_get_implicit_key)(arg0_operation, arg1_output); |
| 1024 | return status; |
| 1025 | } |
| 1026 | |
| 1027 | /* Wrapper for psa_pake_input */ |
| 1028 | psa_status_t mbedtls_test_wrap_psa_pake_input( |
| 1029 | psa_pake_operation_t *arg0_operation, |
| 1030 | psa_pake_step_t arg1_step, |
| 1031 | const uint8_t *arg2_input, |
| 1032 | size_t arg3_input_length) |
| 1033 | { |
David Horstmann | 6076fe4 | 2024-01-23 15:28:51 +0000 | [diff] [blame] | 1034 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 1035 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 1036 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1037 | psa_status_t status = (psa_pake_input)(arg0_operation, arg1_step, arg2_input, arg3_input_length); |
David Horstmann | 6076fe4 | 2024-01-23 15:28:51 +0000 | [diff] [blame] | 1038 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 1039 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 1040 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1041 | return status; |
| 1042 | } |
| 1043 | |
| 1044 | /* Wrapper for psa_pake_output */ |
| 1045 | psa_status_t mbedtls_test_wrap_psa_pake_output( |
| 1046 | psa_pake_operation_t *arg0_operation, |
| 1047 | psa_pake_step_t arg1_step, |
| 1048 | uint8_t *arg2_output, |
| 1049 | size_t arg3_output_size, |
| 1050 | size_t *arg4_output_length) |
| 1051 | { |
David Horstmann | 6076fe4 | 2024-01-23 15:28:51 +0000 | [diff] [blame] | 1052 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 1053 | MBEDTLS_TEST_MEMORY_POISON(arg2_output, arg3_output_size); |
| 1054 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1055 | psa_status_t status = (psa_pake_output)(arg0_operation, arg1_step, arg2_output, arg3_output_size, arg4_output_length); |
David Horstmann | 6076fe4 | 2024-01-23 15:28:51 +0000 | [diff] [blame] | 1056 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 1057 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_output, arg3_output_size); |
| 1058 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1059 | return status; |
| 1060 | } |
| 1061 | |
| 1062 | /* Wrapper for psa_pake_set_password_key */ |
| 1063 | psa_status_t mbedtls_test_wrap_psa_pake_set_password_key( |
| 1064 | psa_pake_operation_t *arg0_operation, |
| 1065 | mbedtls_svc_key_id_t arg1_password) |
| 1066 | { |
| 1067 | psa_status_t status = (psa_pake_set_password_key)(arg0_operation, arg1_password); |
| 1068 | return status; |
| 1069 | } |
| 1070 | |
| 1071 | /* Wrapper for psa_pake_set_peer */ |
| 1072 | psa_status_t mbedtls_test_wrap_psa_pake_set_peer( |
| 1073 | psa_pake_operation_t *arg0_operation, |
| 1074 | const uint8_t *arg1_peer_id, |
| 1075 | size_t arg2_peer_id_len) |
| 1076 | { |
David Horstmann | 6076fe4 | 2024-01-23 15:28:51 +0000 | [diff] [blame] | 1077 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 1078 | MBEDTLS_TEST_MEMORY_POISON(arg1_peer_id, arg2_peer_id_len); |
| 1079 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1080 | psa_status_t status = (psa_pake_set_peer)(arg0_operation, arg1_peer_id, arg2_peer_id_len); |
David Horstmann | 6076fe4 | 2024-01-23 15:28:51 +0000 | [diff] [blame] | 1081 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 1082 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_peer_id, arg2_peer_id_len); |
| 1083 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1084 | return status; |
| 1085 | } |
| 1086 | |
| 1087 | /* Wrapper for psa_pake_set_role */ |
| 1088 | psa_status_t mbedtls_test_wrap_psa_pake_set_role( |
| 1089 | psa_pake_operation_t *arg0_operation, |
| 1090 | psa_pake_role_t arg1_role) |
| 1091 | { |
| 1092 | psa_status_t status = (psa_pake_set_role)(arg0_operation, arg1_role); |
| 1093 | return status; |
| 1094 | } |
| 1095 | |
| 1096 | /* Wrapper for psa_pake_set_user */ |
| 1097 | psa_status_t mbedtls_test_wrap_psa_pake_set_user( |
| 1098 | psa_pake_operation_t *arg0_operation, |
| 1099 | const uint8_t *arg1_user_id, |
| 1100 | size_t arg2_user_id_len) |
| 1101 | { |
David Horstmann | 6076fe4 | 2024-01-23 15:28:51 +0000 | [diff] [blame] | 1102 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 1103 | MBEDTLS_TEST_MEMORY_POISON(arg1_user_id, arg2_user_id_len); |
| 1104 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1105 | psa_status_t status = (psa_pake_set_user)(arg0_operation, arg1_user_id, arg2_user_id_len); |
David Horstmann | 6076fe4 | 2024-01-23 15:28:51 +0000 | [diff] [blame] | 1106 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 1107 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_user_id, arg2_user_id_len); |
| 1108 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1109 | return status; |
| 1110 | } |
| 1111 | |
| 1112 | /* Wrapper for psa_pake_setup */ |
| 1113 | psa_status_t mbedtls_test_wrap_psa_pake_setup( |
| 1114 | psa_pake_operation_t *arg0_operation, |
| 1115 | const psa_pake_cipher_suite_t *arg1_cipher_suite) |
| 1116 | { |
| 1117 | psa_status_t status = (psa_pake_setup)(arg0_operation, arg1_cipher_suite); |
| 1118 | return status; |
| 1119 | } |
| 1120 | |
| 1121 | /* Wrapper for psa_purge_key */ |
| 1122 | psa_status_t mbedtls_test_wrap_psa_purge_key( |
| 1123 | mbedtls_svc_key_id_t arg0_key) |
| 1124 | { |
| 1125 | psa_status_t status = (psa_purge_key)(arg0_key); |
| 1126 | return status; |
| 1127 | } |
| 1128 | |
| 1129 | /* Wrapper for psa_raw_key_agreement */ |
| 1130 | psa_status_t mbedtls_test_wrap_psa_raw_key_agreement( |
| 1131 | psa_algorithm_t arg0_alg, |
| 1132 | mbedtls_svc_key_id_t arg1_private_key, |
| 1133 | const uint8_t *arg2_peer_key, |
| 1134 | size_t arg3_peer_key_length, |
| 1135 | uint8_t *arg4_output, |
| 1136 | size_t arg5_output_size, |
| 1137 | size_t *arg6_output_length) |
| 1138 | { |
Thomas Daubney | fe2bda3 | 2024-02-15 13:35:06 +0000 | [diff] [blame] | 1139 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 1140 | MBEDTLS_TEST_MEMORY_POISON(arg2_peer_key, arg3_peer_key_length); |
| 1141 | MBEDTLS_TEST_MEMORY_POISON(arg4_output, arg5_output_size); |
| 1142 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1143 | 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); |
Thomas Daubney | fe2bda3 | 2024-02-15 13:35:06 +0000 | [diff] [blame] | 1144 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 1145 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_peer_key, arg3_peer_key_length); |
| 1146 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_output, arg5_output_size); |
| 1147 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1148 | return status; |
| 1149 | } |
| 1150 | |
| 1151 | /* Wrapper for psa_sign_hash */ |
| 1152 | psa_status_t mbedtls_test_wrap_psa_sign_hash( |
| 1153 | mbedtls_svc_key_id_t arg0_key, |
| 1154 | psa_algorithm_t arg1_alg, |
| 1155 | const uint8_t *arg2_hash, |
| 1156 | size_t arg3_hash_length, |
| 1157 | uint8_t *arg4_signature, |
| 1158 | size_t arg5_signature_size, |
| 1159 | size_t *arg6_signature_length) |
| 1160 | { |
Thomas Daubney | f430f47 | 2024-01-30 12:25:35 +0000 | [diff] [blame] | 1161 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 1162 | MBEDTLS_TEST_MEMORY_POISON(arg2_hash, arg3_hash_length); |
| 1163 | MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_size); |
| 1164 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1165 | 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] | 1166 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 1167 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_hash, arg3_hash_length); |
| 1168 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_size); |
| 1169 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1170 | return status; |
| 1171 | } |
| 1172 | |
| 1173 | /* Wrapper for psa_sign_hash_abort */ |
| 1174 | psa_status_t mbedtls_test_wrap_psa_sign_hash_abort( |
| 1175 | psa_sign_hash_interruptible_operation_t *arg0_operation) |
| 1176 | { |
| 1177 | psa_status_t status = (psa_sign_hash_abort)(arg0_operation); |
| 1178 | return status; |
| 1179 | } |
| 1180 | |
| 1181 | /* Wrapper for psa_sign_hash_complete */ |
| 1182 | psa_status_t mbedtls_test_wrap_psa_sign_hash_complete( |
| 1183 | psa_sign_hash_interruptible_operation_t *arg0_operation, |
| 1184 | uint8_t *arg1_signature, |
| 1185 | size_t arg2_signature_size, |
| 1186 | size_t *arg3_signature_length) |
| 1187 | { |
David Horstmann | 5d64c6a | 2024-03-11 13:58:07 +0000 | [diff] [blame] | 1188 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 1189 | MBEDTLS_TEST_MEMORY_POISON(arg1_signature, arg2_signature_size); |
| 1190 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1191 | psa_status_t status = (psa_sign_hash_complete)(arg0_operation, arg1_signature, arg2_signature_size, arg3_signature_length); |
David Horstmann | 5d64c6a | 2024-03-11 13:58:07 +0000 | [diff] [blame] | 1192 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 1193 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_signature, arg2_signature_size); |
| 1194 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1195 | return status; |
| 1196 | } |
| 1197 | |
| 1198 | /* Wrapper for psa_sign_hash_start */ |
| 1199 | psa_status_t mbedtls_test_wrap_psa_sign_hash_start( |
| 1200 | psa_sign_hash_interruptible_operation_t *arg0_operation, |
| 1201 | mbedtls_svc_key_id_t arg1_key, |
| 1202 | psa_algorithm_t arg2_alg, |
| 1203 | const uint8_t *arg3_hash, |
| 1204 | size_t arg4_hash_length) |
| 1205 | { |
David Horstmann | 5d64c6a | 2024-03-11 13:58:07 +0000 | [diff] [blame] | 1206 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 1207 | MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_length); |
| 1208 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1209 | psa_status_t status = (psa_sign_hash_start)(arg0_operation, arg1_key, arg2_alg, arg3_hash, arg4_hash_length); |
David Horstmann | 5d64c6a | 2024-03-11 13:58:07 +0000 | [diff] [blame] | 1210 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 1211 | MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_length); |
| 1212 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1213 | return status; |
| 1214 | } |
| 1215 | |
| 1216 | /* Wrapper for psa_sign_message */ |
| 1217 | psa_status_t mbedtls_test_wrap_psa_sign_message( |
| 1218 | mbedtls_svc_key_id_t arg0_key, |
| 1219 | psa_algorithm_t arg1_alg, |
| 1220 | const uint8_t *arg2_input, |
| 1221 | size_t arg3_input_length, |
| 1222 | uint8_t *arg4_signature, |
| 1223 | size_t arg5_signature_size, |
| 1224 | size_t *arg6_signature_length) |
| 1225 | { |
Thomas Daubney | f430f47 | 2024-01-30 12:25:35 +0000 | [diff] [blame] | 1226 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 1227 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 1228 | MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_size); |
| 1229 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1230 | 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] | 1231 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 1232 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 1233 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_size); |
| 1234 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1235 | return status; |
| 1236 | } |
| 1237 | |
| 1238 | /* Wrapper for psa_verify_hash */ |
| 1239 | psa_status_t mbedtls_test_wrap_psa_verify_hash( |
| 1240 | mbedtls_svc_key_id_t arg0_key, |
| 1241 | psa_algorithm_t arg1_alg, |
| 1242 | const uint8_t *arg2_hash, |
| 1243 | size_t arg3_hash_length, |
| 1244 | const uint8_t *arg4_signature, |
| 1245 | size_t arg5_signature_length) |
| 1246 | { |
Thomas Daubney | f430f47 | 2024-01-30 12:25:35 +0000 | [diff] [blame] | 1247 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 1248 | MBEDTLS_TEST_MEMORY_POISON(arg2_hash, arg3_hash_length); |
| 1249 | MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_length); |
| 1250 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1251 | 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] | 1252 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 1253 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_hash, arg3_hash_length); |
| 1254 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_length); |
| 1255 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1256 | return status; |
| 1257 | } |
| 1258 | |
| 1259 | /* Wrapper for psa_verify_hash_abort */ |
| 1260 | psa_status_t mbedtls_test_wrap_psa_verify_hash_abort( |
| 1261 | psa_verify_hash_interruptible_operation_t *arg0_operation) |
| 1262 | { |
| 1263 | psa_status_t status = (psa_verify_hash_abort)(arg0_operation); |
| 1264 | return status; |
| 1265 | } |
| 1266 | |
| 1267 | /* Wrapper for psa_verify_hash_complete */ |
| 1268 | psa_status_t mbedtls_test_wrap_psa_verify_hash_complete( |
| 1269 | psa_verify_hash_interruptible_operation_t *arg0_operation) |
| 1270 | { |
| 1271 | psa_status_t status = (psa_verify_hash_complete)(arg0_operation); |
| 1272 | return status; |
| 1273 | } |
| 1274 | |
| 1275 | /* Wrapper for psa_verify_hash_start */ |
| 1276 | psa_status_t mbedtls_test_wrap_psa_verify_hash_start( |
| 1277 | psa_verify_hash_interruptible_operation_t *arg0_operation, |
| 1278 | mbedtls_svc_key_id_t arg1_key, |
| 1279 | psa_algorithm_t arg2_alg, |
| 1280 | const uint8_t *arg3_hash, |
| 1281 | size_t arg4_hash_length, |
| 1282 | const uint8_t *arg5_signature, |
| 1283 | size_t arg6_signature_length) |
| 1284 | { |
David Horstmann | 5d64c6a | 2024-03-11 13:58:07 +0000 | [diff] [blame] | 1285 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 1286 | MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_length); |
| 1287 | MBEDTLS_TEST_MEMORY_POISON(arg5_signature, arg6_signature_length); |
| 1288 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1289 | psa_status_t status = (psa_verify_hash_start)(arg0_operation, arg1_key, arg2_alg, arg3_hash, arg4_hash_length, arg5_signature, arg6_signature_length); |
David Horstmann | 5d64c6a | 2024-03-11 13:58:07 +0000 | [diff] [blame] | 1290 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 1291 | MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_length); |
| 1292 | MBEDTLS_TEST_MEMORY_UNPOISON(arg5_signature, arg6_signature_length); |
| 1293 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1294 | return status; |
| 1295 | } |
| 1296 | |
| 1297 | /* Wrapper for psa_verify_message */ |
| 1298 | psa_status_t mbedtls_test_wrap_psa_verify_message( |
| 1299 | mbedtls_svc_key_id_t arg0_key, |
| 1300 | psa_algorithm_t arg1_alg, |
| 1301 | const uint8_t *arg2_input, |
| 1302 | size_t arg3_input_length, |
| 1303 | const uint8_t *arg4_signature, |
| 1304 | size_t arg5_signature_length) |
| 1305 | { |
Thomas Daubney | f430f47 | 2024-01-30 12:25:35 +0000 | [diff] [blame] | 1306 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 1307 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 1308 | MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_length); |
| 1309 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1310 | 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] | 1311 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 1312 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 1313 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_length); |
| 1314 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1315 | return status; |
| 1316 | } |
| 1317 | |
Gilles Peskine | 4411c9c | 2024-01-04 20:51:38 +0100 | [diff] [blame] | 1318 | #endif /* defined(MBEDTLS_PSA_CRYPTO_C) && defined(MBEDTLS_TEST_HOOKS) && \ |
| 1319 | !defined(RECORD_PSA_STATUS_COVERAGE_LOG) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1320 | |
| 1321 | /* End of automatically generated file. */ |