]> git.codecow.com Git - Monocypher.git/commitdiff
make implicit typecast explicit
authorSethArchambault <seth@doercreator.com>
Fri, 20 Oct 2023 00:18:14 +0000 (20:18 -0400)
committerLoup Vaillant <github-is-valid@loup-vaillant.fr>
Sun, 22 Oct 2023 22:16:00 +0000 (00:16 +0200)
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;

src/monocypher.c

index 302635aca3199311c332d2122992278795e191e9..1f4b2e6f150dc8240b4e278561f4e173b07ca16e 100644 (file)
@@ -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