Documentation ¶
Index ¶
- func EvalsCircuitR1CS(hashSeed string, numVoters int, numCandidates int) (frontend.CompiledConstraintSystem, error)
- func HashSeedFromSeedParts(seedParts [][]byte) string
- func LagrangeEvalAtZero(points []Point) *fr.Element
- func SumCircuitR1CS(hashSeed string, numVoters int) (frontend.CompiledConstraintSystem, error)
- type EvalsCircuit
- type Point
- type Poly
- type SumCircuit
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EvalsCircuitR1CS ¶ added in v0.4.0
func HashSeedFromSeedParts ¶ added in v0.4.0
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(hashSeed string, numVoters int) (frontend.CompiledConstraintSystem, error)
Types ¶
type EvalsCircuit ¶ added in v0.4.0
type EvalsCircuit struct { HashSeed string 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"` HashSeed string `json:"hash_seed"` 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.