diff options
author | Mattias Andrée <maandree@kth.se> | 2022-07-07 14:32:58 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2022-07-07 14:32:58 +0200 |
commit | 811a82296969a037d1e580d65bb5a73241ffae1f (patch) | |
tree | 404759c5e429d450c91f110497758424fb4eaf1d /common.h | |
parent | Don't marshal w (diff) | |
download | libsha1-811a82296969a037d1e580d65bb5a73241ffae1f.tar.gz libsha1-811a82296969a037d1e580d65bb5a73241ffae1f.tar.bz2 libsha1-811a82296969a037d1e580d65bb5a73241ffae1f.tar.xz |
Use uint_least32_t instead of uint32_t
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | common.h | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -4,6 +4,7 @@ #include <sys/stat.h> #include <alloca.h> #include <errno.h> +#include <inttypes.h> #include <stdlib.h> #include <stddef.h> #include <string.h> @@ -16,6 +17,15 @@ /** + * 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 * * @param state The hashing state |