Use only `MBEDTLS_ECP_WITH_MPI_UINT` to switch between the ecp variants
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
diff --git a/library/ecp.c b/library/ecp.c
index 6087256..f5d43d5 100644
--- a/library/ecp.c
+++ b/library/ecp.c
@@ -43,9 +43,7 @@
#include "common.h"
-#include "ecp_invasive.h"
-
-#if defined(MBEDTLS_ECP_WITH_MPI_STRUCT)
+#if !defined(MBEDTLS_ECP_WITH_MPI_UINT)
/**
* \brief Function level alternative implementation.
@@ -84,6 +82,7 @@
#include "mbedtls/error.h"
#include "bn_mul.h"
+#include "ecp_invasive.h"
#include <string.h>
@@ -3653,4 +3652,4 @@
#endif /* MBEDTLS_ECP_LIGHT */
-#endif /* MBEDTLS_ECP_WITH_MPI_STRUCT */
+#endif /* MBEDTLS_ECP_WITH_MPI_UINT */
diff --git a/library/ecp_invasive.h b/library/ecp_invasive.h
index 456ac21..c4a0a4d 100644
--- a/library/ecp_invasive.h
+++ b/library/ecp_invasive.h
@@ -40,23 +40,13 @@
MBEDTLS_ECP_MOD_SCALAR
} mbedtls_ecp_modulus_type;
-/* Requred macros for ECP split.
- * If MBEDTLS_ECP_WITH_MPI_UINT is defined the new bignum interface is used.
- */
-#if !defined(MBEDTLS_ECP_WITH_MPI_UINT)
-
/* Provide a commented-out definition so that `check_names.py` knows that
* it's not a typo.
* MBEDTLS_ECP_WITH_MPI_UINT must not be defined within config files, but
- * only on the command line, as otherwise both ECP implementations will be
- * built.
+ * only on the command line.
*/
//#define MBEDTLS_ECP_WITH_MPI_UINT
-/* Enable the old bignum interface. */
-#define MBEDTLS_ECP_WITH_MPI_STRUCT
-#endif
-
typedef enum {
MBEDTLS_ECP_VARIANT_NONE = 0,
MBEDTLS_ECP_VARIANT_WITH_MPI_STRUCT = 1,
diff --git a/library/ecp_new.c b/library/ecp_new.c
index 3df6f9f..028a33b 100644
--- a/library/ecp_new.c
+++ b/library/ecp_new.c
@@ -43,8 +43,6 @@
#include "common.h"
-#include "ecp_invasive.h"
-
#if defined(MBEDTLS_ECP_WITH_MPI_UINT)
/**
@@ -84,6 +82,7 @@
#include "mbedtls/error.h"
#include "bn_mul.h"
+#include "ecp_invasive.h"
#include <string.h>