Function esp_idf_svc::hal::sys::psa_sign_hash_complete
source ยท pub unsafe extern "C" fn psa_sign_hash_complete(
operation: *mut psa_sign_hash_interruptible_operation_s,
signature: *mut u8,
signature_size: usize,
signature_length: *mut usize,
) -> i32
Expand description
\brief Continue and eventually complete the action of signing a hash or short message with a private key, in an interruptible manner.
\see \c psa_sign_hash_start()
\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_sign_hash_start() is equivalent to \c psa_sign_hash() but this function 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 call.
\note Users should call this function on the same operation object repeatedly until it either returns 0 or an error. This function will return #PSA_OPERATION_INCOMPLETE if there is more work to do. Alternatively users can call \c psa_sign_hash_abort() at any point if they no longer want the result.
\note When this function returns successfully, the operation becomes inactive. If this function returns an error status, the operation enters an error state and must be aborted by calling \c psa_sign_hash_abort().
\param[in, out] operation The \c psa_sign_hash_interruptible_operation_t to use. This must be initialized first, and have had \c psa_sign_hash_start() called with it first.
\param[out] signature Buffer where the signature is to be written. \param signature_size Size of the \p signature buffer in bytes. This must be appropriate for the selected algorithm and key: - The required signature size is #PSA_SIGN_OUTPUT_SIZE(\c key_type, \c key_bits, \c alg) where \c key_type and \c key_bits are the type and bit-size respectively of key. - #PSA_SIGNATURE_MAX_SIZE evaluates to the maximum signature size of any supported signature algorithm. \param[out] signature_length On success, the number of bytes that make up the returned signature value.
\retval #PSA_SUCCESS Operation completed successfully
\retval #PSA_OPERATION_INCOMPLETE Operation was interrupted due to the setting of \c psa_interruptible_set_max_ops(). There is still work to be done. Call this function again with the same operation object.
\retval #PSA_ERROR_BUFFER_TOO_SMALL The size of the \p signature buffer is too small. You can determine a sufficient buffer size by calling #PSA_SIGN_OUTPUT_SIZE(\c key_type, \c key_bits, \c alg) where \c key_type and \c key_bits are the type and bit-size respectively of \c key.
\retval #PSA_ERROR_BAD_STATE An operation was not previously started on this context via \c psa_sign_hash_start().
\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_INSUFFICIENT_ENTROPY \emptydescription \retval #PSA_ERROR_BAD_STATE The library has either not been previously initialized by psa_crypto_init() or you did not previously call psa_sign_hash_start() with this operation object. It is implementation-dependent whether a failure to initialize results in this error code.