diff options
Diffstat (limited to 'src/lib/math/bigint/bigint.h')
-rw-r--r-- | src/lib/math/bigint/bigint.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/math/bigint/bigint.h b/src/lib/math/bigint/bigint.h index d5bd4ad4f..64ab24e7d 100644 --- a/src/lib/math/bigint/bigint.h +++ b/src/lib/math/bigint/bigint.h @@ -552,7 +552,11 @@ class BOTAN_PUBLIC_API(2,0) BigInt final * Resize the vector to the minimum word size to hold the integer, or * min_size words, whichever is larger */ - void shrink_to_fit(size_t min_size = 0); + void shrink_to_fit(size_t min_size = 0) + { + const size_t words = std::max(min_size, sig_words()); + m_reg.resize(words); + } /** * Fill BigInt with a random number with size of bitsize |