Use function for 16/24/32-bit BE conversion

Use functions for 16/24/32-bit big endian conversion to save ROM.
diff --git a/library/ssl_ticket.c b/library/ssl_ticket.c
index 5fe693c..eeaeb52 100644
--- a/library/ssl_ticket.c
+++ b/library/ssl_ticket.c
@@ -221,8 +221,8 @@
     {
          goto cleanup;
     }
-    state_len_bytes[0] = ( clear_len >> 8 ) & 0xff;
-    state_len_bytes[1] = ( clear_len      ) & 0xff;
+
+    mbedtls_platform_put_uint16_be( state_len_bytes, clear_len );
 
     /* Encrypt and authenticate */
     tag = state + clear_len;