smt

package
v0.0.0-...-6972718 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExclusionVerifier

func ExclusionVerifier(api frontend.API, root frontend.Variable, siblings []frontend.Variable, oldKey, oldValue, isOld0, key frontend.Variable)

func ForceEqualIfEnabled

func ForceEqualIfEnabled(api frontend.API, a, b, enabled frontend.Variable)

func Hash1

func Hash1(api frontend.API, key, value frontend.Variable) frontend.Variable

func Hash2

func Hash2(api frontend.API, l, r frontend.Variable) frontend.Variable

func InclusionVerifier

func InclusionVerifier(api frontend.API, root frontend.Variable, siblings []frontend.Variable, key, value frontend.Variable)

func IsEqual

func IsEqual(api frontend.API, a, b frontend.Variable) frontend.Variable

func LevIns

func LevIns(api frontend.API, enabled frontend.Variable, siblings []frontend.Variable) (levIns []frontend.Variable)

func MultiAnd

func MultiAnd(api frontend.API, in []frontend.Variable) frontend.Variable

func Processor

func Processor(api frontend.API, oldRoot frontend.Variable, siblings []frontend.Variable, oldKey, oldValue, isOld0, newKey, newValue, fnc0, fnc1 frontend.Variable) (newRoot frontend.Variable)

func ProcessorLevel

func ProcessorLevel(api frontend.API, stTop, stOld0, stBot, stNew1, stUpd, sibling, old1leaf, new1leaf, newlrbit, oldChild, newChild frontend.Variable) (oldRoot, newRoot frontend.Variable)

func ProcessorSM

func ProcessorSM(api frontend.API, xor, is0, levIns, fnc0, prevTop, prevOld0, prevBot, prevNew1, prevNa, prevUpd frontend.Variable) (stTop, stOld0, stBot, stNew1, stNa, stUpd frontend.Variable)

func Switcher

func Switcher(api frontend.API, sel, l, r frontend.Variable) (frontend.Variable, frontend.Variable)

func Verifier

func Verifier(api frontend.API, enabled, root frontend.Variable, siblings []frontend.Variable, oldKey, oldValue, isOld0, key, value, fnc frontend.Variable)

func VerifierLevel

func VerifierLevel(api frontend.API, stTop, stIOld, stINew, sibling, old1leaf, new1leaf, lrbit, child frontend.Variable) (root frontend.Variable)

func VerifierSM

func VerifierSM(api frontend.API, is0, levIns, fnc, prevTop, prevI0, prevIOld, prevINew, prevNa frontend.Variable) (stTop, stI0, stIOld, stINew, stNa frontend.Variable)

Types

type Assignment

type Assignment struct {
	Fnc0     uint8
	Fnc1     uint8
	OldKey   *big.Int
	NewKey   *big.Int
	IsOld0   uint8
	OldValue *big.Int
	NewValue *big.Int
	OldRoot  *big.Int
	NewRoot  *big.Int
	Siblings []*big.Int
}

type Wrapper

type Wrapper interface {
	Proof(key *big.Int) (Assignment, error)
	ProofWithTx(tx db.Reader, key *big.Int) (Assignment, error)
	SetProof(key, value *big.Int) (Assignment, error)
	Set(key, value *big.Int) (Assignment, error)
	SetWithTx(tx db.WriteTx, key, value *big.Int) (Assignment, error)
}

Wrapper defines methods for wrapping existing SMT implementations, useful for generating circuit assignments for generating proof witnesses. See WrapperArbo for a concrete example that wrappers the arbo.Tree implementation.

func NewWrapperArbo

func NewWrapperArbo(tree *arbo.Tree, database db.Database, levels uint8) Wrapper

type WrapperArbo

type WrapperArbo struct {
	*arbo.Tree
	// contains filtered or unexported fields
}

WrapperArbo wraps an arbo.Tree, generating circuit assignments for certain tree operations like Add and Update.

func (*WrapperArbo) Proof

func (t *WrapperArbo) Proof(key *big.Int) (Assignment, error)

func (*WrapperArbo) ProofWithTx

func (t *WrapperArbo) ProofWithTx(tx db.Reader, key *big.Int) (Assignment, error)

func (*WrapperArbo) Set

func (t *WrapperArbo) Set(key, value *big.Int) (Assignment, error)

func (*WrapperArbo) SetProof

func (t *WrapperArbo) SetProof(key, value *big.Int) (Assignment, error)

func (*WrapperArbo) SetWithTx

func (t *WrapperArbo) SetWithTx(tx db.WriteTx, key, value *big.Int) (Assignment, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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