Added ecp_sub() as a variant of ecp_add()

This commit is contained in:
Manuel Pégourié-Gonnard 2012-11-19 21:23:27 +01:00 committed by Paul Bakker
parent 1c2782cc7c
commit 9674fd0d5e
4 changed files with 132 additions and 8 deletions

View file

@ -200,6 +200,20 @@ int ecp_use_known_dp( ecp_group *grp, size_t index );
int ecp_add( const ecp_group *grp, ecp_point *R,
const ecp_point *P, const 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,
* POLARSSL_ERR_MPI_MALLOC_FAILED if memory allocation failed
*/
int ecp_sub( const ecp_group *grp, ecp_point *R,
const ecp_point *P, const ecp_point *Q );
/**
* \brief Multiplication by an integer: R = m * P
*