@@ -1224,26 +1224,25 @@ int mbedtls_mpi_lt_mpi_ct( const mbedtls_mpi *X, const mbedtls_mpi *Y,
1224
1224
for ( i = X -> n ; i > 0 ; i -- )
1225
1225
{
1226
1226
/*
1227
- * If Y->p[i - 1] < X->p[i - 1] and both X and Y are negative, then
1228
- * X < Y .
1227
+ * If Y->p[i - 1] < X->p[i - 1] then X < Y is true if and only if both
1228
+ * X and Y are negative .
1229
1229
*
1230
1230
* Again even if we can make a decision, we just mark the result and
1231
1231
* the fact that we are done and continue looping.
1232
1232
*/
1233
- cond = ct_lt_mpi_uint ( Y -> p [i - 1 ], X -> p [i - 1 ] ) & X_is_negative ;
1234
- * ret |= cond & ( 1 - done );
1233
+ cond = ct_lt_mpi_uint ( Y -> p [i - 1 ], X -> p [i - 1 ] );
1234
+ * ret |= cond & ( 1 - done ) & X_is_negative ;
1235
1235
done |= cond ;
1236
1236
1237
1237
/*
1238
- * If X->p[i - 1] < Y->p[i - 1] and both X and Y are positive, then
1239
- * X < Y .
1238
+ * If X->p[i - 1] < Y->p[i - 1] then X < Y is true if and only if both
1239
+ * X and Y are positive .
1240
1240
*
1241
1241
* Again even if we can make a decision, we just mark the result and
1242
1242
* the fact that we are done and continue looping.
1243
1243
*/
1244
- cond = ct_lt_mpi_uint ( X -> p [i - 1 ], Y -> p [i - 1 ] )
1245
- & ( 1 - X_is_negative );
1246
- * ret |= cond & ( 1 - done );
1244
+ cond = ct_lt_mpi_uint ( X -> p [i - 1 ], Y -> p [i - 1 ] );
1245
+ * ret |= cond & ( 1 - done ) & ( 1 - X_is_negative );
1247
1246
done |= cond ;
1248
1247
}
1249
1248
0 commit comments