Documentation ¶
Overview ¶
Copyright (C) 2019-2023 David Florness SPDX-License-Identifier: MPL-2.0
Copyright (C) 2019-2023 David Florness SPDX-License-Identifier: MPL-2.0
Copyright (C) 2019-2023 David Florness SPDX-License-Identifier: MPL-2.0
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EvalsCircuitR1CS ¶ added in v0.4.0
func EvalsCircuitR1CS(numVoters int, numCandidates int) (constraint.ConstraintSystem, error)
func LagrangeEvalAtZero ¶ added in v0.4.0
uses https://en.wikipedia.org/wiki/Lagrange_polynomial#Definition but returns the evaluation at zero (the only one we care about)
func SumCircuitR1CS ¶ added in v0.4.0
func SumCircuitR1CS(numVoters int) (constraint.ConstraintSystem, error)
Types ¶
type EvalsCircuit ¶ added in v0.4.0
type EvalsCircuit struct { Inputs []frontend.Variable `gnark:",public"` OutputHashes []frontend.Variable `gnark:",public"` // must be created with length numCandidates^2 BallotBits []frontend.Variable `gnark:",secret"` // must be created with length numVoters - 1 Coeffs []frontend.Variable `gnark:",secret"` Constant frontend.Variable `gnark:",secret"` }
type Poly ¶
type Poly struct { Ballot [][]byte `json:"ballot"` Coeffs []*fr.Element `json:"coeffs"` Inputs []*fr.Element `json:"inputs"` // contains filtered or unexported fields }
func NewRandomPoly ¶
NewRandomPoly generates a random polynomial of degree numVoters-1, using `ballot' as the constant term
Click to show internal directories.
Click to hide internal directories.