Create psa_util_internal.h

Most functions in psa_util.h are going to end up there (except those
that can be static in one file), but I wanted to have separate commits
for file creation and moving code around, so for now the new file's
pretty empty but that will change in the next few commits.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
diff --git a/library/cipher.c b/library/cipher.c
index 015e25d..2a8e257 100644
--- a/library/cipher.c
+++ b/library/cipher.c
@@ -56,7 +56,7 @@
 
 #if defined(MBEDTLS_USE_PSA_CRYPTO)
 #include "psa/crypto.h"
-#include "mbedtls/psa_util.h"
+#include "psa_util_internal.h"
 #endif /* MBEDTLS_USE_PSA_CRYPTO */
 
 #if defined(MBEDTLS_NIST_KW_C)
diff --git a/library/lmots.c b/library/lmots.c
index 4ef2c51..4030654 100644
--- a/library/lmots.c
+++ b/library/lmots.c
@@ -41,7 +41,7 @@
 #include "mbedtls/lms.h"
 #include "mbedtls/platform_util.h"
 #include "mbedtls/error.h"
-#include "mbedtls/psa_util.h"
+#include "psa_util_internal.h"
 
 #include "psa/crypto.h"
 
diff --git a/library/lms.c b/library/lms.c
index 823ce09..4a42f67 100644
--- a/library/lms.c
+++ b/library/lms.c
@@ -39,7 +39,7 @@
 #include "lmots.h"
 
 #include "psa/crypto.h"
-#include "mbedtls/psa_util.h"
+#include "psa_util_internal.h"
 #include "mbedtls/lms.h"
 #include "mbedtls/error.h"
 #include "mbedtls/platform_util.h"
diff --git a/library/md.c b/library/md.c
index a29d876..964d4bd 100644
--- a/library/md.c
+++ b/library/md.c
@@ -56,7 +56,7 @@
 #if defined(MBEDTLS_PSA_CRYPTO_C)
 #include <psa/crypto.h>
 #include "md_psa.h"
-#include "mbedtls/psa_util.h"
+#include "psa_util_internal.h"
 #endif
 
 #if defined(MBEDTLS_MD_SOME_PSA)
diff --git a/library/pk.c b/library/pk.c
index 77bf291..03c1e35 100644
--- a/library/pk.c
+++ b/library/pk.c
@@ -39,7 +39,7 @@
 #endif
 
 #if defined(MBEDTLS_PSA_CRYPTO_C)
-#include "mbedtls/psa_util.h"
+#include "psa_util_internal.h"
 #include "md_psa.h"
 #endif
 
diff --git a/library/pk_internal.h b/library/pk_internal.h
index 3d05f57..416ef23 100644
--- a/library/pk_internal.h
+++ b/library/pk_internal.h
@@ -34,7 +34,7 @@
 #endif
 
 #if defined(MBEDTLS_PSA_CRYPTO_C)
-#include "mbedtls/psa_util.h"
+#include "psa_util_internal.h"
 #define PSA_PK_TO_MBEDTLS_ERR(status) psa_pk_status_to_mbedtls(status)
 #define PSA_PK_RSA_TO_MBEDTLS_ERR(status) PSA_TO_MBEDTLS_ERR_LIST(status,     \
                                                                   psa_to_pk_rsa_errors,            \
diff --git a/library/pk_wrap.c b/library/pk_wrap.c
index 3c14fd1..3fe2c3e 100644
--- a/library/pk_wrap.c
+++ b/library/pk_wrap.c
@@ -43,7 +43,7 @@
 #endif
 
 #if defined(MBEDTLS_PSA_CRYPTO_C)
-#include "mbedtls/psa_util.h"
+#include "psa_util_internal.h"
 #endif
 
 #if defined(MBEDTLS_USE_PSA_CRYPTO)
diff --git a/library/pkcs12.c b/library/pkcs12.c
index 2f1495a..db31722 100644
--- a/library/pkcs12.c
+++ b/library/pkcs12.c
@@ -39,7 +39,7 @@
 #include "mbedtls/des.h"
 #endif
 
-#include "mbedtls/psa_util.h"
+#include "psa_util_internal.h"
 
 #if defined(MBEDTLS_ASN1_PARSE_C)
 
diff --git a/library/pkcs5.c b/library/pkcs5.c
index d620dc1..5d415ca 100644
--- a/library/pkcs5.c
+++ b/library/pkcs5.c
@@ -44,7 +44,7 @@
 
 #include "mbedtls/platform.h"
 
