MT7687 API Reference  LinkIt SDK v4
SHA

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

Overview

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

Terms Details
SHA Secure Hash Algorithm. For more information, please refer to introduction to the SHA in Wikipedia .

Supported features

How to use this driver

Functions

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

Modules

 Define
 
 Enum
 
 Struct
 

Function Documentation

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.

Parameters
[in]contextis the paramter of this API, see hal_sha_context_t.
[in]messageis the source data buffer.
[in]lengthis the data length.
Returns
HAL_SHA_STATUS_OK, if the operation completed successfully.
Example
Sample code, please refer to How to use this driver.
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.

Parameters
[in]contextis the paramter of this API, see hal_sha_context_t.
[out]digest_messageis the SHA1 result.
Returns
HAL_SHA_STATUS_OK, if the operation completed successfully.
Example
Sample code, please refer to How to use this driver.
hal_sha_status_t hal_sha1_init ( hal_sha1_context_t context)

This function initializes the SHA1 engine.

Parameters
[in]contextis the paramter of this API, see hal_sha_context_t.
Returns
HAL_SHA_STATUS_OK, if the operation completed successfully.
See also
hal_sha1_init
Example
Sample code, please refer to How to use this driver.
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.

Parameters
[in]contextis the paramter of this API, see hal_sha_context_t.
[in]messageis the source data buffer.
[in]lengthis the data length.
Returns
HAL_SHA_STATUS_OK, if the operation completed successfully.
Example
Sample code, please refer to How to use this driver.
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.

Parameters
[in]contextis the paramter of this API, see hal_sha_context_t.
[out]digest_messageis the SHA224 result.
Returns
HAL_SHA_STATUS_OK, if the operation completed successfully.
Example
Sample code, please refer to How to use this driver.
hal_sha_status_t hal_sha224_init ( hal_sha224_context_t context)

This function initializes the SHA224 engine.

Parameters
[in]contextis the paramter of this API, see hal_sha_context_t.
Returns
HAL_SHA_STATUS_OK, if the operation completed successfully.
See also
hal_sha224_init
Example
Sample code, please refer to How to use this driver.
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.

Parameters
[in]contextis the paramter of this API, see hal_sha_context_t.
[in]messageis the source data buffer.
[in]lengthis the data length.
Returns
HAL_SHA_STATUS_OK, if the operation completed successfully.
Example
Sample code, please refer to How to use this driver.
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.

Parameters
[in]contextis the paramter of this API, see hal_sha_context_t.
[out]digest_messageis the SHA256 result.
Returns
HAL_SHA_STATUS_OK, if the operation completed successfully.
Example
Sample code, please refer to How to use this driver.
hal_sha_status_t hal_sha256_init ( hal_sha256_context_t context)

This function initializes the SHA256 engine.

Parameters
[in]contextis the paramter of this API, see hal_sha_context_t.
Returns
HAL_SHA_STATUS_OK, if the operation completed successfully.
See also
hal_sha256_init
Example
Sample code, please refer to How to use this driver.
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.

Parameters
[in]contextis the paramter of this API, see hal_sha_context_t.
[in]messageis the source data buffer.
[in]lengthis the data length.
Returns
HAL_SHA_STATUS_OK, if the operation completed successfully.
Example
Sample code, please refer to How to use this driver.
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.

Parameters
[in]contextis the paramter of this API, see hal_sha_context_t.
[out]digest_messageis the SHA384 result.
Returns
HAL_SHA_STATUS_OK, if the operation completed successfully.
Example
Sample code, please refer to How to use this driver.
hal_sha_status_t hal_sha384_init ( hal_sha384_context_t context)

This function initializes the SHA384 engine.

Parameters
[in]contextis the paramter of this API, see hal_sha_context_t.
Returns
HAL_SHA_STATUS_OK, if the operation completed successfully.
See also
hal_sha384_init
Example
Sample code, please refer to How to use this driver.
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.

Parameters
[in]contextis the paramter of this API, see hal_sha_context_t.
[in]messageis the source data buffer.
[in]lengthis the data length.
Returns
HAL_SHA_STATUS_OK, if the operation completed successfully.
Example
Sample code, please refer to How to use this driver.
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.

Parameters
[in]contextis the paramter of this API, see hal_sha_context_t.
[out]digest_messageis the SHA512 result.
Returns
HAL_SHA_STATUS_OK, if the operation completed successfully.
Example
Sample code, please refer to How to use this driver.
hal_sha_status_t hal_sha512_init ( hal_sha512_context_t context)

This function initializes the SHA512 engine.

Parameters
[in]contextis the paramter of this API, see hal_sha_context_t.
Returns
HAL_SHA_STATUS_OK, if the operation completed successfully.
See also
hal_sha512_init
Example
Sample code, please refer to How to use this driver.