SmartSnippets DA1459x SDK
sys_trng_v2.h
Go to the documentation of this file.
1 
46 #ifndef SYS_TRNG_V2_H_
47 #define SYS_TRNG_V2_H_
48 
49 
50 #if dg_configUSE_SYS_TRNG
51 
52 #include <stdint.h>
53 #include "sdk_defs.h"
54 #include "iid_platform.h"
55 #include "iid_irng.h"
56 #include "iid_aes_types.h"
57 #include "iid_return_codes.h"
58 
59 /*
60  * MACROS
61  *****************************************************************************************
62  */
63 
67 #define SYS_TRNG_SEED_SIZE (IRNG_RANDOM_SEED_SIZE_BYTES)
68 
73 #define SYS_TRNG_MEMORY_BLOCKS (IRNG_MINIMUM_SRAM_PUF_BLOCKS + 4)
74 
75 #if (SYS_TRNG_MEMORY_BLOCKS < IRNG_MINIMUM_SRAM_PUF_BLOCKS)
76 #error "The number of SYS_TRNG_MEMORY_BLOCKS must be equal or greater than IRNG_MINIMUM_SRAM_PUF_BLOCKS"
77 #endif
78 
79 /*
80  * TYPE DEFINITIONS
81  *****************************************************************************************
82  */
83 
87 typedef enum {
88  SYS_TRNG_ERROR_NONE = IID_SUCCESS,
89  SYS_TRNG_ERROR_NOT_ALLOWED = IID_NOT_ALLOWED,
90  SYS_TRNG_ERROR_INVALID_PARAMETERS = IID_INVALID_PARAMETERS,
91  SYS_TRNG_ERROR_INVALID_SRAM_PUF_DATA = IID_ERROR_SRAM_PUF_DATA,
92  SYS_TRNG_ERROR_INSUFFICIENT_SRAM_BLOCKS = IID_ERROR_INSUFFICIENT_SRAM_BLOCKS,
93  SYS_TRNG_ERROR_AES_TIMEOUT = IID_ERROR_AES_TIMEOUT,
94  SYS_TRNG_ERROR_AES_FAILED = IID_ERROR_AES_FAILED,
96 
97 /*
98  * FUNCTION DECLARATIONS
99  *****************************************************************************************
100  */
101 
107 bool sys_trng_can_run(void);
108 
121 
122 
123 #endif /* dg_configUSE_SYS_TRNG */
124 
125 
126 #endif /* SYS_TRNG_V2_H_ */
127 
sdk_defs.h
Central include header file with platform definitions.
sys_trng_init
SYS_TRNG_ERROR sys_trng_init(void)
Runs a software algorithm which generates a random seed. Random memory data are used to feed the soft...
SYS_TRNG_ERROR
SYS_TRNG_ERROR
SYS_TRNG error codes.
Definition: sys_trng_v2.h:87
sys_trng_can_run
bool sys_trng_can_run(void)
Checks whether the TRNG module can generate a seed or not.