psa_verify_hash_start() function
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.
Arguments
key
Identifier of the key to use for the operation. The key must allow the usage #PSA_KEY_USAGE_VERIFY_HASH.
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.
hash
The hash whose signature is to be verified.
hash_length
Size of the \p hash buffer in bytes.
signature
Buffer containing the signature to verify.
signature_length
Size of the \p signature buffer in bytes.
Return value
#PSA_SUCCESS The operation started successfully - please call \c psa_verify_hash_complete() with the same context to complete the operation. #PSA_ERROR_BAD_STATE Another operation has already been started on this context, and is still in progress. #PSA_ERROR_NOT_PERMITTED The key does not have the #PSA_KEY_USAGE_VERIFY_HASH flag, or it does not permit the requested algorithm. #PSA_ERROR_NOT_SUPPORTED \emptydescription #PSA_ERROR_INVALID_ARGUMENT \emptydescription #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription #PSA_ERROR_HARDWARE_FAILURE \emptydescription #PSA_ERROR_CORRUPTION_DETECTED \emptydescription #PSA_ERROR_STORAGE_FAILURE \emptydescription PSA_ERROR_DATA_CORRUPT \emptydescription PSA_ERROR_DATA_INVALID \emptydescription #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.
Notes
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. 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. If this function returns an error status, the operation enters an error state and must be aborted by calling \c psa_verify_hash_abort().