Documentation ¶
Index ¶
- Variables
- func ChallengeNames(sorted []*Wire, logNbInstances int, prefix string) []string
- func ProofSize(c Circuit, logNbInstances int) int
- func ProveHintPlaceholder(*big.Int, []*big.Int, []*big.Int) error
- func SolveHintPlaceholder(*big.Int, []*big.Int, []*big.Int) error
- func Verify(api frontend.API, c Circuit, assignment WireAssignment, proof Proof, ...) error
- type API
- func (api *API) Add(i1, i2 constraint.GkrVariable, in ...constraint.GkrVariable) constraint.GkrVariable
- func (api *API) Import(assignment []frontend.Variable) (constraint.GkrVariable, error)
- func (api *API) Mul(i1, i2 constraint.GkrVariable, in ...constraint.GkrVariable) constraint.GkrVariable
- func (api *API) NamedGate(gate string, in ...constraint.GkrVariable) constraint.GkrVariable
- func (api *API) Neg(i1 constraint.GkrVariable) constraint.GkrVariable
- func (api *API) Println(a ...constraint.GkrVariable)
- func (api *API) Series(input, output constraint.GkrVariable, inputInstance, outputInstance int) *API
- func (api *API) Solve(parentApi frontend.API) (Solution, error)
- func (api *API) Sub(i1, i2 constraint.GkrVariable, in ...constraint.GkrVariable) constraint.GkrVariable
- type AddGate
- type Circuit
- type Gate
- type IdentityGate
- type MulGate
- type Option
- type Proof
- type Solution
- type Wire
- type WireAssignment
Constants ¶
This section is empty.
Variables ¶
View Source
var Gates = map[string]Gate{ "identity": IdentityGate{}, "add": AddGate{}, "mul": MulGate{}, }
Functions ¶
func ChallengeNames ¶
func ProofSize ¶
ProofSize computes how large the proof for a circuit would be. It needs nbUniqueOutputs to be set
func ProveHintPlaceholder ¶ added in v0.9.0
func SolveHintPlaceholder ¶ added in v0.9.0
Types ¶
type API ¶ added in v0.9.0
type API struct {
// contains filtered or unexported fields
}
func (*API) Add ¶ added in v0.9.0
func (api *API) Add(i1, i2 constraint.GkrVariable, in ...constraint.GkrVariable) constraint.GkrVariable
func (*API) Import ¶ added in v0.9.0
func (api *API) Import(assignment []frontend.Variable) (constraint.GkrVariable, error)
Import creates a new input variable, whose values across all instances are given by assignment. If the value in an instance depends on an output of another instance, leave the corresponding index in assigment nil and use Series to specify the dependency.
func (*API) Mul ¶ added in v0.9.0
func (api *API) Mul(i1, i2 constraint.GkrVariable, in ...constraint.GkrVariable) constraint.GkrVariable
func (*API) NamedGate ¶ added in v0.9.0
func (api *API) NamedGate(gate string, in ...constraint.GkrVariable) constraint.GkrVariable
func (*API) Neg ¶ added in v0.9.0
func (api *API) Neg(i1 constraint.GkrVariable) constraint.GkrVariable
func (*API) Println ¶ added in v0.9.0
func (api *API) Println(a ...constraint.GkrVariable)
TODO @Tabaie This can be useful
func (*API) Series ¶ added in v0.9.0
func (api *API) Series(input, output constraint.GkrVariable, inputInstance, outputInstance int) *API
Series like in an electric circuit, binds an input of an instance to an output of another
func (*API) Solve ¶ added in v0.9.0
Solve finalizes the GKR circuit and returns the output variables in the order created
func (*API) Sub ¶ added in v0.9.0
func (api *API) Sub(i1, i2 constraint.GkrVariable, in ...constraint.GkrVariable) constraint.GkrVariable
type IdentityGate ¶
type IdentityGate struct{}
func (IdentityGate) Degree ¶
func (IdentityGate) Degree() int
type MulGate ¶
type MulGate struct{}
type Proof ¶
type Proof []sumcheck.Proof // for each layer, for each wire, a sumcheck (for each variable, a polynomial)
func DeserializeProof ¶
type Solution ¶ added in v0.9.0
type Solution struct {
// contains filtered or unexported fields
}
type Wire ¶
type WireAssignment ¶
type WireAssignment map[*Wire]polynomial.MultiLin
WireAssignment is assignment of values to the same wire across many instances of the circuit
func (WireAssignment) NumInstances ¶
func (a WireAssignment) NumInstances() int
func (WireAssignment) NumVars ¶
func (a WireAssignment) NumVars() int
Click to show internal directories.
Click to hide internal directories.