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> |
Gilles Peskine | 90d14d7 | 2024-01-04 16:59:28 +0100 | [diff] [blame] | 13 | #include <test/memory.h> |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 14 | #include <test/psa_crypto_helpers.h> |
| 15 | #include <test/psa_test_wrappers.h> |
| 16 | |
| 17 | /* Wrapper for mbedtls_psa_inject_entropy */ |
| 18 | #if defined(MBEDTLS_PSA_INJECT_ENTROPY) |
| 19 | psa_status_t mbedtls_test_wrap_mbedtls_psa_inject_entropy( |
| 20 | const uint8_t *arg0_seed, |
| 21 | size_t arg1_seed_size) |
| 22 | { |
| 23 | psa_status_t status = (mbedtls_psa_inject_entropy)(arg0_seed, arg1_seed_size); |
| 24 | return status; |
| 25 | } |
| 26 | #endif /* defined(MBEDTLS_PSA_INJECT_ENTROPY) */ |
| 27 | |
| 28 | /* Wrapper for mbedtls_psa_platform_get_builtin_key */ |
| 29 | #if defined(MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS) |
| 30 | psa_status_t mbedtls_test_wrap_mbedtls_psa_platform_get_builtin_key( |
| 31 | mbedtls_svc_key_id_t arg0_key_id, |
| 32 | psa_key_lifetime_t *arg1_lifetime, |
| 33 | psa_drv_slot_number_t *arg2_slot_number) |
| 34 | { |
| 35 | psa_status_t status = (mbedtls_psa_platform_get_builtin_key)(arg0_key_id, arg1_lifetime, arg2_slot_number); |
| 36 | return status; |
| 37 | } |
| 38 | #endif /* defined(MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS) */ |
| 39 | |
| 40 | /* Wrapper for mbedtls_psa_register_se_key */ |
| 41 | #if defined(MBEDTLS_PSA_CRYPTO_SE_C) |
| 42 | psa_status_t mbedtls_test_wrap_mbedtls_psa_register_se_key( |
| 43 | const psa_key_attributes_t *arg0_attributes) |
| 44 | { |
| 45 | psa_status_t status = (mbedtls_psa_register_se_key)(arg0_attributes); |
| 46 | return status; |
| 47 | } |
| 48 | #endif /* defined(MBEDTLS_PSA_CRYPTO_SE_C) */ |
| 49 | |
| 50 | /* Wrapper for psa_aead_abort */ |
| 51 | psa_status_t mbedtls_test_wrap_psa_aead_abort( |
| 52 | psa_aead_operation_t *arg0_operation) |
| 53 | { |
| 54 | psa_status_t status = (psa_aead_abort)(arg0_operation); |
| 55 | return status; |
| 56 | } |
| 57 | |
| 58 | /* Wrapper for psa_aead_decrypt */ |
| 59 | psa_status_t mbedtls_test_wrap_psa_aead_decrypt( |
| 60 | mbedtls_svc_key_id_t arg0_key, |
| 61 | psa_algorithm_t arg1_alg, |
| 62 | const uint8_t *arg2_nonce, |
| 63 | size_t arg3_nonce_length, |
| 64 | const uint8_t *arg4_additional_data, |
| 65 | size_t arg5_additional_data_length, |
| 66 | const uint8_t *arg6_ciphertext, |
| 67 | size_t arg7_ciphertext_length, |
| 68 | uint8_t *arg8_plaintext, |
| 69 | size_t arg9_plaintext_size, |
| 70 | size_t *arg10_plaintext_length) |
| 71 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 72 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 86e6fe0 | 2024-01-22 14:36:01 +0000 | [diff] [blame] | 73 | MBEDTLS_TEST_MEMORY_POISON(arg2_nonce, arg3_nonce_length); |
| 74 | MBEDTLS_TEST_MEMORY_POISON(arg4_additional_data, arg5_additional_data_length); |
| 75 | MBEDTLS_TEST_MEMORY_POISON(arg6_ciphertext, arg7_ciphertext_length); |
| 76 | MBEDTLS_TEST_MEMORY_POISON(arg8_plaintext, arg9_plaintext_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 77 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 78 | 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] | 79 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 86e6fe0 | 2024-01-22 14:36:01 +0000 | [diff] [blame] | 80 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_nonce, arg3_nonce_length); |
| 81 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_additional_data, arg5_additional_data_length); |
| 82 | MBEDTLS_TEST_MEMORY_UNPOISON(arg6_ciphertext, arg7_ciphertext_length); |
| 83 | MBEDTLS_TEST_MEMORY_UNPOISON(arg8_plaintext, arg9_plaintext_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 84 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 85 | return status; |
| 86 | } |
| 87 | |
| 88 | /* Wrapper for psa_aead_decrypt_setup */ |
| 89 | psa_status_t mbedtls_test_wrap_psa_aead_decrypt_setup( |
| 90 | psa_aead_operation_t *arg0_operation, |
| 91 | mbedtls_svc_key_id_t arg1_key, |
| 92 | psa_algorithm_t arg2_alg) |
| 93 | { |
| 94 | psa_status_t status = (psa_aead_decrypt_setup)(arg0_operation, arg1_key, arg2_alg); |
| 95 | return status; |
| 96 | } |
| 97 | |
| 98 | /* Wrapper for psa_aead_encrypt */ |
| 99 | psa_status_t mbedtls_test_wrap_psa_aead_encrypt( |
| 100 | mbedtls_svc_key_id_t arg0_key, |
| 101 | psa_algorithm_t arg1_alg, |
| 102 | const uint8_t *arg2_nonce, |
| 103 | size_t arg3_nonce_length, |
| 104 | const uint8_t *arg4_additional_data, |
| 105 | size_t arg5_additional_data_length, |
| 106 | const uint8_t *arg6_plaintext, |
| 107 | size_t arg7_plaintext_length, |
| 108 | uint8_t *arg8_ciphertext, |
| 109 | size_t arg9_ciphertext_size, |
| 110 | size_t *arg10_ciphertext_length) |
| 111 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 112 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 86e6fe0 | 2024-01-22 14:36:01 +0000 | [diff] [blame] | 113 | MBEDTLS_TEST_MEMORY_POISON(arg2_nonce, arg3_nonce_length); |
| 114 | MBEDTLS_TEST_MEMORY_POISON(arg4_additional_data, arg5_additional_data_length); |
| 115 | MBEDTLS_TEST_MEMORY_POISON(arg6_plaintext, arg7_plaintext_length); |
| 116 | MBEDTLS_TEST_MEMORY_POISON(arg8_ciphertext, arg9_ciphertext_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 117 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 118 | 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] | 119 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 86e6fe0 | 2024-01-22 14:36:01 +0000 | [diff] [blame] | 120 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_nonce, arg3_nonce_length); |
| 121 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_additional_data, arg5_additional_data_length); |
| 122 | MBEDTLS_TEST_MEMORY_UNPOISON(arg6_plaintext, arg7_plaintext_length); |
| 123 | MBEDTLS_TEST_MEMORY_UNPOISON(arg8_ciphertext, arg9_ciphertext_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 124 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 125 | return status; |
| 126 | } |
| 127 | |
| 128 | /* Wrapper for psa_aead_encrypt_setup */ |
| 129 | psa_status_t mbedtls_test_wrap_psa_aead_encrypt_setup( |
| 130 | psa_aead_operation_t *arg0_operation, |
| 131 | mbedtls_svc_key_id_t arg1_key, |
| 132 | psa_algorithm_t arg2_alg) |
| 133 | { |
| 134 | psa_status_t status = (psa_aead_encrypt_setup)(arg0_operation, arg1_key, arg2_alg); |
| 135 | return status; |
| 136 | } |
| 137 | |
| 138 | /* Wrapper for psa_aead_finish */ |
| 139 | psa_status_t mbedtls_test_wrap_psa_aead_finish( |
| 140 | psa_aead_operation_t *arg0_operation, |
| 141 | uint8_t *arg1_ciphertext, |
| 142 | size_t arg2_ciphertext_size, |
| 143 | size_t *arg3_ciphertext_length, |
| 144 | uint8_t *arg4_tag, |
| 145 | size_t arg5_tag_size, |
| 146 | size_t *arg6_tag_length) |
| 147 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 148 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 86e6fe0 | 2024-01-22 14:36:01 +0000 | [diff] [blame] | 149 | MBEDTLS_TEST_MEMORY_POISON(arg1_ciphertext, arg2_ciphertext_size); |
| 150 | MBEDTLS_TEST_MEMORY_POISON(arg4_tag, arg5_tag_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 151 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 152 | 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] | 153 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 86e6fe0 | 2024-01-22 14:36:01 +0000 | [diff] [blame] | 154 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_ciphertext, arg2_ciphertext_size); |
| 155 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_tag, arg5_tag_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 156 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 157 | return status; |
| 158 | } |
| 159 | |
| 160 | /* Wrapper for psa_aead_generate_nonce */ |
| 161 | psa_status_t mbedtls_test_wrap_psa_aead_generate_nonce( |
| 162 | psa_aead_operation_t *arg0_operation, |
| 163 | uint8_t *arg1_nonce, |
| 164 | size_t arg2_nonce_size, |
| 165 | size_t *arg3_nonce_length) |
| 166 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 167 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 86e6fe0 | 2024-01-22 14:36:01 +0000 | [diff] [blame] | 168 | MBEDTLS_TEST_MEMORY_POISON(arg1_nonce, arg2_nonce_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 169 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 170 | 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] | 171 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 86e6fe0 | 2024-01-22 14:36:01 +0000 | [diff] [blame] | 172 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_nonce, arg2_nonce_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 173 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 174 | return status; |
| 175 | } |
| 176 | |
| 177 | /* Wrapper for psa_aead_set_lengths */ |
| 178 | psa_status_t mbedtls_test_wrap_psa_aead_set_lengths( |
| 179 | psa_aead_operation_t *arg0_operation, |
| 180 | size_t arg1_ad_length, |
| 181 | size_t arg2_plaintext_length) |
| 182 | { |
| 183 | psa_status_t status = (psa_aead_set_lengths)(arg0_operation, arg1_ad_length, arg2_plaintext_length); |
| 184 | return status; |
| 185 | } |
| 186 | |
| 187 | /* Wrapper for psa_aead_set_nonce */ |
| 188 | psa_status_t mbedtls_test_wrap_psa_aead_set_nonce( |
| 189 | psa_aead_operation_t *arg0_operation, |
| 190 | const uint8_t *arg1_nonce, |
| 191 | size_t arg2_nonce_length) |
| 192 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 193 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 86e6fe0 | 2024-01-22 14:36:01 +0000 | [diff] [blame] | 194 | MBEDTLS_TEST_MEMORY_POISON(arg1_nonce, arg2_nonce_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 195 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 196 | 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] | 197 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 86e6fe0 | 2024-01-22 14:36:01 +0000 | [diff] [blame] | 198 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_nonce, arg2_nonce_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 199 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 200 | return status; |
| 201 | } |
| 202 | |
| 203 | /* Wrapper for psa_aead_update */ |
| 204 | psa_status_t mbedtls_test_wrap_psa_aead_update( |
| 205 | psa_aead_operation_t *arg0_operation, |
| 206 | const uint8_t *arg1_input, |
| 207 | size_t arg2_input_length, |
| 208 | uint8_t *arg3_output, |
| 209 | size_t arg4_output_size, |
| 210 | size_t *arg5_output_length) |
| 211 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 212 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 86e6fe0 | 2024-01-22 14:36:01 +0000 | [diff] [blame] | 213 | MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length); |
| 214 | MBEDTLS_TEST_MEMORY_POISON(arg3_output, arg4_output_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 215 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 216 | 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] | 217 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 86e6fe0 | 2024-01-22 14:36:01 +0000 | [diff] [blame] | 218 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length); |
| 219 | MBEDTLS_TEST_MEMORY_UNPOISON(arg3_output, arg4_output_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 220 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 221 | return status; |
| 222 | } |
| 223 | |
| 224 | /* Wrapper for psa_aead_update_ad */ |
| 225 | psa_status_t mbedtls_test_wrap_psa_aead_update_ad( |
| 226 | psa_aead_operation_t *arg0_operation, |
| 227 | const uint8_t *arg1_input, |
| 228 | size_t arg2_input_length) |
| 229 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 230 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 86e6fe0 | 2024-01-22 14:36:01 +0000 | [diff] [blame] | 231 | MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 232 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 233 | 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] | 234 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 86e6fe0 | 2024-01-22 14:36:01 +0000 | [diff] [blame] | 235 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 236 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 237 | return status; |
| 238 | } |
| 239 | |
| 240 | /* Wrapper for psa_aead_verify */ |
| 241 | psa_status_t mbedtls_test_wrap_psa_aead_verify( |
| 242 | psa_aead_operation_t *arg0_operation, |
| 243 | uint8_t *arg1_plaintext, |
| 244 | size_t arg2_plaintext_size, |
| 245 | size_t *arg3_plaintext_length, |
| 246 | const uint8_t *arg4_tag, |
| 247 | size_t arg5_tag_length) |
| 248 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 249 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 86e6fe0 | 2024-01-22 14:36:01 +0000 | [diff] [blame] | 250 | MBEDTLS_TEST_MEMORY_POISON(arg1_plaintext, arg2_plaintext_size); |
| 251 | MBEDTLS_TEST_MEMORY_POISON(arg4_tag, arg5_tag_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 252 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 253 | 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] | 254 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 86e6fe0 | 2024-01-22 14:36:01 +0000 | [diff] [blame] | 255 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_plaintext, arg2_plaintext_size); |
| 256 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_tag, arg5_tag_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 257 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 258 | return status; |
| 259 | } |
| 260 | |
| 261 | /* Wrapper for psa_asymmetric_decrypt */ |
| 262 | psa_status_t mbedtls_test_wrap_psa_asymmetric_decrypt( |
| 263 | mbedtls_svc_key_id_t arg0_key, |
| 264 | psa_algorithm_t arg1_alg, |
| 265 | const uint8_t *arg2_input, |
| 266 | size_t arg3_input_length, |
| 267 | const uint8_t *arg4_salt, |
| 268 | size_t arg5_salt_length, |
| 269 | uint8_t *arg6_output, |
| 270 | size_t arg7_output_size, |
| 271 | size_t *arg8_output_length) |
| 272 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 273 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | 54e6b41 | 2024-01-31 16:56:17 +0000 | [diff] [blame] | 274 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 275 | MBEDTLS_TEST_MEMORY_POISON(arg4_salt, arg5_salt_length); |
| 276 | MBEDTLS_TEST_MEMORY_POISON(arg6_output, arg7_output_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 277 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 278 | 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] | 279 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | 54e6b41 | 2024-01-31 16:56:17 +0000 | [diff] [blame] | 280 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 281 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_salt, arg5_salt_length); |
| 282 | MBEDTLS_TEST_MEMORY_UNPOISON(arg6_output, arg7_output_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 283 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 284 | return status; |
| 285 | } |
| 286 | |
| 287 | /* Wrapper for psa_asymmetric_encrypt */ |
| 288 | psa_status_t mbedtls_test_wrap_psa_asymmetric_encrypt( |
| 289 | mbedtls_svc_key_id_t arg0_key, |
| 290 | psa_algorithm_t arg1_alg, |
| 291 | const uint8_t *arg2_input, |
| 292 | size_t arg3_input_length, |
| 293 | const uint8_t *arg4_salt, |
| 294 | size_t arg5_salt_length, |
| 295 | uint8_t *arg6_output, |
| 296 | size_t arg7_output_size, |
| 297 | size_t *arg8_output_length) |
| 298 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 299 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | 27b48a3 | 2024-01-30 14:04:47 +0000 | [diff] [blame] | 300 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 301 | MBEDTLS_TEST_MEMORY_POISON(arg4_salt, arg5_salt_length); |
| 302 | MBEDTLS_TEST_MEMORY_POISON(arg6_output, arg7_output_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 303 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 304 | 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] | 305 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | 27b48a3 | 2024-01-30 14:04:47 +0000 | [diff] [blame] | 306 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 307 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_salt, arg5_salt_length); |
| 308 | MBEDTLS_TEST_MEMORY_UNPOISON(arg6_output, arg7_output_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 309 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 310 | return status; |
| 311 | } |
| 312 | |
| 313 | /* Wrapper for psa_cipher_abort */ |
| 314 | psa_status_t mbedtls_test_wrap_psa_cipher_abort( |
| 315 | psa_cipher_operation_t *arg0_operation) |
| 316 | { |
| 317 | psa_status_t status = (psa_cipher_abort)(arg0_operation); |
| 318 | return status; |
| 319 | } |
| 320 | |
| 321 | /* Wrapper for psa_cipher_decrypt */ |
| 322 | psa_status_t mbedtls_test_wrap_psa_cipher_decrypt( |
| 323 | mbedtls_svc_key_id_t arg0_key, |
| 324 | psa_algorithm_t arg1_alg, |
| 325 | const uint8_t *arg2_input, |
| 326 | size_t arg3_input_length, |
| 327 | uint8_t *arg4_output, |
| 328 | size_t arg5_output_size, |
| 329 | size_t *arg6_output_length) |
| 330 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 331 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Gabor Mezei | b8f97a1 | 2024-01-24 16:58:40 +0100 | [diff] [blame] | 332 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 333 | MBEDTLS_TEST_MEMORY_POISON(arg4_output, arg5_output_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 334 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 335 | 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] | 336 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Gabor Mezei | b8f97a1 | 2024-01-24 16:58:40 +0100 | [diff] [blame] | 337 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 338 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_output, arg5_output_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 339 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 340 | return status; |
| 341 | } |
| 342 | |
| 343 | /* Wrapper for psa_cipher_decrypt_setup */ |
| 344 | psa_status_t mbedtls_test_wrap_psa_cipher_decrypt_setup( |
| 345 | psa_cipher_operation_t *arg0_operation, |
| 346 | mbedtls_svc_key_id_t arg1_key, |
| 347 | psa_algorithm_t arg2_alg) |
| 348 | { |
| 349 | psa_status_t status = (psa_cipher_decrypt_setup)(arg0_operation, arg1_key, arg2_alg); |
| 350 | return status; |
| 351 | } |
| 352 | |
| 353 | /* Wrapper for psa_cipher_encrypt */ |
| 354 | psa_status_t mbedtls_test_wrap_psa_cipher_encrypt( |
| 355 | mbedtls_svc_key_id_t arg0_key, |
| 356 | psa_algorithm_t arg1_alg, |
| 357 | const uint8_t *arg2_input, |
| 358 | size_t arg3_input_length, |
| 359 | uint8_t *arg4_output, |
| 360 | size_t arg5_output_size, |
| 361 | size_t *arg6_output_length) |
| 362 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 363 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Gilles Peskine | 90d14d7 | 2024-01-04 16:59:28 +0100 | [diff] [blame] | 364 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 365 | MBEDTLS_TEST_MEMORY_POISON(arg4_output, arg5_output_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 366 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 367 | 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] | 368 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Gilles Peskine | 90d14d7 | 2024-01-04 16:59:28 +0100 | [diff] [blame] | 369 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 370 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_output, arg5_output_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 371 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 372 | return status; |
| 373 | } |
| 374 | |
| 375 | /* Wrapper for psa_cipher_encrypt_setup */ |
| 376 | psa_status_t mbedtls_test_wrap_psa_cipher_encrypt_setup( |
| 377 | psa_cipher_operation_t *arg0_operation, |
| 378 | mbedtls_svc_key_id_t arg1_key, |
| 379 | psa_algorithm_t arg2_alg) |
| 380 | { |
| 381 | psa_status_t status = (psa_cipher_encrypt_setup)(arg0_operation, arg1_key, arg2_alg); |
| 382 | return status; |
| 383 | } |
| 384 | |
| 385 | /* Wrapper for psa_cipher_finish */ |
| 386 | psa_status_t mbedtls_test_wrap_psa_cipher_finish( |
| 387 | psa_cipher_operation_t *arg0_operation, |
| 388 | uint8_t *arg1_output, |
| 389 | size_t arg2_output_size, |
| 390 | size_t *arg3_output_length) |
| 391 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 392 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Gabor Mezei | b8f97a1 | 2024-01-24 16:58:40 +0100 | [diff] [blame] | 393 | MBEDTLS_TEST_MEMORY_POISON(arg1_output, arg2_output_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 394 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 395 | 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] | 396 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Gabor Mezei | b8f97a1 | 2024-01-24 16:58:40 +0100 | [diff] [blame] | 397 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_output, arg2_output_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 398 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 399 | return status; |
| 400 | } |
| 401 | |
| 402 | /* Wrapper for psa_cipher_generate_iv */ |
| 403 | psa_status_t mbedtls_test_wrap_psa_cipher_generate_iv( |
| 404 | psa_cipher_operation_t *arg0_operation, |
| 405 | uint8_t *arg1_iv, |
| 406 | size_t arg2_iv_size, |
| 407 | size_t *arg3_iv_length) |
| 408 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 409 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Gabor Mezei | b74ac66 | 2024-02-01 10:39:56 +0100 | [diff] [blame] | 410 | MBEDTLS_TEST_MEMORY_POISON(arg1_iv, arg2_iv_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 411 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 412 | 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] | 413 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Gabor Mezei | b74ac66 | 2024-02-01 10:39:56 +0100 | [diff] [blame] | 414 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_iv, arg2_iv_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 415 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 416 | return status; |
| 417 | } |
| 418 | |
| 419 | /* Wrapper for psa_cipher_set_iv */ |
| 420 | psa_status_t mbedtls_test_wrap_psa_cipher_set_iv( |
| 421 | psa_cipher_operation_t *arg0_operation, |
| 422 | const uint8_t *arg1_iv, |
| 423 | size_t arg2_iv_length) |
| 424 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 425 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Gabor Mezei | b74ac66 | 2024-02-01 10:39:56 +0100 | [diff] [blame] | 426 | MBEDTLS_TEST_MEMORY_POISON(arg1_iv, arg2_iv_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 427 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 428 | 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] | 429 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Gabor Mezei | b74ac66 | 2024-02-01 10:39:56 +0100 | [diff] [blame] | 430 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_iv, arg2_iv_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 431 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 432 | return status; |
| 433 | } |
| 434 | |
| 435 | /* Wrapper for psa_cipher_update */ |
| 436 | psa_status_t mbedtls_test_wrap_psa_cipher_update( |
| 437 | psa_cipher_operation_t *arg0_operation, |
| 438 | const uint8_t *arg1_input, |
| 439 | size_t arg2_input_length, |
| 440 | uint8_t *arg3_output, |
| 441 | size_t arg4_output_size, |
| 442 | size_t *arg5_output_length) |
| 443 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 444 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Gabor Mezei | b8f97a1 | 2024-01-24 16:58:40 +0100 | [diff] [blame] | 445 | MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length); |
| 446 | MBEDTLS_TEST_MEMORY_POISON(arg3_output, arg4_output_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 447 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 448 | 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] | 449 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Gabor Mezei | b8f97a1 | 2024-01-24 16:58:40 +0100 | [diff] [blame] | 450 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length); |
| 451 | MBEDTLS_TEST_MEMORY_UNPOISON(arg3_output, arg4_output_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 452 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 453 | return status; |
| 454 | } |
| 455 | |
| 456 | /* Wrapper for psa_copy_key */ |
| 457 | psa_status_t mbedtls_test_wrap_psa_copy_key( |
| 458 | mbedtls_svc_key_id_t arg0_source_key, |
| 459 | const psa_key_attributes_t *arg1_attributes, |
| 460 | mbedtls_svc_key_id_t *arg2_target_key) |
| 461 | { |
| 462 | psa_status_t status = (psa_copy_key)(arg0_source_key, arg1_attributes, arg2_target_key); |
| 463 | return status; |
| 464 | } |
| 465 | |
| 466 | /* Wrapper for psa_crypto_driver_pake_get_cipher_suite */ |
Ronald Cron | 7062d3d | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 467 | #if defined(PSA_WANT_ALG_SOME_PAKE) |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 468 | psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_cipher_suite( |
| 469 | const psa_crypto_driver_pake_inputs_t *arg0_inputs, |
| 470 | psa_pake_cipher_suite_t *arg1_cipher_suite) |
| 471 | { |
| 472 | psa_status_t status = (psa_crypto_driver_pake_get_cipher_suite)(arg0_inputs, arg1_cipher_suite); |
| 473 | return status; |
| 474 | } |
Ronald Cron | 7062d3d | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 475 | #endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 476 | |
| 477 | /* Wrapper for psa_crypto_driver_pake_get_password */ |
Ronald Cron | 7062d3d | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 478 | #if defined(PSA_WANT_ALG_SOME_PAKE) |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 479 | psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_password( |
| 480 | const psa_crypto_driver_pake_inputs_t *arg0_inputs, |
| 481 | uint8_t *arg1_buffer, |
| 482 | size_t arg2_buffer_size, |
| 483 | size_t *arg3_buffer_length) |
| 484 | { |
| 485 | psa_status_t status = (psa_crypto_driver_pake_get_password)(arg0_inputs, arg1_buffer, arg2_buffer_size, arg3_buffer_length); |
| 486 | return status; |
| 487 | } |
Ronald Cron | 7062d3d | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 488 | #endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 489 | |
| 490 | /* Wrapper for psa_crypto_driver_pake_get_password_len */ |
Ronald Cron | 7062d3d | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 491 | #if defined(PSA_WANT_ALG_SOME_PAKE) |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 492 | psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_password_len( |
| 493 | const psa_crypto_driver_pake_inputs_t *arg0_inputs, |
| 494 | size_t *arg1_password_len) |
| 495 | { |
| 496 | psa_status_t status = (psa_crypto_driver_pake_get_password_len)(arg0_inputs, arg1_password_len); |
| 497 | return status; |
| 498 | } |
Ronald Cron | 7062d3d | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 499 | #endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 500 | |
| 501 | /* Wrapper for psa_crypto_driver_pake_get_peer */ |
Ronald Cron | 7062d3d | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 502 | #if defined(PSA_WANT_ALG_SOME_PAKE) |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 503 | psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_peer( |
| 504 | const psa_crypto_driver_pake_inputs_t *arg0_inputs, |
| 505 | uint8_t *arg1_peer_id, |
| 506 | size_t arg2_peer_id_size, |
| 507 | size_t *arg3_peer_id_length) |
| 508 | { |
| 509 | psa_status_t status = (psa_crypto_driver_pake_get_peer)(arg0_inputs, arg1_peer_id, arg2_peer_id_size, arg3_peer_id_length); |
| 510 | return status; |
| 511 | } |
Ronald Cron | 7062d3d | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 512 | #endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 513 | |
| 514 | /* Wrapper for psa_crypto_driver_pake_get_peer_len */ |
Ronald Cron | 7062d3d | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 515 | #if defined(PSA_WANT_ALG_SOME_PAKE) |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 516 | psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_peer_len( |
| 517 | const psa_crypto_driver_pake_inputs_t *arg0_inputs, |
| 518 | size_t *arg1_peer_len) |
| 519 | { |
| 520 | psa_status_t status = (psa_crypto_driver_pake_get_peer_len)(arg0_inputs, arg1_peer_len); |
| 521 | return status; |
| 522 | } |
Ronald Cron | 7062d3d | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 523 | #endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 524 | |
| 525 | /* Wrapper for psa_crypto_driver_pake_get_user */ |
Ronald Cron | 7062d3d | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 526 | #if defined(PSA_WANT_ALG_SOME_PAKE) |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 527 | psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_user( |
| 528 | const psa_crypto_driver_pake_inputs_t *arg0_inputs, |
| 529 | uint8_t *arg1_user_id, |
| 530 | size_t arg2_user_id_size, |
| 531 | size_t *arg3_user_id_len) |
| 532 | { |
| 533 | psa_status_t status = (psa_crypto_driver_pake_get_user)(arg0_inputs, arg1_user_id, arg2_user_id_size, arg3_user_id_len); |
| 534 | return status; |
| 535 | } |
Ronald Cron | 7062d3d | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 536 | #endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 537 | |
| 538 | /* Wrapper for psa_crypto_driver_pake_get_user_len */ |
Ronald Cron | 7062d3d | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 539 | #if defined(PSA_WANT_ALG_SOME_PAKE) |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 540 | psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_user_len( |
| 541 | const psa_crypto_driver_pake_inputs_t *arg0_inputs, |
| 542 | size_t *arg1_user_len) |
| 543 | { |
| 544 | psa_status_t status = (psa_crypto_driver_pake_get_user_len)(arg0_inputs, arg1_user_len); |
| 545 | return status; |
| 546 | } |
Ronald Cron | 7062d3d | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 547 | #endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 548 | |
| 549 | /* Wrapper for psa_crypto_init */ |
| 550 | psa_status_t mbedtls_test_wrap_psa_crypto_init(void) |
| 551 | { |
| 552 | psa_status_t status = (psa_crypto_init)(); |
| 553 | return status; |
| 554 | } |
| 555 | |
| 556 | /* Wrapper for psa_destroy_key */ |
| 557 | psa_status_t mbedtls_test_wrap_psa_destroy_key( |
| 558 | mbedtls_svc_key_id_t arg0_key) |
| 559 | { |
| 560 | psa_status_t status = (psa_destroy_key)(arg0_key); |
| 561 | return status; |
| 562 | } |
| 563 | |
| 564 | /* Wrapper for psa_export_key */ |
| 565 | psa_status_t mbedtls_test_wrap_psa_export_key( |
| 566 | mbedtls_svc_key_id_t arg0_key, |
| 567 | uint8_t *arg1_data, |
| 568 | size_t arg2_data_size, |
| 569 | size_t *arg3_data_length) |
| 570 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 571 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Ryan Everett | 77b91e3 | 2024-01-25 10:58:06 +0000 | [diff] [blame] | 572 | MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 573 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 574 | 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] | 575 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Ryan Everett | 77b91e3 | 2024-01-25 10:58:06 +0000 | [diff] [blame] | 576 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 577 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 578 | return status; |
| 579 | } |
| 580 | |
| 581 | /* Wrapper for psa_export_public_key */ |
| 582 | psa_status_t mbedtls_test_wrap_psa_export_public_key( |
| 583 | mbedtls_svc_key_id_t arg0_key, |
| 584 | uint8_t *arg1_data, |
| 585 | size_t arg2_data_size, |
| 586 | size_t *arg3_data_length) |
| 587 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 588 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Ryan Everett | 77b91e3 | 2024-01-25 10:58:06 +0000 | [diff] [blame] | 589 | MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 590 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 591 | 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] | 592 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Ryan Everett | 77b91e3 | 2024-01-25 10:58:06 +0000 | [diff] [blame] | 593 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 594 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 595 | return status; |
| 596 | } |
| 597 | |
| 598 | /* Wrapper for psa_generate_key */ |
| 599 | psa_status_t mbedtls_test_wrap_psa_generate_key( |
| 600 | const psa_key_attributes_t *arg0_attributes, |
| 601 | mbedtls_svc_key_id_t *arg1_key) |
| 602 | { |
| 603 | psa_status_t status = (psa_generate_key)(arg0_attributes, arg1_key); |
| 604 | return status; |
| 605 | } |
| 606 | |
Gilles Peskine | b45af2f | 2024-06-07 08:29:44 +0200 | [diff] [blame] | 607 | /* Wrapper for psa_generate_key_custom */ |
| 608 | psa_status_t mbedtls_test_wrap_psa_generate_key_custom( |
| 609 | const psa_key_attributes_t *arg0_attributes, |
| 610 | const psa_custom_key_parameters_t *arg1_custom, |
| 611 | const uint8_t *arg2_custom_data, |
| 612 | size_t arg3_custom_data_length, |
| 613 | mbedtls_svc_key_id_t *arg4_key) |
| 614 | { |
| 615 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
| 616 | MBEDTLS_TEST_MEMORY_POISON(arg2_custom_data, arg3_custom_data_length); |
| 617 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
| 618 | psa_status_t status = (psa_generate_key_custom)(arg0_attributes, arg1_custom, arg2_custom_data, arg3_custom_data_length, arg4_key); |
| 619 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
| 620 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_custom_data, arg3_custom_data_length); |
| 621 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
| 622 | return status; |
| 623 | } |
| 624 | |
Paul Elliott | 2dc5fa3 | 2024-07-19 17:32:42 +0100 | [diff] [blame] | 625 | /* Wrapper for psa_generate_key_iop_abort */ |
| 626 | psa_status_t mbedtls_test_wrap_psa_generate_key_iop_abort( |
| 627 | psa_generate_key_iop_t *arg0_operation) |
| 628 | { |
| 629 | psa_status_t status = (psa_generate_key_iop_abort)(arg0_operation); |
| 630 | return status; |
| 631 | } |
| 632 | |
| 633 | /* Wrapper for psa_generate_key_iop_complete */ |
| 634 | psa_status_t mbedtls_test_wrap_psa_generate_key_iop_complete( |
| 635 | psa_generate_key_iop_t *arg0_operation, |
| 636 | psa_key_id_t *arg1_key) |
| 637 | { |
| 638 | psa_status_t status = (psa_generate_key_iop_complete)(arg0_operation, arg1_key); |
| 639 | return status; |
| 640 | } |
| 641 | |
| 642 | /* Wrapper for psa_generate_key_iop_setup */ |
| 643 | psa_status_t mbedtls_test_wrap_psa_generate_key_iop_setup( |
| 644 | psa_generate_key_iop_t *arg0_operation, |
| 645 | const psa_key_attributes_t *arg1_attributes) |
| 646 | { |
| 647 | psa_status_t status = (psa_generate_key_iop_setup)(arg0_operation, arg1_attributes); |
| 648 | return status; |
| 649 | } |
| 650 | |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 651 | /* Wrapper for psa_generate_random */ |
| 652 | psa_status_t mbedtls_test_wrap_psa_generate_random( |
| 653 | uint8_t *arg0_output, |
| 654 | size_t arg1_output_size) |
| 655 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 656 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 075c5fb | 2024-02-06 15:44:08 +0000 | [diff] [blame] | 657 | MBEDTLS_TEST_MEMORY_POISON(arg0_output, arg1_output_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 658 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 659 | psa_status_t status = (psa_generate_random)(arg0_output, arg1_output_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 660 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 075c5fb | 2024-02-06 15:44:08 +0000 | [diff] [blame] | 661 | MBEDTLS_TEST_MEMORY_UNPOISON(arg0_output, arg1_output_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 662 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 663 | return status; |
| 664 | } |
| 665 | |
| 666 | /* Wrapper for psa_get_key_attributes */ |
| 667 | psa_status_t mbedtls_test_wrap_psa_get_key_attributes( |
| 668 | mbedtls_svc_key_id_t arg0_key, |
| 669 | psa_key_attributes_t *arg1_attributes) |
| 670 | { |
| 671 | psa_status_t status = (psa_get_key_attributes)(arg0_key, arg1_attributes); |
| 672 | return status; |
| 673 | } |
| 674 | |
| 675 | /* Wrapper for psa_hash_abort */ |
| 676 | psa_status_t mbedtls_test_wrap_psa_hash_abort( |
| 677 | psa_hash_operation_t *arg0_operation) |
| 678 | { |
| 679 | psa_status_t status = (psa_hash_abort)(arg0_operation); |
| 680 | return status; |
| 681 | } |
| 682 | |
| 683 | /* Wrapper for psa_hash_clone */ |
| 684 | psa_status_t mbedtls_test_wrap_psa_hash_clone( |
| 685 | const psa_hash_operation_t *arg0_source_operation, |
| 686 | psa_hash_operation_t *arg1_target_operation) |
| 687 | { |
| 688 | psa_status_t status = (psa_hash_clone)(arg0_source_operation, arg1_target_operation); |
| 689 | return status; |
| 690 | } |
| 691 | |
| 692 | /* Wrapper for psa_hash_compare */ |
| 693 | psa_status_t mbedtls_test_wrap_psa_hash_compare( |
| 694 | psa_algorithm_t arg0_alg, |
| 695 | const uint8_t *arg1_input, |
| 696 | size_t arg2_input_length, |
| 697 | const uint8_t *arg3_hash, |
| 698 | size_t arg4_hash_length) |
| 699 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 700 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | 45c8586 | 2024-01-25 16:48:09 +0000 | [diff] [blame] | 701 | MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length); |
| 702 | MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 703 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 704 | 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] | 705 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | 45c8586 | 2024-01-25 16:48:09 +0000 | [diff] [blame] | 706 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length); |
| 707 | MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 708 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 709 | return status; |
| 710 | } |
| 711 | |
| 712 | /* Wrapper for psa_hash_compute */ |
| 713 | psa_status_t mbedtls_test_wrap_psa_hash_compute( |
| 714 | psa_algorithm_t arg0_alg, |
| 715 | const uint8_t *arg1_input, |
| 716 | size_t arg2_input_length, |
| 717 | uint8_t *arg3_hash, |
| 718 | size_t arg4_hash_size, |
| 719 | size_t *arg5_hash_length) |
| 720 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 721 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | 45c8586 | 2024-01-25 16:48:09 +0000 | [diff] [blame] | 722 | MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length); |
| 723 | MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 724 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 725 | 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] | 726 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | 45c8586 | 2024-01-25 16:48:09 +0000 | [diff] [blame] | 727 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length); |
| 728 | MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 729 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 730 | return status; |
| 731 | } |
| 732 | |
| 733 | /* Wrapper for psa_hash_finish */ |
| 734 | psa_status_t mbedtls_test_wrap_psa_hash_finish( |
| 735 | psa_hash_operation_t *arg0_operation, |
| 736 | uint8_t *arg1_hash, |
| 737 | size_t arg2_hash_size, |
| 738 | size_t *arg3_hash_length) |
| 739 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 740 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | 45c8586 | 2024-01-25 16:48:09 +0000 | [diff] [blame] | 741 | MBEDTLS_TEST_MEMORY_POISON(arg1_hash, arg2_hash_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 742 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 743 | 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] | 744 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | 45c8586 | 2024-01-25 16:48:09 +0000 | [diff] [blame] | 745 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_hash, arg2_hash_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 746 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 747 | return status; |
| 748 | } |
| 749 | |
| 750 | /* Wrapper for psa_hash_setup */ |
| 751 | psa_status_t mbedtls_test_wrap_psa_hash_setup( |
| 752 | psa_hash_operation_t *arg0_operation, |
| 753 | psa_algorithm_t arg1_alg) |
| 754 | { |
| 755 | psa_status_t status = (psa_hash_setup)(arg0_operation, arg1_alg); |
| 756 | return status; |
| 757 | } |
| 758 | |
| 759 | /* Wrapper for psa_hash_update */ |
| 760 | psa_status_t mbedtls_test_wrap_psa_hash_update( |
| 761 | psa_hash_operation_t *arg0_operation, |
| 762 | const uint8_t *arg1_input, |
| 763 | size_t arg2_input_length) |
| 764 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 765 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | 45c8586 | 2024-01-25 16:48:09 +0000 | [diff] [blame] | 766 | MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 767 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 768 | 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] | 769 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | 45c8586 | 2024-01-25 16:48:09 +0000 | [diff] [blame] | 770 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 771 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 772 | return status; |
| 773 | } |
| 774 | |
| 775 | /* Wrapper for psa_hash_verify */ |
| 776 | psa_status_t mbedtls_test_wrap_psa_hash_verify( |
| 777 | psa_hash_operation_t *arg0_operation, |
| 778 | const uint8_t *arg1_hash, |
| 779 | size_t arg2_hash_length) |
| 780 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 781 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | 45c8586 | 2024-01-25 16:48:09 +0000 | [diff] [blame] | 782 | MBEDTLS_TEST_MEMORY_POISON(arg1_hash, arg2_hash_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 783 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 784 | 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] | 785 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | 45c8586 | 2024-01-25 16:48:09 +0000 | [diff] [blame] | 786 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_hash, arg2_hash_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 787 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 788 | return status; |
| 789 | } |
| 790 | |
| 791 | /* Wrapper for psa_import_key */ |
| 792 | psa_status_t mbedtls_test_wrap_psa_import_key( |
| 793 | const psa_key_attributes_t *arg0_attributes, |
| 794 | const uint8_t *arg1_data, |
| 795 | size_t arg2_data_length, |
| 796 | mbedtls_svc_key_id_t *arg3_key) |
| 797 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 798 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Ryan Everett | 77b91e3 | 2024-01-25 10:58:06 +0000 | [diff] [blame] | 799 | MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 800 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 801 | 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] | 802 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Ryan Everett | 77b91e3 | 2024-01-25 10:58:06 +0000 | [diff] [blame] | 803 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 804 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 805 | return status; |
| 806 | } |
| 807 | |
Paul Elliott | c884b29 | 2024-07-19 17:32:42 +0100 | [diff] [blame] | 808 | /* Wrapper for psa_key_agreement_iop_abort */ |
| 809 | psa_status_t mbedtls_test_wrap_psa_key_agreement_iop_abort( |
| 810 | psa_key_agreement_iop_t *arg0_operation) |
| 811 | { |
| 812 | psa_status_t status = (psa_key_agreement_iop_abort)(arg0_operation); |
| 813 | return status; |
| 814 | } |
| 815 | |
| 816 | /* Wrapper for psa_key_agreement_iop_complete */ |
| 817 | psa_status_t mbedtls_test_wrap_psa_key_agreement_iop_complete( |
| 818 | psa_key_agreement_iop_t *arg0_operation, |
| 819 | psa_key_id_t *arg1_key) |
| 820 | { |
| 821 | psa_status_t status = (psa_key_agreement_iop_complete)(arg0_operation, arg1_key); |
| 822 | return status; |
| 823 | } |
| 824 | |
| 825 | /* Wrapper for psa_key_agreement_iop_setup */ |
| 826 | psa_status_t mbedtls_test_wrap_psa_key_agreement_iop_setup( |
| 827 | psa_key_agreement_iop_t *arg0_operation, |
| 828 | psa_key_id_t arg1_private_key, |
| 829 | const uint8_t *arg2_peer_key, |
| 830 | size_t arg3_peer_key_length, |
| 831 | psa_algorithm_t arg4_alg, |
| 832 | const psa_key_attributes_t *arg5_attributes) |
| 833 | { |
| 834 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
| 835 | MBEDTLS_TEST_MEMORY_POISON(arg2_peer_key, arg3_peer_key_length); |
| 836 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
| 837 | psa_status_t status = (psa_key_agreement_iop_setup)(arg0_operation, arg1_private_key, arg2_peer_key, arg3_peer_key_length, arg4_alg, arg5_attributes); |
| 838 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
| 839 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_peer_key, arg3_peer_key_length); |
| 840 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
| 841 | return status; |
| 842 | } |
| 843 | |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 844 | /* Wrapper for psa_key_derivation_abort */ |
| 845 | psa_status_t mbedtls_test_wrap_psa_key_derivation_abort( |
| 846 | psa_key_derivation_operation_t *arg0_operation) |
| 847 | { |
| 848 | psa_status_t status = (psa_key_derivation_abort)(arg0_operation); |
| 849 | return status; |
| 850 | } |
| 851 | |
| 852 | /* Wrapper for psa_key_derivation_get_capacity */ |
| 853 | psa_status_t mbedtls_test_wrap_psa_key_derivation_get_capacity( |
| 854 | const psa_key_derivation_operation_t *arg0_operation, |
| 855 | size_t *arg1_capacity) |
| 856 | { |
| 857 | psa_status_t status = (psa_key_derivation_get_capacity)(arg0_operation, arg1_capacity); |
| 858 | return status; |
| 859 | } |
| 860 | |
| 861 | /* Wrapper for psa_key_derivation_input_bytes */ |
| 862 | psa_status_t mbedtls_test_wrap_psa_key_derivation_input_bytes( |
| 863 | psa_key_derivation_operation_t *arg0_operation, |
| 864 | psa_key_derivation_step_t arg1_step, |
| 865 | const uint8_t *arg2_data, |
| 866 | size_t arg3_data_length) |
| 867 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 868 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Ryan Everett | 198a4d9 | 2024-01-25 11:44:56 +0000 | [diff] [blame] | 869 | MBEDTLS_TEST_MEMORY_POISON(arg2_data, arg3_data_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 870 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 871 | 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] | 872 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Ryan Everett | 198a4d9 | 2024-01-25 11:44:56 +0000 | [diff] [blame] | 873 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_data, arg3_data_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 874 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 875 | return status; |
| 876 | } |
| 877 | |
| 878 | /* Wrapper for psa_key_derivation_input_integer */ |
| 879 | psa_status_t mbedtls_test_wrap_psa_key_derivation_input_integer( |
| 880 | psa_key_derivation_operation_t *arg0_operation, |
| 881 | psa_key_derivation_step_t arg1_step, |
| 882 | uint64_t arg2_value) |
| 883 | { |
| 884 | psa_status_t status = (psa_key_derivation_input_integer)(arg0_operation, arg1_step, arg2_value); |
| 885 | return status; |
| 886 | } |
| 887 | |
| 888 | /* Wrapper for psa_key_derivation_input_key */ |
| 889 | psa_status_t mbedtls_test_wrap_psa_key_derivation_input_key( |
| 890 | psa_key_derivation_operation_t *arg0_operation, |
| 891 | psa_key_derivation_step_t arg1_step, |
| 892 | mbedtls_svc_key_id_t arg2_key) |
| 893 | { |
| 894 | psa_status_t status = (psa_key_derivation_input_key)(arg0_operation, arg1_step, arg2_key); |
| 895 | return status; |
| 896 | } |
| 897 | |
| 898 | /* Wrapper for psa_key_derivation_key_agreement */ |
| 899 | psa_status_t mbedtls_test_wrap_psa_key_derivation_key_agreement( |
| 900 | psa_key_derivation_operation_t *arg0_operation, |
| 901 | psa_key_derivation_step_t arg1_step, |
| 902 | mbedtls_svc_key_id_t arg2_private_key, |
| 903 | const uint8_t *arg3_peer_key, |
| 904 | size_t arg4_peer_key_length) |
| 905 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 906 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | fe2bda3 | 2024-02-15 13:35:06 +0000 | [diff] [blame] | 907 | MBEDTLS_TEST_MEMORY_POISON(arg3_peer_key, arg4_peer_key_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 908 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 909 | 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] | 910 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | fe2bda3 | 2024-02-15 13:35:06 +0000 | [diff] [blame] | 911 | MBEDTLS_TEST_MEMORY_UNPOISON(arg3_peer_key, arg4_peer_key_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 912 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 913 | return status; |
| 914 | } |
| 915 | |
| 916 | /* Wrapper for psa_key_derivation_output_bytes */ |
| 917 | psa_status_t mbedtls_test_wrap_psa_key_derivation_output_bytes( |
| 918 | psa_key_derivation_operation_t *arg0_operation, |
| 919 | uint8_t *arg1_output, |
| 920 | size_t arg2_output_length) |
| 921 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 922 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Ryan Everett | 198a4d9 | 2024-01-25 11:44:56 +0000 | [diff] [blame] | 923 | MBEDTLS_TEST_MEMORY_POISON(arg1_output, arg2_output_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 924 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 925 | 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] | 926 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Ryan Everett | 198a4d9 | 2024-01-25 11:44:56 +0000 | [diff] [blame] | 927 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_output, arg2_output_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 928 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 929 | return status; |
| 930 | } |
| 931 | |
| 932 | /* Wrapper for psa_key_derivation_output_key */ |
| 933 | psa_status_t mbedtls_test_wrap_psa_key_derivation_output_key( |
| 934 | const psa_key_attributes_t *arg0_attributes, |
| 935 | psa_key_derivation_operation_t *arg1_operation, |
| 936 | mbedtls_svc_key_id_t *arg2_key) |
| 937 | { |
| 938 | psa_status_t status = (psa_key_derivation_output_key)(arg0_attributes, arg1_operation, arg2_key); |
| 939 | return status; |
| 940 | } |
| 941 | |
Gilles Peskine | b45af2f | 2024-06-07 08:29:44 +0200 | [diff] [blame] | 942 | /* Wrapper for psa_key_derivation_output_key_custom */ |
| 943 | psa_status_t mbedtls_test_wrap_psa_key_derivation_output_key_custom( |
| 944 | const psa_key_attributes_t *arg0_attributes, |
| 945 | psa_key_derivation_operation_t *arg1_operation, |
| 946 | const psa_custom_key_parameters_t *arg2_custom, |
| 947 | const uint8_t *arg3_custom_data, |
| 948 | size_t arg4_custom_data_length, |
| 949 | mbedtls_svc_key_id_t *arg5_key) |
| 950 | { |
| 951 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
| 952 | MBEDTLS_TEST_MEMORY_POISON(arg3_custom_data, arg4_custom_data_length); |
| 953 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
| 954 | psa_status_t status = (psa_key_derivation_output_key_custom)(arg0_attributes, arg1_operation, arg2_custom, arg3_custom_data, arg4_custom_data_length, arg5_key); |
| 955 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
| 956 | MBEDTLS_TEST_MEMORY_UNPOISON(arg3_custom_data, arg4_custom_data_length); |
| 957 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
| 958 | return status; |
| 959 | } |
| 960 | |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 961 | /* Wrapper for psa_key_derivation_set_capacity */ |
| 962 | psa_status_t mbedtls_test_wrap_psa_key_derivation_set_capacity( |
| 963 | psa_key_derivation_operation_t *arg0_operation, |
| 964 | size_t arg1_capacity) |
| 965 | { |
| 966 | psa_status_t status = (psa_key_derivation_set_capacity)(arg0_operation, arg1_capacity); |
| 967 | return status; |
| 968 | } |
| 969 | |
| 970 | /* Wrapper for psa_key_derivation_setup */ |
| 971 | psa_status_t mbedtls_test_wrap_psa_key_derivation_setup( |
| 972 | psa_key_derivation_operation_t *arg0_operation, |
| 973 | psa_algorithm_t arg1_alg) |
| 974 | { |
| 975 | psa_status_t status = (psa_key_derivation_setup)(arg0_operation, arg1_alg); |
| 976 | return status; |
| 977 | } |
| 978 | |
| 979 | /* Wrapper for psa_mac_abort */ |
| 980 | psa_status_t mbedtls_test_wrap_psa_mac_abort( |
| 981 | psa_mac_operation_t *arg0_operation) |
| 982 | { |
| 983 | psa_status_t status = (psa_mac_abort)(arg0_operation); |
| 984 | return status; |
| 985 | } |
| 986 | |
| 987 | /* Wrapper for psa_mac_compute */ |
| 988 | psa_status_t mbedtls_test_wrap_psa_mac_compute( |
| 989 | mbedtls_svc_key_id_t arg0_key, |
| 990 | psa_algorithm_t arg1_alg, |
| 991 | const uint8_t *arg2_input, |
| 992 | size_t arg3_input_length, |
| 993 | uint8_t *arg4_mac, |
| 994 | size_t arg5_mac_size, |
| 995 | size_t *arg6_mac_length) |
| 996 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 997 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | a1cf101 | 2024-01-30 11:18:54 +0000 | [diff] [blame] | 998 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 999 | MBEDTLS_TEST_MEMORY_POISON(arg4_mac, arg5_mac_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1000 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1001 | 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] | 1002 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | a1cf101 | 2024-01-30 11:18:54 +0000 | [diff] [blame] | 1003 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 1004 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_mac, arg5_mac_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1005 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1006 | return status; |
| 1007 | } |
| 1008 | |
| 1009 | /* Wrapper for psa_mac_sign_finish */ |
| 1010 | psa_status_t mbedtls_test_wrap_psa_mac_sign_finish( |
| 1011 | psa_mac_operation_t *arg0_operation, |
| 1012 | uint8_t *arg1_mac, |
| 1013 | size_t arg2_mac_size, |
| 1014 | size_t *arg3_mac_length) |
| 1015 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1016 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | a1cf101 | 2024-01-30 11:18:54 +0000 | [diff] [blame] | 1017 | MBEDTLS_TEST_MEMORY_POISON(arg1_mac, arg2_mac_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1018 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1019 | 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] | 1020 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | a1cf101 | 2024-01-30 11:18:54 +0000 | [diff] [blame] | 1021 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_mac, arg2_mac_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1022 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1023 | return status; |
| 1024 | } |
| 1025 | |
| 1026 | /* Wrapper for psa_mac_sign_setup */ |
| 1027 | psa_status_t mbedtls_test_wrap_psa_mac_sign_setup( |
| 1028 | psa_mac_operation_t *arg0_operation, |
| 1029 | mbedtls_svc_key_id_t arg1_key, |
| 1030 | psa_algorithm_t arg2_alg) |
| 1031 | { |
| 1032 | psa_status_t status = (psa_mac_sign_setup)(arg0_operation, arg1_key, arg2_alg); |
| 1033 | return status; |
| 1034 | } |
| 1035 | |
| 1036 | /* Wrapper for psa_mac_update */ |
| 1037 | psa_status_t mbedtls_test_wrap_psa_mac_update( |
| 1038 | psa_mac_operation_t *arg0_operation, |
| 1039 | const uint8_t *arg1_input, |
| 1040 | size_t arg2_input_length) |
| 1041 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1042 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | a1cf101 | 2024-01-30 11:18:54 +0000 | [diff] [blame] | 1043 | MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1044 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1045 | 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] | 1046 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | a1cf101 | 2024-01-30 11:18:54 +0000 | [diff] [blame] | 1047 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1048 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1049 | return status; |
| 1050 | } |
| 1051 | |
| 1052 | /* Wrapper for psa_mac_verify */ |
| 1053 | psa_status_t mbedtls_test_wrap_psa_mac_verify( |
| 1054 | mbedtls_svc_key_id_t arg0_key, |
| 1055 | psa_algorithm_t arg1_alg, |
| 1056 | const uint8_t *arg2_input, |
| 1057 | size_t arg3_input_length, |
| 1058 | const uint8_t *arg4_mac, |
| 1059 | size_t arg5_mac_length) |
| 1060 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1061 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | a1cf101 | 2024-01-30 11:18:54 +0000 | [diff] [blame] | 1062 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 1063 | MBEDTLS_TEST_MEMORY_POISON(arg4_mac, arg5_mac_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1064 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1065 | 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] | 1066 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | a1cf101 | 2024-01-30 11:18:54 +0000 | [diff] [blame] | 1067 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 1068 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_mac, arg5_mac_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1069 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1070 | return status; |
| 1071 | } |
| 1072 | |
| 1073 | /* Wrapper for psa_mac_verify_finish */ |
| 1074 | psa_status_t mbedtls_test_wrap_psa_mac_verify_finish( |
| 1075 | psa_mac_operation_t *arg0_operation, |
| 1076 | const uint8_t *arg1_mac, |
| 1077 | size_t arg2_mac_length) |
| 1078 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1079 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | a1cf101 | 2024-01-30 11:18:54 +0000 | [diff] [blame] | 1080 | MBEDTLS_TEST_MEMORY_POISON(arg1_mac, arg2_mac_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1081 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1082 | 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] | 1083 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | a1cf101 | 2024-01-30 11:18:54 +0000 | [diff] [blame] | 1084 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_mac, arg2_mac_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1085 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1086 | return status; |
| 1087 | } |
| 1088 | |
| 1089 | /* Wrapper for psa_mac_verify_setup */ |
| 1090 | psa_status_t mbedtls_test_wrap_psa_mac_verify_setup( |
| 1091 | psa_mac_operation_t *arg0_operation, |
| 1092 | mbedtls_svc_key_id_t arg1_key, |
| 1093 | psa_algorithm_t arg2_alg) |
| 1094 | { |
| 1095 | psa_status_t status = (psa_mac_verify_setup)(arg0_operation, arg1_key, arg2_alg); |
| 1096 | return status; |
| 1097 | } |
| 1098 | |
| 1099 | /* Wrapper for psa_pake_abort */ |
Ronald Cron | 7062d3d | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 1100 | #if defined(PSA_WANT_ALG_SOME_PAKE) |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1101 | psa_status_t mbedtls_test_wrap_psa_pake_abort( |
| 1102 | psa_pake_operation_t *arg0_operation) |
| 1103 | { |
| 1104 | psa_status_t status = (psa_pake_abort)(arg0_operation); |
| 1105 | return status; |
| 1106 | } |
Ronald Cron | 7062d3d | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 1107 | #endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1108 | |
| 1109 | /* Wrapper for psa_pake_get_implicit_key */ |
Ronald Cron | 7062d3d | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 1110 | #if defined(PSA_WANT_ALG_SOME_PAKE) |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1111 | psa_status_t mbedtls_test_wrap_psa_pake_get_implicit_key( |
| 1112 | psa_pake_operation_t *arg0_operation, |
| 1113 | psa_key_derivation_operation_t *arg1_output) |
| 1114 | { |
| 1115 | psa_status_t status = (psa_pake_get_implicit_key)(arg0_operation, arg1_output); |
| 1116 | return status; |
| 1117 | } |
Ronald Cron | 7062d3d | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 1118 | #endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1119 | |
| 1120 | /* Wrapper for psa_pake_input */ |
Ronald Cron | 7062d3d | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 1121 | #if defined(PSA_WANT_ALG_SOME_PAKE) |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1122 | psa_status_t mbedtls_test_wrap_psa_pake_input( |
| 1123 | psa_pake_operation_t *arg0_operation, |
| 1124 | psa_pake_step_t arg1_step, |
| 1125 | const uint8_t *arg2_input, |
| 1126 | size_t arg3_input_length) |
| 1127 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1128 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 6076fe4 | 2024-01-23 15:28:51 +0000 | [diff] [blame] | 1129 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1130 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1131 | 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] | 1132 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 6076fe4 | 2024-01-23 15:28:51 +0000 | [diff] [blame] | 1133 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1134 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1135 | return status; |
| 1136 | } |
Ronald Cron | 7062d3d | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 1137 | #endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1138 | |
| 1139 | /* Wrapper for psa_pake_output */ |
Ronald Cron | 7062d3d | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 1140 | #if defined(PSA_WANT_ALG_SOME_PAKE) |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1141 | psa_status_t mbedtls_test_wrap_psa_pake_output( |
| 1142 | psa_pake_operation_t *arg0_operation, |
| 1143 | psa_pake_step_t arg1_step, |
| 1144 | uint8_t *arg2_output, |
| 1145 | size_t arg3_output_size, |
| 1146 | size_t *arg4_output_length) |
| 1147 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1148 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 6076fe4 | 2024-01-23 15:28:51 +0000 | [diff] [blame] | 1149 | MBEDTLS_TEST_MEMORY_POISON(arg2_output, arg3_output_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1150 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1151 | 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] | 1152 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 6076fe4 | 2024-01-23 15:28:51 +0000 | [diff] [blame] | 1153 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_output, arg3_output_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1154 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1155 | return status; |
| 1156 | } |
Ronald Cron | 7062d3d | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 1157 | #endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1158 | |
| 1159 | /* Wrapper for psa_pake_set_password_key */ |
Ronald Cron | 7062d3d | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 1160 | #if defined(PSA_WANT_ALG_SOME_PAKE) |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1161 | psa_status_t mbedtls_test_wrap_psa_pake_set_password_key( |
| 1162 | psa_pake_operation_t *arg0_operation, |
| 1163 | mbedtls_svc_key_id_t arg1_password) |
| 1164 | { |
| 1165 | psa_status_t status = (psa_pake_set_password_key)(arg0_operation, arg1_password); |
| 1166 | return status; |
| 1167 | } |
Ronald Cron | 7062d3d | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 1168 | #endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1169 | |
| 1170 | /* Wrapper for psa_pake_set_peer */ |
Ronald Cron | 7062d3d | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 1171 | #if defined(PSA_WANT_ALG_SOME_PAKE) |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1172 | psa_status_t mbedtls_test_wrap_psa_pake_set_peer( |
| 1173 | psa_pake_operation_t *arg0_operation, |
| 1174 | const uint8_t *arg1_peer_id, |
| 1175 | size_t arg2_peer_id_len) |
| 1176 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1177 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 6076fe4 | 2024-01-23 15:28:51 +0000 | [diff] [blame] | 1178 | MBEDTLS_TEST_MEMORY_POISON(arg1_peer_id, arg2_peer_id_len); |
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 | 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] | 1181 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 6076fe4 | 2024-01-23 15:28:51 +0000 | [diff] [blame] | 1182 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_peer_id, arg2_peer_id_len); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1183 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1184 | return status; |
| 1185 | } |
Ronald Cron | 7062d3d | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 1186 | #endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1187 | |
| 1188 | /* Wrapper for psa_pake_set_role */ |
Ronald Cron | 7062d3d | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 1189 | #if defined(PSA_WANT_ALG_SOME_PAKE) |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1190 | psa_status_t mbedtls_test_wrap_psa_pake_set_role( |
| 1191 | psa_pake_operation_t *arg0_operation, |
| 1192 | psa_pake_role_t arg1_role) |
| 1193 | { |
| 1194 | psa_status_t status = (psa_pake_set_role)(arg0_operation, arg1_role); |
| 1195 | return status; |
| 1196 | } |
Ronald Cron | 7062d3d | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 1197 | #endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1198 | |
| 1199 | /* Wrapper for psa_pake_set_user */ |
Ronald Cron | 7062d3d | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 1200 | #if defined(PSA_WANT_ALG_SOME_PAKE) |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1201 | psa_status_t mbedtls_test_wrap_psa_pake_set_user( |
| 1202 | psa_pake_operation_t *arg0_operation, |
| 1203 | const uint8_t *arg1_user_id, |
| 1204 | size_t arg2_user_id_len) |
| 1205 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1206 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 6076fe4 | 2024-01-23 15:28:51 +0000 | [diff] [blame] | 1207 | MBEDTLS_TEST_MEMORY_POISON(arg1_user_id, arg2_user_id_len); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1208 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1209 | 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] | 1210 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 6076fe4 | 2024-01-23 15:28:51 +0000 | [diff] [blame] | 1211 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_user_id, arg2_user_id_len); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1212 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1213 | return status; |
| 1214 | } |
Ronald Cron | 7062d3d | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 1215 | #endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1216 | |
| 1217 | /* Wrapper for psa_pake_setup */ |
Ronald Cron | 7062d3d | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 1218 | #if defined(PSA_WANT_ALG_SOME_PAKE) |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1219 | psa_status_t mbedtls_test_wrap_psa_pake_setup( |
| 1220 | psa_pake_operation_t *arg0_operation, |
| 1221 | const psa_pake_cipher_suite_t *arg1_cipher_suite) |
| 1222 | { |
| 1223 | psa_status_t status = (psa_pake_setup)(arg0_operation, arg1_cipher_suite); |
| 1224 | return status; |
| 1225 | } |
Ronald Cron | 7062d3d | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 1226 | #endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1227 | |
| 1228 | /* Wrapper for psa_purge_key */ |
| 1229 | psa_status_t mbedtls_test_wrap_psa_purge_key( |
| 1230 | mbedtls_svc_key_id_t arg0_key) |
| 1231 | { |
| 1232 | psa_status_t status = (psa_purge_key)(arg0_key); |
| 1233 | return status; |
| 1234 | } |
| 1235 | |
| 1236 | /* Wrapper for psa_raw_key_agreement */ |
| 1237 | psa_status_t mbedtls_test_wrap_psa_raw_key_agreement( |
| 1238 | psa_algorithm_t arg0_alg, |
| 1239 | mbedtls_svc_key_id_t arg1_private_key, |
| 1240 | const uint8_t *arg2_peer_key, |
| 1241 | size_t arg3_peer_key_length, |
| 1242 | uint8_t *arg4_output, |
| 1243 | size_t arg5_output_size, |
| 1244 | size_t *arg6_output_length) |
| 1245 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1246 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | fe2bda3 | 2024-02-15 13:35:06 +0000 | [diff] [blame] | 1247 | MBEDTLS_TEST_MEMORY_POISON(arg2_peer_key, arg3_peer_key_length); |
| 1248 | MBEDTLS_TEST_MEMORY_POISON(arg4_output, arg5_output_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1249 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1250 | 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] | 1251 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | fe2bda3 | 2024-02-15 13:35:06 +0000 | [diff] [blame] | 1252 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_peer_key, arg3_peer_key_length); |
| 1253 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_output, arg5_output_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1254 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1255 | return status; |
| 1256 | } |
| 1257 | |
| 1258 | /* Wrapper for psa_sign_hash */ |
| 1259 | psa_status_t mbedtls_test_wrap_psa_sign_hash( |
| 1260 | mbedtls_svc_key_id_t arg0_key, |
| 1261 | psa_algorithm_t arg1_alg, |
| 1262 | const uint8_t *arg2_hash, |
| 1263 | size_t arg3_hash_length, |
| 1264 | uint8_t *arg4_signature, |
| 1265 | size_t arg5_signature_size, |
| 1266 | size_t *arg6_signature_length) |
| 1267 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1268 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | f430f47 | 2024-01-30 12:25:35 +0000 | [diff] [blame] | 1269 | MBEDTLS_TEST_MEMORY_POISON(arg2_hash, arg3_hash_length); |
| 1270 | MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1271 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1272 | 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] | 1273 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | f430f47 | 2024-01-30 12:25:35 +0000 | [diff] [blame] | 1274 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_hash, arg3_hash_length); |
| 1275 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1276 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1277 | return status; |
| 1278 | } |
| 1279 | |
| 1280 | /* Wrapper for psa_sign_hash_abort */ |
| 1281 | psa_status_t mbedtls_test_wrap_psa_sign_hash_abort( |
| 1282 | psa_sign_hash_interruptible_operation_t *arg0_operation) |
| 1283 | { |
| 1284 | psa_status_t status = (psa_sign_hash_abort)(arg0_operation); |
| 1285 | return status; |
| 1286 | } |
| 1287 | |
| 1288 | /* Wrapper for psa_sign_hash_complete */ |
| 1289 | psa_status_t mbedtls_test_wrap_psa_sign_hash_complete( |
| 1290 | psa_sign_hash_interruptible_operation_t *arg0_operation, |
| 1291 | uint8_t *arg1_signature, |
| 1292 | size_t arg2_signature_size, |
| 1293 | size_t *arg3_signature_length) |
| 1294 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1295 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 5d64c6a | 2024-03-11 13:58:07 +0000 | [diff] [blame] | 1296 | MBEDTLS_TEST_MEMORY_POISON(arg1_signature, arg2_signature_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1297 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1298 | 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] | 1299 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 5d64c6a | 2024-03-11 13:58:07 +0000 | [diff] [blame] | 1300 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_signature, arg2_signature_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1301 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1302 | return status; |
| 1303 | } |
| 1304 | |
| 1305 | /* Wrapper for psa_sign_hash_start */ |
| 1306 | psa_status_t mbedtls_test_wrap_psa_sign_hash_start( |
| 1307 | psa_sign_hash_interruptible_operation_t *arg0_operation, |
| 1308 | mbedtls_svc_key_id_t arg1_key, |
| 1309 | psa_algorithm_t arg2_alg, |
| 1310 | const uint8_t *arg3_hash, |
| 1311 | size_t arg4_hash_length) |
| 1312 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1313 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 5d64c6a | 2024-03-11 13:58:07 +0000 | [diff] [blame] | 1314 | MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1315 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1316 | 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] | 1317 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 5d64c6a | 2024-03-11 13:58:07 +0000 | [diff] [blame] | 1318 | MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1319 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1320 | return status; |
| 1321 | } |
| 1322 | |
| 1323 | /* Wrapper for psa_sign_message */ |
| 1324 | psa_status_t mbedtls_test_wrap_psa_sign_message( |
| 1325 | mbedtls_svc_key_id_t arg0_key, |
| 1326 | psa_algorithm_t arg1_alg, |
| 1327 | const uint8_t *arg2_input, |
| 1328 | size_t arg3_input_length, |
| 1329 | uint8_t *arg4_signature, |
| 1330 | size_t arg5_signature_size, |
| 1331 | size_t *arg6_signature_length) |
| 1332 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1333 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | f430f47 | 2024-01-30 12:25:35 +0000 | [diff] [blame] | 1334 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 1335 | MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1336 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1337 | 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] | 1338 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | f430f47 | 2024-01-30 12:25:35 +0000 | [diff] [blame] | 1339 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 1340 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_size); |
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 | return status; |
| 1343 | } |
| 1344 | |
| 1345 | /* Wrapper for psa_verify_hash */ |
| 1346 | psa_status_t mbedtls_test_wrap_psa_verify_hash( |
| 1347 | mbedtls_svc_key_id_t arg0_key, |
| 1348 | psa_algorithm_t arg1_alg, |
| 1349 | const uint8_t *arg2_hash, |
| 1350 | size_t arg3_hash_length, |
| 1351 | const uint8_t *arg4_signature, |
| 1352 | size_t arg5_signature_length) |
| 1353 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1354 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | f430f47 | 2024-01-30 12:25:35 +0000 | [diff] [blame] | 1355 | MBEDTLS_TEST_MEMORY_POISON(arg2_hash, arg3_hash_length); |
| 1356 | MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1357 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1358 | 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] | 1359 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | f430f47 | 2024-01-30 12:25:35 +0000 | [diff] [blame] | 1360 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_hash, arg3_hash_length); |
| 1361 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1362 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1363 | return status; |
| 1364 | } |
| 1365 | |
| 1366 | /* Wrapper for psa_verify_hash_abort */ |
| 1367 | psa_status_t mbedtls_test_wrap_psa_verify_hash_abort( |
| 1368 | psa_verify_hash_interruptible_operation_t *arg0_operation) |
| 1369 | { |
| 1370 | psa_status_t status = (psa_verify_hash_abort)(arg0_operation); |
| 1371 | return status; |
| 1372 | } |
| 1373 | |
| 1374 | /* Wrapper for psa_verify_hash_complete */ |
| 1375 | psa_status_t mbedtls_test_wrap_psa_verify_hash_complete( |
| 1376 | psa_verify_hash_interruptible_operation_t *arg0_operation) |
| 1377 | { |
| 1378 | psa_status_t status = (psa_verify_hash_complete)(arg0_operation); |
| 1379 | return status; |
| 1380 | } |
| 1381 | |
| 1382 | /* Wrapper for psa_verify_hash_start */ |
| 1383 | psa_status_t mbedtls_test_wrap_psa_verify_hash_start( |
| 1384 | psa_verify_hash_interruptible_operation_t *arg0_operation, |
| 1385 | mbedtls_svc_key_id_t arg1_key, |
| 1386 | psa_algorithm_t arg2_alg, |
| 1387 | const uint8_t *arg3_hash, |
| 1388 | size_t arg4_hash_length, |
| 1389 | const uint8_t *arg5_signature, |
| 1390 | size_t arg6_signature_length) |
| 1391 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1392 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 5d64c6a | 2024-03-11 13:58:07 +0000 | [diff] [blame] | 1393 | MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_length); |
| 1394 | MBEDTLS_TEST_MEMORY_POISON(arg5_signature, arg6_signature_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1395 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1396 | 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] | 1397 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 5d64c6a | 2024-03-11 13:58:07 +0000 | [diff] [blame] | 1398 | MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_length); |
| 1399 | MBEDTLS_TEST_MEMORY_UNPOISON(arg5_signature, arg6_signature_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1400 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1401 | return status; |
| 1402 | } |
| 1403 | |
| 1404 | /* Wrapper for psa_verify_message */ |
| 1405 | psa_status_t mbedtls_test_wrap_psa_verify_message( |
| 1406 | mbedtls_svc_key_id_t arg0_key, |
| 1407 | psa_algorithm_t arg1_alg, |
| 1408 | const uint8_t *arg2_input, |
| 1409 | size_t arg3_input_length, |
| 1410 | const uint8_t *arg4_signature, |
| 1411 | size_t arg5_signature_length) |
| 1412 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1413 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | f430f47 | 2024-01-30 12:25:35 +0000 | [diff] [blame] | 1414 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 1415 | MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1416 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1417 | 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] | 1418 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | f430f47 | 2024-01-30 12:25:35 +0000 | [diff] [blame] | 1419 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 1420 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1421 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1422 | return status; |
| 1423 | } |
| 1424 | |
Gilles Peskine | 4411c9c | 2024-01-04 20:51:38 +0100 | [diff] [blame] | 1425 | #endif /* defined(MBEDTLS_PSA_CRYPTO_C) && defined(MBEDTLS_TEST_HOOKS) && \ |
| 1426 | !defined(RECORD_PSA_STATUS_COVERAGE_LOG) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1427 | |
| 1428 | /* End of automatically generated file. */ |