no-OS
Loading...
Searching...
No Matches
no_os_trng.h File Reference

Header file of true random number generator. More...

#include <stdint.h>
Include dependency graph for no_os_trng.h:

Classes

struct  no_os_trng_desc
 TRNG Descriptor. More...
 
struct  no_os_trng_init_param
 Init parameter for TRNG. More...
 
struct  no_os_trng_platform_ops
 Structure holding TRNG function pointers that point to the platform specific function. More...
 

Functions

int no_os_trng_init (struct no_os_trng_desc **desc, const struct no_os_trng_init_param *param)
 Initialize the TRNG.
 
int no_os_trng_remove (struct no_os_trng_desc *desc)
 Free the resources allocated by no_os_trng_init().
 
int no_os_trng_fill_buffer (struct no_os_trng_desc *desc, uint8_t *buff, uint32_t len)
 Fill buffer with rng data.
 

Detailed Description

Header file of true random number generator.

Author
Mihail Chindris (mihai.nosp@m.l.ch.nosp@m.indri.nosp@m.s@an.nosp@m.alog..nosp@m.com)

SPDX-License-Identifier: BSD-3-Clause

Function Documentation

◆ no_os_trng_fill_buffer()

int no_os_trng_fill_buffer ( struct no_os_trng_desc * desc,
uint8_t * buff,
uint32_t len )

Fill buffer with rng data.

Parameters
desc- The TRNG descriptor.
buff- Buffer to be filled
len- Size of the buffer
Returns
0 in case of success, -1 otherwise.

◆ no_os_trng_init()

int no_os_trng_init ( struct no_os_trng_desc ** desc,
const struct no_os_trng_init_param * param )

Initialize the TRNG.

Parameters
desc- The TRNG descriptor.
param- The structure that contains the TRNG parameters.
Returns
0 in case of success, -1 otherwise.

◆ no_os_trng_remove()

int no_os_trng_remove ( struct no_os_trng_desc * desc)

Free the resources allocated by no_os_trng_init().

Parameters
desc- The TRNG descriptor.
Returns
0 in case of success, -1 otherwise.