Adjust dependencies

This commit is contained in:
Manuel Pégourié-Gonnard 2013-10-10 15:40:49 +02:00
parent 48ac3db551
commit b8012fca5f
2 changed files with 14 additions and 20 deletions

View File

@ -1016,7 +1016,7 @@
* Caller: library/ecdh.c
* library/ecdsa.c
*
* Requires: POLARSSL_BIGNUM_C
* Requires: POLARSSL_BIGNUM_C and at least one POLARSSL_ECP_DP_XXX_ENABLED
*/
#define POLARSSL_ECP_C
@ -1710,7 +1710,15 @@
#error "POLARSSL_ECDSA_C defined, but not all prerequisites"
#endif
#if defined(POLARSSL_ECP_C) && !defined(POLARSSL_BIGNUM_C)
#if defined(POLARSSL_ECP_C) && !defined(POLARSSL_BIGNUM_C) || ( \
!defined(POLARSSL_ECP_DP_SECP192R1_ENABLED) && \
!defined(POLARSSL_ECP_DP_SECP224R1_ENABLED) && \
!defined(POLARSSL_ECP_DP_SECP256R1_ENABLED) && \
!defined(POLARSSL_ECP_DP_SECP384R1_ENABLED) && \
!defined(POLARSSL_ECP_DP_SECP521R1_ENABLED) && \
!defined(POLARSSL_ECP_DP_BP256R1_ENABLED) && \
!defined(POLARSSL_ECP_DP_BP384R1_ENABLED) && \
!defined(POLARSSL_ECP_DP_BP512R1_ENABLED) )
#error "POLARSSL_ECP_C defined, but not all prerequisites"
#endif

View File

@ -1747,6 +1747,7 @@ int ecp_self_test( int verbose )
ecp_point R, P;
mpi m;
unsigned long add_c_prev, dbl_c_prev;
/* exponents especially adapted for secp192r1 */
const char *exponents[] =
{
"000000000000000000000000000000000000000000000000", /* zero */
@ -1763,27 +1764,12 @@ int ecp_self_test( int verbose )
ecp_point_init( &P );
mpi_init( &m );
/* Use secp192r1 if available, or any available curve */
#if defined(POLARSSL_ECP_DP_SECP192R1_ENABLED)
MPI_CHK( ecp_use_known_dp( &grp, POLARSSL_ECP_DP_SECP192R1 ) );
#else
#if defined(POLARSSL_ECP_DP_SECP224R1_ENABLED)
MPI_CHK( ecp_use_known_dp( &grp, POLARSSL_ECP_DP_SECP224R1 ) );
#else
#if defined(POLARSSL_ECP_DP_SECP256R1_ENABLED)
MPI_CHK( ecp_use_known_dp( &grp, POLARSSL_ECP_DP_SECP256R1 ) );
#else
#if defined(POLARSSL_ECP_DP_SECP384R1_ENABLED)
MPI_CHK( ecp_use_known_dp( &grp, POLARSSL_ECP_DP_SECP384R1 ) );
#else
#if defined(POLARSSL_ECP_DP_SECP521R1_ENABLED)
MPI_CHK( ecp_use_known_dp( &grp, POLARSSL_ECP_DP_SECP521R1 ) );
#else
#error No curves defines
#endif /* POLARSSL_ECP_DP_SECP512R1_ENABLED */
#endif /* POLARSSL_ECP_DP_SECP384R1_ENABLED */
#endif /* POLARSSL_ECP_DP_SECP256R1_ENABLED */
#endif /* POLARSSL_ECP_DP_SECP224R1_ENABLED */
#endif /* POLARSSL_ECP_DP_SECP192R1_ENABLED */
MPI_CHK( ecp_use_known_dp( &grp, ecp_curve_list()->grp_id ) );
#endif
if( verbose != 0 )
printf( " ECP test #1 (constant op_count, base point G): " );