32 lines
		
	
	
		
			588 B
		
	
	
	
		
			C
		
	
	
	
	
	
		
		
			
		
	
	
			32 lines
		
	
	
		
			588 B
		
	
	
	
		
			C
		
	
	
	
	
	
| 
								 | 
							
								// Functionality for internal usage only
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								// TODO: USE EFUSE FOR RISC-V BUILD
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#ifndef iotelic_keystorage_H
							 | 
						||
| 
								 | 
							
								#define iotelic_keystorage_H
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#include <stdint.h>
							 | 
						||
| 
								 | 
							
								#include "global.h"
							 | 
						||
| 
								 | 
							
								#include "keystorage_slots.h"
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								typedef enum {
							 | 
						||
| 
								 | 
							
								    KEYSTORAGE_ERROR_GENERAL = -1,
							 | 
						||
| 
								 | 
							
								    KEYSTORAGE_ERROR_PARAMS = -2,
							 | 
						||
| 
								 | 
							
								} KEYSTORAGE_RESULT;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#ifdef __cplusplus
							 | 
						||
| 
								 | 
							
								extern "C" {
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								int
							 | 
						||
| 
								 | 
							
								keystorage_save(KEYSTORAGE_SLOT slot, const uint8_t * data, size_t data_sz);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								int
							 | 
						||
| 
								 | 
							
								keystorage_load(KEYSTORAGE_SLOT slot, uint8_t * data, size_t buf_sz, size_t * read_sz);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#ifdef __cplusplus
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#endif // iotelic_keystorage
							 |