tls: psa_pake: move move key exchange read/write functions to ssl_tls.c

Inlined functions might cause the compiled code to have different sizes
depending on the usage and this not acceptable in some cases.
Therefore read/write functions used in the initial key exchange are
moved to a standard C file.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
diff --git a/library/ssl_tls12_client.c b/library/ssl_tls12_client.c
index c90ed2e..4e986d1 100644
--- a/library/ssl_tls12_client.c
+++ b/library/ssl_tls12_client.c
@@ -164,7 +164,7 @@
         MBEDTLS_SSL_DEBUG_MSG( 3, ( "generating new ecjpake parameters" ) );
 
 #if defined(MBEDTLS_USE_PSA_CRYPTO)
-        ret = psa_tls12_write_ecjpake_round_one(&ssl->handshake->psa_pake_ctx,
+        ret = mbedtls_psa_ecjpake_write_round_one(&ssl->handshake->psa_pake_ctx,
                                                 p + 2, end - p - 2, &kkpp_len );
         if ( ret != 0 )
         {
@@ -908,7 +908,7 @@
     ssl->handshake->ecjpake_cache_len = 0;
 
 #if defined(MBEDTLS_USE_PSA_CRYPTO)
-    if( ( ret = psa_tls12_parse_ecjpake_round_one(
+    if( ( ret = mbedtls_psa_ecjpake_read_round_one(
                             &ssl->handshake->psa_pake_ctx, buf, len ) ) != 0 )
     {
         psa_destroy_key( ssl->handshake->psa_pake_password );
@@ -2333,7 +2333,7 @@
     if( ciphersuite_info->key_exchange == MBEDTLS_KEY_EXCHANGE_ECJPAKE )
     {
 #if defined(MBEDTLS_USE_PSA_CRYPTO)
-        if( ( ret = psa_tls12_parse_ecjpake_round_two(
+        if( ( ret = mbedtls_psa_ecjpake_read_round_two(
                         &ssl->handshake->psa_pake_ctx, p, end - p,
                         ssl->conf->endpoint ) ) != 0 )
         {
@@ -3292,7 +3292,7 @@
         unsigned char *out_p = ssl->out_msg + header_len;
         unsigned char *end_p = ssl->out_msg + MBEDTLS_SSL_OUT_CONTENT_LEN -
                                header_len;
-        ret = psa_tls12_write_ecjpake_round_two( &ssl->handshake->psa_pake_ctx,
+        ret = mbedtls_psa_ecjpake_write_round_two( &ssl->handshake->psa_pake_ctx,
                                     out_p, end_p - out_p, &content_len );
         if ( ret != 0 )
         {