Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: FXAS21002 FXOS8700Q
pal_entropy.h File Reference
PAL entropy. More...
Go to the source code of this file.
Functions | |
palStatus_t | pal_osEntropyInject (const uint8_t *entropyBuf, size_t bufSizeBytes) |
Inject entropy to non-volatile memory, so that the random number generator may use it. |
Detailed Description
PAL entropy.
This file contains entropy injection and is part of the PAL API.
Definition in file pal_entropy.h.
Function Documentation
palStatus_t pal_osEntropyInject | ( | const uint8_t * | entropyBuf, |
size_t | bufSizeBytes | ||
) |
Inject entropy to non-volatile memory, so that the random number generator may use it.
In addition to OS functions, the module implementing `pal_drbg.h` will hold a deterministic random bit generator (DRBG) instance that works with the entropy injected by this function.
- Note:
- This API call must be placed before any function that may attempt to generate a random number, both by the OS or PAL DRBG. After this API call, `pal_osRandomBuffer()`` calls from `pal_drbg.h` will succeed.
- Parameters:
-
entropyBuf - pointer to buffer containing the entropy. bufSizeBytes - size of `entropyBuf` in bytes.
- Returns:
- PAL_SUCCESS - if operation is successful
- PAL_ERR_NOT_SUPPORTED - code compiled in a way that does not expect entropy to be injected. TRNG must be available to inject entropy.
- PAL_ERR_INVALID_ARGUMENT - `bufSizeBytes` too small.
- PAL_ERR_ENTROPY_EXISTS - Entropy already injected.
- PAL_ERR_GENERIC_FAILURE - Another cause of error.
Definition at line 23 of file pal_entropy.c.
Generated on Tue Jul 12 2022 20:21:04 by
