zksecurity / noname

Noname: a programming language to write zkapps
https://zksecurity.github.io/noname/
161 stars 35 forks source link

Support not equal operator in noname #113

Closed vuvoth closed 1 month ago

vuvoth commented 1 month ago

Motivation

We should support not equal operator in noname.

assert(a != b)

Solution

mimoo commented 1 month ago

could be implemented as is_zero(a - b), see for example https://github.com/Consensys/gnark/blob/master/frontend/cs/r1cs/api.go#L535

mimoo commented 1 month ago

we might already have a == b, so checking that a - b == 0 should work