Function esp_idf_sys::mbedtls_ecdh_make_params
source · pub unsafe extern "C" fn mbedtls_ecdh_make_params(
ctx: *mut mbedtls_ecdh_context,
olen: *mut usize,
buf: *mut c_uchar,
blen: usize,
f_rng: Option<unsafe extern "C" fn(arg1: *mut c_void, arg2: *mut c_uchar, arg3: usize) -> c_int>,
p_rng: *mut c_void,
) -> c_int
Expand description
\brief This function generates an EC key pair and exports its in the format used in a TLS ServerKeyExchange handshake message.
This is the second function used by a TLS server for ECDHE
ciphersuites. (It is called after mbedtls_ecdh_setup().)
\see ecp.h
\param ctx The ECDH context to use. This must be initialized and bound to a group, for example via mbedtls_ecdh_setup(). \param olen The address at which to store the number of Bytes written. \param buf The destination buffer. This must be a writable buffer of length \p blen Bytes. \param blen The length of the destination buffer \p buf in Bytes. \param f_rng The RNG function to use. This must not be \c NULL. \param p_rng The RNG context to be passed to \p f_rng. This may be \c NULL in case \p f_rng doesn’t need a context argument.
\return \c 0 on success. \return #MBEDTLS_ERR_ECP_IN_PROGRESS if maximum number of operations was reached: see \c mbedtls_ecp_set_max_ops(). \return Another \c MBEDTLS_ERR_ECP_XXX error code on failure.