Remove redundant test on curve type

If rsm != NULL then the curve type has to be Short Weierstrass, as we don't
implement restartable Montgomery now. If and when we do, then it's better to
check for the subcontext only, and not for the curve type.
This commit is contained in:
Manuel Pégourié-Gonnard 2017-08-24 13:47:04 +02:00
parent 11556e2846
commit 95aedfea33

View File

@ -2234,10 +2234,9 @@ int mbedtls_ecp_mul_restartable( mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
MBEDTLS_MPI_CHK( mbedtls_internal_ecp_init( grp ) ); MBEDTLS_MPI_CHK( mbedtls_internal_ecp_init( grp ) );
#endif /* MBEDTLS_ECP_INTERNAL_ALT */ #endif /* MBEDTLS_ECP_INTERNAL_ALT */
#if defined(MBEDTLS_ECP_RESTARTABLE) && defined(ECP_SHORTWEIERSTRASS) #if defined(MBEDTLS_ECP_RESTARTABLE)
/* skip argument check when restarting */ /* skip argument check when restarting */
if( ecp_get_type( grp ) != ECP_TYPE_SHORT_WEIERSTRASS || if( rs_ctx == NULL || rs_ctx->rsm == NULL )
rs_ctx == NULL || rs_ctx->rsm == NULL )
#endif #endif
{ {
/* check_privkey is free */ /* check_privkey is free */