Improve GCM buffer overlap test cases

This commit fixes an issue with GCM testing to handle edge cases by
replacing malloc with calloc. Additionally, fix an issue where different
buffers were used for encryption.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
diff --git a/tf-psa-crypto/tests/suites/test_suite_gcm.function b/tf-psa-crypto/tests/suites/test_suite_gcm.function
index 2dcf366..107cc8d 100644
--- a/tf-psa-crypto/tests/suites/test_suite_gcm.function
+++ b/tf-psa-crypto/tests/suites/test_suite_gcm.function
@@ -630,7 +630,7 @@
     if (buffer_len % 16 != 0) {
         buffer_len += (16 - (buffer_len % 16));
     }
-    buffer = malloc(buffer_len);
+    TEST_CALLOC(buffer, buffer_len);
     if (buffer == NULL) {
         TEST_FAIL("Could not allocate memory for input output buffer overlap");
         goto exit;
@@ -642,7 +642,7 @@
     TEST_ASSERT(mbedtls_gcm_setkey(&ctx, cipher_id, key_str->x, key_str->len * 8) == init_result);
     if (init_result == 0) {
         TEST_ASSERT(mbedtls_gcm_crypt_and_tag(&ctx, MBEDTLS_GCM_ENCRYPT, src_str->len, iv_str->x,
-                                              iv_str->len, add_str->x, add_str->len, src_str->x,
+                                              iv_str->len, add_str->x, add_str->len, buffer,
                                               buffer, tag_len, tag_output) == 0);
 
         TEST_MEMORY_COMPARE(buffer, src_str->len, dst->x, dst->len);
@@ -695,7 +695,7 @@
     if (buffer_len % 16 != 0) {
         buffer_len += (16 - (buffer_len % 16));
     }
-    buffer = malloc(buffer_len);
+    TEST_CALLOC(buffer, buffer_len);
     if (buffer == NULL) {
         TEST_FAIL("Could not allocate memory for input output buffer overlap");
         goto exit;