mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-28 00:21:48 +03:00
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>
This commit is contained in:
@ -165,10 +165,10 @@ int mbedtls_ssl_cookie_write( void *p_ctx,
|
||||
t = ctx->serial++;
|
||||
#endif
|
||||
|
||||
(*p)[0] = (unsigned char)( t >> 24 );
|
||||
(*p)[1] = (unsigned char)( t >> 16 );
|
||||
(*p)[2] = (unsigned char)( t >> 8 );
|
||||
(*p)[3] = (unsigned char)( t );
|
||||
(*p)[0] = MBEDTLS_BYTE_3( t );
|
||||
(*p)[1] = MBEDTLS_BYTE_2( t );
|
||||
(*p)[2] = MBEDTLS_BYTE_1( t );
|
||||
(*p)[3] = MBEDTLS_BYTE_0( t );
|
||||
*p += 4;
|
||||
|
||||
#if defined(MBEDTLS_THREADING_C)
|
||||
|
Reference in New Issue
Block a user