mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-02-22 09:40:09 +00:00
Use only MBEDTLS_ECP_WITH_MPI_UINT
to switch between the ecp variants
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
This commit is contained in:
parent
6db604711d
commit
2a7bcaf8af
@ -43,9 +43,7 @@
|
|||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
#include "ecp_invasive.h"
|
#if !defined(MBEDTLS_ECP_WITH_MPI_UINT)
|
||||||
|
|
||||||
#if defined(MBEDTLS_ECP_WITH_MPI_STRUCT)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Function level alternative implementation.
|
* \brief Function level alternative implementation.
|
||||||
@ -84,6 +82,7 @@
|
|||||||
#include "mbedtls/error.h"
|
#include "mbedtls/error.h"
|
||||||
|
|
||||||
#include "bn_mul.h"
|
#include "bn_mul.h"
|
||||||
|
#include "ecp_invasive.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
@ -3653,4 +3652,4 @@ mbedtls_ecp_variant mbedtls_ecp_get_variant()
|
|||||||
|
|
||||||
#endif /* MBEDTLS_ECP_LIGHT */
|
#endif /* MBEDTLS_ECP_LIGHT */
|
||||||
|
|
||||||
#endif /* MBEDTLS_ECP_WITH_MPI_STRUCT */
|
#endif /* MBEDTLS_ECP_WITH_MPI_UINT */
|
||||||
|
@ -40,23 +40,13 @@ typedef enum {
|
|||||||
MBEDTLS_ECP_MOD_SCALAR
|
MBEDTLS_ECP_MOD_SCALAR
|
||||||
} mbedtls_ecp_modulus_type;
|
} 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
|
/* Provide a commented-out definition so that `check_names.py` knows that
|
||||||
* it's not a typo.
|
* it's not a typo.
|
||||||
* MBEDTLS_ECP_WITH_MPI_UINT must not be defined within config files, but
|
* 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
|
* only on the command line.
|
||||||
* built.
|
|
||||||
*/
|
*/
|
||||||
//#define MBEDTLS_ECP_WITH_MPI_UINT
|
//#define MBEDTLS_ECP_WITH_MPI_UINT
|
||||||
|
|
||||||
/* Enable the old bignum interface. */
|
|
||||||
#define MBEDTLS_ECP_WITH_MPI_STRUCT
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
MBEDTLS_ECP_VARIANT_NONE = 0,
|
MBEDTLS_ECP_VARIANT_NONE = 0,
|
||||||
MBEDTLS_ECP_VARIANT_WITH_MPI_STRUCT = 1,
|
MBEDTLS_ECP_VARIANT_WITH_MPI_STRUCT = 1,
|
||||||
|
@ -43,8 +43,6 @@
|
|||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
#include "ecp_invasive.h"
|
|
||||||
|
|
||||||
#if defined(MBEDTLS_ECP_WITH_MPI_UINT)
|
#if defined(MBEDTLS_ECP_WITH_MPI_UINT)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -84,6 +82,7 @@
|
|||||||
#include "mbedtls/error.h"
|
#include "mbedtls/error.h"
|
||||||
|
|
||||||
#include "bn_mul.h"
|
#include "bn_mul.h"
|
||||||
|
#include "ecp_invasive.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
@ -1636,12 +1636,10 @@ void check_variant()
|
|||||||
{
|
{
|
||||||
mbedtls_ecp_variant variant = mbedtls_ecp_get_variant();
|
mbedtls_ecp_variant variant = mbedtls_ecp_get_variant();
|
||||||
|
|
||||||
#if defined(MBEDTLS_ECP_WITH_MPI_STRUCT)
|
#if defined(MBEDTLS_ECP_VARIANT_WITH_MPI_UINT)
|
||||||
TEST_EQUAL(variant, MBEDTLS_ECP_VARIANT_WITH_MPI_STRUCT);
|
|
||||||
#elif defined(MBEDTLS_ECP_WITH_MPI_UINT)
|
|
||||||
TEST_EQUAL(variant, MBEDTLS_ECP_VARIANT_WITH_MPI_UINT);
|
TEST_EQUAL(variant, MBEDTLS_ECP_VARIANT_WITH_MPI_UINT);
|
||||||
#else
|
#else
|
||||||
#error "No ecp variant detected."
|
TEST_EQUAL(variant, MBEDTLS_ECP_VARIANT_WITH_MPI_STRUCT);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
/* END_CASE */
|
/* END_CASE */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user