Prefer persistent over permanent

For consistency across the code base, prefer
persistent over permanent to qualify a key
stored in persistent storage.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
diff --git a/library/psa_crypto.c b/library/psa_crypto.c
index 1f69b55..3e174f9 100644
--- a/library/psa_crypto.c
+++ b/library/psa_crypto.c
@@ -1345,7 +1345,7 @@
         return( PSA_SUCCESS );
 
     /*
-     * Get the description of the key in a key slot. In case of a permanent
+     * Get the description of the key in a key slot. In case of a persistent
      * key, this will load the key description from persistent memory if not
      * done yet. We cannot avoid this loading as without it we don't know if
      * the key is operated by an SE or not and this information is needed by
diff --git a/library/psa_crypto_core.h b/library/psa_crypto_core.h
index 32d1d60..489be31 100644
--- a/library/psa_crypto_core.h
+++ b/library/psa_crypto_core.h
@@ -53,10 +53,10 @@
      * may access it. For example, such control is needed in the following
      * scenarios:
      * . In case of key slot starvation, all key slots contain the description
-     *   of a key, and the library asks for the description of a permanent
+     *   of a key, and the library asks for the description of a persistent
      *   key not present in the key slots, the key slots currently accessed by
      *   the library cannot be reclaimed to free a key slot to load the
-     *   permanent key.
+     *   persistent key.
      * . In case of a multi-threaded application where one thread asks to close
      *   or purge or destroy a key while it is in used by the library through
      *   another thread.
diff --git a/library/psa_crypto_slot_management.c b/library/psa_crypto_slot_management.c
index 5a1fc74..a114eec 100644
--- a/library/psa_crypto_slot_management.c
+++ b/library/psa_crypto_slot_management.c
@@ -175,7 +175,7 @@
 {
     psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
     size_t slot_idx;
-    psa_key_slot_t *selected_slot, *unaccessed_permanent_key_slot;
+    psa_key_slot_t *selected_slot, *unaccessed_persistent_key_slot;
 
     if( ! global_data.key_slots_initialized )
     {
@@ -183,7 +183,7 @@
         goto error;
     }
 
-    selected_slot = unaccessed_permanent_key_slot = NULL;
+    selected_slot = unaccessed_persistent_key_slot = NULL;
     for( slot_idx = 0; slot_idx < PSA_KEY_SLOT_COUNT; slot_idx++ )
     {
         psa_key_slot_t *slot = &global_data.key_slots[ slot_idx ];
@@ -193,22 +193,23 @@
             break;
         }
 
-        if( ( unaccessed_permanent_key_slot == NULL ) &&
+        if( ( unaccessed_persistent_key_slot == NULL ) &&
             ( ! PSA_KEY_LIFETIME_IS_VOLATILE( slot->attr.lifetime ) ) &&
             ( ! psa_is_key_slot_accessed( slot ) ) )
-            unaccessed_permanent_key_slot = slot;
+            unaccessed_persistent_key_slot = slot;
     }
 
     /*
      * If there is no unused key slot and there is at least one unaccessed key
      * slot containing the description of a permament key, recycle the first
      * such key slot we encountered. If we need later on to operate on the
-     * permanent key we evict now, we will reload its description from storage.
+     * persistent key we evict now, we will reload its description from
+     * storage.
      */
     if( ( selected_slot == NULL ) &&
-        ( unaccessed_permanent_key_slot != NULL ) )
+        ( unaccessed_persistent_key_slot != NULL ) )
     {
-        selected_slot = unaccessed_permanent_key_slot;
+        selected_slot = unaccessed_persistent_key_slot;
         selected_slot->access_count = 1;
         psa_wipe_key_slot( selected_slot );
     }