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 | 2463ec8 | 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 | 2463ec8 | 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 | 2463ec8 | 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 | 2463ec8 | 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 | 2463ec8 | 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 | 2463ec8 | 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 | 2463ec8 | 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 | 2463ec8 | 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 | 2463ec8 | 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 | 2463ec8 | 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 | 2463ec8 | 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 | 2463ec8 | 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 | 2463ec8 | 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 | 2463ec8 | 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 | |
David Horstmann | 80a5dbd | 2024-03-12 17:02:48 +0000 | [diff] [blame] | 607 | /* Wrapper for psa_generate_key_ext */ |
| 608 | psa_status_t mbedtls_test_wrap_psa_generate_key_ext( |
| 609 | const psa_key_attributes_t *arg0_attributes, |
| 610 | const psa_key_production_parameters_t *arg1_params, |
| 611 | size_t arg2_params_data_length, |
| 612 | mbedtls_svc_key_id_t *arg3_key) |
| 613 | { |
| 614 | psa_status_t status = (psa_generate_key_ext)(arg0_attributes, arg1_params, arg2_params_data_length, arg3_key); |
| 615 | return status; |
| 616 | } |
| 617 | |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 618 | /* Wrapper for psa_generate_random */ |
| 619 | psa_status_t mbedtls_test_wrap_psa_generate_random( |
| 620 | uint8_t *arg0_output, |
| 621 | size_t arg1_output_size) |
| 622 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 623 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 075c5fb | 2024-02-06 15:44:08 +0000 | [diff] [blame] | 624 | MBEDTLS_TEST_MEMORY_POISON(arg0_output, arg1_output_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 625 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 626 | psa_status_t status = (psa_generate_random)(arg0_output, arg1_output_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 627 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 075c5fb | 2024-02-06 15:44:08 +0000 | [diff] [blame] | 628 | MBEDTLS_TEST_MEMORY_UNPOISON(arg0_output, arg1_output_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 629 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 630 | return status; |
| 631 | } |
| 632 | |
| 633 | /* Wrapper for psa_get_key_attributes */ |
| 634 | psa_status_t mbedtls_test_wrap_psa_get_key_attributes( |
| 635 | mbedtls_svc_key_id_t arg0_key, |
| 636 | psa_key_attributes_t *arg1_attributes) |
| 637 | { |
| 638 | psa_status_t status = (psa_get_key_attributes)(arg0_key, arg1_attributes); |
| 639 | return status; |
| 640 | } |
| 641 | |
| 642 | /* Wrapper for psa_hash_abort */ |
| 643 | psa_status_t mbedtls_test_wrap_psa_hash_abort( |
| 644 | psa_hash_operation_t *arg0_operation) |
| 645 | { |
| 646 | psa_status_t status = (psa_hash_abort)(arg0_operation); |
| 647 | return status; |
| 648 | } |
| 649 | |
| 650 | /* Wrapper for psa_hash_clone */ |
| 651 | psa_status_t mbedtls_test_wrap_psa_hash_clone( |
| 652 | const psa_hash_operation_t *arg0_source_operation, |
| 653 | psa_hash_operation_t *arg1_target_operation) |
| 654 | { |
| 655 | psa_status_t status = (psa_hash_clone)(arg0_source_operation, arg1_target_operation); |
| 656 | return status; |
| 657 | } |
| 658 | |
| 659 | /* Wrapper for psa_hash_compare */ |
| 660 | psa_status_t mbedtls_test_wrap_psa_hash_compare( |
| 661 | psa_algorithm_t arg0_alg, |
| 662 | const uint8_t *arg1_input, |
| 663 | size_t arg2_input_length, |
| 664 | const uint8_t *arg3_hash, |
| 665 | size_t arg4_hash_length) |
| 666 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 667 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | 45c8586 | 2024-01-25 16:48:09 +0000 | [diff] [blame] | 668 | MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length); |
| 669 | MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 670 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 671 | 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] | 672 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | 45c8586 | 2024-01-25 16:48:09 +0000 | [diff] [blame] | 673 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length); |
| 674 | MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 675 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 676 | return status; |
| 677 | } |
| 678 | |
| 679 | /* Wrapper for psa_hash_compute */ |
| 680 | psa_status_t mbedtls_test_wrap_psa_hash_compute( |
| 681 | psa_algorithm_t arg0_alg, |
| 682 | const uint8_t *arg1_input, |
| 683 | size_t arg2_input_length, |
| 684 | uint8_t *arg3_hash, |
| 685 | size_t arg4_hash_size, |
| 686 | size_t *arg5_hash_length) |
| 687 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 688 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | 45c8586 | 2024-01-25 16:48:09 +0000 | [diff] [blame] | 689 | MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length); |
| 690 | MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 691 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 692 | 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] | 693 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | 45c8586 | 2024-01-25 16:48:09 +0000 | [diff] [blame] | 694 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length); |
| 695 | MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 696 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 697 | return status; |
| 698 | } |
| 699 | |
| 700 | /* Wrapper for psa_hash_finish */ |
| 701 | psa_status_t mbedtls_test_wrap_psa_hash_finish( |
| 702 | psa_hash_operation_t *arg0_operation, |
| 703 | uint8_t *arg1_hash, |
| 704 | size_t arg2_hash_size, |
| 705 | size_t *arg3_hash_length) |
| 706 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 707 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | 45c8586 | 2024-01-25 16:48:09 +0000 | [diff] [blame] | 708 | MBEDTLS_TEST_MEMORY_POISON(arg1_hash, arg2_hash_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 709 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 710 | 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] | 711 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | 45c8586 | 2024-01-25 16:48:09 +0000 | [diff] [blame] | 712 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_hash, arg2_hash_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 713 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 714 | return status; |
| 715 | } |
| 716 | |
| 717 | /* Wrapper for psa_hash_setup */ |
| 718 | psa_status_t mbedtls_test_wrap_psa_hash_setup( |
| 719 | psa_hash_operation_t *arg0_operation, |
| 720 | psa_algorithm_t arg1_alg) |
| 721 | { |
| 722 | psa_status_t status = (psa_hash_setup)(arg0_operation, arg1_alg); |
| 723 | return status; |
| 724 | } |
| 725 | |
| 726 | /* Wrapper for psa_hash_update */ |
| 727 | psa_status_t mbedtls_test_wrap_psa_hash_update( |
| 728 | psa_hash_operation_t *arg0_operation, |
| 729 | const uint8_t *arg1_input, |
| 730 | size_t arg2_input_length) |
| 731 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 732 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | 45c8586 | 2024-01-25 16:48:09 +0000 | [diff] [blame] | 733 | MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 734 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 735 | 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] | 736 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | 45c8586 | 2024-01-25 16:48:09 +0000 | [diff] [blame] | 737 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 738 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 739 | return status; |
| 740 | } |
| 741 | |
| 742 | /* Wrapper for psa_hash_verify */ |
| 743 | psa_status_t mbedtls_test_wrap_psa_hash_verify( |
| 744 | psa_hash_operation_t *arg0_operation, |
| 745 | const uint8_t *arg1_hash, |
| 746 | size_t arg2_hash_length) |
| 747 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 748 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | 45c8586 | 2024-01-25 16:48:09 +0000 | [diff] [blame] | 749 | MBEDTLS_TEST_MEMORY_POISON(arg1_hash, arg2_hash_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 750 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 751 | 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] | 752 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | 45c8586 | 2024-01-25 16:48:09 +0000 | [diff] [blame] | 753 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_hash, arg2_hash_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 754 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 755 | return status; |
| 756 | } |
| 757 | |
| 758 | /* Wrapper for psa_import_key */ |
| 759 | psa_status_t mbedtls_test_wrap_psa_import_key( |
| 760 | const psa_key_attributes_t *arg0_attributes, |
| 761 | const uint8_t *arg1_data, |
| 762 | size_t arg2_data_length, |
| 763 | mbedtls_svc_key_id_t *arg3_key) |
| 764 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 765 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Ryan Everett | 77b91e3 | 2024-01-25 10:58:06 +0000 | [diff] [blame] | 766 | MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_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_import_key)(arg0_attributes, arg1_data, arg2_data_length, arg3_key); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 769 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Ryan Everett | 77b91e3 | 2024-01-25 10:58:06 +0000 | [diff] [blame] | 770 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_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_key_derivation_abort */ |
| 776 | psa_status_t mbedtls_test_wrap_psa_key_derivation_abort( |
| 777 | psa_key_derivation_operation_t *arg0_operation) |
| 778 | { |
| 779 | psa_status_t status = (psa_key_derivation_abort)(arg0_operation); |
| 780 | return status; |
| 781 | } |
| 782 | |
| 783 | /* Wrapper for psa_key_derivation_get_capacity */ |
| 784 | psa_status_t mbedtls_test_wrap_psa_key_derivation_get_capacity( |
| 785 | const psa_key_derivation_operation_t *arg0_operation, |
| 786 | size_t *arg1_capacity) |
| 787 | { |
| 788 | psa_status_t status = (psa_key_derivation_get_capacity)(arg0_operation, arg1_capacity); |
| 789 | return status; |
| 790 | } |
| 791 | |
| 792 | /* Wrapper for psa_key_derivation_input_bytes */ |
| 793 | psa_status_t mbedtls_test_wrap_psa_key_derivation_input_bytes( |
| 794 | psa_key_derivation_operation_t *arg0_operation, |
| 795 | psa_key_derivation_step_t arg1_step, |
| 796 | const uint8_t *arg2_data, |
| 797 | size_t arg3_data_length) |
| 798 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 799 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Ryan Everett | 198a4d9 | 2024-01-25 11:44:56 +0000 | [diff] [blame] | 800 | MBEDTLS_TEST_MEMORY_POISON(arg2_data, arg3_data_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 801 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 802 | 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] | 803 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Ryan Everett | 198a4d9 | 2024-01-25 11:44:56 +0000 | [diff] [blame] | 804 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_data, arg3_data_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 805 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 806 | return status; |
| 807 | } |
| 808 | |
| 809 | /* Wrapper for psa_key_derivation_input_integer */ |
| 810 | psa_status_t mbedtls_test_wrap_psa_key_derivation_input_integer( |
| 811 | psa_key_derivation_operation_t *arg0_operation, |
| 812 | psa_key_derivation_step_t arg1_step, |
| 813 | uint64_t arg2_value) |
| 814 | { |
| 815 | psa_status_t status = (psa_key_derivation_input_integer)(arg0_operation, arg1_step, arg2_value); |
| 816 | return status; |
| 817 | } |
| 818 | |
| 819 | /* Wrapper for psa_key_derivation_input_key */ |
| 820 | psa_status_t mbedtls_test_wrap_psa_key_derivation_input_key( |
| 821 | psa_key_derivation_operation_t *arg0_operation, |
| 822 | psa_key_derivation_step_t arg1_step, |
| 823 | mbedtls_svc_key_id_t arg2_key) |
| 824 | { |
| 825 | psa_status_t status = (psa_key_derivation_input_key)(arg0_operation, arg1_step, arg2_key); |
| 826 | return status; |
| 827 | } |
| 828 | |
| 829 | /* Wrapper for psa_key_derivation_key_agreement */ |
| 830 | psa_status_t mbedtls_test_wrap_psa_key_derivation_key_agreement( |
| 831 | psa_key_derivation_operation_t *arg0_operation, |
| 832 | psa_key_derivation_step_t arg1_step, |
| 833 | mbedtls_svc_key_id_t arg2_private_key, |
| 834 | const uint8_t *arg3_peer_key, |
| 835 | size_t arg4_peer_key_length) |
| 836 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 837 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | fe2bda3 | 2024-02-15 13:35:06 +0000 | [diff] [blame] | 838 | MBEDTLS_TEST_MEMORY_POISON(arg3_peer_key, arg4_peer_key_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 839 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 840 | 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] | 841 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | fe2bda3 | 2024-02-15 13:35:06 +0000 | [diff] [blame] | 842 | MBEDTLS_TEST_MEMORY_UNPOISON(arg3_peer_key, arg4_peer_key_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 843 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 844 | return status; |
| 845 | } |
| 846 | |
| 847 | /* Wrapper for psa_key_derivation_output_bytes */ |
| 848 | psa_status_t mbedtls_test_wrap_psa_key_derivation_output_bytes( |
| 849 | psa_key_derivation_operation_t *arg0_operation, |
| 850 | uint8_t *arg1_output, |
| 851 | size_t arg2_output_length) |
| 852 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 853 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Ryan Everett | 198a4d9 | 2024-01-25 11:44:56 +0000 | [diff] [blame] | 854 | MBEDTLS_TEST_MEMORY_POISON(arg1_output, arg2_output_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 855 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 856 | 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] | 857 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Ryan Everett | 198a4d9 | 2024-01-25 11:44:56 +0000 | [diff] [blame] | 858 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_output, arg2_output_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 859 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 860 | return status; |
| 861 | } |
| 862 | |
| 863 | /* Wrapper for psa_key_derivation_output_key */ |
| 864 | psa_status_t mbedtls_test_wrap_psa_key_derivation_output_key( |
| 865 | const psa_key_attributes_t *arg0_attributes, |
| 866 | psa_key_derivation_operation_t *arg1_operation, |
| 867 | mbedtls_svc_key_id_t *arg2_key) |
| 868 | { |
| 869 | psa_status_t status = (psa_key_derivation_output_key)(arg0_attributes, arg1_operation, arg2_key); |
| 870 | return status; |
| 871 | } |
| 872 | |
David Horstmann | 80a5dbd | 2024-03-12 17:02:48 +0000 | [diff] [blame] | 873 | /* Wrapper for psa_key_derivation_output_key_ext */ |
| 874 | psa_status_t mbedtls_test_wrap_psa_key_derivation_output_key_ext( |
| 875 | const psa_key_attributes_t *arg0_attributes, |
| 876 | psa_key_derivation_operation_t *arg1_operation, |
| 877 | const psa_key_production_parameters_t *arg2_params, |
| 878 | size_t arg3_params_data_length, |
| 879 | mbedtls_svc_key_id_t *arg4_key) |
| 880 | { |
| 881 | psa_status_t status = (psa_key_derivation_output_key_ext)(arg0_attributes, arg1_operation, arg2_params, arg3_params_data_length, arg4_key); |
| 882 | return status; |
| 883 | } |
| 884 | |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 885 | /* Wrapper for psa_key_derivation_set_capacity */ |
| 886 | psa_status_t mbedtls_test_wrap_psa_key_derivation_set_capacity( |
| 887 | psa_key_derivation_operation_t *arg0_operation, |
| 888 | size_t arg1_capacity) |
| 889 | { |
| 890 | psa_status_t status = (psa_key_derivation_set_capacity)(arg0_operation, arg1_capacity); |
| 891 | return status; |
| 892 | } |
| 893 | |
| 894 | /* Wrapper for psa_key_derivation_setup */ |
| 895 | psa_status_t mbedtls_test_wrap_psa_key_derivation_setup( |
| 896 | psa_key_derivation_operation_t *arg0_operation, |
| 897 | psa_algorithm_t arg1_alg) |
| 898 | { |
| 899 | psa_status_t status = (psa_key_derivation_setup)(arg0_operation, arg1_alg); |
| 900 | return status; |
| 901 | } |
| 902 | |
| 903 | /* Wrapper for psa_mac_abort */ |
| 904 | psa_status_t mbedtls_test_wrap_psa_mac_abort( |
| 905 | psa_mac_operation_t *arg0_operation) |
| 906 | { |
| 907 | psa_status_t status = (psa_mac_abort)(arg0_operation); |
| 908 | return status; |
| 909 | } |
| 910 | |
| 911 | /* Wrapper for psa_mac_compute */ |
| 912 | psa_status_t mbedtls_test_wrap_psa_mac_compute( |
| 913 | mbedtls_svc_key_id_t arg0_key, |
| 914 | psa_algorithm_t arg1_alg, |
| 915 | const uint8_t *arg2_input, |
| 916 | size_t arg3_input_length, |
| 917 | uint8_t *arg4_mac, |
| 918 | size_t arg5_mac_size, |
| 919 | size_t *arg6_mac_length) |
| 920 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 921 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | a1cf101 | 2024-01-30 11:18:54 +0000 | [diff] [blame] | 922 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 923 | MBEDTLS_TEST_MEMORY_POISON(arg4_mac, arg5_mac_size); |
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_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] | 926 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | a1cf101 | 2024-01-30 11:18:54 +0000 | [diff] [blame] | 927 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 928 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_mac, arg5_mac_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 929 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 930 | return status; |
| 931 | } |
| 932 | |
| 933 | /* Wrapper for psa_mac_sign_finish */ |
| 934 | psa_status_t mbedtls_test_wrap_psa_mac_sign_finish( |
| 935 | psa_mac_operation_t *arg0_operation, |
| 936 | uint8_t *arg1_mac, |
| 937 | size_t arg2_mac_size, |
| 938 | size_t *arg3_mac_length) |
| 939 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 940 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | a1cf101 | 2024-01-30 11:18:54 +0000 | [diff] [blame] | 941 | MBEDTLS_TEST_MEMORY_POISON(arg1_mac, arg2_mac_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 942 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 943 | 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] | 944 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | a1cf101 | 2024-01-30 11:18:54 +0000 | [diff] [blame] | 945 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_mac, arg2_mac_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 946 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 947 | return status; |
| 948 | } |
| 949 | |
| 950 | /* Wrapper for psa_mac_sign_setup */ |
| 951 | psa_status_t mbedtls_test_wrap_psa_mac_sign_setup( |
| 952 | psa_mac_operation_t *arg0_operation, |
| 953 | mbedtls_svc_key_id_t arg1_key, |
| 954 | psa_algorithm_t arg2_alg) |
| 955 | { |
| 956 | psa_status_t status = (psa_mac_sign_setup)(arg0_operation, arg1_key, arg2_alg); |
| 957 | return status; |
| 958 | } |
| 959 | |
| 960 | /* Wrapper for psa_mac_update */ |
| 961 | psa_status_t mbedtls_test_wrap_psa_mac_update( |
| 962 | psa_mac_operation_t *arg0_operation, |
| 963 | const uint8_t *arg1_input, |
| 964 | size_t arg2_input_length) |
| 965 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 966 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | a1cf101 | 2024-01-30 11:18:54 +0000 | [diff] [blame] | 967 | MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 968 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 969 | 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] | 970 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | a1cf101 | 2024-01-30 11:18:54 +0000 | [diff] [blame] | 971 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 972 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 973 | return status; |
| 974 | } |
| 975 | |
| 976 | /* Wrapper for psa_mac_verify */ |
| 977 | psa_status_t mbedtls_test_wrap_psa_mac_verify( |
| 978 | mbedtls_svc_key_id_t arg0_key, |
| 979 | psa_algorithm_t arg1_alg, |
| 980 | const uint8_t *arg2_input, |
| 981 | size_t arg3_input_length, |
| 982 | const uint8_t *arg4_mac, |
| 983 | size_t arg5_mac_length) |
| 984 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 985 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | a1cf101 | 2024-01-30 11:18:54 +0000 | [diff] [blame] | 986 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 987 | MBEDTLS_TEST_MEMORY_POISON(arg4_mac, arg5_mac_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 988 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 989 | 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] | 990 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | a1cf101 | 2024-01-30 11:18:54 +0000 | [diff] [blame] | 991 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 992 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_mac, arg5_mac_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 993 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 994 | return status; |
| 995 | } |
| 996 | |
| 997 | /* Wrapper for psa_mac_verify_finish */ |
| 998 | psa_status_t mbedtls_test_wrap_psa_mac_verify_finish( |
| 999 | psa_mac_operation_t *arg0_operation, |
| 1000 | const uint8_t *arg1_mac, |
| 1001 | size_t arg2_mac_length) |
| 1002 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1003 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | a1cf101 | 2024-01-30 11:18:54 +0000 | [diff] [blame] | 1004 | MBEDTLS_TEST_MEMORY_POISON(arg1_mac, arg2_mac_length); |
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 | 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] | 1007 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | a1cf101 | 2024-01-30 11:18:54 +0000 | [diff] [blame] | 1008 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_mac, arg2_mac_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1009 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1010 | return status; |
| 1011 | } |
| 1012 | |
| 1013 | /* Wrapper for psa_mac_verify_setup */ |
| 1014 | psa_status_t mbedtls_test_wrap_psa_mac_verify_setup( |
| 1015 | psa_mac_operation_t *arg0_operation, |
| 1016 | mbedtls_svc_key_id_t arg1_key, |
| 1017 | psa_algorithm_t arg2_alg) |
| 1018 | { |
| 1019 | psa_status_t status = (psa_mac_verify_setup)(arg0_operation, arg1_key, arg2_alg); |
| 1020 | return status; |
| 1021 | } |
| 1022 | |
| 1023 | /* Wrapper for psa_pake_abort */ |
Ronald Cron | 2463ec8 | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 1024 | #if defined(PSA_WANT_ALG_SOME_PAKE) |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1025 | psa_status_t mbedtls_test_wrap_psa_pake_abort( |
| 1026 | psa_pake_operation_t *arg0_operation) |
| 1027 | { |
| 1028 | psa_status_t status = (psa_pake_abort)(arg0_operation); |
| 1029 | return status; |
| 1030 | } |
Ronald Cron | 2463ec8 | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 1031 | #endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1032 | |
| 1033 | /* Wrapper for psa_pake_get_implicit_key */ |
Ronald Cron | 2463ec8 | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 1034 | #if defined(PSA_WANT_ALG_SOME_PAKE) |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1035 | psa_status_t mbedtls_test_wrap_psa_pake_get_implicit_key( |
| 1036 | psa_pake_operation_t *arg0_operation, |
| 1037 | psa_key_derivation_operation_t *arg1_output) |
| 1038 | { |
| 1039 | psa_status_t status = (psa_pake_get_implicit_key)(arg0_operation, arg1_output); |
| 1040 | return status; |
| 1041 | } |
Ronald Cron | 2463ec8 | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 1042 | #endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1043 | |
| 1044 | /* Wrapper for psa_pake_input */ |
Ronald Cron | 2463ec8 | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 1045 | #if defined(PSA_WANT_ALG_SOME_PAKE) |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1046 | psa_status_t mbedtls_test_wrap_psa_pake_input( |
| 1047 | psa_pake_operation_t *arg0_operation, |
| 1048 | psa_pake_step_t arg1_step, |
| 1049 | const uint8_t *arg2_input, |
| 1050 | size_t arg3_input_length) |
| 1051 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1052 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 6076fe4 | 2024-01-23 15:28:51 +0000 | [diff] [blame] | 1053 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1054 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1055 | 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] | 1056 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 6076fe4 | 2024-01-23 15:28:51 +0000 | [diff] [blame] | 1057 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1058 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1059 | return status; |
| 1060 | } |
Ronald Cron | 2463ec8 | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 1061 | #endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1062 | |
| 1063 | /* Wrapper for psa_pake_output */ |
Ronald Cron | 2463ec8 | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 1064 | #if defined(PSA_WANT_ALG_SOME_PAKE) |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1065 | psa_status_t mbedtls_test_wrap_psa_pake_output( |
| 1066 | psa_pake_operation_t *arg0_operation, |
| 1067 | psa_pake_step_t arg1_step, |
| 1068 | uint8_t *arg2_output, |
| 1069 | size_t arg3_output_size, |
| 1070 | size_t *arg4_output_length) |
| 1071 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1072 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 6076fe4 | 2024-01-23 15:28:51 +0000 | [diff] [blame] | 1073 | MBEDTLS_TEST_MEMORY_POISON(arg2_output, arg3_output_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1074 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1075 | 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] | 1076 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 6076fe4 | 2024-01-23 15:28:51 +0000 | [diff] [blame] | 1077 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_output, arg3_output_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1078 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1079 | return status; |
| 1080 | } |
Ronald Cron | 2463ec8 | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 1081 | #endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1082 | |
| 1083 | /* Wrapper for psa_pake_set_password_key */ |
Ronald Cron | 2463ec8 | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 1084 | #if defined(PSA_WANT_ALG_SOME_PAKE) |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1085 | psa_status_t mbedtls_test_wrap_psa_pake_set_password_key( |
| 1086 | psa_pake_operation_t *arg0_operation, |
| 1087 | mbedtls_svc_key_id_t arg1_password) |
| 1088 | { |
| 1089 | psa_status_t status = (psa_pake_set_password_key)(arg0_operation, arg1_password); |
| 1090 | return status; |
| 1091 | } |
Ronald Cron | 2463ec8 | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 1092 | #endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1093 | |
| 1094 | /* Wrapper for psa_pake_set_peer */ |
Ronald Cron | 2463ec8 | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 1095 | #if defined(PSA_WANT_ALG_SOME_PAKE) |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1096 | psa_status_t mbedtls_test_wrap_psa_pake_set_peer( |
| 1097 | psa_pake_operation_t *arg0_operation, |
| 1098 | const uint8_t *arg1_peer_id, |
| 1099 | size_t arg2_peer_id_len) |
| 1100 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1101 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 6076fe4 | 2024-01-23 15:28:51 +0000 | [diff] [blame] | 1102 | MBEDTLS_TEST_MEMORY_POISON(arg1_peer_id, arg2_peer_id_len); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1103 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1104 | 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] | 1105 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 6076fe4 | 2024-01-23 15:28:51 +0000 | [diff] [blame] | 1106 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_peer_id, arg2_peer_id_len); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1107 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1108 | return status; |
| 1109 | } |
Ronald Cron | 2463ec8 | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 1110 | #endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1111 | |
| 1112 | /* Wrapper for psa_pake_set_role */ |
Ronald Cron | 2463ec8 | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 1113 | #if defined(PSA_WANT_ALG_SOME_PAKE) |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1114 | psa_status_t mbedtls_test_wrap_psa_pake_set_role( |
| 1115 | psa_pake_operation_t *arg0_operation, |
| 1116 | psa_pake_role_t arg1_role) |
| 1117 | { |
| 1118 | psa_status_t status = (psa_pake_set_role)(arg0_operation, arg1_role); |
| 1119 | return status; |
| 1120 | } |
Ronald Cron | 2463ec8 | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 1121 | #endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1122 | |
| 1123 | /* Wrapper for psa_pake_set_user */ |
Ronald Cron | 2463ec8 | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 1124 | #if defined(PSA_WANT_ALG_SOME_PAKE) |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1125 | psa_status_t mbedtls_test_wrap_psa_pake_set_user( |
| 1126 | psa_pake_operation_t *arg0_operation, |
| 1127 | const uint8_t *arg1_user_id, |
| 1128 | size_t arg2_user_id_len) |
| 1129 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1130 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 6076fe4 | 2024-01-23 15:28:51 +0000 | [diff] [blame] | 1131 | MBEDTLS_TEST_MEMORY_POISON(arg1_user_id, arg2_user_id_len); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1132 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1133 | 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] | 1134 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 6076fe4 | 2024-01-23 15:28:51 +0000 | [diff] [blame] | 1135 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_user_id, arg2_user_id_len); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1136 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1137 | return status; |
| 1138 | } |
Ronald Cron | 2463ec8 | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 1139 | #endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1140 | |
| 1141 | /* Wrapper for psa_pake_setup */ |
Ronald Cron | 2463ec8 | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 1142 | #if defined(PSA_WANT_ALG_SOME_PAKE) |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1143 | psa_status_t mbedtls_test_wrap_psa_pake_setup( |
| 1144 | psa_pake_operation_t *arg0_operation, |
| 1145 | const psa_pake_cipher_suite_t *arg1_cipher_suite) |
| 1146 | { |
| 1147 | psa_status_t status = (psa_pake_setup)(arg0_operation, arg1_cipher_suite); |
| 1148 | return status; |
| 1149 | } |
Ronald Cron | 2463ec8 | 2024-05-24 10:28:15 +0200 | [diff] [blame] | 1150 | #endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1151 | |
| 1152 | /* Wrapper for psa_purge_key */ |
| 1153 | psa_status_t mbedtls_test_wrap_psa_purge_key( |
| 1154 | mbedtls_svc_key_id_t arg0_key) |
| 1155 | { |
| 1156 | psa_status_t status = (psa_purge_key)(arg0_key); |
| 1157 | return status; |
| 1158 | } |
| 1159 | |
| 1160 | /* Wrapper for psa_raw_key_agreement */ |
| 1161 | psa_status_t mbedtls_test_wrap_psa_raw_key_agreement( |
| 1162 | psa_algorithm_t arg0_alg, |
| 1163 | mbedtls_svc_key_id_t arg1_private_key, |
| 1164 | const uint8_t *arg2_peer_key, |
| 1165 | size_t arg3_peer_key_length, |
| 1166 | uint8_t *arg4_output, |
| 1167 | size_t arg5_output_size, |
| 1168 | size_t *arg6_output_length) |
| 1169 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1170 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | fe2bda3 | 2024-02-15 13:35:06 +0000 | [diff] [blame] | 1171 | MBEDTLS_TEST_MEMORY_POISON(arg2_peer_key, arg3_peer_key_length); |
| 1172 | MBEDTLS_TEST_MEMORY_POISON(arg4_output, arg5_output_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1173 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1174 | 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] | 1175 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | fe2bda3 | 2024-02-15 13:35:06 +0000 | [diff] [blame] | 1176 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_peer_key, arg3_peer_key_length); |
| 1177 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_output, arg5_output_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1178 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1179 | return status; |
| 1180 | } |
| 1181 | |
| 1182 | /* Wrapper for psa_sign_hash */ |
| 1183 | psa_status_t mbedtls_test_wrap_psa_sign_hash( |
| 1184 | mbedtls_svc_key_id_t arg0_key, |
| 1185 | psa_algorithm_t arg1_alg, |
| 1186 | const uint8_t *arg2_hash, |
| 1187 | size_t arg3_hash_length, |
| 1188 | uint8_t *arg4_signature, |
| 1189 | size_t arg5_signature_size, |
| 1190 | size_t *arg6_signature_length) |
| 1191 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1192 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | f430f47 | 2024-01-30 12:25:35 +0000 | [diff] [blame] | 1193 | MBEDTLS_TEST_MEMORY_POISON(arg2_hash, arg3_hash_length); |
| 1194 | MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1195 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1196 | 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] | 1197 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | f430f47 | 2024-01-30 12:25:35 +0000 | [diff] [blame] | 1198 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_hash, arg3_hash_length); |
| 1199 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1200 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1201 | return status; |
| 1202 | } |
| 1203 | |
| 1204 | /* Wrapper for psa_sign_hash_abort */ |
| 1205 | psa_status_t mbedtls_test_wrap_psa_sign_hash_abort( |
| 1206 | psa_sign_hash_interruptible_operation_t *arg0_operation) |
| 1207 | { |
| 1208 | psa_status_t status = (psa_sign_hash_abort)(arg0_operation); |
| 1209 | return status; |
| 1210 | } |
| 1211 | |
| 1212 | /* Wrapper for psa_sign_hash_complete */ |
| 1213 | psa_status_t mbedtls_test_wrap_psa_sign_hash_complete( |
| 1214 | psa_sign_hash_interruptible_operation_t *arg0_operation, |
| 1215 | uint8_t *arg1_signature, |
| 1216 | size_t arg2_signature_size, |
| 1217 | size_t *arg3_signature_length) |
| 1218 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1219 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 5d64c6a | 2024-03-11 13:58:07 +0000 | [diff] [blame] | 1220 | MBEDTLS_TEST_MEMORY_POISON(arg1_signature, arg2_signature_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1221 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1222 | 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] | 1223 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 5d64c6a | 2024-03-11 13:58:07 +0000 | [diff] [blame] | 1224 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_signature, arg2_signature_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1225 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1226 | return status; |
| 1227 | } |
| 1228 | |
| 1229 | /* Wrapper for psa_sign_hash_start */ |
| 1230 | psa_status_t mbedtls_test_wrap_psa_sign_hash_start( |
| 1231 | psa_sign_hash_interruptible_operation_t *arg0_operation, |
| 1232 | mbedtls_svc_key_id_t arg1_key, |
| 1233 | psa_algorithm_t arg2_alg, |
| 1234 | const uint8_t *arg3_hash, |
| 1235 | size_t arg4_hash_length) |
| 1236 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1237 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 5d64c6a | 2024-03-11 13:58:07 +0000 | [diff] [blame] | 1238 | MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1239 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1240 | 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] | 1241 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 5d64c6a | 2024-03-11 13:58:07 +0000 | [diff] [blame] | 1242 | MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1243 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1244 | return status; |
| 1245 | } |
| 1246 | |
| 1247 | /* Wrapper for psa_sign_message */ |
| 1248 | psa_status_t mbedtls_test_wrap_psa_sign_message( |
| 1249 | mbedtls_svc_key_id_t arg0_key, |
| 1250 | psa_algorithm_t arg1_alg, |
| 1251 | const uint8_t *arg2_input, |
| 1252 | size_t arg3_input_length, |
| 1253 | uint8_t *arg4_signature, |
| 1254 | size_t arg5_signature_size, |
| 1255 | size_t *arg6_signature_length) |
| 1256 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1257 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | f430f47 | 2024-01-30 12:25:35 +0000 | [diff] [blame] | 1258 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 1259 | MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1260 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1261 | 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] | 1262 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | f430f47 | 2024-01-30 12:25:35 +0000 | [diff] [blame] | 1263 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 1264 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_size); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1265 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1266 | return status; |
| 1267 | } |
| 1268 | |
| 1269 | /* Wrapper for psa_verify_hash */ |
| 1270 | psa_status_t mbedtls_test_wrap_psa_verify_hash( |
| 1271 | mbedtls_svc_key_id_t arg0_key, |
| 1272 | psa_algorithm_t arg1_alg, |
| 1273 | const uint8_t *arg2_hash, |
| 1274 | size_t arg3_hash_length, |
| 1275 | const uint8_t *arg4_signature, |
| 1276 | size_t arg5_signature_length) |
| 1277 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1278 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | f430f47 | 2024-01-30 12:25:35 +0000 | [diff] [blame] | 1279 | MBEDTLS_TEST_MEMORY_POISON(arg2_hash, arg3_hash_length); |
| 1280 | MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1281 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1282 | 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] | 1283 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | f430f47 | 2024-01-30 12:25:35 +0000 | [diff] [blame] | 1284 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_hash, arg3_hash_length); |
| 1285 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1286 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1287 | return status; |
| 1288 | } |
| 1289 | |
| 1290 | /* Wrapper for psa_verify_hash_abort */ |
| 1291 | psa_status_t mbedtls_test_wrap_psa_verify_hash_abort( |
| 1292 | psa_verify_hash_interruptible_operation_t *arg0_operation) |
| 1293 | { |
| 1294 | psa_status_t status = (psa_verify_hash_abort)(arg0_operation); |
| 1295 | return status; |
| 1296 | } |
| 1297 | |
| 1298 | /* Wrapper for psa_verify_hash_complete */ |
| 1299 | psa_status_t mbedtls_test_wrap_psa_verify_hash_complete( |
| 1300 | psa_verify_hash_interruptible_operation_t *arg0_operation) |
| 1301 | { |
| 1302 | psa_status_t status = (psa_verify_hash_complete)(arg0_operation); |
| 1303 | return status; |
| 1304 | } |
| 1305 | |
| 1306 | /* Wrapper for psa_verify_hash_start */ |
| 1307 | psa_status_t mbedtls_test_wrap_psa_verify_hash_start( |
| 1308 | psa_verify_hash_interruptible_operation_t *arg0_operation, |
| 1309 | mbedtls_svc_key_id_t arg1_key, |
| 1310 | psa_algorithm_t arg2_alg, |
| 1311 | const uint8_t *arg3_hash, |
| 1312 | size_t arg4_hash_length, |
| 1313 | const uint8_t *arg5_signature, |
| 1314 | size_t arg6_signature_length) |
| 1315 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1316 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 5d64c6a | 2024-03-11 13:58:07 +0000 | [diff] [blame] | 1317 | MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_length); |
| 1318 | MBEDTLS_TEST_MEMORY_POISON(arg5_signature, arg6_signature_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 | 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] | 1321 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
David Horstmann | 5d64c6a | 2024-03-11 13:58:07 +0000 | [diff] [blame] | 1322 | MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_length); |
| 1323 | MBEDTLS_TEST_MEMORY_UNPOISON(arg5_signature, arg6_signature_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1324 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1325 | return status; |
| 1326 | } |
| 1327 | |
| 1328 | /* Wrapper for psa_verify_message */ |
| 1329 | psa_status_t mbedtls_test_wrap_psa_verify_message( |
| 1330 | mbedtls_svc_key_id_t arg0_key, |
| 1331 | psa_algorithm_t arg1_alg, |
| 1332 | const uint8_t *arg2_input, |
| 1333 | size_t arg3_input_length, |
| 1334 | const uint8_t *arg4_signature, |
| 1335 | size_t arg5_signature_length) |
| 1336 | { |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1337 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | f430f47 | 2024-01-30 12:25:35 +0000 | [diff] [blame] | 1338 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 1339 | MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1340 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1341 | 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] | 1342 | #if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) |
Thomas Daubney | f430f47 | 2024-01-30 12:25:35 +0000 | [diff] [blame] | 1343 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 1344 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_length); |
David Horstmann | 0a8abde | 2024-03-13 15:57:46 +0000 | [diff] [blame] | 1345 | #endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1346 | return status; |
| 1347 | } |
| 1348 | |
Gilles Peskine | 4411c9c | 2024-01-04 20:51:38 +0100 | [diff] [blame] | 1349 | #endif /* defined(MBEDTLS_PSA_CRYPTO_C) && defined(MBEDTLS_TEST_HOOKS) && \ |
| 1350 | !defined(RECORD_PSA_STATUS_COVERAGE_LOG) */ |
Gilles Peskine | 6e4332c | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 1351 | |
| 1352 | /* End of automatically generated file. */ |