Invert and rename config option

Replace MBEDTLS_PSA_COPY_CALLER_BUFFERS with inverse:
!MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS. This ensures that buffer
protection is enabled by default without any change to the Mbed TLS
config file.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
diff --git a/library/psa_crypto.c b/library/psa_crypto.c
index 8e981f6..e85e579 100644
--- a/library/psa_crypto.c
+++ b/library/psa_crypto.c
@@ -106,7 +106,7 @@
     if (global_data.initialized == 0)  \
     return PSA_ERROR_BAD_STATE;
 
-#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
+#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
 
 /* Declare a local copy of an input buffer and a variable that will be used
  * to store a pointer to the start of the buffer.
@@ -202,7 +202,7 @@
             status = local_output_status; \
         } \
     } while (0)
-#else /* MBEDTLS_PSA_COPY_CALLER_BUFFERS */
+#else /* !MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS */
 #define LOCAL_INPUT_DECLARE(input, input_copy_name) \
     const uint8_t *input_copy_name = NULL;
 #define LOCAL_INPUT_ALLOC(input, length, input_copy) \
@@ -215,7 +215,7 @@
     output_copy = output;
 #define LOCAL_OUTPUT_FREE(output, output_copy) \
     output_copy = NULL;
-#endif /* MBEDTLS_PSA_COPY_CALLER_BUFFERS */
+#endif /* !MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS */
 
 psa_status_t mbedtls_to_psa_error(int ret)
 {
@@ -1506,7 +1506,7 @@
                                            slot->key.data, slot->key.bytes,
                                            data, data_size, data_length);
 
-#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
+#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
 exit:
 #endif
     unlock_status = psa_unlock_key_slot(slot);
@@ -2362,7 +2362,7 @@
     LOCAL_OUTPUT_ALLOC(hash_external, hash_size, hash);
     status = psa_hash_finish_internal(operation, hash, hash_size, hash_length);
 
-#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
+#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
 exit:
 #endif
     LOCAL_OUTPUT_FREE(hash_external, hash);
@@ -2425,7 +2425,7 @@
     status = psa_driver_wrapper_hash_compute(alg, input, input_length,
                                              hash, hash_size, hash_length);
 
-#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
+#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
 exit:
 #endif
     LOCAL_INPUT_FREE(input_external, input);
@@ -2667,7 +2667,7 @@
         psa_mac_abort(operation);
     }
 
-#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
+#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
 exit:
 #endif
     LOCAL_INPUT_FREE(input_external, input);
@@ -2852,7 +2852,7 @@
                                       input, input_length,
                                       mac, mac_size, mac_length, 1);
 
-#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
+#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
 exit:
 #endif
     LOCAL_INPUT_FREE(input_external, input);
@@ -3110,7 +3110,7 @@
     status = psa_sign_internal(key, 1, alg, input, input_length, signature,
                                signature_size, signature_length);
 
-#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
+#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
 exit:
 #endif
     LOCAL_INPUT_FREE(input_external, input);
@@ -3168,7 +3168,7 @@
     status = psa_verify_internal(key, 1, alg, input, input_length, signature,
                                  signature_length);
 
-#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
+#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
 exit:
 #endif
     LOCAL_INPUT_FREE(input_external, input);
@@ -3242,7 +3242,7 @@
     status = psa_sign_internal(key, 0, alg, hash, hash_length, signature,
                                signature_size, signature_length);
 
-#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
+#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
 exit:
 #endif
     LOCAL_INPUT_FREE(hash_external, hash);
@@ -3314,7 +3314,7 @@
     status = psa_verify_internal(key, 0, alg, hash, hash_length, signature,
                                  signature_length);
 
-#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
+#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
 exit:
 #endif
     LOCAL_INPUT_FREE(hash_external, hash);
@@ -4106,7 +4106,7 @@
     }
 
 /* Exit label is only used for buffer copying, prevent unused warnings. */
-#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
+#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
 exit:
 #endif
     LOCAL_INPUT_FREE(nonce_external, nonce);
@@ -4174,7 +4174,7 @@
     }
 
 /* Exit label is only used for buffer copying, prevent unused warnings. */
-#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
+#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
 exit:
 #endif
     LOCAL_INPUT_FREE(nonce_external, nonce);
@@ -5232,7 +5232,7 @@
     status = psa_key_derivation_input_internal(operation, step,
                                                PSA_KEY_TYPE_NONE,
                                                data, data_length);
-#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
+#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
 exit:
 #endif
     LOCAL_INPUT_FREE(data_external, data);
@@ -5450,7 +5450,7 @@
                                         slot,
                                         peer_key, peer_key_length);
 
-#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
+#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
 exit:
 #endif
     if (status != PSA_SUCCESS) {
@@ -5622,7 +5622,7 @@
 
     status = psa_generate_random_internal(output, output_size);
 
-#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
+#if !defined(MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS)
 exit:
 #endif
     LOCAL_OUTPUT_FREE(output_external, output);