psa_pake_set_password_key() function
Set the password for a password-authenticated key exchange from key ID. Call this function when the password, or a value derived from the password, is already present in the key store.
Arguments
operation
The operation object to set the password 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 password hasn't been set yet (psa_pake_set_password_key() hasn't been called yet).
password
Identifier of the key holding the password or a value derived from the password (eg. by a memory-hard function). It must remain valid until the operation terminates. It must be of type #PSA_KEY_TYPE_PASSWORD or #PSA_KEY_TYPE_PASSWORD_HASH. It has to allow the usage #PSA_KEY_USAGE_DERIVE.
Return value
#PSA_SUCCESS Success. #PSA_ERROR_INVALID_HANDLE \p password is not a valid key identifier. #PSA_ERROR_NOT_PERMITTED The key does not have the #PSA_KEY_USAGE_DERIVE flag, or it does not permit the \p operation's algorithm. #PSA_ERROR_INVALID_ARGUMENT The key type for \p password is not #PSA_KEY_TYPE_PASSWORD or #PSA_KEY_TYPE_PASSWORD_HASH, or \p password is not compatible with the \p operation's cipher suite. #PSA_ERROR_NOT_SUPPORTED The key type or key size of \p password is not supported with the \p operation's cipher suite. #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription #PSA_ERROR_CORRUPTION_DETECTED \emptydescription #PSA_ERROR_STORAGE_FAILURE \emptydescription #PSA_ERROR_DATA_CORRUPT \emptydescription #PSA_ERROR_DATA_INVALID \emptydescription #PSA_ERROR_BAD_STATE The operation state is not valid (it must have been set up.), 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.