Fix ECP alternative macro names

The compile time macros enabling the initialisation and deinitialisation
in the alternative Elliptic Curve Point arithmetic implementation had
names that did not end with '_ALT' as required by check-names.sh.
This commit is contained in:
Janos Follath 2016-11-01 13:27:03 +00:00 committed by Andres AG
parent 58cf392bd4
commit 63f7cf5e35
4 changed files with 16 additions and 15 deletions

View File

@ -150,12 +150,12 @@
#error "MBEDTLS_GCM_C defined, but not all prerequisites" #error "MBEDTLS_GCM_C defined, but not all prerequisites"
#endif #endif
#if defined(MBEDTLS_ECP_ALT_INIT) && !defined(MBEDTLS_ECP_FUNCTION_ALT) #if defined(MBEDTLS_ECP_INIT_ALT) && !defined(MBEDTLS_ECP_FUNCTION_ALT)
#error "MBEDTLS_ECP_ALT_INIT defined, but not all prerequisites" #error "MBEDTLS_ECP_INIT_ALT defined, but not all prerequisites"
#endif #endif
#if defined(MBEDTLS_ECP_ALT_DEINIT) && !defined(MBEDTLS_ECP_FUNCTION_ALT) #if defined(MBEDTLS_ECP_DEINIT_ALT) && !defined(MBEDTLS_ECP_FUNCTION_ALT)
#error "MBEDTLS_ECP_ALT_DEINIT defined, but not all prerequisites" #error "MBEDTLS_ECP_DEINIT_ALT defined, but not all prerequisites"
#endif #endif
#if defined(MBEDTLS_ECP_RANDOMIZE_JAC_ALT) && !defined(MBEDTLS_ECP_FUNCTION_ALT) #if defined(MBEDTLS_ECP_RANDOMIZE_JAC_ALT) && !defined(MBEDTLS_ECP_FUNCTION_ALT)

View File

@ -314,12 +314,12 @@
* The functions: * The functions:
* int ecp_alt_init( const mbedtls_ecp_group *grp ) * int ecp_alt_init( const mbedtls_ecp_group *grp )
* void ecp_alt_deinit( const mbedtls_ecp_group *grp ) * void ecp_alt_deinit( const mbedtls_ecp_group *grp )
* can be enabled by MBEDTLS_ECP_ALT_INIT and MBEDTLS_ECP_ALT_DEINIT. * can be enabled by MBEDTLS_ECP_INIT_ALT and MBEDTLS_ECP_DEINIT_ALT.
* They are called before and after each point operation and provide an * They are called before and after each point operation and provide an
* opportunity to implement optimized set up and tear down instructions. * opportunity to implement optimized set up and tear down instructions.
* *
* Example: In case you uncomment MBEDTLS_ECP_FUNCTION_ALT and * Example: In case you uncomment MBEDTLS_ECP_FUNCTION_ALT and
* MBEDTLS_ECP_DOUBLE_JAC, mbed TLS will still provide the ecp_double_jac * MBEDTLS_ECP_DOUBLE_JAC_ALT, mbed TLS will still provide the ecp_double_jac
* function, but will use your ecp_double_jac_alt if the group is supported * function, but will use your ecp_double_jac_alt if the group is supported
* (your ecp_alt_grp_capable function returns 1 when receives it as an * (your ecp_alt_grp_capable function returns 1 when receives it as an
* argument). If the group is not supported then the original implementation is * argument). If the group is not supported then the original implementation is
@ -334,8 +334,8 @@
/* Required for all the functions in this section */ /* Required for all the functions in this section */
//#define MBEDTLS_ECP_FUNCTION_ALT //#define MBEDTLS_ECP_FUNCTION_ALT
/* Utility functions for setup and cleanup */ /* Utility functions for setup and cleanup */
//#define MBEDTLS_ECP_ALT_INIT //#define MBEDTLS_ECP_INIT_ALT
//#define MBEDTLS_ECP_ALT_DEINIT //#define MBEDTLS_ECP_DEINIT_ALT
/* Support for Weierstrass curves with Jacobi representation */ /* Support for Weierstrass curves with Jacobi representation */
//#define MBEDTLS_ECP_RANDOMIZE_JAC_ALT //#define MBEDTLS_ECP_RANDOMIZE_JAC_ALT
//#define MBEDTLS_ECP_ADD_MIXED_ALT //#define MBEDTLS_ECP_ADD_MIXED_ALT

