Replace hash_size with hash_length

This is to make the variable naming covnention align
with the PSA API documentation.

Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
This commit is contained in:
Thomas Daubney 2023-07-28 14:31:06 +01:00
parent 2c872340e8
commit 6fc4ca2d85

View file

@ -60,7 +60,7 @@ int main(void)
uint8_t buf[] = "Hello World!"; uint8_t buf[] = "Hello World!";
psa_status_t status; psa_status_t status;
uint8_t hash[PSA_HASH_LENGTH(HASH_ALG)]; uint8_t hash[PSA_HASH_LENGTH(HASH_ALG)];
size_t hash_size; size_t hash_length;
psa_hash_operation_t psa_hash_operation = PSA_HASH_OPERATION_INIT; psa_hash_operation_t psa_hash_operation = PSA_HASH_OPERATION_INIT;
psa_hash_operation_t cloned_psa_hash_operation = PSA_HASH_OPERATION_INIT; psa_hash_operation_t cloned_psa_hash_operation = PSA_HASH_OPERATION_INIT;
@ -100,7 +100,7 @@ int main(void)
return EXIT_FAILURE; return EXIT_FAILURE;
} }
status = psa_hash_finish(&psa_hash_operation, hash, sizeof(hash), &hash_size); status = psa_hash_finish(&psa_hash_operation, hash, sizeof(hash), &hash_length);
if (status != PSA_SUCCESS) { if (status != PSA_SUCCESS) {
mbedtls_printf("psa_hash_finish failed\n"); mbedtls_printf("psa_hash_finish failed\n");
psa_hash_abort(&psa_hash_operation); psa_hash_abort(&psa_hash_operation);
@ -122,12 +122,12 @@ int main(void)
/* Compute hash using one-shot function call */ /* Compute hash using one-shot function call */
memset(hash, 0, sizeof(hash)); memset(hash, 0, sizeof(hash));
hash_size = 0; hash_length = 0;
status = psa_hash_compute(HASH_ALG, status = psa_hash_compute(HASH_ALG,
buf, sizeof(buf), buf, sizeof(buf),
hash, sizeof(hash), hash, sizeof(hash),
&hash_size); &hash_length);
if (status != PSA_SUCCESS) { if (status != PSA_SUCCESS) {
mbedtls_printf("psa_hash_compute failed\n"); mbedtls_printf("psa_hash_compute failed\n");
psa_hash_abort(&psa_hash_operation); psa_hash_abort(&psa_hash_operation);