Documentation
¶
Index ¶
- type LinearExpression
- type R1C
- type SolvingMethod
- type Term
- func (t Term) CoeffID() int
- func (t Term) CoeffValue() int
- func (t Term) ConstraintID() int
- func (t Term) ConstraintVisibility() backend.Visibility
- func (t *Term) SetCoeffID(cID int)
- func (t *Term) SetCoeffValue(val int)
- func (t *Term) SetConstraintID(cID int)
- func (t *Term) SetConstraintVisibility(v backend.Visibility)
- func (t Term) Unpack() (coeffValue, coeffID, constraintID int, constraintVisibility backend.Visibility)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LinearExpression ¶
type LinearExpression []Term
LinearExpression represent a linear expression of variables
type R1C ¶
type R1C struct { L LinearExpression R LinearExpression O LinearExpression Solver SolvingMethod }
R1C used to compute the wires
type SolvingMethod ¶
type SolvingMethod uint8
SolvingMethod is used by the R1CS solver note: it is not in backend/r1cs to avoid an import cycle
const ( SingleOutput SolvingMethod = iota BinaryDec )
SingleOuput and BinaryDec are types of solving method for rank-1 constraints
type Term ¶
type Term uint64
Term lightweight version of a term, no pointers first 4 bits are reserved next 30 bits represented the coefficient idx (in r1cs.Coefficients) by which the wire is multiplied next 30 bits represent the constraint used to compute the wire if we support more than 1 billion constraints, this breaks (not so soon.)
func Pack ¶
func Pack(constraintID, coeffID int, constraintVisibility backend.Visibility, coeffValue ...int) Term
Pack packs constraintID, coeffID and coeffValue into Term first 5 bits are reserved to encode visibility of the constraint and coeffValue of the coefficient next 30 bits represented the coefficient idx (in r1cs.Coefficients) by which the wire is multiplied next 29 bits represent the constraint used to compute the wire if we support more than 500 millions constraints, this breaks (not so soon.)
func (Term) CoeffValue ¶
CoeffValue return maxInt if no special value is set if set, returns either -1, 0, 1 or 2
func (Term) ConstraintID ¶
ConstraintID returns the constraintID (see R1CS data structure)
func (Term) ConstraintVisibility ¶
func (t Term) ConstraintVisibility() backend.Visibility
ConstraintVisibility returns encoded backend.Visibility attribute
func (*Term) SetCoeffID ¶
SetCoeffID update the bits correponding to the coeffID with cID
func (*Term) SetCoeffValue ¶
SetCoeffValue update the bits correponding to the coeffValue with its encoding
func (*Term) SetConstraintID ¶
SetConstraintID update the bits correponding to the constraintID with cID
func (*Term) SetConstraintVisibility ¶
func (t *Term) SetConstraintVisibility(v backend.Visibility)
SetConstraintVisibility update the bits correponding to the constraintVisibility with its encoding