This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef _APP_H_ | |
#define _APP_H_ | |
#include <assert.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdarg.h> | |
#include "sgx_error.h" /* sgx_status_t */ | |
#include "sgx_eid.h" /* sgx_enclave_id_t */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <assert.h> | |
# include <unistd.h> | |
# include <pwd.h> | |
# define MAX_PATH FILENAME_MAX | |
#include "sgx_urts.h" | |
#include "App.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef _ENCLAVE_H_ | |
#define _ENCLAVE_H_ | |
#include <stdlib.h> | |
#include <assert.h> | |
#if defined(__cplusplus) | |
extern "C" { | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdarg.h> | |
#include <stdio.h> /* vsnprintf */ | |
#include "Enclave.h" | |
#include "Enclave_t.h" /* print_string */ | |
/* | |
* printf: | |
* Invokes OCALL to display the enclave buffer to the terminal. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sgx_status_t printf_helloworld(sgx_enclave_id_t eid); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Enclave.edl - Top EDL file. */ | |
enclave { | |
/* Import ECALL/OCALL from sub-directory EDLs. | |
* [from]: specifies the location of EDL file. | |
* [import]: specifies the functions to import, | |
* [*]: implies to import all functions. | |
*/ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef ENCLAVE_U_H__ | |
#define ENCLAVE_U_H__ | |
#include <stdint.h> | |
#include <wchar.h> | |
#include <stddef.h> | |
#include <string.h> | |
#include "sgx_edger8r.h" /* for sgx_satus_t etc. */ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <iostream> | |
#include "Enclave_u.h" | |
#include "sgx_urts.h" | |
#include "sgx_utils/sgx_utils.h" | |
/* Global EID shared by multiple threads */ | |
sgx_enclave_id_t global_eid = 0; | |
// OCall implementations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "Enclave_t.h" | |
int generate_random_number() { | |
ocall_print("Processing random number generation..."); | |
return 42; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "sgx_trts.h" | |
#include "sgx_tseal.h" | |
#include "string.h" | |
#include "Enclave_t.h" | |
/** | |
* @brief Seals the plaintext given into the sgx_sealed_data_t structure | |
* given. | |
* | |
* @details The plaintext can be any data. uint8_t is used to represent a |
OlderNewer