mirror of
https://github.com/Fishwaldo/bl_mcu_sdk.git
synced 2025-07-09 14:28:37 +00:00
[feat][sec] add sec trng driver
This commit is contained in:
parent
257890072b
commit
cec78e1093
2 changed files with 18 additions and 0 deletions
|
@ -55,5 +55,8 @@ int sec_ecdh_deinit(sec_ecdh_handle_t *handle);
|
|||
int sec_ecdh_get_encrypt_key(sec_ecdh_handle_t *handle, const uint32_t *pkX, const uint32_t *pkY, const uint32_t *private_key, const uint32_t *pRx, const uint32_t *pRy);
|
||||
int sec_ecdh_get_public_key(sec_ecdh_handle_t *handle, const uint32_t *private_key, const uint32_t *pRx, const uint32_t *pRy);
|
||||
int sec_ecc_get_random_value(uint32_t *randomData, uint32_t *maxRef, uint32_t size);
|
||||
int sec_eng_trng_enable(void);
|
||||
void sec_eng_trng_disable(void);
|
||||
int sec_eng_trng_read(uint8_t data[32]);
|
||||
|
||||
#endif
|
|
@ -1204,6 +1204,21 @@ int sec_ecc_get_random_value(uint32_t *randomData, uint32_t *maxRef, uint32_t si
|
|||
return -1;
|
||||
}
|
||||
|
||||
int sec_eng_trng_enable(void)
|
||||
{
|
||||
return Sec_Eng_Trng_Enable();
|
||||
}
|
||||
|
||||
void sec_eng_trng_disable(void)
|
||||
{
|
||||
Sec_Eng_Trng_Disable();
|
||||
}
|
||||
|
||||
int sec_eng_trng_read(uint8_t data[32])
|
||||
{
|
||||
return Sec_Eng_Trng_Read(data);
|
||||
}
|
||||
|
||||
int sec_ecdh_init(sec_ecdh_handle_t *handle, sec_ecp_type id)
|
||||
{
|
||||
Sec_Eng_PKA_Reset();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue