mbedtls_ecp_read_key() function
This function reads an elliptic curve private key.
Arguments
grp_id
The ECP group identifier.
buf
The buffer containing the binary representation of the key. (Big endian integer for Weierstrass curves, byte string for Montgomery curves.)
buflen
The length of the buffer in bytes.
Return value
\c 0 on success. #MBEDTLS_ERR_ECP_INVALID_KEY error if the key is invalid. #MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed. #MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE if the operation for the group is not implemented. Another negative error code on different kinds of failure.
Notes
This function does not support Curve448 yet.