diff options
author | Mattias Andrée <maandree@kth.se> | 2022-07-07 16:07:31 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2022-07-07 16:07:31 +0200 |
commit | c65cda9f1761a19eac33a2e9d1e16599472ae067 (patch) | |
tree | 7248789cf6b8cbab507d685e680a3553c99d6ed3 /common.h | |
parent | Bump year (diff) | |
download | libsha2-c65cda9f1761a19eac33a2e9d1e16599472ae067.tar.gz libsha2-c65cda9f1761a19eac33a2e9d1e16599472ae067.tar.bz2 libsha2-c65cda9f1761a19eac33a2e9d1e16599472ae067.tar.xz |
Use uint_leastN_t instead of uintN_t
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | common.h | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -16,6 +16,23 @@ /** + * 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) + +/** + * Truncate an unsigned integer to an unsigned 64-bit integer + * + * @param X:uint_least64_t The value to truncate + * @return :uint_least64_t The 64 lowest bits in `X` + */ +#define TRUNC64(X) ((X) & (uint_least64_t)0xFFFFFFFFFFFFFFFFULL) + + +/** * Process a chunk using SHA-2 * * @param state The hashing state |