// EnclaveHello.cpp #include "EnclaveHello_t.h" #include "sgx_trts.h" #include // Change a buffer with a constant string if length allows it void enclaveReply(char* buf, size_t len) { const char* reply = "Hello App!"; if (len > strlen(reply)) { memcpy(buf, reply, strlen(reply) + 1); } } // EnclaveHello.edl enclave { from "sgx_tstdc.edl" import *; trusted { /* define ECALLs here. */ public void enclaveReply([out, size=len] char* buf, size_t len); }; untrusted { /* define OCALLs here. */ }; };