Make MBEDTLS_MPI_IS_PUBLIC thumb friendly

In Thumb instructions, constant can be:

- any constant that can be produced by shifting an 8-bit value left by any
  number of bits within a 32-bit word
- any constant of the form 0x00XY00XY
- any constant of the form 0xXY00XY00
- any constant of the form 0xXYXYXYXY.

Signed-off-by: Janos Follath <janos.follath@arm.com>
This commit is contained in:
Janos Follath 2024-08-12 19:55:02 +01:00 committed by Manuel Pégourié-Gonnard
parent 5b69fade31
commit 24fb8c9be5

View File

@ -108,7 +108,7 @@
* } * }
* not the other way round, in order to prevent misuse. (This is, if a value * 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.) */
#define MBEDTLS_MPI_IS_PUBLIC 0x2a2a #define MBEDTLS_MPI_IS_PUBLIC 0x2a2a2a2a
#define MBEDTLS_MPI_IS_SECRET 0 #define MBEDTLS_MPI_IS_SECRET 0
/** Count leading zero bits in a given integer. /** Count leading zero bits in a given integer.