Some operations are not supported with Curve25519
diff --git a/library/ecp.c b/library/ecp.c
index fd21dd7..d661c2e 100644
--- a/library/ecp.c
+++ b/library/ecp.c
@@ -946,6 +946,9 @@
{
int ret;
+ if( ecp_is_montgomery( grp ) )
+ return( POLARSSL_ERR_ECP_FEATURE_UNAVAILABLE );
+
MPI_CHK( ecp_add_mixed( grp, R, P, Q ) );
MPI_CHK( ecp_normalize_jac( grp, R ) );
@@ -965,6 +968,9 @@
ecp_point_init( &mQ );
+ if( ecp_is_montgomery( grp ) )
+ return( POLARSSL_ERR_ECP_FEATURE_UNAVAILABLE );
+
/* mQ = - Q */
ecp_copy( &mQ, Q );
if( mpi_cmp_int( &mQ.Y, 0 ) != 0 )