Function esp_idf_svc::sys::psa_pake_set_user

source ·
pub unsafe extern "C" fn psa_pake_set_user(
    operation: *mut psa_pake_operation_s,
    user_id: *const u8,
    user_id_len: usize,
) -> i32
Expand description

Set the user ID for a password-authenticated key exchange.

Call this function to set the user ID. For PAKE algorithms that associate a user identifier with each side of the session you need to call psa_pake_set_peer() as well. For PAKE algorithms that associate a single user identifier with the session, call psa_pake_set_user() only.

Refer to the documentation of individual PAKE algorithm types (PSA_ALG_XXX values of type ::psa_algorithm_t such that #PSA_ALG_IS_PAKE(\c alg) is true) for more information.

\param[in,out] operation The operation object to set the user ID for. It must have been set up by psa_pake_setup() and not yet in use (neither psa_pake_output() nor psa_pake_input() has been called yet). It must be on operation for which the user ID hasn’t been set (psa_pake_set_user() hasn’t been called yet). \param[in] user_id The user ID to authenticate with. \param user_id_len Size of the \p user_id buffer in bytes.

\retval #PSA_SUCCESS Success. \retval #PSA_ERROR_INVALID_ARGUMENT \p user_id is not valid for the \p operation’s algorithm and cipher suite. \retval #PSA_ERROR_NOT_SUPPORTED The value of \p user_id is not supported by the implementation. \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription \retval #PSA_ERROR_BAD_STATE The operation state is not valid, or the library has not been previously initialized by psa_crypto_init(). It is implementation-dependent whether a failure to initialize results in this error code.