no-OS
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
no_os_trng.h
Go to the documentation of this file.
1/***************************************************************************/
34
35#ifndef _NO_OS_TRNG_H_
36#define _NO_OS_TRNG_H_
37
38#include <stdint.h>
39
46
57
70
78 int (*init)(struct no_os_trng_desc **,
79 struct no_os_trng_init_param *);
81 int (*fill_buffer)(struct no_os_trng_desc *, uint8_t *, uint32_t);
83 int (*remove)(struct no_os_trng_desc *);
84};
85
86/* Initialize descriptor */
87int no_os_trng_init(struct no_os_trng_desc **desc,
88 const struct no_os_trng_init_param *param);
89
90/* Free resources allocated in descriptor */
91int no_os_trng_remove(struct no_os_trng_desc *desc);
92
93/* Fill buffer with random numbers */
94int no_os_trng_fill_buffer(struct no_os_trng_desc *desc, uint8_t *buff,
95 uint32_t len);
96
97#endif // _NO_OS_TRNG_H_
int no_os_trng_remove(struct no_os_trng_desc *desc)
Free the resources allocated by no_os_trng_init().
Definition no_os_trng.c:70
int no_os_trng_init(struct no_os_trng_desc **desc, const struct no_os_trng_init_param *param)
Initialize the TRNG.
Definition no_os_trng.c:45
int no_os_trng_fill_buffer(struct no_os_trng_desc *desc, uint8_t *buff, uint32_t len)
Fill buffer with rng data.
Definition no_os_trng.c:88
TRNG Descriptor.
Definition no_os_trng.h:51
void * extra
Definition no_os_trng.h:55
const struct no_os_trng_platform_ops * platform_ops
Definition no_os_trng.h:53
Init parameter for TRNG.
Definition no_os_trng.h:62
void * extra
Definition no_os_trng.h:66
uint32_t dev_id
Definition no_os_trng.h:64
const struct no_os_trng_platform_ops * platform_ops
Definition no_os_trng.h:68
Structure holding TRNG function pointers that point to the platform specific function.
Definition no_os_trng.h:76
int(* init)(struct no_os_trng_desc **, struct no_os_trng_init_param *)
Definition no_os_trng.h:78
int(* remove)(struct no_os_trng_desc *)
Definition no_os_trng.h:83
int(* fill_buffer)(struct no_os_trng_desc *, uint8_t *, uint32_t)
Definition no_os_trng.h:81