33 lines
714 B
C
33 lines
714 B
C
#ifndef _APP_UTIL_H_
|
|
#define _APP_UTIL_H_
|
|
|
|
#include <sgx_urts.h>
|
|
|
|
|
|
|
|
/*
|
|
* @brief prints the command syntax and exits with EXIT_FAILURE
|
|
*/
|
|
void syntax_exit(void);
|
|
|
|
void set_bin_name(char* bin_name);
|
|
|
|
void sgx_print_error_message(sgx_status_t ret);
|
|
|
|
int initialize_enclave(char* token_path);
|
|
|
|
sgx_enclave_id_t get_global_eid(void);
|
|
|
|
/*
|
|
* @brief loads a file completely into the HEAP
|
|
*
|
|
* Loads a File into HEAP and returns a dynamically allocated buffer.
|
|
*
|
|
* @param path path of the file
|
|
* @param data allocated buffer output
|
|
* @param data_len length of the allocated buffer
|
|
* @returns 0 on success, non zero on error
|
|
*/
|
|
int load_file(const char* path, uint8_t** data, size_t* data_len);
|
|
|
|
#endif
|