From 811a82296969a037d1e580d65bb5a73241ffae1f Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 7 Jul 2022 14:32:58 +0200 Subject: Use uint_least32_t instead of uint32_t MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- common.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'common.h') diff --git a/common.h b/common.h index 864082c..2c8250c 100644 --- a/common.h +++ b/common.h @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -15,6 +16,15 @@ #endif +/** + * Truncate an unsigned integer to an unsigned 32-bit integer + * + * @param X:uint_least32_t The value to truncate + * @return :uint_least32_t The 32 lowest bits in `X` + */ +#define TRUNC32(X) ((X) & (uint_least32_t)0xFFFFFFFFUL) + + /** * Process a chunk using SHA-1 or SHA-0 * -- cgit v1.2.3-70-g09d2