HasAtLeastOne
pragma circom 2.1.8;
// Create a circuit that takes an array of signals `in[n]` and
// a signal k. The circuit should return 1 if `k` is in the list
// and 0 otherwise. This circuit should work for an arbitrary
// length of `in`.
template HasAtLeastOne(n) {
signal input in[n];
signal input k;
signal output out;
}
component main = HasAtLeastOne(4);TLDR:
if k exists in the array, return 1. else return 0.
Answer
Alternative method 2:
Last updated
Was this helpful?