Implemented ecp_{point,group}_free()

This commit is contained in:
Manuel Pégourié-Gonnard 2012-10-31 19:24:21 +01:00 committed by Paul Bakker
parent d7e4570ad1
commit 1e8c8ecd95

View file

@ -36,6 +36,31 @@
#include "polarssl/ecp.h" #include "polarssl/ecp.h"
/*
* Unallocate (the components of) a point
*/
void ecp_point_free( ecp_point *pt )
{
if( pt == NULL )
return;
mpi_free( &( pt->X ) );
mpi_free( &( pt->Y ) );
}
/*
* Unallocate (the components of) a group
*/
void ecp_group_free( ecp_group *grp )
{
if( grp == NULL )
return;
mpi_free( &( grp->P ) );
mpi_free( &( grp->B ) );
mpi_free( &( grp->N ) );
ecp_point_free( &( grp->G ) );
}
#if defined(POLARSSL_SELF_TEST) #if defined(POLARSSL_SELF_TEST)