Function esp_idf_svc::sys::psa_pake_set_password_key

source ·
pub unsafe extern "C" fn psa_pake_set_password_key(
    operation: *mut psa_pake_operation_s,
    password: u32,
) -> i32
Expand description

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.

\param[in,out] 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). \param 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.

\retval #PSA_SUCCESS Success. \retval #PSA_ERROR_INVALID_HANDLE \p password is not a valid key identifier. \retval #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. \retval #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. \retval #PSA_ERROR_NOT_SUPPORTED The key type or key size of \p password is not supported with the \p operation’s cipher suite. \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription \retval #PSA_ERROR_DATA_CORRUPT \emptydescription \retval #PSA_ERROR_DATA_INVALID \emptydescription \retval #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.