mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-11-09 14:50:17 +08:00
ecp: make mpi_one const again
That way, it can be stored in read-only memory. Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
This commit is contained in:
parent
275a44ec98
commit
1b531ff7e5
@ -47,7 +47,7 @@
|
||||
defined(MBEDTLS_ECP_DP_SECP256K1_ENABLED)
|
||||
/* For these curves, we build the group parameters dynamically. */
|
||||
#define ECP_LOAD_GROUP
|
||||
static mbedtls_mpi_uint mpi_one[] = { 1 };
|
||||
static const mbedtls_mpi_uint mpi_one[] = { 1 };
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -4509,9 +4509,7 @@ static inline void ecp_mpi_load(mbedtls_mpi *X, const mbedtls_mpi_uint *p, size_
|
||||
*/
|
||||
static inline void ecp_mpi_set1(mbedtls_mpi *X)
|
||||
{
|
||||
X->s = 1;
|
||||
X->n = 1;
|
||||
X->p = mpi_one;
|
||||
ecp_mpi_load(X, mpi_one, sizeof(mbedtls_mpi_uint));
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user