Function esp_idf_svc::hal::sys::psa_key_derivation_input_bytes
source · pub unsafe extern "C" fn psa_key_derivation_input_bytes(
operation: *mut psa_key_derivation_s,
step: u16,
data: *const u8,
data_length: usize,
) -> i32
Expand description
Provide an input for key derivation or key agreement.
Which inputs are required and in what order depends on the algorithm. Refer to the documentation of each key derivation or key agreement algorithm for information.
This function passes direct inputs, which is usually correct for
non-secret inputs. To pass a secret input, which should be in a key
object, call psa_key_derivation_input_key() instead of this function.
Refer to the documentation of individual step types
(PSA_KEY_DERIVATION_INPUT_xxx
values of type ::psa_key_derivation_step_t)
for more information.
If this function returns an error status, the operation enters an error state and must be aborted by calling psa_key_derivation_abort().
\param[in,out] operation The key derivation operation object to use. It must have been set up with psa_key_derivation_setup() and must not have produced any output yet. \param step Which step the input data is for. \param[in] data Input data to use. \param data_length Size of the \p data buffer in bytes.
\retval #PSA_SUCCESS Success. \retval #PSA_ERROR_INVALID_ARGUMENT \c step is not compatible with the operation’s algorithm, or \c step does not allow direct inputs. \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription \retval #PSA_ERROR_BAD_STATE The operation state is not valid for this input \p step, 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.