View File

@ -29,12 +29,13 @@
unsigned char ecp_alt_grp_capable( const mbedtls_ecp_group *grp ); unsigned char ecp_alt_grp_capable( const mbedtls_ecp_group *grp );
#if defined(MBEDTLS_ECP_ALT_INIT) #if defined(MBEDTLS_ECP_INIT_ALT)
int ecp_alt_init( const mbedtls_ecp_group *grp ); int ecp_alt_init( const mbedtls_ecp_group *grp );
#endif #endif
#if defined(MBEDTLS_ECP_ALT_DEINIT) #if defined(MBEDTLS_ECP_DEINIT_ALT)
void ecp_alt_deinit( const mbedtls_ecp_group *grp ); void ecp_alt_deinit( const mbedtls_ecp_group *grp );
#endif
#if defined(MBEDTLS_ECP_RANDOMIZE_JAC_ALT) #if defined(MBEDTLS_ECP_RANDOMIZE_JAC_ALT)
int ecp_randomize_jac_alt( const mbedtls_ecp_group *grp, mbedtls_ecp_point *pt, int ecp_randomize_jac_alt( const mbedtls_ecp_group *grp, mbedtls_ecp_point *pt,

View File

@ -1685,7 +1685,7 @@ int mbedtls_ecp_mul( mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
( ret = mbedtls_ecp_check_pubkey( grp, P ) ) != 0 ) ( ret = mbedtls_ecp_check_pubkey( grp, P ) ) != 0 )
return( ret ); return( ret );
#if defined(MBEDTLS_ECP_ALT_INIT) #if defined(MBEDTLS_ECP_INIT_ALT)
if ( ecp_alt_grp_capable( grp ) ) if ( ecp_alt_grp_capable( grp ) )
{ {
MBEDTLS_MPI_CHK( ecp_alt_init( grp ) ); MBEDTLS_MPI_CHK( ecp_alt_init( grp ) );
@ -1702,11 +1702,11 @@ int mbedtls_ecp_mul( mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
ret = ecp_mul_comb( grp, R, m, P, f_rng, p_rng ); ret = ecp_mul_comb( grp, R, m, P, f_rng, p_rng );
#endif #endif
#if defined(MBEDTLS_ECP_ALT_INIT) #if defined(MBEDTLS_ECP_INIT_ALT)
cleanup: cleanup:
#endif #endif
#if defined(MBEDTLS_ECP_ALT_DEINIT) #if defined(MBEDTLS_ECP_DEINIT_ALT)
if ( ecp_alt_grp_capable( grp ) ) if ( ecp_alt_grp_capable( grp ) )
{ {
ecp_alt_deinit( grp ); ecp_alt_deinit( grp );
@ -1815,7 +1815,7 @@ int mbedtls_ecp_muladd( mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
MBEDTLS_MPI_CHK( mbedtls_ecp_mul_shortcuts( grp, &mP, m, P ) ); MBEDTLS_MPI_CHK( mbedtls_ecp_mul_shortcuts( grp, &mP, m, P ) );
MBEDTLS_MPI_CHK( mbedtls_ecp_mul_shortcuts( grp, R, n, Q ) ); MBEDTLS_MPI_CHK( mbedtls_ecp_mul_shortcuts( grp, R, n, Q ) );
#if defined(MBEDTLS_ECP_ALT_INIT) #if defined(MBEDTLS_ECP_INIT_ALT)
if ( ecp_alt_grp_capable( grp ) ) if ( ecp_alt_grp_capable( grp ) )
{ {
MBEDTLS_MPI_CHK( ecp_alt_init( grp ) ); MBEDTLS_MPI_CHK( ecp_alt_init( grp ) );
@ -1826,7 +1826,7 @@ int mbedtls_ecp_muladd( mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
cleanup: cleanup:
#if defined(MBEDTLS_ECP_ALT_DEINIT) #if defined(MBEDTLS_ECP_DEINIT_ALT)
if ( ecp_alt_grp_capable( grp ) ) if ( ecp_alt_grp_capable( grp ) )
{ {
ecp_alt_deinit( grp ); ecp_alt_deinit( grp );