This section introduces the SHA driver APIs including terms and acronyms, supported features, software architecture, details on how to use this driver, SHA function groups, enums, structures and functions.
More...
This section introduces the SHA driver APIs including terms and acronyms, supported features, software architecture, details on how to use this driver, SHA function groups, enums, structures and functions.
Terms and acronyms
Supported features
- Support five mode encryption. The hardware has five different behaviors according to the software mode configuration:
- SHA1 mode: In this mode, hardware will encrypt in sha1.
- SHA224 mode: In this mode, hardware will encrypt in sha224.
- SHA256 mode: In this mode, hardware will encrypt in sha256.
- SHA384 mode: In this mode, hardware will encrypt in sha384.
- SHA512 mode: In this mode, hardware will encrypt in sha512.
How to use this driver
- Use SHA1 to encrypt.
- The others encrypt steps are just like SHA1.
|
| hal_sha_status_t | hal_sha1_init (hal_sha1_context_t *context) |
| | This function initializes the SHA1 engine. More...
|
| |
| hal_sha_status_t | hal_sha1_append (hal_sha1_context_t *context, uint8_t *message, uint32_t length) |
| | This function appends data for SHA1 operation. More...
|
| |
| hal_sha_status_t | hal_sha1_end (hal_sha1_context_t *context, uint8_t digest_message[HAL_SHA1_DIGEST_SIZE]) |
| | This function ends the SHA1 operation and gets the SHA1 result. More...
|
| |
| hal_sha_status_t | hal_sha224_init (hal_sha224_context_t *context) |
| | This function initializes the SHA224 engine. More...
|
| |
| hal_sha_status_t | hal_sha224_append (hal_sha224_context_t *context, uint8_t *message, uint32_t length) |
| | This function appends data for SHA224 operation. More...
|
| |
| hal_sha_status_t | hal_sha224_end (hal_sha224_context_t *context, uint8_t digest_message[HAL_SHA224_DIGEST_SIZE]) |
| | This function ends the SHA224 operation and gets the SHA224 result. More...
|
| |
| hal_sha_status_t | hal_sha256_init (hal_sha256_context_t *context) |
| | This function initializes the SHA256 engine. More...
|
| |
| hal_sha_status_t | hal_sha256_append (hal_sha256_context_t *context, uint8_t *message, uint32_t length) |
| | This function appends data for SHA256 operation. More...
|
| |
| hal_sha_status_t | hal_sha256_end (hal_sha256_context_t *context, uint8_t digest_message[HAL_SHA256_DIGEST_SIZE]) |
| | This function ends the SHA256 operation and gets the SHA256 result. More...
|
| |
| hal_sha_status_t | hal_sha384_init (hal_sha384_context_t *context) |
| | This function initializes the SHA384 engine. More...
|
| |
| hal_sha_status_t | hal_sha384_append (hal_sha384_context_t *context, uint8_t *message, uint32_t length) |
| | This function appends data for SHA384 operation. More...
|
| |
| hal_sha_status_t | hal_sha384_end (hal_sha384_context_t *context, uint8_t digest_message[HAL_SHA384_DIGEST_SIZE]) |
| | This function ends the SHA384 operation and gets the SHA384 result. More...
|
| |
| hal_sha_status_t | hal_sha512_init (hal_sha512_context_t *context) |
| | This function initializes the SHA512 engine. More...
|
| |
| hal_sha_status_t | hal_sha512_append (hal_sha512_context_t *context, uint8_t *message, uint32_t length) |
| | This function appends data for SHA512 operation. More...
|
| |
| hal_sha_status_t | hal_sha512_end (hal_sha512_context_t *context, uint8_t digest_message[HAL_SHA512_DIGEST_SIZE]) |
| | This function ends the SHA512 operation and gets the SHA512 result. More...
|
| |
This function appends data for SHA1 operation.
- Parameters
-
| [in] | context | is the paramter of this API, see hal_sha_context_t. |
| [in] | message | is the source data buffer. |
| [in] | length | is the data length. |
- Returns
- HAL_SHA_STATUS_OK, if the operation completed successfully.
- Example
- Sample code, please refer to How to use this driver.
This function ends the SHA1 operation and gets the SHA1 result.
- Parameters
-
| [in] | context | is the paramter of this API, see hal_sha_context_t. |
| [out] | digest_message | is the SHA1 result. |
- Returns
- HAL_SHA_STATUS_OK, if the operation completed successfully.
- Example
- Sample code, please refer to How to use this driver.
This function appends data for SHA224 operation.
- Parameters
-
| [in] | context | is the paramter of this API, see hal_sha_context_t. |
| [in] | message | is the source data buffer. |
| [in] | length | is the data length. |
- Returns
- HAL_SHA_STATUS_OK, if the operation completed successfully.
- Example
- Sample code, please refer to How to use this driver.
This function ends the SHA224 operation and gets the SHA224 result.
- Parameters
-
| [in] | context | is the paramter of this API, see hal_sha_context_t. |
| [out] | digest_message | is the SHA224 result. |
- Returns
- HAL_SHA_STATUS_OK, if the operation completed successfully.
- Example
- Sample code, please refer to How to use this driver.
This function appends data for SHA256 operation.
- Parameters
-
| [in] | context | is the paramter of this API, see hal_sha_context_t. |
| [in] | message | is the source data buffer. |
| [in] | length | is the data length. |
- Returns
- HAL_SHA_STATUS_OK, if the operation completed successfully.
- Example
- Sample code, please refer to How to use this driver.
This function ends the SHA256 operation and gets the SHA256 result.
- Parameters
-
| [in] | context | is the paramter of this API, see hal_sha_context_t. |
| [out] | digest_message | is the SHA256 result. |
- Returns
- HAL_SHA_STATUS_OK, if the operation completed successfully.
- Example
- Sample code, please refer to How to use this driver.
This function appends data for SHA384 operation.
- Parameters
-
| [in] | context | is the paramter of this API, see hal_sha_context_t. |
| [in] | message | is the source data buffer. |
| [in] | length | is the data length. |
- Returns
- HAL_SHA_STATUS_OK, if the operation completed successfully.
- Example
- Sample code, please refer to How to use this driver.
This function ends the SHA384 operation and gets the SHA384 result.
- Parameters
-
| [in] | context | is the paramter of this API, see hal_sha_context_t. |
| [out] | digest_message | is the SHA384 result. |
- Returns
- HAL_SHA_STATUS_OK, if the operation completed successfully.
- Example
- Sample code, please refer to How to use this driver.
This function appends data for SHA512 operation.
- Parameters
-
| [in] | context | is the paramter of this API, see hal_sha_context_t. |
| [in] | message | is the source data buffer. |
| [in] | length | is the data length. |
- Returns
- HAL_SHA_STATUS_OK, if the operation completed successfully.
- Example
- Sample code, please refer to How to use this driver.
This function ends the SHA512 operation and gets the SHA512 result.
- Parameters
-
| [in] | context | is the paramter of this API, see hal_sha_context_t. |
| [out] | digest_message | is the SHA512 result. |
- Returns
- HAL_SHA_STATUS_OK, if the operation completed successfully.
- Example
- Sample code, please refer to How to use this driver.