Lines Matching refs:nblimbs
208 int mbedtls_mpi_grow(mbedtls_mpi *X, size_t nblimbs)
212 if (nblimbs > MBEDTLS_MPI_MAX_LIMBS) {
216 if (X->n < nblimbs) {
217 if ((p = (mbedtls_mpi_uint *) mbedtls_calloc(nblimbs, ciL)) == NULL) {
226 /* nblimbs fits in n because we ensure that MBEDTLS_MPI_MAX_LIMBS
227 * fits, and we've checked that nblimbs <= MBEDTLS_MPI_MAX_LIMBS. */
228 X->n = (unsigned short) nblimbs;
239 int mbedtls_mpi_shrink(mbedtls_mpi *X, size_t nblimbs)
244 if (nblimbs > MBEDTLS_MPI_MAX_LIMBS) {
248 /* Actually resize up if there are currently fewer than nblimbs limbs. */
249 if (X->n <= nblimbs) {
250 return mbedtls_mpi_grow(X, nblimbs);
252 /* After this point, then X->n > nblimbs and in particular X->n > 0. */
261 if (i < nblimbs) {
262 i = nblimbs;
275 * fits, and we've checked that i <= nblimbs <= MBEDTLS_MPI_MAX_LIMBS. */