🔑Key
<==
: This operator is used to assign a value to a variable or signal. When you use this operator, you're saying "I want the variable on the left side to take on the value (or result of the expression) on the right side." Essentially, you're defining what a particular signal or variable should be.Example:
lowerBound.in[0] <== max_abs_value + in;
This means you're defining or assigning the value of
lowerBound.in[0]
to bemax_abs_value + in
. Here, you're making a definitive statement about whatlowerBound.in[0]
should be in the circuit.
===
: This operator is used to set up an equality constraint. It's like saying "The expressions on both sides of this operator must evaluate to the same value." This is a constraint within the circuit that must be satisfied for the proof to be valid.Example:
lowerBound.out === 0
This means that, whatever other operations or constraints are in the circuit, for the proof to be valid, the signal
lowerBound.out
must equal0
.
In essence:
<==
is directive, telling the circuit "This signal should have this value."===
is conditional, telling the circuit "These two signals or expressions should be equal."
This distinction is key in the construction of zk-SNARK circuits. Proper assignment and correct equality constraints ensure the circuit behaves as expected and produces valid proofs.
<<
:Context in zk/Circom: The left shift operator retains its typical meaning from most programming contexts. In binary representation, it shifts the bits of the number on its left by the number of positions specified on its right.
Example: In the expression
in + (1 << bits)
, the number1
is shifted left bybits
positions, essentially multiplying the number1
by 2 raised to the power ofbits
.
Last updated