Module zkevm_circuits::circuit_tools::gadgets
source · Expand description
Circuit gadgets
Structs§
- Returns
1
whenlhs == rhs
, and returns0
otherwise. - Returns
1
whenlhs == rhs
, and returns0
otherwise. - Returns
1
whenvalue == 0
, and returns0
otherwise. - Returns
1
whenlhs < rhs
, and returns0
otherwise. lhs and rhs< 256**N_BYTES
N_BYTES
is required to be<= MAX_N_BYTES_INTEGER
to prevent overflow: values are stored in a single field element and two of these are added together. The equation that is enforced islhs - rhs == diff - (lt * range)
. Because all values are<= 256**N_BYTES
andlt
is boolean,lt
can only be1
whenlhs < rhs
.