no-OS
no_os_trng.h
Go to the documentation of this file.
1 /***************************************************************************/
41 #ifndef _NO_OS_TRNG_H_
42 #define _NO_OS_TRNG_H_
43 
44 /******************************************************************************/
45 /***************************** Include Files **********************************/
46 /******************************************************************************/
47 
48 #include <stdint.h>
49 
50 /******************************************************************************/
51 /*************************** Types Declarations *******************************/
52 /******************************************************************************/
53 
60 
69  void *extra;
70 };
71 
78  uint32_t dev_id;
80  void *extra;
83 };
84 
92  int (*init)(struct no_os_trng_desc **,
93  const struct no_os_trng_init_param *);
95  int (*fill_buffer)(struct no_os_trng_desc *, uint8_t *, uint32_t);
97  int (*remove)(struct no_os_trng_desc *);
98 };
99 
100 /******************************************************************************/
101 /************************ Functions Declarations ******************************/
102 /******************************************************************************/
103 
104 /* Initialize descriptor */
105 int no_os_trng_init(struct no_os_trng_desc **desc,
106  const struct no_os_trng_init_param *param);
107 
108 /* Free resources allocated in descriptor */
109 int no_os_trng_remove(struct no_os_trng_desc *desc);
110 
111 /* Fill buffer with random numbers */
112 int no_os_trng_fill_buffer(struct no_os_trng_desc *desc, uint8_t *buff,
113  uint32_t len);
114 
115 #endif // _NO_OS_TRNG_H_
no_os_trng_init_param::extra
void * extra
Definition: no_os_trng.h:80
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:92
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:83
no_os_trng_platform_ops::remove
int(* remove)(struct no_os_trng_desc *)
Definition: no_os_trng.h:97
no_os_trng_desc
TRNG Descriptor.
Definition: no_os_trng.h:65
no_os_trng_init_param::dev_id
uint32_t dev_id
Definition: no_os_trng.h:78
no_os_trng_init_param
Init parameter for TRNG.
Definition: no_os_trng.h:76
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:58
no_os_trng_platform_ops::fill_buffer
int(* fill_buffer)(struct no_os_trng_desc *, uint8_t *, uint32_t)
Definition: no_os_trng.h:95
no_os_trng_desc::platform_ops
const struct no_os_trng_platform_ops * platform_ops
Definition: no_os_trng.h:67
no_os_trng_init_param::platform_ops
const struct no_os_trng_platform_ops * platform_ops
Definition: no_os_trng.h:82
no_os_trng_desc::extra
void * extra
Definition: no_os_trng.h:69
no_os_trng_platform_ops
Structure holding TRNG function pointers that point to the platform specific function.
Definition: no_os_trng.h:90
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:101