Debugging asserts had implicit casts that triggered the warnings.
However, instead of making the casts explicit it's more appropriate
to perform checks that ensure that implicit casts were safe.
ec/curve448/scalar.c: size_t-fy scalar_decode_short.
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5494)
* it was < p, so now scarry = -1 and this = x - p + 2^255 so let's add
* back in p. will carry back off the top for 2^255.
*/
- assert(word_is_zero(scarry) | word_is_zero(scarry + 1));
+ assert(scarry == 0 || scarry == -1);
scarry_0 = (word_t)scarry;
carry >>= LIMB_PLACE_VALUE(LIMBPERM(i));
}
- assert(word_is_zero(carry + scarry_0));
+ assert(carry < 2 && ((word_t)carry + scarry_0) == 0);
}
/* Subtract two gf elements d=a-b */
static ossl_inline void scalar_decode_short(curve448_scalar_t s,
const unsigned char *ser,
- unsigned int nbytes)
+ size_t nbytes)
{
- unsigned int i, j, k = 0;
+ size_t i, j, k = 0;
for (i = 0; i < C448_SCALAR_LIMBS; i++) {
c448_word_t out = 0;