psa_pake_set_peer() function
Set the peer ID for a password-authenticated key exchange. Call this function in addition to psa_pake_set_user() for PAKE algorithms that associate a user identifier with each side of the session. 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.
Arguments
operation
The operation object to set the peer 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 peer ID hasn't been set (psa_pake_set_peer() hasn't been called yet).
peer_id
The peer's ID to authenticate.
peer_id_len
Size of the \p peer_id buffer in bytes.
Return value
#PSA_SUCCESS Success. #PSA_ERROR_INVALID_ARGUMENT \p peer_id is not valid for the \p operation's algorithm and cipher suite. #PSA_ERROR_NOT_SUPPORTED The algorithm doesn't associate a second identity with the session. #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription #PSA_ERROR_CORRUPTION_DETECTED \emptydescription #PSA_ERROR_BAD_STATE Calling psa_pake_set_peer() is invalid with the \p operation's algorithm, 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.