0.2.0-dev Download ZIP
44 lines ·1.1 KB Raw
| 1 | /** |
| 2 | * \file entropy_poll.h |
| 3 | * |
| 4 | * \brief Platform-specific and custom entropy polling functions |
| 5 | */ |
| 6 | /* |
| 7 | * Copyright The Mbed TLS Contributors |
| 8 | * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later |
| 9 | */ |
| 10 | #ifndef TF_PSA_CRYPTO_ENTROPY_POLL_H |
| 11 | #define TF_PSA_CRYPTO_ENTROPY_POLL_H |
| 12 | |
| 13 | #include "tf-psa-crypto/build_info.h" |
| 14 | |
| 15 | #include <stddef.h> |
| 16 | |
| 17 | #ifdef __cplusplus |
| 18 | extern "C" { |
| 19 | #endif |
| 20 | |
| 21 | #define MBEDTLS_ENTROPY_POLL_PLATFORM_MIN 32 |
| 22 | |
| 23 | /** |
| 24 | * This function is either provided by the library |
| 25 | * (if #MBEDTLS_PSA_BUILTIN_GET_ENTROPY is enabled) |
| 26 | * or provided externally (if #MBEDTLS_PSA_DRIVER_GET_ENTROPY is enabled). |
| 27 | */ |
| 28 | int mbedtls_entropy_poll_platform(void *data, unsigned char *output, size_t len, size_t *olen); |
| 29 | |
| 30 | #if defined(MBEDTLS_ENTROPY_NV_SEED) |
| 31 | /** |
| 32 | * \brief Entropy poll callback for a non-volatile seed file |
| 33 | * |
| 34 | * \note This must accept NULL as its first argument. |
| 35 | */ |
| 36 | int mbedtls_nv_seed_poll(void *data, |
| 37 | unsigned char *output, size_t len, size_t *olen); |
| 38 | #endif |
| 39 | |
| 40 | #ifdef __cplusplus |
| 41 | } |
| 42 | #endif |
| 43 | |
| 44 | #endif /* TF_PSA_CRYPTO_ENTROPY_POLL_H */ |