From 63fefbcc6ea922bdd14909e025ded5322bdb9578 Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Fri, 7 Dec 2018 11:45:48 -0500 Subject: Fix bug and avoid allocations in left shift --- src/lib/math/bigint/bigint.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/lib/math/bigint/bigint.h') diff --git a/src/lib/math/bigint/bigint.h b/src/lib/math/bigint/bigint.h index 31eee4c3c..ade70ba68 100644 --- a/src/lib/math/bigint/bigint.h +++ b/src/lib/math/bigint/bigint.h @@ -591,6 +591,13 @@ class BOTAN_PUBLIC_API(2,0) BigInt final */ size_t bits() const; + /** + * Get the number of high bits unset in the top (allocated) word + * of this integer. Returns BOTAN_MP_WORD_BITS only iff *this is + * zero. Ignores sign. + */ + size_t top_bits_free() const; + /** * Return a mutable pointer to the register * @result a pointer to the start of the internal register -- cgit v1.2.3