change MBEDTLS_RANDOM_SEED_ITS_UID define to be PSA_CRYPTO_ITS_RANDOM_SEED_UID

pull/8804/head
Mohammad AboMokh 2018-11-21 17:38:15 +02:00 committed by mohammad1603
parent 72037747b1
commit 0fde6af120
1 changed files with 3 additions and 3 deletions

View File

@ -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);