Documentation ¶
Index ¶
- type R1CS
- func (r1cs *R1CS) AddTerm(res *fr.Element, t r1c.Term, value fr.Element) *fr.Element
- func (r1cs *R1CS) GetCurveID() gurvy.ID
- func (r1cs *R1CS) GetNbCoefficients() int
- func (r1cs *R1CS) GetNbConstraints() int
- func (r1cs *R1CS) GetNbWires() int
- func (r1cs *R1CS) IsSolved(assignment map[string]interface{}) error
- func (r1cs *R1CS) Solve(assignment map[string]interface{}, a, b, c, wireValues []fr.Element) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type R1CS ¶
type R1CS struct { // Wires NbWires int NbPublicWires int // includes ONE wire NbSecretWires int SecretWires []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) Logs []backend.LogEntry DebugInfo []backend.LogEntry // 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.R1C Coefficients []fr.Element // R1C coefficients indexes point here }
R1CS decsribes a set of R1CS constraint
func (*R1CS) GetCurveID ¶
GetCurveID returns the curveID of this R1CS
func (*R1CS) GetNbCoefficients ¶
GetNbCoefficients return the number of unique coefficients needed in the R1CS
func (*R1CS) GetNbConstraints ¶
GetNbConstraints returns the number of constraints
func (*R1CS) IsSolved ¶
IsSolved returns nil if given assignment solves the R1CS and error otherwise this method wraps r1cs.Solve() and allocates r1cs.Solve() inputs
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]