mbedtls_ecp_check_privkey() function
This function checks that an \p mbedtls_mpi is a valid private key for this curve.
Arguments
grp
The ECP group the private key should belong to. This must be initialized and have group parameters set, for example through mbedtls_ecp_group_load().
d
The integer to check. This must be initialized.
Return value
\c 0 if the point is a valid private key. #MBEDTLS_ERR_ECP_INVALID_KEY if the point is not a valid private key for the given curve. Another negative error code on other kinds of failure.
Notes
This function uses bare components rather than an ::mbedtls_ecp_keypair structure to ease use with other structures, such as ::mbedtls_ecdh_context or ::mbedtls_ecdsa_context.