Missing maximum-bit number checks in constructor
For the following bigfield
constructor, the maximum_bitlength
argument is used to determine how many bits wide the most significant binary limb will be. The case of maximum_bitlength > 4*NUM_LIMB_BITS
is not intended to be supported by the function; we recommend to assert this in the constructor.
template <typename Builder, typename T>
bigfield<Builder, T>::bigfield(const field_t<Builder>& low_bits_in,
const field_t<Builder>& high_bits_in,
const bool can_overflow,
const size_t maximum_bitlength)
{
ASSERT((can_overflow == true && maximum_bitlength == 0) ||
(can_overflow == false && (maximum_bitlength == 0 || maximum_bitlength > (3 * NUM_LIMB_BITS))));
+ ASSERT(maximum_bitlength <= 4*NUM_LIMB_BITS)