You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
check_membership_if_enabled is very similar to check_membership, except it takes in one more variable enabled:
fncheck_public_set_membership_enabled<F,P>(composer:&mutStandardComposer<F,P>,set:&Vec<F>,member:Variable,enabled:Variable,) -> VariablewhereF:PrimeField,P:TEModelParameters<BaseField = F>,{// Compute all differences between `member` and set elementsletmut diffs = Vec::new();for x in set.iter(){let diff = composer.arithmetic_gate(|gate| {
gate.witness(member, member,None).add(F::zero(),F::one()).pi(-*x)});
diffs.push(diff);}// Accumulate the product of all differencesletmut accumulator = composer.add_witness_to_circuit_description(F::one());for diff in diffs {
accumulator =
composer.arithmetic_gate(|gate| gate.witness(accumulator, diff,None).mul(F::one()));}
accumulator = composer.arithmetic_gate(|gate| gate.witness(accumulator, enabled,None).mul(F::one()));
composer.is_zero_with_output(accumulator)}
The text was updated successfully, but these errors were encountered:
check_membership_if_enabled
is very similar tocheck_membership
, except it takes in one more variableenabled
:The text was updated successfully, but these errors were encountered: