ISARA Radiate Key State Manager  Version 1.2
A framework for safe storage of LMS private key state.
ikm_io.h
Go to the documentation of this file.
1 
16 #ifndef IKM_IO_H
17 #define IKM_IO_H
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 #include <stddef.h>
24 #include <stdint.h>
25 
26 #include "ikm_retval.h"
27 #include "iqr_api.h"
28 
29 // ---------------------------------------------------------------------------------------------------------------------------------
30 // Opaque data type.
31 // ---------------------------------------------------------------------------------------------------------------------------------
32 
34 typedef struct ikm_IO_struct ikm_IO;
35 
36 // ---------------------------------------------------------------------------------------------------------------------------------
37 // Data structure.
38 // ---------------------------------------------------------------------------------------------------------------------------------
39 
49 typedef struct {
65  ikm_retval (*initialize)(const void *user_ctx, void **io_ctx);
66 
76  ikm_retval (*cleanup)(void **io_ctx);
77 
87  ikm_retval (*get_size)(void *io_ctx, uint32_t obj_id, size_t *size);
88 
99  ikm_retval (*read)(void *io_ctx, uint32_t obj_id, uint8_t *data, size_t data_size);
100 
111  ikm_retval (*write)(void *io_ctx, uint32_t obj_id, const uint8_t *data, size_t data_size);
112 
124  ikm_retval (*remove)(void *io_ctx, uint32_t obj_id);
126 
127 // ---------------------------------------------------------------------------------------------------------------------------------
128 // Input/Output interface object initialization and destruction.
129 // ---------------------------------------------------------------------------------------------------------------------------------
130 
142 IQR_API
143 ikm_retval ikm_IOInterfaceCreate(const ikm_IOCallbacks *cb, void *user_ctx, ikm_IO **io);
144 
154 IQR_API_UNENFORCED_RETURN
156 
157 // ---------------------------------------------------------------------------------------------------------------------------------
158 // Simple File Input/Output interface.
159 // ---------------------------------------------------------------------------------------------------------------------------------
160 
174 IQR_API
175 ikm_retval ikm_IOCreateSimpleFileIO(const char *path, ikm_IO **io);
176 
177 #ifdef __cplusplus
178 }
179 #endif
180 
181 #endif /* IKM_IO_H */
struct ikm_IO_struct ikm_IO
Definition: ikm_io.h:34
ikm_retval
Definition: ikm_retval.h:22
IQR_API ikm_retval ikm_IOCreateSimpleFileIO(const char *path, ikm_IO **io)
IQR_API ikm_retval ikm_IOInterfaceCreate(const ikm_IOCallbacks *cb, void *user_ctx, ikm_IO **io)
IQR_API_UNENFORCED_RETURN ikm_retval ikm_IOInterfaceDestroy(ikm_IO **io)
Definition: ikm_io.h:49