Zpal-entropy#
Defines a platform abstraction layer for the Z-Wave random number generation.
How to use the entropy API:
All the ZPAL entropy APIs are required to be implemented.
The following outlines an example of use:
Initialize module with zpal_entropy_init().
Invoke zpal_get_random_data() or zpal_get_pseudo_random() to get generated data.
Requirements:
zpal_get_random_data() generates random data from entropy sources available on platform. Since collecting entropy from hardware may take some time, Z-Wave SDK shall invoke it only once during initialization of PRNG.
zpal_get_pseudo_random() is used for non-security related operations such as generating session IDs or calculating delays. Therefore, the execution speed is highly preferred over true randomness of the output.
Functions#
Initialize entropy module.
Generate true random array of bytes based on the given length and fill a data buffer.
Returns a pseudo random byte.
Function Documentation#
zpal_entropy_init#
void zpal_entropy_init (void )
Initialize entropy module.
N/A |
50
of file /mnt/raid/workspaces/ws.Mh9rMZz8x/overlay/gsdk/protocol/z-wave/PAL/inc/zpal_entropy.h
zpal_get_random_data#
zpal_status_t zpal_get_random_data (uint8_t * data, size_t len)
Generate true random array of bytes based on the given length and fill a data buffer.
[out] | data | A pointer to where the random array of bytes are stored in data buffer. It MUST NOT be NULL. |
[in] | len | The requested size of the random array of bytes that shall be stored in the data buffer. |
Note that this function may shut down the radio while getting the data.
Returns
ZPAL_STATUS_OK if the random array of bytes are generated and stored in the data buffer. ZPAL_STATUS_OK if the random array of bytes are not generated.
63
of file /mnt/raid/workspaces/ws.Mh9rMZz8x/overlay/gsdk/protocol/z-wave/PAL/inc/zpal_entropy.h
zpal_get_pseudo_random#
uint8_t zpal_get_pseudo_random (void )
Returns a pseudo random byte.
N/A |
Returns
Pseudo random byte.
70
of file /mnt/raid/workspaces/ws.Mh9rMZz8x/overlay/gsdk/protocol/z-wave/PAL/inc/zpal_entropy.h