mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-05 19:35:48 +03:00
Improve docs in mbedtls_mpi_lt_mpi_ct
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
This commit is contained in:
@@ -72,7 +72,7 @@ int mbedtls_mpi_lt_mpi_ct(const mbedtls_mpi *X,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set sign_N to 1 if N >= 0, 0 if N < 0.
|
* Set N_is_negative to MBEDTLS_CT_FALSE if N >= 0, MBEDTLS_CT_TRUE if N < 0.
|
||||||
* We know that N->s == 1 if N >= 0 and N->s == -1 if N < 0.
|
* We know that N->s == 1 if N >= 0 and N->s == -1 if N < 0.
|
||||||
*/
|
*/
|
||||||
X_is_negative = mbedtls_ct_bool((X->s & 2) >> 1);
|
X_is_negative = mbedtls_ct_bool((X->s & 2) >> 1);
|
||||||
@@ -83,7 +83,7 @@ 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
|
* 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).
|
* is false if X is positive (X_is_negative == 0).
|
||||||
*/
|
*/
|
||||||
different_sign = mbedtls_ct_bool_xor(X_is_negative, Y_is_negative); // non-zero if different sign
|
different_sign = mbedtls_ct_bool_xor(X_is_negative, Y_is_negative); // true if different sign
|
||||||
result = mbedtls_ct_bool_and(different_sign, X_is_negative);
|
result = mbedtls_ct_bool_and(different_sign, X_is_negative);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user