aggregator

package
v0.0.0-...-1ed7eb0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2025 License: AGPL-3.0 Imports: 16 Imported by: 0

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

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) Define

func (c AggregatorCircuit) Define(api frontend.API) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL