Skip to main content

vote_commitment_poseidon

Function vote_commitment_poseidon 

Source
pub fn vote_commitment_poseidon(
    poseidon_config: &Pow5Config<Base, 3, 2>,
    layouter: &mut impl Layouter<Base>,
    label: &str,
    domain_vc: AssignedCell<Base, Base>,
    voting_round_id: AssignedCell<Base, Base>,
    shares_hash: AssignedCell<Base, Base>,
    proposal_id: AssignedCell<Base, Base>,
    vote_decision: AssignedCell<Base, Base>,
) -> Result<AssignedCell<Base, Base>, Error>
Expand description

In-circuit vote commitment hash.

Computes Poseidon(domain_vc, voting_round_id, shares_hash, proposal_id, vote_decision) matching the out-of-circuit helper above.

Takes a PoseidonConfig so it can be used by any circuit that configures a compatible Poseidon chip (P128Pow5T3, width 3, rate 2). The domain_vc cell must be assigned via assign_advice_from_constant so the value is baked into the verification key.

Used by ZKP #2 (vote proof, condition 12) and ZKP #3 (share reveal, condition 2).