Branch : - branch - develop v1.2 - tag - 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.10 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.20 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.30 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.40 0.41 semver v0.42.0 v0.43.0-rc0 v1.0 v1.0-rc1 v1.0-rc2 v1.0.0-rc0 v1.0.1 v1.0.1-rc1 v1.0.1-rc2 v1.1.0 v1.1.0-rc1 v1.1.0-rc2 v1.1.0-rc3 v1.1.0-rc4 v1.1.0-rc5 v1.2.0 v1.2.0-rc1 v1.2.0-rc2 v1.2.0-rc3
#include "tommath_private.h" #ifdef BN_MP_SHRINK_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* shrink a bignum */ mp_err mp_shrink(mp_int *a) { mp_digit *tmp; int alloc = MP_MAX(MP_MIN_PREC, a->used); if (a->alloc != alloc) { if ((tmp = (mp_digit *) MP_REALLOC(a->dp, (size_t)a->alloc * sizeof(mp_digit), (size_t)alloc * sizeof(mp_digit))) == NULL) { return MP_MEM; } a->dp = tmp; a->alloc = alloc; } return MP_OKAY; } #endif