Documentation
¶
Overview ¶
Package gkrgates contains the registry of GKR gates.
Index ¶
- func Get(name gkr.GateName) *gkrtypes.Gate
- func GetDefaultGateName(fn gkr.GateFunction) gkr.GateName
- func NewGateVerifier(curve ecc.ID) (*gateVerifier, error)
- func Register(f gkr.GateFunction, nbIn int, options ...registerOption) error
- func WithCurves(curves ...ecc.ID) registerOption
- func WithDegree(degree int) registerOption
- func WithName(name gkr.GateName) registerOption
- func WithNoSolvableVar() registerOption
- func WithSolvableVar(solvableVar int) registerOption
- func WithUnverifiedDegree(degree int) registerOption
- func WithUnverifiedSolvableVar(solvableVar int) registerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDefaultGateName ¶
func GetDefaultGateName(fn gkr.GateFunction) gkr.GateName
GetDefaultGateName provides a standardized name for a gate function, depending on its package and name. NB: For anonymous functions, the name is the same no matter the implicit arguments provided.
func NewGateVerifier ¶
func Register ¶
func Register(f gkr.GateFunction, nbIn int, options ...registerOption) error
Register creates a gate object and stores it in the gates registry. - name is a human-readable name for the gate. - f is the polynomial function defining the gate. - nbIn is the number of inputs to the gate.
func WithCurves ¶
WithCurves determines which curves the gate is validated on. The default is to validate on BN254. This works for most gates, unless the leading coefficient is divided by the curve's order, in which case the degree will be computed incorrectly.
func WithDegree ¶
func WithDegree(degree int) registerOption
WithDegree sets the degree of the gate. RegisterGate will return an error if the degree is not correct.
func WithNoSolvableVar ¶
func WithNoSolvableVar() registerOption
WithNoSolvableVar sets the gate as having no variable whose value can be uniquely determined from that of the other variables along with the gate's output. RegisterGate will not check the correctness of this claim.
func WithSolvableVar ¶
func WithSolvableVar(solvableVar int) registerOption
WithSolvableVar gives the index of a variable whose value can be uniquely determined from that of the other variables along with the gate's output. RegisterGate will return an error if it cannot verify that this claim is correct.
func WithUnverifiedDegree ¶
func WithUnverifiedDegree(degree int) registerOption
WithUnverifiedDegree sets the degree of the gate. RegisterGate will not verify that the given degree is correct.
func WithUnverifiedSolvableVar ¶
func WithUnverifiedSolvableVar(solvableVar int) registerOption
WithUnverifiedSolvableVar sets the index of a variable whose value can be uniquely determined from that of the other variables along with the gate's output. RegisterGate will not verify that the given index is correct.
Types ¶
This section is empty.