Function esp_idf_svc::sys::mbedtls_ecp_gen_privkey

source ·
pub unsafe extern "C" fn mbedtls_ecp_gen_privkey(
    grp: *const mbedtls_ecp_group,
    d: *mut mbedtls_mpi,
    f_rng: Option<unsafe extern "C" fn(_: *mut c_void, _: *mut u8, _: usize) -> i32>,
    p_rng: *mut c_void,
) -> i32
Expand description

\brief This function generates a private key.

\param grp The ECP group to generate a private key for. This must be initialized and have group parameters set, for example through mbedtls_ecp_group_load(). \param d The destination MPI (secret part). This must be initialized. \param f_rng The RNG function. This must not be \c NULL. \param p_rng The RNG parameter to be passed to \p f_rng. This may be \c NULL if \p f_rng doesn’t need a context argument.

\return \c 0 on success. \return An \c MBEDTLS_ERR_ECP_XXX or \c MBEDTLS_MPI_XXX error code on failure.