Shouldn't the output signals be equal or am I missing something?
The documentation does not say anything about different behaviors for the ~-operator regarding constants or signals.
Is this a bug in the compiler?
Additionally, the CPP generator seems to print the log-statements twice on this instance. At least for me the logs appear two times in the console.
Hi Lukas,
thank you for reporting this bug: when bitwise complement operator was applied to a constant, the complement used 256 bits instead of 254. That is why b value was incorrect. We have fixed it here.
Greetings circom devs,
I found an interesting behavior regarding the bit-wise complement operator
~
. The following minimal example has different results for outputa
andb
.I compiled with
circom --wasm --c circuit.circom
on the currently newest versionv2.1.9
. Both witness generators produce following output:Shouldn't the output signals be equal or am I missing something? The documentation does not say anything about different behaviors for the
~
-operator regarding constants or signals. Is this a bug in the compiler?Additionally, the CPP generator seems to print the
log
-statements twice on this instance. At least for me the logs appear two times in the console.