mbedtls_pk_ec() function
Quick access to an EC context inside a PK context. \warning This function can only be used when the type of the context, as returned by mbedtls_pk_get_type(), is #MBEDTLS_PK_ECKEY, #MBEDTLS_PK_ECKEY_DH, or #MBEDTLS_PK_ECDSA. Ensuring that is the caller's responsibility. Alternatively, you can check whether this function returns NULL.
Return value
The internal EC context held by the PK context, or NULL.