argumentcomputer / bellpepper-gadgets

A library of gadgets compatible with bellpepper and bellperson (contact: @huitseeker)
Apache License 2.0
17 stars 13 forks source link

bellpepper-emulated: Fix and improve constant handling #32

Closed wwared closed 8 months ago

wwared commented 8 months ago

@avras: If there is a reason why assert_is_equal was falling through and continuing with the rest of the function in the constant if case, let me know. Since it was failing later on with "compact_limbs not implemented for constants", I modified it to return Ok(()) before calling assert_limbs_equality and so on.

With this change, calling assert_is_equal with two constant elements will work correctly, and will NOT generate any constraints in the constraint system. I believe this is desirable behavior.