mirror of https://github.com/ARMmbed/mbed-os.git
change MBEDTLS_RANDOM_SEED_ITS_UID define to be PSA_CRYPTO_ITS_RANDOM_SEED_UID
parent
72037747b1
commit
0fde6af120
|
@ -7,12 +7,12 @@ int mbed_default_seed_read(unsigned char *buf, size_t buf_len)
|
|||
{
|
||||
struct psa_its_info_t info = {0, 0};
|
||||
size_t actual_size = buf_len;
|
||||
psa_its_get_info(MBED_RANDOM_SEED_ITS_UID, &info);
|
||||
psa_its_get_info(PSA_CRYPTO_ITS_RANDOM_SEED_UID, &info);
|
||||
if (info.size < buf_len)
|
||||
{
|
||||
actual_size = info.size;
|
||||
}
|
||||
psa_its_status_t rc = psa_its_get(MBED_RANDOM_SEED_ITS_UID, 0, actual_size, buf);
|
||||
psa_its_status_t rc = psa_its_get(PSA_CRYPTO_ITS_RANDOM_SEED_UID, 0, actual_size, buf);
|
||||
/* Make sure that in case of an error the value will be negative
|
||||
* Mbed TLS errors are negative values */
|
||||
rc = rc < 0 ? rc : (-1 * rc);
|
||||
|
@ -21,7 +21,7 @@ int mbed_default_seed_read(unsigned char *buf, size_t buf_len)
|
|||
|
||||
int mbed_default_seed_write(unsigned char *buf, size_t buf_len)
|
||||
{
|
||||
psa_its_status_t rc = psa_its_set(MBED_RANDOM_SEED_ITS_UID, buf_len, buf, 0);
|
||||
psa_its_status_t rc = psa_its_set(PSA_CRYPTO_ITS_RANDOM_SEED_UID, buf_len, buf, 0);
|
||||
/* Make sure that in case of an error the value will be negative
|
||||
* Mbed TLS errors are negative values */
|
||||
rc = rc < 0 ? rc : (-1 * rc);
|
||||
|
|
Loading…
Reference in New Issue