I found the SGX SDK has a set of ECC crypto APIs but the User Guide is not clear (IMHO) regarding how to use them. So I'm asking for clarification.
Interesting. The documentation (https://software.intel.com/sites/products/sgx-sdk-users-guide-windows/Default.htm) I'm reading says the opposite ([in] v.s. [out]):
I guess you're right and the documentation has a typo?
Surenthar Selvaraj. (Intel) wrote:
- All of the APIs seem to require a sgx_ecc_state_handle_t. But nowhere is stated how this handle should be created. Any idea? -
sgx_ecc256_open_context returns an allocated and initialized context for the elliptic curve cryptosystem over a prime finite field, GF(p). This context must be created prior to calling sgx_ecc256_create_key_pair or sgx_ecc256_compute_shared_dhkey. When the calling code has completed its set of ECC operations, sgx_ecc256_close_context should be called to cleanup and deallocate the ECC context.
- Syntax: sgx_status_t sgx_ecc256_open_context( sgx_ecc_state_handle_t *p_ecc_handle );
- Parameters: p_ecc_handle [out]
This is a handle to the ECC GF(p) context state allocated and initialized used to perform elliptic curve cryptosystem standard functions. The algorithm stores the intermediate results of calculations performed using this context.