Add core constant time comparison

Unfortunately reusing the new function from the signed constant time
comparison is not trivial.

One option would be to do temporary conditional swaps which would prevent
qualifying input to const. Another way would be to add an additional
flag for the sign and make it an integral part of the computation, which
would defeat the purpose of having an unsigned core comparison.

Going with two separate function for now and the signed version can be
retired/compiled out with the legacy API eventually.

The new function in theory could be placed into either
`library/constant_time.c` or `library/bignum_new.c`. Going with the
first as the other functions in the second are not constant time yet and
this distinction seems more valuable for new (as opposed to belonging to
the `_core` functions.

Signed-off-by: Janos Follath <janos.follath@arm.com>
diff --git a/library/constant_time_internal.h b/library/constant_time_internal.h
index 9466bc3..7255b2a 100644
--- a/library/constant_time_internal.h
+++ b/library/constant_time_internal.h
@@ -129,6 +129,22 @@
 unsigned mbedtls_ct_mpi_uint_lt( const mbedtls_mpi_uint x,
                                  const mbedtls_mpi_uint y );
 
+/**
+ * \brief          Check if an MPI is less than the other in constant time.
+ *
+ * \param X        The left-hand MPI. This must point to an array of limbs
+ *                 with the same allocated length as Y.
+ * \param Y        The right-hand MPI. This must point to an array of limbs
+ *                 with the same allocated length as X.
+ * \param len      The number of limbs in X and Y.
+ *
+ * \return         The result of the comparison:
+ *                 \c 1 if \p X is less than \p Y.
+ *                 \c 0 if \p X is greater than or equal to \p Y.
+ */
+unsigned mbedtls_mpi_core_lt_ct( const mbedtls_mpi_uint *X,
+                                 const mbedtls_mpi_uint *Y,
+                                 size_t len );
 #endif /* MBEDTLS_BIGNUM_C */
 
 /** Choose between two integer values without branches.