]> wagner.pp.ru Git - openssl-gost/engine.git/commitdiff
MSVC: Fix signedness in comparison
authorVitaly Chikunov <vt@altlinux.org>
Fri, 3 Dec 2021 09:02:32 +0000 (12:02 +0300)
committerDmitry Belyavskiy <beldmit@users.noreply.github.com>
Sat, 11 Dec 2021 16:45:14 +0000 (19:45 +0300)
Error message:

  gost_crypt.c(652,36): warning C4018: '<': signed/unsigned mismatch

Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
gost_crypt.c

index 3cbea7620c776c7b8954bdf05882615e1354f383..da78e396fd941acc40034f426e7cbd5f79ee3601 100644 (file)
@@ -649,7 +649,7 @@ static void ctr64_inc(unsigned char *counter)
 static inline void apply_acpkm_magma(struct ossl_gost_cipher_ctx *
                                            ctx, unsigned int *num)
 {
-    if (!ctx->key_meshing || (*num < ctx->key_meshing))
+    if (!ctx->key_meshing || (*num < (unsigned int)ctx->key_meshing))
         return;
     acpkm_magma_key_meshing(&ctx->cctx);
     *num &= MAGMA_BLOCK_MASK;