思澈科技软件开发工具包  2.20

Macros

#define HAL_HASH_busy()   (hwp_aes_acc->STATUS & AES_ACC_STATUS_BUSY)
 

Functions

int HAL_HASH_init (uint32_t *iv, uint8_t algo, uint32_t length)
 Initialize AES Hash hardware block. More...
 
HAL_StatusTypeDef HAL_HASH_run (uint8_t *in_data, int size, int final)
 run Hash hardware More...
 
HAL_StatusTypeDef HAL_HASH_run_IT (uint8_t *in_data, int size, int final)
 run Hash hardware, return immediately, generate AES HASH interrupt when done. More...
 
void HAL_HASH_result (uint8_t *out_data)
 Get hash result. More...
 
int HAL_HASH_reset (void)
 Reset AES HASH hardware block. More...
 
void HAL_HASH_IRQHandler (void)
 AES HASH IRQ handler.
 

Detailed Description

HASH_exported_constants

Macro Definition Documentation

◆ HAL_HASH_busy

#define HAL_HASH_busy ( )    (hwp_aes_acc->STATUS & AES_ACC_STATUS_BUSY)

Test whether AES hardware block is busy.

Function Documentation

◆ HAL_HASH_init()

int HAL_HASH_init ( uint32_t *  iv,
uint8_t  algo,
uint32_t  length 
)

Initialize AES Hash hardware block.

Parameters
ivinitial vector, must be 32bit aligned, if NULL, use algorithm default initial vector.
algohash algorithm
lengthfinished length
Return values
0if successful, otherwise -1

◆ HAL_HASH_reset()

int HAL_HASH_reset ( void  )

Reset AES HASH hardware block.

Return values
0if successful, otherwise -1

◆ HAL_HASH_result()

void HAL_HASH_result ( uint8_t *  out_data)

Get hash result.

Parameters
out_dataoutput data, Size of out_data depends on hash algorithm
Note
SHA224 result is 28 bytes, but internal need 32 byte, please allocate 32 bytes for usage.

◆ HAL_HASH_run()

HAL_StatusTypeDef HAL_HASH_run ( uint8_t *  in_data,
int  size,
int  final 
)

run Hash hardware

Parameters
in_datainput data, input data could not in ITCM or Retention memory
sizelength of input data in bytes.
finalLast block
Return values
HAL_OKif successful, otherwise HAL_ERROR

◆ HAL_HASH_run_IT()

HAL_StatusTypeDef HAL_HASH_run_IT ( uint8_t *  in_data,
int  size,
int  final 
)

run Hash hardware, return immediately, generate AES HASH interrupt when done.

Parameters
in_datainput data, input data could not in ITCM or Retention memory
sizelength of input data in bytes.
finalLast block
Return values
HAL_OKif successful, otherwise HAL_ERROR