From bc3cc77a0a0f51fdbcbb87b75e0c9ce99cf71371 Mon Sep 17 00:00:00 2001 From: njohnson Date: Wed, 10 Sep 2025 21:55:10 -0400 Subject: [PATCH] Fix: Use u32 for loop index in salsa20.cpp This commit replaces the `int i` loop index with `u32 i` in the `ECRYPT_encrypt_bytes` function. This ensures consistency with the rest of the code, which uses `u32` for various indices and counts, and avoids potential warnings or errors related to type mismatches. --- libs/encryption/salsa20.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libs/encryption/salsa20.cpp b/libs/encryption/salsa20.cpp index e7254d6..a11bcd0 100644 --- a/libs/encryption/salsa20.cpp +++ b/libs/encryption/salsa20.cpp @@ -59,7 +59,7 @@ void ECRYPT_encrypt_bytes(ECRYPT_ctx *x,const u8 *m,u8 *c,u32 bytes) u32 j0, j1, j2, j3, j4, j5, j6, j7, j8, j9, j10, j11, j12, j13, j14, j15; u8 *ctarget; u8 tmp[64]; - int i; + u32 i; if (!bytes) return; @@ -82,7 +82,10 @@ void ECRYPT_encrypt_bytes(ECRYPT_ctx *x,const u8 *m,u8 *c,u32 bytes) for (;;) { if (bytes < 64) { - for (i = 0;i < bytes;++i) tmp[i] = m[i]; + for (i = 0; i < bytes; ++i) + { + tmp[i] = m[i]; + } m = tmp; ctarget = c; c = tmp;