Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildCircuit ¶
BuildCircuit - Computes the Out layers - Ensures there is no input used more than once : multi-instances must be explicitly provided as intermediary layers
Types ¶
type Assignment ¶
Assigment for a GKR circuit
func (Assignment) Dump ¶
func (a Assignment) Dump()
InputLayersOf returns the input layers of the layer l
func (Assignment) InputsOfLayer ¶
func (a Assignment) InputsOfLayer(c Circuit, l int) []poly.MultiLin
InputLayersOf returns the input layers of the layer l
type Circuit ¶
type Circuit []Layer
func (Circuit) Assign ¶
func (c Circuit) Assign(inps ...poly.MultiLin) (a Assignment)
Assign computes the full assignment
func (Circuit) InputArity ¶
Returns the input arity of the circuit
func (Circuit) IsInputLayer ¶
IsInputLayer returns true/false if this is an input layer There are multiple ways of checking a layer is an input or output All of them are checked. This helps as a sanity checks : it will panic if any of the checks contradict the others.
type Gate ¶
type Gate interface { // ID returns an ID that is unique for the gate ID() string // GnarkEval performs the same computation as Eval but on Gnark variables GnarkEval(cs frontend.API, xs ...frontend.Variable) frontend.Variable // EvalBatch returns an evaluation for a range of inputs passed in evals // And puts each result in res EvalBatch(res []fr.Element, xs ...[]fr.Element) // Eval returns an evaluation for a unique pair of Eval Eval(res *fr.Element, xs ...*fr.Element) // Degree returns the degrees of the gate relatively to HPrime Degree() (degHPrime int) }
Gate assumes the gate can only have 2 inputs
type Layer ¶
type Layer struct { // Variables indexes that are inputs to compute the current variable // Empty, means this an input layer In []int // Variables indexes that are fed by the current variable // Empty means this is an output layer Out []int // Expresses how to build the variable Gate Gate }
Variable describes a circuit variable