Unify PSA to Mbed TLS error translation

Move all error translation utilities to psa_util.c.
Introduce macros and functions to avoid having
a local copy of the error translating function in
each place.
Identify overlapping errors and introduce a
generic function.
Provide a single macro for all error translations
(unless one file needs a couple of different ones).
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
diff --git a/library/hash_info.c b/library/hash_info.c
index f8b41a5..0e445b6 100644
--- a/library/hash_info.c
+++ b/library/hash_info.c
@@ -104,6 +104,7 @@
     return entry->md_type;
 }
 
+#if !defined(MBEDTLS_DEPRECATED_REMOVED)
 int mbedtls_md_error_from_psa(psa_status_t status)
 {
     switch (status) {
@@ -119,3 +120,4 @@
             return MBEDTLS_ERR_PLATFORM_HW_ACCEL_FAILED;
     }
 }
+#endif /* !MBEDTLS_DEPRECATED_REMOVED */