]> git.codecow.com Git - Monocypher.git/commitdiff
Fixed compiler warning
authorLoup Vaillant <loup@loup-vaillant.fr>
Fri, 31 Jul 2020 21:04:16 +0000 (23:04 +0200)
committerLoup Vaillant <loup@loup-vaillant.fr>
Fri, 31 Jul 2020 21:04:16 +0000 (23:04 +0200)
Fixes #187

Note: w should remain a signed integer, so w-1 is correctly compared in
the FOR_T loop.

src/monocypher.c

index dd488e0571d7e9420d749f803389871fa93c5a96..f5f93fcfb8856c999239980e54aa762be05f586c 100644 (file)
@@ -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;