diff --git a/CMakeLists.txt b/CMakeLists.txt index 692629fc1b..1600756782 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -352,7 +352,29 @@ if(ENABLE_TESTING OR ENABLE_PROGRAMS) ${CMAKE_CURRENT_SOURCE_DIR}/framework/tests/src/*.c ${CMAKE_CURRENT_SOURCE_DIR}/framework/tests/src/drivers/*.c) add_library(mbedtls_test OBJECT ${MBEDTLS_TEST_FILES}) + if(GEN_FILES) + add_custom_command( + OUTPUT + ${CMAKE_CURRENT_BINARY_DIR}/tests/include/test/psa_test_wrappers.h + ${CMAKE_CURRENT_BINARY_DIR}/tests/src/psa_test_wrappers.c + COMMAND ${CMAKE_COMMAND} -E make_directory + ${CMAKE_CURRENT_BINARY_DIR}/tests/include/test + ${CMAKE_CURRENT_BINARY_DIR}/tests/src + COMMAND + "${MBEDTLS_PYTHON_EXECUTABLE}" + "${CMAKE_CURRENT_SOURCE_DIR}/framework/scripts/generate_psa_wrappers.py" + "--output-h" "${CMAKE_CURRENT_BINARY_DIR}/tests/include/test/psa_test_wrappers.h" + "--output-c" "${CMAKE_CURRENT_BINARY_DIR}/tests/src/psa_test_wrappers.c" + DEPENDS + ${CMAKE_CURRENT_SOURCE_DIR}/framework/scripts/generate_psa_wrappers.py + ) + add_custom_target(psa_test_wrappers + DEPENDS + ${CMAKE_CURRENT_BINARY_DIR}/tests/include/test/psa_test_wrappers.h + ${CMAKE_CURRENT_BINARY_DIR}/tests/src/psa_test_wrappers.c) + add_dependencies(mbedtls_test psa_test_wrappers) + add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tests/include/test/test_keys.h @@ -367,6 +389,8 @@ if(ENABLE_TESTING OR ENABLE_PROGRAMS) ) add_custom_target(test_keys_header DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/tests/include/test/test_keys.h) + add_dependencies(mbedtls_test test_keys_header) + add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tests/include/test/test_certs.h @@ -382,8 +406,9 @@ if(ENABLE_TESTING OR ENABLE_PROGRAMS) ${CMAKE_CURRENT_SOURCE_DIR}/framework/scripts/generate_test_cert_macros.py ) add_custom_target(test_certs_header DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/tests/include/test/test_certs.h) - add_dependencies(mbedtls_test test_keys_header test_certs_header) + add_dependencies(mbedtls_test test_certs_header) endif() + target_include_directories(mbedtls_test PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/tests/include PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/framework/tests/include diff --git a/docs/architecture/psa-shared-memory.md b/docs/architecture/psa-shared-memory.md index 283ffc6265..89f9eede7a 100644 --- a/docs/architecture/psa-shared-memory.md +++ b/docs/architecture/psa-shared-memory.md @@ -663,7 +663,7 @@ psa_status_t mem_poison_psa_aead_update(psa_aead_operation_t *operation, There now exists a more generic mechanism for making exactly this kind of transformation - the PSA test wrappers, which exist in the files `tests/include/test/psa_test_wrappers.h` and `tests/src/psa_test_wrappers.c`. These are wrappers around all PSA functions that allow testing code to be inserted at the start and end of a PSA function call. -The test wrappers are generated by a script, although they are not automatically generated as part of the build process. Instead, they are checked into source control and must be manually updated when functions change by running `framework/scripts/generate_psa_wrappers.py`. +The test wrappers are generated by a script `framework/scripts/generate_psa_wrappers.py` as part of the product build. Poisoning code is added to these test wrappers where relevant in order to pre-poison and post-unpoison the parameters to the functions. diff --git a/scripts/make_generated_files.bat b/scripts/make_generated_files.bat index f9c2ad1d57..cd96e67b0b 100644 --- a/scripts/make_generated_files.bat +++ b/scripts/make_generated_files.bat @@ -23,6 +23,7 @@ python framework\scripts\generate_bignum_tests.py || exit /b 1 python framework\scripts\generate_config_tests.py || exit /b 1 python framework\scripts\generate_ecp_tests.py || exit /b 1 python framework\scripts\generate_psa_tests.py || exit /b 1 +python framework\scripts\generate_psa_wrappers.py || exit /b 1 python framework\scripts\generate_test_keys.py --output tests\include\test\test_keys.h || exit /b 1 python framework\scripts\generate_test_cert_macros.py --output tests\include\test\test_certs.h || exit /b 1 python scripts\generate_tls_handshake_tests.py || exit /b 1 diff --git a/tests/.gitignore b/tests/.gitignore index d32d367c46..58d4e4897e 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -20,11 +20,13 @@ # Generated source files /opt-testcases/handshake-generated.sh /opt-testcases/tls13-compat.sh +/src/psa_test_wrappers.c /suites/*.generated.data /suites/test_suite_config.mbedtls_boolean.data /suites/test_suite_config.psa_boolean.data /suites/test_suite_psa_crypto_storage_format.v[0-9]*.data /suites/test_suite_psa_crypto_storage_format.current.data +/include/test/psa_test_wrappers.h /include/test/test_keys.h /include/test/test_certs.h ###END_GENERATED_FILES### diff --git a/tests/Makefile b/tests/Makefile index 7fe7171149..a4c7c227bb 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -54,6 +54,7 @@ GENERATED_DATA_FILES += $(GENERATED_PSA_DATA_FILES) GENERATED_FILES = $(GENERATED_DATA_FILES) GENERATED_FILES += include/test/test_keys.h include/test/test_certs.h +GENERATED_FILES += include/test/psa_test_wrappers.h src/psa_test_wrappers.c # Generated files needed to (fully) run ssl-opt.sh .PHONY: ssl-opt @@ -164,6 +165,10 @@ all: $(BINARIES) mbedtls_test: $(MBEDTLS_TEST_OBJS) +include/test/psa_test_wrappers.h src/psa_test_wrappers.c: ../framework/scripts/generate_psa_wrappers.py + echo " Gen $@" + cd .. && $(PYTHON) framework/scripts/generate_psa_wrappers.py + include/test/test_certs.h: ../framework/scripts/generate_test_cert_macros.py \ $($(PYTHON) ../framework/scripts/generate_test_cert_macros.py --list-dependencies) echo " Gen $@" @@ -180,6 +185,7 @@ ifdef RECORD_PSA_STATUS_COVERAGE_LOG # therefore the wildcard enumeration above doesn't include it. TEST_OBJS_DEPS += ../framework/tests/include/test/instrument_record_status.h endif +TEST_OBJS_DEPS += include/test/psa_test_wrappers.h TEST_OBJS_DEPS += include/test/test_certs.h include/test/test_keys.h # Rule to compile common test C files in framework diff --git a/tests/include/test/psa_test_wrappers.h b/tests/include/test/psa_test_wrappers.h deleted file mode 100644 index 134a547c85..0000000000 --- a/tests/include/test/psa_test_wrappers.h +++ /dev/null @@ -1,789 +0,0 @@ -/* Automatically generated by generate_psa_wrappers.py, do not edit! */ - -/* Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later - */ - -#ifndef TEST_PSA_TEST_WRAPPERS_H -#define TEST_PSA_TEST_WRAPPERS_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#if defined(MBEDTLS_PSA_CRYPTO_C) && defined(MBEDTLS_TEST_HOOKS) && \ - !defined(RECORD_PSA_STATUS_COVERAGE_LOG) - -#include -#include -#include -#include - -#if defined(MBEDTLS_PSA_INJECT_ENTROPY) -psa_status_t mbedtls_test_wrap_mbedtls_psa_inject_entropy( - const uint8_t *arg0_seed, - size_t arg1_seed_size); -#define mbedtls_psa_inject_entropy(arg0_seed, arg1_seed_size) \ - mbedtls_test_wrap_mbedtls_psa_inject_entropy(arg0_seed, arg1_seed_size) -#endif /* defined(MBEDTLS_PSA_INJECT_ENTROPY) */ - -#if defined(MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS) -psa_status_t mbedtls_test_wrap_mbedtls_psa_platform_get_builtin_key( - mbedtls_svc_key_id_t arg0_key_id, - psa_key_lifetime_t *arg1_lifetime, - psa_drv_slot_number_t *arg2_slot_number); -#define mbedtls_psa_platform_get_builtin_key(arg0_key_id, arg1_lifetime, arg2_slot_number) \ - mbedtls_test_wrap_mbedtls_psa_platform_get_builtin_key(arg0_key_id, arg1_lifetime, arg2_slot_number) -#endif /* defined(MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS) */ - -#if defined(MBEDTLS_PSA_CRYPTO_SE_C) -psa_status_t mbedtls_test_wrap_mbedtls_psa_register_se_key( - const psa_key_attributes_t *arg0_attributes); -#define mbedtls_psa_register_se_key(arg0_attributes) \ - mbedtls_test_wrap_mbedtls_psa_register_se_key(arg0_attributes) -#endif /* defined(MBEDTLS_PSA_CRYPTO_SE_C) */ - -psa_status_t mbedtls_test_wrap_psa_aead_abort( - psa_aead_operation_t *arg0_operation); -#define psa_aead_abort(arg0_operation) \ - mbedtls_test_wrap_psa_aead_abort(arg0_operation) - -psa_status_t mbedtls_test_wrap_psa_aead_decrypt( - mbedtls_svc_key_id_t arg0_key, - psa_algorithm_t arg1_alg, - const uint8_t *arg2_nonce, - size_t arg3_nonce_length, - const uint8_t *arg4_additional_data, - size_t arg5_additional_data_length, - const uint8_t *arg6_ciphertext, - size_t arg7_ciphertext_length, - uint8_t *arg8_plaintext, - size_t arg9_plaintext_size, - size_t *arg10_plaintext_length); -#define 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) \ - mbedtls_test_wrap_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) - -psa_status_t mbedtls_test_wrap_psa_aead_decrypt_setup( - psa_aead_operation_t *arg0_operation, - mbedtls_svc_key_id_t arg1_key, - psa_algorithm_t arg2_alg); -#define psa_aead_decrypt_setup(arg0_operation, arg1_key, arg2_alg) \ - mbedtls_test_wrap_psa_aead_decrypt_setup(arg0_operation, arg1_key, arg2_alg) - -psa_status_t mbedtls_test_wrap_psa_aead_encrypt( - mbedtls_svc_key_id_t arg0_key, - psa_algorithm_t arg1_alg, - const uint8_t *arg2_nonce, - size_t arg3_nonce_length, - const uint8_t *arg4_additional_data, - size_t arg5_additional_data_length, - const uint8_t *arg6_plaintext, - size_t arg7_plaintext_length, - uint8_t *arg8_ciphertext, - size_t arg9_ciphertext_size, - size_t *arg10_ciphertext_length); -#define 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) \ - mbedtls_test_wrap_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) - -psa_status_t mbedtls_test_wrap_psa_aead_encrypt_setup( - psa_aead_operation_t *arg0_operation, - mbedtls_svc_key_id_t arg1_key, - psa_algorithm_t arg2_alg); -#define psa_aead_encrypt_setup(arg0_operation, arg1_key, arg2_alg) \ - mbedtls_test_wrap_psa_aead_encrypt_setup(arg0_operation, arg1_key, arg2_alg) - -psa_status_t mbedtls_test_wrap_psa_aead_finish( - psa_aead_operation_t *arg0_operation, - uint8_t *arg1_ciphertext, - size_t arg2_ciphertext_size, - size_t *arg3_ciphertext_length, - uint8_t *arg4_tag, - size_t arg5_tag_size, - size_t *arg6_tag_length); -#define psa_aead_finish(arg0_operation, arg1_ciphertext, arg2_ciphertext_size, arg3_ciphertext_length, arg4_tag, arg5_tag_size, arg6_tag_length) \ - mbedtls_test_wrap_psa_aead_finish(arg0_operation, arg1_ciphertext, arg2_ciphertext_size, arg3_ciphertext_length, arg4_tag, arg5_tag_size, arg6_tag_length) - -psa_status_t mbedtls_test_wrap_psa_aead_generate_nonce( - psa_aead_operation_t *arg0_operation, - uint8_t *arg1_nonce, - size_t arg2_nonce_size, - size_t *arg3_nonce_length); -#define psa_aead_generate_nonce(arg0_operation, arg1_nonce, arg2_nonce_size, arg3_nonce_length) \ - mbedtls_test_wrap_psa_aead_generate_nonce(arg0_operation, arg1_nonce, arg2_nonce_size, arg3_nonce_length) - -psa_status_t mbedtls_test_wrap_psa_aead_set_lengths( - psa_aead_operation_t *arg0_operation, - size_t arg1_ad_length, - size_t arg2_plaintext_length); -#define psa_aead_set_lengths(arg0_operation, arg1_ad_length, arg2_plaintext_length) \ - mbedtls_test_wrap_psa_aead_set_lengths(arg0_operation, arg1_ad_length, arg2_plaintext_length) - -psa_status_t mbedtls_test_wrap_psa_aead_set_nonce( - psa_aead_operation_t *arg0_operation, - const uint8_t *arg1_nonce, - size_t arg2_nonce_length); -#define psa_aead_set_nonce(arg0_operation, arg1_nonce, arg2_nonce_length) \ - mbedtls_test_wrap_psa_aead_set_nonce(arg0_operation, arg1_nonce, arg2_nonce_length) - -psa_status_t mbedtls_test_wrap_psa_aead_update( - psa_aead_operation_t *arg0_operation, - const uint8_t *arg1_input, - size_t arg2_input_length, - uint8_t *arg3_output, - size_t arg4_output_size, - size_t *arg5_output_length); -#define psa_aead_update(arg0_operation, arg1_input, arg2_input_length, arg3_output, arg4_output_size, arg5_output_length) \ - mbedtls_test_wrap_psa_aead_update(arg0_operation, arg1_input, arg2_input_length, arg3_output, arg4_output_size, arg5_output_length) - -psa_status_t mbedtls_test_wrap_psa_aead_update_ad( - psa_aead_operation_t *arg0_operation, - const uint8_t *arg1_input, - size_t arg2_input_length); -#define psa_aead_update_ad(arg0_operation, arg1_input, arg2_input_length) \ - mbedtls_test_wrap_psa_aead_update_ad(arg0_operation, arg1_input, arg2_input_length) - -psa_status_t mbedtls_test_wrap_psa_aead_verify( - psa_aead_operation_t *arg0_operation, - uint8_t *arg1_plaintext, - size_t arg2_plaintext_size, - size_t *arg3_plaintext_length, - const uint8_t *arg4_tag, - size_t arg5_tag_length); -#define psa_aead_verify(arg0_operation, arg1_plaintext, arg2_plaintext_size, arg3_plaintext_length, arg4_tag, arg5_tag_length) \ - mbedtls_test_wrap_psa_aead_verify(arg0_operation, arg1_plaintext, arg2_plaintext_size, arg3_plaintext_length, arg4_tag, arg5_tag_length) - -psa_status_t mbedtls_test_wrap_psa_asymmetric_decrypt( - mbedtls_svc_key_id_t arg0_key, - psa_algorithm_t arg1_alg, - const uint8_t *arg2_input, - size_t arg3_input_length, - const uint8_t *arg4_salt, - size_t arg5_salt_length, - uint8_t *arg6_output, - size_t arg7_output_size, - size_t *arg8_output_length); -#define 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) \ - mbedtls_test_wrap_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) - -psa_status_t mbedtls_test_wrap_psa_asymmetric_encrypt( - mbedtls_svc_key_id_t arg0_key, - psa_algorithm_t arg1_alg, - const uint8_t *arg2_input, - size_t arg3_input_length, - const uint8_t *arg4_salt, - size_t arg5_salt_length, - uint8_t *arg6_output, - size_t arg7_output_size, - size_t *arg8_output_length); -#define 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) \ - mbedtls_test_wrap_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) - -psa_status_t mbedtls_test_wrap_psa_cipher_abort( - psa_cipher_operation_t *arg0_operation); -#define psa_cipher_abort(arg0_operation) \ - mbedtls_test_wrap_psa_cipher_abort(arg0_operation) - -psa_status_t mbedtls_test_wrap_psa_cipher_decrypt( - mbedtls_svc_key_id_t arg0_key, - psa_algorithm_t arg1_alg, - const uint8_t *arg2_input, - size_t arg3_input_length, - uint8_t *arg4_output, - size_t arg5_output_size, - size_t *arg6_output_length); -#define psa_cipher_decrypt(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_output, arg5_output_size, arg6_output_length) \ - mbedtls_test_wrap_psa_cipher_decrypt(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_output, arg5_output_size, arg6_output_length) - -psa_status_t mbedtls_test_wrap_psa_cipher_decrypt_setup( - psa_cipher_operation_t *arg0_operation, - mbedtls_svc_key_id_t arg1_key, - psa_algorithm_t arg2_alg); -#define psa_cipher_decrypt_setup(arg0_operation, arg1_key, arg2_alg) \ - mbedtls_test_wrap_psa_cipher_decrypt_setup(arg0_operation, arg1_key, arg2_alg) - -psa_status_t mbedtls_test_wrap_psa_cipher_encrypt( - mbedtls_svc_key_id_t arg0_key, - psa_algorithm_t arg1_alg, - const uint8_t *arg2_input, - size_t arg3_input_length, - uint8_t *arg4_output, - size_t arg5_output_size, - size_t *arg6_output_length); -#define psa_cipher_encrypt(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_output, arg5_output_size, arg6_output_length) \ - mbedtls_test_wrap_psa_cipher_encrypt(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_output, arg5_output_size, arg6_output_length) - -psa_status_t mbedtls_test_wrap_psa_cipher_encrypt_setup( - psa_cipher_operation_t *arg0_operation, - mbedtls_svc_key_id_t arg1_key, - psa_algorithm_t arg2_alg); -#define psa_cipher_encrypt_setup(arg0_operation, arg1_key, arg2_alg) \ - mbedtls_test_wrap_psa_cipher_encrypt_setup(arg0_operation, arg1_key, arg2_alg) - -psa_status_t mbedtls_test_wrap_psa_cipher_finish( - psa_cipher_operation_t *arg0_operation, - uint8_t *arg1_output, - size_t arg2_output_size, - size_t *arg3_output_length); -#define psa_cipher_finish(arg0_operation, arg1_output, arg2_output_size, arg3_output_length) \ - mbedtls_test_wrap_psa_cipher_finish(arg0_operation, arg1_output, arg2_output_size, arg3_output_length) - -psa_status_t mbedtls_test_wrap_psa_cipher_generate_iv( - psa_cipher_operation_t *arg0_operation, - uint8_t *arg1_iv, - size_t arg2_iv_size, - size_t *arg3_iv_length); -#define psa_cipher_generate_iv(arg0_operation, arg1_iv, arg2_iv_size, arg3_iv_length) \ - mbedtls_test_wrap_psa_cipher_generate_iv(arg0_operation, arg1_iv, arg2_iv_size, arg3_iv_length) - -psa_status_t mbedtls_test_wrap_psa_cipher_set_iv( - psa_cipher_operation_t *arg0_operation, - const uint8_t *arg1_iv, - size_t arg2_iv_length); -#define psa_cipher_set_iv(arg0_operation, arg1_iv, arg2_iv_length) \ - mbedtls_test_wrap_psa_cipher_set_iv(arg0_operation, arg1_iv, arg2_iv_length) - -psa_status_t mbedtls_test_wrap_psa_cipher_update( - psa_cipher_operation_t *arg0_operation, - const uint8_t *arg1_input, - size_t arg2_input_length, - uint8_t *arg3_output, - size_t arg4_output_size, - size_t *arg5_output_length); -#define psa_cipher_update(arg0_operation, arg1_input, arg2_input_length, arg3_output, arg4_output_size, arg5_output_length) \ - mbedtls_test_wrap_psa_cipher_update(arg0_operation, arg1_input, arg2_input_length, arg3_output, arg4_output_size, arg5_output_length) - -psa_status_t mbedtls_test_wrap_psa_copy_key( - mbedtls_svc_key_id_t arg0_source_key, - const psa_key_attributes_t *arg1_attributes, - mbedtls_svc_key_id_t *arg2_target_key); -#define psa_copy_key(arg0_source_key, arg1_attributes, arg2_target_key) \ - mbedtls_test_wrap_psa_copy_key(arg0_source_key, arg1_attributes, arg2_target_key) - -#if defined(PSA_WANT_ALG_SOME_PAKE) -psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_cipher_suite( - const psa_crypto_driver_pake_inputs_t *arg0_inputs, - psa_pake_cipher_suite_t *arg1_cipher_suite); -#define psa_crypto_driver_pake_get_cipher_suite(arg0_inputs, arg1_cipher_suite) \ - mbedtls_test_wrap_psa_crypto_driver_pake_get_cipher_suite(arg0_inputs, arg1_cipher_suite) -#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ - -#if defined(PSA_WANT_ALG_SOME_PAKE) -psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_password( - const psa_crypto_driver_pake_inputs_t *arg0_inputs, - uint8_t *arg1_buffer, - size_t arg2_buffer_size, - size_t *arg3_buffer_length); -#define psa_crypto_driver_pake_get_password(arg0_inputs, arg1_buffer, arg2_buffer_size, arg3_buffer_length) \ - mbedtls_test_wrap_psa_crypto_driver_pake_get_password(arg0_inputs, arg1_buffer, arg2_buffer_size, arg3_buffer_length) -#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ - -#if defined(PSA_WANT_ALG_SOME_PAKE) -psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_password_len( - const psa_crypto_driver_pake_inputs_t *arg0_inputs, - size_t *arg1_password_len); -#define psa_crypto_driver_pake_get_password_len(arg0_inputs, arg1_password_len) \ - mbedtls_test_wrap_psa_crypto_driver_pake_get_password_len(arg0_inputs, arg1_password_len) -#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ - -#if defined(PSA_WANT_ALG_SOME_PAKE) -psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_peer( - const psa_crypto_driver_pake_inputs_t *arg0_inputs, - uint8_t *arg1_peer_id, - size_t arg2_peer_id_size, - size_t *arg3_peer_id_length); -#define psa_crypto_driver_pake_get_peer(arg0_inputs, arg1_peer_id, arg2_peer_id_size, arg3_peer_id_length) \ - mbedtls_test_wrap_psa_crypto_driver_pake_get_peer(arg0_inputs, arg1_peer_id, arg2_peer_id_size, arg3_peer_id_length) -#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ - -#if defined(PSA_WANT_ALG_SOME_PAKE) -psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_peer_len( - const psa_crypto_driver_pake_inputs_t *arg0_inputs, - size_t *arg1_peer_len); -#define psa_crypto_driver_pake_get_peer_len(arg0_inputs, arg1_peer_len) \ - mbedtls_test_wrap_psa_crypto_driver_pake_get_peer_len(arg0_inputs, arg1_peer_len) -#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ - -#if defined(PSA_WANT_ALG_SOME_PAKE) -psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_user( - const psa_crypto_driver_pake_inputs_t *arg0_inputs, - uint8_t *arg1_user_id, - size_t arg2_user_id_size, - size_t *arg3_user_id_len); -#define psa_crypto_driver_pake_get_user(arg0_inputs, arg1_user_id, arg2_user_id_size, arg3_user_id_len) \ - mbedtls_test_wrap_psa_crypto_driver_pake_get_user(arg0_inputs, arg1_user_id, arg2_user_id_size, arg3_user_id_len) -#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ - -#if defined(PSA_WANT_ALG_SOME_PAKE) -psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_user_len( - const psa_crypto_driver_pake_inputs_t *arg0_inputs, - size_t *arg1_user_len); -#define psa_crypto_driver_pake_get_user_len(arg0_inputs, arg1_user_len) \ - mbedtls_test_wrap_psa_crypto_driver_pake_get_user_len(arg0_inputs, arg1_user_len) -#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ - -psa_status_t mbedtls_test_wrap_psa_crypto_init(void); -#define psa_crypto_init() \ - mbedtls_test_wrap_psa_crypto_init() - -psa_status_t mbedtls_test_wrap_psa_destroy_key( - mbedtls_svc_key_id_t arg0_key); -#define psa_destroy_key(arg0_key) \ - mbedtls_test_wrap_psa_destroy_key(arg0_key) - -psa_status_t mbedtls_test_wrap_psa_export_key( - mbedtls_svc_key_id_t arg0_key, - uint8_t *arg1_data, - size_t arg2_data_size, - size_t *arg3_data_length); -#define psa_export_key(arg0_key, arg1_data, arg2_data_size, arg3_data_length) \ - mbedtls_test_wrap_psa_export_key(arg0_key, arg1_data, arg2_data_size, arg3_data_length) - -psa_status_t mbedtls_test_wrap_psa_export_public_key( - mbedtls_svc_key_id_t arg0_key, - uint8_t *arg1_data, - size_t arg2_data_size, - size_t *arg3_data_length); -#define psa_export_public_key(arg0_key, arg1_data, arg2_data_size, arg3_data_length) \ - mbedtls_test_wrap_psa_export_public_key(arg0_key, arg1_data, arg2_data_size, arg3_data_length) - -psa_status_t mbedtls_test_wrap_psa_generate_key( - const psa_key_attributes_t *arg0_attributes, - mbedtls_svc_key_id_t *arg1_key); -#define psa_generate_key(arg0_attributes, arg1_key) \ - mbedtls_test_wrap_psa_generate_key(arg0_attributes, arg1_key) - -psa_status_t mbedtls_test_wrap_psa_generate_key_custom( - const psa_key_attributes_t *arg0_attributes, - const psa_custom_key_parameters_t *arg1_custom, - const uint8_t *arg2_custom_data, - size_t arg3_custom_data_length, - mbedtls_svc_key_id_t *arg4_key); -#define psa_generate_key_custom(arg0_attributes, arg1_custom, arg2_custom_data, arg3_custom_data_length, arg4_key) \ - mbedtls_test_wrap_psa_generate_key_custom(arg0_attributes, arg1_custom, arg2_custom_data, arg3_custom_data_length, arg4_key) - -psa_status_t mbedtls_test_wrap_psa_generate_key_ext( - const psa_key_attributes_t *arg0_attributes, - const psa_key_production_parameters_t *arg1_params, - size_t arg2_params_data_length, - mbedtls_svc_key_id_t *arg3_key); -#define psa_generate_key_ext(arg0_attributes, arg1_params, arg2_params_data_length, arg3_key) \ - mbedtls_test_wrap_psa_generate_key_ext(arg0_attributes, arg1_params, arg2_params_data_length, arg3_key) - -psa_status_t mbedtls_test_wrap_psa_generate_random( - uint8_t *arg0_output, - size_t arg1_output_size); -#define psa_generate_random(arg0_output, arg1_output_size) \ - mbedtls_test_wrap_psa_generate_random(arg0_output, arg1_output_size) - -psa_status_t mbedtls_test_wrap_psa_get_key_attributes( - mbedtls_svc_key_id_t arg0_key, - psa_key_attributes_t *arg1_attributes); -#define psa_get_key_attributes(arg0_key, arg1_attributes) \ - mbedtls_test_wrap_psa_get_key_attributes(arg0_key, arg1_attributes) - -psa_status_t mbedtls_test_wrap_psa_hash_abort( - psa_hash_operation_t *arg0_operation); -#define psa_hash_abort(arg0_operation) \ - mbedtls_test_wrap_psa_hash_abort(arg0_operation) - -psa_status_t mbedtls_test_wrap_psa_hash_clone( - const psa_hash_operation_t *arg0_source_operation, - psa_hash_operation_t *arg1_target_operation); -#define psa_hash_clone(arg0_source_operation, arg1_target_operation) \ - mbedtls_test_wrap_psa_hash_clone(arg0_source_operation, arg1_target_operation) - -psa_status_t mbedtls_test_wrap_psa_hash_compare( - psa_algorithm_t arg0_alg, - const uint8_t *arg1_input, - size_t arg2_input_length, - const uint8_t *arg3_hash, - size_t arg4_hash_length); -#define psa_hash_compare(arg0_alg, arg1_input, arg2_input_length, arg3_hash, arg4_hash_length) \ - mbedtls_test_wrap_psa_hash_compare(arg0_alg, arg1_input, arg2_input_length, arg3_hash, arg4_hash_length) - -psa_status_t mbedtls_test_wrap_psa_hash_compute( - psa_algorithm_t arg0_alg, - const uint8_t *arg1_input, - size_t arg2_input_length, - uint8_t *arg3_hash, - size_t arg4_hash_size, - size_t *arg5_hash_length); -#define psa_hash_compute(arg0_alg, arg1_input, arg2_input_length, arg3_hash, arg4_hash_size, arg5_hash_length) \ - mbedtls_test_wrap_psa_hash_compute(arg0_alg, arg1_input, arg2_input_length, arg3_hash, arg4_hash_size, arg5_hash_length) - -psa_status_t mbedtls_test_wrap_psa_hash_finish( - psa_hash_operation_t *arg0_operation, - uint8_t *arg1_hash, - size_t arg2_hash_size, - size_t *arg3_hash_length); -#define psa_hash_finish(arg0_operation, arg1_hash, arg2_hash_size, arg3_hash_length) \ - mbedtls_test_wrap_psa_hash_finish(arg0_operation, arg1_hash, arg2_hash_size, arg3_hash_length) - -psa_status_t mbedtls_test_wrap_psa_hash_setup( - psa_hash_operation_t *arg0_operation, - psa_algorithm_t arg1_alg); -#define psa_hash_setup(arg0_operation, arg1_alg) \ - mbedtls_test_wrap_psa_hash_setup(arg0_operation, arg1_alg) - -psa_status_t mbedtls_test_wrap_psa_hash_update( - psa_hash_operation_t *arg0_operation, - const uint8_t *arg1_input, - size_t arg2_input_length); -#define psa_hash_update(arg0_operation, arg1_input, arg2_input_length) \ - mbedtls_test_wrap_psa_hash_update(arg0_operation, arg1_input, arg2_input_length) - -psa_status_t mbedtls_test_wrap_psa_hash_verify( - psa_hash_operation_t *arg0_operation, - const uint8_t *arg1_hash, - size_t arg2_hash_length); -#define psa_hash_verify(arg0_operation, arg1_hash, arg2_hash_length) \ - mbedtls_test_wrap_psa_hash_verify(arg0_operation, arg1_hash, arg2_hash_length) - -psa_status_t mbedtls_test_wrap_psa_import_key( - const psa_key_attributes_t *arg0_attributes, - const uint8_t *arg1_data, - size_t arg2_data_length, - mbedtls_svc_key_id_t *arg3_key); -#define psa_import_key(arg0_attributes, arg1_data, arg2_data_length, arg3_key) \ - mbedtls_test_wrap_psa_import_key(arg0_attributes, arg1_data, arg2_data_length, arg3_key) - -psa_status_t mbedtls_test_wrap_psa_key_derivation_abort( - psa_key_derivation_operation_t *arg0_operation); -#define psa_key_derivation_abort(arg0_operation) \ - mbedtls_test_wrap_psa_key_derivation_abort(arg0_operation) - -psa_status_t mbedtls_test_wrap_psa_key_derivation_get_capacity( - const psa_key_derivation_operation_t *arg0_operation, - size_t *arg1_capacity); -#define psa_key_derivation_get_capacity(arg0_operation, arg1_capacity) \ - mbedtls_test_wrap_psa_key_derivation_get_capacity(arg0_operation, arg1_capacity) - -psa_status_t mbedtls_test_wrap_psa_key_derivation_input_bytes( - psa_key_derivation_operation_t *arg0_operation, - psa_key_derivation_step_t arg1_step, - const uint8_t *arg2_data, - size_t arg3_data_length); -#define psa_key_derivation_input_bytes(arg0_operation, arg1_step, arg2_data, arg3_data_length) \ - mbedtls_test_wrap_psa_key_derivation_input_bytes(arg0_operation, arg1_step, arg2_data, arg3_data_length) - -psa_status_t mbedtls_test_wrap_psa_key_derivation_input_integer( - psa_key_derivation_operation_t *arg0_operation, - psa_key_derivation_step_t arg1_step, - uint64_t arg2_value); -#define psa_key_derivation_input_integer(arg0_operation, arg1_step, arg2_value) \ - mbedtls_test_wrap_psa_key_derivation_input_integer(arg0_operation, arg1_step, arg2_value) - -psa_status_t mbedtls_test_wrap_psa_key_derivation_input_key( - psa_key_derivation_operation_t *arg0_operation, - psa_key_derivation_step_t arg1_step, - mbedtls_svc_key_id_t arg2_key); -#define psa_key_derivation_input_key(arg0_operation, arg1_step, arg2_key) \ - mbedtls_test_wrap_psa_key_derivation_input_key(arg0_operation, arg1_step, arg2_key) - -psa_status_t mbedtls_test_wrap_psa_key_derivation_key_agreement( - psa_key_derivation_operation_t *arg0_operation, - psa_key_derivation_step_t arg1_step, - mbedtls_svc_key_id_t arg2_private_key, - const uint8_t *arg3_peer_key, - size_t arg4_peer_key_length); -#define psa_key_derivation_key_agreement(arg0_operation, arg1_step, arg2_private_key, arg3_peer_key, arg4_peer_key_length) \ - mbedtls_test_wrap_psa_key_derivation_key_agreement(arg0_operation, arg1_step, arg2_private_key, arg3_peer_key, arg4_peer_key_length) - -psa_status_t mbedtls_test_wrap_psa_key_derivation_output_bytes( - psa_key_derivation_operation_t *arg0_operation, - uint8_t *arg1_output, - size_t arg2_output_length); -#define psa_key_derivation_output_bytes(arg0_operation, arg1_output, arg2_output_length) \ - mbedtls_test_wrap_psa_key_derivation_output_bytes(arg0_operation, arg1_output, arg2_output_length) - -psa_status_t mbedtls_test_wrap_psa_key_derivation_output_key( - const psa_key_attributes_t *arg0_attributes, - psa_key_derivation_operation_t *arg1_operation, - mbedtls_svc_key_id_t *arg2_key); -#define psa_key_derivation_output_key(arg0_attributes, arg1_operation, arg2_key) \ - mbedtls_test_wrap_psa_key_derivation_output_key(arg0_attributes, arg1_operation, arg2_key) - -psa_status_t mbedtls_test_wrap_psa_key_derivation_output_key_custom( - const psa_key_attributes_t *arg0_attributes, - psa_key_derivation_operation_t *arg1_operation, - const psa_custom_key_parameters_t *arg2_custom, - const uint8_t *arg3_custom_data, - size_t arg4_custom_data_length, - mbedtls_svc_key_id_t *arg5_key); -#define psa_key_derivation_output_key_custom(arg0_attributes, arg1_operation, arg2_custom, arg3_custom_data, arg4_custom_data_length, arg5_key) \ - mbedtls_test_wrap_psa_key_derivation_output_key_custom(arg0_attributes, arg1_operation, arg2_custom, arg3_custom_data, arg4_custom_data_length, arg5_key) - -psa_status_t mbedtls_test_wrap_psa_key_derivation_output_key_ext( - const psa_key_attributes_t *arg0_attributes, - psa_key_derivation_operation_t *arg1_operation, - const psa_key_production_parameters_t *arg2_params, - size_t arg3_params_data_length, - mbedtls_svc_key_id_t *arg4_key); -#define psa_key_derivation_output_key_ext(arg0_attributes, arg1_operation, arg2_params, arg3_params_data_length, arg4_key) \ - mbedtls_test_wrap_psa_key_derivation_output_key_ext(arg0_attributes, arg1_operation, arg2_params, arg3_params_data_length, arg4_key) - -psa_status_t mbedtls_test_wrap_psa_key_derivation_set_capacity( - psa_key_derivation_operation_t *arg0_operation, - size_t arg1_capacity); -#define psa_key_derivation_set_capacity(arg0_operation, arg1_capacity) \ - mbedtls_test_wrap_psa_key_derivation_set_capacity(arg0_operation, arg1_capacity) - -psa_status_t mbedtls_test_wrap_psa_key_derivation_setup( - psa_key_derivation_operation_t *arg0_operation, - psa_algorithm_t arg1_alg); -#define psa_key_derivation_setup(arg0_operation, arg1_alg) \ - mbedtls_test_wrap_psa_key_derivation_setup(arg0_operation, arg1_alg) - -psa_status_t mbedtls_test_wrap_psa_mac_abort( - psa_mac_operation_t *arg0_operation); -#define psa_mac_abort(arg0_operation) \ - mbedtls_test_wrap_psa_mac_abort(arg0_operation) - -psa_status_t mbedtls_test_wrap_psa_mac_compute( - mbedtls_svc_key_id_t arg0_key, - psa_algorithm_t arg1_alg, - const uint8_t *arg2_input, - size_t arg3_input_length, - uint8_t *arg4_mac, - size_t arg5_mac_size, - size_t *arg6_mac_length); -#define psa_mac_compute(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_mac, arg5_mac_size, arg6_mac_length) \ - mbedtls_test_wrap_psa_mac_compute(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_mac, arg5_mac_size, arg6_mac_length) - -psa_status_t mbedtls_test_wrap_psa_mac_sign_finish( - psa_mac_operation_t *arg0_operation, - uint8_t *arg1_mac, - size_t arg2_mac_size, - size_t *arg3_mac_length); -#define psa_mac_sign_finish(arg0_operation, arg1_mac, arg2_mac_size, arg3_mac_length) \ - mbedtls_test_wrap_psa_mac_sign_finish(arg0_operation, arg1_mac, arg2_mac_size, arg3_mac_length) - -psa_status_t mbedtls_test_wrap_psa_mac_sign_setup( - psa_mac_operation_t *arg0_operation, - mbedtls_svc_key_id_t arg1_key, - psa_algorithm_t arg2_alg); -#define psa_mac_sign_setup(arg0_operation, arg1_key, arg2_alg) \ - mbedtls_test_wrap_psa_mac_sign_setup(arg0_operation, arg1_key, arg2_alg) - -psa_status_t mbedtls_test_wrap_psa_mac_update( - psa_mac_operation_t *arg0_operation, - const uint8_t *arg1_input, - size_t arg2_input_length); -#define psa_mac_update(arg0_operation, arg1_input, arg2_input_length) \ - mbedtls_test_wrap_psa_mac_update(arg0_operation, arg1_input, arg2_input_length) - -psa_status_t mbedtls_test_wrap_psa_mac_verify( - mbedtls_svc_key_id_t arg0_key, - psa_algorithm_t arg1_alg, - const uint8_t *arg2_input, - size_t arg3_input_length, - const uint8_t *arg4_mac, - size_t arg5_mac_length); -#define psa_mac_verify(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_mac, arg5_mac_length) \ - mbedtls_test_wrap_psa_mac_verify(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_mac, arg5_mac_length) - -psa_status_t mbedtls_test_wrap_psa_mac_verify_finish( - psa_mac_operation_t *arg0_operation, - const uint8_t *arg1_mac, - size_t arg2_mac_length); -#define psa_mac_verify_finish(arg0_operation, arg1_mac, arg2_mac_length) \ - mbedtls_test_wrap_psa_mac_verify_finish(arg0_operation, arg1_mac, arg2_mac_length) - -psa_status_t mbedtls_test_wrap_psa_mac_verify_setup( - psa_mac_operation_t *arg0_operation, - mbedtls_svc_key_id_t arg1_key, - psa_algorithm_t arg2_alg); -#define psa_mac_verify_setup(arg0_operation, arg1_key, arg2_alg) \ - mbedtls_test_wrap_psa_mac_verify_setup(arg0_operation, arg1_key, arg2_alg) - -#if defined(PSA_WANT_ALG_SOME_PAKE) -psa_status_t mbedtls_test_wrap_psa_pake_abort( - psa_pake_operation_t *arg0_operation); -#define psa_pake_abort(arg0_operation) \ - mbedtls_test_wrap_psa_pake_abort(arg0_operation) -#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ - -#if defined(PSA_WANT_ALG_SOME_PAKE) -psa_status_t mbedtls_test_wrap_psa_pake_get_implicit_key( - psa_pake_operation_t *arg0_operation, - psa_key_derivation_operation_t *arg1_output); -#define psa_pake_get_implicit_key(arg0_operation, arg1_output) \ - mbedtls_test_wrap_psa_pake_get_implicit_key(arg0_operation, arg1_output) -#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ - -#if defined(PSA_WANT_ALG_SOME_PAKE) -psa_status_t mbedtls_test_wrap_psa_pake_input( - psa_pake_operation_t *arg0_operation, - psa_pake_step_t arg1_step, - const uint8_t *arg2_input, - size_t arg3_input_length); -#define psa_pake_input(arg0_operation, arg1_step, arg2_input, arg3_input_length) \ - mbedtls_test_wrap_psa_pake_input(arg0_operation, arg1_step, arg2_input, arg3_input_length) -#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ - -#if defined(PSA_WANT_ALG_SOME_PAKE) -psa_status_t mbedtls_test_wrap_psa_pake_output( - psa_pake_operation_t *arg0_operation, - psa_pake_step_t arg1_step, - uint8_t *arg2_output, - size_t arg3_output_size, - size_t *arg4_output_length); -#define psa_pake_output(arg0_operation, arg1_step, arg2_output, arg3_output_size, arg4_output_length) \ - mbedtls_test_wrap_psa_pake_output(arg0_operation, arg1_step, arg2_output, arg3_output_size, arg4_output_length) -#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ - -#if defined(PSA_WANT_ALG_SOME_PAKE) -psa_status_t mbedtls_test_wrap_psa_pake_set_password_key( - psa_pake_operation_t *arg0_operation, - mbedtls_svc_key_id_t arg1_password); -#define psa_pake_set_password_key(arg0_operation, arg1_password) \ - mbedtls_test_wrap_psa_pake_set_password_key(arg0_operation, arg1_password) -#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ - -#if defined(PSA_WANT_ALG_SOME_PAKE) -psa_status_t mbedtls_test_wrap_psa_pake_set_peer( - psa_pake_operation_t *arg0_operation, - const uint8_t *arg1_peer_id, - size_t arg2_peer_id_len); -#define psa_pake_set_peer(arg0_operation, arg1_peer_id, arg2_peer_id_len) \ - mbedtls_test_wrap_psa_pake_set_peer(arg0_operation, arg1_peer_id, arg2_peer_id_len) -#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ - -#if defined(PSA_WANT_ALG_SOME_PAKE) -psa_status_t mbedtls_test_wrap_psa_pake_set_role( - psa_pake_operation_t *arg0_operation, - psa_pake_role_t arg1_role); -#define psa_pake_set_role(arg0_operation, arg1_role) \ - mbedtls_test_wrap_psa_pake_set_role(arg0_operation, arg1_role) -#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ - -#if defined(PSA_WANT_ALG_SOME_PAKE) -psa_status_t mbedtls_test_wrap_psa_pake_set_user( - psa_pake_operation_t *arg0_operation, - const uint8_t *arg1_user_id, - size_t arg2_user_id_len); -#define psa_pake_set_user(arg0_operation, arg1_user_id, arg2_user_id_len) \ - mbedtls_test_wrap_psa_pake_set_user(arg0_operation, arg1_user_id, arg2_user_id_len) -#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ - -#if defined(PSA_WANT_ALG_SOME_PAKE) -psa_status_t mbedtls_test_wrap_psa_pake_setup( - psa_pake_operation_t *arg0_operation, - const psa_pake_cipher_suite_t *arg1_cipher_suite); -#define psa_pake_setup(arg0_operation, arg1_cipher_suite) \ - mbedtls_test_wrap_psa_pake_setup(arg0_operation, arg1_cipher_suite) -#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ - -psa_status_t mbedtls_test_wrap_psa_purge_key( - mbedtls_svc_key_id_t arg0_key); -#define psa_purge_key(arg0_key) \ - mbedtls_test_wrap_psa_purge_key(arg0_key) - -psa_status_t mbedtls_test_wrap_psa_raw_key_agreement( - psa_algorithm_t arg0_alg, - mbedtls_svc_key_id_t arg1_private_key, - const uint8_t *arg2_peer_key, - size_t arg3_peer_key_length, - uint8_t *arg4_output, - size_t arg5_output_size, - size_t *arg6_output_length); -#define psa_raw_key_agreement(arg0_alg, arg1_private_key, arg2_peer_key, arg3_peer_key_length, arg4_output, arg5_output_size, arg6_output_length) \ - mbedtls_test_wrap_psa_raw_key_agreement(arg0_alg, arg1_private_key, arg2_peer_key, arg3_peer_key_length, arg4_output, arg5_output_size, arg6_output_length) - -psa_status_t mbedtls_test_wrap_psa_sign_hash( - mbedtls_svc_key_id_t arg0_key, - psa_algorithm_t arg1_alg, - const uint8_t *arg2_hash, - size_t arg3_hash_length, - uint8_t *arg4_signature, - size_t arg5_signature_size, - size_t *arg6_signature_length); -#define psa_sign_hash(arg0_key, arg1_alg, arg2_hash, arg3_hash_length, arg4_signature, arg5_signature_size, arg6_signature_length) \ - mbedtls_test_wrap_psa_sign_hash(arg0_key, arg1_alg, arg2_hash, arg3_hash_length, arg4_signature, arg5_signature_size, arg6_signature_length) - -psa_status_t mbedtls_test_wrap_psa_sign_hash_abort( - psa_sign_hash_interruptible_operation_t *arg0_operation); -#define psa_sign_hash_abort(arg0_operation) \ - mbedtls_test_wrap_psa_sign_hash_abort(arg0_operation) - -psa_status_t mbedtls_test_wrap_psa_sign_hash_complete( - psa_sign_hash_interruptible_operation_t *arg0_operation, - uint8_t *arg1_signature, - size_t arg2_signature_size, - size_t *arg3_signature_length); -#define psa_sign_hash_complete(arg0_operation, arg1_signature, arg2_signature_size, arg3_signature_length) \ - mbedtls_test_wrap_psa_sign_hash_complete(arg0_operation, arg1_signature, arg2_signature_size, arg3_signature_length) - -psa_status_t mbedtls_test_wrap_psa_sign_hash_start( - psa_sign_hash_interruptible_operation_t *arg0_operation, - mbedtls_svc_key_id_t arg1_key, - psa_algorithm_t arg2_alg, - const uint8_t *arg3_hash, - size_t arg4_hash_length); -#define psa_sign_hash_start(arg0_operation, arg1_key, arg2_alg, arg3_hash, arg4_hash_length) \ - mbedtls_test_wrap_psa_sign_hash_start(arg0_operation, arg1_key, arg2_alg, arg3_hash, arg4_hash_length) - -psa_status_t mbedtls_test_wrap_psa_sign_message( - mbedtls_svc_key_id_t arg0_key, - psa_algorithm_t arg1_alg, - const uint8_t *arg2_input, - size_t arg3_input_length, - uint8_t *arg4_signature, - size_t arg5_signature_size, - size_t *arg6_signature_length); -#define psa_sign_message(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_signature, arg5_signature_size, arg6_signature_length) \ - mbedtls_test_wrap_psa_sign_message(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_signature, arg5_signature_size, arg6_signature_length) - -psa_status_t mbedtls_test_wrap_psa_verify_hash( - mbedtls_svc_key_id_t arg0_key, - psa_algorithm_t arg1_alg, - const uint8_t *arg2_hash, - size_t arg3_hash_length, - const uint8_t *arg4_signature, - size_t arg5_signature_length); -#define psa_verify_hash(arg0_key, arg1_alg, arg2_hash, arg3_hash_length, arg4_signature, arg5_signature_length) \ - mbedtls_test_wrap_psa_verify_hash(arg0_key, arg1_alg, arg2_hash, arg3_hash_length, arg4_signature, arg5_signature_length) - -psa_status_t mbedtls_test_wrap_psa_verify_hash_abort( - psa_verify_hash_interruptible_operation_t *arg0_operation); -#define psa_verify_hash_abort(arg0_operation) \ - mbedtls_test_wrap_psa_verify_hash_abort(arg0_operation) - -psa_status_t mbedtls_test_wrap_psa_verify_hash_complete( - psa_verify_hash_interruptible_operation_t *arg0_operation); -#define psa_verify_hash_complete(arg0_operation) \ - mbedtls_test_wrap_psa_verify_hash_complete(arg0_operation) - -psa_status_t mbedtls_test_wrap_psa_verify_hash_start( - psa_verify_hash_interruptible_operation_t *arg0_operation, - mbedtls_svc_key_id_t arg1_key, - psa_algorithm_t arg2_alg, - const uint8_t *arg3_hash, - size_t arg4_hash_length, - const uint8_t *arg5_signature, - size_t arg6_signature_length); -#define psa_verify_hash_start(arg0_operation, arg1_key, arg2_alg, arg3_hash, arg4_hash_length, arg5_signature, arg6_signature_length) \ - mbedtls_test_wrap_psa_verify_hash_start(arg0_operation, arg1_key, arg2_alg, arg3_hash, arg4_hash_length, arg5_signature, arg6_signature_length) - -psa_status_t mbedtls_test_wrap_psa_verify_message( - mbedtls_svc_key_id_t arg0_key, - psa_algorithm_t arg1_alg, - const uint8_t *arg2_input, - size_t arg3_input_length, - const uint8_t *arg4_signature, - size_t arg5_signature_length); -#define psa_verify_message(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_signature, arg5_signature_length) \ - mbedtls_test_wrap_psa_verify_message(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_signature, arg5_signature_length) - -#endif /* defined(MBEDTLS_PSA_CRYPTO_C) && defined(MBEDTLS_TEST_HOOKS) && \ - !defined(RECORD_PSA_STATUS_COVERAGE_LOG) */ - -#ifdef __cplusplus -} -#endif - -#endif /* TEST_PSA_TEST_WRAPPERS_H */ - -/* End of automatically generated file. */ diff --git a/tests/scripts/check-generated-files.sh b/tests/scripts/check-generated-files.sh index 0d603aae23..0b8b0b77f7 100755 --- a/tests/scripts/check-generated-files.sh +++ b/tests/scripts/check-generated-files.sh @@ -126,6 +126,7 @@ check framework/scripts/generate_bignum_tests.py $(framework/scripts/generate_bi check framework/scripts/generate_config_tests.py $(framework/scripts/generate_config_tests.py --list) check framework/scripts/generate_ecp_tests.py $(framework/scripts/generate_ecp_tests.py --list) check framework/scripts/generate_psa_tests.py $(framework/scripts/generate_psa_tests.py --list) +check framework/scripts/generate_psa_wrappers.py tests/include/test/psa_test_wrappers.h tests/src/psa_test_wrappers.c check framework/scripts/generate_test_keys.py tests/include/test/test_keys.h check scripts/generate_driver_wrappers.py $library_dir/psa_crypto_driver_wrappers.h $library_dir/psa_crypto_driver_wrappers_no_static.c @@ -143,8 +144,3 @@ if in_mbedtls_repo; then # the step that creates or updates these files. check scripts/generate_visualc_files.pl visualc/VS2017 fi - -# Generated files that are present in the repository even in the development -# branch. (This is intended to be temporary, until the generator scripts are -# fully reviewed and the build scripts support a generated header file.) -check framework/scripts/generate_psa_wrappers.py tests/include/test/psa_test_wrappers.h tests/src/psa_test_wrappers.c diff --git a/tests/src/psa_test_wrappers.c b/tests/src/psa_test_wrappers.c deleted file mode 100644 index eceb40bc70..0000000000 --- a/tests/src/psa_test_wrappers.c +++ /dev/null @@ -1,1389 +0,0 @@ -/* Automatically generated by generate_psa_wrappers.py, do not edit! */ - -/* Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later - */ - -#include - -#if defined(MBEDTLS_PSA_CRYPTO_C) && defined(MBEDTLS_TEST_HOOKS) && \ - !defined(RECORD_PSA_STATUS_COVERAGE_LOG) - -#include -#include -#include -#include - -/* Wrapper for mbedtls_psa_inject_entropy */ -#if defined(MBEDTLS_PSA_INJECT_ENTROPY) -psa_status_t mbedtls_test_wrap_mbedtls_psa_inject_entropy( - const uint8_t *arg0_seed, - size_t arg1_seed_size) -{ - psa_status_t status = (mbedtls_psa_inject_entropy)(arg0_seed, arg1_seed_size); - return status; -} -#endif /* defined(MBEDTLS_PSA_INJECT_ENTROPY) */ - -/* Wrapper for mbedtls_psa_platform_get_builtin_key */ -#if defined(MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS) -psa_status_t mbedtls_test_wrap_mbedtls_psa_platform_get_builtin_key( - mbedtls_svc_key_id_t arg0_key_id, - psa_key_lifetime_t *arg1_lifetime, - psa_drv_slot_number_t *arg2_slot_number) -{ - psa_status_t status = (mbedtls_psa_platform_get_builtin_key)(arg0_key_id, arg1_lifetime, arg2_slot_number); - return status; -} -#endif /* defined(MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS) */ - -/* Wrapper for mbedtls_psa_register_se_key */ -#if defined(MBEDTLS_PSA_CRYPTO_SE_C) -psa_status_t mbedtls_test_wrap_mbedtls_psa_register_se_key( - const psa_key_attributes_t *arg0_attributes) -{ - psa_status_t status = (mbedtls_psa_register_se_key)(arg0_attributes); - return status; -} -#endif /* defined(MBEDTLS_PSA_CRYPTO_SE_C) */ - -/* Wrapper for psa_aead_abort */ -psa_status_t mbedtls_test_wrap_psa_aead_abort( - psa_aead_operation_t *arg0_operation) -{ - psa_status_t status = (psa_aead_abort)(arg0_operation); - return status; -} - -/* Wrapper for psa_aead_decrypt */ -psa_status_t mbedtls_test_wrap_psa_aead_decrypt( - mbedtls_svc_key_id_t arg0_key, - psa_algorithm_t arg1_alg, - const uint8_t *arg2_nonce, - size_t arg3_nonce_length, - const uint8_t *arg4_additional_data, - size_t arg5_additional_data_length, - const uint8_t *arg6_ciphertext, - size_t arg7_ciphertext_length, - uint8_t *arg8_plaintext, - size_t arg9_plaintext_size, - size_t *arg10_plaintext_length) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg2_nonce, arg3_nonce_length); - MBEDTLS_TEST_MEMORY_POISON(arg4_additional_data, arg5_additional_data_length); - MBEDTLS_TEST_MEMORY_POISON(arg6_ciphertext, arg7_ciphertext_length); - MBEDTLS_TEST_MEMORY_POISON(arg8_plaintext, arg9_plaintext_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - 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); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg2_nonce, arg3_nonce_length); - MBEDTLS_TEST_MEMORY_UNPOISON(arg4_additional_data, arg5_additional_data_length); - MBEDTLS_TEST_MEMORY_UNPOISON(arg6_ciphertext, arg7_ciphertext_length); - MBEDTLS_TEST_MEMORY_UNPOISON(arg8_plaintext, arg9_plaintext_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} - -/* Wrapper for psa_aead_decrypt_setup */ -psa_status_t mbedtls_test_wrap_psa_aead_decrypt_setup( - psa_aead_operation_t *arg0_operation, - mbedtls_svc_key_id_t arg1_key, - psa_algorithm_t arg2_alg) -{ - psa_status_t status = (psa_aead_decrypt_setup)(arg0_operation, arg1_key, arg2_alg); - return status; -} - -/* Wrapper for psa_aead_encrypt */ -psa_status_t mbedtls_test_wrap_psa_aead_encrypt( - mbedtls_svc_key_id_t arg0_key, - psa_algorithm_t arg1_alg, - const uint8_t *arg2_nonce, - size_t arg3_nonce_length, - const uint8_t *arg4_additional_data, - size_t arg5_additional_data_length, - const uint8_t *arg6_plaintext, - size_t arg7_plaintext_length, - uint8_t *arg8_ciphertext, - size_t arg9_ciphertext_size, - size_t *arg10_ciphertext_length) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg2_nonce, arg3_nonce_length); - MBEDTLS_TEST_MEMORY_POISON(arg4_additional_data, arg5_additional_data_length); - MBEDTLS_TEST_MEMORY_POISON(arg6_plaintext, arg7_plaintext_length); - MBEDTLS_TEST_MEMORY_POISON(arg8_ciphertext, arg9_ciphertext_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - 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); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg2_nonce, arg3_nonce_length); - MBEDTLS_TEST_MEMORY_UNPOISON(arg4_additional_data, arg5_additional_data_length); - MBEDTLS_TEST_MEMORY_UNPOISON(arg6_plaintext, arg7_plaintext_length); - MBEDTLS_TEST_MEMORY_UNPOISON(arg8_ciphertext, arg9_ciphertext_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} - -/* Wrapper for psa_aead_encrypt_setup */ -psa_status_t mbedtls_test_wrap_psa_aead_encrypt_setup( - psa_aead_operation_t *arg0_operation, - mbedtls_svc_key_id_t arg1_key, - psa_algorithm_t arg2_alg) -{ - psa_status_t status = (psa_aead_encrypt_setup)(arg0_operation, arg1_key, arg2_alg); - return status; -} - -/* Wrapper for psa_aead_finish */ -psa_status_t mbedtls_test_wrap_psa_aead_finish( - psa_aead_operation_t *arg0_operation, - uint8_t *arg1_ciphertext, - size_t arg2_ciphertext_size, - size_t *arg3_ciphertext_length, - uint8_t *arg4_tag, - size_t arg5_tag_size, - size_t *arg6_tag_length) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg1_ciphertext, arg2_ciphertext_size); - MBEDTLS_TEST_MEMORY_POISON(arg4_tag, arg5_tag_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - psa_status_t status = (psa_aead_finish)(arg0_operation, arg1_ciphertext, arg2_ciphertext_size, arg3_ciphertext_length, arg4_tag, arg5_tag_size, arg6_tag_length); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg1_ciphertext, arg2_ciphertext_size); - MBEDTLS_TEST_MEMORY_UNPOISON(arg4_tag, arg5_tag_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} - -/* Wrapper for psa_aead_generate_nonce */ -psa_status_t mbedtls_test_wrap_psa_aead_generate_nonce( - psa_aead_operation_t *arg0_operation, - uint8_t *arg1_nonce, - size_t arg2_nonce_size, - size_t *arg3_nonce_length) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg1_nonce, arg2_nonce_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - psa_status_t status = (psa_aead_generate_nonce)(arg0_operation, arg1_nonce, arg2_nonce_size, arg3_nonce_length); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg1_nonce, arg2_nonce_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} - -/* Wrapper for psa_aead_set_lengths */ -psa_status_t mbedtls_test_wrap_psa_aead_set_lengths( - psa_aead_operation_t *arg0_operation, - size_t arg1_ad_length, - size_t arg2_plaintext_length) -{ - psa_status_t status = (psa_aead_set_lengths)(arg0_operation, arg1_ad_length, arg2_plaintext_length); - return status; -} - -/* Wrapper for psa_aead_set_nonce */ -psa_status_t mbedtls_test_wrap_psa_aead_set_nonce( - psa_aead_operation_t *arg0_operation, - const uint8_t *arg1_nonce, - size_t arg2_nonce_length) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg1_nonce, arg2_nonce_length); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - psa_status_t status = (psa_aead_set_nonce)(arg0_operation, arg1_nonce, arg2_nonce_length); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg1_nonce, arg2_nonce_length); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} - -/* Wrapper for psa_aead_update */ -psa_status_t mbedtls_test_wrap_psa_aead_update( - psa_aead_operation_t *arg0_operation, - const uint8_t *arg1_input, - size_t arg2_input_length, - uint8_t *arg3_output, - size_t arg4_output_size, - size_t *arg5_output_length) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length); - MBEDTLS_TEST_MEMORY_POISON(arg3_output, arg4_output_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - psa_status_t status = (psa_aead_update)(arg0_operation, arg1_input, arg2_input_length, arg3_output, arg4_output_size, arg5_output_length); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length); - MBEDTLS_TEST_MEMORY_UNPOISON(arg3_output, arg4_output_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} - -/* Wrapper for psa_aead_update_ad */ -psa_status_t mbedtls_test_wrap_psa_aead_update_ad( - psa_aead_operation_t *arg0_operation, - const uint8_t *arg1_input, - size_t arg2_input_length) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - psa_status_t status = (psa_aead_update_ad)(arg0_operation, arg1_input, arg2_input_length); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} - -/* Wrapper for psa_aead_verify */ -psa_status_t mbedtls_test_wrap_psa_aead_verify( - psa_aead_operation_t *arg0_operation, - uint8_t *arg1_plaintext, - size_t arg2_plaintext_size, - size_t *arg3_plaintext_length, - const uint8_t *arg4_tag, - size_t arg5_tag_length) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg1_plaintext, arg2_plaintext_size); - MBEDTLS_TEST_MEMORY_POISON(arg4_tag, arg5_tag_length); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - psa_status_t status = (psa_aead_verify)(arg0_operation, arg1_plaintext, arg2_plaintext_size, arg3_plaintext_length, arg4_tag, arg5_tag_length); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg1_plaintext, arg2_plaintext_size); - MBEDTLS_TEST_MEMORY_UNPOISON(arg4_tag, arg5_tag_length); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} - -/* Wrapper for psa_asymmetric_decrypt */ -psa_status_t mbedtls_test_wrap_psa_asymmetric_decrypt( - mbedtls_svc_key_id_t arg0_key, - psa_algorithm_t arg1_alg, - const uint8_t *arg2_input, - size_t arg3_input_length, - const uint8_t *arg4_salt, - size_t arg5_salt_length, - uint8_t *arg6_output, - size_t arg7_output_size, - size_t *arg8_output_length) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); - MBEDTLS_TEST_MEMORY_POISON(arg4_salt, arg5_salt_length); - MBEDTLS_TEST_MEMORY_POISON(arg6_output, arg7_output_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - 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); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); - MBEDTLS_TEST_MEMORY_UNPOISON(arg4_salt, arg5_salt_length); - MBEDTLS_TEST_MEMORY_UNPOISON(arg6_output, arg7_output_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} - -/* Wrapper for psa_asymmetric_encrypt */ -psa_status_t mbedtls_test_wrap_psa_asymmetric_encrypt( - mbedtls_svc_key_id_t arg0_key, - psa_algorithm_t arg1_alg, - const uint8_t *arg2_input, - size_t arg3_input_length, - const uint8_t *arg4_salt, - size_t arg5_salt_length, - uint8_t *arg6_output, - size_t arg7_output_size, - size_t *arg8_output_length) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); - MBEDTLS_TEST_MEMORY_POISON(arg4_salt, arg5_salt_length); - MBEDTLS_TEST_MEMORY_POISON(arg6_output, arg7_output_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - 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); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); - MBEDTLS_TEST_MEMORY_UNPOISON(arg4_salt, arg5_salt_length); - MBEDTLS_TEST_MEMORY_UNPOISON(arg6_output, arg7_output_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} - -/* Wrapper for psa_cipher_abort */ -psa_status_t mbedtls_test_wrap_psa_cipher_abort( - psa_cipher_operation_t *arg0_operation) -{ - psa_status_t status = (psa_cipher_abort)(arg0_operation); - return status; -} - -/* Wrapper for psa_cipher_decrypt */ -psa_status_t mbedtls_test_wrap_psa_cipher_decrypt( - mbedtls_svc_key_id_t arg0_key, - psa_algorithm_t arg1_alg, - const uint8_t *arg2_input, - size_t arg3_input_length, - uint8_t *arg4_output, - size_t arg5_output_size, - size_t *arg6_output_length) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); - MBEDTLS_TEST_MEMORY_POISON(arg4_output, arg5_output_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - psa_status_t status = (psa_cipher_decrypt)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_output, arg5_output_size, arg6_output_length); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); - MBEDTLS_TEST_MEMORY_UNPOISON(arg4_output, arg5_output_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} - -/* Wrapper for psa_cipher_decrypt_setup */ -psa_status_t mbedtls_test_wrap_psa_cipher_decrypt_setup( - psa_cipher_operation_t *arg0_operation, - mbedtls_svc_key_id_t arg1_key, - psa_algorithm_t arg2_alg) -{ - psa_status_t status = (psa_cipher_decrypt_setup)(arg0_operation, arg1_key, arg2_alg); - return status; -} - -/* Wrapper for psa_cipher_encrypt */ -psa_status_t mbedtls_test_wrap_psa_cipher_encrypt( - mbedtls_svc_key_id_t arg0_key, - psa_algorithm_t arg1_alg, - const uint8_t *arg2_input, - size_t arg3_input_length, - uint8_t *arg4_output, - size_t arg5_output_size, - size_t *arg6_output_length) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); - MBEDTLS_TEST_MEMORY_POISON(arg4_output, arg5_output_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - psa_status_t status = (psa_cipher_encrypt)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_output, arg5_output_size, arg6_output_length); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); - MBEDTLS_TEST_MEMORY_UNPOISON(arg4_output, arg5_output_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} - -/* Wrapper for psa_cipher_encrypt_setup */ -psa_status_t mbedtls_test_wrap_psa_cipher_encrypt_setup( - psa_cipher_operation_t *arg0_operation, - mbedtls_svc_key_id_t arg1_key, - psa_algorithm_t arg2_alg) -{ - psa_status_t status = (psa_cipher_encrypt_setup)(arg0_operation, arg1_key, arg2_alg); - return status; -} - -/* Wrapper for psa_cipher_finish */ -psa_status_t mbedtls_test_wrap_psa_cipher_finish( - psa_cipher_operation_t *arg0_operation, - uint8_t *arg1_output, - size_t arg2_output_size, - size_t *arg3_output_length) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg1_output, arg2_output_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - psa_status_t status = (psa_cipher_finish)(arg0_operation, arg1_output, arg2_output_size, arg3_output_length); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg1_output, arg2_output_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} - -/* Wrapper for psa_cipher_generate_iv */ -psa_status_t mbedtls_test_wrap_psa_cipher_generate_iv( - psa_cipher_operation_t *arg0_operation, - uint8_t *arg1_iv, - size_t arg2_iv_size, - size_t *arg3_iv_length) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg1_iv, arg2_iv_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - psa_status_t status = (psa_cipher_generate_iv)(arg0_operation, arg1_iv, arg2_iv_size, arg3_iv_length); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg1_iv, arg2_iv_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} - -/* Wrapper for psa_cipher_set_iv */ -psa_status_t mbedtls_test_wrap_psa_cipher_set_iv( - psa_cipher_operation_t *arg0_operation, - const uint8_t *arg1_iv, - size_t arg2_iv_length) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg1_iv, arg2_iv_length); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - psa_status_t status = (psa_cipher_set_iv)(arg0_operation, arg1_iv, arg2_iv_length); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg1_iv, arg2_iv_length); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} - -/* Wrapper for psa_cipher_update */ -psa_status_t mbedtls_test_wrap_psa_cipher_update( - psa_cipher_operation_t *arg0_operation, - const uint8_t *arg1_input, - size_t arg2_input_length, - uint8_t *arg3_output, - size_t arg4_output_size, - size_t *arg5_output_length) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length); - MBEDTLS_TEST_MEMORY_POISON(arg3_output, arg4_output_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - psa_status_t status = (psa_cipher_update)(arg0_operation, arg1_input, arg2_input_length, arg3_output, arg4_output_size, arg5_output_length); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length); - MBEDTLS_TEST_MEMORY_UNPOISON(arg3_output, arg4_output_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} - -/* Wrapper for psa_copy_key */ -psa_status_t mbedtls_test_wrap_psa_copy_key( - mbedtls_svc_key_id_t arg0_source_key, - const psa_key_attributes_t *arg1_attributes, - mbedtls_svc_key_id_t *arg2_target_key) -{ - psa_status_t status = (psa_copy_key)(arg0_source_key, arg1_attributes, arg2_target_key); - return status; -} - -/* Wrapper for psa_crypto_driver_pake_get_cipher_suite */ -#if defined(PSA_WANT_ALG_SOME_PAKE) -psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_cipher_suite( - const psa_crypto_driver_pake_inputs_t *arg0_inputs, - psa_pake_cipher_suite_t *arg1_cipher_suite) -{ - psa_status_t status = (psa_crypto_driver_pake_get_cipher_suite)(arg0_inputs, arg1_cipher_suite); - return status; -} -#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ - -/* Wrapper for psa_crypto_driver_pake_get_password */ -#if defined(PSA_WANT_ALG_SOME_PAKE) -psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_password( - const psa_crypto_driver_pake_inputs_t *arg0_inputs, - uint8_t *arg1_buffer, - size_t arg2_buffer_size, - size_t *arg3_buffer_length) -{ - psa_status_t status = (psa_crypto_driver_pake_get_password)(arg0_inputs, arg1_buffer, arg2_buffer_size, arg3_buffer_length); - return status; -} -#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ - -/* Wrapper for psa_crypto_driver_pake_get_password_len */ -#if defined(PSA_WANT_ALG_SOME_PAKE) -psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_password_len( - const psa_crypto_driver_pake_inputs_t *arg0_inputs, - size_t *arg1_password_len) -{ - psa_status_t status = (psa_crypto_driver_pake_get_password_len)(arg0_inputs, arg1_password_len); - return status; -} -#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ - -/* Wrapper for psa_crypto_driver_pake_get_peer */ -#if defined(PSA_WANT_ALG_SOME_PAKE) -psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_peer( - const psa_crypto_driver_pake_inputs_t *arg0_inputs, - uint8_t *arg1_peer_id, - size_t arg2_peer_id_size, - size_t *arg3_peer_id_length) -{ - psa_status_t status = (psa_crypto_driver_pake_get_peer)(arg0_inputs, arg1_peer_id, arg2_peer_id_size, arg3_peer_id_length); - return status; -} -#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ - -/* Wrapper for psa_crypto_driver_pake_get_peer_len */ -#if defined(PSA_WANT_ALG_SOME_PAKE) -psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_peer_len( - const psa_crypto_driver_pake_inputs_t *arg0_inputs, - size_t *arg1_peer_len) -{ - psa_status_t status = (psa_crypto_driver_pake_get_peer_len)(arg0_inputs, arg1_peer_len); - return status; -} -#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ - -/* Wrapper for psa_crypto_driver_pake_get_user */ -#if defined(PSA_WANT_ALG_SOME_PAKE) -psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_user( - const psa_crypto_driver_pake_inputs_t *arg0_inputs, - uint8_t *arg1_user_id, - size_t arg2_user_id_size, - size_t *arg3_user_id_len) -{ - psa_status_t status = (psa_crypto_driver_pake_get_user)(arg0_inputs, arg1_user_id, arg2_user_id_size, arg3_user_id_len); - return status; -} -#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ - -/* Wrapper for psa_crypto_driver_pake_get_user_len */ -#if defined(PSA_WANT_ALG_SOME_PAKE) -psa_status_t mbedtls_test_wrap_psa_crypto_driver_pake_get_user_len( - const psa_crypto_driver_pake_inputs_t *arg0_inputs, - size_t *arg1_user_len) -{ - psa_status_t status = (psa_crypto_driver_pake_get_user_len)(arg0_inputs, arg1_user_len); - return status; -} -#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ - -/* Wrapper for psa_crypto_init */ -psa_status_t mbedtls_test_wrap_psa_crypto_init(void) -{ - psa_status_t status = (psa_crypto_init)(); - return status; -} - -/* Wrapper for psa_destroy_key */ -psa_status_t mbedtls_test_wrap_psa_destroy_key( - mbedtls_svc_key_id_t arg0_key) -{ - psa_status_t status = (psa_destroy_key)(arg0_key); - return status; -} - -/* Wrapper for psa_export_key */ -psa_status_t mbedtls_test_wrap_psa_export_key( - mbedtls_svc_key_id_t arg0_key, - uint8_t *arg1_data, - size_t arg2_data_size, - size_t *arg3_data_length) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - psa_status_t status = (psa_export_key)(arg0_key, arg1_data, arg2_data_size, arg3_data_length); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} - -/* Wrapper for psa_export_public_key */ -psa_status_t mbedtls_test_wrap_psa_export_public_key( - mbedtls_svc_key_id_t arg0_key, - uint8_t *arg1_data, - size_t arg2_data_size, - size_t *arg3_data_length) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - psa_status_t status = (psa_export_public_key)(arg0_key, arg1_data, arg2_data_size, arg3_data_length); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} - -/* Wrapper for psa_generate_key */ -psa_status_t mbedtls_test_wrap_psa_generate_key( - const psa_key_attributes_t *arg0_attributes, - mbedtls_svc_key_id_t *arg1_key) -{ - psa_status_t status = (psa_generate_key)(arg0_attributes, arg1_key); - return status; -} - -/* Wrapper for psa_generate_key_custom */ -psa_status_t mbedtls_test_wrap_psa_generate_key_custom( - const psa_key_attributes_t *arg0_attributes, - const psa_custom_key_parameters_t *arg1_custom, - const uint8_t *arg2_custom_data, - size_t arg3_custom_data_length, - mbedtls_svc_key_id_t *arg4_key) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg2_custom_data, arg3_custom_data_length); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - psa_status_t status = (psa_generate_key_custom)(arg0_attributes, arg1_custom, arg2_custom_data, arg3_custom_data_length, arg4_key); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg2_custom_data, arg3_custom_data_length); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} - -/* Wrapper for psa_generate_key_ext */ -psa_status_t mbedtls_test_wrap_psa_generate_key_ext( - const psa_key_attributes_t *arg0_attributes, - const psa_key_production_parameters_t *arg1_params, - size_t arg2_params_data_length, - mbedtls_svc_key_id_t *arg3_key) -{ - psa_status_t status = (psa_generate_key_ext)(arg0_attributes, arg1_params, arg2_params_data_length, arg3_key); - return status; -} - -/* Wrapper for psa_generate_random */ -psa_status_t mbedtls_test_wrap_psa_generate_random( - uint8_t *arg0_output, - size_t arg1_output_size) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg0_output, arg1_output_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - psa_status_t status = (psa_generate_random)(arg0_output, arg1_output_size); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg0_output, arg1_output_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} - -/* Wrapper for psa_get_key_attributes */ -psa_status_t mbedtls_test_wrap_psa_get_key_attributes( - mbedtls_svc_key_id_t arg0_key, - psa_key_attributes_t *arg1_attributes) -{ - psa_status_t status = (psa_get_key_attributes)(arg0_key, arg1_attributes); - return status; -} - -/* Wrapper for psa_hash_abort */ -psa_status_t mbedtls_test_wrap_psa_hash_abort( - psa_hash_operation_t *arg0_operation) -{ - psa_status_t status = (psa_hash_abort)(arg0_operation); - return status; -} - -/* Wrapper for psa_hash_clone */ -psa_status_t mbedtls_test_wrap_psa_hash_clone( - const psa_hash_operation_t *arg0_source_operation, - psa_hash_operation_t *arg1_target_operation) -{ - psa_status_t status = (psa_hash_clone)(arg0_source_operation, arg1_target_operation); - return status; -} - -/* Wrapper for psa_hash_compare */ -psa_status_t mbedtls_test_wrap_psa_hash_compare( - psa_algorithm_t arg0_alg, - const uint8_t *arg1_input, - size_t arg2_input_length, - const uint8_t *arg3_hash, - size_t arg4_hash_length) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length); - MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_length); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - psa_status_t status = (psa_hash_compare)(arg0_alg, arg1_input, arg2_input_length, arg3_hash, arg4_hash_length); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length); - MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_length); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} - -/* Wrapper for psa_hash_compute */ -psa_status_t mbedtls_test_wrap_psa_hash_compute( - psa_algorithm_t arg0_alg, - const uint8_t *arg1_input, - size_t arg2_input_length, - uint8_t *arg3_hash, - size_t arg4_hash_size, - size_t *arg5_hash_length) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length); - MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - psa_status_t status = (psa_hash_compute)(arg0_alg, arg1_input, arg2_input_length, arg3_hash, arg4_hash_size, arg5_hash_length); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length); - MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} - -/* Wrapper for psa_hash_finish */ -psa_status_t mbedtls_test_wrap_psa_hash_finish( - psa_hash_operation_t *arg0_operation, - uint8_t *arg1_hash, - size_t arg2_hash_size, - size_t *arg3_hash_length) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg1_hash, arg2_hash_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - psa_status_t status = (psa_hash_finish)(arg0_operation, arg1_hash, arg2_hash_size, arg3_hash_length); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg1_hash, arg2_hash_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} - -/* Wrapper for psa_hash_setup */ -psa_status_t mbedtls_test_wrap_psa_hash_setup( - psa_hash_operation_t *arg0_operation, - psa_algorithm_t arg1_alg) -{ - psa_status_t status = (psa_hash_setup)(arg0_operation, arg1_alg); - return status; -} - -/* Wrapper for psa_hash_update */ -psa_status_t mbedtls_test_wrap_psa_hash_update( - psa_hash_operation_t *arg0_operation, - const uint8_t *arg1_input, - size_t arg2_input_length) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - psa_status_t status = (psa_hash_update)(arg0_operation, arg1_input, arg2_input_length); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} - -/* Wrapper for psa_hash_verify */ -psa_status_t mbedtls_test_wrap_psa_hash_verify( - psa_hash_operation_t *arg0_operation, - const uint8_t *arg1_hash, - size_t arg2_hash_length) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg1_hash, arg2_hash_length); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - psa_status_t status = (psa_hash_verify)(arg0_operation, arg1_hash, arg2_hash_length); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg1_hash, arg2_hash_length); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} - -/* Wrapper for psa_import_key */ -psa_status_t mbedtls_test_wrap_psa_import_key( - const psa_key_attributes_t *arg0_attributes, - const uint8_t *arg1_data, - size_t arg2_data_length, - mbedtls_svc_key_id_t *arg3_key) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg1_data, arg2_data_length); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - psa_status_t status = (psa_import_key)(arg0_attributes, arg1_data, arg2_data_length, arg3_key); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg1_data, arg2_data_length); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} - -/* Wrapper for psa_key_derivation_abort */ -psa_status_t mbedtls_test_wrap_psa_key_derivation_abort( - psa_key_derivation_operation_t *arg0_operation) -{ - psa_status_t status = (psa_key_derivation_abort)(arg0_operation); - return status; -} - -/* Wrapper for psa_key_derivation_get_capacity */ -psa_status_t mbedtls_test_wrap_psa_key_derivation_get_capacity( - const psa_key_derivation_operation_t *arg0_operation, - size_t *arg1_capacity) -{ - psa_status_t status = (psa_key_derivation_get_capacity)(arg0_operation, arg1_capacity); - return status; -} - -/* Wrapper for psa_key_derivation_input_bytes */ -psa_status_t mbedtls_test_wrap_psa_key_derivation_input_bytes( - psa_key_derivation_operation_t *arg0_operation, - psa_key_derivation_step_t arg1_step, - const uint8_t *arg2_data, - size_t arg3_data_length) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg2_data, arg3_data_length); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - psa_status_t status = (psa_key_derivation_input_bytes)(arg0_operation, arg1_step, arg2_data, arg3_data_length); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg2_data, arg3_data_length); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} - -/* Wrapper for psa_key_derivation_input_integer */ -psa_status_t mbedtls_test_wrap_psa_key_derivation_input_integer( - psa_key_derivation_operation_t *arg0_operation, - psa_key_derivation_step_t arg1_step, - uint64_t arg2_value) -{ - psa_status_t status = (psa_key_derivation_input_integer)(arg0_operation, arg1_step, arg2_value); - return status; -} - -/* Wrapper for psa_key_derivation_input_key */ -psa_status_t mbedtls_test_wrap_psa_key_derivation_input_key( - psa_key_derivation_operation_t *arg0_operation, - psa_key_derivation_step_t arg1_step, - mbedtls_svc_key_id_t arg2_key) -{ - psa_status_t status = (psa_key_derivation_input_key)(arg0_operation, arg1_step, arg2_key); - return status; -} - -/* Wrapper for psa_key_derivation_key_agreement */ -psa_status_t mbedtls_test_wrap_psa_key_derivation_key_agreement( - psa_key_derivation_operation_t *arg0_operation, - psa_key_derivation_step_t arg1_step, - mbedtls_svc_key_id_t arg2_private_key, - const uint8_t *arg3_peer_key, - size_t arg4_peer_key_length) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg3_peer_key, arg4_peer_key_length); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - psa_status_t status = (psa_key_derivation_key_agreement)(arg0_operation, arg1_step, arg2_private_key, arg3_peer_key, arg4_peer_key_length); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg3_peer_key, arg4_peer_key_length); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} - -/* Wrapper for psa_key_derivation_output_bytes */ -psa_status_t mbedtls_test_wrap_psa_key_derivation_output_bytes( - psa_key_derivation_operation_t *arg0_operation, - uint8_t *arg1_output, - size_t arg2_output_length) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg1_output, arg2_output_length); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - psa_status_t status = (psa_key_derivation_output_bytes)(arg0_operation, arg1_output, arg2_output_length); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg1_output, arg2_output_length); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} - -/* Wrapper for psa_key_derivation_output_key */ -psa_status_t mbedtls_test_wrap_psa_key_derivation_output_key( - const psa_key_attributes_t *arg0_attributes, - psa_key_derivation_operation_t *arg1_operation, - mbedtls_svc_key_id_t *arg2_key) -{ - psa_status_t status = (psa_key_derivation_output_key)(arg0_attributes, arg1_operation, arg2_key); - return status; -} - -/* Wrapper for psa_key_derivation_output_key_custom */ -psa_status_t mbedtls_test_wrap_psa_key_derivation_output_key_custom( - const psa_key_attributes_t *arg0_attributes, - psa_key_derivation_operation_t *arg1_operation, - const psa_custom_key_parameters_t *arg2_custom, - const uint8_t *arg3_custom_data, - size_t arg4_custom_data_length, - mbedtls_svc_key_id_t *arg5_key) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg3_custom_data, arg4_custom_data_length); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - psa_status_t status = (psa_key_derivation_output_key_custom)(arg0_attributes, arg1_operation, arg2_custom, arg3_custom_data, arg4_custom_data_length, arg5_key); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg3_custom_data, arg4_custom_data_length); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} - -/* Wrapper for psa_key_derivation_output_key_ext */ -psa_status_t mbedtls_test_wrap_psa_key_derivation_output_key_ext( - const psa_key_attributes_t *arg0_attributes, - psa_key_derivation_operation_t *arg1_operation, - const psa_key_production_parameters_t *arg2_params, - size_t arg3_params_data_length, - mbedtls_svc_key_id_t *arg4_key) -{ - psa_status_t status = (psa_key_derivation_output_key_ext)(arg0_attributes, arg1_operation, arg2_params, arg3_params_data_length, arg4_key); - return status; -} - -/* Wrapper for psa_key_derivation_set_capacity */ -psa_status_t mbedtls_test_wrap_psa_key_derivation_set_capacity( - psa_key_derivation_operation_t *arg0_operation, - size_t arg1_capacity) -{ - psa_status_t status = (psa_key_derivation_set_capacity)(arg0_operation, arg1_capacity); - return status; -} - -/* Wrapper for psa_key_derivation_setup */ -psa_status_t mbedtls_test_wrap_psa_key_derivation_setup( - psa_key_derivation_operation_t *arg0_operation, - psa_algorithm_t arg1_alg) -{ - psa_status_t status = (psa_key_derivation_setup)(arg0_operation, arg1_alg); - return status; -} - -/* Wrapper for psa_mac_abort */ -psa_status_t mbedtls_test_wrap_psa_mac_abort( - psa_mac_operation_t *arg0_operation) -{ - psa_status_t status = (psa_mac_abort)(arg0_operation); - return status; -} - -/* Wrapper for psa_mac_compute */ -psa_status_t mbedtls_test_wrap_psa_mac_compute( - mbedtls_svc_key_id_t arg0_key, - psa_algorithm_t arg1_alg, - const uint8_t *arg2_input, - size_t arg3_input_length, - uint8_t *arg4_mac, - size_t arg5_mac_size, - size_t *arg6_mac_length) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); - MBEDTLS_TEST_MEMORY_POISON(arg4_mac, arg5_mac_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - psa_status_t status = (psa_mac_compute)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_mac, arg5_mac_size, arg6_mac_length); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); - MBEDTLS_TEST_MEMORY_UNPOISON(arg4_mac, arg5_mac_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} - -/* Wrapper for psa_mac_sign_finish */ -psa_status_t mbedtls_test_wrap_psa_mac_sign_finish( - psa_mac_operation_t *arg0_operation, - uint8_t *arg1_mac, - size_t arg2_mac_size, - size_t *arg3_mac_length) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg1_mac, arg2_mac_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - psa_status_t status = (psa_mac_sign_finish)(arg0_operation, arg1_mac, arg2_mac_size, arg3_mac_length); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg1_mac, arg2_mac_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} - -/* Wrapper for psa_mac_sign_setup */ -psa_status_t mbedtls_test_wrap_psa_mac_sign_setup( - psa_mac_operation_t *arg0_operation, - mbedtls_svc_key_id_t arg1_key, - psa_algorithm_t arg2_alg) -{ - psa_status_t status = (psa_mac_sign_setup)(arg0_operation, arg1_key, arg2_alg); - return status; -} - -/* Wrapper for psa_mac_update */ -psa_status_t mbedtls_test_wrap_psa_mac_update( - psa_mac_operation_t *arg0_operation, - const uint8_t *arg1_input, - size_t arg2_input_length) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg1_input, arg2_input_length); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - psa_status_t status = (psa_mac_update)(arg0_operation, arg1_input, arg2_input_length); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg1_input, arg2_input_length); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} - -/* Wrapper for psa_mac_verify */ -psa_status_t mbedtls_test_wrap_psa_mac_verify( - mbedtls_svc_key_id_t arg0_key, - psa_algorithm_t arg1_alg, - const uint8_t *arg2_input, - size_t arg3_input_length, - const uint8_t *arg4_mac, - size_t arg5_mac_length) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); - MBEDTLS_TEST_MEMORY_POISON(arg4_mac, arg5_mac_length); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - psa_status_t status = (psa_mac_verify)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_mac, arg5_mac_length); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); - MBEDTLS_TEST_MEMORY_UNPOISON(arg4_mac, arg5_mac_length); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} - -/* Wrapper for psa_mac_verify_finish */ -psa_status_t mbedtls_test_wrap_psa_mac_verify_finish( - psa_mac_operation_t *arg0_operation, - const uint8_t *arg1_mac, - size_t arg2_mac_length) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg1_mac, arg2_mac_length); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - psa_status_t status = (psa_mac_verify_finish)(arg0_operation, arg1_mac, arg2_mac_length); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg1_mac, arg2_mac_length); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} - -/* Wrapper for psa_mac_verify_setup */ -psa_status_t mbedtls_test_wrap_psa_mac_verify_setup( - psa_mac_operation_t *arg0_operation, - mbedtls_svc_key_id_t arg1_key, - psa_algorithm_t arg2_alg) -{ - psa_status_t status = (psa_mac_verify_setup)(arg0_operation, arg1_key, arg2_alg); - return status; -} - -/* Wrapper for psa_pake_abort */ -#if defined(PSA_WANT_ALG_SOME_PAKE) -psa_status_t mbedtls_test_wrap_psa_pake_abort( - psa_pake_operation_t *arg0_operation) -{ - psa_status_t status = (psa_pake_abort)(arg0_operation); - return status; -} -#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ - -/* Wrapper for psa_pake_get_implicit_key */ -#if defined(PSA_WANT_ALG_SOME_PAKE) -psa_status_t mbedtls_test_wrap_psa_pake_get_implicit_key( - psa_pake_operation_t *arg0_operation, - psa_key_derivation_operation_t *arg1_output) -{ - psa_status_t status = (psa_pake_get_implicit_key)(arg0_operation, arg1_output); - return status; -} -#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ - -/* Wrapper for psa_pake_input */ -#if defined(PSA_WANT_ALG_SOME_PAKE) -psa_status_t mbedtls_test_wrap_psa_pake_input( - psa_pake_operation_t *arg0_operation, - psa_pake_step_t arg1_step, - const uint8_t *arg2_input, - size_t arg3_input_length) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - psa_status_t status = (psa_pake_input)(arg0_operation, arg1_step, arg2_input, arg3_input_length); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} -#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ - -/* Wrapper for psa_pake_output */ -#if defined(PSA_WANT_ALG_SOME_PAKE) -psa_status_t mbedtls_test_wrap_psa_pake_output( - psa_pake_operation_t *arg0_operation, - psa_pake_step_t arg1_step, - uint8_t *arg2_output, - size_t arg3_output_size, - size_t *arg4_output_length) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg2_output, arg3_output_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - psa_status_t status = (psa_pake_output)(arg0_operation, arg1_step, arg2_output, arg3_output_size, arg4_output_length); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg2_output, arg3_output_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} -#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ - -/* Wrapper for psa_pake_set_password_key */ -#if defined(PSA_WANT_ALG_SOME_PAKE) -psa_status_t mbedtls_test_wrap_psa_pake_set_password_key( - psa_pake_operation_t *arg0_operation, - mbedtls_svc_key_id_t arg1_password) -{ - psa_status_t status = (psa_pake_set_password_key)(arg0_operation, arg1_password); - return status; -} -#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ - -/* Wrapper for psa_pake_set_peer */ -#if defined(PSA_WANT_ALG_SOME_PAKE) -psa_status_t mbedtls_test_wrap_psa_pake_set_peer( - psa_pake_operation_t *arg0_operation, - const uint8_t *arg1_peer_id, - size_t arg2_peer_id_len) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg1_peer_id, arg2_peer_id_len); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - psa_status_t status = (psa_pake_set_peer)(arg0_operation, arg1_peer_id, arg2_peer_id_len); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg1_peer_id, arg2_peer_id_len); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} -#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ - -/* Wrapper for psa_pake_set_role */ -#if defined(PSA_WANT_ALG_SOME_PAKE) -psa_status_t mbedtls_test_wrap_psa_pake_set_role( - psa_pake_operation_t *arg0_operation, - psa_pake_role_t arg1_role) -{ - psa_status_t status = (psa_pake_set_role)(arg0_operation, arg1_role); - return status; -} -#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ - -/* Wrapper for psa_pake_set_user */ -#if defined(PSA_WANT_ALG_SOME_PAKE) -psa_status_t mbedtls_test_wrap_psa_pake_set_user( - psa_pake_operation_t *arg0_operation, - const uint8_t *arg1_user_id, - size_t arg2_user_id_len) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg1_user_id, arg2_user_id_len); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - psa_status_t status = (psa_pake_set_user)(arg0_operation, arg1_user_id, arg2_user_id_len); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg1_user_id, arg2_user_id_len); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} -#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ - -/* Wrapper for psa_pake_setup */ -#if defined(PSA_WANT_ALG_SOME_PAKE) -psa_status_t mbedtls_test_wrap_psa_pake_setup( - psa_pake_operation_t *arg0_operation, - const psa_pake_cipher_suite_t *arg1_cipher_suite) -{ - psa_status_t status = (psa_pake_setup)(arg0_operation, arg1_cipher_suite); - return status; -} -#endif /* defined(PSA_WANT_ALG_SOME_PAKE) */ - -/* Wrapper for psa_purge_key */ -psa_status_t mbedtls_test_wrap_psa_purge_key( - mbedtls_svc_key_id_t arg0_key) -{ - psa_status_t status = (psa_purge_key)(arg0_key); - return status; -} - -/* Wrapper for psa_raw_key_agreement */ -psa_status_t mbedtls_test_wrap_psa_raw_key_agreement( - psa_algorithm_t arg0_alg, - mbedtls_svc_key_id_t arg1_private_key, - const uint8_t *arg2_peer_key, - size_t arg3_peer_key_length, - uint8_t *arg4_output, - size_t arg5_output_size, - size_t *arg6_output_length) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg2_peer_key, arg3_peer_key_length); - MBEDTLS_TEST_MEMORY_POISON(arg4_output, arg5_output_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - 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); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg2_peer_key, arg3_peer_key_length); - MBEDTLS_TEST_MEMORY_UNPOISON(arg4_output, arg5_output_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} - -/* Wrapper for psa_sign_hash */ -psa_status_t mbedtls_test_wrap_psa_sign_hash( - mbedtls_svc_key_id_t arg0_key, - psa_algorithm_t arg1_alg, - const uint8_t *arg2_hash, - size_t arg3_hash_length, - uint8_t *arg4_signature, - size_t arg5_signature_size, - size_t *arg6_signature_length) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg2_hash, arg3_hash_length); - MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - psa_status_t status = (psa_sign_hash)(arg0_key, arg1_alg, arg2_hash, arg3_hash_length, arg4_signature, arg5_signature_size, arg6_signature_length); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg2_hash, arg3_hash_length); - MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} - -/* Wrapper for psa_sign_hash_abort */ -psa_status_t mbedtls_test_wrap_psa_sign_hash_abort( - psa_sign_hash_interruptible_operation_t *arg0_operation) -{ - psa_status_t status = (psa_sign_hash_abort)(arg0_operation); - return status; -} - -/* Wrapper for psa_sign_hash_complete */ -psa_status_t mbedtls_test_wrap_psa_sign_hash_complete( - psa_sign_hash_interruptible_operation_t *arg0_operation, - uint8_t *arg1_signature, - size_t arg2_signature_size, - size_t *arg3_signature_length) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg1_signature, arg2_signature_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - psa_status_t status = (psa_sign_hash_complete)(arg0_operation, arg1_signature, arg2_signature_size, arg3_signature_length); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg1_signature, arg2_signature_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} - -/* Wrapper for psa_sign_hash_start */ -psa_status_t mbedtls_test_wrap_psa_sign_hash_start( - psa_sign_hash_interruptible_operation_t *arg0_operation, - mbedtls_svc_key_id_t arg1_key, - psa_algorithm_t arg2_alg, - const uint8_t *arg3_hash, - size_t arg4_hash_length) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_length); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - psa_status_t status = (psa_sign_hash_start)(arg0_operation, arg1_key, arg2_alg, arg3_hash, arg4_hash_length); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_length); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} - -/* Wrapper for psa_sign_message */ -psa_status_t mbedtls_test_wrap_psa_sign_message( - mbedtls_svc_key_id_t arg0_key, - psa_algorithm_t arg1_alg, - const uint8_t *arg2_input, - size_t arg3_input_length, - uint8_t *arg4_signature, - size_t arg5_signature_size, - size_t *arg6_signature_length) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); - MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - psa_status_t status = (psa_sign_message)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_signature, arg5_signature_size, arg6_signature_length); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); - MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_size); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} - -/* Wrapper for psa_verify_hash */ -psa_status_t mbedtls_test_wrap_psa_verify_hash( - mbedtls_svc_key_id_t arg0_key, - psa_algorithm_t arg1_alg, - const uint8_t *arg2_hash, - size_t arg3_hash_length, - const uint8_t *arg4_signature, - size_t arg5_signature_length) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg2_hash, arg3_hash_length); - MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_length); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - psa_status_t status = (psa_verify_hash)(arg0_key, arg1_alg, arg2_hash, arg3_hash_length, arg4_signature, arg5_signature_length); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg2_hash, arg3_hash_length); - MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_length); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} - -/* Wrapper for psa_verify_hash_abort */ -psa_status_t mbedtls_test_wrap_psa_verify_hash_abort( - psa_verify_hash_interruptible_operation_t *arg0_operation) -{ - psa_status_t status = (psa_verify_hash_abort)(arg0_operation); - return status; -} - -/* Wrapper for psa_verify_hash_complete */ -psa_status_t mbedtls_test_wrap_psa_verify_hash_complete( - psa_verify_hash_interruptible_operation_t *arg0_operation) -{ - psa_status_t status = (psa_verify_hash_complete)(arg0_operation); - return status; -} - -/* Wrapper for psa_verify_hash_start */ -psa_status_t mbedtls_test_wrap_psa_verify_hash_start( - psa_verify_hash_interruptible_operation_t *arg0_operation, - mbedtls_svc_key_id_t arg1_key, - psa_algorithm_t arg2_alg, - const uint8_t *arg3_hash, - size_t arg4_hash_length, - const uint8_t *arg5_signature, - size_t arg6_signature_length) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg3_hash, arg4_hash_length); - MBEDTLS_TEST_MEMORY_POISON(arg5_signature, arg6_signature_length); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - psa_status_t status = (psa_verify_hash_start)(arg0_operation, arg1_key, arg2_alg, arg3_hash, arg4_hash_length, arg5_signature, arg6_signature_length); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg3_hash, arg4_hash_length); - MBEDTLS_TEST_MEMORY_UNPOISON(arg5_signature, arg6_signature_length); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} - -/* Wrapper for psa_verify_message */ -psa_status_t mbedtls_test_wrap_psa_verify_message( - mbedtls_svc_key_id_t arg0_key, - psa_algorithm_t arg1_alg, - const uint8_t *arg2_input, - size_t arg3_input_length, - const uint8_t *arg4_signature, - size_t arg5_signature_length) -{ -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_POISON(arg2_input, arg3_input_length); - MBEDTLS_TEST_MEMORY_POISON(arg4_signature, arg5_signature_length); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - psa_status_t status = (psa_verify_message)(arg0_key, arg1_alg, arg2_input, arg3_input_length, arg4_signature, arg5_signature_length); -#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) - MBEDTLS_TEST_MEMORY_UNPOISON(arg2_input, arg3_input_length); - MBEDTLS_TEST_MEMORY_UNPOISON(arg4_signature, arg5_signature_length); -#endif /* !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS) */ - return status; -} - -#endif /* defined(MBEDTLS_PSA_CRYPTO_C) && defined(MBEDTLS_TEST_HOOKS) && \ - !defined(RECORD_PSA_STATUS_COVERAGE_LOG) */ - -/* End of automatically generated file. */ diff --git a/tests/suites/test_suite_debug.data b/tests/suites/test_suite_debug.data index 46b6be4581..f0d7a029f1 100644 --- a/tests/suites/test_suite_debug.data +++ b/tests/suites/test_suite_debug.data @@ -1,12 +1,46 @@ printf "%" MBEDTLS_PRINTF_SIZET, 0 printf_int_expr:PRINTF_SIZET:sizeof(size_t):0:"0" +printf "%" MBEDTLS_PRINTF_SIZET, 1 byte +printf_int_expr:PRINTF_SIZET:sizeof(size_t):42:"42" + +printf "%" MBEDTLS_PRINTF_SIZET, 4 bytes +printf_int_expr:PRINTF_SIZET:sizeof(size_t):0xfedcba98:"4275878552" + +printf "%" MBEDTLS_PRINTF_SIZET, 8 bytes +depends_on:SIZE_MAX>=0xffffffffffffffff +printf_int_expr:PRINTF_SIZET:sizeof(size_t):0xfedcba9876543210:"18364758544493064720" + printf "%" MBEDTLS_PRINTF_LONGLONG, 0 printf_int_expr:PRINTF_LONGLONG:sizeof(long long):0:"0" +printf "%" MBEDTLS_PRINTF_LONGLONG, 1 byte +printf_int_expr:PRINTF_LONGLONG:sizeof(long long):42:"42" + +printf "%" MBEDTLS_PRINTF_LONGLONG, 4 bytes +printf_int_expr:PRINTF_LONGLONG:sizeof(long long):0xfedcba98:"4275878552" + +printf "%" MBEDTLS_PRINTF_LONGLONG, 8 bytes +printf_int_expr:PRINTF_LONGLONG:sizeof(long long):0x7edcba9876543210:"9141386507638288912" + +printf "%" MBEDTLS_PRINTF_LONGLONG, 8 bytes, negative +printf_int_expr:PRINTF_LONGLONG:sizeof(long long):-0x7edcba9876543210:"-9141386507638288912" + printf "%" MBEDTLS_PRINTF_MS_TIME, 0 printf_int_expr:PRINTF_MS_TIME:sizeof(mbedtls_ms_time_t):0:"0" +printf "%" MBEDTLS_PRINTF_MS_TIME, 1 byte +printf_int_expr:PRINTF_MS_TIME:sizeof(mbedtls_ms_time_t):42:"42" + +printf "%" MBEDTLS_PRINTF_MS_TIME, 4 bytes +printf_int_expr:PRINTF_MS_TIME:sizeof(mbedtls_ms_time_t):0xfedcba98:"4275878552" + +printf "%" MBEDTLS_PRINTF_MS_TIME, 8 bytes +printf_int_expr:PRINTF_MS_TIME:sizeof(mbedtls_ms_time_t):0x7edcba9876543210:"9141386507638288912" + +printf "%" MBEDTLS_PRINTF_MS_TIME, 8 bytes, negative +printf_int_expr:PRINTF_MS_TIME:sizeof(mbedtls_ms_time_t):-0x7edcba9876543210:"-9141386507638288912" + Debug print msg (threshold 1, level 0) debug_print_msg_threshold:1:0:"MyFile":999:"MyFile(0999)\: Text message, 2 == 2\n"