board

package
v0.0.0-...-58399a2 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountMultiplicityStep

func CountMultiplicityStep(ins []expr.Expr, outs []string, t trace.Trace, _ *Program, proof *proof.Proof, mu *sync.Mutex, ctx StepContext) error

CountUnionMultiplicityStep computes the running sum M/E where ins[0] = S (values), ins[1] = T (table), ins[2] = Sel (selector)

func CountWeightedMultiplicityStep

func CountWeightedMultiplicityStep(ins []expr.Expr, outs []string, t trace.Trace, _ *Program, proof *proof.Proof, mu *sync.Mutex, ctx StepContext) error

CountWeightedMultiplicityStep computes the running sum M/E where ins: [ selS || S || T]

func ExposeEntriesStep

func ExposeEntriesStep(ins []expr.Expr, outs []string, t trace.Trace, prog *Program, proof *proof.Proof, mu *sync.Mutex, ctx StepContext) error

func ExposeIthValue

func ExposeIthValue(ins []expr.Expr, outs []string, t trace.Trace, pg *Program, proof *proof.Proof, mu *sync.Mutex, ctx StepContext) error

ExposeIthValue adds a constraint Lagrange_pos * (expr - expr[pos]), and stores expr[pos] in the proof so the verifier has access to it

func ExposeRelativeIthValueStep

func ExposeRelativeIthValueStep(ins []expr.Expr, outs []string, t trace.Trace, pg *Program, proof *proof.Proof, mu *sync.Mutex, ctx StepContext) error

ExposeRelativeIthValueStep adds a constraint Lagrange_pos * (expr - expr[pos]), and stores expr[pos] in the proof so the verifier has access to it

func FSStep

func FSStep(ins []expr.Expr, outs []string, t trace.Trace, _ *Program, proof *proof.Proof, mu *sync.Mutex, ctx StepContext) error

func GrandProductStep

func GrandProductStep(ins []expr.Expr, outs []string, t trace.Trace, prog *Program, proof *proof.Proof, mu *sync.Mutex, _ StepContext) error

_GrandProductStep computes the running product N/D where ins[0] = N, ins[1] = D

func LogUpStep

func LogUpStep(ins []expr.Expr, outs []string, t trace.Trace, prog *Program, proof *proof.Proof, mu *sync.Mutex, _ StepContext) error

_LogUpStep computes the running sum M/E where ins[0] = E, ins[1] = M

Types

type Builder

type Builder struct {
	Modules  map[string]*Module
	LogupBus []LogupBus
	Steps    []ProverStep
}

func NewBuilder

func NewBuilder() Builder

func (*Builder) AddCountMultiplicityStep

func (b *Builder) AddCountMultiplicityStep(S, T []expr.Expr, output string)

S ⊂ T, the ouptut is in T's module

func (*Builder) AddCountWeightedMultiplicityStep

func (b *Builder) AddCountWeightedMultiplicityStep(selS, S, T []expr.Expr, output string)

S ⊂ T, the ouptut is in T's module

func (*Builder) AddExposeIthValueStep

func (b *Builder) AddExposeIthValueStep(module string, E expr.Expr, out string, pos int)

AddExposeIthValueStep adds a constraint Lagrange_pos * (expr - expr[pos]), and stores expr[pos] in the proof so the verifier has access to it the 1 entry column expr[pos] is registered in the trace

func (*Builder) AddExposeLastEntryStep

func (b *Builder) AddExposeLastEntryStep(module string, E expr.Expr, out string)

AddExposeLastEntryStep syntactic sugar for AddExposeRelativeIthValueStep(module, E, out, 0)

func (*Builder) AddExposeRelativeIthValueStep

func (b *Builder) AddExposeRelativeIthValueStep(module string, E expr.Expr, out string, pos int)

AddExposeIthValue adds a constraint Lagrange_pos * (expr - expr[pos]), and stores expr[pos] in the proof so the verifier has access to it the 1 entry column expr[pos] is registered in the trace

func (*Builder) AddExposeValuesStep

func (b *Builder) AddExposeValuesStep(module string, E expr.Expr, selector, out string, idx []int)

func (*Builder) AddFiatShamirStep

func (b *Builder) AddFiatShamirStep(E []expr.Expr, out string)

func (*Builder) AddGrandProductStep

func (b *Builder) AddGrandProductStep(module string, N, D expr.Expr, output string)

func (*Builder) AddLogupBus

func (b *Builder) AddLogupBus(cm LogupBus)

func (*Builder) AddLogupStep

func (b *Builder) AddLogupStep(module string, E, M expr.Expr, output string)

AddLogupStep register the action of computing the column interpolating the running sum \Sigma_j<=i M[i]/E[i]

func (*Builder) AddModule

func (b *Builder) AddModule(m Module)

func (*Builder) AssertEqualAt

func (b *Builder) AssertEqualAt(module string, A, B expr.Expr, i int) error

func (*Builder) AssertZero

func (b *Builder) AssertZero(module string, relation expr.Expr) error

type CMCtx

type CMCtx struct {
	NbSources, NbTargets int
}

type CMWCtx

type CMWCtx struct {
	NbSources, NbTargets int
}

type Column

type Column struct {
	Module string
	In     expr.Expr
	Field  field.Kind
}

func (Column) FieldKind

func (c Column) FieldKind() field.Kind

type ColumnRef

type ColumnRef struct {
	Name   string
	Module string
	Field  field.Kind
}

ColumnRef identifies a column by its bare name and the module it belongs to. The module name is needed to recover the column's polynomial size from program.Modules, which is required for multi-degree FRI (commitments are grouped per size).

type CompiledModule

