1 /** Support for memory poisoning wrappers for PSA functions.
2  *
3  *  The wrappers poison the input and output buffers of each function
4  *  before calling it, to ensure that it does not access the buffers
5  *  except by calling the approved buffer-copying functions.
6  *
7  * This header declares support functions. The wrappers themselves are
8  * decalred in the automatically generated file `test/psa_test_wrappers.h`.
9  */
10 /*
11  *  Copyright The Mbed TLS Contributors
12  *  SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
13  */
14 
15 #ifndef PSA_MEMORY_POISONING_WRAPPERS_H
16 #define PSA_MEMORY_POISONING_WRAPPERS_H
17 
18 #include "psa/crypto.h"
19 
20 #include "test/memory.h"
21 
22 #if defined(MBEDTLS_TEST_HOOKS) && defined(MBEDTLS_TEST_MEMORY_CAN_POISON)
23 
24 /**
25  * \brief         Setup the memory poisoning test hooks used by
26  *                psa_crypto_copy_input() and psa_crypto_copy_output() for
27  *                memory poisoning.
28  */
29 void mbedtls_poison_test_hooks_setup(void);
30 
31 /**
32  * \brief         Teardown the memory poisoning test hooks used by
33  *                psa_crypto_copy_input() and psa_crypto_copy_output() for
34  *                memory poisoning.
35  */
36 void mbedtls_poison_test_hooks_teardown(void);
37 
38 #endif /* MBEDTLS_TEST_HOOKS && MBEDTLS_TEST_MEMORY_CAN_POISON */
39 
40 #endif /* PSA_MEMORY_POISONING_WRAPPERS_H */
41