1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-12-24 17:41:01 +03:00

Improve documentation and add more uses of MBEDTLS_PUT

minor changes, such as improving the documentation for the byte reading
macros, and using MBEDTLS_PUT_UINT16_xy in place of byte reading
macro combinations

Signed-off-by: Joe Subbiani <joe.subbiani@arm.com>
This commit is contained in:
Joe Subbiani
2021-07-21 15:22:47 +01:00
parent 896f4eeaf7
commit d3a3f21ad5
4 changed files with 5 additions and 8 deletions

View File

@@ -221,8 +221,7 @@ static int ccm_auth_crypt( mbedtls_ccm_context *ctx, int mode, size_t length,
src = add;
memset( b, 0, 16 );
b[0] = MBEDTLS_BYTE_1( add_len );
b[1] = MBEDTLS_BYTE_0( add_len );
MBEDTLS_PUT_UINT16_BE( add_len, b, 0 );
use_len = len_left < 16 - 2 ? len_left : 16 - 2;
memcpy( b + 2, src, use_len );