type CompiledModule struct {
	Name              string
	GenCol            []Gen // public columns generator (lagrange, permutation columns, etc)
	N                 int
	VanishingRelation *dag.DAG
	D                 *fft.Domain
}

func (*CompiledModule) NameIthIDSupport

func (m *CompiledModule) NameIthIDSupport(i int) string

NameIthIDSupport returns the name of the i-th chunk of the support of a permutation (common to every permutation within a CompiledModule)

type ExposeEntriesCtx

type ExposeEntriesCtx struct {
	Idx []int // indices of the entries to make public
	N   int
}

type ExposeIthValueCtx

type ExposeIthValueCtx struct {
	Module string
	Pos    int // position of the value to pick in a column
}

type ExposeRelativeIthValueCtx

type ExposeRelativeIthValueCtx struct {
	Module string
	Pos    int // relative position of the value to pick in a column -> the position module.N - 1 - Pos. It allows to refer to N, so N can be modified
}

type ExposedEntry

type ExposedEntry = proof.ExposedEntry

type ExposedValue

type ExposedValue = proof.ExposedValue

type FSCtx

type FSCtx struct{}

type GPCtx

type GPCtx struct{}

type Gen

type Gen interface {
	Gen(t trace.Trace, m *CompiledModule) error
}

type LagrangeGen

type LagrangeGen struct {
	// contains filtered or unexported fields
}

func (LagrangeGen) Gen

type LagrangeRelativeGen

type LagrangeRelativeGen struct {
	// contains filtered or unexported fields
}

func (LagrangeRelativeGen) Gen

type LogUpCtx

type LogUpCtx struct{}

type LogupBus

type LogupBus = proof.LogupBus

func NewLogupBus

func NewLogupBus(positive, negative []string) LogupBus

type Module

type Module struct {
	Name      string
	Relations []Relation
	GenCol    []Gen // public columns generator (lagrange, permutation columns, selectors, etc)
	N         int
}

func NewModule

func NewModule(name string) Module

func (*Module) AssertEqualAt

func (m *Module) AssertEqualAt(A, B expr.Expr, i int)

func (*Module) AssertEqualFirstEntry

func (m *Module) AssertEqualFirstEntry(A, B expr.Expr)

func (*Module) AssertEqualLastEntry

func (m *Module) AssertEqualLastEntry(A, B expr.Expr)

func (*Module) AssertEqualRelativeAt

func (m *Module) AssertEqualRelativeAt(A, B expr.Expr, i int)

asserts that A[m.N-1-i]=B[m.N-1-i]

func (*Module) AssertZero

func (m *Module) AssertZero(relation expr.Expr)

func (*Module) AssertZeroAt

func (m *Module) AssertZeroAt(relation expr.Expr, i ...int)

func (*Module) AssertZeroExceptAt

func (m *Module) AssertZeroExceptAt(relation expr.Expr, i ...int)

func (*Module) AssertZeroExceptLastEntry

func (m *Module) AssertZeroExceptLastEntry(relation expr.Expr)

func (*Module) AssertZeroFirstEntry

func (m *Module) AssertZeroFirstEntry(relation expr.Expr)

func (*Module) AssertZeroLastEntry

func (m *Module) AssertZeroLastEntry(relation expr.Expr)

func (*Module) AssertZeroRelativeAt

func (m *Module) AssertZeroRelativeAt(relation expr.Expr, i ...int)

func (*Module) LagrangeCol

func (m *Module) LagrangeCol(i int) expr.Expr

func (*Module) LagrangeColRelative

func (m *Module) LagrangeColRelative(i int) expr.Expr

func (*Module) NameIthIDSupport

func (m *Module) NameIthIDSupport(i int) string

NameIthIDSupport returns the name of the i-th chunk of the support of a permutation (common to every permutation within a module)

type Output

type Output struct {
	Module  string
	ColName string
}

type PermutationGen

type PermutationGen struct {
	S               []int64
	PermutationName string
}

func NewPermutationGen

func NewPermutationGen(S []int64, permutationName string) PermutationGen

func (PermutationGen) Gen

func (PermutationGen) NameIthPermutationChunk

func (p PermutationGen) NameIthPermutationChunk(i int) string

type Program

type Program struct {
	Modules               map[string]CompiledModule
	SetupColumns          []ColumnRef   // setup columns, precommitted (ex: ql, qr, etc in plonk)
	FScolumnsDependencies [][]ColumnRef // one []ColumnRef per FS round
	ColumnFields          map[string]field.Kind
	LogupBus              []LogupBus
	Steps                 [][]ProverStep
}

Program the double slice [][] means that the steps are scheduled

func Compile

func Compile(b *Builder) (Program, error)

func (*Program) SetSize

func (pg *Program) SetSize(module string, size int)

TODO group modules per size, fold the vanishing relations per modules of the same size -> less calls to ComputeQuotient

type Proof

type Proof = proof.Proof

type ProverStep

type ProverStep struct {
	Ctx  StepContext
	Ins  []expr.Expr
	Outs []string
	Step Step
}

func NewProverStep

func NewProverStep(ins []expr.Expr, outs []string, step Step, ctx StepContext) ProverStep

func (*ProverStep) Execute

func (ps *ProverStep) Execute(trace trace.Trace, prog *Program, proof *proof.Proof, mu *sync.Mutex) error

type RangeColumnGen

type RangeColumnGen struct {
	Bound uint64
}

func (RangeColumnGen) Gen

type Relation

type Relation = expr.Expr

type SelectorGen

type SelectorGen struct {
	Idx  []int
	Name string
}

func (SelectorGen) Gen

type Step

type StepContext

type StepContext any

type Table

type Table struct {
	Module string
	In     []expr.Expr
}

func NewTable

func NewTable(module string, size int) Table

Jump to

Keyboard shortcuts

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