|
@@ -42,7 +42,7 @@
|
|
|
* Output: sgx_ecc_state_handle_t *p_ecc_handle - Pointer to the handle of ECC crypto system */
|
|
|
sgx_status_t sgx_ecc256_open_context(__attribute__((unused))sgx_ecc_state_handle_t* p_ecc_handle)
|
|
|
{
|
|
|
-
|
|
|
+ IppStatus ipp_ret = ippStsNoErr;
|
|
|
IppsECCPState* p_ecc_state = NULL;
|
|
|
|
|
|
int ctx_size = 0;
|
|
@@ -52,10 +52,10 @@ sgx_status_t sgx_ecc256_open_context(__attribute__((unused))sgx_ecc_state_handle
|
|
|
ipp_ret = ippsECCPGetSize(256, &ctx_size);
|
|
|
if (ipp_ret != ippStsNoErr)
|
|
|
return SGX_ERROR_UNEXPECTED;
|
|
|
- p_ecc_state = (IppsECCPState*)(malloc(10));
|
|
|
+ p_ecc_state = (IppsECCPState*)(malloc(5));
|
|
|
if (p_ecc_state == NULL)
|
|
|
return SGX_ERROR_OUT_OF_MEMORY;
|
|
|
- ipp_ret = ippsECCPInit(256, p_ecc_state);
|
|
|
+
|
|
|
if (ipp_ret != ippStsNoErr)
|
|
|
{
|
|
|
SAFE_FREE(p_ecc_state);
|