| 1 | /* TF_PSA_CRYPTO_USER_CONFIG_FILE for testing. |
| 2 | * Only used for a few test configurations. |
| 3 | * |
| 4 | * Typical usage (note multiple levels of quoting): |
| 5 | * cmake -DTF_PSA_CRYPTO_USER_CONFIG_FILE="./tests/configs/user-config-for-test.h\" |
| 6 | */ |
| 7 | |
| 8 | /* |
| 9 | * Copyright The Mbed TLS Contributors |
| 10 | * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later |
| 11 | */ |
| 12 | |
| 13 | #if defined(MBEDTLS_PSA_INJECT_ENTROPY) |
| 14 | /* The #MBEDTLS_PSA_INJECT_ENTROPY feature requires two extra platform |
| 15 | * functions, which must be configured as #MBEDTLS_PLATFORM_NV_SEED_READ_MACRO |
| 16 | * and #MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO. The job of these functions |
| 17 | * is to read and write from the entropy seed file, which is located |
| 18 | * in the PSA ITS file whose uid is #PSA_CRYPTO_ITS_RANDOM_SEED_UID. |
| 19 | * (These could have been provided as library functions, but for historical |
| 20 | * reasons, they weren't, and so each integrator has to provide a copy |
| 21 | * of these functions.) |
| 22 | * |
| 23 | * Provide implementations of these functions for testing. */ |
| 24 | #include <stddef.h> |
| 25 | int mbedtls_test_inject_entropy_seed_read(unsigned char *buf, size_t len); |
| 26 | int mbedtls_test_inject_entropy_seed_write(unsigned char *buf, size_t len); |
| 27 | #define MBEDTLS_PLATFORM_NV_SEED_READ_MACRO mbedtls_test_inject_entropy_seed_read |
| 28 | #define MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO mbedtls_test_inject_entropy_seed_write |
| 29 | #endif /* MBEDTLS_PSA_INJECT_ENTROPY */ |