Documentation
¶
Index ¶
Constants ¶
const ( SingleOutput solvingMethod = iota BinaryDec )
const MaxOrder = 28
const RootOfUnityStr = "19103219067921713944291392827692070036145651957329286315305642004821462161904"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Domain ¶
type Domain struct { Generator fr.Element GeneratorInv fr.Element GeneratorSqRt fr.Element // generator of 2 adic subgroup of order 2*nb_constraints GeneratorSqRtInv fr.Element Cardinality int CardinalityInv fr.Element }
domain with a power of 2 cardinality compute a field element of order 2x and store it in GeneratorSqRt all other values can be derived from x, GeneratorSqrt
type LinearExpression ¶
type LinearExpression []Term
LinearExpression lightweight version of linear expression
func (LinearExpression) String ¶
func (l LinearExpression) String() string
String helper for LinearExpression
type R1C ¶
type R1C struct { L LinearExpression R LinearExpression O LinearExpression Solver frontend.SolvingMethod }
R1C used to compute the wires (wo pointers)
type R1CS ¶
type R1CS struct { // Wires NbWires int NbPublicWires int // includes ONE wire NbPrivateWires int PrivateWires []string // private wire names, correctly ordered (the i-th entry is the name of the (offset+)i-th wire) PublicWires []string // public wire names, correctly ordered (the i-th entry is the name of the (offset+)i-th wire) WireTags map[int][]string // optional tags -- debug info // Constraints NbConstraints int // total number of constraints NbCOConstraints int // number of constraints that need to be solved, the first of the Constraints slice Constraints []R1C }
R1CS decsribes a set of R1CS constraint
func Cast ¶
Cast casts a frontend.R1CS (whose coefficients are big.Int) into a specialized R1CS whose coefficients are fr elements
func (*R1CS) Inspect ¶
func (r1cs *R1CS) Inspect(solution backend.Assignments, showsInputs bool) (map[string]fr.Element, error)
Inspect returns the tagged variables with their corresponding value If showsInput is set, it also puts in the resulting map the inputs (public and private).
func (*R1CS) Solve ¶
Solve sets all the wires and returns the a, b, c vectors. the r1cs system should have been compiled before. The entries in a, b, c are in Montgomery form. assignment: map[string]value: contains the input variables a, b, c vectors: ab-c = hz wireValues = [intermediateVariables | privateInputs | publicInputs]