mbedtls_ecdh_make_public() function
This function generates a public key and exports it as a TLS ClientKeyExchange payload. This is the second function used by a TLS client for ECDH(E) ciphersuites. \see ecp.h
Arguments
ctx
The ECDH context to use. This must be initialized and bound to a group, the latter usually by mbedtls_ecdh_read_params().
olen
The address at which to store the number of Bytes written. This must not be \c NULL.
buf
The destination buffer. This must be a writable buffer of length \p blen Bytes.
blen
The size of the destination buffer \p buf in Bytes.
f_rng
The RNG function to use. This must not be \c NULL.
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 value
\c 0 on success. #MBEDTLS_ERR_ECP_IN_PROGRESS if maximum number of operations was reached: see \c mbedtls_ecp_set_max_ops(). Another \c MBEDTLS_ERR_ECP_XXX error code on failure.