TI OAD API Documentation  9.14.00
Functions
Interruptible sign/verify hash

Functions

psa_status_t psa_hash_resume (psa_hash_operation_t *operation, const uint8_t *hash_state, size_t hash_state_length)
 Resume a previously suspended hash operation. More...
 
psa_status_t psa_hash_suspend (psa_hash_operation_t *operation, uint8_t *hash_state, size_t hash_state_size, size_t *hash_state_length)
 Suspend an active hash operation. More...
 

Detailed Description

Function Documentation

§ psa_hash_resume()

psa_status_t psa_hash_resume ( psa_hash_operation_t operation,
const uint8_t *  hash_state,
size_t  hash_state_length 
)

Resume a previously suspended hash operation.

Set up a multi-part hash operation using the hash suspend state from a previously suspended hash operation.

Parameters
[in,out]operationThe operation object to set up. It must have been initialized as per the documentation for psa_hash_operation_t and not yet in use.
[in]hash_stateBuffer containing the suspended hash state which is to be resumed.
hash_state_lengthLength of hash_state in bytes.
Return values
#PSA_SUCCESS
#PSA_ERROR_NOT_SUPPORTED
#PSA_ERROR_BAD_STATEThe operation state is not valid: it must be inactive. 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.

§ psa_hash_suspend()

psa_status_t psa_hash_suspend ( psa_hash_operation_t operation,
uint8_t *  hash_state,
size_t  hash_state_size,
size_t *  hash_state_length 
)

Suspend an active hash operation.

Halt the hash operation and extract the intermediate state of the hash computation.

Parameters
[in]operationActive hash operation.
[out]hash_stateBuffer where the hash suspend state is to be written.
hash_state_sizeSize of the hash_state buffer in bytes. This must be appropriate for the selected algorithm.
[out]hash_state_lengthOn success, the number of bytes that make up the hash suspend state.
Return values
#PSA_SUCCESSSuccess. The first (*hash_state_length) bytes of hash_state contain the intermediate hash state.
#PSA_ERROR_NOT_SUPPORTED
#PSA_ERROR_BUFFER_TOO_SMALLThe size of the hash_state buffer is too small. You can determine a sufficient buffer size by calling #PSA_HASH_SUSPEND_OUTPUT_SIZE(alg) where alg is the algorithm that was used to set up the operation.
#PSA_ERROR_BAD_STATEThe operation state is not valid: it must be active. 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.