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 | { |
Gabor Mezei | 50bcca2 | 2024-02-01 10:39:56 +0100 | [diff] [blame^] | 263 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 264 | MBEDTLS_TEST_MEMORY_POISON(arg1_iv, arg2_iv_size); |
| 265 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 266 | psa_status_t status = (psa_cipher_generate_iv)(arg0_operation, arg1_iv, arg2_iv_size, arg3_iv_length); |
Gabor Mezei | 50bcca2 | 2024-02-01 10:39:56 +0100 | [diff] [blame^] | 267 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 268 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_iv, arg2_iv_size); |
| 269 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 270 | return status; |
| 271 | } |
| 272 | |
| 273 | /* Wrapper for psa_cipher_set_iv */ |
| 274 | psa_status_t mbedtls_test_wrap_psa_cipher_set_iv( |
| 275 | psa_cipher_operation_t *arg0_operation, |
| 276 | const uint8_t *arg1_iv, |
| 277 | size_t arg2_iv_length) |
| 278 | { |
Gabor Mezei | 50bcca2 | 2024-02-01 10:39:56 +0100 | [diff] [blame^] | 279 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 280 | MBEDTLS_TEST_MEMORY_POISON(arg1_iv, arg2_iv_length); |
| 281 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 282 | psa_status_t status = (psa_cipher_set_iv)(arg0_operation, arg1_iv, arg2_iv_length); |
Gabor Mezei | 50bcca2 | 2024-02-01 10:39:56 +0100 | [diff] [blame^] | 283 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 284 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_iv, arg2_iv_length); |
| 285 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 286 | return status; |
| 287 | } |
| 288 | |
| 289 | /* Wrapper for psa_cipher_update */ |
| 290 | psa_status_t mbedtls_test_wrap_psa_cipher_update( |
| 291 | psa_cipher_operation_t *arg0_operation, |
| 292 | const uint8_t *arg1_input, |
| 293 | size_t arg2_input_length, |
| 294 | uint8_t *arg3_output, |
| 295 | size_t arg4_output_size, |
| 296 | size_t *arg5_output_length) |
| 297 | { |
Gabor Mezei | 143864c | 2024-01-24 16:58:40 +0100 | [diff] [blame] | 298 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 299 | MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length); |
| 300 | MBEDTLS_TEST_MEMORY_POISON(arg3_output, arg4_output_size); |
| 301 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 302 | 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] | 303 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 304 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length); |
| 305 | MBEDTLS_TEST_MEMORY_UNPOISON(arg3_output, arg4_output_size); |
| 306 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 307 | return status; |
| 308 | } |
| 309 | |
| 310 | /* Wrapper for psa_copy_key */ |
| 311 | psa_status_t mbedtls_test_wrap_psa_copy_key( |
| 312 | mbedtls_svc_key_id_t arg0_source_key, |
| 313 | const psa_key_attributes_t *arg1_attributes, |
| 314 | mbedtls_svc_key_id_t *arg2_target_key) |
| 315 | { |
| 316 | psa_status_t status = (psa_copy_key)(arg0_source_key, arg1_attributes, arg2_target_key); |
| 317 | return status; |
| 318 | } |
| 319 | |
| 320 | /* Wrapper for psa_crypto_init */ |
| 321 | psa_status_t mbedtls_test_wrap_psa_crypto_init(void) |
| 322 | { |
| 323 | psa_status_t status = (psa_crypto_init)(); |
| 324 | return status; |
| 325 | } |
| 326 | |
| 327 | /* Wrapper for psa_destroy_key */ |
| 328 | psa_status_t mbedtls_test_wrap_psa_destroy_key( |
| 329 | mbedtls_svc_key_id_t arg0_key) |
| 330 | { |
| 331 | psa_status_t status = (psa_destroy_key)(arg0_key); |
| 332 | return status; |
| 333 | } |
| 334 | |
| 335 | /* Wrapper for psa_export_key */ |
| 336 | psa_status_t mbedtls_test_wrap_psa_export_key( |
| 337 | mbedtls_svc_key_id_t arg0_key, |
| 338 | uint8_t *arg1_data, |
| 339 | size_t arg2_data_size, |
| 340 | size_t *arg3_data_length) |
| 341 | { |
Ryan Everett | dcbc1d3 | 2024-01-25 11:04:48 +0000 | [diff] [blame] | 342 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 343 | MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_size); |
| 344 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 345 | 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] | 346 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 347 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_size); |
| 348 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 349 | return status; |
| 350 | } |
| 351 | |
| 352 | /* Wrapper for psa_export_public_key */ |
| 353 | psa_status_t mbedtls_test_wrap_psa_export_public_key( |
| 354 | mbedtls_svc_key_id_t arg0_key, |
| 355 | uint8_t *arg1_data, |
| 356 | size_t arg2_data_size, |
| 357 | size_t *arg3_data_length) |
| 358 | { |
Ryan Everett | dcbc1d3 | 2024-01-25 11:04:48 +0000 | [diff] [blame] | 359 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 360 | MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_size); |
| 361 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 362 | 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] | 363 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 364 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_size); |
| 365 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 366 | return status; |
| 367 | } |
| 368 | |
| 369 | /* Wrapper for psa_generate_key */ |
| 370 | psa_status_t mbedtls_test_wrap_psa_generate_key( |
| 371 | const psa_key_attributes_t *arg0_attributes, |
| 372 | mbedtls_svc_key_id_t *arg1_key) |
| 373 | { |
| 374 | psa_status_t status = (psa_generate_key)(arg0_attributes, arg1_key); |
| 375 | return status; |
| 376 | } |
| 377 | |
| 378 | /* Wrapper for psa_generate_random */ |
| 379 | psa_status_t mbedtls_test_wrap_psa_generate_random( |
| 380 | uint8_t *arg0_output, |
| 381 | size_t arg1_output_size) |
| 382 | { |
| 383 | psa_status_t status = (psa_generate_random)(arg0_output, arg1_output_size); |
| 384 | return status; |
| 385 | } |
| 386 | |
| 387 | /* Wrapper for psa_get_key_attributes */ |
| 388 | psa_status_t mbedtls_test_wrap_psa_get_key_attributes( |
| 389 | mbedtls_svc_key_id_t arg0_key, |
| 390 | psa_key_attributes_t *arg1_attributes) |
| 391 | { |
| 392 | psa_status_t status = (psa_get_key_attributes)(arg0_key, arg1_attributes); |
| 393 | return status; |
| 394 | } |
| 395 | |
| 396 | /* Wrapper for psa_hash_abort */ |
| 397 | psa_status_t mbedtls_test_wrap_psa_hash_abort( |
| 398 | psa_hash_operation_t *arg0_operation) |
| 399 | { |
| 400 | psa_status_t status = (psa_hash_abort)(arg0_operation); |
| 401 | return status; |
| 402 | } |
| 403 | |
| 404 | /* Wrapper for psa_hash_clone */ |
| 405 | psa_status_t mbedtls_test_wrap_psa_hash_clone( |
| 406 | const psa_hash_operation_t *arg0_source_operation, |
| 407 | psa_hash_operation_t *arg1_target_operation) |
| 408 | { |
| 409 | psa_status_t status = (psa_hash_clone)(arg0_source_operation, arg1_target_operation); |
| 410 | return status; |
| 411 | } |
| 412 | |
| 413 | /* Wrapper for psa_hash_compare */ |
| 414 | psa_status_t mbedtls_test_wrap_psa_hash_compare( |
| 415 | psa_algorithm_t arg0_alg, |
| 416 | const uint8_t *arg1_input, |
| 417 | size_t arg2_input_length, |
| 418 | const uint8_t *arg3_hash, |
| 419 | size_t arg4_hash_length) |
| 420 | { |
Thomas Daubney | ebf9329 | 2024-01-25 17:09:10 +0000 | [diff] [blame] | 421 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 422 | MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length); |
| 423 | MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_length); |
| 424 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 425 | 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] | 426 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 427 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length); |
| 428 | MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_length); |
| 429 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 430 | return status; |
| 431 | } |
| 432 | |
| 433 | /* Wrapper for psa_hash_compute */ |
| 434 | psa_status_t mbedtls_test_wrap_psa_hash_compute( |
| 435 | psa_algorithm_t arg0_alg, |
| 436 | const uint8_t *arg1_input, |
| 437 | size_t arg2_input_length, |
| 438 | uint8_t *arg3_hash, |
| 439 | size_t arg4_hash_size, |
| 440 | size_t *arg5_hash_length) |
| 441 | { |
Thomas Daubney | ebf9329 | 2024-01-25 17:09:10 +0000 | [diff] [blame] | 442 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 443 | MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length); |
| 444 | MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_size); |
| 445 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 446 | 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] | 447 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 448 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length); |
| 449 | MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_size); |
| 450 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 451 | return status; |
| 452 | } |
| 453 | |
| 454 | /* Wrapper for psa_hash_finish */ |
| 455 | psa_status_t mbedtls_test_wrap_psa_hash_finish( |
| 456 | psa_hash_operation_t *arg0_operation, |
| 457 | uint8_t *arg1_hash, |
| 458 | size_t arg2_hash_size, |
| 459 | size_t *arg3_hash_length) |
| 460 | { |
Thomas Daubney | ebf9329 | 2024-01-25 17:09:10 +0000 | [diff] [blame] | 461 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 462 | MBEDTLS_TEST_MEMORY_POISON(arg1_hash, arg2_hash_size); |
| 463 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 464 | 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] | 465 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 466 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_hash, arg2_hash_size); |
| 467 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 468 | return status; |
| 469 | } |
| 470 | |
| 471 | /* Wrapper for psa_hash_setup */ |
| 472 | psa_status_t mbedtls_test_wrap_psa_hash_setup( |
| 473 | psa_hash_operation_t *arg0_operation, |
| 474 | psa_algorithm_t arg1_alg) |
| 475 | { |
| 476 | psa_status_t status = (psa_hash_setup)(arg0_operation, arg1_alg); |
| 477 | return status; |
| 478 | } |
| 479 | |
| 480 | /* Wrapper for psa_hash_update */ |
| 481 | psa_status_t mbedtls_test_wrap_psa_hash_update( |
| 482 | psa_hash_operation_t *arg0_operation, |
| 483 | const uint8_t *arg1_input, |
| 484 | size_t arg2_input_length) |
| 485 | { |
Thomas Daubney | ebf9329 | 2024-01-25 17:09:10 +0000 | [diff] [blame] | 486 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 487 | MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length); |
| 488 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 489 | 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] | 490 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 491 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length); |
| 492 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 493 | return status; |
| 494 | } |
| 495 | |
| 496 | /* Wrapper for psa_hash_verify */ |
| 497 | psa_status_t mbedtls_test_wrap_psa_hash_verify( |
| 498 | psa_hash_operation_t *arg0_operation, |
| 499 | const uint8_t *arg1_hash, |
| 500 | size_t arg2_hash_length) |
| 501 | { |
Thomas Daubney | ebf9329 | 2024-01-25 17:09:10 +0000 | [diff] [blame] | 502 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 503 | MBEDTLS_TEST_MEMORY_POISON(arg1_hash, arg2_hash_length); |
| 504 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 505 | 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] | 506 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 507 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_hash, arg2_hash_length); |
| 508 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 509 | return status; |
| 510 | } |
| 511 | |
| 512 | /* Wrapper for psa_import_key */ |
| 513 | psa_status_t mbedtls_test_wrap_psa_import_key( |
| 514 | const psa_key_attributes_t *arg0_attributes, |
| 515 | const uint8_t *arg1_data, |
| 516 | size_t arg2_data_length, |
| 517 | mbedtls_svc_key_id_t *arg3_key) |
| 518 | { |
Ryan Everett | dcbc1d3 | 2024-01-25 11:04:48 +0000 | [diff] [blame] | 519 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 520 | MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_length); |
| 521 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 522 | 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] | 523 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 524 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_length); |
| 525 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 526 | return status; |
| 527 | } |
| 528 | |
| 529 | /* Wrapper for psa_key_derivation_abort */ |
| 530 | psa_status_t mbedtls_test_wrap_psa_key_derivation_abort( |
| 531 | psa_key_derivation_operation_t *arg0_operation) |
| 532 | { |
| 533 | psa_status_t status = (psa_key_derivation_abort)(arg0_operation); |
| 534 | return status; |
| 535 | } |
| 536 | |
| 537 | /* Wrapper for psa_key_derivation_get_capacity */ |
| 538 | psa_status_t mbedtls_test_wrap_psa_key_derivation_get_capacity( |
| 539 | const psa_key_derivation_operation_t *arg0_operation, |
| 540 | size_t *arg1_capacity) |
| 541 | { |
| 542 | psa_status_t status = (psa_key_derivation_get_capacity)(arg0_operation, arg1_capacity); |
| 543 | return status; |
| 544 | } |
| 545 | |
| 546 | /* Wrapper for psa_key_derivation_input_bytes */ |
| 547 | psa_status_t mbedtls_test_wrap_psa_key_derivation_input_bytes( |
| 548 | psa_key_derivation_operation_t *arg0_operation, |
| 549 | psa_key_derivation_step_t arg1_step, |
| 550 | const uint8_t *arg2_data, |
| 551 | size_t arg3_data_length) |
| 552 | { |
Ryan Everett | 6c9e69d | 2024-02-09 16:23:25 +0000 | [diff] [blame] | 553 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 554 | MBEDTLS_TEST_MEMORY_POISON(arg2_data, arg3_data_length); |
| 555 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 556 | 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] | 557 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 558 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_data, arg3_data_length); |
| 559 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 560 | return status; |
| 561 | } |
| 562 | |
| 563 | /* Wrapper for psa_key_derivation_input_key */ |
| 564 | psa_status_t mbedtls_test_wrap_psa_key_derivation_input_key( |
| 565 | psa_key_derivation_operation_t *arg0_operation, |
| 566 | psa_key_derivation_step_t arg1_step, |
| 567 | mbedtls_svc_key_id_t arg2_key) |
| 568 | { |
| 569 | psa_status_t status = (psa_key_derivation_input_key)(arg0_operation, arg1_step, arg2_key); |
| 570 | return status; |
| 571 | } |
| 572 | |
| 573 | /* Wrapper for psa_key_derivation_key_agreement */ |
| 574 | psa_status_t mbedtls_test_wrap_psa_key_derivation_key_agreement( |
| 575 | psa_key_derivation_operation_t *arg0_operation, |
| 576 | psa_key_derivation_step_t arg1_step, |
| 577 | mbedtls_svc_key_id_t arg2_private_key, |
| 578 | const uint8_t *arg3_peer_key, |
| 579 | size_t arg4_peer_key_length) |
| 580 | { |
| 581 | psa_status_t status = (psa_key_derivation_key_agreement)(arg0_operation, arg1_step, arg2_private_key, arg3_peer_key, arg4_peer_key_length); |
| 582 | return status; |
| 583 | } |
| 584 | |
| 585 | /* Wrapper for psa_key_derivation_output_bytes */ |
| 586 | psa_status_t mbedtls_test_wrap_psa_key_derivation_output_bytes( |
| 587 | psa_key_derivation_operation_t *arg0_operation, |
| 588 | uint8_t *arg1_output, |
| 589 | size_t arg2_output_length) |
| 590 | { |
Ryan Everett | 6c9e69d | 2024-02-09 16:23:25 +0000 | [diff] [blame] | 591 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 592 | MBEDTLS_TEST_MEMORY_POISON(arg1_output, arg2_output_length); |
| 593 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 594 | 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] | 595 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 596 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_output, arg2_output_length); |
| 597 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 598 | return status; |
| 599 | } |
| 600 | |
| 601 | /* Wrapper for psa_key_derivation_output_key */ |
| 602 | psa_status_t mbedtls_test_wrap_psa_key_derivation_output_key( |
| 603 | const psa_key_attributes_t *arg0_attributes, |
| 604 | psa_key_derivation_operation_t *arg1_operation, |
| 605 | mbedtls_svc_key_id_t *arg2_key) |
| 606 | { |
| 607 | psa_status_t status = (psa_key_derivation_output_key)(arg0_attributes, arg1_operation, arg2_key); |
| 608 | return status; |
| 609 | } |
| 610 | |
| 611 | /* Wrapper for psa_key_derivation_set_capacity */ |
| 612 | psa_status_t mbedtls_test_wrap_psa_key_derivation_set_capacity( |
| 613 | psa_key_derivation_operation_t *arg0_operation, |
| 614 | size_t arg1_capacity) |
| 615 | { |
| 616 | psa_status_t status = (psa_key_derivation_set_capacity)(arg0_operation, arg1_capacity); |
| 617 | return status; |
| 618 | } |
| 619 | |
| 620 | /* Wrapper for psa_key_derivation_setup */ |
| 621 | psa_status_t mbedtls_test_wrap_psa_key_derivation_setup( |
| 622 | psa_key_derivation_operation_t *arg0_operation, |
| 623 | psa_algorithm_t arg1_alg) |
| 624 | { |
| 625 | psa_status_t status = (psa_key_derivation_setup)(arg0_operation, arg1_alg); |
| 626 | return status; |
| 627 | } |
| 628 | |
| 629 | /* Wrapper for psa_mac_abort */ |
| 630 | psa_status_t mbedtls_test_wrap_psa_mac_abort( |
| 631 | psa_mac_operation_t *arg0_operation) |
| 632 | { |
| 633 | psa_status_t status = (psa_mac_abort)(arg0_operation); |
| 634 | return status; |
| 635 | } |
| 636 | |
| 637 | /* Wrapper for psa_mac_compute */ |
| 638 | psa_status_t mbedtls_test_wrap_psa_mac_compute( |
| 639 | mbedtls_svc_key_id_t arg0_key, |
| 640 | psa_algorithm_t arg1_alg, |
| 641 | const uint8_t *arg2_input, |
| 642 | size_t arg3_input_length, |
| 643 | uint8_t *arg4_mac, |
| 644 | size_t arg5_mac_size, |
| 645 | size_t *arg6_mac_length) |
| 646 | { |
Thomas Daubney | 6b91503 | 2024-01-30 12:07:38 +0000 | [diff] [blame] | 647 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 648 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 649 | MBEDTLS_TEST_MEMORY_POISON(arg4_mac, arg5_mac_size); |
| 650 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 651 | 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] | 652 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 653 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 654 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_mac, arg5_mac_size); |
| 655 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 656 | return status; |
| 657 | } |
| 658 | |
| 659 | /* Wrapper for psa_mac_sign_finish */ |
| 660 | psa_status_t mbedtls_test_wrap_psa_mac_sign_finish( |
| 661 | psa_mac_operation_t *arg0_operation, |
| 662 | uint8_t *arg1_mac, |
| 663 | size_t arg2_mac_size, |
| 664 | size_t *arg3_mac_length) |
| 665 | { |
Thomas Daubney | 6b91503 | 2024-01-30 12:07:38 +0000 | [diff] [blame] | 666 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 667 | MBEDTLS_TEST_MEMORY_POISON(arg1_mac, arg2_mac_size); |
| 668 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 669 | 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] | 670 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 671 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_mac, arg2_mac_size); |
| 672 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 673 | return status; |
| 674 | } |
| 675 | |
| 676 | /* Wrapper for psa_mac_sign_setup */ |
| 677 | psa_status_t mbedtls_test_wrap_psa_mac_sign_setup( |
| 678 | psa_mac_operation_t *arg0_operation, |
| 679 | mbedtls_svc_key_id_t arg1_key, |
| 680 | psa_algorithm_t arg2_alg) |
| 681 | { |
| 682 | psa_status_t status = (psa_mac_sign_setup)(arg0_operation, arg1_key, arg2_alg); |
| 683 | return status; |
| 684 | } |
| 685 | |
| 686 | /* Wrapper for psa_mac_update */ |
| 687 | psa_status_t mbedtls_test_wrap_psa_mac_update( |
| 688 | psa_mac_operation_t *arg0_operation, |
| 689 | const uint8_t *arg1_input, |
| 690 | size_t arg2_input_length) |
| 691 | { |
Thomas Daubney | 6b91503 | 2024-01-30 12:07:38 +0000 | [diff] [blame] | 692 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 693 | MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length); |
| 694 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 695 | 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] | 696 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 697 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length); |
| 698 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 699 | return status; |
| 700 | } |
| 701 | |
| 702 | /* Wrapper for psa_mac_verify */ |
| 703 | psa_status_t mbedtls_test_wrap_psa_mac_verify( |
| 704 | mbedtls_svc_key_id_t arg0_key, |
| 705 | psa_algorithm_t arg1_alg, |
| 706 | const uint8_t *arg2_input, |
| 707 | size_t arg3_input_length, |
| 708 | const uint8_t *arg4_mac, |
| 709 | size_t arg5_mac_length) |
| 710 | { |
Thomas Daubney | 6b91503 | 2024-01-30 12:07:38 +0000 | [diff] [blame] | 711 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 712 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 713 | MBEDTLS_TEST_MEMORY_POISON(arg4_mac, arg5_mac_length); |
| 714 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 715 | 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] | 716 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 717 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 718 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_mac, arg5_mac_length); |
| 719 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 720 | return status; |
| 721 | } |
| 722 | |
| 723 | /* Wrapper for psa_mac_verify_finish */ |
| 724 | psa_status_t mbedtls_test_wrap_psa_mac_verify_finish( |
| 725 | psa_mac_operation_t *arg0_operation, |
| 726 | const uint8_t *arg1_mac, |
| 727 | size_t arg2_mac_length) |
| 728 | { |
Thomas Daubney | 6b91503 | 2024-01-30 12:07:38 +0000 | [diff] [blame] | 729 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 730 | MBEDTLS_TEST_MEMORY_POISON(arg1_mac, arg2_mac_length); |
| 731 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 732 | 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] | 733 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 734 | MBEDTLS_TEST_MEMORY_UNPOISON(arg1_mac, arg2_mac_length); |
| 735 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 736 | return status; |
| 737 | } |
| 738 | |
| 739 | /* Wrapper for psa_mac_verify_setup */ |
| 740 | psa_status_t mbedtls_test_wrap_psa_mac_verify_setup( |
| 741 | psa_mac_operation_t *arg0_operation, |
| 742 | mbedtls_svc_key_id_t arg1_key, |
| 743 | psa_algorithm_t arg2_alg) |
| 744 | { |
| 745 | psa_status_t status = (psa_mac_verify_setup)(arg0_operation, arg1_key, arg2_alg); |
| 746 | return status; |
| 747 | } |
| 748 | |
| 749 | /* Wrapper for psa_purge_key */ |
| 750 | psa_status_t mbedtls_test_wrap_psa_purge_key( |
| 751 | mbedtls_svc_key_id_t arg0_key) |
| 752 | { |
| 753 | psa_status_t status = (psa_purge_key)(arg0_key); |
| 754 | return status; |
| 755 | } |
| 756 | |
| 757 | /* Wrapper for psa_raw_key_agreement */ |
| 758 | psa_status_t mbedtls_test_wrap_psa_raw_key_agreement( |
| 759 | psa_algorithm_t arg0_alg, |
| 760 | mbedtls_svc_key_id_t arg1_private_key, |
| 761 | const uint8_t *arg2_peer_key, |
| 762 | size_t arg3_peer_key_length, |
| 763 | uint8_t *arg4_output, |
| 764 | size_t arg5_output_size, |
| 765 | size_t *arg6_output_length) |
| 766 | { |
| 767 | 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); |
| 768 | return status; |
| 769 | } |
| 770 | |
| 771 | /* Wrapper for psa_sign_hash */ |
| 772 | psa_status_t mbedtls_test_wrap_psa_sign_hash( |
| 773 | mbedtls_svc_key_id_t arg0_key, |
| 774 | psa_algorithm_t arg1_alg, |
| 775 | const uint8_t *arg2_hash, |
| 776 | size_t arg3_hash_length, |
| 777 | uint8_t *arg4_signature, |
| 778 | size_t arg5_signature_size, |
| 779 | size_t *arg6_signature_length) |
| 780 | { |
Thomas Daubney | c63e31a | 2024-01-30 13:33:14 +0000 | [diff] [blame] | 781 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 782 | MBEDTLS_TEST_MEMORY_POISON(arg2_hash, arg3_hash_length); |
| 783 | MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_size); |
| 784 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 785 | 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] | 786 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 787 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_hash, arg3_hash_length); |
| 788 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_size); |
| 789 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 790 | return status; |
| 791 | } |
| 792 | |
| 793 | /* Wrapper for psa_sign_message */ |
| 794 | psa_status_t mbedtls_test_wrap_psa_sign_message( |
| 795 | mbedtls_svc_key_id_t arg0_key, |
| 796 | psa_algorithm_t arg1_alg, |
| 797 | const uint8_t *arg2_input, |
| 798 | size_t arg3_input_length, |
| 799 | uint8_t *arg4_signature, |
| 800 | size_t arg5_signature_size, |
| 801 | size_t *arg6_signature_length) |
| 802 | { |
Thomas Daubney | c63e31a | 2024-01-30 13:33:14 +0000 | [diff] [blame] | 803 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 804 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 805 | MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_size); |
| 806 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 807 | 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] | 808 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 809 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 810 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_size); |
| 811 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 812 | return status; |
| 813 | } |
| 814 | |
| 815 | /* Wrapper for psa_verify_hash */ |
| 816 | psa_status_t mbedtls_test_wrap_psa_verify_hash( |
| 817 | mbedtls_svc_key_id_t arg0_key, |
| 818 | psa_algorithm_t arg1_alg, |
| 819 | const uint8_t *arg2_hash, |
| 820 | size_t arg3_hash_length, |
| 821 | const uint8_t *arg4_signature, |
| 822 | size_t arg5_signature_length) |
| 823 | { |
Thomas Daubney | c63e31a | 2024-01-30 13:33:14 +0000 | [diff] [blame] | 824 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 825 | MBEDTLS_TEST_MEMORY_POISON(arg2_hash, arg3_hash_length); |
| 826 | MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_length); |
| 827 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 828 | 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] | 829 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 830 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_hash, arg3_hash_length); |
| 831 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_length); |
| 832 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 833 | return status; |
| 834 | } |
| 835 | |
| 836 | /* Wrapper for psa_verify_message */ |
| 837 | psa_status_t mbedtls_test_wrap_psa_verify_message( |
| 838 | mbedtls_svc_key_id_t arg0_key, |
| 839 | psa_algorithm_t arg1_alg, |
| 840 | const uint8_t *arg2_input, |
| 841 | size_t arg3_input_length, |
| 842 | const uint8_t *arg4_signature, |
| 843 | size_t arg5_signature_length) |
| 844 | { |
Thomas Daubney | c63e31a | 2024-01-30 13:33:14 +0000 | [diff] [blame] | 845 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 846 | MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); |
| 847 | MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_length); |
| 848 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 849 | 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] | 850 | #if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) |
| 851 | MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); |
| 852 | MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_length); |
| 853 | #endif /* defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 854 | return status; |
| 855 | } |
| 856 | |
Gilles Peskine | a980aa0 | 2024-01-04 20:51:38 +0100 | [diff] [blame] | 857 | #endif /* defined(MBEDTLS_PSA_CRYPTO_C) && defined(MBEDTLS_TEST_HOOKS) && \ |
| 858 | !defined(RECORD_PSA_STATUS_COVERAGE_LOG) */ |
Gilles Peskine | d5e5e6d | 2024-01-04 16:42:40 +0100 | [diff] [blame] | 859 | |
| 860 | /* End of automatically generated file. */ |