What is the maximum size of a buffer that we can allocate inside the enclave?
I mean if I am defining a function in my enclave.edl as follows
public void buffer_block_access([out, size=block_length]char*buffer, size_t block_length);
what is the maximum of "block_length" that I can define?
I malloc a buffer with the size of 2MB in my code like this
const size_t SZ = 2097152; char *buff = (char *)malloc(SZ*sizeof(char));
and when I call the function as mentioned bellow
sgx_status_t stat = buffer_block_access(global_eid, buff, SZ);
It returns back
stat = 3
- General Support
It will depends on two factors:
1. Your system's EPC size: you can modify and configure your EPC size in your system's BIOS
2. your enclave's configuration file(enclavename.config.xml): this is one typical enclave configuration file:
Please pay attention to the high-light part.