diff --git a/library/ecdh.c b/library/ecdh.c index 307ee1fb20..5fb06cca37 100644 --- a/library/ecdh.c +++ b/library/ecdh.c @@ -212,7 +212,7 @@ int mbedtls_ecdh_make_params( mbedtls_ecdh_context *ctx, size_t *olen, if( ( ret = ecdh_gen_public_restartable( &ctx->grp, &ctx->d, &ctx->Q, f_rng, p_rng, rs_ctx ) ) != 0 ) return( ret ); -#endif /* MBEDTLS_ECDH_GEN_PUBLIC_ALT */ +#endif /* !MBEDTLS_ECDH_GEN_PUBLIC_ALT */ if( ( ret = mbedtls_ecp_tls_write_group( &ctx->grp, &grp_len, buf, blen ) ) != 0 ) @@ -286,14 +286,14 @@ int mbedtls_ecdh_make_public( mbedtls_ecdh_context *ctx, size_t *olen, void *p_rng ) { int ret; -#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 @@ -342,14 +342,14 @@ int mbedtls_ecdh_calc_secret( mbedtls_ecdh_context *ctx, size_t *olen, void *p_rng ) { int ret; -#if !defined(MBEDTLS_ECDH_COMPUTE_SHARED_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