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
rte_random.c File Reference

Secure random bytes: validates parameters, then dispatches to the OSAdapter registered via rte_osadapter_random_register() (ADR-005). More...

Include dependency graph for rte_random.c:

Go to the source code of this file.

Functions

rte_status_t rte_osadapter_random_register (const rte_osadapter_random_t *osadapter)
 Registers the OSAdapter random implementation.
rte_status_t rte_random_fill (uint8_t *out, size_t len)
 Fills out with len cryptographically secure random bytes from the registered OSAdapter.

Variables

static const rte_osadapter_random_t * s_osadapter = NULL
 Currently registered OSAdapter, or NULL if none (ADR-005).

Detailed Description

Secure random bytes: validates parameters, then dispatches to the OSAdapter registered via rte_osadapter_random_register() (ADR-005).

Definition in file rte_random.c.

Function Documentation

◆ rte_osadapter_random_register()

rte_status_t rte_osadapter_random_register ( const rte_osadapter_random_t * adapter)

Registers the OSAdapter random implementation.

Global functions

Parameters
adapterPointer to random operations vtable.
Returns
RTE_STATUS_OK on success, RTE_STATUS_INVALID_PARAM if adapter is NULL, or RTE_STATUS_INVALID_STATE if the setup phase is already locked (REQ-LIFECYCLE-001, ADR-026; the previous registration, if any, is kept).

REQ-OAL-RANDOM-011

Definition at line 16 of file rte_random.c.

Variable Documentation

◆ s_osadapter

const rte_osadapter_random_t* s_osadapter = NULL
static

Currently registered OSAdapter, or NULL if none (ADR-005).

Local variables declarations

Definition at line 13 of file rte_random.c.