Function esp_idf_hal::sys::psa_verify_hash_start
source ยท pub unsafe extern "C" fn psa_verify_hash_start(
operation: *mut psa_verify_hash_interruptible_operation_s,
key: u32,
alg: u32,
hash: *const u8,
hash_length: usize,
signature: *const u8,
signature_length: usize,
) -> i32
Expand description
\brief Start reading and verifying a hash or short message, in an interruptible manner.
\see \c psa_verify_hash_complete()
\warning This is a beta API, and thus subject to change at any point. It is not bound by the usual interface stability promises.
\note This function combined with \c psa_verify_hash_complete() is equivalent to \c psa_verify_hash() but \c psa_verify_hash_complete() can return early and resume according to the limit set with \c psa_interruptible_set_max_ops() to reduce the maximum time spent in a function.
\note Users should call \c psa_verify_hash_complete() repeatedly on the same operation object after a successful call to this function until \c psa_verify_hash_complete() either returns 0 or an error. \c psa_verify_hash_complete() will return #PSA_OPERATION_INCOMPLETE if there is more work to do. Alternatively users can call \c psa_verify_hash_abort() at any point if they no longer want the result.
\note If this function returns an error status, the operation enters an error state and must be aborted by calling \c psa_verify_hash_abort().
\param[in, out] operation The \c psa_verify_hash_interruptible_operation_t to use. This must be initialized first.
\param key Identifier of the key to use for the operation. The key must allow the usage #PSA_KEY_USAGE_VERIFY_HASH. \param alg A signature algorithm (\c PSA_ALG_XXX value such that #PSA_ALG_IS_SIGN_HASH(\p alg) is true), that is compatible with the type of \p key. \param[in] hash The hash whose signature is to be verified. \param hash_length Size of the \p hash buffer in bytes. \param[in] signature Buffer containing the signature to verify. \param signature_length Size of the \p signature buffer in bytes.
\retval #PSA_SUCCESS The operation started successfully - please call \c psa_verify_hash_complete() with the same context to complete the operation.
\retval #PSA_ERROR_BAD_STATE Another operation has already been started on this context, and is still in progress.
\retval #PSA_ERROR_NOT_PERMITTED The key does not have the #PSA_KEY_USAGE_VERIFY_HASH flag, or it does not permit the requested algorithm.
\retval #PSA_ERROR_NOT_SUPPORTED \emptydescription \retval #PSA_ERROR_INVALID_ARGUMENT \emptydescription \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_DATA_CORRUPT \emptydescription \retval PSA_ERROR_DATA_INVALID \emptydescription \retval #PSA_ERROR_BAD_STATE 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.