Skip to content

Commit

Permalink
make implicit typecast explicit
Browse files Browse the repository at this point in the history
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;
  • Loading branch information
SethArchambault authored and LoupVaillant committed Oct 22, 2023
1 parent 983e136 commit 67771e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/monocypher.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 67771e5

Please sign in to comment.