no-OS
Classes | Functions
trng.h File Reference

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

#include <stdint.h>
Include dependency graph for trng.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  trng_init_param
 Init parameter for TRNG. More...
 

Functions

int32_t trng_init (struct trng_desc **desc, struct trng_init_param *param)
 Initialize descriptor. More...
 
void trng_remove (struct trng_desc *desc)
 Free resources allocated in descriptor. More...
 
int32_t trng_fill_buffer (struct trng_desc *desc, uint8_t *buff, uint32_t len)
 Fill buffer with random numbers. More...
 

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)

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Function Documentation

◆ trng_fill_buffer()

int32_t trng_fill_buffer ( struct trng_desc desc,
uint8_t *  buff,
uint32_t  len 
)

Fill buffer with random numbers.

Parameters
desc- TRNG descriptor
buff- Buffer to be filled
len- Size of the buffer
Returns
SUCCESS if no errors, FAILURE is an error occurs and the data in the buffer is not useful.

◆ trng_init()

int32_t trng_init ( struct trng_desc **  desc,
struct trng_init_param param 
)

Initialize descriptor.

Parameters
desc- Where to store the TRNG Descriptor
param- Unused
Returns
SUCCESS or FAILURE if desc is null

◆ trng_remove()

void trng_remove ( struct trng_desc desc)

Free resources allocated in descriptor.

Parameters
desc- TRNG Descriptor