Function esp_idf_sys::mbedtls_mpi_shrink

source ยท
pub unsafe extern "C" fn mbedtls_mpi_shrink(
    X: *mut mbedtls_mpi,
    nblimbs: usize,
) -> c_int
Expand description

\brief This function resizes an MPI downwards, keeping at least the specified number of limbs.

            If \c X is smaller than \c nblimbs, it is resized up
            instead.

\param X The MPI to shrink. This must point to an initialized MPI. \param nblimbs The minimum number of limbs to keep.

\return \c 0 if successful. \return #MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed (this can only happen when resizing up). \return Another negative error code on other kinds of failure.