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:

  1. Initialize module with zpal_entropy_init().

  2. 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#

void

Initialize entropy module.

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.

uint8_t

Returns a pseudo random byte.

Function Documentation#

zpal_entropy_init#

void zpal_entropy_init (void )

Initialize entropy module.

Parameters
N/A

Definition at line 50 of file /mnt/raid/workspaces/ws.WDdsgIAV6/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.

Parameters
[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.


Definition at line 63 of file /mnt/raid/workspaces/ws.WDdsgIAV6/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.

Parameters
N/A

Returns

  • Pseudo random byte.


Definition at line 70 of file /mnt/raid/workspaces/ws.WDdsgIAV6/overlay/gsdk/protocol/z-wave/PAL/inc/zpal_entropy.h