-#include "mbedtls/psa_util.h"
+#include "psa_util_internal.h"
 
 #if defined(MBEDTLS_ASN1_PARSE_C)
 static int pkcs5_parse_pbkdf2_params(const mbedtls_asn1_buf *params,
diff --git a/library/pkparse.c b/library/pkparse.c
index 483176a..e3d84c2 100644
--- a/library/pkparse.c
+++ b/library/pkparse.c
@@ -54,7 +54,7 @@
 #endif
 
 #if defined(MBEDTLS_PSA_CRYPTO_C)
-#include "mbedtls/psa_util.h"
+#include "psa_util_internal.h"
 #endif
 
 #if defined(MBEDTLS_USE_PSA_CRYPTO)
diff --git a/library/pkwrite.c b/library/pkwrite.c
index 5f801e2..4ec0b81 100644
--- a/library/pkwrite.c
+++ b/library/pkwrite.c
@@ -53,7 +53,7 @@
 
 #if defined(MBEDTLS_USE_PSA_CRYPTO)
 #include "psa/crypto.h"
-#include "mbedtls/psa_util.h"
+#include "psa_util_internal.h"
 #endif
 #include "mbedtls/platform.h"
 
diff --git a/library/psa_crypto_pake.c b/library/psa_crypto_pake.c
index e22bcf8..c2e7dba 100644
--- a/library/psa_crypto_pake.c
+++ b/library/psa_crypto_pake.c
@@ -28,7 +28,7 @@
 #include "psa_crypto_slot_management.h"
 
 #include <mbedtls/ecjpake.h>
-#include <mbedtls/psa_util.h>
+#include <psa_util_internal.h>
 
 #include <mbedtls/platform.h>
 #include <mbedtls/error.h>
diff --git a/library/psa_crypto_random_impl.h b/library/psa_crypto_random_impl.h
index 4197b4b..2a75a43 100644
--- a/library/psa_crypto_random_impl.h
+++ b/library/psa_crypto_random_impl.h
@@ -3,12 +3,12 @@
  * \brief PSA crypto random generator implementation abstraction.
  *
  * The definitions here need to be consistent with the declarations
- * in include/mbedtls/psa_util.h. This file contains some redundant
+ * in include/psa_util_internal.h. This file contains some redundant
  * declarations to increase the chance that a compiler will detect
  * inconsistencies if one file is changed without updating the other,
  * but not all potential inconsistencies can be enforced, so make sure
  * to check the public declarations and contracts in
- * include/mbedtls/psa_util.h if you modify this file.
+ * include/psa_util_internal.h if you modify this file.
  */
 /*
  *  Copyright The Mbed TLS Contributors
@@ -30,7 +30,7 @@
 #ifndef PSA_CRYPTO_RANDOM_IMPL_H
 #define PSA_CRYPTO_RANDOM_IMPL_H
 
-#include <mbedtls/psa_util.h>
+#include <psa_util_internal.h>
 
 #if defined(MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG)
 
@@ -123,7 +123,7 @@
     mbedtls_psa_drbg_context_t drbg;
 } mbedtls_psa_random_context_t;
 
-/* Defined in include/mbedtls/psa_util.h so that it's visible to
+/* Defined in include/psa_util_internal.h so that it's visible to
  * application code. The declaration here is redundant, but included
  * as a safety net to make it more likely that a future change that
  * accidentally causes the implementation to diverge from the interface
@@ -154,7 +154,7 @@
 /* psa_crypto.c sets this variable to a pointer to the DRBG state in the
  * global PSA crypto state. */
 /* The type `mbedtls_psa_drbg_context_t` is defined in
- * include/mbedtls/psa_util.h so that `mbedtls_psa_random_state` can be
+ * include/psa_util_internal.h so that `mbedtls_psa_random_state` can be
  * declared there and be visible to application code. */
 extern mbedtls_psa_drbg_context_t *const mbedtls_psa_random_state;
 
diff --git a/library/psa_util.c b/library/psa_util.c
index 70b80d8..4469520 100644
--- a/library/psa_util.c
+++ b/library/psa_util.c
@@ -25,7 +25,7 @@
 #include <psa/crypto.h>
 
 #include "psa_crypto_core.h"
-#include <mbedtls/psa_util.h>
+#include <psa_util_internal.h>
 #include <mbedtls/error.h>
 #include <mbedtls/lms.h>
 #include <mbedtls/ssl.h>
diff --git a/library/psa_util_internal.h b/library/psa_util_internal.h
new file mode 100644
index 0000000..5e4dc63
--- /dev/null
+++ b/library/psa_util_internal.h
@@ -0,0 +1,32 @@
+/**
+ * \file psa_util_internal.h
+ *
+ * \brief Internal utility functions for use of PSA Crypto.
+ */
+/*
+ *  Copyright The Mbed TLS Contributors
+ *  SPDX-License-Identifier: Apache-2.0
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License"); you may
+ *  not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+#ifndef MBEDTLS_PSA_UTIL_INTERNAL_H
+#define MBEDTLS_PSA_UTIL_INTERNAL_H
+
+/* Include the public header so that users only need one include. */
+#include "mbedtls/psa_util.h"
+
+#if defined(MBEDTLS_PSA_CRYPTO_C)
+
+#endif /* MBEDTLS_PSA_CRYPTO_C */
+#endif /* MBEDTLS_PSA_UTIL_INTERNAL_H */
diff --git a/library/ssl_misc.h b/library/ssl_misc.h
index 2b115dc..325bb09 100644
--- a/library/ssl_misc.h
+++ b/library/ssl_misc.h
@@ -29,7 +29,7 @@
 
 #if defined(MBEDTLS_USE_PSA_CRYPTO) || defined(MBEDTLS_SSL_PROTO_TLS1_3)
 #include "psa/crypto.h"
-#include "mbedtls/psa_util.h"
+#include "psa_util_internal.h"
 #endif
 
 #if defined(MBEDTLS_MD_CAN_MD5)
diff --git a/library/ssl_msg.c b/library/ssl_msg.c
index e905023..2aba17b 100644
--- a/library/ssl_msg.c
+++ b/library/ssl_msg.c
@@ -40,7 +40,7 @@
 #include <string.h>
 
 #if defined(MBEDTLS_USE_PSA_CRYPTO)
-#include "mbedtls/psa_util.h"
+#include "psa_util_internal.h"
 #include "psa/crypto.h"
 #endif
 
diff --git a/library/ssl_tls.c b/library/ssl_tls.c
index 06637a9..46b0a22 100644
--- a/library/ssl_tls.c
+++ b/library/ssl_tls.c
@@ -42,7 +42,7 @@
 
 #if defined(MBEDTLS_USE_PSA_CRYPTO)
 #include "md_psa.h"
-#include "mbedtls/psa_util.h"
+#include "psa_util_internal.h"
 #include "psa/crypto.h"
 #endif
 
diff --git a/library/ssl_tls12_client.c b/library/ssl_tls12_client.c
index e4f3821..8aaf37a 100644
--- a/library/ssl_tls12_client.c
+++ b/library/ssl_tls12_client.c
@@ -31,7 +31,7 @@
 #include "mbedtls/constant_time.h"
 
 #if defined(MBEDTLS_USE_PSA_CRYPTO)
-#include "mbedtls/psa_util.h"
+#include "psa_util_internal.h"
 #include "psa/crypto.h"
 #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED)
 /* Define a local translating function to save code size by not using too many
diff --git a/library/ssl_tls13_generic.c b/library/ssl_tls13_generic.c
index 1bf627d..5d5b853 100644
--- a/library/ssl_tls13_generic.c
+++ b/library/ssl_tls13_generic.c
@@ -37,7 +37,7 @@
 #include "ssl_debug_helpers.h"
 
 #include "psa/crypto.h"
-#include "mbedtls/psa_util.h"
+#include "psa_util_internal.h"
 
 #if defined(MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED) || \
     defined(PSA_WANT_ALG_ECDH) || defined(PSA_WANT_ALG_FFDH)
diff --git a/library/x509_crt.c b/library/x509_crt.c
index a783b18..b3bcdaf 100644
--- a/library/x509_crt.c
+++ b/library/x509_crt.c
@@ -46,7 +46,7 @@
 
 #if defined(MBEDTLS_USE_PSA_CRYPTO)
 #include "psa/crypto.h"
-#include "mbedtls/psa_util.h"
+#include "psa_util_internal.h"
 #include "md_psa.h"
 #endif /* MBEDTLS_USE_PSA_CRYPTO */
 #include "pk_internal.h"
diff --git a/library/x509write_crt.c b/library/x509write_crt.c
index 59fd589..bcee4dc 100644
--- a/library/x509write_crt.c
+++ b/library/x509write_crt.c
@@ -44,7 +44,7 @@
 
 #if defined(MBEDTLS_USE_PSA_CRYPTO)
 #include "psa/crypto.h"
-#include "mbedtls/psa_util.h"
+#include "psa_util_internal.h"
 #include "md_psa.h"
 #endif /* MBEDTLS_USE_PSA_CRYPTO */
 
diff --git a/library/x509write_csr.c b/library/x509write_csr.c
index d792d34..b67cdde 100644
--- a/library/x509write_csr.c
+++ b/library/x509write_csr.c
@@ -35,7 +35,7 @@
 
 #if defined(MBEDTLS_USE_PSA_CRYPTO)
 #include "psa/crypto.h"
-#include "mbedtls/psa_util.h"
+#include "psa_util_internal.h"
 #include "md_psa.h"
 #endif /* MBEDTLS_USE_PSA_CRYPTO */