kaleido-io / kaleido-iden3-samples

Sample code for using the iden3 protocol to issue verifiable claims
Apache License 2.0
5 stars 4 forks source link

What's the difference between <-- and <== in circom? #15

Closed 1k2222 closed 1 year ago

1k2222 commented 1 year ago

Hi, this is Ling Zhang from Weiming's team. I'm confused about the opeartor <-- and <== in circom.

For example. If I wrote c <== a b, the value of c is always be equal to a b since singals are immutable. In my opinion, add a constraint c === a * b is redundant. So why we should use “<==” ?

Chengxuan commented 1 year ago

@1k2222 Hi Ling, that's a good question. Here is an explanation I found: https://docs.circom.io/circom-language/constraint-generation/ As per my understanding it's useful when a b are variables and avoid assignment mistakes.

Circom has a github repo: https://github.com/iden3/circom, you might be able to find more there.