diff --git a/library/bignum.c b/library/bignum.c index aa5f818c40..de652c3090 100644 --- a/library/bignum.c +++ b/library/bignum.c @@ -61,7 +61,7 @@ int mbedtls_mpi_lt_mpi_ct(const mbedtls_mpi *X, const mbedtls_mpi *Y, unsigned *ret) { - mbedtls_ct_condition_t cond, X_is_negative, Y_is_negative, result; + mbedtls_ct_condition_t different_sign, X_is_negative, Y_is_negative, result; MPI_VALIDATE_RET(X != NULL); MPI_VALIDATE_RET(Y != NULL); @@ -83,8 +83,8 @@ int mbedtls_mpi_lt_mpi_ct(const mbedtls_mpi *X, * That is if X is negative (X_is_negative == 1), then X < Y is true and it * is false if X is positive (X_is_negative == 0). */ - cond = mbedtls_ct_bool_xor(X_is_negative, Y_is_negative); // non-zero if different sign - result = mbedtls_ct_bool_and(cond, X_is_negative); + different_sign = mbedtls_ct_bool_xor(X_is_negative, Y_is_negative); // non-zero if different sign + result = mbedtls_ct_bool_and(different_sign, X_is_negative); /* * Assuming signs are the same, compare X and Y. We switch the comparison @@ -98,10 +98,11 @@ int mbedtls_mpi_lt_mpi_ct(const mbedtls_mpi *X, mbedtls_ct_condition_t lt = mbedtls_mpi_core_lt_ct(p[i], p[i ^ 1], X->n); /* - * Store in result iff the signs are the same (i.e., iff cond == false). If + * Store in result iff the signs are the same (i.e., iff different_sign == false). If * the signs differ, result has already been set, so we don't change it. */ - result = mbedtls_ct_bool_or(result, mbedtls_ct_bool_and(mbedtls_ct_bool_not(cond), lt)); + result = mbedtls_ct_bool_or(result, + mbedtls_ct_bool_and(mbedtls_ct_bool_not(different_sign), lt)); *ret = mbedtls_ct_uint_if0(result, 1);