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.
This commit is contained in:
parent
dcd6d9bf7b
commit
bc3cc77a0a
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user