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...
 

Detailed Description

RTOS-integrated Crypto HASH Framework Module.

Macro Definition Documentation

◆ SF_CRYPTO_HASH_CODE_VERSION_MAJOR

#define SF_CRYPTO_HASH_CODE_VERSION_MAJOR   (2U)

The API version of SSP Crypto Framework

Function Documentation

◆ SF_CRYPTO_HASH_Close()

ssp_err_t SF_CRYPTO_HASH_Close ( sf_crypto_hash_ctrl_t *const  p_api_ctrl)

SSP Crypto HASH Framework Close operation.

Return values
SSP_SUCCESSThe module was successfully closed.
SSP_ERR_ASSERTIONNULL is passed through the argument.
SSP_ERR_NOT_OPENThe module has yet been opened. Call Open API first.
SSP_ERR_UNSUPPORTEDHASH algorithms are not supported for the MCU part.
Returns
See Common Error Codes for other possible return codes.

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.

◆ SF_CRYPTO_HASH_MessageDigestFinal()

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.

Return values
SSP_SUCCESSThe module updated a message Digest successfully.
SSP_ERR_ASSERTIONNULL is passed through an argument.
SSP_ERR_INVALID_SIZEThe memory size to store a message digest is not sufficient for the digest type.
SSP_ERR_NOT_OPENThe module has yet been opened. Call Open API first.
SSP_ERR_UNSUPPORTEDHASH algorithms are not supported for the MCU part.
SSP_ERR_INVALID_CALLFunction call was made if the module state had not yet transitioned to SF_CRYPTO_HASH_DIGEST_UPDATED.
Returns
See Common Error Codes for other possible return codes.
Note
p_msg_digest->p_data must be WORD aligned. The memory allocation to store a message digest is user's responsibility.

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.

◆ SF_CRYPTO_HASH_MessageDigestInit()

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.

Return values
SSP_SUCCESSThe module updated a message Digest successfully.
SSP_ERR_ASSERTIONNULL is passed through an argument.
SSP_ERR_NOT_OPENThe module has yet been opened. Call Open API first.
Returns
See Common Error Codes for other possible return codes.
Note
When this function is called if SF_CRYPTO_HASH_DIGEST_INITIALIZED or SF_CRYPTO_HASH_DIGEST_UPDATED, the message digest will be initialized.

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'.

◆ SF_CRYPTO_HASH_MessageDigestUpdate()

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.

Return values
SSP_SUCCESSThe module updated a message Digest successfully.
SSP_ERR_ASSERTIONNULL is passed through an argument.
SSP_ERR_NOT_OPENThe module has yet been opened. Call Open API first.
SSP_ERR_UNSUPPORTEDHASH algorithms are not supported for the MCU part.
SSP_ERR_INVALID_CALLFunction call was made if the module state had not yet transitioned to SF_CRYPTO_HASH_DIGEST_INITIALIZED.
Returns
See Common Error Codes for other possible return codes.

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.

◆ SF_CRYPTO_HASH_Open()

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.

Return values
SSP_SUCCESSThe module was successfully opened.
SSP_ERR_ASSERTIONNULL is passed through an argument.
SSP_ERR_CRYPTO_COMMON_NOT_OPENEDCrypto Framework Common Module has yet been opened.
SSP_ERR_ALREADY_OPENThe module has been already opened.
SSP_ERR_UNSUPPORTEDHASH algorithms are not supported for the MCU part.
Returns
See Common Error Codes for other possible return codes.

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'.

◆ SF_CRYPTO_HASH_VersionGet()

ssp_err_t SF_CRYPTO_HASH_VersionGet ( ssp_version_t *const  p_version)

Gets driver version based on compile time macros.

Return values
SSP_SUCCESSSuccessful close.
SSP_ERR_ASSERTIONThe parameter p_version is NULL.