Safe API Framework 0.1.0 build 384e6ae
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
Loading...
Searching...
No Matches
Secure Random Bytes

OSAdapter-backed cryptographically secure random bytes. More...

Files

file  src/oal/random/rte_random.c
 Secure random bytes: validates parameters, then dispatches to the OSAdapter registered via rte_osadapter_random_register() (ADR-005).

Macros

#define RTE_RANDOM_MAX_REQUEST   256U
 Largest request rte_random_fill() accepts in one call (bytes).

Functions

rte_status_t rte_random_fill (uint8_t *out, size_t len)
 Fills out with len cryptographically secure random bytes from the registered OSAdapter.

Detailed Description

OSAdapter-backed cryptographically secure random bytes.

Macro Definition Documentation

◆ RTE_RANDOM_MAX_REQUEST

#define RTE_RANDOM_MAX_REQUEST   256U

Largest request rte_random_fill() accepts in one call (bytes).

Definition at line 29 of file rte_random.h.

Function Documentation

◆ rte_random_fill()

rte_status_t rte_random_fill ( uint8_t * out,
size_t len )

Fills out with len cryptographically secure random bytes from the registered OSAdapter.

Parameters
outDestination buffer. Non-NULL.
lenNumber of bytes, 1..RTE_RANDOM_MAX_REQUEST.
Returns
RTE_STATUS_OK with out filled. RTE_STATUS_INVALID_PARAM for a NULL out or len outside 1..RTE_RANDOM_MAX_REQUEST. RTE_STATUS_NOT_INITIALIZED if no OSAdapter is registered. RTE_STATUS_NOT_SUPPORTED if the registered OSAdapter does not implement this operation. RTE_STATUS_HARDWARE_FAULT if the OSAdapter's source failed; out must then not be used.

REQ-OAL-RANDOM-010

Definition at line 34 of file rte_random.c.