Improve comments in mpi_shrink
This commit is contained in:
parent
3e9f5228c8
commit
27c15c7853
1 changed files with 2 additions and 1 deletions
|
@ -157,9 +157,10 @@ int mbedtls_mpi_shrink( mbedtls_mpi *X, size_t nblimbs )
|
||||||
if( nblimbs > MBEDTLS_MPI_MAX_LIMBS )
|
if( nblimbs > MBEDTLS_MPI_MAX_LIMBS )
|
||||||
return( MBEDTLS_ERR_MPI_ALLOC_FAILED );
|
return( MBEDTLS_ERR_MPI_ALLOC_FAILED );
|
||||||
|
|
||||||
/* Actually resize up in this case */
|
/* Actually resize up if there are currently fewer than nblimbs limbs. */
|
||||||
if( X->n <= nblimbs )
|
if( X->n <= nblimbs )
|
||||||
return( mbedtls_mpi_grow( X, nblimbs ) );
|
return( mbedtls_mpi_grow( X, nblimbs ) );
|
||||||
|
/* Now X->n > nblimbs >= 0. */
|
||||||
|
|
||||||
for( i = X->n - 1; i > 0; i-- )
|
for( i = X->n - 1; i > 0; i-- )
|
||||||
if( X->p[i] != 0 )
|
if( X->p[i] != 0 )
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue