Gilles Peskine | d5e5e6d | 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 | #if !defined(MBEDTLS_CONFIG_FILE) |
| 8 | #include "mbedtls/config.h" |
| 9 | #else |
| 10 | #include MBEDTLS_CONFIG_FILE |
| 11 | #endif |
| 12 | |
Gilles Peskine | a980aa0 | 2024-01-04 20:51:38 +0100 | [diff] [blame] | 13 | #if defined(MBEDTLS_PSA_CRYPTO_C) && defined(MBEDTLS_TEST_HOOKS) && \ |
| 14 | !defined(RECORD_PSA_STATUS_COVERAGE_LOG) |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 15 | |
| 16 | #include <psa/crypto.h> |
| 17 | |
Gilles Peskine | 42fa8ea | 2024-01-04 16:59:28 +0100 | [diff] [blame] | 18 | #include <test/memory.h> |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 19 | #include <test/psa_crypto_helpers.h> |
| 20 | #include <test/psa_test_wrappers.h> |
| 21 | |
| 22 | /* Wrapper for mbedtls_psa_inject_entropy */ |
| 23 | #if defined(MBEDTLS_PSA_INJECT_ENTROPY) |
| 24 | psa_status_t mbedtls_test_wrap_mbedtls_psa_inject_entropy( |
| 25 | const uint8_t *arg0_seed, |
| 26 | size_t arg1_seed_size) |
| 27 | { |
| 28 | psa_status_t status = (mbedtls_psa_inject_entropy)(arg0_seed, arg1_seed_size); |
| 29 | return status; |
| 30 | } |
| 31 | #endif /* defined(MBEDTLS_PSA_INJECT_ENTROPY) */ |
| 32 | |
| 33 | /* Wrapper for mbedtls_psa_platform_get_builtin_key */ |
| 34 | #if defined(MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS) |
| 35 | psa_status_t mbedtls_test_wrap_mbedtls_psa_platform_get_builtin_key( |
| 36 | mbedtls_svc_key_id_t arg0_key_id, |
| 37 | psa_key_lifetime_t *arg1_lifetime, |
| 38 | psa_drv_slot_number_t *arg2_slot_number) |
| 39 | { |
| 40 | psa_status_t status = (mbedtls_psa_platform_get_builtin_key)(arg0_key_id, arg1_lifetime, arg2_slot_number); |
| 41 | return status; |
| 42 | } |
| 43 | #endif /* defined(MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS) */ |
| 44 | |
| 45 | /* Wrapper for mbedtls_psa_register_se_key */ |
| 46 | #if defined(MBEDTLS_PSA_CRYPTO_SE_C) |
| 47 | psa_status_t mbedtls_test_wrap_mbedtls_psa_register_se_key( |
| 48 | const psa_key_attributes_t *arg0_attributes) |
| 49 | { |
| 50 | psa_status_t status = (mbedtls_psa_register_se_key)(arg0_attributes); |
| 51 | return status; |
| 52 | } |
| 53 | #endif /* defined(MBEDTLS_PSA_CRYPTO_SE_C) */ |
| 54 | |
| 55 | /* Wrapper for psa_aead_decrypt */ |
| 56 | psa_status_t mbedtls_test_wrap_psa_aead_decrypt( |
| 57 | mbedtls_svc_key_id_t arg0_key, |
| 58 | psa_algorithm_t arg1_alg, |
| 59 | const uint8_t *arg2_nonce, |
| 60 | size_t arg3_nonce_length, |
| 61 | const uint8_t *arg4_additional_data, |
| 62 | size_t arg5_additional_data_length, |
| 63 | const uint8_t *arg6_ciphertext, |
| 64 | size_t arg7_ciphertext_length, |
| 65 | uint8_t *arg8_plaintext, |
| 66 | size_t arg9_plaintext_size, |
| 67 | size_t *arg10_plaintext_length) |
| 68 | { |
David Horstmann | 436b2ef | 2024-01-22 14:36:01 +0000 | [diff] [blame] | 69 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 70 | MBEDTLS_TEST_MEMORY_POISON(arg2_nonce, arg3_nonce_length); |
| 71 | MBEDTLS_TEST_MEMORY_POISON(arg4_additional_data, arg5_additional_data_length); |
| 72 | MBEDTLS_TEST_MEMORY_POISON(arg6_ciphertext, arg7_ciphertext_length); |
| 73 | MBEDTLS_TEST_MEMORY_POISON(arg8_plaintext, arg9_plaintext_size); |
| 74 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 75 | 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 | 436b2ef | 2024-01-22 14:36:01 +0000 | [diff] [blame] | 76 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 77 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_nonce, arg3_nonce_length); |
| 78 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_additional_data, arg5_additional_data_length); |
| 79 | MBEDTLS_TEST_MEMORY_UNPOISON(arg6_ciphertext, arg7_ciphertext_length); |
| 80 | MBEDTLS_TEST_MEMORY_UNPOISON(arg8_plaintext, arg9_plaintext_size); |
| 81 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 82 | return status; |
| 83 | } |
| 84 | |
| 85 | /* Wrapper for psa_aead_encrypt */ |
| 86 | psa_status_t mbedtls_test_wrap_psa_aead_encrypt( |
| 87 | mbedtls_svc_key_id_t arg0_key, |
| 88 | psa_algorithm_t arg1_alg, |
| 89 | const uint8_t *arg2_nonce, |
| 90 | size_t arg3_nonce_length, |
| 91 | const uint8_t *arg4_additional_data, |
| 92 | size_t arg5_additional_data_length, |
| 93 | const uint8_t *arg6_plaintext, |
| 94 | size_t arg7_plaintext_length, |
| 95 | uint8_t *arg8_ciphertext, |
| 96 | size_t arg9_ciphertext_size, |
| 97 | size_t *arg10_ciphertext_length) |
| 98 | { |
David Horstmann | 436b2ef | 2024-01-22 14:36:01 +0000 | [diff] [blame] | 99 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 100 | MBEDTLS_TEST_MEMORY_POISON(arg2_nonce, arg3_nonce_length); |
| 101 | MBEDTLS_TEST_MEMORY_POISON(arg4_additional_data, arg5_additional_data_length); |
| 102 | MBEDTLS_TEST_MEMORY_POISON(arg6_plaintext, arg7_plaintext_length); |
| 103 | MBEDTLS_TEST_MEMORY_POISON(arg8_ciphertext, arg9_ciphertext_size); |
| 104 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 105 | 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 | 436b2ef | 2024-01-22 14:36:01 +0000 | [diff] [blame] | 106 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 107 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_nonce, arg3_nonce_length); |
| 108 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_additional_data, arg5_additional_data_length); |
| 109 | MBEDTLS_TEST_MEMORY_UNPOISON(arg6_plaintext, arg7_plaintext_length); |
| 110 | MBEDTLS_TEST_MEMORY_UNPOISON(arg8_ciphertext, arg9_ciphertext_size); |
| 111 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 112 | return status; |
| 113 | } |
| 114 | |
| 115 | /* Wrapper for psa_asymmetric_decrypt */ |
| 116 | psa_status_t mbedtls_test_wrap_psa_asymmetric_decrypt( |
| 117 | mbedtls_svc_key_id_t arg0_key, |
| 118 | psa_algorithm_t arg1_alg, |
| 119 | const uint8_t *arg2_input, |
| 120 | size_t arg3_input_length, |
| 121 | const uint8_t *arg4_salt, |
| 122 | size_t arg5_salt_length, |
| 123 | uint8_t *arg6_output, |
| 124 | size_t arg7_output_size, |
| 125 | size_t *arg8_output_length) |
| 126 | { |
Thomas Daubney | 2b614f9 | 2024-01-31 16:57:30 +0000 | [diff] [blame] | 127 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 128 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 129 | MBEDTLS_TEST_MEMORY_POISON(arg4_salt, arg5_salt_length); |
| 130 | MBEDTLS_TEST_MEMORY_POISON(arg6_output, arg7_output_size); |
| 131 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 132 | psa_status_t status = (psa_asymmetric_decrypt)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_salt, arg5_salt_length, arg6_output, arg7_output_size, arg8_output_length); |
Thomas Daubney | 2b614f9 | 2024-01-31 16:57:30 +0000 | [diff] [blame] | 133 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 134 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 135 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_salt, arg5_salt_length); |
| 136 | MBEDTLS_TEST_MEMORY_UNPOISON(arg6_output, arg7_output_size); |
| 137 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 138 | return status; |
| 139 | } |
| 140 | |
| 141 | /* Wrapper for psa_asymmetric_encrypt */ |
| 142 | psa_status_t mbedtls_test_wrap_psa_asymmetric_encrypt( |
| 143 | mbedtls_svc_key_id_t arg0_key, |
| 144 | psa_algorithm_t arg1_alg, |
| 145 | const uint8_t *arg2_input, |
| 146 | size_t arg3_input_length, |
| 147 | const uint8_t *arg4_salt, |
| 148 | size_t arg5_salt_length, |
| 149 | uint8_t *arg6_output, |
| 150 | size_t arg7_output_size, |
| 151 | size_t *arg8_output_length) |
| 152 | { |
Thomas Daubney | d8adccf | 2024-01-30 14:41:05 +0000 | [diff] [blame] | 153 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 154 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 155 | MBEDTLS_TEST_MEMORY_POISON(arg4_salt, arg5_salt_length); |
| 156 | MBEDTLS_TEST_MEMORY_POISON(arg6_output, arg7_output_size); |
| 157 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 158 | psa_status_t status = (psa_asymmetric_encrypt)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_salt, arg5_salt_length, arg6_output, arg7_output_size, arg8_output_length); |
Thomas Daubney | d8adccf | 2024-01-30 14:41:05 +0000 | [diff] [blame] | 159 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 160 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 161 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_salt, arg5_salt_length); |
| 162 | MBEDTLS_TEST_MEMORY_UNPOISON(arg6_output, arg7_output_size); |
| 163 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 164 | return status; |
| 165 | } |
| 166 | |
| 167 | /* Wrapper for psa_cipher_abort */ |
| 168 | psa_status_t mbedtls_test_wrap_psa_cipher_abort( |
| 169 | psa_cipher_operation_t *arg0_operation) |
| 170 | { |
| 171 | psa_status_t status = (psa_cipher_abort)(arg0_operation); |
| 172 | return status; |
| 173 | } |
| 174 | |
| 175 | /* Wrapper for psa_cipher_decrypt */ |
| 176 | psa_status_t mbedtls_test_wrap_psa_cipher_decrypt( |
| 177 | mbedtls_svc_key_id_t arg0_key, |
| 178 | psa_algorithm_t arg1_alg, |
| 179 | const uint8_t *arg2_input, |
| 180 | size_t arg3_input_length, |
| 181 | uint8_t *arg4_output, |
| 182 | size_t arg5_output_size, |
| 183 | size_t *arg6_output_length) |
| 184 | { |
Gabor Mezei | 143864c | 2024-01-24 16:58:40 +0100 | [diff] [blame^] | 185 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 186 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 187 | MBEDTLS_TEST_MEMORY_POISON(arg4_output, arg5_output_size); |
| 188 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 189 | psa_status_t status = (psa_cipher_decrypt)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_output, arg5_output_size, arg6_output_length); |
Gabor Mezei | 143864c | 2024-01-24 16:58:40 +0100 | [diff] [blame^] | 190 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 191 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 192 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_output, arg5_output_size); |
| 193 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 194 | return status; |
| 195 | } |
| 196 | |
| 197 | /* Wrapper for psa_cipher_decrypt_setup */ |
| 198 | psa_status_t mbedtls_test_wrap_psa_cipher_decrypt_setup( |
| 199 | psa_cipher_operation_t *arg0_operation, |
| 200 | mbedtls_svc_key_id_t arg1_key, |
| 201 | psa_algorithm_t arg2_alg) |
| 202 | { |
| 203 | psa_status_t status = (psa_cipher_decrypt_setup)(arg0_operation, arg1_key, arg2_alg); |
| 204 | return status; |
| 205 | } |
| 206 | |
| 207 | /* Wrapper for psa_cipher_encrypt */ |
| 208 | psa_status_t mbedtls_test_wrap_psa_cipher_encrypt( |
| 209 | mbedtls_svc_key_id_t arg0_key, |
| 210 | psa_algorithm_t arg1_alg, |
| 211 | const uint8_t *arg2_input, |
| 212 | size_t arg3_input_length, |
| 213 | uint8_t *arg4_output, |
| 214 | size_t arg5_output_size, |
| 215 | size_t *arg6_output_length) |
| 216 | { |
Ryan Everett | 810421c | 2024-01-25 12:09:09 +0000 | [diff] [blame] | 217 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 218 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 219 | MBEDTLS_TEST_MEMORY_POISON(arg4_output, arg5_output_size); |
| 220 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 221 | psa_status_t status = (psa_cipher_encrypt)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_output, arg5_output_size, arg6_output_length); |
Ryan Everett | 810421c | 2024-01-25 12:09:09 +0000 | [diff] [blame] | 222 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 223 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 224 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_output, arg5_output_size); |
| 225 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 226 | return status; |
| 227 | } |
| 228 | |
| 229 | /* Wrapper for psa_cipher_encrypt_setup */ |
| 230 | psa_status_t mbedtls_test_wrap_psa_cipher_encrypt_setup( |
| 231 | psa_cipher_operation_t *arg0_operation, |
| 232 | mbedtls_svc_key_id_t arg1_key, |
| 233 | psa_algorithm_t arg2_alg) |
| 234 | { |
| 235 | psa_status_t status = (psa_cipher_encrypt_setup)(arg0_operation, arg1_key, arg2_alg); |
| 236 | return status; |
| 237 | } |
| 238 | |
| 239 | /* Wrapper for psa_cipher_finish */ |
| 240 | psa_status_t mbedtls_test_wrap_psa_cipher_finish( |
| 241 | psa_cipher_operation_t *arg0_operation, |
| 242 | uint8_t *arg1_output, |
| 243 | size_t arg2_output_size, |
| 244 | size_t *arg3_output_length) |
| 245 | { |
Gabor Mezei | 143864c | 2024-01-24 16:58:40 +0100 | [diff] [blame^] | 246 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 247 | MBEDTLS_TEST_MEMORY_POISON(arg1_output, arg2_output_size); |
| 248 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 249 | psa_status_t status = (psa_cipher_finish)(arg0_operation, arg1_output, arg2_output_size, arg3_output_length); |
Gabor Mezei | 143864c | 2024-01-24 16:58:40 +0100 | [diff] [blame^] | 250 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 251 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_output, arg2_output_size); |
| 252 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 253 | return status; |
| 254 | } |
| 255 | |
| 256 | /* Wrapper for psa_cipher_generate_iv */ |
| 257 | psa_status_t mbedtls_test_wrap_psa_cipher_generate_iv( |
| 258 | psa_cipher_operation_t *arg0_operation, |
| 259 | uint8_t *arg1_iv, |
| 260 | size_t arg2_iv_size, |
| 261 | size_t *arg3_iv_length) |
| 262 | { |
| 263 | psa_status_t status = (psa_cipher_generate_iv)(arg0_operation, arg1_iv, arg2_iv_size, arg3_iv_length); |
| 264 | return status; |
| 265 | } |
| 266 | |
| 267 | /* Wrapper for psa_cipher_set_iv */ |
| 268 | psa_status_t mbedtls_test_wrap_psa_cipher_set_iv( |
| 269 | psa_cipher_operation_t *arg0_operation, |
| 270 | const uint8_t *arg1_iv, |
| 271 | size_t arg2_iv_length) |
| 272 | { |
| 273 | psa_status_t status = (psa_cipher_set_iv)(arg0_operation, arg1_iv, arg2_iv_length); |
| 274 | return status; |
| 275 | } |
| 276 | |
| 277 | /* Wrapper for psa_cipher_update */ |
| 278 | psa_status_t mbedtls_test_wrap_psa_cipher_update( |
| 279 | psa_cipher_operation_t *arg0_operation, |
| 280 | const uint8_t *arg1_input, |
| 281 | size_t arg2_input_length, |
| 282 | uint8_t *arg3_output, |
| 283 | size_t arg4_output_size, |
| 284 | size_t *arg5_output_length) |
| 285 | { |
Gabor Mezei | 143864c | 2024-01-24 16:58:40 +0100 | [diff] [blame^] | 286 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 287 | MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length); |
| 288 | MBEDTLS_TEST_MEMORY_POISON(arg3_output, arg4_output_size); |
| 289 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 290 | psa_status_t status = (psa_cipher_update)(arg0_operation, arg1_input, arg2_input_length, arg3_output, arg4_output_size, arg5_output_length); |
Gabor Mezei | 143864c | 2024-01-24 16:58:40 +0100 | [diff] [blame^] | 291 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 292 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length); |
| 293 | MBEDTLS_TEST_MEMORY_UNPOISON(arg3_output, arg4_output_size); |
| 294 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 295 | return status; |
| 296 | } |
| 297 | |
| 298 | /* Wrapper for psa_copy_key */ |
| 299 | psa_status_t mbedtls_test_wrap_psa_copy_key( |
| 300 | mbedtls_svc_key_id_t arg0_source_key, |
| 301 | const psa_key_attributes_t *arg1_attributes, |
| 302 | mbedtls_svc_key_id_t *arg2_target_key) |
| 303 | { |
| 304 | psa_status_t status = (psa_copy_key)(arg0_source_key, arg1_attributes, arg2_target_key); |
| 305 | return status; |
| 306 | } |
| 307 | |
| 308 | /* Wrapper for psa_crypto_init */ |
| 309 | psa_status_t mbedtls_test_wrap_psa_crypto_init(void) |
| 310 | { |
| 311 | psa_status_t status = (psa_crypto_init)(); |
| 312 | return status; |
| 313 | } |
| 314 | |
| 315 | /* Wrapper for psa_destroy_key */ |
| 316 | psa_status_t mbedtls_test_wrap_psa_destroy_key( |
| 317 | mbedtls_svc_key_id_t arg0_key) |
| 318 | { |
| 319 | psa_status_t status = (psa_destroy_key)(arg0_key); |
| 320 | return status; |
| 321 | } |
| 322 | |
| 323 | /* Wrapper for psa_export_key */ |
| 324 | psa_status_t mbedtls_test_wrap_psa_export_key( |
| 325 | mbedtls_svc_key_id_t arg0_key, |
| 326 | uint8_t *arg1_data, |
| 327 | size_t arg2_data_size, |
| 328 | size_t *arg3_data_length) |
| 329 | { |
Ryan Everett | dcbc1d3 | 2024-01-25 11:04:48 +0000 | [diff] [blame] | 330 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 331 | MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_size); |
| 332 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 333 | psa_status_t status = (psa_export_key)(arg0_key, arg1_data, arg2_data_size, arg3_data_length); |
Ryan Everett | dcbc1d3 | 2024-01-25 11:04:48 +0000 | [diff] [blame] | 334 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 335 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_size); |
| 336 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 337 | return status; |
| 338 | } |
| 339 | |
| 340 | /* Wrapper for psa_export_public_key */ |
| 341 | psa_status_t mbedtls_test_wrap_psa_export_public_key( |
| 342 | mbedtls_svc_key_id_t arg0_key, |
| 343 | uint8_t *arg1_data, |
| 344 | size_t arg2_data_size, |
| 345 | size_t *arg3_data_length) |
| 346 | { |
Ryan Everett | dcbc1d3 | 2024-01-25 11:04:48 +0000 | [diff] [blame] | 347 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 348 | MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_size); |
| 349 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 350 | psa_status_t status = (psa_export_public_key)(arg0_key, arg1_data, arg2_data_size, arg3_data_length); |
Ryan Everett | dcbc1d3 | 2024-01-25 11:04:48 +0000 | [diff] [blame] | 351 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 352 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_size); |
| 353 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 354 | return status; |
| 355 | } |
| 356 | |
| 357 | /* Wrapper for psa_generate_key */ |
| 358 | psa_status_t mbedtls_test_wrap_psa_generate_key( |
| 359 | const psa_key_attributes_t *arg0_attributes, |
| 360 | mbedtls_svc_key_id_t *arg1_key) |
| 361 | { |
| 362 | psa_status_t status = (psa_generate_key)(arg0_attributes, arg1_key); |
| 363 | return status; |
| 364 | } |
| 365 | |
| 366 | /* Wrapper for psa_generate_random */ |
| 367 | psa_status_t mbedtls_test_wrap_psa_generate_random( |
| 368 | uint8_t *arg0_output, |
| 369 | size_t arg1_output_size) |
| 370 | { |
| 371 | psa_status_t status = (psa_generate_random)(arg0_output, arg1_output_size); |
| 372 | return status; |
| 373 | } |
| 374 | |
| 375 | /* Wrapper for psa_get_key_attributes */ |
| 376 | psa_status_t mbedtls_test_wrap_psa_get_key_attributes( |
| 377 | mbedtls_svc_key_id_t arg0_key, |
| 378 | psa_key_attributes_t *arg1_attributes) |
| 379 | { |
| 380 | psa_status_t status = (psa_get_key_attributes)(arg0_key, arg1_attributes); |
| 381 | return status; |
| 382 | } |
| 383 | |
| 384 | /* Wrapper for psa_hash_abort */ |
| 385 | psa_status_t mbedtls_test_wrap_psa_hash_abort( |
| 386 | psa_hash_operation_t *arg0_operation) |
| 387 | { |
| 388 | psa_status_t status = (psa_hash_abort)(arg0_operation); |
| 389 | return status; |
| 390 | } |
| 391 | |
| 392 | /* Wrapper for psa_hash_clone */ |
| 393 | psa_status_t mbedtls_test_wrap_psa_hash_clone( |
| 394 | const psa_hash_operation_t *arg0_source_operation, |
| 395 | psa_hash_operation_t *arg1_target_operation) |
| 396 | { |
| 397 | psa_status_t status = (psa_hash_clone)(arg0_source_operation, arg1_target_operation); |
| 398 | return status; |
| 399 | } |
| 400 | |
| 401 | /* Wrapper for psa_hash_compare */ |
| 402 | psa_status_t mbedtls_test_wrap_psa_hash_compare( |
| 403 | psa_algorithm_t arg0_alg, |
| 404 | const uint8_t *arg1_input, |
| 405 | size_t arg2_input_length, |
| 406 | const uint8_t *arg3_hash, |
| 407 | size_t arg4_hash_length) |
| 408 | { |
Thomas Daubney | ebf9329 | 2024-01-25 17:09:10 +0000 | [diff] [blame] | 409 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 410 | MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length); |
| 411 | MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_length); |
| 412 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 413 | psa_status_t status = (psa_hash_compare)(arg0_alg, arg1_input, arg2_input_length, arg3_hash, arg4_hash_length); |
Thomas Daubney | ebf9329 | 2024-01-25 17:09:10 +0000 | [diff] [blame] | 414 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 415 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length); |
| 416 | MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_length); |
| 417 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 418 | return status; |
| 419 | } |
| 420 | |
| 421 | /* Wrapper for psa_hash_compute */ |
| 422 | psa_status_t mbedtls_test_wrap_psa_hash_compute( |
| 423 | psa_algorithm_t arg0_alg, |
| 424 | const uint8_t *arg1_input, |
| 425 | size_t arg2_input_length, |
| 426 | uint8_t *arg3_hash, |
| 427 | size_t arg4_hash_size, |
| 428 | size_t *arg5_hash_length) |
| 429 | { |
Thomas Daubney | ebf9329 | 2024-01-25 17:09:10 +0000 | [diff] [blame] | 430 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 431 | MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length); |
| 432 | MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_size); |
| 433 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 434 | psa_status_t status = (psa_hash_compute)(arg0_alg, arg1_input, arg2_input_length, arg3_hash, arg4_hash_size, arg5_hash_length); |
Thomas Daubney | ebf9329 | 2024-01-25 17:09:10 +0000 | [diff] [blame] | 435 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 436 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length); |
| 437 | MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_size); |
| 438 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 439 | return status; |
| 440 | } |
| 441 | |
| 442 | /* Wrapper for psa_hash_finish */ |
| 443 | psa_status_t mbedtls_test_wrap_psa_hash_finish( |
| 444 | psa_hash_operation_t *arg0_operation, |
| 445 | uint8_t *arg1_hash, |
| 446 | size_t arg2_hash_size, |
| 447 | size_t *arg3_hash_length) |
| 448 | { |
Thomas Daubney | ebf9329 | 2024-01-25 17:09:10 +0000 | [diff] [blame] | 449 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 450 | MBEDTLS_TEST_MEMORY_POISON(arg1_hash, arg2_hash_size); |
| 451 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 452 | psa_status_t status = (psa_hash_finish)(arg0_operation, arg1_hash, arg2_hash_size, arg3_hash_length); |
Thomas Daubney | ebf9329 | 2024-01-25 17:09:10 +0000 | [diff] [blame] | 453 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 454 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_hash, arg2_hash_size); |
| 455 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 456 | return status; |
| 457 | } |
| 458 | |
| 459 | /* Wrapper for psa_hash_setup */ |
| 460 | psa_status_t mbedtls_test_wrap_psa_hash_setup( |
| 461 | psa_hash_operation_t *arg0_operation, |
| 462 | psa_algorithm_t arg1_alg) |
| 463 | { |
| 464 | psa_status_t status = (psa_hash_setup)(arg0_operation, arg1_alg); |
| 465 | return status; |
| 466 | } |
| 467 | |
| 468 | /* Wrapper for psa_hash_update */ |
| 469 | psa_status_t mbedtls_test_wrap_psa_hash_update( |
| 470 | psa_hash_operation_t *arg0_operation, |
| 471 | const uint8_t *arg1_input, |
| 472 | size_t arg2_input_length) |
| 473 | { |
Thomas Daubney | ebf9329 | 2024-01-25 17:09:10 +0000 | [diff] [blame] | 474 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 475 | MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length); |
| 476 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 477 | psa_status_t status = (psa_hash_update)(arg0_operation, arg1_input, arg2_input_length); |
Thomas Daubney | ebf9329 | 2024-01-25 17:09:10 +0000 | [diff] [blame] | 478 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 479 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length); |
| 480 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 481 | return status; |
| 482 | } |
| 483 | |
| 484 | /* Wrapper for psa_hash_verify */ |
| 485 | psa_status_t mbedtls_test_wrap_psa_hash_verify( |
| 486 | psa_hash_operation_t *arg0_operation, |
| 487 | const uint8_t *arg1_hash, |
| 488 | size_t arg2_hash_length) |
| 489 | { |
Thomas Daubney | ebf9329 | 2024-01-25 17:09:10 +0000 | [diff] [blame] | 490 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 491 | MBEDTLS_TEST_MEMORY_POISON(arg1_hash, arg2_hash_length); |
| 492 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 493 | psa_status_t status = (psa_hash_verify)(arg0_operation, arg1_hash, arg2_hash_length); |
Thomas Daubney | ebf9329 | 2024-01-25 17:09:10 +0000 | [diff] [blame] | 494 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 495 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_hash, arg2_hash_length); |
| 496 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 497 | return status; |
| 498 | } |
| 499 | |
| 500 | /* Wrapper for psa_import_key */ |
| 501 | psa_status_t mbedtls_test_wrap_psa_import_key( |
| 502 | const psa_key_attributes_t *arg0_attributes, |
| 503 | const uint8_t *arg1_data, |
| 504 | size_t arg2_data_length, |
| 505 | mbedtls_svc_key_id_t *arg3_key) |
| 506 | { |
Ryan Everett | dcbc1d3 | 2024-01-25 11:04:48 +0000 | [diff] [blame] | 507 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 508 | MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_length); |
| 509 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 510 | psa_status_t status = (psa_import_key)(arg0_attributes, arg1_data, arg2_data_length, arg3_key); |
Ryan Everett | dcbc1d3 | 2024-01-25 11:04:48 +0000 | [diff] [blame] | 511 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 512 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_length); |
| 513 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 514 | return status; |
| 515 | } |
| 516 | |
| 517 | /* Wrapper for psa_key_derivation_abort */ |
| 518 | psa_status_t mbedtls_test_wrap_psa_key_derivation_abort( |
| 519 | psa_key_derivation_operation_t *arg0_operation) |
| 520 | { |
| 521 | psa_status_t status = (psa_key_derivation_abort)(arg0_operation); |
| 522 | return status; |
| 523 | } |
| 524 | |
| 525 | /* Wrapper for psa_key_derivation_get_capacity */ |
| 526 | psa_status_t mbedtls_test_wrap_psa_key_derivation_get_capacity( |
| 527 | const psa_key_derivation_operation_t *arg0_operation, |
| 528 | size_t *arg1_capacity) |
| 529 | { |
| 530 | psa_status_t status = (psa_key_derivation_get_capacity)(arg0_operation, arg1_capacity); |
| 531 | return status; |
| 532 | } |
| 533 | |
| 534 | /* Wrapper for psa_key_derivation_input_bytes */ |
| 535 | psa_status_t mbedtls_test_wrap_psa_key_derivation_input_bytes( |
| 536 | psa_key_derivation_operation_t *arg0_operation, |
| 537 | psa_key_derivation_step_t arg1_step, |
| 538 | const uint8_t *arg2_data, |
| 539 | size_t arg3_data_length) |
| 540 | { |
Ryan Everett | 6c9e69d | 2024-02-09 16:23:25 +0000 | [diff] [blame] | 541 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 542 | MBEDTLS_TEST_MEMORY_POISON(arg2_data, arg3_data_length); |
| 543 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 544 | psa_status_t status = (psa_key_derivation_input_bytes)(arg0_operation, arg1_step, arg2_data, arg3_data_length); |
Ryan Everett | 6c9e69d | 2024-02-09 16:23:25 +0000 | [diff] [blame] | 545 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 546 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_data, arg3_data_length); |
| 547 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 548 | return status; |
| 549 | } |
| 550 | |
| 551 | /* Wrapper for psa_key_derivation_input_key */ |
| 552 | psa_status_t mbedtls_test_wrap_psa_key_derivation_input_key( |
| 553 | psa_key_derivation_operation_t *arg0_operation, |
| 554 | psa_key_derivation_step_t arg1_step, |
| 555 | mbedtls_svc_key_id_t arg2_key) |
| 556 | { |
| 557 | psa_status_t status = (psa_key_derivation_input_key)(arg0_operation, arg1_step, arg2_key); |
| 558 | return status; |
| 559 | } |
| 560 | |
| 561 | /* Wrapper for psa_key_derivation_key_agreement */ |
| 562 | psa_status_t mbedtls_test_wrap_psa_key_derivation_key_agreement( |
| 563 | psa_key_derivation_operation_t *arg0_operation, |
| 564 | psa_key_derivation_step_t arg1_step, |
| 565 | mbedtls_svc_key_id_t arg2_private_key, |
| 566 | const uint8_t *arg3_peer_key, |
| 567 | size_t arg4_peer_key_length) |
| 568 | { |
| 569 | psa_status_t status = (psa_key_derivation_key_agreement)(arg0_operation, arg1_step, arg2_private_key, arg3_peer_key, arg4_peer_key_length); |
| 570 | return status; |
| 571 | } |
| 572 | |
| 573 | /* Wrapper for psa_key_derivation_output_bytes */ |
| 574 | psa_status_t mbedtls_test_wrap_psa_key_derivation_output_bytes( |
| 575 | psa_key_derivation_operation_t *arg0_operation, |
| 576 | uint8_t *arg1_output, |
| 577 | size_t arg2_output_length) |
| 578 | { |
Ryan Everett | 6c9e69d | 2024-02-09 16:23:25 +0000 | [diff] [blame] | 579 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 580 | MBEDTLS_TEST_MEMORY_POISON(arg1_output, arg2_output_length); |
| 581 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 582 | psa_status_t status = (psa_key_derivation_output_bytes)(arg0_operation, arg1_output, arg2_output_length); |
Ryan Everett | 6c9e69d | 2024-02-09 16:23:25 +0000 | [diff] [blame] | 583 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 584 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_output, arg2_output_length); |
| 585 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 586 | return status; |
| 587 | } |
| 588 | |
| 589 | /* Wrapper for psa_key_derivation_output_key */ |
| 590 | psa_status_t mbedtls_test_wrap_psa_key_derivation_output_key( |
| 591 | const psa_key_attributes_t *arg0_attributes, |
| 592 | psa_key_derivation_operation_t *arg1_operation, |
| 593 | mbedtls_svc_key_id_t *arg2_key) |
| 594 | { |
| 595 | psa_status_t status = (psa_key_derivation_output_key)(arg0_attributes, arg1_operation, arg2_key); |
| 596 | return status; |
| 597 | } |
| 598 | |
| 599 | /* Wrapper for psa_key_derivation_set_capacity */ |
| 600 | psa_status_t mbedtls_test_wrap_psa_key_derivation_set_capacity( |
| 601 | psa_key_derivation_operation_t *arg0_operation, |
| 602 | size_t arg1_capacity) |
| 603 | { |
| 604 | psa_status_t status = (psa_key_derivation_set_capacity)(arg0_operation, arg1_capacity); |
| 605 | return status; |
| 606 | } |
| 607 | |
| 608 | /* Wrapper for psa_key_derivation_setup */ |
| 609 | psa_status_t mbedtls_test_wrap_psa_key_derivation_setup( |
| 610 | psa_key_derivation_operation_t *arg0_operation, |
| 611 | psa_algorithm_t arg1_alg) |
| 612 | { |
| 613 | psa_status_t status = (psa_key_derivation_setup)(arg0_operation, arg1_alg); |
| 614 | return status; |
| 615 | } |
| 616 | |
| 617 | /* Wrapper for psa_mac_abort */ |
| 618 | psa_status_t mbedtls_test_wrap_psa_mac_abort( |
| 619 | psa_mac_operation_t *arg0_operation) |
| 620 | { |
| 621 | psa_status_t status = (psa_mac_abort)(arg0_operation); |
| 622 | return status; |
| 623 | } |
| 624 | |
| 625 | /* Wrapper for psa_mac_compute */ |
| 626 | psa_status_t mbedtls_test_wrap_psa_mac_compute( |
| 627 | mbedtls_svc_key_id_t arg0_key, |
| 628 | psa_algorithm_t arg1_alg, |
| 629 | const uint8_t *arg2_input, |
| 630 | size_t arg3_input_length, |
| 631 | uint8_t *arg4_mac, |
| 632 | size_t arg5_mac_size, |
| 633 | size_t *arg6_mac_length) |
| 634 | { |
Thomas Daubney | 6b91503 | 2024-01-30 12:07:38 +0000 | [diff] [blame] | 635 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 636 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 637 | MBEDTLS_TEST_MEMORY_POISON(arg4_mac, arg5_mac_size); |
| 638 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 639 | psa_status_t status = (psa_mac_compute)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_mac, arg5_mac_size, arg6_mac_length); |
Thomas Daubney | 6b91503 | 2024-01-30 12:07:38 +0000 | [diff] [blame] | 640 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 641 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 642 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_mac, arg5_mac_size); |
| 643 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 644 | return status; |
| 645 | } |
| 646 | |
| 647 | /* Wrapper for psa_mac_sign_finish */ |
| 648 | psa_status_t mbedtls_test_wrap_psa_mac_sign_finish( |
| 649 | psa_mac_operation_t *arg0_operation, |
| 650 | uint8_t *arg1_mac, |
| 651 | size_t arg2_mac_size, |
| 652 | size_t *arg3_mac_length) |
| 653 | { |
Thomas Daubney | 6b91503 | 2024-01-30 12:07:38 +0000 | [diff] [blame] | 654 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 655 | MBEDTLS_TEST_MEMORY_POISON(arg1_mac, arg2_mac_size); |
| 656 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 657 | psa_status_t status = (psa_mac_sign_finish)(arg0_operation, arg1_mac, arg2_mac_size, arg3_mac_length); |
Thomas Daubney | 6b91503 | 2024-01-30 12:07:38 +0000 | [diff] [blame] | 658 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 659 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_mac, arg2_mac_size); |
| 660 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 661 | return status; |
| 662 | } |
| 663 | |
| 664 | /* Wrapper for psa_mac_sign_setup */ |
| 665 | psa_status_t mbedtls_test_wrap_psa_mac_sign_setup( |
| 666 | psa_mac_operation_t *arg0_operation, |
| 667 | mbedtls_svc_key_id_t arg1_key, |
| 668 | psa_algorithm_t arg2_alg) |
| 669 | { |
| 670 | psa_status_t status = (psa_mac_sign_setup)(arg0_operation, arg1_key, arg2_alg); |
| 671 | return status; |
| 672 | } |
| 673 | |
| 674 | /* Wrapper for psa_mac_update */ |
| 675 | psa_status_t mbedtls_test_wrap_psa_mac_update( |
| 676 | psa_mac_operation_t *arg0_operation, |
| 677 | const uint8_t *arg1_input, |
| 678 | size_t arg2_input_length) |
| 679 | { |
Thomas Daubney | 6b91503 | 2024-01-30 12:07:38 +0000 | [diff] [blame] | 680 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 681 | MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length); |
| 682 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 683 | psa_status_t status = (psa_mac_update)(arg0_operation, arg1_input, arg2_input_length); |
Thomas Daubney | 6b91503 | 2024-01-30 12:07:38 +0000 | [diff] [blame] | 684 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 685 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length); |
| 686 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 687 | return status; |
| 688 | } |
| 689 | |
| 690 | /* Wrapper for psa_mac_verify */ |
| 691 | psa_status_t mbedtls_test_wrap_psa_mac_verify( |
| 692 | mbedtls_svc_key_id_t arg0_key, |
| 693 | psa_algorithm_t arg1_alg, |
| 694 | const uint8_t *arg2_input, |
| 695 | size_t arg3_input_length, |
| 696 | const uint8_t *arg4_mac, |
| 697 | size_t arg5_mac_length) |
| 698 | { |
Thomas Daubney | 6b91503 | 2024-01-30 12:07:38 +0000 | [diff] [blame] | 699 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 700 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 701 | MBEDTLS_TEST_MEMORY_POISON(arg4_mac, arg5_mac_length); |
| 702 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 703 | psa_status_t status = (psa_mac_verify)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_mac, arg5_mac_length); |
Thomas Daubney | 6b91503 | 2024-01-30 12:07:38 +0000 | [diff] [blame] | 704 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 705 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 706 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_mac, arg5_mac_length); |
| 707 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 708 | return status; |
| 709 | } |
| 710 | |
| 711 | /* Wrapper for psa_mac_verify_finish */ |
| 712 | psa_status_t mbedtls_test_wrap_psa_mac_verify_finish( |
| 713 | psa_mac_operation_t *arg0_operation, |
| 714 | const uint8_t *arg1_mac, |
| 715 | size_t arg2_mac_length) |
| 716 | { |
Thomas Daubney | 6b91503 | 2024-01-30 12:07:38 +0000 | [diff] [blame] | 717 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 718 | MBEDTLS_TEST_MEMORY_POISON(arg1_mac, arg2_mac_length); |
| 719 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 720 | psa_status_t status = (psa_mac_verify_finish)(arg0_operation, arg1_mac, arg2_mac_length); |
Thomas Daubney | 6b91503 | 2024-01-30 12:07:38 +0000 | [diff] [blame] | 721 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 722 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_mac, arg2_mac_length); |
| 723 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 724 | return status; |
| 725 | } |
| 726 | |
| 727 | /* Wrapper for psa_mac_verify_setup */ |
| 728 | psa_status_t mbedtls_test_wrap_psa_mac_verify_setup( |
| 729 | psa_mac_operation_t *arg0_operation, |
| 730 | mbedtls_svc_key_id_t arg1_key, |
| 731 | psa_algorithm_t arg2_alg) |
| 732 | { |
| 733 | psa_status_t status = (psa_mac_verify_setup)(arg0_operation, arg1_key, arg2_alg); |
| 734 | return status; |
| 735 | } |
| 736 | |
| 737 | /* Wrapper for psa_purge_key */ |
| 738 | psa_status_t mbedtls_test_wrap_psa_purge_key( |
| 739 | mbedtls_svc_key_id_t arg0_key) |
| 740 | { |
| 741 | psa_status_t status = (psa_purge_key)(arg0_key); |
| 742 | return status; |
| 743 | } |
| 744 | |
| 745 | /* Wrapper for psa_raw_key_agreement */ |
| 746 | psa_status_t mbedtls_test_wrap_psa_raw_key_agreement( |
| 747 | psa_algorithm_t arg0_alg, |
| 748 | mbedtls_svc_key_id_t arg1_private_key, |
| 749 | const uint8_t *arg2_peer_key, |
| 750 | size_t arg3_peer_key_length, |
| 751 | uint8_t *arg4_output, |
| 752 | size_t arg5_output_size, |
| 753 | size_t *arg6_output_length) |
| 754 | { |
| 755 | 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); |
| 756 | return status; |
| 757 | } |
| 758 | |
| 759 | /* Wrapper for psa_sign_hash */ |
| 760 | psa_status_t mbedtls_test_wrap_psa_sign_hash( |
| 761 | mbedtls_svc_key_id_t arg0_key, |
| 762 | psa_algorithm_t arg1_alg, |
| 763 | const uint8_t *arg2_hash, |
| 764 | size_t arg3_hash_length, |
| 765 | uint8_t *arg4_signature, |
| 766 | size_t arg5_signature_size, |
| 767 | size_t *arg6_signature_length) |
| 768 | { |
Thomas Daubney | c63e31a | 2024-01-30 13:33:14 +0000 | [diff] [blame] | 769 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 770 | MBEDTLS_TEST_MEMORY_POISON(arg2_hash, arg3_hash_length); |
| 771 | MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_size); |
| 772 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 773 | psa_status_t status = (psa_sign_hash)(arg0_key, arg1_alg, arg2_hash, arg3_hash_length, arg4_signature, arg5_signature_size, arg6_signature_length); |
Thomas Daubney | c63e31a | 2024-01-30 13:33:14 +0000 | [diff] [blame] | 774 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 775 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_hash, arg3_hash_length); |
| 776 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_size); |
| 777 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 778 | return status; |
| 779 | } |
| 780 | |
| 781 | /* Wrapper for psa_sign_message */ |
| 782 | psa_status_t mbedtls_test_wrap_psa_sign_message( |
| 783 | mbedtls_svc_key_id_t arg0_key, |
| 784 | psa_algorithm_t arg1_alg, |
| 785 | const uint8_t *arg2_input, |
| 786 | size_t arg3_input_length, |
| 787 | uint8_t *arg4_signature, |
| 788 | size_t arg5_signature_size, |
| 789 | size_t *arg6_signature_length) |
| 790 | { |
Thomas Daubney | c63e31a | 2024-01-30 13:33:14 +0000 | [diff] [blame] | 791 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 792 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 793 | MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_size); |
| 794 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 795 | psa_status_t status = (psa_sign_message)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_signature, arg5_signature_size, arg6_signature_length); |
Thomas Daubney | c63e31a | 2024-01-30 13:33:14 +0000 | [diff] [blame] | 796 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 797 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 798 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_size); |
| 799 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 800 | return status; |
| 801 | } |
| 802 | |
| 803 | /* Wrapper for psa_verify_hash */ |
| 804 | psa_status_t mbedtls_test_wrap_psa_verify_hash( |
| 805 | mbedtls_svc_key_id_t arg0_key, |
| 806 | psa_algorithm_t arg1_alg, |
| 807 | const uint8_t *arg2_hash, |
| 808 | size_t arg3_hash_length, |
| 809 | const uint8_t *arg4_signature, |
| 810 | size_t arg5_signature_length) |
| 811 | { |
Thomas Daubney | c63e31a | 2024-01-30 13:33:14 +0000 | [diff] [blame] | 812 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 813 | MBEDTLS_TEST_MEMORY_POISON(arg2_hash, arg3_hash_length); |
| 814 | MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_length); |
| 815 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 816 | psa_status_t status = (psa_verify_hash)(arg0_key, arg1_alg, arg2_hash, arg3_hash_length, arg4_signature, arg5_signature_length); |
Thomas Daubney | c63e31a | 2024-01-30 13:33:14 +0000 | [diff] [blame] | 817 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 818 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_hash, arg3_hash_length); |
| 819 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_length); |
| 820 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 821 | return status; |
| 822 | } |
| 823 | |
| 824 | /* Wrapper for psa_verify_message */ |
| 825 | psa_status_t mbedtls_test_wrap_psa_verify_message( |
| 826 | mbedtls_svc_key_id_t arg0_key, |
| 827 | psa_algorithm_t arg1_alg, |
| 828 | const uint8_t *arg2_input, |
| 829 | size_t arg3_input_length, |
| 830 | const uint8_t *arg4_signature, |
| 831 | size_t arg5_signature_length) |
| 832 | { |
Thomas Daubney | c63e31a | 2024-01-30 13:33:14 +0000 | [diff] [blame] | 833 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 834 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 835 | MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_length); |
| 836 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 837 | psa_status_t status = (psa_verify_message)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_signature, arg5_signature_length); |
Thomas Daubney | c63e31a | 2024-01-30 13:33:14 +0000 | [diff] [blame] | 838 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 839 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 840 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_length); |
| 841 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 842 | return status; |
| 843 | } |
| 844 | |
Gilles Peskine | a980aa0 | 2024-01-04 20:51:38 +0100 | [diff] [blame] | 845 | #endif /* defined(MBEDTLS_PSA_CRYPTO_C) && defined(MBEDTLS_TEST_HOOKS) && \ |
| 846 | !defined(RECORD_PSA_STATUS_COVERAGE_LOG) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 847 | |
| 848 | /* End of automatically generated file. */ |