Function esp_idf_sys::psa_pake_output
source · pub unsafe extern "C" fn psa_pake_output(
operation: *mut psa_pake_operation_t,
step: psa_pake_step_t,
output: *mut u8,
output_size: usize,
output_length: *mut usize,
) -> psa_status_t
Expand description
Get output 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 of the algorithm for which the output is requested. \param[out] output Buffer where the output is to be written 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 output_size Size of the \p output buffer in bytes. This must be at least #PSA_PAKE_OUTPUT_SIZE(\c alg, \c primitive, \p output_step) where \c alg and \p primitive are the PAKE algorithm and primitive in the operation’s cipher suite, and \p step is the output step.
\param[out] output_length On success, the number of bytes of the returned output.
\retval #PSA_SUCCESS Success. \retval #PSA_ERROR_BUFFER_TOO_SMALL The size of the \p output buffer is too small. \retval #PSA_ERROR_INVALID_ARGUMENT \p step is not compatible with the operation’s algorithm. \retval #PSA_ERROR_NOT_SUPPORTED \p step is not supported with the operation’s algorithm. \retval #PSA_ERROR_INSUFFICIENT_ENTROPY \emptydescription \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.