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