Deprecate Mbed TLS cryptography API

The PSA Crypto API should be used instead. The Mbed TLS cryptography API
will still remain available under MBEDTLS_DEPRECATED_REMOVED, as Mbed
Crypto (which implements the PSA Crypto API) continues to rely on this
now internal API.

Functions in that are already considered internal and are not deprecated
by this commit. We already have the freedom to change or remove these
internal APIs.

Document the relationship between Mbed Crypto and Mbed TLS, describing
Mbed Crypto's dual purpose of providing both deprecated Mbed TLS
cryptography APIs and the PSA Crypto API.
diff --git a/include/mbedtls/md.h b/include/mbedtls/md.h
index 0423e45..6306af9 100644
--- a/include/mbedtls/md.h
+++ b/include/mbedtls/md.h
@@ -111,6 +111,7 @@
  *                  message-digest enumeration #mbedtls_md_type_t.
  *                  The last entry is 0.
  */
+MBEDTLS_DEPRECATED
 const int *mbedtls_md_list( void );
 
 /**
@@ -122,6 +123,7 @@
  * \return          The message-digest information associated with \p md_name.
  * \return          NULL if the associated message-digest information is not found.
  */
+MBEDTLS_DEPRECATED
 const mbedtls_md_info_t *mbedtls_md_info_from_string( const char *md_name );
 
 /**
@@ -133,6 +135,7 @@
  * \return          The message-digest information associated with \p md_type.
  * \return          NULL if the associated message-digest information is not found.
  */
+MBEDTLS_DEPRECATED
 const mbedtls_md_info_t *mbedtls_md_info_from_type( mbedtls_md_type_t md_type );
 
 /**
@@ -143,6 +146,7 @@
  *                  context for mbedtls_md_setup() for binding it to a
  *                  message-digest algorithm.
  */
+MBEDTLS_DEPRECATED
 void mbedtls_md_init( mbedtls_md_context_t *ctx );
 
 /**
@@ -158,6 +162,7 @@
  *                  You must not call this function if you have not called
  *                  mbedtls_md_init().
  */
+MBEDTLS_DEPRECATED
 void mbedtls_md_free( mbedtls_md_context_t *ctx );
 
 #if ! defined(MBEDTLS_DEPRECATED_REMOVED)
@@ -201,6 +206,7 @@
  *                  failure.
  * \return          #MBEDTLS_ERR_MD_ALLOC_FAILED on memory-allocation failure.
  */
+MBEDTLS_DEPRECATED
 int mbedtls_md_setup( mbedtls_md_context_t *ctx, const mbedtls_md_info_t *md_info, int hmac );
 
 /**
@@ -222,6 +228,7 @@
  * \return          \c 0 on success.
  * \return          #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification failure.
  */
+MBEDTLS_DEPRECATED
 int mbedtls_md_clone( mbedtls_md_context_t *dst,
                       const mbedtls_md_context_t *src );
 
@@ -234,6 +241,7 @@
  *
  * \return          The size of the message-digest output in Bytes.
  */
+MBEDTLS_DEPRECATED
 unsigned char mbedtls_md_get_size( const mbedtls_md_info_t *md_info );
 
 /**
@@ -245,6 +253,7 @@
  *
  * \return          The type of the message digest.
  */
+MBEDTLS_DEPRECATED
 mbedtls_md_type_t mbedtls_md_get_type( const mbedtls_md_info_t *md_info );
 
 /**
@@ -256,6 +265,7 @@
  *
  * \return          The name of the message digest.
  */
+MBEDTLS_DEPRECATED
 const char *mbedtls_md_get_name( const mbedtls_md_info_t *md_info );
 
 /**
@@ -271,6 +281,7 @@
  * \return          #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification
  *                  failure.
  */
+MBEDTLS_DEPRECATED
 int mbedtls_md_starts( mbedtls_md_context_t *ctx );
 
 /**
@@ -289,6 +300,7 @@
  * \return          #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification
  *                  failure.
  */
+MBEDTLS_DEPRECATED
 int mbedtls_md_update( mbedtls_md_context_t *ctx, const unsigned char *input, size_t ilen );
 
 /**
@@ -309,6 +321,7 @@
  * \return          #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification
  *                  failure.
  */
+MBEDTLS_DEPRECATED
 int mbedtls_md_finish( mbedtls_md_context_t *ctx, unsigned char *output );
 
 /**
@@ -329,6 +342,7 @@
  * \return         #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification
  *                 failure.
  */
+MBEDTLS_DEPRECATED
 int mbedtls_md( const mbedtls_md_info_t *md_info, const unsigned char *input, size_t ilen,
         unsigned char *output );
 
@@ -350,6 +364,7 @@
  *                 the file pointed by \p path.
  * \return         #MBEDTLS_ERR_MD_BAD_INPUT_DATA if \p md_info was NULL.
  */
+MBEDTLS_DEPRECATED
 int mbedtls_md_file( const mbedtls_md_info_t *md_info, const char *path,
                      unsigned char *output );
 #endif /* MBEDTLS_FS_IO */
@@ -372,6 +387,7 @@
  * \return          #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification
  *                  failure.
  */
+MBEDTLS_DEPRECATED
 int mbedtls_md_hmac_starts( mbedtls_md_context_t *ctx, const unsigned char *key,
                     size_t keylen );
 
@@ -394,6 +410,7 @@
  * \return          #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification
  *                  failure.
  */
+MBEDTLS_DEPRECATED
 int mbedtls_md_hmac_update( mbedtls_md_context_t *ctx, const unsigned char *input,
                     size_t ilen );
 
@@ -415,6 +432,7 @@
  * \return          #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification
  *                  failure.
  */
+MBEDTLS_DEPRECATED
 int mbedtls_md_hmac_finish( mbedtls_md_context_t *ctx, unsigned char *output);
 
 /**
@@ -432,6 +450,7 @@
  * \return          #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification
  *                  failure.
  */
+MBEDTLS_DEPRECATED
 int mbedtls_md_hmac_reset( mbedtls_md_context_t *ctx );
 
 /**
@@ -456,11 +475,13 @@
  * \return         #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification
  *                 failure.
  */
+MBEDTLS_DEPRECATED
 int mbedtls_md_hmac( const mbedtls_md_info_t *md_info, const unsigned char *key, size_t keylen,
                 const unsigned char *input, size_t ilen,
                 unsigned char *output );
 
 /* Internal use */
+MBEDTLS_DEPRECATED
 int mbedtls_md_process( mbedtls_md_context_t *ctx, const unsigned char *data );
 
 #ifdef __cplusplus