mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-06-19 07:17:54 +00:00
Allowed point at infinity, supressed ecp_double()
This commit is contained in:
parent
1e8c8ecd95
commit
5179e463d5
|
@ -38,6 +38,7 @@
|
||||||
*/
|
*/
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
char is_zero; /*!< true if point at infinity */
|
||||||
mpi X; /*!< the point's X coordinate */
|
mpi X; /*!< the point's X coordinate */
|
||||||
mpi Y; /*!< the point's Y coordinate */
|
mpi Y; /*!< the point's Y coordinate */
|
||||||
}
|
}
|
||||||
|
@ -156,18 +157,6 @@ extern "C" {
|
||||||
int ecp_add( const ecp_group *grp, ecp_point *R,
|
int ecp_add( const ecp_group *grp, ecp_point *R,
|
||||||
const ecp_point *P, const ecp_point *Q );
|
const ecp_point *P, const ecp_point *Q );
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Duplication: R = 2 P
|
|
||||||
*
|
|
||||||
* \param grp ECP group
|
|
||||||
* \param R Destination point
|
|
||||||
* \param P Point to double
|
|
||||||
*
|
|
||||||
* \return 0 if successful, or an POLARSSL_ERR_ECP_XXX error code
|
|
||||||
*/
|
|
||||||
int ecp_double( const ecp_group *grp, ecp_point *R,
|
|
||||||
const ecp_point *P );
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Multiplication by an integer: R = m * P
|
* \brief Multiplication by an integer: R = m * P
|
||||||
*
|
*
|
||||||
|
@ -178,7 +167,7 @@ int ecp_double( const ecp_group *grp, ecp_point *R,
|
||||||
*
|
*
|
||||||
* \return 0 if successful, or an POLARSSL_ERR_ECP_XXX error code
|
* \return 0 if successful, or an POLARSSL_ERR_ECP_XXX error code
|
||||||
*/
|
*/
|
||||||
int ecp_multiply( const ecp_group *grp, ecp_point *R,
|
int ecp_mul( const ecp_group *grp, ecp_point *R,
|
||||||
const mpi *m, const ecp_point *P );
|
const mpi *m, const ecp_point *P );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -44,6 +44,7 @@ void ecp_point_free( ecp_point *pt )
|
||||||
if( pt == NULL )
|
if( pt == NULL )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
pt->is_zero = 1;
|
||||||
mpi_free( &( pt->X ) );
|
mpi_free( &( pt->X ) );
|
||||||
mpi_free( &( pt->Y ) );
|
mpi_free( &( pt->Y ) );
|
||||||
}
|
}
|
||||||
|
@ -62,6 +63,8 @@ void ecp_group_free( ecp_group *grp )
|
||||||
ecp_point_free( &( grp->G ) );
|
ecp_point_free( &( grp->G ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(POLARSSL_SELF_TEST)
|
#if defined(POLARSSL_SELF_TEST)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue