-
I'm trying to assert if a frontend.Variable is part of a list of frontend.Variable, and maintain the list of frontend.Variable secret. So I'm running something like:
Essentially, I want the circuit to fail if the Value in the circuit does not match any of the Permissible_Values, but I want the if statement itself to be a circuit assertion, since Permissible_Values should remain secret. I've looked at api.Select but I'm unsure how I'd use it in this context (or any other context, couldnt find many examples) and Issue #81 seems unresolved. I have looked around for similar discussions and honestly this is a pretty confusing topic! Any help is appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You could use |
Beta Was this translation helpful? Give feedback.
You could use
isDifferent = api.Sub(1, api.IsZero(api.Sub(circuit.Permissible_Values[i], Value)))
and then multiply the results and assert that the product is 1.