psa: storage: Use key id macros to compute ITS file identifier

Use macros instead of accessing directly the key identifier
fields for coding consistency and ease maintenance.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
diff --git a/library/psa_crypto_storage.c b/library/psa_crypto_storage.c
index e48bc28..46d0b65 100644
--- a/library/psa_crypto_storage.c
+++ b/library/psa_crypto_storage.c
@@ -67,8 +67,9 @@
      * owner values are nonzero (as they are on a PSA platform),
      * no key file will ever have a value less than 0x100000000, so
      * the whole range 0..0xffffffff is available for non-key files. */
-    uint32_t unsigned_owner = (uint32_t) key.owner;
-    return( (uint64_t) unsigned_owner << 32 | key.key_id );
+    uint32_t unsigned_owner_id = MBEDTLS_SVC_KEY_ID_GET_OWNER_ID( key );
+    return(  ( (uint64_t) unsigned_owner_id << 32 ) |
+             MBEDTLS_SVC_KEY_ID_GET_KEY_ID( key ) );
 #else
     /* Use the key id directly as a file name.
      * psa_is_key_id_valid() in psa_crypto_slot_management.c