gkrgates

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2025 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Overview

Package gkrgates contains the registry of GKR gates.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(name gkr.GateName) *gkrtypes.Gate

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 NewGateVerifier(curve ecc.ID) (*gateVerifier, error)

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

func WithCurves(curves ...ecc.ID) registerOption

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 WithName

func WithName(name gkr.GateName) registerOption

WithName can be used to set a human-readable name for the gate.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL