Mayank Gupta / Mbed OS pelion-example-frdm

Dependencies:   FXAS21002 FXOS8700Q

Embed: (wiki syntax)

« Back to documentation index

pal_drbg.h File Reference

pal_drbg.h File Reference

PAL DRBG. This file contains the real-time OS APIs and is a part of the PAL service API. More...

Go to the source code of this file.

Functions

palStatus_t pal_osRandomBuffer (uint8_t *randomBuf, size_t bufSizeBytes)
 Generate random number into given buffer with given size in bytes.
palStatus_t pal_osRandom32bit (uint32_t *randomInt)
 Generate a 32-bit random number.

Detailed Description

PAL DRBG. This file contains the real-time OS APIs and is a part of the PAL service API.

It provides thread, timers, semaphores, mutexes and memory pool management APIs as well as random API.

Definition in file pal_drbg.h.


Function Documentation

palStatus_t pal_osRandom32bit ( uint32_t *  randomInt )

Generate a 32-bit random number.

Parameters:
[out]randomIntA 32-bit buffer to hold the generated number.
Note:
`pal_init()` MUST be called before this function.
If non-volatile entropy is expected, the entropy must be in storage when this function is called. Non-volatile entropy may be injected using `pal_plat_osEntropyInject()`.
Returns:
PAL_SUCCESS on success, a negative value indicating a specific error code in case of failure.

Definition at line 29 of file pal_drbg.c.

palStatus_t pal_osRandomBuffer ( uint8_t *  randomBuf,
size_t  bufSizeBytes 
)

Generate random number into given buffer with given size in bytes.

Parameters:
[out]randomBufA buffer to hold the generated number.
[in]bufSizeBytesThe size of the buffer and the size of the required random number to generate.
Note:
`pal_init()` MUST be called before this function.
If non-volatile entropy is expected, the entropy must have been injected before this function is called. If entropy has not been injected to non-volatile memory, us `pal_plat_osEntropyInject()`.
Returns:
PAL_SUCCESS on success, a negative value indicating a specific error code in case of failure.

Definition at line 21 of file pal_drbg.c.