Function esp_idf_svc::hal::sys::mbedtls_ecjpake_setup

source ยท
pub unsafe extern "C" fn mbedtls_ecjpake_setup(
    ctx: *mut mbedtls_ecjpake_context,
    role: u32,
    hash: u32,
    curve: u32,
    secret: *const u8,
    len: usize,
) -> i32
Expand description

\brief Set up an ECJPAKE context for use.

\note Currently the only values for hash/curve allowed by the standard are #MBEDTLS_MD_SHA256/#MBEDTLS_ECP_DP_SECP256R1.

\param ctx The ECJPAKE context to set up. This must be initialized. \param role The role of the caller. This must be either #MBEDTLS_ECJPAKE_CLIENT or #MBEDTLS_ECJPAKE_SERVER. \param hash The identifier of the hash function to use, for example #MBEDTLS_MD_SHA256. \param curve The identifier of the elliptic curve to use, for example #MBEDTLS_ECP_DP_SECP256R1. \param secret The pre-shared secret (passphrase). This must be a readable not empty buffer of length \p len Bytes. It need only be valid for the duration of this call. \param len The length of the pre-shared secret \p secret.

\return \c 0 if successful. \return A negative error code on failure.