Adapt ecp_group_free() to static constants

This commit is contained in:
Manuel Pégourié-Gonnard 2013-12-06 12:51:50 +01:00
parent 73cc01d7fa
commit 1f82b041e7
3 changed files with 11 additions and 10 deletions

View file

@ -277,18 +277,17 @@ void ecp_group_free( ecp_group *grp )
{
size_t i;
/* FIXME WIP */
if( grp->id != 0 )
return;
if( grp == NULL )
return;
mpi_free( &grp->P );
mpi_free( &grp->A );
mpi_free( &grp->B );
ecp_point_free( &grp->G );
mpi_free( &grp->N );
if( grp->h != 1 )
{
mpi_free( &grp->P );
mpi_free( &grp->A );
mpi_free( &grp->B );
ecp_point_free( &grp->G );
mpi_free( &grp->N );
}
if( grp->T != NULL )
{

View file

@ -485,6 +485,8 @@ static int ecp_group_load( ecp_group *grp,
grp->pbits = mpi_msb( &grp->P );
grp->nbits = mpi_msb( &grp->N );
grp->h = 1;
return( 0 );
}