37 #include "hal_platform.h" 39 #ifdef HAL_SHA_MODULE_ENABLED 41 #ifdef HAL_SHA_USE_PHYSICAL_MEMORY_ADDRESS 131 #include "hal_define.h" 141 #define HAL_SHA1_BLOCK_SIZE (64) 142 #define HAL_SHA1_DIGEST_SIZE (20) 143 #define HAL_SHA224_BLOCK_SIZE (64) 144 #define HAL_SHA224_DIGEST_SIZE (28) 145 #define HAL_SHA256_BLOCK_SIZE (64) 146 #define HAL_SHA256_DIGEST_SIZE (32) 147 #define HAL_SHA384_BLOCK_SIZE (128) 148 #define HAL_SHA384_DIGEST_SIZE (48) 149 #define HAL_SHA512_BLOCK_SIZE (128) 150 #define HAL_SHA512_DIGEST_SIZE (64) 178 uint32_t hash_value[16];
186 #define hal_sha1_context_t hal_sha_context_t 188 #define hal_sha224_context_t hal_sha_context_t 190 #define hal_sha256_context_t hal_sha_context_t 192 #define hal_sha384_context_t hal_sha_context_t 194 #define hal_sha512_context_t hal_sha_context_t hal_sha_status_t hal_sha1_append(hal_sha_context_t *context, uint8_t *message, uint32_t length)
This function appends data for SHA1 operation.
#define hal_sha384_context_t
This defines SHA384 context structure.
Definition: hal_sha.h:192
uint32_t message_length
Total size.
Definition: hal_sha.h:179
#define HAL_SHA224_DIGEST_SIZE
224 bits = 28 bytes
Definition: hal_sha.h:144
hal_sha_status_t hal_sha512_append(hal_sha_context_t *context, uint8_t *message, uint32_t length)
This function appends data for SHA512 operation.
hal_sha_status_t hal_sha1_end(hal_sha_context_t *context, uint8_t digest_message[(20)])
This function ends the SHA1 operation and gets the SHA1 result.
An error occurred.
Definition: hal_sha.h:163
hal_sha_status_t hal_sha256_append(hal_sha_context_t *context, uint8_t *message, uint32_t length)
This function appends data for SHA256 operation.
#define HAL_SHA512_BLOCK_SIZE
1024 bits = 128 bytes
Definition: hal_sha.h:149
#define hal_sha224_context_t
This defines SHA224 context structure.
Definition: hal_sha.h:188
#define HAL_SHA384_DIGEST_SIZE
384 bits = 48 bytes
Definition: hal_sha.h:148
hal_sha_status_t
This enum defines the HAL interface return value.
Definition: hal_sha.h:162
hal_sha_status_t hal_sha512_init(hal_sha_context_t *context)
This function initializes the SHA512 engine.
hal_sha_status_t hal_sha1_init(hal_sha_context_t *context)
This function initializes the SHA1 engine.
#define hal_sha256_context_t
This defines SHA256 context structure.
Definition: hal_sha.h:190
#define HAL_SHA512_DIGEST_SIZE
512 bits = 64 bytes
Definition: hal_sha.h:150
#define hal_sha512_context_t
This defines SHA512 context structure.
Definition: hal_sha.h:194
uint32_t block_length
Block length for each operation.
Definition: hal_sha.h:182
hal_sha_status_t hal_sha256_end(hal_sha_context_t *context, uint8_t digest_message[(32)])
This function ends the SHA256 operation and gets the SHA256 result.
hal_sha_status_t hal_sha384_end(hal_sha_context_t *context, uint8_t digest_message[(48)])
This function ends the SHA384 operation and gets the SHA384 result.
hal_sha_status_t hal_sha512_end(hal_sha_context_t *context, uint8_t digest_message[(64)])
This function ends the SHA512 operation and gets the SHA512 result.
hal_sha_status_t hal_sha224_init(hal_sha_context_t *context)
This function initializes the SHA224 engine.
SHA context - SHA1/224/256/384/512.
Definition: hal_sha.h:177
hal_sha_status_t hal_sha224_append(hal_sha_context_t *context, uint8_t *message, uint32_t length)
This function appends data for SHA224 operation.
No error occurred.
Definition: hal_sha.h:164
hal_sha_status_t hal_sha224_end(hal_sha_context_t *context, uint8_t digest_message[(28)])
This function ends the SHA224 operation and gets the SHA224 result.
uint8_t * block
A pointer to the start of the buffer.
Definition: hal_sha.h:181
hal_sha_status_t hal_sha384_init(hal_sha_context_t *context)
This function initializes the SHA384 engine.
#define HAL_SHA1_DIGEST_SIZE
160 bits = 20 bytes
Definition: hal_sha.h:142
#define hal_sha1_context_t
This defines SHA1 context structure.
Definition: hal_sha.h:186
hal_sha_status_t hal_sha256_init(hal_sha_context_t *context)
This function initializes the SHA256 engine.
hal_sha_status_t hal_sha384_append(hal_sha_context_t *context, uint8_t *message, uint32_t length)
This function appends data for SHA384 operation.
#define HAL_SHA256_DIGEST_SIZE
256 bits = 32 bytes
Definition: hal_sha.h:146