diff --git a/include/mbedtls/config.h b/include/mbedtls/config.h index c594b6944..950319a10 100644 --- a/include/mbedtls/config.h +++ b/include/mbedtls/config.h @@ -695,8 +695,9 @@ * * Uncomment this macro to enable restartable ECC computations. * - * \note MBEDTLS_ECP_RESTARTABLE cannot be defined if there is an alternative - * implementation for one of the ECP, ECDSA or ECDH functions. * + * \note This option only works with the default software implementation of + * elliptic curve functionality. It is incompatible with + * MBEDTLS_ECP_ALT, MBEDTLS_ECDH_xxx_ALT and MBEDTLS_ECDSA_xxx_ALT. */ //#define MBEDTLS_ECP_RESTARTABLE diff --git a/library/ecdh.c b/library/ecdh.c index b7e25dcc9..307ee1fb2 100644 --- a/library/ecdh.c +++ b/library/ecdh.c @@ -191,14 +191,14 @@ int mbedtls_ecdh_make_params( mbedtls_ecdh_context *ctx, size_t *olen, { int ret; size_t grp_len, pt_len; -#if !defined(MBEDTLS_ECDH_GEN_PUBLIC_ALT) +#if defined(MBEDTLS_ECP_RESTARTABLE) mbedtls_ecp_restart_ctx *rs_ctx = NULL; #endif if( ctx == NULL || ctx->grp.pbits == 0 ) return( MBEDTLS_ERR_ECP_BAD_INPUT_DATA ); -#if defined(MBEDTLS_ECP_RESTARTABLE) && !defined(MBEDTLS_ECDH_GEN_PUBLIC_ALT) +#if defined(MBEDTLS_ECP_RESTARTABLE) if( ctx->restart_enabled ) rs_ctx = &ctx->rs; #endif