From 2f8ad595db07954f384bbe1a78e649073c02b117 Mon Sep 17 00:00:00 2001 From: Janos Follath Date: Thu, 22 Aug 2024 17:13:25 +0100 Subject: [PATCH] Explain the choice of the value of MBEDTLS_MPI_IS_PUBLIC Signed-off-by: Janos Follath --- library/bignum_core.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/library/bignum_core.h b/library/bignum_core.h index e64128f160..ba2978eb33 100644 --- a/library/bignum_core.h +++ b/library/bignum_core.h @@ -107,7 +107,10 @@ * // safe path * } * not the other way round, in order to prevent misuse. (This is, if a value - * other than the two below is passed, default to the safe path.) */ + * other than the two below is passed, default to the safe path.) + * + * The value of MBEDTLS_MPI_IS_PUBLIC is chosen in a way that is unlikely to happen by accident, but + * which can be used as an immediate value in a Thumb2 comparison (for code size). */ #define MBEDTLS_MPI_IS_PUBLIC 0x2a2a2a2a #define MBEDTLS_MPI_IS_SECRET 0 #if defined(MBEDTLS_TEST_HOOKS) && !defined(MBEDTLS_THREADING_C)