MACI Utility Circuits
Process Messages Input Hasher
A utility circuit used by the main processMessages
circuit to hash its inputs.
It outputs one field element, which is the SHA256 hash of the following inputs:
packedVals
pollEndTimestamp
msgRoot
coordinatorPubKeyHash
newSbCommitment
currentSbCommitment
Tally Votes Input Hasher
A utility template that generates a sha256 hash of the provided tally inputs.
It outputs one field element, which is the SHA256 hash of the following inputs:
packedVals
sbCommitment
currentTallyCommitment
newTallyCommitment
ResultsCommitmentVerifier
A utility circuit used by the main tallyVotes
circuit to verify that the results commitment is correct.
QuinCheckRoot
Utility circuit that given a quin Merkle root and a list of leaves, check if the root is the correct result of inserting all the leaves into the tree in the given order.
CalculateTotal
Utility circuit used to calculate the sum of an array of elements.
ECDH
Utility circuit used to generate a shared key from a private key and a public key.
Poseidon
Utility circuit used to generate a Poseidon hash. In this case, it supports up to 13 inputs.
MessageToCommand
Utility circuit used to convert a message into a command, this involves decrypting the message.
MessageValidator
Utility circuit used to validate a message. This performs several checks:
stateTreeIndex
is validvoteOptionIndex
is validnonce
is valid- the signature is valid
- the user signed up before poll end timestamp
- the user had enough voice credits
PrivToPubKey
Utility circuit used to generate a public key from a private key.
VerifySignature
Utility circuit used to verify a EdDSA signature
UnpackElement
Utility circuit used to unpack an input element.
QuinSelector
Utility circuit used to select one element from an array of n elements at a given index.
Splicer
Utility circuit used to insert one element in an array at position index
.
QuinBatchLeavesExists
Utility circuit used to check if a batch of leaves exists in a quinary tree.
QuinGeneratePathIndices
Utility circuit used to generate the indices needed to traverse the tree until we find the leaf we are looking for.
ProcessOne
Utility circuit used to process one message.