Rename mbedtls_ct_bool_xor to mbedtls_ct_bool_ne
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
diff --git a/library/bignum.c b/library/bignum.c
index 0a0022c..9c19fc9 100644
--- a/library/bignum.c
+++ b/library/bignum.c
@@ -83,7 +83,7 @@
* 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).
*/
- different_sign = mbedtls_ct_bool_xor(X_is_negative, Y_is_negative); // non-zero if different sign
+ different_sign = mbedtls_ct_bool_ne(X_is_negative, Y_is_negative); // true if different sign
result = mbedtls_ct_bool_and(different_sign, X_is_negative);
/*
diff --git a/library/constant_time_impl.h b/library/constant_time_impl.h
index 8da15a8..98a5663 100644
--- a/library/constant_time_impl.h
+++ b/library/constant_time_impl.h
@@ -407,8 +407,8 @@
return ~mbedtls_ct_uint_gt(x, y);
}
-static inline mbedtls_ct_condition_t mbedtls_ct_bool_xor(mbedtls_ct_condition_t x,
- mbedtls_ct_condition_t y)
+static inline mbedtls_ct_condition_t mbedtls_ct_bool_ne(mbedtls_ct_condition_t x,
+ mbedtls_ct_condition_t y)
{
return (mbedtls_ct_condition_t) (x ^ y);
}
diff --git a/library/constant_time_internal.h b/library/constant_time_internal.h
index 323edef..50c08fa 100644
--- a/library/constant_time_internal.h
+++ b/library/constant_time_internal.h
@@ -194,11 +194,11 @@
static inline mbedtls_ct_condition_t mbedtls_ct_uint_le(mbedtls_ct_uint_t x,
mbedtls_ct_uint_t y);
-/** Boolean "xor" operation.
+/** Boolean not-equals operation.
*
* Functionally equivalent to:
*
- * \p x ^ \p y
+ * \p x != \p y
*
* \param x The first value to analyze.
* \param y The second value to analyze.
@@ -206,11 +206,11 @@
* \note This is more efficient than mbedtls_ct_uint_ne if both arguments are
* mbedtls_ct_condition_t.
*
- * \return MBEDTLS_CT_TRUE if \p x ^ \p y,
+ * \return MBEDTLS_CT_TRUE if \p x != \p y,
* otherwise MBEDTLS_CT_FALSE.
*/
-static inline mbedtls_ct_condition_t mbedtls_ct_bool_xor(mbedtls_ct_condition_t x,
- mbedtls_ct_condition_t y);
+static inline mbedtls_ct_condition_t mbedtls_ct_bool_ne(mbedtls_ct_condition_t x,
+ mbedtls_ct_condition_t y);
/** Boolean "and" operation.
*