Remove ecp_sub()
diff --git a/ChangeLog b/ChangeLog
index a3c4605..28a3ef2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -61,6 +61,7 @@
Removals
* Removed mbedtls_ecp_group_read_string(). Only named groups are supported.
+ * Removed mbedtls_ecp_sub().
* Removed individual mdX_hmac and shaX_hmac functions (use generic
md_hmac functions from md.h)
* Removed the PBKDF2 module (use PKCS5).
diff --git a/include/mbedtls/ecp.h b/include/mbedtls/ecp.h
index 2d33c38..901c23e 100644
--- a/include/mbedtls/ecp.h
+++ b/include/mbedtls/ecp.h
@@ -499,23 +499,6 @@
const mbedtls_ecp_point *P, const mbedtls_ecp_point *Q );
/**
- * \brief Subtraction: R = P - Q
- *
- * \param grp ECP group
- * \param R Destination point
- * \param P Left-hand point
- * \param Q Right-hand point
- *
- * \return 0 if successful,
- * MBEDTLS_ERR_MPI_MALLOC_FAILED if memory allocation failed
- *
- * \note This function does not support Montgomery curves, such as
- * Curve25519.
- */
-int mbedtls_ecp_sub( const mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
- const mbedtls_ecp_point *P, const mbedtls_ecp_point *Q );
-
-/**
* \brief Multiplication by an integer: R = m * P
* (Not thread-safe to use same group in multiple threads)
*
diff --git a/library/ecp.c b/library/ecp.c
index e064c50..f0fcc1f 100644
--- a/library/ecp.c
+++ b/library/ecp.c
@@ -1067,34 +1067,6 @@
}
/*
- * Subtraction: R = P - Q, result's coordinates normalized
- */
-int mbedtls_ecp_sub( const mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
- const mbedtls_ecp_point *P, const mbedtls_ecp_point *Q )
-{
- int ret;
- mbedtls_ecp_point mQ;
-
- mbedtls_ecp_point_init( &mQ );
-
- if( ecp_get_type( grp ) != ECP_TYPE_SHORT_WEIERSTRASS )
- return( MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE );
-
- /* mQ = - Q */
- MBEDTLS_MPI_CHK( mbedtls_ecp_copy( &mQ, Q ) );
- if( mbedtls_mpi_cmp_int( &mQ.Y, 0 ) != 0 )
- MBEDTLS_MPI_CHK( mbedtls_mpi_sub_mpi( &mQ.Y, &grp->P, &mQ.Y ) );
-
- MBEDTLS_MPI_CHK( ecp_add_mixed( grp, R, P, &mQ ) );
- MBEDTLS_MPI_CHK( ecp_normalize_jac( grp, R ) );
-
-cleanup:
- mbedtls_ecp_point_free( &mQ );
-
- return( ret );
-}
-
-/*
* Randomize jacobian coordinates:
* (X, Y, Z) -> (l^2 X, l^3 Y, l Z) for random l
* This is sort of the reverse operation of ecp_normalize_jac().