Documentation
¶
Overview ¶
aggregator package contains the Gnark circuit defiinition that aggregates some votes and proves the validity of the aggregation. The circuit checks every single verification proof generating a single proof for the whole aggregation. It also checks that the number of valid votes and that the hash of the witnesses is the expected.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Artifacts = circuits.NewCircuitArtifacts( &circuits.Artifact{ Name: "aggregator ccs", RemoteURL: config.AggregatorCircuitURL, Hash: types.HexStringToHexBytes(config.AggregatorCircuitHash), }, &circuits.Artifact{ Name: "aggregator proving key", RemoteURL: config.AggregatorProvingKeyURL, Hash: types.HexStringToHexBytes(config.AggregatorProvingKeyHash), }, &circuits.Artifact{ Name: "aggregator verification key", RemoteURL: config.AggregatorVerificationKeyURL, Hash: types.HexStringToHexBytes(config.AggregatorVerificationKeyHash), }, )
Artifacts contains the circuit artifacts for the aggregator circuit, which includes the proving and verification keys.
Functions ¶
This section is empty.
Types ¶
type AggregatorCircuit ¶
type AggregatorCircuit struct { ValidProofs frontend.Variable `gnark:",public"` ProofsInputsHashes [circuits.VotesPerBatch]emulated.Element[sw_bn254.ScalarField] `gnark:",public"` Proofs [circuits.VotesPerBatch]groth16.Proof[sw_bls12377.G1Affine, sw_bls12377.G2Affine] VerificationKey groth16.VerifyingKey[sw_bls12377.G1Affine, sw_bls12377.G2Affine, sw_bls12377.GT] `gnark:"-"` }
func (*AggregatorCircuit) FillWithDummy ¶
func (assignments *AggregatorCircuit) FillWithDummy(mainCCS constraint.ConstraintSystem, mainPk groth16.ProvingKey, innerVk []byte, fromIdx int, ) error
FillWithDummy function fills the assignments provided with a dummy proofs and witnesses compiled for the main constraint.ConstraintSystem provided and the proving key. It generates dummy proofs using the inner verification key provided. It starts to fill from the index provided. Returns an error if something fails.
func (AggregatorCircuit) Prove ¶
func (assignment AggregatorCircuit) Prove() (groth16.Proof, error)
Prove method of AggregatorCircuit instance generates a proof of the validity values of the current assignment. It loads the required circuit artifacts and decodes them to the proper format. It returns the proof or an error.