How to create a function within an enclave that is callable from an untrusted application
Unable to call an Intel® Software Guard Extensions (Intel® SGX) trusted function from an untrusted application.
Trusted functions can be called only from within an enclave via an enclave call (ECALL).
Refer to the Enclave Development Basics section in the Intel® SGX SDK Developer Reference Guide for Windows* for complete details on ECALLs, outside calls (OCALLs), and other topics for developing Intel® SGX applications.
The SGX101 enclave_example, which is based on the SampleEnclave in the SGX SDK, is a simple tutorial on creating an enclave with a single ECALL and OCALL.
The Intel® SGX Developer Reference for Linux* is in the Documentation folder of the latest release of the Intel® Software Guard Extensions SDK for Linux*.