From 281956d5c3702dbd48b3ca25134e79cc12c11c37 Mon Sep 17 00:00:00 2001 From: Joe Subbiani Date: Fri, 16 Jul 2021 17:14:07 +0100 Subject: [PATCH] Remove use of byte reading macro for uint16 Accidently used MBEDTLS_BYTE_16 for a uint16 variable Signed-off-by: Joe Subbiani --- library/poly1305.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/poly1305.c b/library/poly1305.c index 333aade94..9e90d67b1 100644 --- a/library/poly1305.c +++ b/library/poly1305.c @@ -61,9 +61,9 @@ static uint64_t mul64( uint32_t a, uint32_t b ) { /* a = al + 2**16 ah, b = bl + 2**16 bh */ const uint16_t al = (uint16_t) a; - const uint16_t bl = (uint16_t) b; - const uint16_t ah = MBEDTLS_BYTE_2( a ); - const uint16_t bh = MBEDTLS_BYTE_2( b ); + const uint16_t bl = (uint16_t) b; + const uint16_t ah = a >> 16; + const uint16_t bh = b >> 16; /* ab = al*bl + 2**16 (ah*bl + bl*bh) + 2**32 ah*bh */ const uint32_t lo = (uint32_t) al * bl;