chore: stdlib field pre-audit pt.2#14604
Conversation
…ages into si/field-work-1
|
|
||
| if (witness_index == IS_CONSTANT) { | ||
| ASSERT(additive_constant != bb::fr(0), msg); | ||
| if (!this->is_constant()) { |
There was a problem hiding this comment.
any reason not just !is_constant()?
|
|
||
| if (input.size() == 1) { | ||
| return input[0]; //.normalize(); | ||
| return input[0].normalize(); |
There was a problem hiding this comment.
we normalize the output in the general case, so seems logical to do so here
There was a problem hiding this comment.
I like that we're being consistent, i.e., accumulate would always return a normalized output (so you don't have to do it manually when using accumulate. Some instances where you can remove normalize():
…ages into si/field-work-2
| } | ||
| } | ||
|
|
||
| #ifndef NDEBUG |
There was a problem hiding this comment.
EXPECT_DEATH leads to failed to die in most of the presets, e.g. in ./barretenberg/bootstrap.sh test
There was a problem hiding this comment.
(out of curiosity) then how did the CI pass for previous PR?
There was a problem hiding this comment.
In CI it actually captures the ASSERT's correctly, so it passes, but it was somewhat disruptive for me to hit the failed to die when running bootstrap.sh test
* `accumulate()` docs + tests + fix a minor bug * `fix_witness()` docs + test * `is_zero()`: * + use `big_mul` gates instead of `poly` gates --> no need to `normalize()` the witness * + slightly expanded the tests * + docs improved * `==` operator: * + found a bug in the implementation - missing `bool` constraint for the resulting `bool_t` * + now `==` is simply re-using `.is_zero()` * + note: this led to VK changes for various circuits where `==` is used * + expanded test docs by explaining the expected gate counts
accumulate()docs + tests + fix a minor bugfix_witness()docs + testis_zero():big_mulgates instead ofpolygates --> no need tonormalize()the witness==operator:boolconstraint for the resultingbool_t==is simply re-using.is_zero()==is used