1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-10-31 21:50:31 +03:00

Add mpi_shrink()

This commit is contained in:
Manuel Pégourié-Gonnard
2013-11-21 10:39:37 +01:00
parent e282012219
commit 5868163e07
4 changed files with 90 additions and 0 deletions

View File

@@ -201,6 +201,17 @@ void mpi_free( mpi *X );
*/
int mpi_grow( mpi *X, size_t nblimbs );
/**
* \brief Resize down, keeping at least the specified number of limbs
*
* \param X MPI to shrink
* \param nblimbs The minimum number of limbs to keep
*
* \return 0 if successful,
* POLARSSL_ERR_MPI_MALLOC_FAILED if memory allocation failed
*/
int mpi_shrink( mpi *X, size_t nblimbs );
/**
* \brief Copy the contents of Y into X
*