![]() |
Synergy Software Package User's Manual
|
RTOS-integrated Crypto HASH Framework Module. More...
Data Structures | |
| struct | sf_crypto_hash_instance_ctrl_t |
Macros | |
| #define | SF_CRYPTO_HASH_CODE_VERSION_MAJOR (2U) |
Functions | |
| ssp_err_t | SF_CRYPTO_HASH_Open (sf_crypto_hash_ctrl_t *const p_api_ctrl, sf_crypto_hash_cfg_t const *const p_cfg) |
| SSP Crypto HASH Framework Open operation. More... | |
| ssp_err_t | SF_CRYPTO_HASH_Close (sf_crypto_hash_ctrl_t *const p_api_ctrl) |
| SSP Crypto HASH Framework Close operation. More... | |
| ssp_err_t | SF_CRYPTO_HASH_MessageDigestInit (sf_crypto_hash_ctrl_t *const p_api_ctrl) |
| SSP Crypto HASH Framework - Generates the initial message digest in an internal context buffer. Can be called once messageDigestFinal() is called to initialize a new digest operation. Unless a different HASH type is used, users do not need to close the module for new digest operation. This is a blocking call. More... | |
| ssp_err_t | SF_CRYPTO_HASH_MessageDigestUpdate (sf_crypto_hash_ctrl_t *const p_api_ctrl, sf_crypto_data_handle_t const *const p_data_in) |
| SSP Crypto HASH Framework - Hashes input data and saves it in an internal context buffer. Can be called multiple times for additional blocks of data. This is a blocking call. More... | |
| ssp_err_t | SF_CRYPTO_HASH_MessageDigestFinal (sf_crypto_hash_ctrl_t *const p_api_ctrl, sf_crypto_data_handle_t *const p_msg_digest, uint32_t *p_size) |
| SSP Crypto HASH Framework - Hashes the last block of data and returns the message digest in the output buffer. Once this function is called, no additional function calls can be made but open function call can be made to initialize a new digest operation. The Output buffer will contain the message digest on success and the buffer length will be updated to reflect the size of the digest. On error, only the length is set to 0.This is a blocking call. More... | |
| ssp_err_t | SF_CRYPTO_HASH_VersionGet (ssp_version_t *const p_version) |
| Gets driver version based on compile time macros. More... | |
RTOS-integrated Crypto HASH Framework Module.
| #define SF_CRYPTO_HASH_CODE_VERSION_MAJOR (2U) |
The API version of SSP Crypto Framework
| ssp_err_t SF_CRYPTO_HASH_Close | ( | sf_crypto_hash_ctrl_t *const | p_api_ctrl | ) |
SSP Crypto HASH Framework Close operation.
| SSP_SUCCESS | The module was successfully closed. |
| SSP_ERR_ASSERTION | NULL is passed through the argument. |
| SSP_ERR_NOT_OPEN | The module has yet been opened. Call Open API first. |
| SSP_ERR_UNSUPPORTED | HASH algorithms are not supported for the MCU part. |
Get a Crypto Framework common control block and the interface.
Check if the Crypto HASH Framework has been opened.
Delete memory resources used by this module and close the HASH HAL module.
Mark the module status as 'Closed'.
Decrement the open counter to enable users to close SF_CRYPTO module.
| ssp_err_t SF_CRYPTO_HASH_MessageDigestFinal | ( | sf_crypto_hash_ctrl_t *const | p_api_ctrl, |
| sf_crypto_data_handle_t *const | p_msg_digest, | ||
| uint32_t * | p_size | ||
| ) |
SSP Crypto HASH Framework - Hashes the last block of data and returns the message digest in the output buffer. Once this function is called, no additional function calls can be made but open function call can be made to initialize a new digest operation. The Output buffer will contain the message digest on success and the buffer length will be updated to reflect the size of the digest. On error, only the length is set to 0.This is a blocking call.
| SSP_SUCCESS | The module updated a message Digest successfully. |
| SSP_ERR_ASSERTION | NULL is passed through an argument. |
| SSP_ERR_INVALID_SIZE | The memory size to store a message digest is not sufficient for the digest type. |
| SSP_ERR_NOT_OPEN | The module has yet been opened. Call Open API first. |
| SSP_ERR_UNSUPPORTED | HASH algorithms are not supported for the MCU part. |
| SSP_ERR_INVALID_CALL | Function call was made if the module state had not yet transitioned to SF_CRYPTO_HASH_DIGEST_UPDATED. |
Get a Crypto Framework common control block and the interface.
Check if the Crypto Framework has been in 'Digest Updated' status. If not, return an error.
Update the message digest.
We are all set now. A message digest is returned. Mark the module status as 'Opened'.
Unlock the module.
| ssp_err_t SF_CRYPTO_HASH_MessageDigestInit | ( | sf_crypto_hash_ctrl_t *const | p_api_ctrl | ) |
SSP Crypto HASH Framework - Generates the initial message digest in an internal context buffer. Can be called once messageDigestFinal() is called to initialize a new digest operation. Unless a different HASH type is used, users do not need to close the module for new digest operation. This is a blocking call.
| SSP_SUCCESS | The module updated a message Digest successfully. |
| SSP_ERR_ASSERTION | NULL is passed through an argument. |
| SSP_ERR_NOT_OPEN | The module has yet been opened. Call Open API first. |
Check if the Crypto HASH Framework module has been opened. If not yet opened, return an error.
Create initial message digest code in the module context.
Mark the module status as 'Digest Initialized'.
| ssp_err_t SF_CRYPTO_HASH_MessageDigestUpdate | ( | sf_crypto_hash_ctrl_t *const | p_api_ctrl, |
| sf_crypto_data_handle_t const *const | p_data_in | ||
| ) |
SSP Crypto HASH Framework - Hashes input data and saves it in an internal context buffer. Can be called multiple times for additional blocks of data. This is a blocking call.
| SSP_SUCCESS | The module updated a message Digest successfully. |
| SSP_ERR_ASSERTION | NULL is passed through an argument. |
| SSP_ERR_NOT_OPEN | The module has yet been opened. Call Open API first. |
| SSP_ERR_UNSUPPORTED | HASH algorithms are not supported for the MCU part. |
| SSP_ERR_INVALID_CALL | Function call was made if the module state had not yet transitioned to SF_CRYPTO_HASH_DIGEST_INITIALIZED. |
Get a Crypto Framework common control block and the interface.
Check if the Crypto Framework has been in 'Digest Initialized' status. If not, return an error.
Update the message digest.
Mark the module status as 'Digest Updated'.
Unlock the module.
| ssp_err_t SF_CRYPTO_HASH_Open | ( | sf_crypto_hash_ctrl_t *const | p_api_ctrl, |
| sf_crypto_hash_cfg_t const *const | p_cfg | ||
| ) |
SSP Crypto HASH Framework Open operation.
| SSP_SUCCESS | The module was successfully opened. |
| SSP_ERR_ASSERTION | NULL is passed through an argument. |
| SSP_ERR_CRYPTO_COMMON_NOT_OPENED | Crypto Framework Common Module has yet been opened. |
| SSP_ERR_ALREADY_OPEN | The module has been already opened. |
| SSP_ERR_UNSUPPORTED | HASH algorithms are not supported for the MCU part. |
Get a Crypto Framework common instance, the control block and interface.
Get a lower-level HASH instance.
Check if the Crypto Framework common instance has been opened. If not yet opened, return an error.
Check if the Crypto HASH Framework module has been opened.
Create memory resources used by this module and open a HASH HAL module.
Increment the open counter.
We have successfully processed the open procedures. Mark the module status as 'Opened'.
| ssp_err_t SF_CRYPTO_HASH_VersionGet | ( | ssp_version_t *const | p_version | ) |
Gets driver version based on compile time macros.
| SSP_SUCCESS | Successful close. |
| SSP_ERR_ASSERTION | The parameter p_version is NULL. |