Function esp_idf_svc::hal::sys::psa_pake_input

source ·
pub unsafe extern "C" fn psa_pake_input(
    operation: *mut psa_pake_operation_s,
    step: u8,
    input: *const u8,
    input_length: usize,
) -> i32
Expand description

Provide input for a step of a password-authenticated key exchange.

Depending on the algorithm being executed, you might need to call this function several times or you might not need to call this at all.

The exact sequence of calls to perform a password-authenticated key exchange depends on the algorithm in use. 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.

If this function returns an error status, the operation enters an error state and must be aborted by calling psa_pake_abort().

\param[in,out] operation Active PAKE operation. \param step The step for which the input is provided. \param[in] input Buffer containing the input in the format appropriate for this \p step. Refer to the documentation of the individual \c PSA_PAKE_STEP_XXX constants for more information. \param input_length Size of the \p input buffer in bytes.

\retval #PSA_SUCCESS Success. \retval #PSA_ERROR_INVALID_SIGNATURE The verification fails for a #PSA_PAKE_STEP_ZK_PROOF input step. \retval #PSA_ERROR_INVALID_ARGUMENT \p input_length is not compatible with the \p operation’s algorithm, or the \p input is not valid for the \p operation’s algorithm, cipher suite or \p step. \retval #PSA_ERROR_NOT_SUPPORTED \p step p is not supported with the \p operation’s algorithm, or the \p input is not supported for the \p operation’s algorithm, cipher suite or \p step. \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription \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 be active, and fully set up, and this call must conform to the algorithm’s requirements for ordering of input and output steps), 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.