Use byte reading macros in places not using a byte mask
byte shifting opertations throughout library/ were only replaced with
the byte reading macros when an 0xff mask was being used.
The byte reading macros are now more widley used, however they have not
been used in all cases of a byte shift operation, as it detracted from
the immediate readability or otherwise did not seem appropriate.
Signed-off-by: Joe Subbiani <joe.subbiani@arm.com>
diff --git a/library/ecp.c b/library/ecp.c
index ca49f99..cc8a26c 100644
--- a/library/ecp.c
+++ b/library/ecp.c
@@ -1160,8 +1160,8 @@
/*
* Next two bytes are the namedcurve value
*/
- buf[0] = curve_info->tls_id >> 8;
- buf[1] = curve_info->tls_id & 0xFF;
+ buf[0] = MBEDTLS_BYTE_1( curve_info->tls_id );
+ buf[1] = MBEDTLS_BYTE_0( curve_info->tls_id );
return( 0 );
}