From: SethArchambault Date: Fri, 20 Oct 2023 00:18:14 +0000 (-0400) Subject: make implicit typecast explicit X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=67771e5074263d4402d96a37064b6d84933eff7b;p=Monocypher.git make implicit typecast explicit This came out of adding these compile options: `-Werror -Wall -Wextra -Wshadow -Wconversion -Wno-deprecated-declarations -Wno-unused-parameter` /src/monocypher.c -u32 index = lane * lane_size + (u32)ref; +u32 index = (u32)(lane * lane_size) + (u32)ref; --- diff --git a/src/monocypher.c b/src/monocypher.c index 302635a..1f4b2e6 100644 --- a/src/monocypher.c +++ b/src/monocypher.c @@ -878,7 +878,7 @@ void crypto_argon2(u8 *hash, u32 hash_size, void *work_area, u64 y = (window_size * x) >> 32; u64 z = (window_size - 1) - y; u64 ref = (window_start + z) % lane_size; - u32 index = lane * lane_size + (u32)ref; + u32 index = (u32)(lane * lane_size) + (u32)ref; blk *reference = blocks + index; // Shuffle the previous & reference block