no-OS
no_os_trng.h
Go to the documentation of this file.
1 /***************************************************************************/
35 #ifndef _NO_OS_TRNG_H_
36 #define _NO_OS_TRNG_H_
37 
38 /******************************************************************************/
39 /***************************** Include Files **********************************/
40 /******************************************************************************/
41 
42 #include <stdint.h>
43 
44 /******************************************************************************/
45 /*************************** Types Declarations *******************************/
46 /******************************************************************************/
47 
54 
63  void *extra;
64 };
65 
72  uint32_t dev_id;
74  void *extra;
77 };
78 
86  int (*init)(struct no_os_trng_desc **,
87  const struct no_os_trng_init_param *);
89  int (*fill_buffer)(struct no_os_trng_desc *, uint8_t *, uint32_t);
91  int (*remove)(struct no_os_trng_desc *);
92 };
93 
94 /******************************************************************************/
95 /************************ Functions Declarations ******************************/
96 /******************************************************************************/
97 
98 /* Initialize descriptor */
99 int no_os_trng_init(struct no_os_trng_desc **desc,
100  const struct no_os_trng_init_param *param);
101 
102 /* Free resources allocated in descriptor */
103 int no_os_trng_remove(struct no_os_trng_desc *desc);
104 
105 /* Fill buffer with random numbers */
106 int no_os_trng_fill_buffer(struct no_os_trng_desc *desc, uint8_t *buff,
107  uint32_t len);
108 
109 #endif // _NO_OS_TRNG_H_
no_os_trng_init_param::extra
void * extra
Definition: no_os_trng.h:74
no_os_trng_platform_ops::init
int(* init)(struct no_os_trng_desc **, const struct no_os_trng_init_param *)
Definition: no_os_trng.h:86
no_os_trng_remove
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:77
no_os_trng_platform_ops::remove
int(* remove)(struct no_os_trng_desc *)
Definition: no_os_trng.h:91
no_os_trng_desc
TRNG Descriptor.
Definition: no_os_trng.h:59
no_os_trng_init_param::dev_id
uint32_t dev_id
Definition: no_os_trng.h:72
no_os_trng_init_param
Init parameter for TRNG.
Definition: no_os_trng.h:70
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.
Definition: no_os_trng.c:52
no_os_trng_platform_ops::fill_buffer
int(* fill_buffer)(struct no_os_trng_desc *, uint8_t *, uint32_t)
Definition: no_os_trng.h:89
no_os_trng_desc::platform_ops
const struct no_os_trng_platform_ops * platform_ops
Definition: no_os_trng.h:61
no_os_trng_init_param::platform_ops
const struct no_os_trng_platform_ops * platform_ops
Definition: no_os_trng.h:76
no_os_trng_desc::extra
void * extra
Definition: no_os_trng.h:63
no_os_trng_platform_ops
Structure holding TRNG function pointers that point to the platform specific function.
Definition: no_os_trng.h:84
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.
Definition: no_os_trng.c:95