mirror of
https://github.com/openssl/openssl.git
synced 2025-01-19 08:23:32 +08:00
Change loops conditions to make zero loop risk more obvious.
Fixes openssl#18073. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Todd Short <todd.short@me.com> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18327)
This commit is contained in:
parent
272138795f
commit
36c269c302
@ -498,7 +498,7 @@ void ossl_aria_encrypt(const unsigned char *in, unsigned char *out,
|
||||
ARIA_ADD_ROUND_KEY(rk, reg0, reg1, reg2, reg3);
|
||||
rk++;
|
||||
|
||||
while (Nr -= 2) {
|
||||
while ((Nr -= 2) > 0) {
|
||||
ARIA_SUBST_DIFF_EVEN(reg0, reg1, reg2, reg3);
|
||||
ARIA_ADD_ROUND_KEY(rk, reg0, reg1, reg2, reg3);
|
||||
rk++;
|
||||
|
@ -545,7 +545,11 @@ static void gcm_ghash_4bit(u64 Xi[2], const u128 Htable[16],
|
||||
Xi[0] = Z.hi;
|
||||
Xi[1] = Z.lo;
|
||||
}
|
||||
} while (inp += 16, len -= 16);
|
||||
|
||||
inp += 16;
|
||||
/* Block size is 128 bits so len is a multiple of 16 */
|
||||
len -= 16;
|
||||
} while (len > 0);
|
||||
}
|
||||
# endif
|
||||
# else
|
||||
|
Loading…
Reference in New Issue
Block a user