diff --git a/src/gadget.tcc b/src/gadget.tcc index 4f59138..b6aaae4 100644 --- a/src/gadget.tcc +++ b/src/gadget.tcc @@ -7,6 +7,7 @@ sodoku_encryption_key::sodoku_encryption_key(protoboard &pb, { assert(seed_key.size() == (256-8)); unsigned int num_key_digests = div_ceil(dimension * dimension * 8, 256); + assert(num_key_digests < 256); // after this it will cycle padding_var.reset(new digest_variable(pb, 256, "padding")); @@ -163,6 +164,8 @@ sodoku_gadget::sodoku_gadget(protoboard &pb, unsigned int n) : { dimension = n * n; + assert(dimension < 256); // any more will overflow the 8 bit storage + const size_t input_size_in_bits = dimension * dimension * 8; { const size_t input_size_in_field_elements = div_ceil(input_size_in_bits, FieldT::capacity());