Code style improvements

Signed-off-by: Archana <archana.madhavan@silabs.com>
diff --git a/library/psa_crypto.c b/library/psa_crypto.c
index ee16983..b105890 100644
--- a/library/psa_crypto.c
+++ b/library/psa_crypto.c
@@ -431,7 +431,7 @@
         * defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY) */
 
 psa_status_t psa_validate_unstructured_key_bit_size( psa_key_type_t type,
-                                                   size_t bits )
+                                                     size_t bits )
 {
     /* Check that the bit size is acceptable for the key type */
     switch( type )
@@ -558,7 +558,8 @@
     {
         *bits = PSA_BYTES_TO_BITS( data_length );
 
-        status = psa_validate_unstructured_key_bit_size( attributes->core.type, *bits );
+        status = psa_validate_unstructured_key_bit_size( attributes->core.type,
+                                                         *bits );
         if( status != PSA_SUCCESS )
             return( status );
 
@@ -1892,7 +1893,7 @@
     if( data_length == 0 )
         return( PSA_ERROR_INVALID_ARGUMENT );
 
-    /* Ensure that the bytes-to-bits conversion hasn't overflown. */
+    /* Ensure that the bytes-to-bits conversion cannot overflow. */
     if( data_length > SIZE_MAX / 8 )
         return( PSA_ERROR_NOT_SUPPORTED );
 
@@ -1902,15 +1903,15 @@
         goto exit;
 
     /* In the case of a transparent key or an opaque key stored in local
-     * storage( thus not in the case of the old-style secure element interface
-     * (MBEDTLS_PSA_CRYPTO_SE_C)),we have to allocate a buffer to hold the
-     * imported key material. */
+     * storage ( thus not in the case of importing a key in a secure element
+     * with storage ( MBEDTLS_PSA_CRYPTO_SE_C ) ),we have to allocate a
+     * buffer to hold the imported key material. */
     if( slot->key.data == NULL )
     {
         if( psa_key_lifetime_is_external( attributes->core.lifetime ) )
         {
-            status = psa_driver_wrapper_get_key_buffer_size_from_key_data( attributes, data,
-                                           data_length , &storage_size );
+            status = psa_driver_wrapper_get_key_buffer_size_from_key_data(
+                         attributes, data, data_length, &storage_size );
             if( status != PSA_SUCCESS )
                 goto exit;
         }
@@ -2046,7 +2047,7 @@
          * If the source and target keys are stored across different locations,
          * the source key would need to be exported as plaintext and re-imported
          * in the other location. This has security implications which have not
-         * been fully mapped.For now, this can be acheived through
+         * been fully mapped. For now, this can be achieved through
          * appropriate API invocations from the application, if needed.
          * */
         status = PSA_ERROR_NOT_SUPPORTED;
@@ -2054,14 +2055,14 @@
     }
     /*
      * When the source and target keys are within the same location,
-     * - For transparent keys it is a blind copy sans any driver invocation,
+     * - For transparent keys it is a blind copy without any driver invocation,
      * - For opaque keys this translates to an invocation of the drivers'
      *   copy_key entry point through the dispatch layer.
      * */
     if( psa_key_lifetime_is_external( actual_attributes.core.lifetime ) )
     {
         status = psa_driver_wrapper_get_key_buffer_size( &actual_attributes,
-                         &storage_size );
+                                                         &storage_size );
         if( status != PSA_SUCCESS )
             goto exit;
         status = psa_allocate_buffer_to_slot( target_slot, storage_size );
@@ -4197,7 +4198,8 @@
 
     if( psa_key_lifetime_is_external( attributes.core.lifetime ) )
     {
-        status = psa_driver_wrapper_get_key_buffer_size( &attributes, &storage_size );
+        status = psa_driver_wrapper_get_key_buffer_size( &attributes,
+                                                         &storage_size );
         if( status != PSA_SUCCESS )
             goto exit;
     }
@@ -5193,9 +5195,9 @@
         goto exit;
 
     /* In the case of a transparent key or an opaque key stored in local
-     * storage( thus not in the case of the old-style secure element interface
-     * (MBEDTLS_PSA_CRYPTO_SE_C)),we have to allocate a buffer to hold the
-     * imported key material. */
+     * storage ( thus not in the case of generating a key in a secure element
+     * with storage ( MBEDTLS_PSA_CRYPTO_SE_C ) ),we have to allocate a
+     * buffer to hold the generated key material. */
     if( slot->key.data == NULL )
     {
         if ( PSA_KEY_LIFETIME_GET_LOCATION( attributes->core.lifetime ) ==
diff --git a/library/psa_crypto_core.h b/library/psa_crypto_core.h
index 4a3fa50..8c91b04 100644
--- a/library/psa_crypto_core.h
+++ b/library/psa_crypto_core.h
@@ -546,5 +546,5 @@
  *         the two is not supported.
  */
 psa_status_t psa_validate_unstructured_key_bit_size( psa_key_type_t type,
-                                                   size_t bits );
+                                                     size_t bits );
 #endif /* PSA_CRYPTO_CORE_H */
diff --git a/library/psa_crypto_driver_wrappers.c b/library/psa_crypto_driver_wrappers.c
index 1597b00..00c1706 100644
--- a/library/psa_crypto_driver_wrappers.c
+++ b/library/psa_crypto_driver_wrappers.c
@@ -380,10 +380,9 @@
     }
 }
 
-/** calculate the key buffer size required to store the key material of a key
+/** Calculate the key buffer size required to store the key material of a key
  *  associated with an opaque driver from input key data.
  *
- *
  * \param[in] attributes        The key attributes
  * \param[in] data              The input key data.
  * \param[in] data_length       The input data length.
@@ -399,7 +398,8 @@
     size_t data_length,
     size_t *key_buffer_size )
 {
-    psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION( attributes->core.lifetime );
+    psa_key_location_t location =
+        PSA_KEY_LIFETIME_GET_LOCATION( attributes->core.lifetime );
     psa_key_type_t key_type = attributes->core.type;
 
     *key_buffer_size = 0;
@@ -459,7 +459,8 @@
                 return( PSA_SUCCESS );
             }
 #endif /* MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS */
-            *key_buffer_size = mbedtls_test_opaque_size_function( key_type, key_bits );
+            *key_buffer_size = mbedtls_test_opaque_size_function( key_type,
+                                                                  key_bits );
             return( ( *key_buffer_size != 0 ) ?
                     PSA_SUCCESS : PSA_ERROR_NOT_SUPPORTED );
 #endif /* PSA_CRYPTO_DRIVER_TEST */
@@ -785,20 +786,12 @@
 psa_status_t psa_driver_wrapper_copy_key(
     psa_key_attributes_t *attributes,
     const uint8_t *source_key, size_t source_key_size,
-    uint8_t *target_key_buffer, size_t target_buffer_size, size_t *key_length )
+    uint8_t *target_key_buffer, size_t target_key_buffer_size,
+    size_t *target_key_buffer_length )
 {
-    psa_status_t status = PSA_ERROR_INVALID_ARGUMENT;
-    psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION( attributes->core.lifetime );
-#if defined(MBEDTLS_PSA_CRYPTO_SE_C)
-    const psa_drv_se_t *drv;
-    psa_drv_se_context_t *drv_context;
-
-    if( psa_get_se_driver( attributes->core.lifetime, &drv, &drv_context ) )
-    {
-        /* Copying to a secure element is not implemented yet. */
-        return( PSA_ERROR_NOT_SUPPORTED );
-    }
-#endif /* MBEDTLS_PSA_CRYPTO_SE_C */
+    psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
+    psa_key_location_t location =
+        PSA_KEY_LIFETIME_GET_LOCATION( attributes->core.lifetime );
 
     switch( location )
     {
@@ -808,16 +801,16 @@
             return( mbedtls_test_opaque_copy_key( attributes, source_key,
                                                   source_key_size,
                                                   target_key_buffer,
-                                                  target_buffer_size,
-                                                  key_length ) );
+                                                  target_key_buffer_size,
+                                                  target_key_buffer_length) );
 #endif /* PSA_CRYPTO_DRIVER_TEST */
 #endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
         default:
             (void)source_key;
             (void)source_key_size;
             (void)target_key_buffer;
-            (void)target_buffer_size;
-            (void)key_length;
+            (void)target_key_buffer_size;
+            (void)target_key_buffer_length;
             status = PSA_ERROR_INVALID_ARGUMENT;
     }
     return( status );
diff --git a/library/psa_crypto_driver_wrappers.h b/library/psa_crypto_driver_wrappers.h
index 7c45fbf..c186228 100644
--- a/library/psa_crypto_driver_wrappers.h
+++ b/library/psa_crypto_driver_wrappers.h
@@ -103,7 +103,8 @@
 psa_status_t psa_driver_wrapper_copy_key(
     psa_key_attributes_t *attributes,
     const uint8_t *source_key, size_t source_key_size,
-    uint8_t *target_key_buffer, size_t target_buffer_size, size_t *key_length );
+    uint8_t *target_key_buffer, size_t target_key_buffer_size,
+    size_t *target_key_buffer_length );
 /*
  * Cipher functions
  */