From e2c4454f869b42cfa108c758b6c2dbe23490b74f Mon Sep 17 00:00:00 2001 From: Loup Vaillant Date: Fri, 31 Jul 2020 23:04:16 +0200 Subject: [PATCH] Fixed compiler warning Fixes #187 Note: w should remain a signed integer, so w-1 is correctly compared in the FOR_T loop. --- src/monocypher.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/monocypher.c b/src/monocypher.c index dd488e0..f5f93fc 100644 --- a/src/monocypher.c +++ b/src/monocypher.c @@ -1843,7 +1843,7 @@ static int slide_step(slide_ctx *ctx, int width, int i, const u8 scalar[32]) | (((lsb & 0xF0) != 0) << 2)); ctx->next_index = (i16)(i-(w-1)+s); ctx->next_digit = (i8) (v >> s ); - ctx->next_check -= w; + ctx->next_check -= (u8) w; } } return i == ctx->next_index ? ctx->next_digit: 0; -- 2.47.3