irwg

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2025 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TVariable reflect.Type

Functions

func GetCircuitVariables

func GetCircuitVariables(assignment frontend.Circuit, field field.Field) ([]constraint.Element, []constraint.Element)

GetCircuitVariables reimplements frontend.NewWitness to support fields that are not present in gnark.

func SerializeRootCircuit

func SerializeRootCircuit(c *RootCircuit) []byte

Types

type Circuit

type Circuit struct {
	Instructions []Instruction
	Constraints  []int
	Outputs      []int
	NumInputs    int
}

type Instruction

type Instruction struct {
	Type        InstructionType
	Inputs      []int
	NumOutputs  int
	ExtraId     uint64
	LinCombCoef []constraint.Element
	Const       constraint.Element
}

type InstructionType

type InstructionType = int
const (
	LinComb InstructionType
	Mul
	Hint
	ConstantLike
	SubCircuitCall
	CustomGate
)

type RootCircuit

type RootCircuit struct {
	NumPublicInputs         int
	ExpectedNumOutputZeroes int
	Circuits                map[uint64]*Circuit
	Field                   field.Field
}

func DeserializeRootCircuit

func DeserializeRootCircuit(buf []byte) *RootCircuit

func (*RootCircuit) Serialize

func (c *RootCircuit) Serialize() []byte

func (*RootCircuit) SolveInput

func (rc *RootCircuit) SolveInput(assignment frontend.Circuit, _ int) (*Witness, error)

SolveInput is the entry point to solve the final input of the given assignment using a specified number of threads.

func (*RootCircuit) SolveInputAuto

func (rc *RootCircuit) SolveInputAuto(assignment frontend.Circuit) (*Witness, error)

func (*RootCircuit) SolveInputs

func (rc *RootCircuit) SolveInputs(assignments []frontend.Circuit) (*Witness, error)

type Witness

type Witness struct {
	NumWitnesses              int
	NumInputsPerWitness       int
	NumPublicInputsPerWitness int
	Field                     *big.Int
	Values                    []*big.Int
}

Witness represents the solved values of the circuit's inputs.

func (*Witness) Serialize

func (w *Witness) Serialize() []byte

Serialize converts the Witness into a byte slice for storage or transmission.

Jump to

Keyboard shortcuts

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