mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-07 06:42:56 +03:00
Reduce the size of mbedtls_mpi
Reduce the size of mbedtls_mpi from 3 words to 2 on most architectures. This also reduces the code size significantly in bignum.o and ecp_curves.o, with negligible variations in other modules. This removes the ability to set MBEDTLS_MPI_MAX_LIMBS to a value >=65536, but we don't support customizing this value anyway (it's always 10000). Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
@@ -214,10 +214,13 @@ typedef struct mbedtls_mpi {
|
||||
* Note that this implies that calloc() or `... = {0}` does not create
|
||||
* a valid MPI representation. You must call mbedtls_mpi_init().
|
||||
*/
|
||||
int MBEDTLS_PRIVATE(s);
|
||||
signed short MBEDTLS_PRIVATE(s);
|
||||
|
||||
/** Total number of limbs in \c p. */
|
||||
size_t MBEDTLS_PRIVATE(n);
|
||||
unsigned short MBEDTLS_PRIVATE(n);
|
||||
#if MBEDTLS_MPI_MAX_LIMBS > 65535
|
||||
#error "MBEDTLS_MPI_MAX_LIMBS > 65535 is not supported"
|
||||
#endif
|
||||
|
||||
/** Pointer to limbs.
|
||||
*
|
||||
|
Reference in New Issue
Block a user