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

Implementation of the TRNG Interface. More...

#include <inttypes.h>
#include "no_os_trng.h"
#include <stdlib.h>
#include "no_os_error.h"
Include dependency graph for no_os_trng.c:

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

Implementation of the TRNG Interface.

Author
Antoniu Miclaus (anton.nosp@m.iu.m.nosp@m.iclau.nosp@m.s@an.nosp@m.alog..nosp@m.com)

Copyright 2023(c) Analog Devices, Inc.

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.